Class ActivityServiceImpl

  • All Implemented Interfaces:
    ActivityPostService, ActivityService, org.springframework.beans.factory.InitializingBean

    public class ActivityServiceImpl
    extends Object
    implements ActivityService, org.springframework.beans.factory.InitializingBean
    Activity Service Implementation
    Author:
    janv
    • Constructor Detail

      • ActivityServiceImpl

        public ActivityServiceImpl()
    • Method Detail

      • setMaxFeedItems

        public void setMaxFeedItems​(int maxFeedItems)
      • setUserNamesAreCaseSensitive

        public void setUserNamesAreCaseSensitive​(boolean userNamesAreCaseSensitive)
      • setFeedControlDAO

        public void setFeedControlDAO​(FeedControlDAO feedControlDAO)
      • setFeedCleaner

        public void setFeedCleaner​(FeedCleaner feedCleaner)
      • setAuthorityService

        public void setAuthorityService​(AuthorityService authorityService)
      • setTenantService

        public void setTenantService​(TenantService tenantService)
      • setSiteService

        public void setSiteService​(SiteService siteService)
      • setActivityPostService

        public void setActivityPostService​(ActivityPostService activityPostService)
      • setPersonService

        public void setPersonService​(PersonService personService)
      • setNodeService

        public void setNodeService​(NodeService nodeService)
      • afterPropertiesSet

        public void afterPropertiesSet()
                                throws Exception
        Specified by:
        afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
        Throws:
        Exception
      • postActivity

        public void postActivity​(String activityType,
                                 String siteId,
                                 String appTool,
                                 String activityData)
        Description copied from interface: ActivityPostService
        Post a custom activity type
        Specified by:
        postActivity in interface ActivityPostService
        Parameters:
        activityType - - required
        siteId - - optional, if null will be stored as empty string
        appTool - - optional, if null will be stored as empty string
        activityData - - required
      • postActivity

        public void postActivity​(String activityType,
                                 String siteId,
                                 String appTool,
                                 String activityData,
                                 String userId)
        Description copied from interface: ActivityPostService
        Post a custom activity type
        Specified by:
        postActivity in interface ActivityPostService
        Parameters:
        activityType - - required
        siteId - - optional, if null will be stored as empty string
        appTool - - optional, if null will be stored as empty string
        activityData - - required
        userId - - required
      • postActivity

        public void postActivity​(String activityType,
                                 String siteId,
                                 String appTool,
                                 NodeRef nodeRef)
        Description copied from interface: ActivityPostService
        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)
        Specified by:
        postActivity in interface ActivityPostService
        Parameters:
        activityType - - required
        siteId - - optional, if null will be stored as empty string
        appTool - - optional, if null will be stored as empty string
        nodeRef - - required - do not use for deleted (or about to be deleted) nodeRef
      • postActivity

        public void postActivity​(String activityType,
                                 String siteId,
                                 String appTool,
                                 NodeRef nodeRef,
                                 String name)
        Description copied from interface: ActivityPostService
        Post a pre-defined activity type - eg. for checked-out nodeRef or renamed nodeRef
        Specified by:
        postActivity in interface ActivityPostService
        Parameters:
        activityType - - required
        siteId - - optional, if null will be stored as empty string
        appTool - - optional, if null will be stored as empty string
        nodeRef - - required - do not use deleted (or about to be deleted) nodeRef
        name - - optional - name of node (eg. prior to name change)
      • postActivity

        public void postActivity​(String activityType,
                                 String siteId,
                                 String appTool,
                                 NodeRef nodeRef,
                                 String name,
                                 QName typeQName,
                                 NodeRef parentNodeRef)
        Description copied from interface: ActivityPostService
        Post a pre-defined activity type - eg. for deleted nodeRef
        Specified by:
        postActivity in interface ActivityPostService
        Parameters:
        activityType - - required
        siteId - - optional, if null will be stored as empty string
        appTool - - optional, if null will be stored as empty string
        nodeRef - - required - can be a deleted (or about to be deleted) nodeRef
        name - - optional - name of name
        typeQName - - optional - type of node
        parentNodeRef - - required - used to lookup path/displayPath
      • postActivity

        public void postActivity​(String activityType,
                                 String siteId,
                                 String appTool,
                                 String jsonActivityData,
                                 org.alfresco.sync.repo.Client client)
        Description copied from interface: ActivityPostService
        Post a custom activity type
        Specified by:
        postActivity in interface ActivityPostService
        Parameters:
        activityType - - required
        siteId - - optional, if null will be stored as empty string
        appTool - - optional, if null will be stored as empty string
        jsonActivityData - - required
      • postActivity

        public void postActivity​(String activityType,
                                 String siteId,
                                 String appTool,
                                 String jsonActivityData,
                                 org.alfresco.sync.repo.Client client,
                                 FileInfo contentNodeInfo)
        Description copied from interface: ActivityPostService
        Post a custom activity type
        Specified by:
        postActivity in interface ActivityPostService
        Parameters:
        activityType - - required
        siteId - - optional, if null will be stored as empty string
        appTool - - optional, if null will be stored as empty string
        jsonActivityData - - required
        contentNodeInfo - FileInfo
      • getUserFeedEntries

        public List<String> getUserFeedEntries​(String feedUserId,
                                               String siteId)
        Description copied from interface: ActivityService
        Retrieve 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:
        getUserFeedEntries in interface ActivityService
        Parameters:
        feedUserId - - required
        siteId - - optional, if set then will filter by given siteId else return all sites
        Returns:
        list of JSON feed entries
      • getUserFeedEntries

        public List<String> getUserFeedEntries​(String feedUserId,
                                               String siteId,
                                               boolean excludeThisUser,
                                               boolean excludeOtherUsers)
        Description copied from interface: ActivityService
        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. 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:
        getUserFeedEntries in interface ActivityService
        Parameters:
        feedUserId - - required
        siteId - - optional, if set then will filter by given siteId else return all sites
        excludeThisUser - - 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 List<String> getUserFeedEntries​(String feedUserId,
                                               String siteId,
                                               boolean excludeThisUser,
                                               boolean excludeOtherUsers,
                                               Set<String> userFilter,
                                               Set<String> actvityFilter)
        Description copied from interface: ActivityService
        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. 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:
        getUserFeedEntries in interface ActivityService
        Parameters:
        feedUserId - - required
        siteId - - optional, if set then will filter by given siteId else return all sites
        excludeThisUser - - 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 set
        actvityFilter - - if not NULL then will only return activities that are in this set
        Returns:
        list of JSON feed entries
      • getUserAvatarNodeRef

        protected NodeRef getUserAvatarNodeRef​(ActivityFeedEntity activityFeed,
                                               Map<String,​NodeRef> userIdToAvatarNodeRefCache)
        Attempts to find the avatar NodeRef for the user in supplied ActivityFeedEntity. As this is aimed at setting the NodeRef from 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 fetched NodeRefs for efficiency.
        Parameters:
        activityFeed - ActivityFeedEntity
        Returns:
        NodeRef
      • getUserFeedEntries

        public List<ActivityFeedEntity> getUserFeedEntries​(String feedUserId,
                                                           String siteId,
                                                           boolean excludeThisUser,
                                                           boolean excludeOtherUsers,
                                                           long minFeedId)
        Description copied from interface: ActivityService
        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. 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:
        getUserFeedEntries in interface ActivityService
        Parameters:
        feedUserId - - required
        siteId - - optional, if set then will filter by given siteId else return all sites
        excludeThisUser - - 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 List<ActivityFeedEntity> getUserFeedEntries​(String feedUserId,
                                                           String siteId,
                                                           boolean excludeThisUser,
                                                           boolean excludeOtherUsers,
                                                           Set<String> userFilter,
                                                           Set<String> actvityFilter,
                                                           long minFeedId)
        Description copied from interface: ActivityService
        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. 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:
        getUserFeedEntries in interface ActivityService
        Parameters:
        feedUserId - - required
        siteId - - optional, if set then will filter by given siteId else return all sites
        excludeThisUser - - 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 set
        actvityFilter - - if not NULL then will only return activities that are in this set
        minFeedId - - inclusive from min feed DB id, if -1 then return all available
        Returns:
        list of JSON feed entries
      • setFeedControl

        public void setFeedControl​(FeedControl feedControl)
        Description copied from interface: ActivityService
        For current user, set feed control (opt-out) for a site or an appTool or a site/appTool combination
        Specified by:
        setFeedControl in interface ActivityService
        Parameters:
        feedControl - - required
      • existsFeedControl

        public boolean existsFeedControl​(FeedControl feedControl)
        Description copied from interface: ActivityService
        For current user, does the feed control exist ?
        Specified by:
        existsFeedControl in interface ActivityService
        Parameters:
        feedControl - - required
        Returns:
        true, if user feed control exists