Class CommentableDocumentAdapter
- java.lang.Object
-
- org.nuxeo.ecm.platform.comment.impl.CommentableDocumentAdapter
-
- All Implemented Interfaces:
Serializable
,CommentableDocument
public class CommentableDocumentAdapter extends Object implements CommentableDocument
- Author:
- George Lefter
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected CommentManager
commentManager
protected DocumentModel
docModel
-
Constructor Summary
Constructors Constructor Description CommentableDocumentAdapter(DocumentModel docModel)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DocumentModel
addComment(DocumentModel comment)
Creates a new comment.DocumentModel
addComment(DocumentModel comment, String path)
Creates a new comment in a specific location.DocumentModel
addComment(DocumentModel parent, DocumentModel comment)
Creates a new comment as a reply to an existing comment.List<DocumentModel>
getComments()
Returns all comments for this document.List<DocumentModel>
getComments(DocumentModel parent)
Returns the comments for this document that are replied to a parent comment.void
removeComment(DocumentModel comment)
Removes a comment from the document comment list.
-
-
-
Field Detail
-
docModel
protected final DocumentModel docModel
-
commentManager
protected final CommentManager commentManager
-
-
Constructor Detail
-
CommentableDocumentAdapter
public CommentableDocumentAdapter(DocumentModel docModel)
-
-
Method Detail
-
addComment
public DocumentModel addComment(DocumentModel comment)
Description copied from interface:CommentableDocument
Creates a new comment.- Specified by:
addComment
in interfaceCommentableDocument
-
addComment
public DocumentModel addComment(DocumentModel comment, String path)
Description copied from interface:CommentableDocument
Creates a new comment in a specific location.- Specified by:
addComment
in interfaceCommentableDocument
- Parameters:
comment
- the comment to be addedpath
- the given location
-
addComment
public DocumentModel addComment(DocumentModel parent, DocumentModel comment)
Description copied from interface:CommentableDocument
Creates a new comment as a reply to an existing comment.- Specified by:
addComment
in interfaceCommentableDocument
- Parameters:
parent
- the parent comment, which must existcomment
- the comment to be added
-
removeComment
public void removeComment(DocumentModel comment)
Description copied from interface:CommentableDocument
Removes a comment from the document comment list.- Specified by:
removeComment
in interfaceCommentableDocument
-
getComments
public List<DocumentModel> getComments()
Description copied from interface:CommentableDocument
Returns all comments for this document.- Specified by:
getComments
in interfaceCommentableDocument
- Returns:
- the list of comments
-
getComments
public List<DocumentModel> getComments(DocumentModel parent)
Description copied from interface:CommentableDocument
Returns the comments for this document that are replied to a parent comment.- Specified by:
getComments
in interfaceCommentableDocument
- Parameters:
parent
- the parent comment- Returns:
- the comments for the parent comment
-
-