Class CommentServiceImpl

    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.alfresco.repo.policy.Policy

        Policy.Arg
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void beforeDeleteNode​(org.alfresco.service.cmr.repository.NodeRef commentNodeRef)
      Called before a node is deleted.
      org.alfresco.service.cmr.repository.NodeRef createComment​(org.alfresco.service.cmr.repository.NodeRef discussableNode, java.lang.String title, java.lang.String comment, boolean suppressRollups)
      Creates a comment for the discussableNode
      void deleteComment​(org.alfresco.service.cmr.repository.NodeRef commentNodeRef)
      Deletes the comment for the discussableNode
      java.util.Map<java.lang.String,​java.lang.Boolean> getCommentPermissions​(org.alfresco.service.cmr.repository.NodeRef discussableNode, org.alfresco.service.cmr.repository.NodeRef commentNodeRef)
      canEdit / canDelete
      org.alfresco.service.cmr.repository.NodeRef getDiscussableAncestor​(org.alfresco.service.cmr.repository.NodeRef descendantNodeRef)
      Thi method retrieves the ancestor in the repository containment hierarchy having the fm:discussable aspect.
      org.alfresco.service.cmr.repository.NodeRef getShareCommentsTopic​(org.alfresco.service.cmr.repository.NodeRef discussableNode)
      This method retrieves the fm:topic NodeRef which holds the Share comments for the specified fm:discussable node.
      org.alfresco.query.PagingResults<org.alfresco.service.cmr.repository.NodeRef> listComments​(org.alfresco.service.cmr.repository.NodeRef discussableNode, org.alfresco.query.PagingRequest paging)
      Returns a paged list of comments.
      protected void onBootstrap​(org.springframework.context.ApplicationEvent event)  
      protected void onShutdown​(org.springframework.context.ApplicationEvent event)  
      void onUpdateProperties​(org.alfresco.service.cmr.repository.NodeRef commentNodeRef, java.util.Map<org.alfresco.service.namespace.QName,​java.io.Serializable> before, java.util.Map<org.alfresco.service.namespace.QName,​java.io.Serializable> after)
      Called after a node's properties have been changed.
      void setActivityService​(ActivityService activityService)  
      void setBehaviourFilter​(BehaviourFilter behaviourFilter)  
      void setCannedQueryRegistry​(org.alfresco.util.registry.NamedObjectRegistry<org.alfresco.query.CannedQueryFactory<? extends java.lang.Object>> cannedQueryRegistry)  
      void setContentService​(ContentService contentService)  
      void setDictionaryService​(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)  
      void setLockService​(LockService lockService)  
      void setNodeService​(org.alfresco.service.cmr.repository.NodeService nodeService)  
      void setPermissionService​(org.alfresco.service.cmr.security.PermissionService permissionService)  
      void setPolicyComponent​(PolicyComponent policyComponent)  
      void setSiteService​(SiteService siteService)  
      void updateComment​(org.alfresco.service.cmr.repository.NodeRef commentNodeRef, java.lang.String title, java.lang.String comment)
      Updates the comment
      • Methods inherited from class org.springframework.extensions.surf.util.AbstractLifecycleBean

        getApplicationContext, onApplicationEvent, setApplicationContext
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CommentServiceImpl

        public CommentServiceImpl()
    • Method Detail

      • setSiteService

        public void setSiteService​(SiteService siteService)
      • setActivityService

        public void setActivityService​(ActivityService activityService)
      • setNodeService

        public void setNodeService​(org.alfresco.service.cmr.repository.NodeService nodeService)
      • setContentService

        public void setContentService​(ContentService contentService)
      • setCannedQueryRegistry

        public void setCannedQueryRegistry​(org.alfresco.util.registry.NamedObjectRegistry<org.alfresco.query.CannedQueryFactory<? extends java.lang.Object>> cannedQueryRegistry)
      • setPolicyComponent

        public void setPolicyComponent​(PolicyComponent policyComponent)
      • setBehaviourFilter

        public void setBehaviourFilter​(BehaviourFilter behaviourFilter)
      • setPermissionService

        public void setPermissionService​(org.alfresco.service.cmr.security.PermissionService permissionService)
      • setLockService

        public void setLockService​(LockService lockService)
      • setDictionaryService

        public void setDictionaryService​(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
      • onBootstrap

        protected void onBootstrap​(org.springframework.context.ApplicationEvent event)
        Specified by:
        onBootstrap in class org.springframework.extensions.surf.util.AbstractLifecycleBean
      • onShutdown

        protected void onShutdown​(org.springframework.context.ApplicationEvent event)
        Specified by:
        onShutdown in class org.springframework.extensions.surf.util.AbstractLifecycleBean
      • getDiscussableAncestor

        public org.alfresco.service.cmr.repository.NodeRef getDiscussableAncestor​(org.alfresco.service.cmr.repository.NodeRef descendantNodeRef)
        Description copied from interface: CommentService
        Thi method retrieves the ancestor in the repository containment hierarchy having the fm:discussable aspect.
        Specified by:
        getDiscussableAncestor in interface CommentService
        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<org.alfresco.service.cmr.repository.NodeRef> listComments​(org.alfresco.service.cmr.repository.NodeRef discussableNode,
                                                                                                          org.alfresco.query.PagingRequest paging)
        Description copied from interface: CommentService
        Returns a paged list of comments.
        Specified by:
        listComments in interface CommentService
        Parameters:
        discussableNode - the node which is being commented on .
        paging - paging.
        Returns:
        a list of comment nodes
      • getShareCommentsTopic

        public org.alfresco.service.cmr.repository.NodeRef getShareCommentsTopic​(org.alfresco.service.cmr.repository.NodeRef discussableNode)
        Description copied from interface: CommentService
        This method retrieves the fm:topic NodeRef which holds the Share comments for the specified fm:discussable node.
        Specified by:
        getShareCommentsTopic in interface CommentService
        Parameters:
        discussableNode - the node whose Share comments are sought.
        Returns:
        the fm:topic NodeRef, if one exists, else null.
      • createComment

        public org.alfresco.service.cmr.repository.NodeRef createComment​(org.alfresco.service.cmr.repository.NodeRef discussableNode,
                                                                         java.lang.String title,
                                                                         java.lang.String comment,
                                                                         boolean suppressRollups)
        Description copied from interface: CommentService
        Creates a comment for the discussableNode
        Specified by:
        createComment in interface CommentService
        Parameters:
        discussableNode - the node in Share which is being commented on .
        title - - title of the comment
        comment - - body of the comment
        suppressRollups - - should it suppressRollups
        Returns:
        NodeRef - the created node reference
      • updateComment

        public void updateComment​(org.alfresco.service.cmr.repository.NodeRef commentNodeRef,
                                  java.lang.String title,
                                  java.lang.String comment)
        Description copied from interface: CommentService
        Updates the comment
        Specified by:
        updateComment in interface CommentService
        Parameters:
        commentNodeRef - the comment node.
        title - - title of the comment
        comment - - body of the comment
      • deleteComment

        public void deleteComment​(org.alfresco.service.cmr.repository.NodeRef commentNodeRef)
        Description copied from interface: CommentService
        Deletes the comment for the discussableNode
        Specified by:
        deleteComment in interface CommentService
        Parameters:
        commentNodeRef - the node in Share which is being commented on.
      • getCommentPermissions

        public java.util.Map<java.lang.String,​java.lang.Boolean> getCommentPermissions​(org.alfresco.service.cmr.repository.NodeRef discussableNode,
                                                                                             org.alfresco.service.cmr.repository.NodeRef commentNodeRef)
        Description copied from interface: CommentService
        canEdit / canDelete
        Specified by:
        getCommentPermissions in interface CommentService
        Returns:
      • onUpdateProperties

        public void onUpdateProperties​(org.alfresco.service.cmr.repository.NodeRef commentNodeRef,
                                       java.util.Map<org.alfresco.service.namespace.QName,​java.io.Serializable> before,
                                       java.util.Map<org.alfresco.service.namespace.QName,​java.io.Serializable> after)
        Description copied from interface: NodeServicePolicies.OnUpdatePropertiesPolicy
        Called after a node's properties have been changed.
        Specified by:
        onUpdateProperties in interface NodeServicePolicies.OnUpdatePropertiesPolicy
        Parameters:
        commentNodeRef - reference to the updated node
        before - the node's properties before the change
        after - the node's properties after the change