Nuxeo Enterprise Platform 5.4

org.nuxeo.ecm.platform.forum.web.api
Interface ThreadAction

All Superinterfaces:
java.io.Serializable
All Known Subinterfaces:
ThreadActionLocal, ThreadActionRemote
All Known Implementing Classes:
ThreadActionBean

public interface ThreadAction
extends java.io.Serializable

This Action Listener represents a Thread inside a forum.

Author:
Brice Chaffangeon

Method Summary
 java.lang.String addThread()
          Adds the thread inside the forum.
 ThreadAdapter getAdapter(DocumentModel thread)
           
 java.util.List<DocumentModel> getAllPosts(DocumentModel thread, java.lang.String state)
          Gets all Posts in the Thread with the specified state.
 java.lang.String getDescription()
          Gets the description of the Thread.
 DocumentModel getLastPostPublished(DocumentModel thread)
          Gets the latest post published in given thread.
 java.lang.String getModerationAsString(DocumentModel thread)
          Return the label of the moderation state of the thread
 java.util.List<java.lang.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.
 java.util.List<ThreadEntry> getPostsAsThread()
          Gets all available posts in the thread according the Post state and principal rights.
 java.util.List<DocumentModel> getPostsPending(DocumentModel thread)
          Gets pending posts in a thread.
 java.util.List<DocumentModel> getPostsPublished(DocumentModel thread)
          Gets published posts in a thread.
 java.lang.String getTitle()
          Gets the title of the Thread to be created.
 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 setDescription(java.lang.String description)
          Sets the description of the Thread.
 void setModerated(boolean moderated)
          Sets the moderation on a thread.
 void setTitle(java.lang.String title)
          Sets the title of the Thread.
 

Method Detail

getTitle

java.lang.String getTitle()
Gets the title of the Thread to be created.


setTitle

void setTitle(java.lang.String title)
Sets the title of the Thread.


getDescription

java.lang.String getDescription()
Gets the description of the Thread.


setDescription

void setDescription(java.lang.String description)
Sets the description of the Thread.


addThread

java.lang.String addThread()
                           throws ClientException
Adds the thread inside the forum.

Throws:
ClientException - if the Thread can't be created

isModerated

boolean isModerated()
Returns true if the thread is moderated, false otherwise. Just used at creation time.


getModerationAsString

java.lang.String getModerationAsString(DocumentModel thread)
                                       throws ClientException
Return the label of the moderation state of the thread

Parameters:
thread - is the thread we want
Throws:
ClientException

setModerated

void setModerated(boolean moderated)
Sets the moderation on a thread.


getModerators

java.util.List<java.lang.String> getModerators()
Get all moderators on the thread.


isPrincipalModerator

boolean isPrincipalModerator()
Returns true if the principal (logged user) is a moderator, else otherwise.


isPrincipalGroupModerator

boolean isPrincipalGroupModerator()
Returns true if the principal(s group is a moderator group


isCurrentThreadModerated

boolean isCurrentThreadModerated()
                                 throws ClientException
Returns true if the thread is moderated, false otherwise. Intends to be used by a Post.

Throws:
ClientException

isThreadModerated

boolean isThreadModerated(DocumentModel thread)
                          throws ClientException
Returns true if the given thread is moderated, false otherwise.

Parameters:
thread - is the thread to test
Throws:
ClientException

getLastPostPublished

DocumentModel getLastPostPublished(DocumentModel thread)
                                   throws ClientException
Gets the latest post published in given thread.

Throws:
ClientException

getPostsAsThread

java.util.List<ThreadEntry> getPostsAsThread()
                                             throws ClientException
Gets all available posts in the thread according the Post state and principal rights. I.e., Post that are not published won't be visible for non-moderators.

Returns:
a list of ThreadEntry, directly usable for display with indentation
Throws:
ClientException

getAllPosts

java.util.List<DocumentModel> getAllPosts(DocumentModel thread,
                                          java.lang.String state)
                                          throws ClientException
Gets all Posts in the Thread with the specified state. Return all posts if state is null.

Throws:
ClientException

getPostsPublished

java.util.List<DocumentModel> getPostsPublished(DocumentModel thread)
                                                throws ClientException
Gets published posts in a thread.

Throws:
ClientException

getPostsPending

java.util.List<DocumentModel> getPostsPending(DocumentModel thread)
                                              throws ClientException
Gets pending posts in a thread.

Throws:
ClientException

getParentPost

DocumentModel getParentPost(int post)
                            throws ClientException
Return the parent post of the specified index of the post in the getPostsAsThread() list.

Throws:
ClientException

isParentPostPublished

boolean isParentPostPublished(int post)
                              throws ClientException
Return true if the parent post identified by it's number in the getPostsAsThread list is published.

Throws:
ClientException

getAdapter

ThreadAdapter getAdapter(DocumentModel thread)

Nuxeo Enterprise Platform 5.4

Copyright © 2010 Nuxeo SAS. All Rights Reserved.