Class DefaultCommentService
- java.lang.Object
 - 
- com.atlassian.confluence.content.service.DefaultCommentService
 
 
- 
- All Implemented Interfaces:
 CommentService
public class DefaultCommentService extends Object implements CommentService
 
- 
- 
Constructor Summary
Constructors Constructor Description DefaultCommentService(CommentManager commentManager, PermissionManager permissionManager, ContentEntityManager contentManager, EditorConverter editorConverter) 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CreateCommentCommandnewCreateCommentCommand(long contentId, long parentCommentId, String content, UUID submissionToken)Retrieve a command to add a new command to some content, threaded below some other comment.CreateCommentCommandnewCreateCommentCommand(long contentId, String content, UUID submissionToken)Retrieve a command to create a new comment and add it to some content.CreateCommentCommandnewCreateCommentFromEditorCommand(long contentId, long parentCommentId, String content, UUID submissionToken)Retrieve a command to add a new command to some content, threaded below some other comment.DeleteCommentCommandnewDeleteCommentCommand(long commentId)Retrieve a command to delete an existing commentEditCommentCommandnewEditCommentCommand(long commentId, String newContent)Retrieve a command to edit the contents of a comment.EditCommentCommandnewEditCommentFromEditorCommand(long commentId, String newContent)Retrieve a command to edit the contents of a comment. 
 - 
 
- 
- 
Constructor Detail
- 
DefaultCommentService
public DefaultCommentService(CommentManager commentManager, PermissionManager permissionManager, ContentEntityManager contentManager, EditorConverter editorConverter)
 
 - 
 
- 
Method Detail
- 
newDeleteCommentCommand
public DeleteCommentCommand newDeleteCommentCommand(long commentId)
Description copied from interface:CommentServiceRetrieve a command to delete an existing comment- Specified by:
 newDeleteCommentCommandin interfaceCommentService- Parameters:
 commentId- the ID of the comment to delete- Returns:
 - an appropriate command instance
 
 
- 
newCreateCommentCommand
public CreateCommentCommand newCreateCommentCommand(long contentId, String content, UUID submissionToken)
Description copied from interface:CommentServiceRetrieve a command to create a new comment and add it to some content. The content identified by the id parameter must be an instance of AbstractPage (i.e. a page or blog post.)- Specified by:
 newCreateCommentCommandin interfaceCommentService- Parameters:
 contentId- the ID of the AbstractPage to attach the comment tocontent- the content of the commentsubmissionToken- a unique identifier for the comment- Returns:
 - an appropriate command instance
 - Since:
 - 5.6
 
 
- 
newCreateCommentCommand
public CreateCommentCommand newCreateCommentCommand(long contentId, long parentCommentId, String content, UUID submissionToken)
Description copied from interface:CommentServiceRetrieve a command to add a new command to some content, threaded below some other comment. The parent comment must (obviously) be attached to the page provided- Specified by:
 newCreateCommentCommandin interfaceCommentService- Parameters:
 contentId- the ID of the AbstractPage to attach the comment toparentCommentId- the ID of the comment that is the parent of this comment in a threadcontent- the content of the commentsubmissionToken- a unique identifier for the comment- Returns:
 - an appropriate command instance
 - Since:
 - 5.6
 
 
- 
newEditCommentCommand
public EditCommentCommand newEditCommentCommand(long commentId, String newContent)
Description copied from interface:CommentServiceRetrieve a command to edit the contents of a comment.- Specified by:
 newEditCommentCommandin interfaceCommentService- Parameters:
 commentId- the id of the comment to editnewContent- the new body of the content- Returns:
 - an appropriate command instance
 
 
- 
newCreateCommentFromEditorCommand
public CreateCommentCommand newCreateCommentFromEditorCommand(long contentId, long parentCommentId, String content, UUID submissionToken)
Description copied from interface:CommentServiceRetrieve a command to add a new command to some content, threaded below some other comment. The parent comment must (obviously) be attached to the page provided. This instance of a CreateCommentCommand expects the comment content to be in Confluence editor format, meaning it will be transformed automatically to storage format when the command is executed.- Specified by:
 newCreateCommentFromEditorCommandin interfaceCommentService- Parameters:
 contentId- the ID of the AbstractPage to attach the comment toparentCommentId- the ID of the comment that is the parent of this comment in a threadcontent- the content of the comment in Confluence editor format.submissionToken- a unique identifier for the comment- Returns:
 - an appropriate command instance
 - Since:
 - 5.6
 
 
- 
newEditCommentFromEditorCommand
public EditCommentCommand newEditCommentFromEditorCommand(long commentId, String newContent)
Description copied from interface:CommentServiceRetrieve a command to edit the contents of a comment. The content of the comment must be in editor format.- Specified by:
 newEditCommentFromEditorCommandin interfaceCommentService- Parameters:
 commentId- the id of the comment to editnewContent- the new body of the content- Returns:
 - an appropriate command instance
 
 
 - 
 
 -