public class BridgeCommentManager extends AbstractCommentManager
CommentManager.Feature| Modifier and Type | Field and Description |
|---|---|
protected CommentManager |
first |
protected CommentManager |
second |
COMMENTS_DIRECTORY| Constructor and Description |
|---|
BridgeCommentManager(CommentManager first,
CommentManager second) |
| 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)
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 comment,
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.
|
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.
|
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> |
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.
|
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, notifyEvent, setCommentPermissions, setFolderPermissionsprotected final CommentManager first
protected final CommentManager second
public BridgeCommentManager(CommentManager first, CommentManager second)
public List<DocumentModel> getComments(DocumentModel docModel)
CommentManagergetComments in interface CommentManagergetComments in class AbstractCommentManagerdocModel - the document modelpublic List<DocumentModel> getComments(CoreSession session, DocumentModel docModel) throws CommentSecurityException
CommentManagersession - the core sessiondocModel - the document modelCommentSecurityException - if the current user does not have the right permissions on the commented
documentpublic DocumentModel createComment(DocumentModel docModel, String comment)
CommentManagerdocModel - the document to commentcomment - the comment contentpublic DocumentModel createComment(DocumentModel docModel, String comment, String author)
CommentManagerdocModel - the document to commentcomment - the comment contentauthor - the comment authorpublic DocumentModel createComment(DocumentModel docModel, DocumentModel comment) throws CommentSecurityException
CommentManagerdocModel - the document to commentcomment - 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)
CommentManagerdocModel - the document to commentparent - the comment parent document modelchild - the comment child document modelpublic void deleteComment(DocumentModel docModel, DocumentModel comment)
CommentManagerdocModel - the comment document modelcomment - the commentpublic List<DocumentModel> getDocumentsForComment(DocumentModel comment)
CommentManagercomment - the commentpublic DocumentModel getThreadForComment(DocumentModel comment) throws CommentSecurityException
CommentManagercomment - 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) throws CommentSecurityException
CommentManagerdocModel - 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.public Comment createComment(CoreSession session, Comment comment) throws CommentNotFoundException, CommentSecurityException
CommentManagersession - 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
CommentManagersession - 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 List<Comment> getComments(CoreSession session, String documentId)
CommentManagergetComments in interface CommentManagergetComments in class AbstractCommentManagersession - the core sessiondocumentId - the document idpublic PartialList<Comment> getComments(CoreSession session, String documentId, Long pageSize, Long currentPageIndex, boolean sortAscending) throws CommentSecurityException
CommentManagersession - 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, CommentSecurityException
CommentManagersession - 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.public void deleteComment(CoreSession session, String commentId) throws CommentNotFoundException, CommentSecurityException
CommentManagersession - 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, CommentSecurityException
CommentManagersession - 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.public Comment updateExternalComment(CoreSession session, String entityId, Comment comment) throws CommentNotFoundException, CommentSecurityException
CommentManagersession - 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.public void deleteExternalComment(CoreSession session, String entityId) throws CommentNotFoundException, CommentSecurityException
CommentManagersession - 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.public boolean hasFeature(CommentManager.Feature feature)
CommentManagerCopyright © 2019 Nuxeo. All rights reserved.