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, wait
getCommentsAsThread
protected 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()
CommentManagerActions
initialize
in interface CommentManagerActions
@Destroy public void destroy()
destroy
in interface CommentManagerActions
public String getPrincipalName()
getPrincipalName
in interface CommentManagerActions
public boolean getPrincipalIsAdmin()
getPrincipalIsAdmin
in interface CommentManagerActions
protected DocumentModel initializeComment(DocumentModel comment)
public DocumentModel addComment(DocumentModel comment, DocumentModel docToComment)
public DocumentModel addComment(DocumentModel comment)
CommentManagerActions
addComment
in interface CommentManagerActions
public String addComment()
CommentManagerActions
addComment
in interface CommentManagerActions
public String createComment(DocumentModel docToComment)
CommentManagerActions
createComment
in interface CommentManagerActions
@Observer(value={"documentSelectionChanged","contentRootSelectionChanged","documentChanged"}, create=false) @BypassInterceptors public void documentChanged()
CommentManagerActions
documentChanged
in interface CommentManagerActions
protected CommentableDocument getCommentableDoc()
protected CommentableDocument getCommentableDoc(DocumentModel doc)
public void initComments()
initComments
in interface CommentManagerActions
public void initComments(DocumentModel commentedDoc)
initComments
in interface CommentManagerActions
public List<UIComment> getComments(DocumentModel doc)
public List<ThreadEntry> getCommentsAsThreadOnDoc(DocumentModel doc)
getCommentsAsThreadOnDoc
in interface CommentManagerActions
public List<ThreadEntry> getCommentsAsThread(DocumentModel commentedDoc)
CommentManagerActions
getCommentsAsThread
in interface CommentManagerActions
public void flattenTree(List<ThreadEntry> commentThread, UIComment uiComment, int depth)
protected UIComment createUIComment(UIComment parent, DocumentModel comment)
public String deleteComment(String commentId)
deleteComment
in interface CommentManagerActions
public String deleteComment()
deleteComment
in interface CommentManagerActions
public String getNewContent()
getNewContent
in interface CommentManagerActions
public void setNewContent(String newContent)
setNewContent
in interface CommentManagerActions
public String beginComment()
beginComment
in interface CommentManagerActions
public String cancelComment()
cancelComment
in interface CommentManagerActions
public boolean getCommentStarted()
getCommentStarted
in interface CommentManagerActions
public void getChildren(UIComment comment)
public List<UIComment> getLastCommentsByDate(String commentNumber, DocumentModel commentedDoc)
CommentManagerActions
getLastCommentsByDate
in interface CommentManagerActions
commentNumber
- the number of comment to fetchpublic List<UIComment> getLastCommentsByDate(String commentNumber)
CommentManagerActions
getLastCommentsByDate
in interface CommentManagerActions
commentNumber
- the number of comment to fetchpublic String getSavedReplyCommentId()
getSavedReplyCommentId
in interface CommentManagerActions
public void setSavedReplyCommentId(String savedReplyCommentId)
setSavedReplyCommentId
in interface CommentManagerActions
public List<Action> getActionsForComment()
getActionsForComment
in interface CommentManagerActions
public List<Action> getActionsForComment(String category)
getActionsForComment
in interface CommentManagerActions
public boolean getShowCreateForm()
getShowCreateForm
in interface CommentManagerActions
public void setShowCreateForm(boolean flag)
setShowCreateForm
in interface CommentManagerActions
public void toggleCreateForm(javax.faces.event.ActionEvent event)
toggleCreateForm
in interface CommentManagerActions
public void cleanContextVariable()
Copyright © 2017 Nuxeo. All rights reserved.