Package org.alfresco.repo.activities
Class ActivityServiceImpl
- java.lang.Object
-
- org.alfresco.repo.activities.ActivityServiceImpl
-
- All Implemented Interfaces:
ActivityPostService,ActivityService,org.springframework.beans.factory.InitializingBean
public class ActivityServiceImpl extends java.lang.Object implements ActivityService, org.springframework.beans.factory.InitializingBean
Activity Service Implementation- Author:
- janv
-
-
Constructor Summary
Constructors Constructor Description ActivityServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterPropertiesSet()booleanexistsFeedControl(FeedControl feedControl)For current user, does the feed control exist ?java.util.List<FeedControl>getFeedControls()For current user, get feed controlsjava.util.List<FeedControl>getFeedControls(java.lang.String userId)For given user, get feed controlsintgetMaxFeedItems()Return maximum configured item entries (per feed)org.alfresco.query.PagingResults<ActivityFeedEntity>getPagedUserFeedEntries(java.lang.String feedUserId, java.lang.String siteId, boolean excludeThisUser, boolean excludeOtherUsers, long minFeedId, org.alfresco.query.PagingRequest pagingRequest)java.util.List<java.lang.String>getSiteFeedEntries(java.lang.String siteId)Retrieve site feedprotected org.alfresco.service.cmr.repository.NodeRefgetUserAvatarNodeRef(ActivityFeedEntity activityFeed, java.util.Map<java.lang.String,org.alfresco.service.cmr.repository.NodeRef> userIdToAvatarNodeRefCache)Attempts to find the avatarNodeReffor the user in suppliedActivityFeedEntity.java.util.List<java.lang.String>getUserFeedEntries(java.lang.String feedUserId, java.lang.String siteId)Retrieve user feed with optional site filter Will return activities for all users across all sites, or optionally for all users for specified site.java.util.List<java.lang.String>getUserFeedEntries(java.lang.String feedUserId, java.lang.String siteId, boolean excludeThisUser, boolean excludeOtherUsers)Retrieve user feed with optional site filter and optional user filters Will return activities for users across all sites, or optionally for users for specified site.java.util.List<ActivityFeedEntity>getUserFeedEntries(java.lang.String feedUserId, java.lang.String siteId, boolean excludeThisUser, boolean excludeOtherUsers, long minFeedId)Retrieve user feed with optional site filter and optional user filters and optional min feed DB id Will return activities for users across all sites, or optionally for users for specified site.java.util.List<java.lang.String>getUserFeedEntries(java.lang.String feedUserId, java.lang.String siteId, boolean excludeThisUser, boolean excludeOtherUsers, java.util.Set<java.lang.String> userFilter, java.util.Set<java.lang.String> actvityFilter)Retrieve user feed with optional site filter and optional user filters Will return activities for users across all sites, or optionally for users for specified site.java.util.List<ActivityFeedEntity>getUserFeedEntries(java.lang.String feedUserId, java.lang.String siteId, boolean excludeThisUser, boolean excludeOtherUsers, java.util.Set<java.lang.String> userFilter, java.util.Set<java.lang.String> actvityFilter, long minFeedId)Retrieve user feed with optional site filter and optional user filters and optional min feed DB id Will return activities for users across all sites, or optionally for users for specified site.voidpostActivity(java.lang.String activityType, java.lang.String siteId, java.lang.String appTool, java.lang.String activityData)Post a custom activity typevoidpostActivity(java.lang.String activityType, java.lang.String siteId, java.lang.String appTool, java.lang.String activityData, java.lang.String userId)Post a custom activity typevoidpostActivity(java.lang.String activityType, java.lang.String siteId, java.lang.String appTool, java.lang.String jsonActivityData, org.alfresco.sync.repo.Client client)Post a custom activity typevoidpostActivity(java.lang.String activityType, java.lang.String siteId, java.lang.String appTool, java.lang.String jsonActivityData, org.alfresco.sync.repo.Client client, FileInfo contentNodeInfo)Post a custom activity typevoidpostActivity(java.lang.String activityType, java.lang.String siteId, java.lang.String appTool, org.alfresco.service.cmr.repository.NodeRef nodeRef)Post a pre-defined activity type - certain activity data will be looked-up asynchronously, including: name (of nodeRef) displayPath typeQName firstName (of posting user) lastName (of posting user)voidpostActivity(java.lang.String activityType, java.lang.String siteId, java.lang.String appTool, org.alfresco.service.cmr.repository.NodeRef nodeRef, java.lang.String name)Post a pre-defined activity type - eg.voidpostActivity(java.lang.String activityType, java.lang.String siteId, java.lang.String appTool, org.alfresco.service.cmr.repository.NodeRef nodeRef, java.lang.String name, org.alfresco.service.namespace.QName typeQName, org.alfresco.service.cmr.repository.NodeRef parentNodeRef)Post a pre-defined activity type - eg.voidsetActivityPostService(ActivityPostService activityPostService)voidsetAuthorityService(AuthorityService authorityService)voidsetFeedCleaner(FeedCleaner feedCleaner)voidsetFeedControl(FeedControl feedControl)For current user, set feed control (opt-out) for a site or an appTool or a site/appTool combinationvoidsetFeedControlDAO(FeedControlDAO feedControlDAO)voidsetFeedDAO(ActivityFeedDAO feedDAO)voidsetMaxFeedItems(int maxFeedItems)voidsetNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)voidsetPersonService(PersonService personService)voidsetSiteService(SiteService siteService)voidsetTenantService(org.alfresco.repo.tenant.TenantService tenantService)voidsetUserNamesAreCaseSensitive(boolean userNamesAreCaseSensitive)voidunsetFeedControl(FeedControl feedControl)For current user, unset feed control
-
-
-
Method Detail
-
setMaxFeedItems
public void setMaxFeedItems(int maxFeedItems)
-
setUserNamesAreCaseSensitive
public void setUserNamesAreCaseSensitive(boolean userNamesAreCaseSensitive)
-
setFeedDAO
public void setFeedDAO(ActivityFeedDAO feedDAO)
-
setFeedControlDAO
public void setFeedControlDAO(FeedControlDAO feedControlDAO)
-
setFeedCleaner
public void setFeedCleaner(FeedCleaner feedCleaner)
-
setAuthorityService
public void setAuthorityService(AuthorityService authorityService)
-
setTenantService
public void setTenantService(org.alfresco.repo.tenant.TenantService tenantService)
-
setSiteService
public void setSiteService(SiteService siteService)
-
setActivityPostService
public void setActivityPostService(ActivityPostService activityPostService)
-
setPersonService
public void setPersonService(PersonService personService)
-
setNodeService
public void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
-
afterPropertiesSet
public void afterPropertiesSet() throws java.lang.Exception- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
java.lang.Exception
-
postActivity
public void postActivity(java.lang.String activityType, java.lang.String siteId, java.lang.String appTool, java.lang.String activityData)Description copied from interface:ActivityPostServicePost a custom activity type- Specified by:
postActivityin interfaceActivityPostService- Parameters:
activityType- - requiredsiteId- - optional, if null will be stored as empty stringappTool- - optional, if null will be stored as empty stringactivityData- - required
-
postActivity
public void postActivity(java.lang.String activityType, java.lang.String siteId, java.lang.String appTool, java.lang.String activityData, java.lang.String userId)Description copied from interface:ActivityPostServicePost a custom activity type- Specified by:
postActivityin interfaceActivityPostService- Parameters:
activityType- - requiredsiteId- - optional, if null will be stored as empty stringappTool- - optional, if null will be stored as empty stringactivityData- - requireduserId- - required
-
postActivity
public void postActivity(java.lang.String activityType, java.lang.String siteId, java.lang.String appTool, org.alfresco.service.cmr.repository.NodeRef nodeRef)Description copied from interface:ActivityPostServicePost a pre-defined activity type - certain activity data will be looked-up asynchronously, including: name (of nodeRef) displayPath typeQName firstName (of posting user) lastName (of posting user)- Specified by:
postActivityin interfaceActivityPostService- Parameters:
activityType- - requiredsiteId- - optional, if null will be stored as empty stringappTool- - optional, if null will be stored as empty stringnodeRef- - required - do not use for deleted (or about to be deleted) nodeRef
-
postActivity
public void postActivity(java.lang.String activityType, java.lang.String siteId, java.lang.String appTool, org.alfresco.service.cmr.repository.NodeRef nodeRef, java.lang.String name)Description copied from interface:ActivityPostServicePost a pre-defined activity type - eg. for checked-out nodeRef or renamed nodeRef- Specified by:
postActivityin interfaceActivityPostService- Parameters:
activityType- - requiredsiteId- - optional, if null will be stored as empty stringappTool- - optional, if null will be stored as empty stringnodeRef- - required - do not use deleted (or about to be deleted) nodeRefname- - optional - name of node (eg. prior to name change)
-
postActivity
public void postActivity(java.lang.String activityType, java.lang.String siteId, java.lang.String appTool, org.alfresco.service.cmr.repository.NodeRef nodeRef, java.lang.String name, org.alfresco.service.namespace.QName typeQName, org.alfresco.service.cmr.repository.NodeRef parentNodeRef)Description copied from interface:ActivityPostServicePost a pre-defined activity type - eg. for deleted nodeRef- Specified by:
postActivityin interfaceActivityPostService- Parameters:
activityType- - requiredsiteId- - optional, if null will be stored as empty stringappTool- - optional, if null will be stored as empty stringnodeRef- - required - can be a deleted (or about to be deleted) nodeRefname- - optional - name of nametypeQName- - optional - type of nodeparentNodeRef- - required - used to lookup path/displayPath
-
postActivity
public void postActivity(java.lang.String activityType, java.lang.String siteId, java.lang.String appTool, java.lang.String jsonActivityData, org.alfresco.sync.repo.Client client)Description copied from interface:ActivityPostServicePost a custom activity type- Specified by:
postActivityin interfaceActivityPostService- Parameters:
activityType- - requiredsiteId- - optional, if null will be stored as empty stringappTool- - optional, if null will be stored as empty stringjsonActivityData- - required
-
postActivity
public void postActivity(java.lang.String activityType, java.lang.String siteId, java.lang.String appTool, java.lang.String jsonActivityData, org.alfresco.sync.repo.Client client, FileInfo contentNodeInfo)Description copied from interface:ActivityPostServicePost a custom activity type- Specified by:
postActivityin interfaceActivityPostService- Parameters:
activityType- - requiredsiteId- - optional, if null will be stored as empty stringappTool- - optional, if null will be stored as empty stringjsonActivityData- - requiredcontentNodeInfo- FileInfo
-
getUserFeedEntries
public java.util.List<java.lang.String> getUserFeedEntries(java.lang.String feedUserId, java.lang.String siteId)Description copied from interface:ActivityServiceRetrieve user feed with optional site filter Will return activities for all users across all sites, or optionally for all users for specified site.- Specified by:
getUserFeedEntriesin interfaceActivityService- Parameters:
feedUserId- - requiredsiteId- - optional, if set then will filter by given siteId else return all sites- Returns:
- list of JSON feed entries
-
getUserFeedEntries
public java.util.List<java.lang.String> getUserFeedEntries(java.lang.String feedUserId, java.lang.String siteId, boolean excludeThisUser, boolean excludeOtherUsers)Description copied from interface:ActivityServiceRetrieve user feed with optional site filter and optional user filters Will return activities for users across all sites, or optionally for users for specified site. User filters are: - all user activities (excludeThisUser = false, excludeOtherUsers = false) - other user activities (excludeThisUser = true, excludeOtherUsers = false) - my user activities (excludeThisUser = false, excludeOtherUsers = true) note: if both excludes are true then no activities will be returned.- Specified by:
getUserFeedEntriesin interfaceActivityService- Parameters:
feedUserId- - requiredsiteId- - optional, if set then will filter by given siteId else return all sitesexcludeThisUser- - if TRUE then will exclude activities for this user (hence returning other users only)excludeOtherUsers- - if TRUE then will exclude activities for other users (hence returning this user only)- Returns:
- list of JSON feed entries
-
getUserFeedEntries
public java.util.List<java.lang.String> getUserFeedEntries(java.lang.String feedUserId, java.lang.String siteId, boolean excludeThisUser, boolean excludeOtherUsers, java.util.Set<java.lang.String> userFilter, java.util.Set<java.lang.String> actvityFilter)Description copied from interface:ActivityServiceRetrieve user feed with optional site filter and optional user filters Will return activities for users across all sites, or optionally for users for specified site. User filters are: - all user activities (excludeThisUser = false, excludeOtherUsers = false) - other user activities (excludeThisUser = true, excludeOtherUsers = false) - my user activities (excludeThisUser = false, excludeOtherUsers = true) note: if both excludes are true then no activities will be returned.- Specified by:
getUserFeedEntriesin interfaceActivityService- Parameters:
feedUserId- - requiredsiteId- - optional, if set then will filter by given siteId else return all sitesexcludeThisUser- - if TRUE then will exclude activities for this user (hence returning other users only)excludeOtherUsers- - if TRUE then will exclude activities for other users (hence returning this user only)userFilter- - if not NULL then will only return activities of users in this setactvityFilter- - if not NULL then will only return activities that are in this set- Returns:
- list of JSON feed entries
-
getPagedUserFeedEntries
public org.alfresco.query.PagingResults<ActivityFeedEntity> getPagedUserFeedEntries(java.lang.String feedUserId, java.lang.String siteId, boolean excludeThisUser, boolean excludeOtherUsers, long minFeedId, org.alfresco.query.PagingRequest pagingRequest)
- Specified by:
getPagedUserFeedEntriesin interfaceActivityService
-
getUserAvatarNodeRef
protected org.alfresco.service.cmr.repository.NodeRef getUserAvatarNodeRef(ActivityFeedEntity activityFeed, java.util.Map<java.lang.String,org.alfresco.service.cmr.repository.NodeRef> userIdToAvatarNodeRefCache)
Attempts to find the avatarNodeReffor the user in suppliedActivityFeedEntity. As this is aimed at setting theNodeReffrom a client-side point of view there are a couple of activity types where the user is taken from the activity summary rather than from the poster (e.g. when a user role is changed). A cache should be passed in from which to retrieve previously fetchedNodeRefs for efficiency.- Parameters:
activityFeed- ActivityFeedEntity- Returns:
- NodeRef
-
getUserFeedEntries
public java.util.List<ActivityFeedEntity> getUserFeedEntries(java.lang.String feedUserId, java.lang.String siteId, boolean excludeThisUser, boolean excludeOtherUsers, long minFeedId)
Description copied from interface:ActivityServiceRetrieve user feed with optional site filter and optional user filters and optional min feed DB id Will return activities for users across all sites, or optionally for users for specified site. User filters are: - all user activities (excludeThisUser = false, excludeOtherUsers = false) - other user activities (excludeThisUser = true, excludeOtherUsers = false) - my user activities (excludeThisUser = false, excludeOtherUsers = true) note: if both excludes are true then no activities will be returned.- Specified by:
getUserFeedEntriesin interfaceActivityService- Parameters:
feedUserId- - requiredsiteId- - optional, if set then will filter by given siteId else return all sitesexcludeThisUser- - if TRUE then will exclude activities for this user (hence returning other users only)excludeOtherUsers- - if TRUE then will exclude activities for other users (hence returning this user only)minFeedId- - inclusive from min feed DB id, if -1 then return all available- Returns:
- list of JSON feed entries
-
getUserFeedEntries
public java.util.List<ActivityFeedEntity> getUserFeedEntries(java.lang.String feedUserId, java.lang.String siteId, boolean excludeThisUser, boolean excludeOtherUsers, java.util.Set<java.lang.String> userFilter, java.util.Set<java.lang.String> actvityFilter, long minFeedId)
Description copied from interface:ActivityServiceRetrieve user feed with optional site filter and optional user filters and optional min feed DB id Will return activities for users across all sites, or optionally for users for specified site. User filters are: - all user activities (excludeThisUser = false, excludeOtherUsers = false) - other user activities (excludeThisUser = true, excludeOtherUsers = false) - my user activities (excludeThisUser = false, excludeOtherUsers = true) note: if both excludes are true then no activities will be returned.- Specified by:
getUserFeedEntriesin interfaceActivityService- Parameters:
feedUserId- - requiredsiteId- - optional, if set then will filter by given siteId else return all sitesexcludeThisUser- - if TRUE then will exclude activities for this user (hence returning other users only)excludeOtherUsers- - if TRUE then will exclude activities for other users (hence returning this user only)userFilter- - if not NULL then will only return activities of users in this setactvityFilter- - if not NULL then will only return activities that are in this setminFeedId- - inclusive from min feed DB id, if -1 then return all available- Returns:
- list of JSON feed entries
-
getSiteFeedEntries
public java.util.List<java.lang.String> getSiteFeedEntries(java.lang.String siteId)
Description copied from interface:ActivityServiceRetrieve site feed- Specified by:
getSiteFeedEntriesin interfaceActivityService- Parameters:
siteId- - required- Returns:
- list of JSON feed entries
-
getMaxFeedItems
public int getMaxFeedItems()
Description copied from interface:ActivityServiceReturn maximum configured item entries (per feed)- Specified by:
getMaxFeedItemsin interfaceActivityService- Returns:
- int
-
setFeedControl
public void setFeedControl(FeedControl feedControl)
Description copied from interface:ActivityServiceFor current user, set feed control (opt-out) for a site or an appTool or a site/appTool combination- Specified by:
setFeedControlin interfaceActivityService- Parameters:
feedControl- - required
-
getFeedControls
public java.util.List<FeedControl> getFeedControls()
Description copied from interface:ActivityServiceFor current user, get feed controls- Specified by:
getFeedControlsin interfaceActivityService- Returns:
- list of user feed controls
-
getFeedControls
public java.util.List<FeedControl> getFeedControls(java.lang.String userId)
Description copied from interface:ActivityServiceFor given user, get feed controls- Specified by:
getFeedControlsin interfaceActivityService- Parameters:
userId- - required (must match- Returns:
- list of user feed controls
-
unsetFeedControl
public void unsetFeedControl(FeedControl feedControl)
Description copied from interface:ActivityServiceFor current user, unset feed control- Specified by:
unsetFeedControlin interfaceActivityService- Parameters:
feedControl- - required
-
existsFeedControl
public boolean existsFeedControl(FeedControl feedControl)
Description copied from interface:ActivityServiceFor current user, does the feed control exist ?- Specified by:
existsFeedControlin interfaceActivityService- Parameters:
feedControl- - required- Returns:
- true, if user feed control exists
-
-