Activity Service Config

From alfrescowiki

Revision as of 17:11, 4 February 2011 by Jan (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


Contents

Summary of Activity Service changes for Alfresco 3.2

  • activity user feed will now return all feed entries by default (including the user's own activities)
  • feed cleaner also supports maxFeedSize (in addition to maxAgeMins) and the properties can be overridden (eg. via custom-repository.properties)
  • local feed generator now makes embedded repo calls by default (rather than remote repo callbacks) (hence repo.remote.endpoint.url is ignored by default)
  • iBatis resources are loaded according to Hibernate dialect class hierarchy (hence custom-activities-feed-context.xml and custom-activities-feed-context.xml are no longer required)

Note: for earlier Alfresco releases (pre-3.2) please refer to Activity Service Config for 3.0 and 3.1

Runtime Configuration

With Alfresco 3.2 onwards, the activity service has been re-factored such that iBatis resources are loaded according to Hibernate dialect class hierarchy.

There is no longer a need to override activities configurations. The following installed files are deprecated and ignored, hence can be removed after upgrading from 3.0/3.1 to 3.2:

  • .../alfresco/extension/custom-activities-SqlMapConfig.xml
  • .../alfresco/extension/custom-activities-feed-context.xml

Custom Properties

The repository endpoint (repo.remote.endpoint.url) property is no longer required (unless the local feed generator is overridden to make remote repo callbacks).

Please note: the feed cleaner now also supports the ability to clean site/user feeds to a maxFeedSize, in addition to maxAgeMins.

The following config applies since Alfresco 3.2 (note: after Labs 3.2 preview):

  • The feed cleaner will, by default, purge generated feed entries that are more than 31 days old (feedCleaner -> maxAgeMins)
  • The feed cleaner will, by default, purge generated feed entries for site/user feeds that contain more than 100 entries (feedCleaner -> maxFeedSize)
  • The post cleaner will, by default, purge processed post entries that are more than 30 minutes old (postCleaner -> maxAgeMins)
  • The activity service will, by default, retrieve up to 100 feeds entries (activityService -> maxFeedItems)

The feed cleaner defaults can now be overridden via custom repository properties, for example:

  ...
  # Activity feed max size and max age (eg. 44640 mins = 31 days)
  activities.feed.max.size=100
  activities.feed.max.age.mins=44640
  ...

You can override custom repository properties, by adding to:

  • .../alfresco/extension/custom-repository.properties

Custom Bean Configuration

Some defaults can be overridden via repository properties (see above). If needed, the post cleaner can also be overridden by adding a alfresco/extension/custom-activities-context.xml file. For example:

   <?xml version='1.0' encoding='UTF-8'?>
   <!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>

   <!-- cleans processed posts - max age can be small, unless required to be kept longer (for debugging) -->
   <bean id="postCleaner" class="org.alfresco.repo.activities.post.cleanup.PostCleaner">
      <property name="postDAO" ref="postDAO"/>
      <property name="maxAgeMins">
         <value>30</value> <!-- 30 minutes -->
      </property>
   </bean>

   <beans>

Custom Scheduled Jobs

The activity service uses a number of scheduled jobs. The parameters to these jobs (such as repeatInterval) can be overridden by adding and/or updating the alfresco/extension/custom-scheduled-action-services-context.xml file. For example:

    <?xml version='1.0' encoding='UTF-8'?>
    <!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>

    <beans>

    <!-- Activities Feed Cleaner -->
    
    <bean id="feedCleanerJobDetail" class="org.springframework.scheduling.quartz.JobDetailBean">
        <property name="jobClass">
            <value>org.alfresco.repo.activities.feed.cleanup.FeedCleanupJob</value>
        </property>
        <property name="jobDataAsMap">
            <map>
                <entry key="feedCleaner">
                    <ref bean="feedCleaner" />
                </entry>
            </map>
        </property>
    </bean>
    <bean id="feedCleanerTrigger" class="org.alfresco.util.TriggerBean">
        <property name="jobDetail">
            <ref bean="feedCleanerJobDetail" />
        </property>
        <property name="scheduler">
            <ref bean="schedulerFactory" />
        </property>
        <property name="startDelayMinutes">
            <value>5</value>
        </property>
        <property name="repeatIntervalMinutes">
            <value>10</value>
        </property>
    </bean>

    <!-- Activities Feed Generator -->
    
    <bean id="feedGeneratorJobDetail" class="org.springframework.scheduling.quartz.JobDetailBean">
        <property name="jobClass">
            <value>org.alfresco.repo.activities.feed.FeedGeneratorJob</value>
        </property>
        <property name="jobDataAsMap">
            <map>
                <entry key="feedGenerator">
                    <ref bean="feedGenerator" />
                </entry>
            </map>
        </property>
    </bean>
    <bean id="feedGeneratorTrigger" class="org.alfresco.util.TriggerBean">
        <property name="jobDetail">
            <ref bean="feedGeneratorJobDetail" />
        </property>
        <property name="scheduler">
            <ref bean="schedulerFactory" />
        </property>
        <property name="startDelayMinutes">
            <value>0</value>
        </property>
        <property name="repeatInterval">
            <value>30000</value> <!-- 30000 msecs = 30 seconds -->
        </property>
    </bean>
    
    <!-- Activities Post Lookup (for secondary lookup) -->
    
    <bean id="postLookupJobDetail" class="org.springframework.scheduling.quartz.JobDetailBean">
        <property name="jobClass">
            <value>org.alfresco.repo.activities.post.lookup.PostLookupJob</value>
        </property>
        <property name="jobDataAsMap">
            <map>
                <entry key="postLookup">
                    <ref bean="postLookup" />
                </entry>
            </map>
        </property>
    </bean>
    <bean id="postLookupTrigger" class="org.alfresco.util.TriggerBean">
        <property name="jobDetail">
            <ref bean="postLookupJobDetail" />
        </property>
        <property name="scheduler">
            <ref bean="schedulerFactory" />
        </property>
        <property name="startDelayMinutes">
            <value>1</value>
        </property>
        <property name="repeatInterval">
            <value>15000</value> <!-- 15000 msecs = 15 seconds -->
        </property>
    </bean>
    
    <!-- Activities Post Cleaner -->
    
    <bean id="postCleanerJobDetail" class="org.springframework.scheduling.quartz.JobDetailBean">
        <property name="jobClass">
            <value>org.alfresco.repo.activities.post.cleanup.PostCleanupJob</value>
        </property>
        <property name="jobDataAsMap">
            <map>
                <entry key="postCleaner">
                    <ref bean="postCleaner" />
                </entry>
            </map>
        </property>
    </bean>
    <bean id="postCleanerTrigger" class="org.alfresco.util.TriggerBean">
        <property name="jobDetail">
            <ref bean="postCleanerJobDetail" />
        </property>
        <property name="scheduler">
            <ref bean="schedulerFactory" />
        </property>
        <property name="startDelayMinutes">
            <value>10</value>
        </property>
        <property name="repeatIntervalMinutes">
            <value>10</value>
        </property>
    </bean>

    <beans>
Personal tools
Download and go
© 2014 Alfresco Software, Inc. All Rights Reserved. Legal | Privacy | Accessibility