Nuxeo Enterprise Platform 5.4

org.nuxeo.ecm.platform.comment.web
Class AbstractCommentManagerActionsBean

java.lang.Object
  extended by org.nuxeo.ecm.platform.comment.web.AbstractCommentManagerActionsBean
All Implemented Interfaces:
CommentManagerActions
Direct Known Subclasses:
CommentManagerActionsBean

public abstract class AbstractCommentManagerActionsBean
extends java.lang.Object
implements CommentManagerActions

Author:
George Lefter

Nested Class Summary
static class AbstractCommentManagerActionsBean.FollowTransitionUnrestricted
           
 
Field Summary
 
Fields inherited from interface org.nuxeo.ecm.platform.comment.web.CommentManagerActions
CHILDREN_COMMENT_LIST
 
Constructor Summary
AbstractCommentManagerActionsBean()
           
 
Method Summary
 java.lang.String addComment()
          creates a new comment from
 DocumentModel addComment(DocumentModel comment)
          Add the given comment DocumentModel to commentableDoc.
 DocumentModel addComment(DocumentModel comment, DocumentModel docToComment)
           
 java.lang.String beginComment()
           
 java.lang.String cancelComment()
           
 void cleanContextVariable()
           
 java.lang.String createComment(DocumentModel docToComment)
          Same as addComment() method but using the given document instead of currentDocument.
 java.lang.String deleteComment()
           
 java.lang.String deleteComment(java.lang.String commentId)
           
 void destroy()
           
 void documentChanged()
          Clean all the bean's context variables.
 void flattenTree(java.util.List<ThreadEntry> commentThread, UIComment uiComment, int depth)
          Visits a list of comment trees and puts them into a list of "ThreadEntry"s.
 java.util.List<Action> getActionsForComment()
           
 java.util.List<Action> getActionsForComment(java.lang.String category)
           
 void getChildren(UIComment comment)
          Retrieves children for a given comment.
 java.util.List<UIComment> getComments(DocumentModel doc)
           
 java.util.List<ThreadEntry> getCommentsAsThread(DocumentModel commentedDoc)
          Initialize uiComments with given Document if uiComments is null.
 java.util.List<ThreadEntry> getCommentsAsThreadOnDoc(DocumentModel doc)
          Recursively retrieves all comments of a doc.
 boolean getCommentStarted()
           
 java.util.List<UIComment> getLastCommentsByDate(java.lang.String commentNumber)
          Retrieves a given number of comments from currentDocument.
 java.util.List<UIComment> getLastCommentsByDate(java.lang.String commentNumber, DocumentModel commentedDoc)
          Retrieves a given number of comments from the given Document.
 java.lang.String getNewContent()
           
 boolean getPrincipalIsAdmin()
           
 java.lang.String getPrincipalName()
           
 java.lang.String getSavedReplyCommentId()
           
 boolean getShowCreateForm()
           
 void initComments()
          Initializes uiComments with Comments of current document.
 void initComments(DocumentModel commentedDoc)
          Initializes uiComments with Comments of current document.
 void initialize()
          Bean initialization method.
 void setNewContent(java.lang.String newContent)
           
 void setSavedReplyCommentId(java.lang.String savedReplyCommentId)
           
 void setShowCreateForm(boolean flag)
           
 void toggleCreateForm(javax.faces.event.ActionEvent event)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.nuxeo.ecm.platform.comment.web.CommentManagerActions
getCommentsAsThread
 

Constructor Detail

AbstractCommentManagerActionsBean

public AbstractCommentManagerActionsBean()
Method Detail

initialize

@Create
public void initialize()
                throws java.lang.Exception
Description copied from interface: CommentManagerActions
Bean initialization method.

Specified by:
initialize in interface CommentManagerActions
Throws:
java.lang.Exception

destroy

@Destroy
public void destroy()
Specified by:
destroy in interface CommentManagerActions

getPrincipalName

public java.lang.String getPrincipalName()
Specified by:
getPrincipalName in interface CommentManagerActions

getPrincipalIsAdmin

public boolean getPrincipalIsAdmin()
Specified by:
getPrincipalIsAdmin in interface CommentManagerActions

addComment

public DocumentModel addComment(DocumentModel comment,
                                DocumentModel docToComment)
                         throws ClientException
Throws:
ClientException

addComment

public DocumentModel addComment(DocumentModel comment)
                         throws ClientException
Description copied from interface: CommentManagerActions
Add the given comment DocumentModel to commentableDoc.

Specified by:
addComment in interface CommentManagerActions
Throws:
ClientException

addComment

public java.lang.String addComment()
                            throws ClientException
Description copied from interface: CommentManagerActions
creates a new comment from

Specified by:
addComment in interface CommentManagerActions
Returns:
null to avoid navigation
Throws:
ClientException

createComment

public java.lang.String createComment(DocumentModel docToComment)
                               throws ClientException
Description copied from interface: CommentManagerActions
Same as addComment() method but using the given document instead of currentDocument.

Specified by:
createComment in interface CommentManagerActions
Returns:
null to avoid navigation
Throws:
ClientException

documentChanged

@Observer(value={"documentSelectionChanged","contentRootSelectionChanged","documentChanged"},
          create=false)
@BypassInterceptors
public void documentChanged()
Description copied from interface: CommentManagerActions
Clean all the bean's context variables.

Specified by:
documentChanged in interface CommentManagerActions

initComments

public void initComments()
                  throws ClientException
Initializes uiComments with Comments of current document.

Specified by:
initComments in interface CommentManagerActions
Throws:
ClientException

initComments

public void initComments(DocumentModel commentedDoc)
                  throws ClientException
Initializes uiComments with Comments of current document.

Specified by:
initComments in interface CommentManagerActions
Throws:
ClientException

getComments

public java.util.List<UIComment> getComments(DocumentModel doc)
                                      throws ClientException
Throws:
ClientException

getCommentsAsThreadOnDoc

public java.util.List<ThreadEntry> getCommentsAsThreadOnDoc(DocumentModel doc)
                                                     throws ClientException
Recursively retrieves all comments of a doc.

Specified by:
getCommentsAsThreadOnDoc in interface CommentManagerActions
Returns:
list of ThreadEntry for given Document.
Throws:
ClientException

getCommentsAsThread

public java.util.List<ThreadEntry> getCommentsAsThread(DocumentModel commentedDoc)
                                                throws ClientException
Description copied from interface: CommentManagerActions
Initialize uiComments with given Document if uiComments is null.

Specified by:
getCommentsAsThread in interface CommentManagerActions
Returns:
list of ThreadEntry for given Document.
Throws:
ClientException

flattenTree

public void flattenTree(java.util.List<ThreadEntry> commentThread,
                        UIComment uiComment,
                        int depth)
Visits a list of comment trees and puts them into a list of "ThreadEntry"s.


deleteComment

public java.lang.String deleteComment(java.lang.String commentId)
                               throws ClientException
Specified by:
deleteComment in interface CommentManagerActions
Throws:
ClientException

deleteComment

public java.lang.String deleteComment()
                               throws ClientException
Specified by:
deleteComment in interface CommentManagerActions
Throws:
ClientException

getNewContent

public java.lang.String getNewContent()
Specified by:
getNewContent in interface CommentManagerActions

setNewContent

public void setNewContent(java.lang.String newContent)
Specified by:
setNewContent in interface CommentManagerActions

beginComment

public java.lang.String beginComment()
Specified by:
beginComment in interface CommentManagerActions

cancelComment

public java.lang.String cancelComment()
Specified by:
cancelComment in interface CommentManagerActions

getCommentStarted

public boolean getCommentStarted()
Specified by:
getCommentStarted in interface CommentManagerActions

getChildren

public void getChildren(UIComment comment)
Retrieves children for a given comment.


getLastCommentsByDate

public java.util.List<UIComment> getLastCommentsByDate(java.lang.String commentNumber,
                                                       DocumentModel commentedDoc)
                                                throws ClientException
Description copied from interface: CommentManagerActions
Retrieves a given number of comments from the given Document.

Specified by:
getLastCommentsByDate in interface CommentManagerActions
Parameters:
commentNumber - the number of comment to fetch
Throws:
ClientException

getLastCommentsByDate

public java.util.List<UIComment> getLastCommentsByDate(java.lang.String commentNumber)
                                                throws ClientException
Description copied from interface: CommentManagerActions
Retrieves a given number of comments from currentDocument.

Specified by:
getLastCommentsByDate in interface CommentManagerActions
Parameters:
commentNumber - the number of comment to fetch
Throws:
ClientException

getSavedReplyCommentId

public java.lang.String getSavedReplyCommentId()
Specified by:
getSavedReplyCommentId in interface CommentManagerActions

setSavedReplyCommentId

public void setSavedReplyCommentId(java.lang.String savedReplyCommentId)
Specified by:
setSavedReplyCommentId in interface CommentManagerActions

getActionsForComment

public java.util.List<Action> getActionsForComment()
Specified by:
getActionsForComment in interface CommentManagerActions
Returns:
available action for COMMENTS_ACTIONS

getActionsForComment

public java.util.List<Action> getActionsForComment(java.lang.String category)
Specified by:
getActionsForComment in interface CommentManagerActions
Returns:
available action for given category

getShowCreateForm

public boolean getShowCreateForm()
Specified by:
getShowCreateForm in interface CommentManagerActions

setShowCreateForm

public void setShowCreateForm(boolean flag)
Specified by:
setShowCreateForm in interface CommentManagerActions

toggleCreateForm

public void toggleCreateForm(javax.faces.event.ActionEvent event)
Specified by:
toggleCreateForm in interface CommentManagerActions

cleanContextVariable

public void cleanContextVariable()

Nuxeo Enterprise Platform 5.4

Copyright © 2010 Nuxeo SAS. All Rights Reserved.