Clearspace API (1.10.14) Web Services Client Javadocs

com.jivesoftware.community.webservices
Interface ForumService


public interface ForumService

Provides the ability to manipulate forum messages. This service will allow you to delete, move and acquire forum messages.


Method Summary
 void addAttachmentToMessage(long messageID, java.lang.String name, java.lang.String contentType, byte[] source)
          Adds an attachment to the message with the specified ID.
 void addImageToMessage(long messageID, java.lang.String name, java.lang.String contentType, byte[] source)
          Adds an image to the message with the specified ID.
 ForumMessage createMessage(java.lang.String subject, java.lang.String body, long threadID, long userID)
          Creates a new message on the given thread.
 ForumMessage createReplyMessage(java.lang.String subject, java.lang.String body, long messageID, long userID)
          Creates a new message that is a direct response to a given message.
 ForumThread createThread(java.lang.String subject, java.lang.String body, long communityID, long userID)
          Creates a new thread.
 void deleteMessage(long messageID)
          Delete the message with the following id.
 void deleteMessageAndChildren(long messageID, boolean deleteChildren)
          Delete the message with the specified id.
 void deleteMessageProperty(java.lang.String name, long messageID)
          Delete a property with the given name from the message with the given ID.
 void deleteThread(long threadID)
          Deletes a thread with the specified ID.
 void deleteThreadProperty(java.lang.String name, long threadID)
          Delete a property with the given name from the thread with the given ID.
 Attachment[] getAttachmentsByMessageID(long messageID)
          Returns an array of attachments that are attached to the specified message.
 ForumMessage getChild(long messageID, int index)
          Returns the child of parent at index index in the parent's child array.
 int getChildCount(long messageID)
          Returns the number of children of parent.
 ForumMessage[] getChildren(long messageID)
          Returns an array of all the child messages of the parent.
 ForumMessage getForumMessage(long messageID)
          Returns a ForumMessage by its ID.
 ForumThread getForumThread(long threadID)
          Returns a ForumThread by its ID.
 Image[] getImagesByMessageID(long messageID)
          Returns an array of images that are attached to the specified message.
 int getIndexOfChild(long parentID, long messageID)
          Returns the index of child in parent.
 int getMessageCountByCommunityID(long communityID)
          Returns the number of messages that are in the community.
 int getMessageCountByCommunityIDAndFilter(long communityID, ResultFilter filter)
          Returns the number of messages that are in the community with the specified id after the specified filter has been applied.
 int getMessageCountByThreadID(long threadID)
          Returns the number of messages that are in the thread.
 int getMessageCountByThreadIDAndFilter(long threadID, ResultFilter filter)
          Returns the number of messages that are in the thread with the specified id after the specified filter has been applied.
 int getMessageCountsByCommunityID(long communityID)
          Returns the number of messages that are in the community.
 int getMessageCountsByCommunityIDAndFilter(long communityID, ResultFilter filter)
          Returns the number of messages that are in the forum with the specified id after the specified filter has been applied.
 int getMessageDepth(long messageID)
          Returns the depth of a message in the message tree hierarchy.
 long[] getMessageIDsByCommunityID(long communityID)
          Returns all of the message IDs for all of the message that are in the community.
 long[] getMessageIDsByCommunityIDAndFilter(long communityID, ResultFilter filter)
          Returns all of the message IDs for all of the message that are in the community with the specified ID, filtered by the the specified result filter.
 long[] getMessageIDsByThreadID(long threadID)
          Returns the IDs of the messages that are in the thread.
 long[] getMessageIDsByThreadIDAndFilter(long threadID, ResultFilter filter)
          Returns all of the message IDs for all of the message that are in the thread after the specified filter has been applied.
 Property[] getMessageProperties(long messageID)
          Returns all tbe extended properties for the message with the specified ID.
 java.lang.String getMessageProperty(java.lang.String name, long messageID)
          Returns a specific extended property for the message with the specified property name and message ID.
 ForumMessage[] getMessagesByCommunityID(long communityID)
          Returns all of the messages that are in the community.
 ForumMessage[] getMessagesByCommunityIDAndFilter(long communityID, ResultFilter filter)
          Returns all of the messages that are in the community with the specified ID, filtered by the the specified result filter.
 ForumMessage[] getMessagesByThreadID(long threadID)
          Returns the messages that are in the thread.
 ForumMessage[] getMessagesByThreadIDAndFilter(long threadID, ResultFilter filter)
          Returns all of the messages that are in the thread after the specified filter has been applied.
 ForumMessage getParent(long messageID)
          Returns the parent of the child ForumMessage.
 ForumThread[] getPopularThreads()
          Returns an array of thread IDs for all the popular threads in the system.
 ForumThread[] getPopularThreadsByCommunityID(long communityID)
          Return an array of popular threads by community.
 int getRecursiveChildCount(long messageID)
          Returns the total number of recursive children of a parent.
 ForumMessage[] getRecursiveChildren(long messageID)
          Returns an array for all child messages (and sub-children, etc) of the parent.
 ForumMessage[] getRecursiveMessages(long threadID)
          Returns an array for all messages in the thread in depth-first order.
 ForumMessage getRootMessage(long threadID)
          Returns the root of a thread.
 int getThreadCountByCommunityID(long communityID)
          Returns the number of threads in the specified community.
 int getThreadCountByCommunityIDAndFilter(long communityID, ResultFilter filter)
          Returns the number of threads in the specified community after being filtered by the specified filter.
 Property[] getThreadProperties(long threadID)
          Returns all tbe extended properties for the thread with the specified ID.
 java.lang.String getThreadProperty(java.lang.String name, long threadID)
          Returns a specific extended property for the thread with the specified property name and thread ID.
 ForumThread[] getThreadsByCommunityID(long communityID)
          Returns all of the IDs for threads a community.
 ForumThread[] getThreadsByCommunityIDAndFilter(long communityID, ResultFilter filter)
          Returns all of the IDs for threads a community has filtered by the specified result filter.
 Property[] getUnfilteredMessageProperties(long messageID)
          Returns the properties without applying filters to them first.
 boolean hasParent(long messageID)
          Returns true if the child message has a parent message.
 boolean isLeaf(long messageID)
          Returns true if node is a leaf.
 void moveThread(long threadID, long communityID)
          Moves the thread with the specified ID to the community with the specified ID.
 void setMessageProperty(java.lang.String name, java.lang.String value, long messageID)
          Set an extended for the property with the given message id.
 void setThreadProperty(java.lang.String name, java.lang.String value, long threadID)
          Set an extended for the property for the thread with the given ID.
 void updateForumMessage(ForumMessage message)
          Used to update the subject and body of a ForumMessage
 

Method Detail

getForumMessage

ForumMessage getForumMessage(long messageID)
                             throws ForumMessageNotFoundException
Returns a ForumMessage by its ID.

Parameters:
messageID - id of the message.
Returns:
the ForumMessage that matches the specified ID.
Throws:
ForumMessageNotFoundException - Thrown if the specified message does not exist.

deleteMessage

void deleteMessage(long messageID)
                   throws ForumMessageNotFoundException
Delete the message with the following id.

Parameters:
messageID - the id of the message to delete.
Throws:
ForumMessageNotFoundException - Thrown if the specified message does not exist.

deleteMessageAndChildren

void deleteMessageAndChildren(long messageID,
                              boolean deleteChildren)
                              throws ForumMessageNotFoundException
Delete the message with the specified id. If the deleteChildren parameters is set to true all children of this message will be deleted.

Parameters:
messageID - The ID of the message to delete.
deleteChildren - Whether or not to delete the children of this message.
Throws:
ForumMessageNotFoundException - Thrown if the specified message does not exist.

getMessageProperties

Property[] getMessageProperties(long messageID)
Returns all tbe extended properties for the message with the specified ID.

Parameters:
messageID - The ID of the message to retrieve properties for.
Returns:
An array of properties for the message with the given ID.

getMessageProperty

java.lang.String getMessageProperty(java.lang.String name,
                                    long messageID)
                                    throws ForumMessageNotFoundException
Returns a specific extended property for the message with the specified property name and message ID.

Parameters:
name - The name of the property.
messageID - The ID of the message to retrieve the property for.
Returns:
The value of the property, null if not found.
Throws:
ForumMessageNotFoundException - Thrown if the specified message does not exist.

setMessageProperty

void setMessageProperty(java.lang.String name,
                        java.lang.String value,
                        long messageID)
                        throws ForumMessageNotFoundException
Set an extended for the property with the given message id.

Parameters:
name - The name of the property.
value - The value of the property.
messageID - The ID of the message to set an extended property for.
Throws:
ForumMessageNotFoundException - Thrown if the specified message does not exist.

deleteMessageProperty

void deleteMessageProperty(java.lang.String name,
                           long messageID)
                           throws ForumMessageNotFoundException
Delete a property with the given name from the message with the given ID.

Parameters:
name - The name of the property to delete.
messageID - The ID of the message to delete the property from.
Throws:
ForumMessageNotFoundException - Thrown if the specified message does not exist.

getUnfilteredMessageProperties

Property[] getUnfilteredMessageProperties(long messageID)
                                          throws ForumMessageNotFoundException
Returns the properties without applying filters to them first.

Parameters:
messageID - The ID of the message to return unfiltered properties for.
Returns:
Unfiltered properties for the message.
Throws:
ForumMessageNotFoundException - Thrown if the specified message does not exist.

getAttachmentsByMessageID

Attachment[] getAttachmentsByMessageID(long messageID)
                                       throws ForumMessageNotFoundException
Returns an array of attachments that are attached to the specified message.

Parameters:
messageID - The ID of the message to acquire attachments for.
Returns:
An array of attachments that are attached to the specified message.
Throws:
ForumMessageNotFoundException - Thrown if the specified message does not exist.

addAttachmentToMessage

void addAttachmentToMessage(long messageID,
                            java.lang.String name,
                            java.lang.String contentType,
                            byte[] source)
                            throws AttachmentException,
                                   ForumMessageNotFoundException,
                                   java.io.IOException
Adds an attachment to the message with the specified ID.

Parameters:
messageID - The ID of the message.
name - The name of the attachment.
contentType - the content type of the attachment.
source - The content for the attachment.
Throws:
java.io.IOException - Thrown if there are issues adding the message.
AttachmentException - Thrown if the attachment cannot be created.
ForumMessageNotFoundException - Thrown if the specified message does not exist.

getImagesByMessageID

Image[] getImagesByMessageID(long messageID)
                             throws ForumMessageNotFoundException
Returns an array of images that are attached to the specified message.

Parameters:
messageID - The ID of the message to acquire images for.
Returns:
An array of images that are attached to the specified message.
Throws:
ForumMessageNotFoundException - Thrown if the specified message does not exist.

addImageToMessage

void addImageToMessage(long messageID,
                       java.lang.String name,
                       java.lang.String contentType,
                       byte[] source)
                       throws com.jivesoftware.community.ImageException,
                              ForumMessageNotFoundException,
                              java.io.IOException
Adds an image to the message with the specified ID.

Parameters:
messageID - The ID of the message.
name - The name of the image.
contentType - the content type of the image.
source - The content for the image.
Throws:
java.io.IOException - Thrown if there are issues adding the message.
com.jivesoftware.community.ImageException - Thrown if the image cannot be created.
ForumMessageNotFoundException - Thrown if the specified message does not exist.

getMessageIDsByCommunityIDAndFilter

long[] getMessageIDsByCommunityIDAndFilter(long communityID,
                                           ResultFilter filter)
                                           throws CommunityNotFoundException
Returns all of the message IDs for all of the message that are in the community with the specified ID, filtered by the the specified result filter.

Parameters:
communityID - The id of the community to find messages for.
filter - Filter to be apply to the results.
Returns:
An array of message IDs for message that belong to the specified community.
Throws:
CommunityNotFoundException - Thrown if the specified community does not exist.

getMessageIDsByCommunityID

long[] getMessageIDsByCommunityID(long communityID)
                                  throws CommunityNotFoundException
Returns all of the message IDs for all of the message that are in the community.

If the number of results exceeds WSConstants.MAX_MESSAGE_RESULTS than then message IDs up to WSConstants.MAX_MESSAGE_RESULTS will be returned.

Parameters:
communityID - The ID of the community to find messages for.
Returns:
An array of message IDs for message that belong to the specified community.
Throws:
CommunityNotFoundException - Thrown if the specified community does not exist.

getMessageCountsByCommunityIDAndFilter

int getMessageCountsByCommunityIDAndFilter(long communityID,
                                           ResultFilter filter)
                                           throws com.jivesoftware.community.NotFoundException
Returns the number of messages that are in the forum with the specified id after the specified filter has been applied.

Parameters:
communityID - The id of the community.
filter - Filter that can be applied to filter out results.
Returns:
The number of messages in the specified community.
Throws:
com.jivesoftware.community.NotFoundException - Thrown if the specified community does not exist.

getMessageCountsByCommunityID

int getMessageCountsByCommunityID(long communityID)
                                  throws com.jivesoftware.community.NotFoundException
Returns the number of messages that are in the community.

Parameters:
communityID - The id of the community
Returns:
The number of messages in the specified community.
Throws:
com.jivesoftware.community.NotFoundException - Thrown if the community does not exist.

getMessageCountByCommunityIDAndFilter

int getMessageCountByCommunityIDAndFilter(long communityID,
                                          ResultFilter filter)
                                          throws CommunityNotFoundException
Returns the number of messages that are in the community with the specified id after the specified filter has been applied.

Parameters:
communityID - The ID of the community to find the message count for.
filter - The filter that can be applied to filter out results.
Returns:
The number of messages in the specified community.
Throws:
CommunityNotFoundException - Thrown if the specified community does not exist.

getMessageCountByCommunityID

int getMessageCountByCommunityID(long communityID)
                                 throws CommunityNotFoundException
Returns the number of messages that are in the community.

Parameters:
communityID - The ID of the community to find the message count for.
Returns:
The number of messages in the specified community.
Throws:
CommunityNotFoundException - Thrown if the specified community does not exist.

getMessageIDsByThreadIDAndFilter

long[] getMessageIDsByThreadIDAndFilter(long threadID,
                                        ResultFilter filter)
                                        throws ForumThreadNotFoundException
Returns all of the message IDs for all of the message that are in the thread after the specified filter has been applied.

Parameters:
threadID - The ID of the thread to find messages for.
filter - The filter to apply to the results.
Returns:
An array of message IDs for message that belong to the specified thread.
Throws:
ForumThreadNotFoundException - Thrown if the specified thread does not exist.

getMessageIDsByThreadID

long[] getMessageIDsByThreadID(long threadID)
                               throws ForumThreadNotFoundException
Returns the IDs of the messages that are in the thread.

If the number of results exceeds WSConstants.MAX_MESSAGE_RESULTS than then message IDs up to WSConstants.MAX_MESSAGE_RESULTS will be returned.

Parameters:
threadID - The ID of the thread to find message IDs for.
Returns:
The IDs of the messages in the specified thread.
Throws:
ForumThreadNotFoundException - Thrown if the specified thread does not exist.

getMessageCountByThreadIDAndFilter

int getMessageCountByThreadIDAndFilter(long threadID,
                                       ResultFilter filter)
                                       throws ForumThreadNotFoundException
Returns the number of messages that are in the thread with the specified id after the specified filter has been applied.

Parameters:
threadID - The ID of the thread to find the message count for.
filter - The filter that can be applied to filter out results.
Returns:
The number of messages in the specified thread.
Throws:
ForumThreadNotFoundException - Thrown if the specified thread does not exist.

getMessageCountByThreadID

int getMessageCountByThreadID(long threadID)
                              throws ForumThreadNotFoundException
Returns the number of messages that are in the thread.

Parameters:
threadID - The ID of the thread to find the message count for.
Returns:
The number of messages in the specified thread.
Throws:
ForumThreadNotFoundException - Thrown if the specified thread does not exist.

getMessagesByCommunityIDAndFilter

ForumMessage[] getMessagesByCommunityIDAndFilter(long communityID,
                                                 ResultFilter filter)
                                                 throws CommunityNotFoundException
Returns all of the messages that are in the community with the specified ID, filtered by the the specified result filter.

Parameters:
communityID - The id of the community to find messages for.
filter - Filter to be apply to the results.
Returns:
An array of messages that belong to the specified community.
Throws:
CommunityNotFoundException - Thrown if the specified community does not exist.

getMessagesByCommunityID

ForumMessage[] getMessagesByCommunityID(long communityID)
                                        throws CommunityNotFoundException
Returns all of the messages that are in the community.

If the number of results exceeds WSConstants.MAX_MESSAGE_RESULTS than then message IDs up to WSConstants.MAX_MESSAGE_RESULTS will be returned.

Parameters:
communityID - The ID of the community to find messages for.
Returns:
An array of messages that belong to the specified community.
Throws:
CommunityNotFoundException - Thrown if the specified community does not exist.

getMessagesByThreadIDAndFilter

ForumMessage[] getMessagesByThreadIDAndFilter(long threadID,
                                              ResultFilter filter)
                                              throws ForumThreadNotFoundException
Returns all of the messages that are in the thread after the specified filter has been applied.

Parameters:
threadID - The ID of the thread to find messages for.
filter - The filter to apply to the results.
Returns:
An array of messages that belong to the specified thread.
Throws:
ForumThreadNotFoundException - Thrown if the specified thread does not exist.

getMessagesByThreadID

ForumMessage[] getMessagesByThreadID(long threadID)
                                     throws ForumThreadNotFoundException
Returns the messages that are in the thread.

If the number of results exceeds WSConstants.MAX_MESSAGE_RESULTS than then message IDs up to WSConstants.MAX_MESSAGE_RESULTS will be returned.

Parameters:
threadID - The ID of the thread to find message IDs for.
Returns:
The messages in the specified thread.
Throws:
ForumThreadNotFoundException - Thrown if the specified thread does not exist.

getRootMessage

ForumMessage getRootMessage(long threadID)
                            throws ForumThreadNotFoundException
Returns the root of a thread. Returns null only if thread has no nodes.

Parameters:
threadID - The ID of the thread.
Returns:
The root of the thread.
Throws:
ForumThreadNotFoundException - Thrown if the specified thread does not exist.

hasParent

boolean hasParent(long messageID)
                  throws ForumMessageNotFoundException
Returns true if the child message has a parent message.

Parameters:
messageID - the message.
Returns:
true if the message has a parent.
Throws:
ForumMessageNotFoundException - Thrown if the specified message does not exist.

getParent

ForumMessage getParent(long messageID)
                       throws ForumMessageNotFoundException
Returns the parent of the child ForumMessage.

Parameters:
messageID - The ID of the message to find the parent for.
Returns:
the parent message of child.
Throws:
ForumMessageNotFoundException - if child does not have a parent, or if the parent message could not be loaded for any other reason.

getChild

ForumMessage getChild(long messageID,
                      int index)
                      throws ForumMessageNotFoundException
Returns the child of parent at index index in the parent's child array. The index must be a valid one, that is: index >= 0, and index < getChildCount(parent). If the index is not valid, or if the child could not be loaded for any other reason, a ForumMessageNotFoundException will be thrown.

Parameters:
messageID - The ID of the parent message.
index - the index of the child.
Returns:
the child of parent at index.
Throws:
ForumMessageNotFoundException - if the index was invalid or the child could not be loaded for any other reason.

getChildren

ForumMessage[] getChildren(long messageID)
                           throws ForumMessageNotFoundException
Returns an array of all the child messages of the parent. This method only considers direct descendants of the parent message and not sub-children. To get an array for the full hierarchy of children for a parent message, use the getRecursiveChildren(long) method.

Parameters:
messageID - The parent message.
Returns:
An array for the children of parent.
Throws:
ForumMessageNotFoundException - Thrown if the specified message does not exist.

getRecursiveChildren

ForumMessage[] getRecursiveChildren(long messageID)
                                    throws ForumMessageNotFoundException
Returns an array for all child messages (and sub-children, etc) of the parent. Messages will be returned depth-first. For example, consider the following message tree:

   1
   |-- 3
   |-- |-- 4
   |-- |-- |-- 7
   |-- |-- |-- |-- 10
   |-- |-- 6
   |-- |-- 8
   |-- 5
 

Calling getRecursiveChildren(3) on the tree above would return the sequence 4, 7, 10, 6, 8. This method is a powerful way to show all children of a message, especially in combination with the getMessageDepth(long) method.

Parameters:
messageID - The ID of the parent message.
Returns:
An array for all the recursive children of the parent.
Throws:
ForumMessageNotFoundException - Thrown if the specified message does not exist.

isLeaf

boolean isLeaf(long messageID)
               throws ForumMessageNotFoundException
Returns true if node is a leaf. A node is a leaf when it has no children messages.

Parameters:
messageID - A node in the thread, obtained from this data source.
Returns:
True if node is a leaf.
Throws:
ForumMessageNotFoundException - Thrown if the specified message does not exist.

getRecursiveChildCount

int getRecursiveChildCount(long messageID)
                           throws ForumMessageNotFoundException
Returns the total number of recursive children of a parent. Returns 0 if there are no children. This method is not intended to aid in navigation of a Thread but is included as an added utility.

Parameters:
messageID - The ID of the message.
Returns:
The recursive count of the children of parent.
Throws:
ForumMessageNotFoundException - Thrown if the specified message does not exist.

getIndexOfChild

int getIndexOfChild(long parentID,
                    long messageID)
                    throws ForumMessageNotFoundException
Returns the index of child in parent. This method does not deal with the indexes of sub-children of parents. For example, take the following tree:

   4
   |-- 2
   |-- |-- 1
   |-- |-- 6
   |-- |-- 8
   |-- 5
 

In this example, getIndexOfChild(4, 2) would return 0, getIndexOfChild(4, 5) would return 1, and getIndexOfChild(2, 8) would return 2. getIndexOfChild(4, 8) -- NOT VALID

Parameters:
parentID - The ID of the parent message.
messageID - The ID of the child message to get the index for.
Returns:
The index of child in the list of siblings under parent.
Throws:
ForumMessageNotFoundException - Thrown if the specified message does not exist.

getMessageDepth

int getMessageDepth(long messageID)
                    throws ForumMessageNotFoundException
Returns the depth of a message in the message tree hierarchy. The root message is always at depth 0. For example, consider the following message tree:

   1
   |-- 3
   |-- |-- 4
   |-- |-- |-- 7
 

The depth of message 4 is 2, the depth of message 7 is 3, etc. This method is useful in combination with the getRecursiveChildren(long) array to build a UI of hierarchical messages.

Parameters:
messageID - The ID of the message to determine the depth of.
Returns:
The depth of the message in the message tree hiearchy.
Throws:
ForumMessageNotFoundException - Thrown if the specified message does not exist.

getChildCount

int getChildCount(long messageID)
                  throws ForumMessageNotFoundException
Returns the number of children of parent. Returns 0 if the node is a leaf or if it has no children.

Parameters:
messageID - The ID the message.
Returns:
The number of children of the node parent.
Throws:
ForumMessageNotFoundException - Thrown if the specified message does not exist.

getRecursiveMessages

ForumMessage[] getRecursiveMessages(long threadID)
                                    throws ForumThreadNotFoundException
Returns an array for all messages in the thread in depth-first order. For example, consider the following message tree:

   1
   |-- 3
   |-- |-- 4
   |-- |-- |-- 7
   |-- |-- |-- |-- 10
   |-- |-- 6
   |-- |-- 8
   |-- 5
 

Calling getRecursiveMessages() on the tree above would return the sequence 1, 3, 4, 7, 10, 6, 8, 5. This method is a powerful way to show the full tree of messages, especially in combination with the getMessageDepth(long) method.

Parameters:
threadID - The ID of the thread.
Returns:
An array for all messages in the thread in depth-first order.
Throws:
ForumThreadNotFoundException - Thrown if the specified thread does not exist.

updateForumMessage

void updateForumMessage(ForumMessage message)
                        throws ForumMessageNotFoundException
Used to update the subject and body of a ForumMessage

Parameters:
message - The message to update
Throws:
ForumMessageNotFoundException - Thrown if the forum message does not exist

getForumThread

ForumThread getForumThread(long threadID)
                           throws ForumThreadNotFoundException
Returns a ForumThread by its ID.

Parameters:
threadID - The ID of the thread.
Returns:
The ForumThread object by the ID.
Throws:
ForumThreadNotFoundException - Thrown if the specified therad does not exist.

getPopularThreads

ForumThread[] getPopularThreads()
Returns an array of thread IDs for all the popular threads in the system.

Returns:
An array of popular thread IDs in the system.

deleteThread

void deleteThread(long threadID)
                  throws ForumThreadNotFoundException
Deletes a thread with the specified ID.

Parameters:
threadID - The ID of thread to delete.
Throws:
ForumThreadNotFoundException - Thrown if the specified therad does not exist.

moveThread

void moveThread(long threadID,
                long communityID)
                throws ForumThreadNotFoundException,
                       CommunityNotFoundException
Moves the thread with the specified ID to the community with the specified ID.

Parameters:
threadID - The ID of the thread to move.
communityID - The ID of the community to move the thread to.
Throws:
ForumThreadNotFoundException - Thrown if the specified therad does not exist.
CommunityNotFoundException - Thrown if the specified community does not exist.

getThreadProperties

Property[] getThreadProperties(long threadID)
                               throws ForumThreadNotFoundException
Returns all tbe extended properties for the thread with the specified ID.

Parameters:
threadID - The ID of the thread to retrieve properties for.
Returns:
An array of extended properties for the thread with the given ID.
Throws:
ForumThreadNotFoundException - Thrown if the specified therad does not exist.

getThreadProperty

java.lang.String getThreadProperty(java.lang.String name,
                                   long threadID)
                                   throws ForumThreadNotFoundException
Returns a specific extended property for the thread with the specified property name and thread ID.

Parameters:
name - The name of the property.
threadID - The ID of the thread to retrieve the property for.
Returns:
The value of the property, null if not found.
Throws:
ForumThreadNotFoundException - Thrown if the specified thread does not exist.

setThreadProperty

void setThreadProperty(java.lang.String name,
                       java.lang.String value,
                       long threadID)
                       throws ForumThreadNotFoundException
Set an extended for the property for the thread with the given ID.

Parameters:
name - The name of the property.
value - The value of the property.
threadID - The ID of the thread to set an extended property for.
Throws:
ForumThreadNotFoundException - Thrown if the specified therad does not exist.

deleteThreadProperty

void deleteThreadProperty(java.lang.String name,
                          long threadID)
                          throws ForumThreadNotFoundException
Delete a property with the given name from the thread with the given ID.

Parameters:
name - The name of the property to delete.
threadID - The ID of the thread to delete the property from.
Throws:
ForumThreadNotFoundException - Thrown if the specified therad does not exist.

getThreadsByCommunityID

ForumThread[] getThreadsByCommunityID(long communityID)
                                      throws CommunityNotFoundException
Returns all of the IDs for threads a community. If the number of threads exceeds WSConstants.MAX_THREAD_RESULTS the threads up to WSConstants.MAX_THREAD_RESULTS will be returned.

Parameters:
communityID - The ID of the community to grab threds for.
Returns:
An array of thread IDs for a community.
Throws:
CommunityNotFoundException - Thrown if the specified community does not exist.

getThreadsByCommunityIDAndFilter

ForumThread[] getThreadsByCommunityIDAndFilter(long communityID,
                                               ResultFilter filter)
                                               throws CommunityNotFoundException
Returns all of the IDs for threads a community has filtered by the specified result filter.

Parameters:
communityID - The ID of the community to grab threds for.
filter - The filter to use against the result.
Returns:
An array of thread IDs for a community.
Throws:
CommunityNotFoundException - Thrown if the specified community does not exist.

getThreadCountByCommunityID

int getThreadCountByCommunityID(long communityID)
                                throws CommunityNotFoundException
Returns the number of threads in the specified community.

Parameters:
communityID - The ID of the community to check the thread count for.
Returns:
The number of threads in the community.
Throws:
CommunityNotFoundException - Thrown if the specified community does not exist.

getThreadCountByCommunityIDAndFilter

int getThreadCountByCommunityIDAndFilter(long communityID,
                                         ResultFilter filter)
                                         throws CommunityNotFoundException
Returns the number of threads in the specified community after being filtered by the specified filter.

Parameters:
communityID - The ID of the community to check the thread count for.
filter - The filter to filter out results with.
Returns:
The number of threads in the community after the filter has been applied.
Throws:
CommunityNotFoundException - Thrown if the specified community does not exist.

getPopularThreadsByCommunityID

ForumThread[] getPopularThreadsByCommunityID(long communityID)
                                             throws CommunityNotFoundException
Return an array of popular threads by community.

Parameters:
communityID - The ID of the community to check the thread count for.
Returns:
An array of threads.
Throws:
CommunityNotFoundException - Thrown if community does not exist.

createThread

ForumThread createThread(java.lang.String subject,
                         java.lang.String body,
                         long communityID,
                         long userID)
                         throws RejectedException,
                                com.jivesoftware.community.NotFoundException
Creates a new thread.

Parameters:
subject - Subject used in creation of the thread.
body - Body used in creation of the thread.
communityID - The community to create a new thread in.
userID - The user to create this message as. Use a number less than zero for anonymous.
Returns:
The newly created thread.
Throws:
com.jivesoftware.community.NotFoundException - If the Community or the user does not exist.
RejectedException - If the message is not valid.

createMessage

ForumMessage createMessage(java.lang.String subject,
                           java.lang.String body,
                           long threadID,
                           long userID)
                           throws RejectedException,
                                  com.jivesoftware.community.NotFoundException
Creates a new message on the given thread.

If userID is a value less than one then the message will be created for an anonymous user.

Parameters:
subject - Subject used in creation of the thread.
body - Body used in creation of the thread.
threadID - Thread to create the message too.
userID - The user to create this message as. Use a number less than zero for anonymous.
Returns:
The newly created message.
Throws:
com.jivesoftware.community.NotFoundException - If the community or user does not exist.
RejectedException - Thrown if the message is rejected.

createReplyMessage

ForumMessage createReplyMessage(java.lang.String subject,
                                java.lang.String body,
                                long messageID,
                                long userID)
                                throws RejectedException,
                                       com.jivesoftware.community.NotFoundException
Creates a new message that is a direct response to a given message.

If userID is a value less than one then the message will be created for an anonymous user.

Parameters:
subject - Subject used in creation of the thread.
body - Body used in creation of the thread.
messageID - The id of the message to respond too.
userID - The user to create this message as. Use a number less than zero for anonymous.
Returns:
The newly created message.
Throws:
RejectedException - Thrown if the message is invalid.
com.jivesoftware.community.NotFoundException - Thrown if the user or the original message does not exist.

Clearspace Project Page

Copyright © 1999-2007 Jive Software.