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 class org.springframework.extensions.surf.util.AbstractLifecycleBean
logFields inherited from interface org.alfresco.repo.forum.CommentService
CAN_DELETE, CAN_EDITFields inherited from interface org.alfresco.repo.node.NodeServicePolicies.BeforeDeleteNodePolicy
QNAMEFields inherited from interface org.alfresco.repo.node.NodeServicePolicies.OnUpdatePropertiesPolicy
ARG_0, ARG_1, ARG_2, QNAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbeforeDeleteNode(NodeRef commentNodeRef) Called before a node is deleted.createComment(NodeRef discussableNode, String title, String comment, boolean suppressRollups) Creates a comment for the discussableNodevoiddeleteComment(NodeRef commentNodeRef) Deletes the comment for the discussableNodegetCommentPermissions(NodeRef discussableNode, NodeRef commentNodeRef) canEdit / canDeletegetDiscussableAncestor(NodeRef descendantNodeRef) Thi method retrieves the ancestor in the repository containment hierarchy having thefm:discussableaspect.getShareCommentsTopic(NodeRef discussableNode) This method retrieves thefm:topicNodeRef which holds the Share comments for the specifiedfm:discussablenode.org.alfresco.query.PagingResults<NodeRef>listComments(NodeRef discussableNode, org.alfresco.query.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(org.alfresco.util.registry.NamedObjectRegistry<org.alfresco.query.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 commentMethods inherited from class org.springframework.extensions.surf.util.AbstractLifecycleBean
getApplicationContext, onApplicationEvent, setApplicationContextMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.context.ApplicationListener
supportsAsyncExecution
-
Constructor Details
-
CommentServiceImpl
public CommentServiceImpl()
-
-
Method Details
-
setSiteService
-
setActivityService
-
setNodeService
-
setContentService
-
setCannedQueryRegistry
public void setCannedQueryRegistry(org.alfresco.util.registry.NamedObjectRegistry<org.alfresco.query.CannedQueryFactory<? extends Object>> cannedQueryRegistry) -
setPolicyComponent
-
setBehaviourFilter
-
setPermissionService
-
setLockService
-
setDictionaryService
-
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
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 org.alfresco.query.PagingResults<NodeRef> listComments(NodeRef discussableNode, org.alfresco.query.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
-
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
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
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
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
Description copied from interface:NodeServicePolicies.BeforeDeleteNodePolicyCalled before a node is deleted.- Specified by:
beforeDeleteNodein interfaceNodeServicePolicies.BeforeDeleteNodePolicy- Parameters:
commentNodeRef- the node reference
-