@Name(value="threadAction") @Scope(value=CONVERSATION) public class ThreadActionBean extends Object implements ThreadAction
Modifier and Type | Field and Description |
---|---|
protected ThreadAdapter |
adapter |
protected CommentManagerActions |
commentManagerActions |
protected Principal |
currentUser |
protected String |
description |
protected CoreSession |
documentManager |
protected boolean |
moderated |
protected NavigationContext |
navigationContext |
protected PostAction |
postAction |
protected NuxeoPrincipal |
principal |
protected boolean |
principalIsAdmin |
protected ResourcesAccessor |
resourcesAccessor |
protected static String |
schema |
protected List<String> |
selectedModerators |
protected String |
title |
protected static String |
type |
Constructor and Description |
---|
ThreadActionBean() |
Modifier and Type | Method and Description |
---|---|
String |
addThread()
Adds the thread inside the forum.
|
protected void |
clean()
Clean variables.
|
ThreadAdapter |
getAdapter(DocumentModel thread) |
List<DocumentModel> |
getAllPosts(DocumentModel thread,
String state)
Gets all Posts in the Thread with the specified state.
|
String |
getDescription()
Gets the description of the Thread.
|
protected DocumentModel |
getDocumentThreadModel(DocumentRef threadRef)
Gets the thread for a given document reference.
|
DocumentModel |
getLastPostPublished(DocumentModel thread)
Gets the latest post published in given thread.
|
String |
getModerationAsString(DocumentModel thread)
Return the label of the moderation state of the thread
|
List<String> |
getModerators()
Get all moderators on the thread.
|
DocumentModel |
getParentPost(int post)
Return the parent post of the specified index of the post in the getPostsAsThread() list.
|
List<ThreadEntry> |
getPostsAsThread()
Gets all available posts in the thread according the Post state and principal rights.
|
List<DocumentModel> |
getPostsPending(DocumentModel thread)
Gets pending posts in a thread.
|
List<DocumentModel> |
getPostsPublished(DocumentModel thread)
Gets published posts in a thread.
|
String |
getSchema() |
List<String> |
getSelectedModerators() |
protected DocumentModel |
getThreadModel()
Gets the Thread to create as a DocumentModel.
|
String |
getTitle()
Gets the title of the Thread to be created.
|
String |
getType() |
boolean |
isCurrentThreadModerated()
Returns true if the thread is moderated, false otherwise.
|
boolean |
isModerated()
Returns true if the thread is moderated, false otherwise.
|
boolean |
isParentPostPublished(int post)
Return true if the parent post identified by it's number in the getPostsAsThread list is published.
|
boolean |
isPrincipalGroupModerator()
Returns true if the principal(s group is a moderator group
|
boolean |
isPrincipalModerator()
Returns true if the principal (logged user) is a moderator, else otherwise.
|
boolean |
isThreadModerated(DocumentModel thread)
Returns true if the given thread is moderated, false otherwise.
|
void |
readState() |
void |
saveState() |
void |
setDescription(String description)
Sets the description of the Thread.
|
void |
setModerated(boolean moderated)
Sets the moderation on a thread.
|
void |
setSelectedModerators(List<String> selectedModerators) |
void |
setTitle(String title)
Sets the title of the Thread.
|
protected static final String schema
protected static final String type
protected boolean principalIsAdmin
@In(create=true) protected transient Principal currentUser
@In(create=true, required=false) protected transient CoreSession documentManager
@In(create=true) protected transient CommentManagerActions commentManagerActions
@In(create=true) protected NavigationContext navigationContext
@In(create=true) protected ResourcesAccessor resourcesAccessor
@In(create=true) protected PostAction postAction
protected String description
protected List<String> selectedModerators
protected boolean moderated
protected NuxeoPrincipal principal
protected ThreadAdapter adapter
public ThreadActionBean()
public String addThread()
ThreadAction
addThread
in interface ThreadAction
protected void clean()
protected DocumentModel getThreadModel()
public List<String> getModerators()
ThreadAction
getModerators
in interface ThreadAction
public boolean isPrincipalModerator()
ThreadAction
isPrincipalModerator
in interface ThreadAction
public boolean isPrincipalGroupModerator()
ThreadAction
isPrincipalGroupModerator
in interface ThreadAction
public boolean isCurrentThreadModerated()
ThreadAction
isCurrentThreadModerated
in interface ThreadAction
@Factory(value="currentThreadPosts", scope=EVENT) public List<ThreadEntry> getPostsAsThread()
ThreadAction
getPostsAsThread
in interface ThreadAction
public ThreadAdapter getAdapter(DocumentModel thread)
getAdapter
in interface ThreadAction
public List<DocumentModel> getAllPosts(DocumentModel thread, String state)
ThreadAction
getAllPosts
in interface ThreadAction
public List<DocumentModel> getPostsPublished(DocumentModel thread)
ThreadAction
getPostsPublished
in interface ThreadAction
public List<DocumentModel> getPostsPending(DocumentModel thread)
ThreadAction
getPostsPending
in interface ThreadAction
public String getDescription()
ThreadAction
getDescription
in interface ThreadAction
public String getTitle()
ThreadAction
getTitle
in interface ThreadAction
public void setDescription(String description)
ThreadAction
setDescription
in interface ThreadAction
public void setTitle(String title)
ThreadAction
setTitle
in interface ThreadAction
public void saveState()
public void readState()
public boolean isModerated()
ThreadAction
isModerated
in interface ThreadAction
public void setModerated(boolean moderated)
ThreadAction
setModerated
in interface ThreadAction
public DocumentModel getLastPostPublished(DocumentModel thread)
ThreadAction
getLastPostPublished
in interface ThreadAction
public String getModerationAsString(DocumentModel thread)
ThreadAction
getModerationAsString
in interface ThreadAction
thread
- is the thread we wantpublic boolean isThreadModerated(DocumentModel thread)
ThreadAction
isThreadModerated
in interface ThreadAction
thread
- is the thread to testpublic DocumentModel getParentPost(int post)
ThreadAction
getParentPost
in interface ThreadAction
public boolean isParentPostPublished(int post)
ThreadAction
isParentPostPublished
in interface ThreadAction
protected DocumentModel getDocumentThreadModel(DocumentRef threadRef)
public List<String> getSelectedModerators()
public void setSelectedModerators(List<String> selectedModerators)
Copyright © 2015 Nuxeo SA. All rights reserved.