Package org.alfresco.repo.subscriptions
Class SubscriptionServiceImpl
java.lang.Object
org.alfresco.repo.subscriptions.SubscriptionServiceImpl
- All Implemented Interfaces:
ActivateableBean,SubscriptionService
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ActionServiceprotected booleanprotected ActivityServiceprotected AuthorityServiceprotected FileFolderServiceprotected NamespaceServiceprotected NodeServiceprotected PersonServiceprotected SearchServiceprotected SubscriptionsDAO -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidChecks if the subscription service is enabled.protected voidChecks if the current user is allowed to get subscription data.protected voidcheckUserNode(NodeRef nodeRef) Checks if the node is a user node and throws an exception if it id not.protected voidcheckWrite(String userId) Checks if the current user is allowed to get change data.voidFollows a user.booleanReturns if the user follows to the given other user.protected StringReturns the NodeRef of the email template ornullif the template coudln't be found.getFollowers(String userId, org.alfresco.query.PagingRequest pagingRequest) Returns a list of users that follow the given user.intgetFollowersCount(String userId) Returns how many users follow the given user.getFollowing(String userId, org.alfresco.query.PagingRequest pagingRequest) Returns a list of users that the given user follows.intgetFollowingCount(String userId) Returns how many users the given user follows.intgetSubscriptionCount(String userId, SubscriptionItemTypeEnum type) Returns how many nodes the given user has subscribed to.getSubscriptions(String userId, SubscriptionItemTypeEnum type, org.alfresco.query.PagingRequest pagingRequest) Returns the nodes a user has subscribed to.protected NodeRefgetUserNodeRef(String userId) Gets the user node ref from the user id.booleanhasSubscribed(String userId, NodeRef node) Returns if the user has subscribed to the given node.booleanisActive()Returns if subscription are enabled for this system.booleanisSubscriptionListPrivate(String userId) Returns if the subscription list of the given user is set to private.protected voidsendFollowingMail(String userId, String userToFollow) Sends an email to the person that is followed.final voidsetActionService(ActionService actionService) Sets the action service.final voidsetActive(boolean active) final voidsetActivityService(ActivityService activictyService) Sets the activity service.final voidsetAuthorityService(AuthorityService authorityService) Sets the authority service.final voidsetFileFolderService(FileFolderService fileFolderService) Set the fileFolder service.voidsetFollowingEmailTemplateLocation(RepositoryLocation followingEmailTemplateLocation) final voidsetNamespaceService(NamespaceService namespaceService) Set the namespace service.final voidsetNodeService(NodeService nodeService) Sets the node service.final voidsetPersonService(PersonService personService) Sets the person service.final voidsetSearchService(SearchService searchService) Set the search service.voidsetSubscriptionListPrivate(String userId, boolean isPrivate) Sets or unsets the subscription list of the given user to private.voidsetSubscriptionsDAO(SubscriptionsDAO subscriptionsDAO) Sets the subscriptions DAO.voidSubscribes to a node.voidUnfollows a user.voidunsubscribe(String userId, NodeRef node) Unsubscribes from a node.
-
Field Details
-
subscriptionsDAO
-
nodeService
-
personService
-
activityService
-
authorityService
-
actionService
-
searchService
-
namespaceService
-
fileFolderService
-
active
protected boolean active
-
-
Constructor Details
-
SubscriptionServiceImpl
public SubscriptionServiceImpl()
-
-
Method Details
-
setSubscriptionsDAO
Sets the subscriptions DAO. -
setNodeService
Sets the node service. -
setPersonService
Sets the person service. -
setActivityService
Sets the activity service. -
setAuthorityService
Sets the authority service. -
setActionService
Sets the action service. -
setSearchService
Set the search service. -
setNamespaceService
Set the namespace service. -
setFileFolderService
Set the fileFolder service. -
setActive
public final void setActive(boolean active) -
setFollowingEmailTemplateLocation
-
getSubscriptions
public PagingSubscriptionResults getSubscriptions(String userId, SubscriptionItemTypeEnum type, org.alfresco.query.PagingRequest pagingRequest) Description copied from interface:SubscriptionServiceReturns the nodes a user has subscribed to.- Specified by:
getSubscriptionsin interfaceSubscriptionService- Parameters:
userId- the id of the usertype- the type of the nodespagingRequest- paging details
-
getSubscriptionCount
Description copied from interface:SubscriptionServiceReturns how many nodes the given user has subscribed to.- Specified by:
getSubscriptionCountin interfaceSubscriptionService- Parameters:
userId- the id of the usertype- the type of the nodes
-
subscribe
Description copied from interface:SubscriptionServiceSubscribes to a node.- Specified by:
subscribein interfaceSubscriptionService- Parameters:
userId- id of the usernode- the node
-
unsubscribe
Description copied from interface:SubscriptionServiceUnsubscribes from a node.- Specified by:
unsubscribein interfaceSubscriptionService- Parameters:
userId- id of the usernode- the node
-
hasSubscribed
Description copied from interface:SubscriptionServiceReturns if the user has subscribed to the given node.- Specified by:
hasSubscribedin interfaceSubscriptionService- Parameters:
userId- id of the usernode- the node
-
getFollowing
public PagingFollowingResults getFollowing(String userId, org.alfresco.query.PagingRequest pagingRequest) Description copied from interface:SubscriptionServiceReturns a list of users that the given user follows.- Specified by:
getFollowingin interfaceSubscriptionService- Parameters:
userId- id of the userpagingRequest- paging details
-
getFollowingCount
Description copied from interface:SubscriptionServiceReturns how many users the given user follows.- Specified by:
getFollowingCountin interfaceSubscriptionService- Parameters:
userId- the id of the user
-
getFollowers
public PagingFollowingResults getFollowers(String userId, org.alfresco.query.PagingRequest pagingRequest) Description copied from interface:SubscriptionServiceReturns a list of users that follow the given user.- Specified by:
getFollowersin interfaceSubscriptionService- Parameters:
userId- id of the userpagingRequest- paging details
-
getFollowersCount
Description copied from interface:SubscriptionServiceReturns how many users follow the given user.- Specified by:
getFollowersCountin interfaceSubscriptionService- Parameters:
userId- the id of the user
-
follow
Description copied from interface:SubscriptionServiceFollows a user.- Specified by:
followin interfaceSubscriptionService- Parameters:
userId- the id of the useruserToFollow- the id of the user to follow
-
unfollow
Description copied from interface:SubscriptionServiceUnfollows a user.- Specified by:
unfollowin interfaceSubscriptionService- Parameters:
userId- the id of the useruserToUnfollow- the id of the user to unfollow
-
follows
Description copied from interface:SubscriptionServiceReturns if the user follows to the given other user.- Specified by:
followsin interfaceSubscriptionService- Parameters:
userId- id of the useruserToFollow- the id of the other user
-
setSubscriptionListPrivate
Description copied from interface:SubscriptionServiceSets or unsets the subscription list of the given user to private.- Specified by:
setSubscriptionListPrivatein interfaceSubscriptionService- Parameters:
userId- the id of the userisPrivate-true- set list private,false- set list public
-
isSubscriptionListPrivate
Description copied from interface:SubscriptionServiceReturns if the subscription list of the given user is set to private.- Specified by:
isSubscriptionListPrivatein interfaceSubscriptionService- Parameters:
userId- the id of the user
-
isActive
public boolean isActive()Description copied from interface:SubscriptionServiceReturns if subscription are enabled for this system.- Specified by:
isActivein interfaceActivateableBean- Specified by:
isActivein interfaceSubscriptionService- Returns:
trueif this bean is active
-
checkEnabled
protected void checkEnabled()Checks if the subscription service is enabled. -
checkRead
Checks if the current user is allowed to get subscription data. -
checkWrite
Checks if the current user is allowed to get change data. -
getUserNodeRef
Gets the user node ref from the user id. -
checkUserNode
Checks if the node is a user node and throws an exception if it id not. -
sendFollowingMail
Sends an email to the person that is followed. -
getEmailTemplateRef
Returns the NodeRef of the email template ornullif the template coudln't be found.
-