mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
First-cut Activity Service (SLNG-20)
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@9128 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
19
config/alfresco/activities/activities-SqlMapConfig.xml
Normal file
19
config/alfresco/activities/activities-SqlMapConfig.xml
Normal file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<!DOCTYPE sqlMapConfig
|
||||
PUBLIC "-//ibatis.apache.org//DTD SQL Map Config 2.0//EN"
|
||||
"http://ibatis.apache.org/dtd/sql-map-config-2.dtd">
|
||||
|
||||
<sqlMapConfig>
|
||||
|
||||
<!-- NOTE: although we use iBatis here rather than Hibernate, for consistency we make use of single SQL dialect property (hibernate.dialect) for consistency -->
|
||||
<properties resource="alfresco/domain/hibernate-cfg.properties" />
|
||||
|
||||
<!-- SQL Map XML files loaded from the classpath -->
|
||||
|
||||
<!-- note: dialect property is set in properties resource above -->
|
||||
<sqlMap resource="alfresco/activities/${hibernate.dialect}/ActivityPost.xml"/>
|
||||
<sqlMap resource="alfresco/activities/${hibernate.dialect}/ActivityFeed.xml"/>
|
||||
<sqlMap resource="alfresco/activities/${hibernate.dialect}/ActivityFeedControl.xml"/>
|
||||
|
||||
</sqlMapConfig>
|
86
config/alfresco/activities/activities-feed-context.xml
Normal file
86
config/alfresco/activities/activities-feed-context.xml
Normal file
@@ -0,0 +1,86 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
|
||||
|
||||
<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="iBatisDataSource" parent="dataSource">
|
||||
<property name="defaultAutoCommit" >
|
||||
<value>true</value>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean" singleton="true">
|
||||
<property name="configLocation"><value>classpath:alfresco/activities/activities-SqlMapConfig.xml</value></property>
|
||||
<property name="dataSource" ref="iBatisDataSource"/>
|
||||
</bean>
|
||||
|
||||
<bean id="postDaoService" class="org.alfresco.repo.activities.ibatis.IBatisActivityPostDaoServiceImpl">
|
||||
<property name="sqlMapClient" ref="sqlMapClient"/>
|
||||
</bean>
|
||||
|
||||
<bean id="feedDaoService" class="org.alfresco.repo.activities.ibatis.IBatisActivityFeedDaoServiceImpl">
|
||||
<property name="sqlMapClient" ref="sqlMapClient"/>
|
||||
</bean>
|
||||
|
||||
<bean id="feedControlDaoService" class="org.alfresco.repo.activities.ibatis.IBatisFeedControlDaoServiceImpl">
|
||||
<property name="sqlMapClient" ref="sqlMapClient"/>
|
||||
</bean>
|
||||
|
||||
<!-- cleans out-of-date feed entries -->
|
||||
<bean id="feedCleaner" class="org.alfresco.repo.activities.feed.cleanup.FeedCleaner">
|
||||
<property name="feedDaoService" ref="feedDaoService"/>
|
||||
<property name="maxAgeMins">
|
||||
<value>20160</value> <!-- 20160 mins = 2 weeks -->
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<!-- 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="postDaoService" ref="postDaoService"/>
|
||||
<property name="maxAgeMins">
|
||||
<value>30</value> <!-- 30 minutes -->
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<!-- secondary lookup for pending posts -->
|
||||
<bean id="postLookup" class="org.alfresco.repo.activities.post.lookup.PostLookup">
|
||||
<property name="postDaoService" ref="postDaoService"/>
|
||||
<property name="nodeService" ref="NodeService"/>
|
||||
<property name="permissionService" ref="PermissionService"/>
|
||||
<property name="transactionService" ref="transactionService"/>
|
||||
<property name="personService" ref="personService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="baseFeedGenerator" class="org.alfresco.repo.activities.feed.AbstractFeedGenerator" abstract="true" init-method="init">
|
||||
<property name="postDaoService" ref="postDaoService"/>
|
||||
<property name="authenticationService" ref="AuthenticationService"/>
|
||||
<property name="repoEndPoint" value="${repo.remote.endpoint.url}"/>
|
||||
<property name="maxItemsPerCycle" value="100"/>
|
||||
</bean>
|
||||
|
||||
|
||||
<!-- Local (non-grid-based) Feed Generator -->
|
||||
|
||||
<bean id="feedGenerator" class="org.alfresco.repo.activities.feed.local.LocalFeedGenerator" parent="baseFeedGenerator">
|
||||
<property name="feedTaskProcessor" ref="feedTaskProcessor"/>
|
||||
</bean>
|
||||
|
||||
<bean id="feedTaskProcessor" class="org.alfresco.repo.activities.feed.local.LocalFeedTaskProcessor">
|
||||
<!-- NOTE: assumes same sqlMapClient is also configured for postDaoService and feedDaoService -->
|
||||
<property name="sqlMapClient" ref="sqlMapClient"/>
|
||||
<property name="postDaoService" ref="postDaoService"/>
|
||||
<property name="feedDaoService" ref="feedDaoService"/>
|
||||
<property name="feedControlDaoService" ref="feedControlDaoService"/>
|
||||
</bean>
|
||||
|
||||
</beans>
|
@@ -0,0 +1,84 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<!DOCTYPE sqlMap
|
||||
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
|
||||
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
|
||||
|
||||
<sqlMap namespace="ActivityFeed">
|
||||
|
||||
<typeAlias alias="ActivityFeed" type="org.alfresco.repo.activities.feed.ActivityFeedDAO"/>
|
||||
|
||||
<resultMap id="ActivityFeedResult" class="ActivityFeed">
|
||||
<result property="id" column="ID"/>
|
||||
<result property="feedUserId" column="FEED_USER_ID"/>
|
||||
<result property="postUserId" column="POST_USER_ID"/>
|
||||
<result property="postDate" column="POST_DATE"/>
|
||||
<result property="postId" column="POST_ID"/> <!-- not an explicit FK constraint, can dangle if and when activity post is deleted -->
|
||||
<result property="siteNetwork" column="SITE_NETWORK"/>
|
||||
<result property="activityType" column="ACTIVITY_TYPE"/>
|
||||
<result property="activitySummary" column="ACTIVITY_SUMMARY"/>
|
||||
<result property="activitySummaryFormat" column="ACTIVITY_FORMAT"/>
|
||||
<result property="feedDate" column="FEED_DATE"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="select.activity.feed.for.feeduser" parameterClass="ActivityFeed" resultClass="ActivityFeed">
|
||||
<![CDATA[
|
||||
select id as id, activity_format as activitySummaryFormat, activity_summary as activitySummary, feed_user_id as feedUserId, post_user_id as postUserId, site_network as siteNetwork, post_date postDate
|
||||
from alf_activity_feed
|
||||
where feed_user_id = #feedUserId#
|
||||
and post_user_id != #feedUserId#
|
||||
and activity_format = #activitySummaryFormat#
|
||||
order by post_date desc
|
||||
]]>
|
||||
</select>
|
||||
|
||||
<select id="select.activity.feedcontrol" parameterClass="FeedControl" resultClass="long">
|
||||
<![CDATA[
|
||||
select id as id
|
||||
from alf_activity_feed_control
|
||||
where feed_user_id = #feedUserId#
|
||||
and site_network = #siteNetwork#
|
||||
and app_tool = #appTool#
|
||||
]]>
|
||||
</select>
|
||||
|
||||
<select id="select.activity.feed.for.feeduser.and.site" parameterClass="ActivityFeed" resultClass="ActivityFeed">
|
||||
<![CDATA[
|
||||
select id as id, activity_format as activitySummaryFormat, activity_summary as activitySummary, feed_user_id as feedUserId, post_user_id as postUserId, site_network as siteNetwork, post_date postDate
|
||||
from alf_activity_feed
|
||||
where feed_user_id = #feedUserId#
|
||||
and post_user_id != #feedUserId#
|
||||
and site_network = #siteNetwork#
|
||||
and activity_format = #activitySummaryFormat#
|
||||
order by post_date desc
|
||||
]]>
|
||||
</select>
|
||||
|
||||
<select id="select.activity.feed.for.site" parameterClass="ActivityFeed" resultClass="ActivityFeed">
|
||||
<![CDATA[
|
||||
select id as id, activity_format as activitySummaryFormat, activity_summary as activitySummary, feed_user_id as feedUserId, post_user_id as postUserId, site_network as siteNetwork, post_date postDate
|
||||
from alf_activity_feed
|
||||
where feed_user_id = ''
|
||||
and site_network = #siteNetwork#
|
||||
and activity_format = #activitySummaryFormat#
|
||||
order by post_date desc
|
||||
]]>
|
||||
</select>
|
||||
|
||||
<insert id="insert.activity.feed" parameterClass="ActivityFeed">
|
||||
insert into alf_activity_feed (activity_type, activity_summary, activity_format, feed_user_id, post_user_id, post_date, post_id, site_network, app_tool, feed_date)
|
||||
values (#activityType#, #activitySummary#, #activitySummaryFormat#, #feedUserId#, #postUserId#, #postDate#, #postId#, #siteNetwork#, #appTool#, #feedDate#)
|
||||
|
||||
<!-- optionally return auto-generated primary key - only required for debug (can be commented out) -->
|
||||
<selectKey resultClass="long" keyProperty="id" type="post">
|
||||
CALL IDENTITY()
|
||||
</selectKey>
|
||||
</insert>
|
||||
|
||||
<delete id="delete.activity.feed.entries.older.than.date" parameterClass="Date">
|
||||
<![CDATA[
|
||||
delete from alf_activity_feed where post_date < #keepdate#
|
||||
]]>
|
||||
</delete>
|
||||
|
||||
</sqlMap>
|
@@ -0,0 +1,46 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<!DOCTYPE sqlMap
|
||||
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
|
||||
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
|
||||
|
||||
<sqlMap namespace="ActivityFeedControl">
|
||||
|
||||
<typeAlias alias="FeedControl" type="org.alfresco.repo.activities.feed.control.FeedControlDAO"/>
|
||||
|
||||
<resultMap id="FeedControlResult" class="FeedControl">
|
||||
<result property="id" column="ID"/>
|
||||
<result property="feedUserId" column="FEED_USER_ID"/>
|
||||
<result property="siteNetwork" column="SITE_NETWORK"/>
|
||||
<result property="appTool" column="APP_TOOL"/>
|
||||
<result property="lastModified" column="LAST_MODIFIED"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="select.activity.feedcontrols.for.user" parameterClass="FeedControl" resultClass="FeedControl">
|
||||
<![CDATA[
|
||||
select id as id, feed_user_id as feedUserId, site_network as siteNetwork, app_tool as appTool
|
||||
from alf_activity_feed_control
|
||||
where feed_user_id = #feedUserId#
|
||||
]]>
|
||||
</select>
|
||||
|
||||
<insert id="insert.activity.feedcontrol" parameterClass="FeedControl">
|
||||
insert into alf_activity_feed_control (feed_user_id, site_network, app_tool, last_modified)
|
||||
values (#feedUserId#, #siteNetwork#, #appTool#, #lastModified#)
|
||||
|
||||
<!-- optionally return auto-generated primary key - only required for debug (can be commented out) -->
|
||||
<selectKey resultClass="long" keyProperty="id" type="post">
|
||||
CALL IDENTITY()
|
||||
</selectKey>
|
||||
</insert>
|
||||
|
||||
<delete id="delete.activity.feedcontrol" parameterClass="FeedControl">
|
||||
<![CDATA[
|
||||
delete from alf_activity_feed_control
|
||||
where feed_user_id = #feedUserId#
|
||||
and site_network = #siteNetwork#
|
||||
and app_tool = #appTool#
|
||||
]]>
|
||||
</delete>
|
||||
|
||||
</sqlMap>
|
114
config/alfresco/activities/org.hibernate.dialect.HSQLDialect/ActivityPost.xml
Executable file
114
config/alfresco/activities/org.hibernate.dialect.HSQLDialect/ActivityPost.xml
Executable file
@@ -0,0 +1,114 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<!DOCTYPE sqlMap
|
||||
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
|
||||
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
|
||||
|
||||
<sqlMap namespace="ActivityPost">
|
||||
|
||||
<typeAlias alias="ActivityPost" type="org.alfresco.repo.activities.post.ActivityPostDAO"/>
|
||||
|
||||
<resultMap id="ActivityPostResult" class="ActivityPost">
|
||||
<result property="id" column="SEQUENCE_ID"/>
|
||||
<result property="activityData" column="ACTIVITY_DATA"/>
|
||||
<result property="activityType" column="ACTIVITY_TYPE"/>
|
||||
<result property="userId" column="POST_USER_ID"/>
|
||||
<result property="postDate" column="POST_DATE"/>
|
||||
<result property="jobTaskNode" column="JOB_TASK_NODE"/>
|
||||
<result property="siteNetwork" column="SITE_NETWORK"/>
|
||||
<result property="appTool" column="APP_TOOL"/>
|
||||
<result property="status" column="STATUS"/>
|
||||
<result property="lastModified" column="LAST_MODIFIED"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="select.activity.posts" parameterClass="ActivityPost" resultClass="ActivityPost">
|
||||
<![CDATA[
|
||||
select
|
||||
sequence_id as id,
|
||||
activity_data as activityData,
|
||||
activity_type as activityType,
|
||||
post_user_id as userId,
|
||||
post_date as postDate,
|
||||
job_task_node as jobTaskNode,
|
||||
site_network as siteNetwork,
|
||||
app_tool as appTool,
|
||||
status as status
|
||||
from
|
||||
alf_activity_post
|
||||
where
|
||||
job_task_node = #jobTaskNode# and
|
||||
sequence_id >= #minId# and
|
||||
sequence_id <= #maxId# and
|
||||
status = #status#
|
||||
]]>
|
||||
</select>
|
||||
|
||||
<select id="select.activity.posts.by.status.only" parameterClass="ActivityPost" resultClass="ActivityPost">
|
||||
<![CDATA[
|
||||
select
|
||||
sequence_id as id,
|
||||
activity_data as activityData,
|
||||
activity_type as activityType,
|
||||
post_user_id as userId,
|
||||
post_date as postDate,
|
||||
job_task_node as jobTaskNode,
|
||||
site_network as siteNetwork,
|
||||
app_tool as appTool,
|
||||
status as status
|
||||
from
|
||||
alf_activity_post
|
||||
where
|
||||
status = #status#
|
||||
]]>
|
||||
</select>
|
||||
|
||||
<select id="select.activity.post.max.seq" resultClass="long">
|
||||
select max(sequence_id) as maxId
|
||||
from alf_activity_post
|
||||
where status = 'POSTED'
|
||||
</select>
|
||||
|
||||
<select id="select.activity.post.min.seq" resultClass="long">
|
||||
select min(sequence_id) as minId
|
||||
from alf_activity_post
|
||||
where status = 'POSTED'
|
||||
</select>
|
||||
|
||||
<select id="select.activity.post.max.jobtasknode" resultClass="int">
|
||||
select max(job_task_node) as maxJobTaskNode
|
||||
from alf_activity_post
|
||||
where status = 'POSTED'
|
||||
</select>
|
||||
|
||||
<insert id="insert.activity.post" parameterClass="ActivityPost">
|
||||
insert into alf_activity_post (status, activity_data, post_user_id, post_date, activity_type, site_network, app_tool, job_task_node, last_modified)
|
||||
values (#status#, #activityData#, #userId#, #postDate#, #activityType#, #siteNetwork#, #appTool#, #jobTaskNode#, #lastModified#)
|
||||
|
||||
<!-- optionally return auto-generated primary key - only required for debug (can be commented out) -->
|
||||
<selectKey resultClass="long" keyProperty="id" type="post">
|
||||
CALL IDENTITY()
|
||||
</selectKey>
|
||||
|
||||
</insert>
|
||||
|
||||
<delete id="delete.activity.posts.older.than.date" parameterClass="ActivityPost">
|
||||
<![CDATA[
|
||||
delete from alf_activity_post
|
||||
where post_date < #postDate#
|
||||
and status = #status#
|
||||
]]>
|
||||
</delete>
|
||||
|
||||
<update id="update.activity.post.data" parameterClass="ActivityPost">
|
||||
update alf_activity_post set status = #status#, activity_data=#activityData#, site_network=#siteNetwork#, last_modified=#lastModified#
|
||||
where sequence_id = #id#
|
||||
and status != #status#
|
||||
</update>
|
||||
|
||||
<update id="update.activity.post.status" parameterClass="ActivityPost">
|
||||
update alf_activity_post set status = #status#, last_modified=#lastModified#
|
||||
where sequence_id = #id#
|
||||
and status != #status#
|
||||
</update>
|
||||
|
||||
</sqlMap>
|
@@ -0,0 +1,74 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<!DOCTYPE sqlMap
|
||||
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
|
||||
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
|
||||
|
||||
<sqlMap namespace="ActivityFeed">
|
||||
|
||||
<typeAlias alias="ActivityFeed" type="org.alfresco.repo.activities.feed.ActivityFeedDAO"/>
|
||||
|
||||
<resultMap id="ActivityFeedResult" class="ActivityFeed">
|
||||
<result property="id" column="ID"/>
|
||||
<result property="feedUserId" column="FEED_USER_ID"/>
|
||||
<result property="postUserId" column="POST_USER_ID"/>
|
||||
<result property="postDate" column="POST_DATE"/>
|
||||
<result property="postId" column="POST_ID"/> <!-- not an explicit FK constraint, can dangle if and when activity post is deleted -->
|
||||
<result property="siteNetwork" column="SITE_NETWORK"/>
|
||||
<result property="activityType" column="ACTIVITY_TYPE"/>
|
||||
<result property="activitySummary" column="ACTIVITY_SUMMARY"/>
|
||||
<result property="activitySummaryFormat" column="ACTIVITY_FORMAT"/>
|
||||
<result property="feedDate" column="FEED_DATE"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="select.activity.feed.for.feeduser" parameterClass="ActivityFeed" resultClass="ActivityFeed">
|
||||
<![CDATA[
|
||||
select id as id, activity_format as activitySummaryFormat, activity_summary as activitySummary, feed_user_id as feedUserId, post_user_id as postUserId, site_network as siteNetwork, post_date postDate
|
||||
from alf_activity_feed
|
||||
where feed_user_id = #feedUserId#
|
||||
and post_user_id != #feedUserId#
|
||||
and activity_format = #activitySummaryFormat#
|
||||
order by post_date desc
|
||||
]]>
|
||||
</select>
|
||||
|
||||
<select id="select.activity.feed.for.feeduser.and.site" parameterClass="ActivityFeed" resultClass="ActivityFeed">
|
||||
<![CDATA[
|
||||
select id as id, activity_format as activitySummaryFormat, activity_summary as activitySummary, feed_user_id as feedUserId, post_user_id as postUserId, site_network as siteNetwork, post_date postDate
|
||||
from alf_activity_feed
|
||||
where feed_user_id = #feedUserId#
|
||||
and post_user_id != #feedUserId#
|
||||
and site_network = #siteNetwork#
|
||||
and activity_format = #activitySummaryFormat#
|
||||
order by post_date desc
|
||||
]]>
|
||||
</select>
|
||||
|
||||
<select id="select.activity.feed.for.site" parameterClass="ActivityFeed" resultClass="ActivityFeed">
|
||||
<![CDATA[
|
||||
select id as id, activity_format as activitySummaryFormat, activity_summary as activitySummary, feed_user_id as feedUserId, post_user_id as postUserId, site_network as siteNetwork, post_date postDate
|
||||
from alf_activity_feed
|
||||
where feed_user_id = ''
|
||||
and site_network = #siteNetwork#
|
||||
and activity_format = #activitySummaryFormat#
|
||||
order by post_date desc
|
||||
]]>
|
||||
</select>
|
||||
|
||||
<insert id="insert.activity.feed" parameterClass="ActivityFeed">
|
||||
insert into alf_activity_feed (activity_type, activity_summary, activity_format, feed_user_id, post_user_id, post_date, post_id, site_network, app_tool, feed_date)
|
||||
values (#activityType#, #activitySummary#, #activitySummaryFormat#, #feedUserId#, #postUserId#, #postDate#, #postId#, #siteNetwork#, #appTool#, #feedDate#)
|
||||
|
||||
<!-- optionally return auto-generated primary key - only required for debug (can be commented out) -->
|
||||
<selectKey resultClass="long" keyProperty="id" type="post">
|
||||
SELECT LAST_INSERT_ID() AS value
|
||||
</selectKey>
|
||||
</insert>
|
||||
|
||||
<delete id="delete.activity.feed.entries.older.than.date" parameterClass="Date">
|
||||
<![CDATA[
|
||||
delete from alf_activity_feed where post_date < #keepdate#
|
||||
]]>
|
||||
</delete>
|
||||
|
||||
</sqlMap>
|
@@ -0,0 +1,56 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<!DOCTYPE sqlMap
|
||||
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
|
||||
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
|
||||
|
||||
<sqlMap namespace="ActivityFeedControl">
|
||||
|
||||
<typeAlias alias="FeedControl" type="org.alfresco.repo.activities.feed.control.FeedControlDAO"/>
|
||||
|
||||
<resultMap id="FeedControlResult" class="FeedControl">
|
||||
<result property="id" column="ID"/>
|
||||
<result property="feedUserId" column="FEED_USER_ID"/>
|
||||
<result property="siteNetwork" column="SITE_NETWORK"/>
|
||||
<result property="appTool" column="APP_TOOL"/>
|
||||
<result property="lastModified" column="LAST_MODIFIED"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="select.activity.feedcontrols.for.user" parameterClass="FeedControl" resultClass="FeedControl">
|
||||
<![CDATA[
|
||||
select id as id, feed_user_id as feedUserId, site_network as siteNetwork, app_tool as appTool
|
||||
from alf_activity_feed_control
|
||||
where feed_user_id = #feedUserId#
|
||||
]]>
|
||||
</select>
|
||||
|
||||
<select id="select.activity.feedcontrol" parameterClass="FeedControl" resultClass="long">
|
||||
<![CDATA[
|
||||
select id as id
|
||||
from alf_activity_feed_control
|
||||
where feed_user_id = #feedUserId#
|
||||
and site_network = #siteNetwork#
|
||||
and app_tool = #appTool#
|
||||
]]>
|
||||
</select>
|
||||
|
||||
<insert id="insert.activity.feedcontrol" parameterClass="FeedControl">
|
||||
insert into alf_activity_feed_control (feed_user_id, site_network, app_tool, last_modified)
|
||||
values (#feedUserId#, #siteNetwork#, #appTool#, #lastModified#)
|
||||
|
||||
<!-- optionally return auto-generated primary key - only required for debug (can be commented out) -->
|
||||
<selectKey resultClass="long" keyProperty="id" type="post">
|
||||
SELECT LAST_INSERT_ID() AS value
|
||||
</selectKey>
|
||||
</insert>
|
||||
|
||||
<delete id="delete.activity.feedcontrol" parameterClass="FeedControl">
|
||||
<![CDATA[
|
||||
delete from alf_activity_feed_control
|
||||
where feed_user_id = #feedUserId#
|
||||
and site_network = #siteNetwork#
|
||||
and app_tool = #appTool#
|
||||
]]>
|
||||
</delete>
|
||||
|
||||
</sqlMap>
|
@@ -0,0 +1,114 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<!DOCTYPE sqlMap
|
||||
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
|
||||
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
|
||||
|
||||
<sqlMap namespace="ActivityPost">
|
||||
|
||||
<typeAlias alias="ActivityPost" type="org.alfresco.repo.activities.post.ActivityPostDAO"/>
|
||||
|
||||
<resultMap id="ActivityPostResult" class="ActivityPost">
|
||||
<result property="id" column="SEQUENCE_ID"/>
|
||||
<result property="activityData" column="ACTIVITY_DATA"/>
|
||||
<result property="activityType" column="ACTIVITY_TYPE"/>
|
||||
<result property="userId" column="POST_USER_ID"/>
|
||||
<result property="postDate" column="POST_DATE"/>
|
||||
<result property="jobTaskNode" column="JOB_TASK_NODE"/>
|
||||
<result property="siteNetwork" column="SITE_NETWORK"/>
|
||||
<result property="appTool" column="APP_TOOL"/>
|
||||
<result property="status" column="STATUS"/>
|
||||
<result property="lastModified" column="LAST_MODIFIED"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="select.activity.posts" parameterClass="ActivityPost" resultClass="ActivityPost">
|
||||
<![CDATA[
|
||||
select
|
||||
sequence_id as id,
|
||||
activity_data as activityData,
|
||||
activity_type as activityType,
|
||||
post_user_id as userId,
|
||||
post_date as postDate,
|
||||
job_task_node as jobTaskNode,
|
||||
site_network as siteNetwork,
|
||||
app_tool as appTool,
|
||||
status as status
|
||||
from
|
||||
alf_activity_post
|
||||
where
|
||||
job_task_node = #jobTaskNode# and
|
||||
sequence_id >= #minId# and
|
||||
sequence_id <= #maxId# and
|
||||
status = #status#
|
||||
]]>
|
||||
</select>
|
||||
|
||||
<select id="select.activity.posts.by.status.only" parameterClass="ActivityPost" resultClass="ActivityPost">
|
||||
<![CDATA[
|
||||
select
|
||||
sequence_id as id,
|
||||
activity_data as activityData,
|
||||
activity_type as activityType,
|
||||
post_user_id as userId,
|
||||
post_date as postDate,
|
||||
job_task_node as jobTaskNode,
|
||||
site_network as siteNetwork,
|
||||
app_tool as appTool,
|
||||
status as status
|
||||
from
|
||||
alf_activity_post
|
||||
where
|
||||
status = #status#
|
||||
]]>
|
||||
</select>
|
||||
|
||||
<select id="select.activity.post.max.seq" resultClass="long">
|
||||
select max(sequence_id) as maxId
|
||||
from alf_activity_post
|
||||
where status = 'POSTED'
|
||||
</select>
|
||||
|
||||
<select id="select.activity.post.min.seq" resultClass="long">
|
||||
select min(sequence_id) as minId
|
||||
from alf_activity_post
|
||||
where status = 'POSTED'
|
||||
</select>
|
||||
|
||||
<select id="select.activity.post.max.jobtasknode" resultClass="int">
|
||||
select max(job_task_node) as maxJobTaskNode
|
||||
from alf_activity_post
|
||||
where status = 'POSTED'
|
||||
</select>
|
||||
|
||||
<insert id="insert.activity.post" parameterClass="ActivityPost">
|
||||
insert into alf_activity_post (status, activity_data, post_user_id, post_date, activity_type, site_network, app_tool, job_task_node, last_modified)
|
||||
values (#status#, #activityData#, #userId#, #postDate#, #activityType#, #siteNetwork#, #appTool#, #jobTaskNode#, #lastModified#)
|
||||
|
||||
<!-- optionally return auto-generated primary key - only required for debug (can be commented out) -->
|
||||
<selectKey resultClass="long" keyProperty="id" type="post">
|
||||
SELECT LAST_INSERT_ID() AS value
|
||||
</selectKey>
|
||||
|
||||
</insert>
|
||||
|
||||
<delete id="delete.activity.posts.older.than.date" parameterClass="ActivityPost">
|
||||
<![CDATA[
|
||||
delete from alf_activity_post
|
||||
where post_date < #postDate#
|
||||
and status = #status#
|
||||
]]>
|
||||
</delete>
|
||||
|
||||
<update id="update.activity.post.data" parameterClass="ActivityPost">
|
||||
update alf_activity_post set status = #status#, activity_data=#activityData#, site_network=#siteNetwork#, last_modified=#lastModified#
|
||||
where sequence_id = #id#
|
||||
and status != #status#
|
||||
</update>
|
||||
|
||||
<update id="update.activity.post.status" parameterClass="ActivityPost">
|
||||
update alf_activity_post set status = #status#, last_modified=#lastModified#
|
||||
where sequence_id = #id#
|
||||
and status != #status#
|
||||
</update>
|
||||
|
||||
</sqlMap>
|
@@ -0,0 +1,75 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<!DOCTYPE sqlMap
|
||||
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
|
||||
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
|
||||
|
||||
<sqlMap namespace="ActivityFeed">
|
||||
|
||||
<typeAlias alias="ActivityFeed" type="org.alfresco.repo.activities.feed.ActivityFeedDAO"/>
|
||||
|
||||
<resultMap id="ActivityFeedResult" class="ActivityFeed">
|
||||
<result property="id" column="ID"/>
|
||||
<result property="feedUserId" column="FEED_USER_ID"/>
|
||||
<result property="postUserId" column="POST_USER_ID"/>
|
||||
<result property="postDate" column="POST_DATE"/>
|
||||
<result property="postId" column="POST_ID"/> <!-- not an explicit FK constraint, can dangle if and when activity post is deleted -->
|
||||
<result property="siteNetwork" column="SITE_NETWORK"/>
|
||||
<result property="activityType" column="ACTIVITY_TYPE"/>
|
||||
<result property="activitySummary" column="ACTIVITY_SUMMARY"/>
|
||||
<result property="activitySummaryFormat" column="ACTIVITY_FORMAT"/>
|
||||
<result property="feedDate" column="FEED_DATE"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="select.activity.feed.for.feeduser" parameterClass="ActivityFeed" resultClass="ActivityFeed">
|
||||
<![CDATA[
|
||||
select id as id, activity_format as activitySummaryFormat, activity_summary as activitySummary, feed_user_id as feedUserId, post_user_id as postUserId, site_network as siteNetwork, post_date postDate
|
||||
from alf_activity_feed
|
||||
where feed_user_id = #feedUserId#
|
||||
and post_user_id != #feedUserId#
|
||||
and activity_format = #activitySummaryFormat#
|
||||
order by post_date desc
|
||||
]]>
|
||||
</select>
|
||||
|
||||
<select id="select.activity.feed.for.feeduser.and.site" parameterClass="ActivityFeed" resultClass="ActivityFeed">
|
||||
<![CDATA[
|
||||
select id as id, activity_format as activitySummaryFormat, activity_summary as activitySummary, feed_user_id as feedUserId, post_user_id as postUserId, site_network as siteNetwork, post_date postDate
|
||||
from alf_activity_feed
|
||||
where feed_user_id = #feedUserId#
|
||||
and post_user_id != #feedUserId#
|
||||
and site_network = #siteNetwork#
|
||||
and activity_format = #activitySummaryFormat#
|
||||
order by post_date desc
|
||||
]]>
|
||||
</select>
|
||||
|
||||
<select id="select.activity.feed.for.site" parameterClass="ActivityFeed" resultClass="ActivityFeed">
|
||||
<![CDATA[
|
||||
select id as id, activity_format as activitySummaryFormat, activity_summary as activitySummary, feed_user_id as feedUserId, post_user_id as postUserId, site_network as siteNetwork, post_date postDate
|
||||
from alf_activity_feed
|
||||
where feed_user_id = ''
|
||||
and site_network = #siteNetwork#
|
||||
and activity_format = #activitySummaryFormat#
|
||||
order by post_date desc
|
||||
]]>
|
||||
</select>
|
||||
|
||||
<insert id="insert.activity.feed" parameterClass="ActivityFeed">
|
||||
|
||||
<selectKey resultClass="long" keyProperty="id" type="pre">
|
||||
select alf_activity_feed_seq.nextval as value from dual
|
||||
</selectKey>
|
||||
|
||||
insert into alf_activity_feed (id, activity_type, activity_summary, activity_format, feed_user_id, post_user_id, post_date, post_id, site_network, app_tool, feed_date)
|
||||
values (#id#, #activityType#, #activitySummary#, #activitySummaryFormat#, #feedUserId#, #postUserId#, #postDate#, #postId#, #siteNetwork#, #appTool#, #feedDate#)
|
||||
|
||||
</insert>
|
||||
|
||||
<delete id="delete.activity.feed.entries.older.than.date" parameterClass="Date">
|
||||
<![CDATA[
|
||||
delete from alf_activity_feed where post_date < #keepdate#
|
||||
]]>
|
||||
</delete>
|
||||
|
||||
</sqlMap>
|
@@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<!DOCTYPE sqlMap
|
||||
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
|
||||
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
|
||||
|
||||
<sqlMap namespace="ActivityFeedControl">
|
||||
|
||||
<typeAlias alias="FeedControl" type="org.alfresco.repo.activities.feed.control.FeedControlDAO"/>
|
||||
|
||||
<resultMap id="FeedControlResult" class="FeedControl">
|
||||
<result property="id" column="ID"/>
|
||||
<result property="feedUserId" column="FEED_USER_ID"/>
|
||||
<result property="siteNetwork" column="SITE_NETWORK"/>
|
||||
<result property="appTool" column="APP_TOOL"/>
|
||||
<result property="lastModified" column="LAST_MODIFIED"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="select.activity.feedcontrols.for.user" parameterClass="FeedControl" resultClass="FeedControl">
|
||||
<![CDATA[
|
||||
select id as id, feed_user_id as feedUserId, site_network as siteNetwork, app_tool as appTool
|
||||
from alf_activity_feed_control
|
||||
where feed_user_id = #feedUserId#
|
||||
]]>
|
||||
</select>
|
||||
|
||||
<select id="select.activity.feedcontrol" parameterClass="FeedControl" resultClass="long">
|
||||
<![CDATA[
|
||||
select id as id
|
||||
from alf_activity_feed_control
|
||||
where feed_user_id = #feedUserId#
|
||||
and site_network = #siteNetwork#
|
||||
and app_tool = #appTool#
|
||||
]]>
|
||||
</select>
|
||||
|
||||
<insert id="insert.activity.feedcontrol" parameterClass="FeedControl">
|
||||
|
||||
<selectKey resultClass="long" keyProperty="id" type="pre">
|
||||
select alf_activity_feed_control_seq.nextval as value from dual
|
||||
</selectKey>
|
||||
|
||||
insert into alf_activity_feed_control (id, feed_user_id, site_network, app_tool, last_modified)
|
||||
values (#id#, #feedUserId#, #siteNetwork#, #appTool#, #lastModified#)
|
||||
|
||||
</insert>
|
||||
|
||||
<delete id="delete.activity.feedcontrol" parameterClass="FeedControl">
|
||||
<![CDATA[
|
||||
delete from alf_activity_feed_control
|
||||
where feed_user_id = #feedUserId#
|
||||
and site_network = #siteNetwork#
|
||||
and app_tool = #appTool#
|
||||
]]>
|
||||
</delete>
|
||||
|
||||
</sqlMap>
|
114
config/alfresco/activities/org.hibernate.dialect.Oracle9Dialect/ActivityPost.xml
Executable file
114
config/alfresco/activities/org.hibernate.dialect.Oracle9Dialect/ActivityPost.xml
Executable file
@@ -0,0 +1,114 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<!DOCTYPE sqlMap
|
||||
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
|
||||
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
|
||||
|
||||
<sqlMap namespace="ActivityPost">
|
||||
|
||||
<typeAlias alias="ActivityPost" type="org.alfresco.repo.activities.post.ActivityPostDAO"/>
|
||||
|
||||
<resultMap id="ActivityPostResult" class="ActivityPost">
|
||||
<result property="id" column="SEQUENCE_ID"/>
|
||||
<result property="activityData" column="ACTIVITY_DATA"/>
|
||||
<result property="activityType" column="ACTIVITY_TYPE"/>
|
||||
<result property="userId" column="POST_USER_ID"/>
|
||||
<result property="postDate" column="POST_DATE"/>
|
||||
<result property="jobTaskNode" column="JOB_TASK_NODE"/>
|
||||
<result property="siteNetwork" column="SITE_NETWORK"/>
|
||||
<result property="appTool" column="APP_TOOL"/>
|
||||
<result property="status" column="STATUS"/>
|
||||
<result property="lastModified" column="LAST_MODIFIED"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="select.activity.posts" parameterClass="ActivityPost" resultClass="ActivityPost">
|
||||
<![CDATA[
|
||||
select
|
||||
sequence_id as id,
|
||||
activity_data as activityData,
|
||||
activity_type as activityType,
|
||||
post_user_id as userId,
|
||||
post_date as postDate,
|
||||
job_task_node as jobTaskNode,
|
||||
site_network as siteNetwork,
|
||||
app_tool as appTool,
|
||||
status as status
|
||||
from
|
||||
alf_activity_post
|
||||
where
|
||||
job_task_node = #jobTaskNode# and
|
||||
sequence_id >= #minId# and
|
||||
sequence_id <= #maxId# and
|
||||
status = #status#
|
||||
]]>
|
||||
</select>
|
||||
|
||||
<select id="select.activity.posts.by.status.only" parameterClass="ActivityPost" resultClass="ActivityPost">
|
||||
<![CDATA[
|
||||
select
|
||||
sequence_id as id,
|
||||
activity_data as activityData,
|
||||
activity_type as activityType,
|
||||
post_user_id as userId,
|
||||
post_date as postDate,
|
||||
job_task_node as jobTaskNode,
|
||||
site_network as siteNetwork,
|
||||
app_tool as appTool,
|
||||
status as status
|
||||
from
|
||||
alf_activity_post
|
||||
where
|
||||
status = #status#
|
||||
]]>
|
||||
</select>
|
||||
|
||||
<select id="select.activity.post.max.seq" resultClass="long">
|
||||
select max(sequence_id) as maxId
|
||||
from alf_activity_post
|
||||
where status = 'POSTED'
|
||||
</select>
|
||||
|
||||
<select id="select.activity.post.min.seq" resultClass="long">
|
||||
select min(sequence_id) as minId
|
||||
from alf_activity_post
|
||||
where status = 'POSTED'
|
||||
</select>
|
||||
|
||||
<select id="select.activity.post.max.jobtasknode" resultClass="int">
|
||||
select max(job_task_node) as maxJobTaskNode
|
||||
from alf_activity_post
|
||||
where status = 'POSTED'
|
||||
</select>
|
||||
|
||||
<insert id="insert.activity.post" parameterClass="ActivityPost">
|
||||
|
||||
<selectKey resultClass="long" keyProperty="id" type="pre">
|
||||
select alf_activity_post_seq.nextval as value from dual
|
||||
</selectKey>
|
||||
|
||||
insert into alf_activity_post (sequence_id, status, activity_data, post_user_id, post_date, activity_type, site_network, app_tool, job_task_node, last_modified)
|
||||
values (#id#, #status#, #activityData#, #userId#, #postDate#, #activityType#, #siteNetwork#, #appTool#, #jobTaskNode#, #lastModified#)
|
||||
|
||||
</insert>
|
||||
|
||||
<delete id="delete.activity.posts.older.than.date" parameterClass="ActivityPost">
|
||||
<![CDATA[
|
||||
delete from alf_activity_post
|
||||
where post_date < #postDate#
|
||||
and status = #status#
|
||||
]]>
|
||||
</delete>
|
||||
|
||||
<update id="update.activity.post.data" parameterClass="ActivityPost">
|
||||
update alf_activity_post set status = #status#, activity_data=#activityData#, site_network=#siteNetwork#, last_modified=#lastModified#
|
||||
where sequence_id = #id#
|
||||
and status != #status#
|
||||
</update>
|
||||
|
||||
<update id="update.activity.post.status" parameterClass="ActivityPost">
|
||||
update alf_activity_post set status = #status#, last_modified=#lastModified#
|
||||
where sequence_id = #id#
|
||||
and status != #status#
|
||||
</update>
|
||||
|
||||
</sqlMap>
|
@@ -12,7 +12,8 @@
|
||||
<import resource="classpath:alfresco/model-specific-services-context.xml" />
|
||||
<import resource="classpath:alfresco/action-services-context.xml" />
|
||||
<import resource="classpath:alfresco/rule-services-context.xml" />
|
||||
<import resource="classpath:alfresco/node-services-context.xml" />
|
||||
<import resource="classpath:alfresco/node-services-context.xml" />
|
||||
<import resource="classpath:alfresco/activities/activities-feed-context.xml" />
|
||||
<import resource="classpath:alfresco/scheduled-jobs-context.xml" />
|
||||
<import resource="classpath:alfresco/network-protocol-context.xml" />
|
||||
<import resource="classpath:alfresco/emailserver/email-service-context.xml" />
|
||||
|
@@ -43,6 +43,7 @@
|
||||
<list>
|
||||
<value>classpath:alfresco/dbscripts/create/2.2/${db.script.dialect}/AlfrescoPostCreate-2.2-MappedFKIndexes.sql</value>
|
||||
<value>classpath:alfresco/dbscripts/create/2.2/${db.script.dialect}/AlfrescoPostCreate-2.2-Extra.sql</value>
|
||||
<value>classpath:alfresco/dbscripts/create/3.0/${db.script.dialect}/create-activities-tables.sql</value>
|
||||
</list>
|
||||
</property>
|
||||
<property name="validateUpdateScriptPatches">
|
||||
@@ -59,6 +60,7 @@
|
||||
<ref bean="patch.db-V2.2-1-DropIndexesAndConstraints" />
|
||||
<ref bean="patch.db-V2.2-2-MoveQNames" />
|
||||
<ref bean="patch.db-V2.2-3-PropTypes" />
|
||||
<ref bean="patch.db-V3.0-0-CreateActivitiesTables" />
|
||||
</list>
|
||||
</property>
|
||||
<property name="postUpdateScriptPatches">
|
||||
|
@@ -0,0 +1,59 @@
|
||||
--
|
||||
-- Title: Activities Schema
|
||||
-- Database: HSQL
|
||||
-- Since: V3.0.0 Schema
|
||||
--
|
||||
-- Note: The Activities schema is NOT managed by Hibernate
|
||||
--
|
||||
|
||||
|
||||
CREATE TABLE alf_activity_post (
|
||||
sequence_id bigint generated by default as identity (start with 1),
|
||||
post_date timestamp NOT NULL,
|
||||
status varchar(10) NOT NULL,
|
||||
activity_data varchar(4000) NOT NULL,
|
||||
post_user_id varchar(255) NOT NULL,
|
||||
job_task_node integer NOT NULL,
|
||||
site_network varchar(255) default NULL,
|
||||
app_tool varchar(36) default NULL,
|
||||
activity_type varchar(255) NOT NULL,
|
||||
last_modified timestamp NOT NULL,
|
||||
primary key (sequence_id)
|
||||
);
|
||||
|
||||
CREATE INDEX jobtasknode_idx on alf_activity_post(job_task_node);
|
||||
CREATE INDEX status_idx on alf_activity_post(status);
|
||||
|
||||
|
||||
CREATE TABLE alf_activity_feed (
|
||||
id bigint generated by default as identity (start with 1),
|
||||
post_id bigint default NULL,
|
||||
post_date timestamp NOT NULL,
|
||||
activity_summary varchar(4000) default NULL,
|
||||
feed_user_id varchar(255) NOT NULL,
|
||||
activity_type varchar(255) NOT NULL,
|
||||
activity_format varchar(10) default NULL,
|
||||
site_network varchar(255) default NULL,
|
||||
app_tool varchar(36) default NULL,
|
||||
post_user_id varchar(255) NOT NULL,
|
||||
feed_date timestamp NOT NULL,
|
||||
primary key (id)
|
||||
);
|
||||
|
||||
CREATE INDEX postdate_idx ON alf_activity_feed(post_date);
|
||||
CREATE INDEX feeduserid_idx ON alf_activity_feed(feed_user_id);
|
||||
CREATE INDEX postuserid_idx ON alf_activity_feed(post_user_id);
|
||||
CREATE INDEX sitenetwork_idx ON alf_activity_feed(site_network);
|
||||
CREATE INDEX activityformat_idx ON alf_activity_feed(activity_format);
|
||||
|
||||
|
||||
CREATE TABLE alf_activity_feed_control (
|
||||
id bigint generated by default as identity (start with 1),
|
||||
feed_user_id varchar(255) NOT NULL,
|
||||
site_network varchar(255) NOT NULL,
|
||||
app_tool varchar(36) default NULL,
|
||||
last_modified timestamp NOT NULL,
|
||||
primary key (id)
|
||||
);
|
||||
|
||||
CREATE INDEX feedcontroluserid_idx ON alf_activity_feed_control(feed_user_id);
|
@@ -0,0 +1,56 @@
|
||||
--
|
||||
-- Title: Activities Schema
|
||||
-- Database: MySQL
|
||||
-- Since: V3.0.0 Schema
|
||||
--
|
||||
-- Note: The Activities schema is NOT managed by Hibernate
|
||||
--
|
||||
|
||||
|
||||
CREATE TABLE alf_activity_post (
|
||||
sequence_id bigint NOT NULL auto_increment,
|
||||
post_date timestamp NOT NULL,
|
||||
status varchar(10) NOT NULL,
|
||||
activity_data varchar(4000) NOT NULL,
|
||||
post_user_id varchar(255) NOT NULL,
|
||||
job_task_node int(11) NOT NULL,
|
||||
site_network varchar(255) default NULL,
|
||||
app_tool varchar(36) default NULL,
|
||||
activity_type varchar(255) NOT NULL,
|
||||
last_modified timestamp NOT NULL,
|
||||
PRIMARY KEY (sequence_id),
|
||||
KEY jobtasknode_idx (job_task_node),
|
||||
KEY status_idx (status)
|
||||
) type=InnoDB;
|
||||
|
||||
|
||||
CREATE TABLE alf_activity_feed (
|
||||
id bigint NOT NULL auto_increment,
|
||||
post_id bigint default NULL,
|
||||
post_date timestamp NOT NULL,
|
||||
activity_summary varchar(4000) default NULL,
|
||||
feed_user_id varchar(255) NOT NULL,
|
||||
activity_type varchar(255) NOT NULL,
|
||||
activity_format varchar(10) default NULL,
|
||||
site_network varchar(255) default NULL,
|
||||
app_tool varchar(36) default NULL,
|
||||
post_user_id varchar(255) NOT NULL,
|
||||
feed_date timestamp NOT NULL,
|
||||
PRIMARY KEY (id),
|
||||
KEY postdate_idx (post_date),
|
||||
KEY feeduserid_idx (feed_user_id),
|
||||
KEY postuserid_idx (post_user_id),
|
||||
KEY sitenetwork_idx (site_network),
|
||||
KEY activityformat_idx (activity_format)
|
||||
) type=InnoDB;
|
||||
|
||||
|
||||
CREATE TABLE alf_activity_feed_control (
|
||||
id bigint NOT NULL auto_increment,
|
||||
feed_user_id varchar(255) NOT NULL,
|
||||
site_network varchar(255) NOT NULL,
|
||||
app_tool varchar(36) NOT NULL,
|
||||
last_modified timestamp NOT NULL,
|
||||
PRIMARY KEY (id),
|
||||
KEY feedcontroluserid_idx (feed_user_id)
|
||||
) type=InnoDB;
|
@@ -0,0 +1,65 @@
|
||||
--
|
||||
-- Title: Activities Schema
|
||||
-- Database: Oracle
|
||||
-- Since: V3.0.0 Schema
|
||||
--
|
||||
-- Note: The Activities schema is NOT managed by Hibernate
|
||||
--
|
||||
|
||||
|
||||
CREATE TABLE alf_activity_post (
|
||||
sequence_id number(19,0) NOT NULL,
|
||||
post_date timestamp NOT NULL,
|
||||
status varchar2(10) NOT NULL,
|
||||
activity_data varchar2(4000) NOT NULL,
|
||||
post_user_id varchar2(255) NOT NULL,
|
||||
job_task_node number(19,0) NOT NULL,
|
||||
site_network varchar2(255) default NULL,
|
||||
app_tool varchar2(36) default NULL,
|
||||
activity_type varchar2(255) NOT NULL,
|
||||
last_modified timestamp NOT NULL,
|
||||
primary key (sequence_id)
|
||||
);
|
||||
|
||||
CREATE SEQUENCE alf_activity_post_seq START WITH 1 INCREMENT BY 1;
|
||||
|
||||
CREATE INDEX jobtasknode_idx on alf_activity_post(job_task_node);
|
||||
CREATE INDEX status_idx on alf_activity_post(status);
|
||||
|
||||
|
||||
CREATE TABLE alf_activity_feed (
|
||||
id number(19,0) NOT NULL,
|
||||
post_id number(19,0) default NULL,
|
||||
post_date timestamp NOT NULL,
|
||||
activity_summary varchar2(4000) default NULL,
|
||||
feed_user_id varchar2(255) default NULL,
|
||||
activity_type varchar2(255) NOT NULL,
|
||||
activity_format varchar2(10) default NULL,
|
||||
site_network varchar2(255) default NULL,
|
||||
app_tool varchar2(36) default NULL,
|
||||
post_user_id varchar2(255) NOT NULL,
|
||||
feed_date timestamp NOT NULL,
|
||||
primary key (id)
|
||||
);
|
||||
|
||||
CREATE SEQUENCE alf_activity_feed_seq START WITH 1 INCREMENT BY 1;
|
||||
|
||||
CREATE INDEX postdate_idx ON alf_activity_feed(post_date);
|
||||
CREATE INDEX feeduserid_idx ON alf_activity_feed(feed_user_id);
|
||||
CREATE INDEX postuserid_idx ON alf_activity_feed(post_user_id);
|
||||
CREATE INDEX sitenetwork_idx ON alf_activity_feed(site_network);
|
||||
CREATE INDEX activityformat_idx ON alf_activity_feed(activity_format);
|
||||
|
||||
|
||||
CREATE TABLE alf_activity_feed_control (
|
||||
id number(19,0) NOT NULL,
|
||||
feed_user_id varchar2(255) NOT NULL,
|
||||
site_network varchar2(255) NOT NULL,
|
||||
app_tool varchar2(36) NOT NULL,
|
||||
last_modified timestamp NOT NULL,
|
||||
primary key (id)
|
||||
);
|
||||
|
||||
CREATE SEQUENCE alf_activity_feed_control_seq START WITH 1 INCREMENT BY 1;
|
||||
|
||||
CREATE INDEX feedcontroluserid_idx ON alf_activity_feed_control(feed_user_id);
|
@@ -1468,4 +1468,15 @@
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="patch.db-V3.0-0-CreateActivitiesTables" class="org.alfresco.repo.admin.patch.impl.SchemaUpgradeScriptPatch" parent="basePatch">
|
||||
<property name="id"><value>patch.db-V3.0-0-CreateActivitiesTables</value></property>
|
||||
<property name="description"><value>patch.schemaUpgradeScript.description</value></property>
|
||||
<property name="fixesFromSchema"><value>0</value></property>
|
||||
<property name="fixesToSchema"><value>125</value></property>
|
||||
<property name="targetSchema"><value>126</value></property>
|
||||
<property name="scriptUrl">
|
||||
<value>classpath:alfresco/dbscripts/create/3.0/${db.script.dialect}/create-activities-tables.sql</value>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
|
@@ -205,3 +205,6 @@ avm.remote.idlestream.timeout=30000
|
||||
|
||||
# ECM content usages/quotas
|
||||
system.usages.enabled=true
|
||||
|
||||
# Repository endpoint - used by Activity Service
|
||||
repo.remote.endpoint.url=http://localhost:8080/alfresco/service
|
@@ -354,4 +354,120 @@
|
||||
<!-- See the wiki (http://wiki.alfresco.com/wikiDeployment) for details -->
|
||||
<!-- and the deployment-attempt-cleaner-context.xml.sample file. -->
|
||||
|
||||
|
||||
<!-- 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>
|
||||
|
||||
<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>
|
@@ -167,4 +167,13 @@
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="activitiesScript" parent="baseJavaScriptExtension" class="org.alfresco.repo.activities.script.Activity">
|
||||
<property name="extensionName">
|
||||
<value>activities</value>
|
||||
</property>
|
||||
<property name="activityService">
|
||||
<ref bean="activityService"/>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
|
@@ -19,4 +19,4 @@ version.build=@build-number@
|
||||
|
||||
# Schema number
|
||||
|
||||
version.schema=125
|
||||
version.schema=126
|
||||
|
Reference in New Issue
Block a user