public abstract class AbstractCommentManagerActionsBean extends Object implements CommentManagerActions
| Modifier and Type | Field and Description |
|---|---|
protected CommentableDocument |
commentableDoc |
protected Map<String,UIComment> |
commentMap |
protected static String |
COMMENTS_ACTIONS |
protected boolean |
commentStarted |
protected List<ThreadEntry> |
commentThread |
protected String |
deleteCommentId |
protected CoreSession |
documentManager |
protected List<UIComment> |
flatComments |
protected NavigationContext |
navigationContext |
protected String |
newContent |
protected NuxeoPrincipal |
principal |
protected boolean |
principalIsAdmin |
protected String |
replyCommentId |
protected String |
savedReplyCommentId |
protected boolean |
showCreateForm |
protected List<UIComment> |
uiComments |
protected UserSession |
userSession |
protected WebActions |
webActions |
CHILDREN_COMMENT_LIST| Constructor and Description |
|---|
AbstractCommentManagerActionsBean() |
| Modifier and Type | Method and Description |
|---|---|
String |
addComment()
creates a new comment from
|
DocumentModel |
addComment(DocumentModel comment)
Add the given comment DocumentModel to commentableDoc.
|
DocumentModel |
addComment(DocumentModel comment,
DocumentModel docToComment) |
String |
beginComment() |
String |
cancelComment() |
void |
cleanContextVariable() |
String |
createComment(DocumentModel docToComment)
Same as addComment() method but using the given document instead of currentDocument.
|
protected UIComment |
createUIComment(UIComment parent,
DocumentModel comment)
Creates a UIComment wrapping "comment", having "parent" as parent.
|
String |
deleteComment() |
String |
deleteComment(String commentId) |
void |
destroy() |
void |
documentChanged()
Clean all the bean's context variables.
|
void |
flattenTree(List<ThreadEntry> commentThread,
UIComment uiComment,
int depth)
Visits a list of comment trees and puts them into a list of "ThreadEntry"s.
|
List<Action> |
getActionsForComment() |
List<Action> |
getActionsForComment(String category) |
void |
getChildren(UIComment comment)
Retrieves children for a given comment.
|
protected CommentableDocument |
getCommentableDoc() |
protected CommentableDocument |
getCommentableDoc(DocumentModel doc) |
List<UIComment> |
getComments(DocumentModel doc) |
List<ThreadEntry> |
getCommentsAsThread(DocumentModel commentedDoc)
Initialize uiComments with given Document if uiComments is null.
|
List<ThreadEntry> |
getCommentsAsThreadOnDoc(DocumentModel doc)
Recursively retrieves all comments of a doc.
|
boolean |
getCommentStarted() |
List<UIComment> |
getLastCommentsByDate(String commentNumber)
Retrieves a given number of comments from currentDocument.
|
List<UIComment> |
getLastCommentsByDate(String commentNumber,
DocumentModel commentedDoc)
Retrieves a given number of comments from the given Document.
|
String |
getNewContent() |
boolean |
getPrincipalIsAdmin() |
String |
getPrincipalName() |
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.
|
protected DocumentModel |
initializeComment(DocumentModel comment) |
void |
setNewContent(String newContent) |
void |
setSavedReplyCommentId(String savedReplyCommentId) |
void |
setShowCreateForm(boolean flag) |
void |
toggleCreateForm(javax.faces.event.ActionEvent event) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetCommentsAsThreadprotected static final String COMMENTS_ACTIONS
protected NuxeoPrincipal principal
protected boolean principalIsAdmin
protected boolean showCreateForm
@In(create=true,
required=false)
protected transient CoreSession documentManager
@In(create=true) protected transient WebActions webActions
protected String newContent
protected CommentableDocument commentableDoc
protected List<UIComment> uiComments
protected List<ThreadEntry> commentThread
@RequestParameter protected String deleteCommentId
@RequestParameter protected String replyCommentId
protected String savedReplyCommentId
protected Map<String,UIComment> commentMap
protected boolean commentStarted
protected List<UIComment> flatComments
@In(create=true) protected UserSession userSession
@In(create=true) protected NavigationContext navigationContext
public AbstractCommentManagerActionsBean()
@Create public void initialize()
CommentManagerActionsinitialize in interface CommentManagerActions@Destroy public void destroy()
destroy in interface CommentManagerActionspublic String getPrincipalName()
getPrincipalName in interface CommentManagerActionspublic boolean getPrincipalIsAdmin()
getPrincipalIsAdmin in interface CommentManagerActionsprotected DocumentModel initializeComment(DocumentModel comment)
public DocumentModel addComment(DocumentModel comment, DocumentModel docToComment)
public DocumentModel addComment(DocumentModel comment)
CommentManagerActionsaddComment in interface CommentManagerActionspublic String addComment()
CommentManagerActionsaddComment in interface CommentManagerActionspublic String createComment(DocumentModel docToComment)
CommentManagerActionscreateComment in interface CommentManagerActions@Observer(value={"documentSelectionChanged","contentRootSelectionChanged","documentChanged"},
create=false)
@BypassInterceptors
public void documentChanged()
CommentManagerActionsdocumentChanged in interface CommentManagerActionsprotected CommentableDocument getCommentableDoc()
protected CommentableDocument getCommentableDoc(DocumentModel doc)
public void initComments()
initComments in interface CommentManagerActionspublic void initComments(DocumentModel commentedDoc)
initComments in interface CommentManagerActionspublic List<UIComment> getComments(DocumentModel doc)
public List<ThreadEntry> getCommentsAsThreadOnDoc(DocumentModel doc)
getCommentsAsThreadOnDoc in interface CommentManagerActionspublic List<ThreadEntry> getCommentsAsThread(DocumentModel commentedDoc)
CommentManagerActionsgetCommentsAsThread in interface CommentManagerActionspublic void flattenTree(List<ThreadEntry> commentThread, UIComment uiComment, int depth)
protected UIComment createUIComment(UIComment parent, DocumentModel comment)
public String deleteComment(String commentId)
deleteComment in interface CommentManagerActionspublic String deleteComment()
deleteComment in interface CommentManagerActionspublic String getNewContent()
getNewContent in interface CommentManagerActionspublic void setNewContent(String newContent)
setNewContent in interface CommentManagerActionspublic String beginComment()
beginComment in interface CommentManagerActionspublic String cancelComment()
cancelComment in interface CommentManagerActionspublic boolean getCommentStarted()
getCommentStarted in interface CommentManagerActionspublic void getChildren(UIComment comment)
public List<UIComment> getLastCommentsByDate(String commentNumber, DocumentModel commentedDoc)
CommentManagerActionsgetLastCommentsByDate in interface CommentManagerActionscommentNumber - the number of comment to fetchpublic List<UIComment> getLastCommentsByDate(String commentNumber)
CommentManagerActionsgetLastCommentsByDate in interface CommentManagerActionscommentNumber - the number of comment to fetchpublic String getSavedReplyCommentId()
getSavedReplyCommentId in interface CommentManagerActionspublic void setSavedReplyCommentId(String savedReplyCommentId)
setSavedReplyCommentId in interface CommentManagerActionspublic List<Action> getActionsForComment()
getActionsForComment in interface CommentManagerActionspublic List<Action> getActionsForComment(String category)
getActionsForComment in interface CommentManagerActionspublic boolean getShowCreateForm()
getShowCreateForm in interface CommentManagerActionspublic void setShowCreateForm(boolean flag)
setShowCreateForm in interface CommentManagerActionspublic void toggleCreateForm(javax.faces.event.ActionEvent event)
toggleCreateForm in interface CommentManagerActionspublic void cleanContextVariable()
Copyright © 2018 Nuxeo. All rights reserved.