Class AbstractCommentManager

    • Constructor Detail

      • AbstractCommentManager

        public AbstractCommentManager()
    • Method Detail

      • getComments

        public List<Comment> getComments​(CoreSession session,
                                         String documentId)
        Description copied from interface: CommentManager
        Gets all comments for a document.
        Specified by:
        getComments in interface CommentManager
        Parameters:
        session - the core session
        documentId - the document id
        Returns:
        the list of comments, ordered ascending by comment's creation date, or an empty list if no comment is found.
      • getComments

        public List<Comment> getComments​(CoreSession session,
                                         String documentId,
                                         boolean sortAscending)
        Description copied from interface: CommentManager
        Gets all comments for a document.
        Specified by:
        getComments in interface CommentManager
        Parameters:
        session - the core session
        documentId - the document id
        sortAscending - whether to sort ascending or descending
        Returns:
        the list of comments, ordered by comment's creation date and according to sortAscending parameter, or an empty list if no comment is found.
      • getComments

        public PartialList<Comment> getComments​(CoreSession session,
                                                String documentId,
                                                Long pageSize,
                                                Long currentPageIndex)
        Description copied from interface: CommentManager
        Gets all comments for a document.
        Specified by:
        getComments in interface CommentManager
        Parameters:
        session - the core session
        documentId - the document id
        pageSize - the page size to query, give null or 0 to disable pagination
        currentPageIndex - the page index to query, give null or 0 to disable pagination
        Returns:
        the list of comments, ordered ascending by comment's creation date, or an empty list if no comment is found.
      • getTopLevelDocumentRef

        public DocumentRef getTopLevelDocumentRef​(CoreSession session,
                                                  DocumentRef commentRef)
        Description copied from interface: CommentManager
        Gets the top level ancestor document ref for the given document model comment ref. No matter how many levels of comments there is.

        Given a document fileOne, that we comment with commentOne which we reply on with replyOne

        This method will return:

        • CommentManager#getAncestorRef(session, commentOne) = fileOne
        • CommentManager#getAncestorRef(session, replyOne) = fileOne
        Specified by:
        getTopLevelDocumentRef in interface CommentManager
        Parameters:
        session - the CoreSession
        commentRef - the comment document model ref
        Returns:
        the top level ancestor document ref
      • fillCommentForCreation

        protected void fillCommentForCreation​(CoreSession session,
                                              Comment comment)
      • computeAncestorIds

        protected <S extends Set<String> & Serializable> S computeAncestorIds​(CoreSession session,
                                                                              String parentId)
        Parameters:
        session - the session allowing to get parent documents, depending on implementation it should be privileged