public class PropertyCommentManager extends AbstractCommentManager
CommentManager.Feature
Modifier and Type | Field and Description |
---|---|
protected static String |
COMMENT_NAME |
protected static String |
GET_COMMENT_PAGEPROVIDER_NAME |
protected static String |
GET_COMMENTS_FOR_DOC_PAGEPROVIDER_NAME |
protected static String |
HIDDEN_FOLDER_TYPE |
COMMENTS_DIRECTORY
Constructor and Description |
---|
PropertyCommentManager() |
Modifier and Type | Method and Description |
---|---|
Comment |
createComment(CoreSession session,
Comment comment)
Creates a comment.
|
DocumentModel |
createComment(DocumentModel docModel,
DocumentModel commentModel)
Creates a comment document model, filling its properties with given info and linking it to given document.
|
DocumentModel |
createComment(DocumentModel docModel,
DocumentModel parent,
DocumentModel child)
Creates a comment document model, filling its properties with given info and linking it to given document.
|
DocumentModel |
createComment(DocumentModel docModel,
String comment)
Creates a comment.
|
DocumentModel |
createComment(DocumentModel docModel,
String text,
String author)
Creates a comment document model, filling its properties with given info and linking it to given document.
|
DocumentModel |
createLocatedComment(DocumentModel docModel,
DocumentModel comment,
String path)
Creates a comment document model.
|
void |
deleteComment(CoreSession session,
String commentId)
Deletes a comment.
|
void |
deleteComment(DocumentModel docModel,
DocumentModel comment)
Deletes a comment.
|
void |
deleteExternalComment(CoreSession session,
String entityId)
Deletes an external comment.
|
protected DocumentRef |
getAncestorRef(CoreSession session,
DocumentModel documentModel) |
Comment |
getComment(CoreSession session,
String commentId)
Gets a comment.
|
protected String |
getCommentContainerPath(CoreSession session,
String commentedDocumentId) |
List<DocumentModel> |
getComments(CoreSession session,
DocumentModel docModel)
Gets comments of a document.
|
PartialList<Comment> |
getComments(CoreSession session,
String documentId,
Long pageSize,
Long currentPageIndex,
boolean sortAscending)
Gets all comments for a document.
|
List<DocumentModel> |
getComments(DocumentModel docModel,
DocumentModel parent)
Get comments of a document.
|
List<DocumentModel> |
getDocumentsForComment(DocumentModel comment)
Gets documents in relation with a particular comment.
|
Comment |
getExternalComment(CoreSession session,
String entityId)
Gets a comment generated by an external service.
|
protected DocumentModel |
getExternalCommentModel(CoreSession session,
String entityId) |
protected DocumentModel |
getThreadForComment(CoreSession session,
DocumentModel comment) |
DocumentModel |
getThreadForComment(DocumentModel comment)
Gets thread in relation with a given comment (post or comment).
|
boolean |
hasFeature(CommentManager.Feature feature)
Checks if a feature is available.
|
Comment |
updateComment(CoreSession session,
String commentId,
Comment comment)
Updates a comment.
|
Comment |
updateExternalComment(CoreSession session,
String entityId,
Comment comment)
Updates an external comment.
|
computeAncestorIds, getAuthor, getComments, getComments, getComments, getComments, notifyEvent, setCommentPermissions, setFolderPermissions
protected static final String GET_COMMENT_PAGEPROVIDER_NAME
protected static final String GET_COMMENTS_FOR_DOC_PAGEPROVIDER_NAME
protected static final String HIDDEN_FOLDER_TYPE
protected static final String COMMENT_NAME
public PropertyCommentManager()
public List<DocumentModel> getComments(CoreSession session, DocumentModel docModel) throws CommentSecurityException
CommentManager
session
- the core sessiondocModel
- the document modelCommentSecurityException
- if the current user does not have the right permissions on the commented
documentpublic List<DocumentModel> getComments(DocumentModel docModel, DocumentModel parent)
CommentManager
getComments
in interface CommentManager
getComments
in class AbstractCommentManager
docModel
- the document modelparent
- the parent document modelpublic DocumentModel createComment(DocumentModel docModel, String comment)
CommentManager
docModel
- the document to commentcomment
- the comment contentpublic DocumentModel createComment(DocumentModel docModel, String text, String author)
CommentManager
docModel
- the document to commenttext
- the comment contentauthor
- the comment authorpublic DocumentModel createComment(DocumentModel docModel, DocumentModel commentModel) throws CommentSecurityException
CommentManager
docModel
- the document to commentcommentModel
- the comment document modelCommentSecurityException
- if the current user does not have the right permissions on the document to
comment.public DocumentModel createComment(DocumentModel docModel, DocumentModel parent, DocumentModel child)
CommentManager
docModel
- the document to commentparent
- the comment parent document modelchild
- the comment child document modelpublic void deleteComment(DocumentModel docModel, DocumentModel comment)
CommentManager
docModel
- the comment document modelcomment
- the commentpublic List<DocumentModel> getDocumentsForComment(DocumentModel comment)
CommentManager
comment
- the commentpublic DocumentModel getThreadForComment(DocumentModel comment) throws CommentSecurityException
CommentManager
comment
- the commentCommentSecurityException
- if the current user does not have the right permissions on the commented
document.public DocumentModel createLocatedComment(DocumentModel docModel, DocumentModel comment, String path)
CommentManager
docModel
- the document to commentcomment
- the comment contentpath
- the location pathpublic Comment createComment(CoreSession session, Comment comment) throws CommentNotFoundException, CommentSecurityException
CommentManager
session
- the core sessionCommentNotFoundException
- if the document to comment, i.e. comment's parent, does not exist.CommentSecurityException
- if the current user does not have the right permissions on the document to
comment.public Comment getComment(CoreSession session, String commentId) throws CommentNotFoundException, CommentSecurityException
CommentManager
session
- the core sessioncommentId
- the comment idCommentNotFoundException
- if the comment does not existCommentSecurityException
- if the current user does not have the right permissions on the commented
document.public PartialList<Comment> getComments(CoreSession session, String documentId, Long pageSize, Long currentPageIndex, boolean sortAscending) throws CommentSecurityException
CommentManager
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 paginationsortAscending
- whether to sort ascending or descendingCommentSecurityException
- if the current user does not have the right permissions on the commented
document.public Comment updateComment(CoreSession session, String commentId, Comment comment) throws CommentNotFoundException
CommentManager
session
- the core sessioncommentId
- the comment idcomment
- the updated commentCommentNotFoundException
- if no comment was found with the given id.public void deleteComment(CoreSession session, String commentId) throws CommentNotFoundException, CommentSecurityException
CommentManager
session
- the core sessioncommentId
- the comment idCommentNotFoundException
- if no comment was found with the given id.CommentSecurityException
- if the current user does not have the right permissions on the commented
document.public Comment getExternalComment(CoreSession session, String entityId) throws CommentNotFoundException
CommentManager
session
- the core sessionentityId
- the external entity idCommentNotFoundException
- if no comment was found with the given external entity id.public Comment updateExternalComment(CoreSession session, String entityId, Comment comment) throws CommentNotFoundException
CommentManager
session
- the core sessionentityId
- the external entity idcomment
- the comment containing the modificationsCommentNotFoundException
- if no comment was found with the given external entity id.public void deleteExternalComment(CoreSession session, String entityId) throws CommentNotFoundException
CommentManager
session
- the core sessionentityId
- the external entity idCommentNotFoundException
- if no comment was found with the given external entity id.public boolean hasFeature(CommentManager.Feature feature)
CommentManager
protected DocumentModel getExternalCommentModel(CoreSession session, String entityId)
protected String getCommentContainerPath(CoreSession session, String commentedDocumentId)
protected DocumentRef getAncestorRef(CoreSession session, DocumentModel documentModel)
protected DocumentModel getThreadForComment(CoreSession session, DocumentModel comment) throws CommentSecurityException
CommentSecurityException
Copyright © 2018 Nuxeo. All rights reserved.