|
Jive API (3.0.13) Core Javadocs | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ForumManager
This manager provides methods to load forum threads, user messages and to retrieve popular forum threads.
JiveContext| Method Summary | |
|---|---|
void |
addAttachment(ForumMessage message,
Attachment attachment)
Adds an attachment to a given message. |
void |
addMessage(ForumThread thread,
ForumMessage parentMessage,
ForumMessage newMessage)
Adds a new message to a given thread. |
void |
addThread(JiveContainer container,
ForumThread thread)
Adds a new thread to the container. |
ForumMessage |
createMessage(JiveContainer container)
Factory method to create a message with an anonymous author. |
ForumMessage |
createMessage(JiveContainer container,
User user)
Factory method to create a message as the specified user. |
ForumThread |
createThread(JiveContainer container,
ForumMessage rootMessage)
Factory method to create a new thread. |
void |
deleteMessage(ForumThread thread,
ForumMessage message)
Deletes a message from the given thread. |
void |
deleteMessage(ForumThread thread,
ForumMessage message,
boolean deleteChildren)
Deletes a message and (optionally) all of its child messages from the given thread. |
void |
deleteThread(ForumThread thread)
Deletes a thread and all of its messages. |
void |
deleteUserMessages(User user)
Deletes all messages authored by a given user. |
ForumThread |
getForumThread(long threadID)
Returns the thread with the specified threadID. |
ForumMessage |
getLatestMessage(JiveContainer container)
Returns the most recently created or edited message in this container (including all sub-containers if applicable). |
ForumMessage |
getLatestMessage(TagSet tagSet)
Returns the most recently created or edited message in this tag set . |
ForumMessage |
getMessage(long messageID)
Returns the forum message with the specified messageID. |
int |
getMessageCount(JiveContainer container)
Acquire the count of all messages for a specified container. |
int |
getMessageCount(JiveContainer container,
ThreadResultFilter resultFilter)
The account of messages for the JiveContainer with the ThreadResultFilter applied. |
int |
getMessageCount(TagSet tagSet)
Acquire the count of all messages for a specified tag set. |
int |
getMessageCount(TagSet tagSet,
ThreadResultFilter resultFilter)
The account of messages for the TagSet with the ThreadResultFilter applied. |
JiveIterator<ForumMessage> |
getMessages(JiveContainer container)
Returns an Iterable for all the messages in the container. |
JiveIterator<ForumMessage> |
getMessages(JiveContainer container,
ThreadResultFilter resultFilter)
Returns an Iterable for all the messages in the container that match the criteria specified by the ResultFilter. |
JiveIterator<ForumMessage> |
getMessages(TagSet tagSet)
Returns an Iterable for all the messages in the tag set. |
JiveIterator<ForumMessage> |
getMessages(TagSet tagSet,
ThreadResultFilter resultFilter)
Returns an Iterable for all the messages in the tag set that match the criteria specified by the ResultFilter. |
JiveIterator<ForumThread> |
getPopularThreads()
Returns an Iterable for the most threads in the system as ForumThread objects. |
int |
getThreadCount(JiveContainer container)
Returns the number of threads in the container. |
int |
getThreadCount(JiveContainer container,
ThreadResultFilter resultFilter)
Returns the number of threads in the container based on the specified ResultFilter. |
int |
getThreadCount(TagSet tagSet)
Returns the number of threads in the tag set. |
int |
getThreadCount(TagSet tagSet,
ThreadResultFilter resultFilter)
Returns the number of threads in the tag set based on the specified ResultFilter. |
JiveIterator<ForumThread> |
getThreads(JiveContainer container)
Returns an Iterable for all the threads in the container. |
JiveIterator<ForumThread> |
getThreads(JiveContainer container,
ThreadResultFilter resultFilter)
Returns an Iterable for all the threads in the container that match the criteria specified by the ResultFilter. |
JiveIterator<ForumThread> |
getThreads(TagSet tagSet)
Returns an Iterable for all the threads in the tag set. |
JiveIterator<ForumThread> |
getThreads(TagSet tagSet,
ThreadResultFilter resultFilter)
Returns an Iterable for all the threads in the tag set that match the criteria specified by the ResultFilter. |
int |
getUserMessageCount(User user)
Returns the total number of messages a user has posted in all containers. |
int |
getUserMessageCount(User user,
ThreadResultFilter resultFilter)
Returns the total number of messages a user has posted in all containers that obey the parameters set by the specificed ResultFilter. |
JiveIterator<ForumMessage> |
getUserMessages(User user)
Returns an iterable for all messages posted by a user. |
JiveIterator<ForumMessage> |
getUserMessages(User user,
ThreadResultFilter resultFilter)
Returns an iterable for all messages posted by a user that obey the parameters set by the specified ResultFilter. |
boolean |
isModerationEnabled()
Returns true if moderation has been enabled by setting the Jive property "database.moderationEnabled" to true. |
void |
moveMessage(ForumMessage message,
ForumThread newThread,
long parentMessageID)
Moves a message to another thread. |
void |
moveThread(ForumThread thread,
JiveContainer newContainer)
Moves a thread from one container to another. |
void |
update(ForumMessage message)
Persists message changes, and broadcasts changes across the cluster. |
void |
update(ForumThread thread)
Persists thread changes, and broadcasts changes across the cluster. |
| Methods inherited from interface com.jivesoftware.community.JiveManager |
|---|
destroy |
| Method Detail |
|---|
ForumThread getForumThread(long threadID)
throws ForumThreadNotFoundException,
UnauthorizedException
threadID - the id of the thread to return.
UnauthorizedException - if not allowed to read the thread.
ForumThreadNotFoundException - if the requested thread does not exist.
ForumMessage getMessage(long messageID)
throws ForumMessageNotFoundException,
UnauthorizedException
messageID - the id of the message to return.
UnauthorizedException - if not allowed to read the message.
ForumMessageNotFoundException - if the requested message does not exist.JiveIterator<ForumThread> getPopularThreads()
popularThreads.number -- The number of threads that will be returned in the list of popular threads.
Default is 4. popularThreads.timeWindow -- The number of hours to consider new messages in a
thread from. Default is 24 hours, which is suitable for sites with moderate to high amounts of traffic. Sites
with less traffic may wish to set the window to a number of days.
void moveThread(ForumThread thread,
JiveContainer newContainer)
throws UnauthorizedException
newContainer.
or be the author of the thread and have rights to create new threads in the newContainer
The main purpose of this method is to allow admins to move non-topical threads into a more appropriate
container.
thread - the thread to move to another container.newContainer - the new container to move the thread to
UnauthorizedException - if does not have admin or moderator permissions for the thread's current container
and the newContainer.
void deleteThread(ForumThread thread)
throws UnauthorizedException
thread - the thread to delete.
UnauthorizedException - if not an admin or moderator of the thread's containerint getUserMessageCount(User user)
getMessageCount(JiveContainer ,ThreadResultFilter) method.
user - the user to tally results for.
int getUserMessageCount(User user,
ThreadResultFilter resultFilter)
getMessageCount(JiveContainer , ThreadResultFilter) method.
user - the user to tally results for.resultFilter - a resultFilter to limit the query on.
JiveIterator<ForumMessage> getUserMessages(User user)
user - the user to get messages for.
JiveIterator<ForumMessage> getUserMessages(User user,
ThreadResultFilter resultFilter)
user - the user to get messages for.resultFilter - a resultFilter to limit the query on.
boolean isModerationEnabled()
int getThreadCount(JiveContainer container)
getThreads(JiveContainer) method.
container - the container
int getThreadCount(TagSet tagSet)
getThreads(TagSet) method.
tagSet - the tag set
int getThreadCount(JiveContainer container,
ThreadResultFilter resultFilter)
getThreads(JiveContainer , com.jivesoftware.community.ThreadResultFilter) method.
container - the containerresultFilter - a resultFilter to limit the query on.
int getThreadCount(TagSet tagSet,
ThreadResultFilter resultFilter)
getThreads(JiveContainer ,
com.jivesoftware.community.ThreadResultFilter) method.
tagSet - the tag setresultFilter - a resultFilter to limit the query on.
JiveIterator<ForumThread> getThreads(JiveContainer container)
container - the container
JiveIterator<ForumThread> getThreads(TagSet tagSet)
tagSet - the tag set
JiveIterator<ForumThread> getThreads(JiveContainer container,
ThreadResultFilter resultFilter)
container - the containerresultFilter - a ResultFilter object to perform filtering and sorting with.
JiveIterator<ForumThread> getThreads(TagSet tagSet,
ThreadResultFilter resultFilter)
tagSet - the tag setresultFilter - a ResultFilter object to perform filtering and sorting with.
ForumThread createThread(JiveContainer container,
ForumMessage rootMessage)
Create a new message, and set each of its fields such as the subject and
body. addThread
method.addThread method before it is saved to
the database. It is illegal to create a thread in one container and then add it to another container.
container - The container to create a thread in.rootMessage - the root message of the thread.
UnauthorizedException - if does not have CREATE_THREAD permissions.
void addThread(JiveContainer container,
ForumThread thread)
throws RejectedException
moveForum method should be used.
container - The container to add a thread too.thread - the thread to add to the container.
RejectedException - if one of the installed interceptors prevents the root message from being posted.
UnauthorizedException - if does not have CREATE_THREAD permissions.int getMessageCount(JiveContainer container)
container - The container to acquire the count for.
int getMessageCount(TagSet tagSet)
tagSet - the tag set
int getMessageCount(JiveContainer container,
ThreadResultFilter resultFilter)
JiveContainer with the ThreadResultFilter applied.
container - The container to acquire the count for.resultFilter - The filter to apply to the resutls
int getMessageCount(TagSet tagSet,
ThreadResultFilter resultFilter)
TagSet with the ThreadResultFilter applied.
tagSet - the tag setresultFilter - The filter to apply to the resutls
JiveIterator<ForumMessage> getMessages(JiveContainer container)
container - The container
JiveIterator<ForumMessage> getMessages(TagSet tagSet)
tagSet - the tag set
JiveIterator<ForumMessage> getMessages(JiveContainer container,
ThreadResultFilter resultFilter)
container - the containerresultFilter - a ResultFilter object to perform filtering and sorting with.
JiveIterator<ForumMessage> getMessages(TagSet tagSet,
ThreadResultFilter resultFilter)
tagSet - the tag setresultFilter - a ResultFilter object to perform filtering and sorting with.
ForumMessage getLatestMessage(JiveContainer container)
ThreadResultFilter, but this method offers a simpler, more optimized way
to access the data.
container - The container to acquire the last message from.
ForumMessage getLatestMessage(TagSet tagSet)
ThreadResultFilter, but this method offers a simpler, more optimized way to access the data.
tagSet - the tag set
ForumMessage createMessage(JiveContainer container)
container - The container to create the message in
ForumMessage createMessage(JiveContainer container,
User user)
container - The container to create the message inuser - the author of the message.
UnauthorizedException - if does not have permission to post as the specified user.void update(ForumMessage message)
RequiresUpdate annotation change this method should be called to save the
changes.
message - The message.void update(ForumThread thread)
RequiresUpdate annotation change this method should be called to save the
changes.
thread - The thread.
void addMessage(ForumThread thread,
ForumMessage parentMessage,
ForumMessage newMessage)
throws RejectedException
When a message is being added, it is first run through all message interceptors that are installed. Each interceptor has the option to reject the message by throwing a RejectedException. For example, an interceptor might reject all messages coming from a certain IP.
thread - the thread recieving the new message.parentMessage - some message in this thread that will be parent.newMessage - message to add to this thread under the parent.
RejectedException - if one of the installed interceptors prevents the message from being posted.
UnauthorizedException - if does not have CREATE_MESSAGE permissions.
void deleteMessage(ForumThread thread,
ForumMessage message,
boolean deleteChildren)
thread - the thread having message(s) delete from it.message - the message to delete.deleteChildren - true to delete given message's child messages.
UnauthorizedException - if not an admin or moderator of the message's container
void deleteUserMessages(User user)
throws UnauthorizedException
user - the author of the messages being deleted.
UnauthorizedException - if not an admin or moderator of the message's container
void deleteMessage(ForumThread thread,
ForumMessage message)
thread - the thread having message(s) delete from it.message - the message to delete.
UnauthorizedException - if not an admin or moderator of the message's container
void moveMessage(ForumMessage message,
ForumThread newThread,
long parentMessageID)
message - the message being movednewThread - the thread recieving the messageparentMessageID - the messageID of the moving message's new parent message within the new thread
UnauthorizedException - if does not have admin or moderator permissions for the thread's current
container.
void addAttachment(ForumMessage message,
Attachment attachment)
message - message that the attachment is added to.attachment - attachement.
RejectedException - if one of the installed interceptors prevents the message from being posted.
UnauthorizedException - if does not have CREATE_MESSAGE permissions.
|
Jive Product Page | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||