Activity Service Config for 3.0 and 3.1

Document created by resplin Employee on Jun 6, 2015
Version 1Show Document
  • View in full screen mode

Obsolete Pages{{Obsolete}}

The official documentation is at: http://docs.alfresco.com



InstallationConfiguration3.03.1Activities Service


Config changes for 3.0 Activity Service


For Alfresco 3.2, refer to Activity Service Config


Bootstrap


The bootstrap should pick-up the hibernate dialect (via the bootstrap config) so the 3 activity tables (and other objects, such indexes etc) should be automatically created in your chosen database:


  • alf_activity_post
  • alf_activity_feed
  • alf_activity_feed_controls

Runtime Configuration


If not already done so for your installation, verify and/or override the following configuration options:


Custom SQL Map Config


Although the Activity Service currently uses iBatis rather than Hibernate, it does use the hibernate dialect property to indicate the configured DB dialect.

Ensure that sqlMapConfig points to the correct hibernate dialect. For example, assuming you already use:


  • .../alfresco/extension/custom-hibernate-dialect.properties

then:


  • copy .../alfresco/extension/custom-activities-SqlMapConfig.xml.sample to .../alfresco/extension/custom-activities-SqlMapConfig.xml
  ...
  <bean id='sqlMapClient' class='org.springframework.orm.ibatis.SqlMapClientFactoryBean' singleton='true'>
     <property name='configLocation'><value>classpath:alfresco/extension/custom-activities-SqlMapConfig.xml</value></property>
     <property name='dataSource' ref='iBatisDataSource'/>
  </bean>
  ...

and:


  • copy .../alfresco/extension/custom-activities-feed-context.xml.sample to .../alfresco/extension/custom-activities-feed-context.xml
  ...
  <properties resource='alfresco/extension/custom-hibernate-dialect.properties' />
  ...

or

  ...
  <properties url='file:C:\workspaces\V3.0\hibernate-cfg.properties' />
  ...

Custom Properties


Ensure that the repository endpoint is correct for your installation, by default:

  ...
  # Repository endpoint - used by Activity Service
  repo.remote.endpoint.url=http://localhost:8080/alfresco/service
  ...

The default should be sufficient for the in-process activity service. You can override, by adding to:


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

Custom Bean Configuration


The following settings are system-wide.


  • The feed cleaner will, by default, purge generated feed entries that are more than 31 days old (feedCleaner -> maxAgeMins)
  • 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)

These defaults can be overridden by adding a alfresco/extension/custom-activities-context.xml file. For example:



   <beans>

   <bean id='activityService' class='org.alfresco.repo.activities.ActivityServiceImpl'>
      <property name='postDaoService' ref='postDaoService'/>
      <property name='feedDaoService' ref='feedDaoService'/>
      <property name='feedControlDaoService' ref='feedControlDaoService'/>
      <property name='authorityService' ref='AuthorityService'/>
      <property name='userNamesAreCaseSensitive' value='${user.name.caseSensitive}'/>
      <property name='feedGenerator' ref='feedGenerator'/>
      <property name='maxFeedItems' value='100'/>
   </bean>

   <bean id='feedCleaner' class='org.alfresco.repo.activities.feed.cleanup.FeedCleaner'>
      <property name='feedDaoService' ref='feedDaoService'/>
      <property name='maxAgeMins'>
         <value>44640</value>
      </property>
   </bean>
  
   <bean id='postCleaner' class='org.alfresco.repo.activities.post.cleanup.PostCleaner'>
      <property name='postDaoService' ref='postDaoService'/>
      <property name='maxAgeMins'>
         <value>30</value>
      </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:



    <beans>

   
    <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>

   
    <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>
        </property>
    </bean>
   
   
    <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>
        </property>
    </bean>
   
   
    <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>

Attachments

    Outcomes