public class SubscriptionServiceImpl extends Object implements SubscriptionService
Modifier and Type | Field and Description |
---|---|
protected ActionService |
actionService |
protected boolean |
active |
protected ActivityService |
activityService |
protected AuthorityService |
authorityService |
protected FileFolderService |
fileFolderService |
protected org.alfresco.service.namespace.NamespaceService |
namespaceService |
protected org.alfresco.service.cmr.repository.NodeService |
nodeService |
protected PersonService |
personService |
protected org.alfresco.service.cmr.search.SearchService |
searchService |
protected SubscriptionsDAO |
subscriptionsDAO |
Constructor and Description |
---|
SubscriptionServiceImpl() |
Modifier and Type | Method and Description |
---|---|
protected void |
checkEnabled()
Checks if the subscription service is enabled.
|
protected void |
checkRead(String userId,
boolean checkPrivate)
Checks if the current user is allowed to get subscription data.
|
protected void |
checkUserNode(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Checks if the node is a user node and throws an exception if it id not.
|
protected void |
checkWrite(String userId)
Checks if the current user is allowed to get change data.
|
void |
follow(String userId,
String userToFollow)
Follows a user.
|
boolean |
follows(String userId,
String userToFollow)
Returns if the user follows to the given other user.
|
protected String |
getEmailTemplateRef()
Returns the NodeRef of the email template or
null if the
template coudln't be found. |
PagingFollowingResults |
getFollowers(String userId,
org.alfresco.query.PagingRequest pagingRequest)
Returns a list of users that follow the given user.
|
int |
getFollowersCount(String userId)
Returns how many users follow the given user.
|
PagingFollowingResults |
getFollowing(String userId,
org.alfresco.query.PagingRequest pagingRequest)
Returns a list of users that the given user follows.
|
int |
getFollowingCount(String userId)
Returns how many users the given user follows.
|
int |
getSubscriptionCount(String userId,
SubscriptionItemTypeEnum type)
Returns how many nodes the given user has subscribed to.
|
PagingSubscriptionResults |
getSubscriptions(String userId,
SubscriptionItemTypeEnum type,
org.alfresco.query.PagingRequest pagingRequest)
Returns the nodes a user has subscribed to.
|
protected org.alfresco.service.cmr.repository.NodeRef |
getUserNodeRef(String userId)
Gets the user node ref from the user id.
|
boolean |
hasSubscribed(String userId,
org.alfresco.service.cmr.repository.NodeRef node)
Returns if the user has subscribed to the given node.
|
boolean |
isActive()
Returns if subscription are enabled for this system.
|
boolean |
isSubscriptionListPrivate(String userId)
Returns if the subscription list of the given user is set to private.
|
protected void |
sendFollowingMail(String userId,
String userToFollow)
Sends an email to the person that is followed.
|
void |
setActionService(ActionService actionService)
Sets the action service.
|
void |
setActive(boolean active) |
void |
setActivityService(ActivityService activictyService)
Sets the activity service.
|
void |
setAuthorityService(AuthorityService authorityService)
Sets the authority service.
|
void |
setFileFolderService(FileFolderService fileFolderService)
Set the fileFolder service.
|
void |
setFollowingEmailTemplateLocation(RepositoryLocation followingEmailTemplateLocation) |
void |
setNamespaceService(org.alfresco.service.namespace.NamespaceService namespaceService)
Set the namespace service.
|
void |
setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
Sets the node service.
|
void |
setPersonService(PersonService personService)
Sets the person service.
|
void |
setSearchService(org.alfresco.service.cmr.search.SearchService searchService)
Set the search service.
|
void |
setSubscriptionListPrivate(String userId,
boolean isPrivate)
Sets or unsets the subscription list of the given user to private.
|
void |
setSubscriptionsDAO(SubscriptionsDAO subscriptionsDAO)
Sets the subscriptions DAO.
|
void |
subscribe(String userId,
org.alfresco.service.cmr.repository.NodeRef node)
Subscribes to a node.
|
void |
unfollow(String userId,
String userToUnfollow)
Unfollows a user.
|
void |
unsubscribe(String userId,
org.alfresco.service.cmr.repository.NodeRef node)
Unsubscribes from a node.
|
protected SubscriptionsDAO subscriptionsDAO
protected org.alfresco.service.cmr.repository.NodeService nodeService
protected PersonService personService
protected ActivityService activityService
protected AuthorityService authorityService
protected ActionService actionService
protected org.alfresco.service.cmr.search.SearchService searchService
protected org.alfresco.service.namespace.NamespaceService namespaceService
protected FileFolderService fileFolderService
protected boolean active
public void setSubscriptionsDAO(SubscriptionsDAO subscriptionsDAO)
public final void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
public final void setPersonService(PersonService personService)
public final void setActivityService(ActivityService activictyService)
public final void setAuthorityService(AuthorityService authorityService)
public final void setActionService(ActionService actionService)
public final void setSearchService(org.alfresco.service.cmr.search.SearchService searchService)
public final void setNamespaceService(org.alfresco.service.namespace.NamespaceService namespaceService)
public final void setFileFolderService(FileFolderService fileFolderService)
public final void setActive(boolean active)
public void setFollowingEmailTemplateLocation(RepositoryLocation followingEmailTemplateLocation)
public PagingSubscriptionResults getSubscriptions(String userId, SubscriptionItemTypeEnum type, org.alfresco.query.PagingRequest pagingRequest)
SubscriptionService
getSubscriptions
in interface SubscriptionService
userId
- the id of the usertype
- the type of the nodespagingRequest
- paging detailspublic int getSubscriptionCount(String userId, SubscriptionItemTypeEnum type)
SubscriptionService
getSubscriptionCount
in interface SubscriptionService
userId
- the id of the usertype
- the type of the nodespublic void subscribe(String userId, org.alfresco.service.cmr.repository.NodeRef node)
SubscriptionService
subscribe
in interface SubscriptionService
userId
- id of the usernode
- the nodepublic void unsubscribe(String userId, org.alfresco.service.cmr.repository.NodeRef node)
SubscriptionService
unsubscribe
in interface SubscriptionService
userId
- id of the usernode
- the nodepublic boolean hasSubscribed(String userId, org.alfresco.service.cmr.repository.NodeRef node)
SubscriptionService
hasSubscribed
in interface SubscriptionService
userId
- id of the usernode
- the nodepublic PagingFollowingResults getFollowing(String userId, org.alfresco.query.PagingRequest pagingRequest)
SubscriptionService
getFollowing
in interface SubscriptionService
userId
- id of the userpagingRequest
- paging detailspublic int getFollowingCount(String userId)
SubscriptionService
getFollowingCount
in interface SubscriptionService
userId
- the id of the userpublic PagingFollowingResults getFollowers(String userId, org.alfresco.query.PagingRequest pagingRequest)
SubscriptionService
getFollowers
in interface SubscriptionService
userId
- id of the userpagingRequest
- paging detailspublic int getFollowersCount(String userId)
SubscriptionService
getFollowersCount
in interface SubscriptionService
userId
- the id of the userpublic void follow(String userId, String userToFollow)
SubscriptionService
follow
in interface SubscriptionService
userId
- the id of the useruserToFollow
- the id of the user to followpublic void unfollow(String userId, String userToUnfollow)
SubscriptionService
unfollow
in interface SubscriptionService
userId
- the id of the useruserToUnfollow
- the id of the user to unfollowpublic boolean follows(String userId, String userToFollow)
SubscriptionService
follows
in interface SubscriptionService
userId
- id of the useruserToFollow
- the id of the other userpublic void setSubscriptionListPrivate(String userId, boolean isPrivate)
SubscriptionService
setSubscriptionListPrivate
in interface SubscriptionService
userId
- the id of the userisPrivate
- true
- set list private,
false
- set list publicpublic boolean isSubscriptionListPrivate(String userId)
SubscriptionService
isSubscriptionListPrivate
in interface SubscriptionService
userId
- the id of the userpublic boolean isActive()
SubscriptionService
isActive
in interface ActivateableBean
isActive
in interface SubscriptionService
true
if this bean is activeprotected void checkEnabled()
protected void checkRead(String userId, boolean checkPrivate)
protected void checkWrite(String userId)
protected org.alfresco.service.cmr.repository.NodeRef getUserNodeRef(String userId)
protected void checkUserNode(org.alfresco.service.cmr.repository.NodeRef nodeRef)
protected void sendFollowingMail(String userId, String userToFollow)
protected String getEmailTemplateRef()
null
if the
template coudln't be found.Copyright © 2005–2017 Alfresco Software. All rights reserved.