Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.platform.comment.impl
Class CommentManagerImpl

java.lang.Object
  extended by org.nuxeo.ecm.platform.comment.impl.CommentManagerImpl
All Implemented Interfaces:
CommentManager

public class CommentManagerImpl
extends Object
implements CommentManager

Author:
George Lefter

Field Summary
static String COMMENTS_DIRECTORY
           
 
Constructor Summary
CommentManagerImpl(CommentServiceConfig config)
           
 
Method Summary
 DocumentModel createComment(DocumentModel docModel, DocumentModel comment)
           
 DocumentModel createComment(DocumentModel docModel, DocumentModel parent, DocumentModel child)
           
 DocumentModel createComment(DocumentModel docModel, String 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(DocumentModel docModel, DocumentModel comment)
           
 List<DocumentModel> getComments(DocumentModel docModel)
           
 List<DocumentModel> getComments(DocumentModel docModel, DocumentModel parent)
           
 List<DocumentModel> getDocumentsForComment(DocumentModel comment)
          Gets documents in relation with a particular comment.
 DocumentModel getThreadForComment(DocumentModel comment)
          Gets thread in relation with a given comment (post or comment)
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMMENTS_DIRECTORY

public static final String COMMENTS_DIRECTORY
See Also:
Constant Field Values
Constructor Detail

CommentManagerImpl

public CommentManagerImpl(CommentServiceConfig config)
Method Detail

getComments

public List<DocumentModel> getComments(DocumentModel docModel)
                                throws ClientException
Specified by:
getComments in interface CommentManager
Throws:
ClientException

createComment

public DocumentModel createComment(DocumentModel docModel,
                                   String comment,
                                   String author)
                            throws ClientException
Description copied from interface: CommentManager
Creates a comment document model, filling its properties with given info and linking it to given document.

Specified by:
createComment in interface CommentManager
Parameters:
docModel - the document to comment
comment - the comment content
author - the comment author
Returns:
the comment document model.
Throws:
ClientException

createComment

public DocumentModel createComment(DocumentModel docModel,
                                   String comment)
                            throws ClientException
Specified by:
createComment in interface CommentManager
Throws:
ClientException

createComment

public DocumentModel createComment(DocumentModel docModel,
                                   DocumentModel comment)
                            throws ClientException
Specified by:
createComment in interface CommentManager
Throws:
ClientException

deleteComment

public void deleteComment(DocumentModel docModel,
                          DocumentModel comment)
                   throws ClientException
Specified by:
deleteComment in interface CommentManager
Throws:
ClientException

createComment

public DocumentModel createComment(DocumentModel docModel,
                                   DocumentModel parent,
                                   DocumentModel child)
                            throws ClientException
Specified by:
createComment in interface CommentManager
Throws:
ClientException

getComments

public List<DocumentModel> getComments(DocumentModel docModel,
                                       DocumentModel parent)
                                throws ClientException
Specified by:
getComments in interface CommentManager
Throws:
ClientException

getDocumentsForComment

public List<DocumentModel> getDocumentsForComment(DocumentModel comment)
                                           throws ClientException
Description copied from interface: CommentManager
Gets documents in relation with a particular comment.

Specified by:
getDocumentsForComment in interface CommentManager
Parameters:
comment - the comment
Returns:
the list of documents
Throws:
ClientException

createLocatedComment

public DocumentModel createLocatedComment(DocumentModel docModel,
                                          DocumentModel comment,
                                          String path)
                                   throws ClientException
Description copied from interface: CommentManager
Creates a comment document model. It gives opportunity to save the comments in a specified location.

Specified by:
createLocatedComment in interface CommentManager
Parameters:
docModel - the document to comment
comment - the comment content
path - the location path
Returns:
the comment document model.
Throws:
ClientException

getThreadForComment

public DocumentModel getThreadForComment(DocumentModel comment)
                                  throws ClientException
Description copied from interface: CommentManager
Gets thread in relation with a given comment (post or comment)

Specified by:
getThreadForComment in interface CommentManager
Returns:
Throws:
ClientException

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.