Class AbstractCommentManager
- java.lang.Object
-
- org.nuxeo.ecm.platform.comment.impl.AbstractCommentManager
-
- All Implemented Interfaces:
CommentManager
- Direct Known Subclasses:
BridgeCommentManager
,CommentManagerImpl
,PropertyCommentManager
,TreeCommentManager
public abstract class AbstractCommentManager extends Object implements CommentManager
- Since:
- 10.3
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.nuxeo.ecm.platform.comment.api.CommentManager
CommentManager.Feature
-
-
Field Summary
Fields Modifier and Type Field Description static String
COMMENTS_DIRECTORY
-
Constructor Summary
Constructors Constructor Description AbstractCommentManager()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected <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)
List<Comment>
getComments(CoreSession session, String documentId)
Gets all comments for a document.List<Comment>
getComments(CoreSession session, String documentId, boolean sortAscending)
Gets all comments for a document.PartialList<Comment>
getComments(CoreSession session, String documentId, Long pageSize, Long currentPageIndex)
Gets all comments for a document.List<DocumentModel>
getComments(DocumentModel docModel)
Gets comments of a document.List<DocumentModel>
getComments(DocumentModel docModel, DocumentModel parent)
Get comments of a document.protected abstract DocumentModel
getTopLevelDocument(CoreSession session, DocumentModel commentDoc)
DocumentRef
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 Detail
-
COMMENTS_DIRECTORY
public static final String COMMENTS_DIRECTORY
- Since:
- 11.1
- See Also:
- Constant Field Values
-
-
Method Detail
-
getComments
public List<DocumentModel> getComments(DocumentModel docModel)
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
public List<DocumentModel> getComments(DocumentModel docModel, DocumentModel parent)
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
public List<Comment> getComments(CoreSession session, String documentId)
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
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 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
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 interfaceCommentManager
- Parameters:
session
- the CoreSessioncommentRef
- the comment document model ref- Returns:
- the top level ancestor document ref
-
notifyEvent
protected void notifyEvent(CoreSession session, String eventType, DocumentModel commentDoc)
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
protected abstract DocumentModel getTopLevelDocument(CoreSession session, DocumentModel commentDoc)
-
getCommentedDocument
protected abstract DocumentModel getCommentedDocument(CoreSession session, DocumentModel commentDoc)
-
getAuthor
protected NuxeoPrincipal getAuthor(DocumentModel docModel)
-
setFolderPermissions
protected void setFolderPermissions(CoreSession session, DocumentModel documentModel)
-
setCommentPermissions
@Deprecated(since="11.1") protected void setCommentPermissions(CoreSession session, DocumentModel documentModel)
Deprecated.since 11.1. Not used anymore
-
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
-
-