Interface CommentService

  • All Known Implementing Classes:
    CommentServiceImpl

    public interface CommentService
    A service for handling comments.
    Since:
    4.0
    Author:
    Neil Mc Erlean
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String CAN_DELETE  
      static java.lang.String CAN_EDIT  
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      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.
      void updateComment​(org.alfresco.service.cmr.repository.NodeRef commentNodeRef, java.lang.String title, java.lang.String comment)
      Updates the comment
    • Method Detail

      • getDiscussableAncestor

        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.
        Parameters:
        descendantNodeRef - The nodeRef which descends from the f:discussable node.
        Returns:
        the fm:discussable ancestor if there is one, else null
        Throws:
        org.alfresco.error.AlfrescoRuntimeException - if the specified expectedNodeType is not correct.
      • getShareCommentsTopic

        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.
        Parameters:
        discussableNode - the node whose Share comments are sought.
        Returns:
        the fm:topic NodeRef, if one exists, else null.
      • createComment

        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
        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

        void updateComment​(org.alfresco.service.cmr.repository.NodeRef commentNodeRef,
                           java.lang.String title,
                           java.lang.String comment)
        Updates the comment
        Parameters:
        commentNodeRef - the comment node.
        title - - title of the comment
        comment - - body of the comment
      • listComments

        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.
        Parameters:
        discussableNode - the node which is being commented on .
        paging - paging.
        Returns:
        a list of comment nodes
      • deleteComment

        void deleteComment​(org.alfresco.service.cmr.repository.NodeRef commentNodeRef)
        Deletes the comment for the discussableNode
        Parameters:
        commentNodeRef - the node in Share which is being commented on.
      • getCommentPermissions

        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
        Parameters:
        discussableNode -
        commentNodeRef -
        Returns: