Clearspace API (2.0.15) Web Services Client Javadocs

com.jivesoftware.community.webservices
Class WSForumMessage

java.lang.Object
  extended by com.jivesoftware.community.webservices.WSForumMessage

public class WSForumMessage
extends java.lang.Object

A ForumMessage encapsulates message data. Each message belongs to a thread, and relates to other messages in a thread in a tree relationship. This system allows messages to represent threaded conversations.


Constructor Summary
WSForumMessage()
           
 
Method Summary
 boolean equals(java.lang.Object o)
           
 int getAttachmentCount()
          Returns the number of attachments this message has.
 java.lang.String getBody()
          Returns the message body.
 java.util.Date getCreationDate()
          Returns the date this message was created.
 long getForumThreadID()
          Returns the ID of the thread this message belongs to.
 long getID()
          Returns the id of this message.
 int getImageCount()
          Returns the number of images this message has.
 long getJiveContainerID()
          Returns the ID of the community this message belongs to.
 int getJiveContainerType()
           
 int getModerationValue()
          Returns the number of moderation points this message has.
 java.util.Date getModificationDate()
          Returns the date this message was last modified.
 long getParentMessageID()
          Returns the ID of the parent message of this message or 0 if this message is the root message of a thread.
 java.lang.String getSubject()
          Returns the message subject.
 java.lang.String getUnfilteredSubject()
          Returns the message subject, bypassing any active filters.
 WSUser getUser()
          Returns the ID User that authored this message.
 int hashCode()
           
 boolean isAnonymous()
          Returns true if this message was posted anonymously.
 void setAnonymous(boolean anonymous)
          Sets whether or not this message was created anonymously.
 void setAttachmentCount(int attachmentCount)
          Sets the number of attachments this message has.
 void setBody(java.lang.String body)
          Sets the body of this message.
 void setCreationDate(java.util.Date creationDate)
          Sets the creation date of this message.
 void setForumThreadID(long forumThreadID)
          Sets the ID of thread that this message belongs too.
 void setHtml(boolean html)
          Sets whether or not this message contains html.
 void setID(long id)
          Sets the id of this message.
 void setImageCount(int imageCount)
          Sets the number of images this message has.
 void setJiveContainerID(long containerID)
          Sets the ID of the community that this message belongs too.
 void setJiveContainerType(int jiveContainerType)
           
 void setModerationValue(int value)
          Sets the number of moderation points this message has.
 void setModificationDate(java.util.Date modificationDate)
          Sets the date this message was last modified.
 void setParentMessageID(long parentMessageID)
          Sets the id of the parent message to this message.
 void setSubject(java.lang.String subject)
          Sets the subject of this message.
 void setUnfilteredSubject(java.lang.String unfilteredSubject)
          Sets the unfiltered version of the subject.
 void setUser(WSUser user)
          Sets the id of the user.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WSForumMessage

public WSForumMessage()
Method Detail

getID

public long getID()
Returns the id of this message.

Returns:
the unique id of this message.

setID

public void setID(long id)
Sets the id of this message.

Parameters:
id - the id of this message.

getCreationDate

public java.util.Date getCreationDate()
Returns the date this message was created.

Returns:
the date this message was created.

setCreationDate

public void setCreationDate(java.util.Date creationDate)
Sets the creation date of this message. In most cases, the creation date will default to when the message was entered into the system. However, the creation date needs to be set manually when importing messages. In other words, skin authors should ignore this method since it only intended for system maintenance.

Parameters:
creationDate - the date this message was created.
Throws:
UnauthorizedException - if does not have ADMIN permissions.

getModificationDate

public java.util.Date getModificationDate()
Returns the date this message was last modified. When a message is first created, the date returned by this method is identical to the creation date. The modified date is updated every time a message property is updated, such as the message body.

Returns:
the date this message was last modified.

setModificationDate

public void setModificationDate(java.util.Date modificationDate)
Sets the date this message was last modified. In most cases, last modifed will default to when the message data was last changed. However, the last modified date needs to be set manually when importing messages. In other words, skin authors should ignore this method since it only intended for system maintenance.

Parameters:
modificationDate - the date this message was modified.
Throws:
UnauthorizedException - if not allowed to edit the message.

getSubject

public java.lang.String getSubject()
Returns the message subject. If message filters are active, the subject returned will be a filtered one. Because filters often provide security functionality, this method is the preferred way to get the subject of a message.

Returns:
the subject of this message.

getUnfilteredSubject

public java.lang.String getUnfilteredSubject()
Returns the message subject, bypassing any active filters. Because filters often provide security, this method should be used with caution. In particular, you should avoid showing unfiltered data in an environment where embedded HTML might be interpreted.

Unfiltered content is necessary for a few reasons. One is when saving Jive content to another persistence mechanism such as an XML format. Another is when you need to skip filter formatting, such as when a user is responding to another user's message.

Returns:
the subject of this message.

setUnfilteredSubject

public void setUnfilteredSubject(java.lang.String unfilteredSubject)
Sets the unfiltered version of the subject.

Parameters:
unfilteredSubject - the unfiltered version of the subject.

setSubject

public void setSubject(java.lang.String subject)
Sets the subject of this message.

Parameters:
subject - the subject of this message.
Throws:
UnauthorizedException - if not allowed to edit this message.

getBody

public java.lang.String getBody()
Returns the message body. If message filters are active, the body returned will be a filtered one. Because filters often provide security functionality such as stripping out HTML and Javascript, this method is the preferred way to get the body of a message.

Returns:
the body of this message.

setBody

public void setBody(java.lang.String body)
             throws UnauthorizedException
Sets the body of this message.

Parameters:
body - the body of this message.
Throws:
UnauthorizedException - if does not allowed to edit this message.

getUser

public WSUser getUser()
Returns the ID User that authored this message. If the message was created anonymously, this method will return 0.

Returns:
the author of the message.

setUser

public void setUser(WSUser user)
Sets the id of the user.

Parameters:
user - the id of the user.

getParentMessageID

public long getParentMessageID()
Returns the ID of the parent message of this message or 0 if this message is the root message of a thread.

Returns:
the ID of the parent message of this message or 0 if this message is the root message of a thread.

setParentMessageID

public void setParentMessageID(long parentMessageID)
Sets the id of the parent message to this message.

Parameters:
parentMessageID - the id of the parent message to this message.

getAttachmentCount

public int getAttachmentCount()
Returns the number of attachments this message has.

Returns:
the number of attachments this message has.

setAttachmentCount

public void setAttachmentCount(int attachmentCount)
Sets the number of attachments this message has.

Parameters:
attachmentCount - the number of attachments this message has.

getImageCount

public int getImageCount()
Returns the number of images this message has.

Returns:
the number of images this message has.

setImageCount

public void setImageCount(int imageCount)
Sets the number of images this message has.

Parameters:
imageCount - the number of images this message has.

getModerationValue

public int getModerationValue()
Returns the number of moderation points this message has.

If the moderation value is less than JiveConstants.MESSAGE_MODERATION_VISIBLE then the message will not be displayed by default.

Returns:
the number of moderation points the message has.

setModerationValue

public void setModerationValue(int value)
                        throws UnauthorizedException
Sets the number of moderation points this message has. If the moderation value is less than than JiveConstants.MESSAGE_MODERATION_VISIBLE, then a number of things will happen:

When calling this method results in a message to go from below the minimum visible threshold to above, then the actions listed above will all be executed. Any change of the moderation value also results in the modified date of the message being updated.

Only administrators and moderators can call this method.

The authToken token of the user must be passed into this method as a paramater for moderation auditing purposes.

Parameters:
value - the number of moderation points for the message.
Throws:
UnauthorizedException - if does not have ADMIN, MODERATE_MESSAGES or MODERATOR permissions.
See Also:
com.jivesoftware.community.gateway.Gateway, com.jivesoftware.community.WatchManager

isAnonymous

public boolean isAnonymous()
Returns true if this message was posted anonymously. This is a convenience method for: message.getUser() < 1.

Returns:
true if this message was posted anonymously.

setAnonymous

public void setAnonymous(boolean anonymous)
Sets whether or not this message was created anonymously.

Parameters:
anonymous - whether or not this message was created anonymously.

getForumThreadID

public long getForumThreadID()
Returns the ID of the thread this message belongs to.

Returns:
The thread this message belongs to.

setForumThreadID

public void setForumThreadID(long forumThreadID)
Sets the ID of thread that this message belongs too.

Parameters:
forumThreadID - The ID of thread that this message belongs too.

getJiveContainerID

public long getJiveContainerID()
Returns the ID of the community this message belongs to.

Returns:
The community this message belongs to.

setJiveContainerID

public void setJiveContainerID(long containerID)
Sets the ID of the community that this message belongs too.

Parameters:
containerID - The ID of the community that this message belongs too.

setHtml

public void setHtml(boolean html)
Sets whether or not this message contains html.

Parameters:
html - whether or not this message contains html.

setJiveContainerType

public void setJiveContainerType(int jiveContainerType)

getJiveContainerType

public int getJiveContainerType()

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

Clearspace Project Page

Copyright © 1999-2007 Jive Software.