Package org.alfresco.repo.forum
Class CommentServiceImpl
- java.lang.Object
-
- org.springframework.extensions.surf.util.AbstractLifecycleBean
-
- org.alfresco.repo.forum.CommentServiceImpl
-
- All Implemented Interfaces:
EventListener,CommentService,NodeServicePolicies.BeforeDeleteNodePolicy,NodeServicePolicies.OnUpdatePropertiesPolicy,ClassPolicy,Policy,org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware,org.springframework.context.ApplicationListener
public class CommentServiceImpl extends org.springframework.extensions.surf.util.AbstractLifecycleBean implements CommentService, NodeServicePolicies.BeforeDeleteNodePolicy, NodeServicePolicies.OnUpdatePropertiesPolicy
- Since:
- 4.0
- Author:
- Neil Mc Erlean
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.alfresco.repo.policy.Policy
Policy.Arg
-
-
Field Summary
-
Fields inherited from interface org.alfresco.repo.forum.CommentService
CAN_DELETE, CAN_EDIT
-
Fields inherited from interface org.alfresco.repo.node.NodeServicePolicies.BeforeDeleteNodePolicy
QNAME
-
Fields inherited from interface org.alfresco.repo.node.NodeServicePolicies.OnUpdatePropertiesPolicy
ARG_0, ARG_1, ARG_2, QNAME
-
-
Constructor Summary
Constructors Constructor Description CommentServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbeforeDeleteNode(NodeRef commentNodeRef)Called before a node is deleted.NodeRefcreateComment(NodeRef discussableNode, String title, String comment, boolean suppressRollups)Creates a comment for the discussableNodevoiddeleteComment(NodeRef commentNodeRef)Deletes the comment for the discussableNodeMap<String,Boolean>getCommentPermissions(NodeRef discussableNode, NodeRef commentNodeRef)canEdit / canDeleteNodeRefgetDiscussableAncestor(NodeRef descendantNodeRef)Thi method retrieves the ancestor in the repository containment hierarchy having thefm:discussableaspect.NodeRefgetShareCommentsTopic(NodeRef discussableNode)This method retrieves thefm:topicNodeRef which holds the Share comments for the specifiedfm:discussablenode.PagingResults<NodeRef>listComments(NodeRef discussableNode, PagingRequest paging)Returns a paged list of comments.protected voidonBootstrap(org.springframework.context.ApplicationEvent event)protected voidonShutdown(org.springframework.context.ApplicationEvent event)voidonUpdateProperties(NodeRef commentNodeRef, Map<QName,Serializable> before, Map<QName,Serializable> after)Called after a node's properties have been changed.voidsetActivityService(ActivityService activityService)voidsetBehaviourFilter(BehaviourFilter behaviourFilter)voidsetCannedQueryRegistry(NamedObjectRegistry<CannedQueryFactory<? extends Object>> cannedQueryRegistry)voidsetContentService(ContentService contentService)voidsetDictionaryService(DictionaryService dictionaryService)voidsetLockService(LockService lockService)voidsetNodeService(NodeService nodeService)voidsetPermissionService(PermissionService permissionService)voidsetPolicyComponent(PolicyComponent policyComponent)voidsetSiteService(SiteService siteService)voidupdateComment(NodeRef commentNodeRef, String title, String comment)Updates the comment
-
-
-
Method Detail
-
setSiteService
public void setSiteService(SiteService siteService)
-
setActivityService
public void setActivityService(ActivityService activityService)
-
setNodeService
public void setNodeService(NodeService nodeService)
-
setContentService
public void setContentService(ContentService contentService)
-
setCannedQueryRegistry
public void setCannedQueryRegistry(NamedObjectRegistry<CannedQueryFactory<? extends Object>> cannedQueryRegistry)
-
setPolicyComponent
public void setPolicyComponent(PolicyComponent policyComponent)
-
setBehaviourFilter
public void setBehaviourFilter(BehaviourFilter behaviourFilter)
-
setPermissionService
public void setPermissionService(PermissionService permissionService)
-
setLockService
public void setLockService(LockService lockService)
-
setDictionaryService
public void setDictionaryService(DictionaryService dictionaryService)
-
onBootstrap
protected void onBootstrap(org.springframework.context.ApplicationEvent event)
- Specified by:
onBootstrapin classorg.springframework.extensions.surf.util.AbstractLifecycleBean
-
onShutdown
protected void onShutdown(org.springframework.context.ApplicationEvent event)
- Specified by:
onShutdownin classorg.springframework.extensions.surf.util.AbstractLifecycleBean
-
getDiscussableAncestor
public NodeRef getDiscussableAncestor(NodeRef descendantNodeRef)
Description copied from interface:CommentServiceThi method retrieves the ancestor in the repository containment hierarchy having thefm:discussableaspect.- Specified by:
getDiscussableAncestorin interfaceCommentService- Parameters:
descendantNodeRef- The nodeRef which descends from the f:discussable node.- Returns:
- the fm:discussable ancestor if there is one, else null
-
listComments
public PagingResults<NodeRef> listComments(NodeRef discussableNode, PagingRequest paging)
Description copied from interface:CommentServiceReturns a paged list of comments.- Specified by:
listCommentsin interfaceCommentService- Parameters:
discussableNode- the node which is being commented on .paging- paging.- Returns:
- a list of comment nodes
-
getShareCommentsTopic
public NodeRef getShareCommentsTopic(NodeRef discussableNode)
Description copied from interface:CommentServiceThis method retrieves thefm:topicNodeRef which holds the Share comments for the specifiedfm:discussablenode.- Specified by:
getShareCommentsTopicin interfaceCommentService- Parameters:
discussableNode- the node whose Share comments are sought.- Returns:
- the fm:topic NodeRef, if one exists, else null.
-
createComment
public NodeRef createComment(NodeRef discussableNode, String title, String comment, boolean suppressRollups)
Description copied from interface:CommentServiceCreates a comment for the discussableNode- Specified by:
createCommentin interfaceCommentService- Parameters:
discussableNode- the node in Share which is being commented on .title- - title of the commentcomment- - body of the commentsuppressRollups- - should it suppressRollups- Returns:
- NodeRef - the created node reference
-
updateComment
public void updateComment(NodeRef commentNodeRef, String title, String comment)
Description copied from interface:CommentServiceUpdates the comment- Specified by:
updateCommentin interfaceCommentService- Parameters:
commentNodeRef- the comment node.title- - title of the commentcomment- - body of the comment
-
deleteComment
public void deleteComment(NodeRef commentNodeRef)
Description copied from interface:CommentServiceDeletes the comment for the discussableNode- Specified by:
deleteCommentin interfaceCommentService- Parameters:
commentNodeRef- the node in Share which is being commented on.
-
getCommentPermissions
public Map<String,Boolean> getCommentPermissions(NodeRef discussableNode, NodeRef commentNodeRef)
Description copied from interface:CommentServicecanEdit / canDelete- Specified by:
getCommentPermissionsin interfaceCommentService- Returns:
-
onUpdateProperties
public void onUpdateProperties(NodeRef commentNodeRef, Map<QName,Serializable> before, Map<QName,Serializable> after)
Description copied from interface:NodeServicePolicies.OnUpdatePropertiesPolicyCalled after a node's properties have been changed.- Specified by:
onUpdatePropertiesin interfaceNodeServicePolicies.OnUpdatePropertiesPolicy- Parameters:
commentNodeRef- reference to the updated nodebefore- the node's properties before the changeafter- the node's properties after the change
-
beforeDeleteNode
public void beforeDeleteNode(NodeRef commentNodeRef)
Description copied from interface:NodeServicePolicies.BeforeDeleteNodePolicyCalled before a node is deleted.- Specified by:
beforeDeleteNodein interfaceNodeServicePolicies.BeforeDeleteNodePolicy- Parameters:
commentNodeRef- the node reference
-
-