Class SubscriptionServiceImpl

java.lang.Object
org.alfresco.repo.subscriptions.SubscriptionServiceImpl
All Implemented Interfaces:
ActivateableBean, SubscriptionService

public class SubscriptionServiceImpl extends Object implements SubscriptionService
  • Field Details

  • Constructor Details

    • SubscriptionServiceImpl

      public SubscriptionServiceImpl()
  • Method Details

    • setSubscriptionsDAO

      public void setSubscriptionsDAO(SubscriptionsDAO subscriptionsDAO)
      Sets the subscriptions DAO.
    • setNodeService

      public final void setNodeService(NodeService nodeService)
      Sets the node service.
    • setPersonService

      public final void setPersonService(PersonService personService)
      Sets the person service.
    • setActivityService

      public final void setActivityService(ActivityService activictyService)
      Sets the activity service.
    • setAuthorityService

      public final void setAuthorityService(AuthorityService authorityService)
      Sets the authority service.
    • setActionService

      public final void setActionService(ActionService actionService)
      Sets the action service.
    • setSearchService

      public final void setSearchService(SearchService searchService)
      Set the search service.
    • setNamespaceService

      public final void setNamespaceService(NamespaceService namespaceService)
      Set the namespace service.
    • setFileFolderService

      public final void setFileFolderService(FileFolderService fileFolderService)
      Set the fileFolder service.
    • setActive

      public final void setActive(boolean active)
    • setFollowingEmailTemplateLocation

      public void setFollowingEmailTemplateLocation(RepositoryLocation followingEmailTemplateLocation)
    • getSubscriptions

      public PagingSubscriptionResults getSubscriptions(String userId, SubscriptionItemTypeEnum type, org.alfresco.query.PagingRequest pagingRequest)
      Description copied from interface: SubscriptionService
      Returns the nodes a user has subscribed to.
      Specified by:
      getSubscriptions in interface SubscriptionService
      Parameters:
      userId - the id of the user
      type - the type of the nodes
      pagingRequest - paging details
    • getSubscriptionCount

      public int getSubscriptionCount(String userId, SubscriptionItemTypeEnum type)
      Description copied from interface: SubscriptionService
      Returns how many nodes the given user has subscribed to.
      Specified by:
      getSubscriptionCount in interface SubscriptionService
      Parameters:
      userId - the id of the user
      type - the type of the nodes
    • subscribe

      public void subscribe(String userId, NodeRef node)
      Description copied from interface: SubscriptionService
      Subscribes to a node.
      Specified by:
      subscribe in interface SubscriptionService
      Parameters:
      userId - id of the user
      node - the node
    • unsubscribe

      public void unsubscribe(String userId, NodeRef node)
      Description copied from interface: SubscriptionService
      Unsubscribes from a node.
      Specified by:
      unsubscribe in interface SubscriptionService
      Parameters:
      userId - id of the user
      node - the node
    • hasSubscribed

      public boolean hasSubscribed(String userId, NodeRef node)
      Description copied from interface: SubscriptionService
      Returns if the user has subscribed to the given node.
      Specified by:
      hasSubscribed in interface SubscriptionService
      Parameters:
      userId - id of the user
      node - the node
    • getFollowing

      public PagingFollowingResults getFollowing(String userId, org.alfresco.query.PagingRequest pagingRequest)
      Description copied from interface: SubscriptionService
      Returns a list of users that the given user follows.
      Specified by:
      getFollowing in interface SubscriptionService
      Parameters:
      userId - id of the user
      pagingRequest - paging details
    • getFollowingCount

      public int getFollowingCount(String userId)
      Description copied from interface: SubscriptionService
      Returns how many users the given user follows.
      Specified by:
      getFollowingCount in interface SubscriptionService
      Parameters:
      userId - the id of the user
    • getFollowers

      public PagingFollowingResults getFollowers(String userId, org.alfresco.query.PagingRequest pagingRequest)
      Description copied from interface: SubscriptionService
      Returns a list of users that follow the given user.
      Specified by:
      getFollowers in interface SubscriptionService
      Parameters:
      userId - id of the user
      pagingRequest - paging details
    • getFollowersCount

      public int getFollowersCount(String userId)
      Description copied from interface: SubscriptionService
      Returns how many users follow the given user.
      Specified by:
      getFollowersCount in interface SubscriptionService
      Parameters:
      userId - the id of the user
    • follow

      public void follow(String userId, String userToFollow)
      Description copied from interface: SubscriptionService
      Follows a user.
      Specified by:
      follow in interface SubscriptionService
      Parameters:
      userId - the id of the user
      userToFollow - the id of the user to follow
    • unfollow

      public void unfollow(String userId, String userToUnfollow)
      Description copied from interface: SubscriptionService
      Unfollows a user.
      Specified by:
      unfollow in interface SubscriptionService
      Parameters:
      userId - the id of the user
      userToUnfollow - the id of the user to unfollow
    • follows

      public boolean follows(String userId, String userToFollow)
      Description copied from interface: SubscriptionService
      Returns if the user follows to the given other user.
      Specified by:
      follows in interface SubscriptionService
      Parameters:
      userId - id of the user
      userToFollow - the id of the other user
    • setSubscriptionListPrivate

      public void setSubscriptionListPrivate(String userId, boolean isPrivate)
      Description copied from interface: SubscriptionService
      Sets or unsets the subscription list of the given user to private.
      Specified by:
      setSubscriptionListPrivate in interface SubscriptionService
      Parameters:
      userId - the id of the user
      isPrivate - true - set list private, false - set list public
    • isSubscriptionListPrivate

      public boolean isSubscriptionListPrivate(String userId)
      Description copied from interface: SubscriptionService
      Returns if the subscription list of the given user is set to private.
      Specified by:
      isSubscriptionListPrivate in interface SubscriptionService
      Parameters:
      userId - the id of the user
    • isActive

      public boolean isActive()
      Description copied from interface: SubscriptionService
      Returns if subscription are enabled for this system.
      Specified by:
      isActive in interface ActivateableBean
      Specified by:
      isActive in interface SubscriptionService
      Returns:
      true if this bean is active
    • checkEnabled

      protected void checkEnabled()
      Checks if the subscription service is enabled.
    • checkRead

      protected void checkRead(String userId, boolean checkPrivate)
      Checks if the current user is allowed to get subscription data.
    • checkWrite

      protected void checkWrite(String userId)
      Checks if the current user is allowed to get change data.
    • getUserNodeRef

      protected NodeRef getUserNodeRef(String userId)
      Gets the user node ref from the user id.
    • checkUserNode

      protected void checkUserNode(NodeRef nodeRef)
      Checks if the node is a user node and throws an exception if it id not.
    • sendFollowingMail

      protected void sendFollowingMail(String userId, String userToFollow)
      Sends an email to the person that is followed.
    • getEmailTemplateRef

      protected String getEmailTemplateRef()
      Returns the NodeRef of the email template or null if the template coudln't be found.