public interface CommentManager
| Modifier and Type | Interface and Description |
|---|---|
static class |
CommentManager.Feature
Features of the implementation of the service.
|
| Modifier and Type | Method and Description |
|---|---|
Comment |
createComment(CoreSession session,
Comment comment)
Creates a comment.
|
DocumentModel |
createComment(DocumentModel docModel,
DocumentModel comment)
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)
Deprecated.
since 10.3, use
createComment(CoreSession, Comment) instead. |
DocumentModel |
createComment(DocumentModel docModel,
String comment)
Deprecated.
CommentManager cannot find the author if invoked remotely so one should use
createComment(DocumentModel, String, String) |
DocumentModel |
createComment(DocumentModel docModel,
String comment,
String author)
Deprecated.
since 10.3, use
createComment(CoreSession, Comment) instead. |
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)
Deprecated.
since 10.3, use
deleteComment(CoreSession, String) instead. |
void |
deleteExternalComment(CoreSession session,
String entityId)
Deletes an external comment.
|
Comment |
getComment(CoreSession session,
String commentId)
Gets a comment.
|
List<DocumentModel> |
getComments(CoreSession session,
DocumentModel docModel)
Gets comments of a document.
|
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.
|
PartialList<Comment> |
getComments(CoreSession session,
String documentId,
Long pageSize,
Long currentPageIndex,
boolean sortAscending)
Gets all comments for a document.
|
List<DocumentModel> |
getComments(DocumentModel docModel)
Gets comments of a document.
|
List<DocumentModel> |
getComments(DocumentModel docModel,
DocumentModel parent)
Deprecated.
since 10.3, use
getComments(DocumentModel) instead. |
List<DocumentModel> |
getDocumentsForComment(DocumentModel comment)
Deprecated.
since 10.3, only used with deprecated implementation, no replacement.
|
Comment |
getExternalComment(CoreSession session,
String entityId)
Gets a comment generated by an external service.
|
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.
|
List<DocumentModel> getComments(DocumentModel docModel)
docModel - the document modelList<DocumentModel> getComments(CoreSession session, DocumentModel docModel) throws CommentSecurityException
session - the core sessiondocModel - the document modelCommentSecurityException - if the current user does not have the right permissions on the commented
document@Deprecated List<DocumentModel> getComments(DocumentModel docModel, DocumentModel parent)
getComments(DocumentModel) instead.docModel - the document modelparent - the parent document model@Deprecated DocumentModel createComment(DocumentModel docModel, String comment)
createComment(DocumentModel, String, String)docModel - the document to commentcomment - the comment content@Deprecated DocumentModel createComment(DocumentModel docModel, String comment, String author)
createComment(CoreSession, Comment) instead.docModel - the document to commentcomment - the comment contentauthor - the comment authorDocumentModel createComment(DocumentModel docModel, DocumentModel comment) throws CommentSecurityException
docModel - the document to commentcomment - the comment document modelCommentSecurityException - if the current user does not have the right permissions on the document to
comment.@Deprecated DocumentModel createComment(DocumentModel docModel, DocumentModel parent, DocumentModel child)
createComment(CoreSession, Comment) instead.docModel - the document to commentparent - the comment parent document modelchild - the comment child document model@Deprecated void deleteComment(DocumentModel docModel, DocumentModel comment)
deleteComment(CoreSession, String) instead.docModel - the comment document modelcomment - the comment@Deprecated List<DocumentModel> getDocumentsForComment(DocumentModel comment)
comment - the commentDocumentModel getThreadForComment(DocumentModel comment) throws CommentSecurityException
comment - the commentCommentSecurityException - if the current user does not have the right permissions on the commented
document.DocumentModel createLocatedComment(DocumentModel docModel, DocumentModel comment, String path) throws CommentSecurityException
docModel - the document to commentcomment - the comment contentpath - the location pathCommentSecurityException - if the current user does not have the right permissions on the document to
comment.Comment createComment(CoreSession session, Comment comment) throws CommentNotFoundException, CommentSecurityException
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.Comment getComment(CoreSession session, String commentId) throws CommentNotFoundException, CommentSecurityException
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.List<Comment> getComments(CoreSession session, String documentId)
session - the core sessiondocumentId - the document idList<Comment> getComments(CoreSession session, String documentId, boolean sortAscending)
session - the core sessiondocumentId - the document idsortAscending - whether to sort ascending or descendingPartialList<Comment> getComments(CoreSession session, String documentId, Long pageSize, Long currentPageIndex)
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 paginationPartialList<Comment> getComments(CoreSession session, String documentId, Long pageSize, Long currentPageIndex, boolean sortAscending) throws CommentSecurityException
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.Comment updateComment(CoreSession session, String commentId, Comment comment) throws CommentNotFoundException, CommentSecurityException
session - the core sessioncommentId - the comment idcomment - the updated commentCommentNotFoundException - if no comment was found with the given id.CommentSecurityException - if the current user does not have the right permissions on the commented
document.void deleteComment(CoreSession session, String commentId) throws CommentNotFoundException, CommentSecurityException
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.Comment getExternalComment(CoreSession session, String entityId) throws CommentNotFoundException, CommentSecurityException
session - the core sessionentityId - the external entity idCommentNotFoundException - if no comment was found with the given external entity id.CommentSecurityException - if the current user does not have the right permissions on the commented
document.Comment updateExternalComment(CoreSession session, String entityId, Comment comment) throws CommentNotFoundException, CommentSecurityException
session - the core sessionentityId - the external entity idcomment - the comment containing the modificationsCommentNotFoundException - if no comment was found with the given external entity id.CommentSecurityException - if the current user does not have the right permissions on the commented
document.void deleteExternalComment(CoreSession session, String entityId) throws CommentNotFoundException, CommentSecurityException
session - the core sessionentityId - the external entity idCommentNotFoundException - if no comment was found with the given external entity id.CommentSecurityException - if the current user does not have the right permissions on the commented
document.boolean hasFeature(CommentManager.Feature feature)
Copyright © 2019 Nuxeo. All rights reserved.