|
Clearspace API (2.5.29) Core Javadocs | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ForumMessage
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. For example:
[thread]
|- [message]
|- [message]
|- [message]
|- [message]
|- [message]
|- [message]
Each message has a subject and body. Messages are authored by a user in the system or can be anonymous. An ID is
given to each message so that it can be tracked uniquely. Because is possible that one might want to store more
information with each message besides a subject and body, each message can have an arbitrary number of properties.
For example, a property "IPAddress" could be stored with each message that records the IP address of the person
posting the message for security reasons.The creation date, and the date the message was last modified are maintained for each message. These values are normally maintained automatically by the system and do not need to be set explicitly except in special circumstances.
Message editing has a number of rules:
For added functionality, any number of filters can be applied to a message. Filters dynamically format the subject and body of a message. Methods are also provided to bypass filters.
ForumManager.getMessage(long),
ForumThread.getMessage(long)| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.jivesoftware.community.JiveContentObject |
|---|
JiveContentObject.Field, JiveContentObject.Status |
| Method Summary | |
|---|---|
Document |
getBody()
Returns the message body. |
long |
getContainerID()
Returns the id of the container object of the message. |
int |
getContainerType()
Returns the type of the container object of the message. |
Date |
getCreationDate()
Returns the date this message was created. |
ForumThread |
getForumThread()
Returns the thread this message belongs to. |
long |
getID()
Returns the id of this message, or -1 if this message hasn't been added to the database yet. |
JiveContainer |
getJiveContainer()
Returns the container object of the message. |
int |
getModerationValue()
Returns the number of moderation points this message has. |
Date |
getModificationDate()
Returns the date this message was last modified. |
ForumMessage |
getParentMessage()
Returns the parent message of this message or null if this message is the root message of a thread. |
Map<String,String> |
getProperties()
Retrieve a map of all the extended properties for the message. |
int |
getRewardPoints()
|
String |
getSubject()
Returns the message subject. |
String |
getUnfilteredProperty(String name)
Returns an extended property of the message, bypassing any filters. |
User |
getUser()
Returns the User that authored this message. |
boolean |
isAnonymous()
Returns true if this message was posted anonymously. |
boolean |
isAuthorized(long permissionType)
Returns true if the handle on this object has the permission specified. |
boolean |
isHtml()
Returns true if this body of this message contains HTML. |
boolean |
isRead(User user)
Returns true if this message has been read by the user, false otherwise. |
boolean |
isUnread(User user)
Returns true if this message has not been read by the user, false otherwise. |
boolean |
isUpdated(User user)
Returns true if this message has been updated since read by the user, false otherwise. |
void |
setBody(Document body)
Sets the body of this message. |
void |
setCreationDate(Date creationDate)
Sets the creation date of this message. |
void |
setModerationValue(int value)
Sets the number of moderation points this message has. |
void |
setModificationDate(Date modificationDate)
Sets the date this message was last modified. |
void |
setRewardPoints(int rewardPoints)
|
void |
setStatus(JiveContentObject.Status status)
Sets the status of this message |
void |
setSubject(String subject)
Sets the subject of this message. |
| Methods inherited from interface com.jivesoftware.community.JiveContentObject |
|---|
getIndexContent, getPlainBody, getPlainSubject, getStatus, getUnfilteredSubject |
| Methods inherited from interface com.jivesoftware.community.JiveObject |
|---|
getObjectType |
| Methods inherited from interface com.jivesoftware.community.JiveObject |
|---|
getObjectType |
| Methods inherited from interface com.jivesoftware.community.ImageContentResource |
|---|
addImage, createImage, deleteImage, getImage, getImageCount, getImages |
| Method Detail |
|---|
long getID()
getID in interface JiveObjectDate getCreationDate()
getCreationDate in interface JiveContentObject
void setCreationDate(Date creationDate)
throws UnauthorizedException
creationDate - the date this message was created.
UnauthorizedException - if does not have ADMIN permissions.Date getModificationDate()
getModificationDate in interface JiveContentObject
void setModificationDate(Date modificationDate)
throws UnauthorizedException
modificationDate - the date this message was modified.
UnauthorizedException - if not allowed to edit the message.String getSubject()
getSubject in interface JiveContentObject
void setSubject(String subject)
throws UnauthorizedException
subject - the subject of this message.
UnauthorizedException - if not allowed to edit this message.Document getBody()
getBody in interface JiveContentObject
void setBody(Document body)
throws UnauthorizedException
body - the body of this message.
UnauthorizedException - if does not allowed to edit this message.User getUser()
AnonymousUser.
getUser in interface JiveContentObjectForumMessage getParentMessage()
TreeWalker for similiar functionality.
int getModerationValue()
Community.getModerationDefaultMessageValue()If the moderation value is less than
JiveConstants.MESSAGE_MODERATION_VISIBLE then the message will not
be displayed by default.
void setModerationValue(int value)
throws UnauthorizedException
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.
value - the number of moderation points for the message.
UnauthorizedException - if does not have ADMIN, MODERATE_MESSAGES or MODERATOR permissions.Gateway,
WatchManager
void setStatus(JiveContentObject.Status status)
throws UnauthorizedException
status - the status of the message.
UnauthorizedException - if the caller does not have ADMIN, MODERATE_MESSAGES or MODERATOR permissions.int getRewardPoints()
void setRewardPoints(int rewardPoints)
Map<String,String> getProperties()
If the user is not authorized to modify the message any method which modifies the map will fail with a UnsupportedOperationException;
String getUnfilteredProperty(String name)
Because properties are not filtered before being returned, this method should be used with caution. In particular, you should avoid showing unfiltered data in an environment where embedded HTML might be interpreted.
name - the name of the property to get.
boolean isAnonymous()
ForumThread getForumThread()
boolean isAuthorized(long permissionType)
A list of possible permissions can be found in the Permissions class. Certain methods of this class are restricted to certain permissions as specified in the method comments.
permissionType - permissionType a permission type.
Permissionsboolean isHtml()
DbForumMessage.PROP_CONTENT_TYPE extended property being set to DbForumMessage.TEXT_HTML.
boolean isRead(User user)
user - the user to check read stats for this message
boolean isUnread(User user)
user - the user to check read stats for this message
boolean isUpdated(User user)
user - the user to check read stats for this message
int getContainerType()
getContainerType in interface com.jivesoftware.community.ContainerAwaregetContainerType in interface JiveContentObjectlong getContainerID()
getContainerID in interface com.jivesoftware.community.ContainerAwaregetContainerID in interface JiveContentObjectJiveContainer getJiveContainer()
|
Clearspace Project Page | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||