com.atlassian.confluence.content.service
Class DefaultCommentService

java.lang.Object
  extended by com.atlassian.confluence.content.service.DefaultCommentService
All Implemented Interfaces:
CommentService

public class DefaultCommentService
extends java.lang.Object
implements CommentService


Constructor Summary
DefaultCommentService()
           
 
Method Summary
 CreateCommentCommand newCreateCommentCommand(long pageId, long parentCommentId, java.lang.String content)
          Retrieve a command to add a new command to some content, threaded below some other comment.
 CreateCommentCommand newCreateCommentCommand(long pageId, java.lang.String content)
          Retrieve a command to create a new comment and add it to some content.
 CreateCommentCommand newCreateCommentFromEditorCommand(long pageId, long parentCommentId, java.lang.String content)
          Retrieve a command to add a new command to some content, threaded below some other comment.
 CreateCommentCommand newCreateCommentFromEditorCommand(long pageId, java.lang.String content)
          Retrieve a command to create a new comment and add it to some content.
 DeleteCommentCommand newDeleteCommentCommand(long commentId)
          Retrieve a command to delete an existing comment
 EditCommentCommand newEditCommentCommand(long commentId, java.lang.String newContent)
          Retrieve a command to edit the contents of a comment.
 EditCommentCommand newEditCommentFromEditorCommand(long commentId, java.lang.String newContent)
          Retrieve a command to edit the contents of a comment.
 void setCommentManager(CommentManager commentManager)
           
 void setEditConverter(EditorConverter editorConvertor)
           
 void setPageManager(PageManager pageManager)
           
 void setPermissionManager(PermissionManager permissionManager)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultCommentService

public DefaultCommentService()
Method Detail

newDeleteCommentCommand

public DeleteCommentCommand newDeleteCommentCommand(long commentId)
Description copied from interface: CommentService
Retrieve a command to delete an existing comment

Specified by:
newDeleteCommentCommand in interface CommentService
Parameters:
commentId - the ID of the comment to delete
Returns:
an appropriate command instance

newCreateCommentCommand

public CreateCommentCommand newCreateCommentCommand(long pageId,
                                                    java.lang.String content)
Description copied from interface: CommentService
Retrieve 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:
newCreateCommentCommand in interface CommentService
Parameters:
pageId - the ID of the AbstractPage to attach the comment to
content - the content of the comment
Returns:
an appropriate command instance

newCreateCommentCommand

public CreateCommentCommand newCreateCommentCommand(long pageId,
                                                    long parentCommentId,
                                                    java.lang.String content)
Description copied from interface: CommentService
Retrieve 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:
newCreateCommentCommand in interface CommentService
Parameters:
pageId - the ID of the AbstractPage to attach the comment to
parentCommentId - the ID of the comment that is the parent of this comment in a thread
content - the content of the comment
Returns:
an appropriate command instance

newEditCommentCommand

public EditCommentCommand newEditCommentCommand(long commentId,
                                                java.lang.String newContent)
Description copied from interface: CommentService
Retrieve a command to edit the contents of a comment.

Specified by:
newEditCommentCommand in interface CommentService
Parameters:
commentId - the id of the comment to edit
newContent - the new body of the content
Returns:
an appropriate command instance

newCreateCommentFromEditorCommand

public CreateCommentCommand newCreateCommentFromEditorCommand(long pageId,
                                                              long parentCommentId,
                                                              java.lang.String content)
Description copied from interface: CommentService
Retrieve 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:
newCreateCommentFromEditorCommand in interface CommentService
Parameters:
pageId - the ID of the AbstractPage to attach the comment to
parentCommentId - the ID of the comment that is the parent of this comment in a thread
content - the content of the comment in Confluence editor format.
Returns:
an appropriate command instance

newEditCommentFromEditorCommand

public EditCommentCommand newEditCommentFromEditorCommand(long commentId,
                                                          java.lang.String newContent)
Description copied from interface: CommentService
Retrieve a command to edit the contents of a comment. The content of the comment must be in editor format.

Specified by:
newEditCommentFromEditorCommand in interface CommentService
Parameters:
commentId - the id of the comment to edit
newContent - the new body of the content
Returns:
an appropriate command instance

newCreateCommentFromEditorCommand

public CreateCommentCommand newCreateCommentFromEditorCommand(long pageId,
                                                              java.lang.String content)
Description copied from interface: CommentService
Retrieve 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.) 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:
newCreateCommentFromEditorCommand in interface CommentService
Parameters:
pageId - the ID of the AbstractPage to attach the comment to
content - the content of the comment
Returns:
an appropriate command instance

setCommentManager

public void setCommentManager(CommentManager commentManager)

setPermissionManager

public void setPermissionManager(PermissionManager permissionManager)

setPageManager

public void setPageManager(PageManager pageManager)

setEditConverter

public void setEditConverter(EditorConverter editorConvertor)


Copyright © 2003-2014 Atlassian. All Rights Reserved.