Class AbstractCommentManager
java.lang.Object
org.nuxeo.ecm.platform.comment.impl.AbstractCommentManager
- All Implemented Interfaces:
CommentManager
- Direct Known Subclasses:
BridgeCommentManager
,CommentManagerImpl
,PropertyCommentManager
,TreeCommentManager
- Since:
- 10.3
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.nuxeo.ecm.platform.comment.api.CommentManager
CommentManager.Feature
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected <S extends Set<String> & Serializable>
ScomputeAncestorIds
(CoreSession session, String parentId) protected void
fillCommentForCreation
(CoreSession session, Comment comment) protected NuxeoPrincipal
getAuthor
(DocumentModel docModel) protected abstract DocumentModel
getCommentedDocument
(CoreSession session, DocumentModel commentDoc) getComments
(CoreSession session, String documentId) Gets all comments for a document.getComments
(CoreSession session, String documentId, boolean sortAscending) Gets all comments for a document.getComments
(CoreSession session, String documentId, Long pageSize, Long currentPageIndex) Gets all comments for a document.getComments
(DocumentModel docModel) Gets comments of a document.getComments
(DocumentModel docModel, DocumentModel parent) Get comments of a document.protected abstract DocumentModel
getTopLevelDocument
(CoreSession session, DocumentModel commentDoc) getTopLevelDocumentRef
(CoreSession session, DocumentRef commentRef) Gets the top level ancestor document ref for the given document model comment ref.protected void
notifyEvent
(CoreSession session, String eventType, DocumentModel commentDoc) Notifies the event of typeeventType
on the givencommentDoc
.protected void
notifyEvent
(CoreSession session, String eventType, DocumentModel commentedDoc, DocumentModel commentDoc) protected void
notifyEvent
(CoreSession session, String eventType, DocumentModel topLevelDoc, DocumentModel commentedDoc, DocumentModel commentDoc) protected void
setCommentPermissions
(CoreSession session, DocumentModel documentModel) Deprecated.since 11.1.protected void
setFolderPermissions
(CoreSession session, DocumentModel documentModel) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.nuxeo.ecm.platform.comment.api.CommentManager
createComment, createComment, createComment, createComment, createComment, createLocatedComment, deleteComment, deleteComment, deleteExternalComment, deleteExternalComment, getComment, getComments, getComments, getComments, getDocumentsForComment, getExternalComment, getExternalComment, getThreadForComment, hasFeature, updateComment, updateExternalComment, updateExternalComment
-
Field Details
-
COMMENTS_DIRECTORY
- Since:
- 11.1
- See Also:
-
-
Constructor Details
-
AbstractCommentManager
public AbstractCommentManager()
-
-
Method Details
-
getComments
Description copied from interface:CommentManager
Gets comments of a document.- Specified by:
getComments
in interfaceCommentManager
- Parameters:
docModel
- the document model- Returns:
- the list of comments
-
getComments
Description copied from interface:CommentManager
Get comments of a document.- Specified by:
getComments
in interfaceCommentManager
- Parameters:
docModel
- the document modelparent
- the parent document model- Returns:
- the list of comments
-
getComments
Description copied from interface:CommentManager
Gets all comments for a document.- Specified by:
getComments
in interfaceCommentManager
- Parameters:
session
- the core sessiondocumentId
- 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
Description copied from interface:CommentManager
Gets all comments for a document.- Specified by:
getComments
in interfaceCommentManager
- Parameters:
session
- the core sessiondocumentId
- the document idsortAscending
- 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 interfaceCommentManager
- Parameters:
session
- the core sessiondocumentId
- the document idpageSize
- the page size to query, give null or 0 to disable paginationcurrentPageIndex
- 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
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 interfaceCommentManager
- Parameters:
session
- the CoreSessioncommentRef
- the comment document model ref- Returns:
- the top level ancestor document ref
-
notifyEvent
Notifies the event of typeeventType
on the givencommentDoc
.- Parameters:
session
- the sessioneventType
- the event type to firecommentDoc
- the document model of the comment- Since:
- 11.1
- Implementation Requirements:
- This method uses internally
notifyEvent(CoreSession, String, DocumentModel, DocumentModel)
-
notifyEvent
protected void notifyEvent(CoreSession session, String eventType, DocumentModel commentedDoc, DocumentModel commentDoc) -
notifyEvent
protected void notifyEvent(CoreSession session, String eventType, DocumentModel topLevelDoc, DocumentModel commentedDoc, DocumentModel commentDoc) - Since:
- 11.1
-
getTopLevelDocument
-
getCommentedDocument
protected abstract DocumentModel getCommentedDocument(CoreSession session, DocumentModel commentDoc) -
getAuthor
-
setFolderPermissions
-
setCommentPermissions
@Deprecated(since="11.1") protected void setCommentPermissions(CoreSession session, DocumentModel documentModel) Deprecated.since 11.1. Not used anymore -
fillCommentForCreation
-
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
-