| org.nemesis.forum.Message
All known Subclasses: org.nemesis.forum.impl.DbForumMessage, org.nemesis.forum.MessageFilter, org.nemesis.forum.proxy.MessageProxy,
Message | public interface Message (Code) | | 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
considerable more information with each message besides a subject and body,
each message can have an arbitrary number of properties. For example, a
property "IP" 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.
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.
See Also: ForumMessageFilter |
getBody | public String getBody()(Code) | | Returns the message body. If message filters are active, the body
returned will be a filtered one. Because filters often provide security
functionality, this method is the preferred way to get the body of a
message.
the body of the message. |
getCreationDate | public Date getCreationDate()(Code) | | Returns the date the message was created.
the date the message was created. |
getForumThread | public ForumThread getForumThread()(Code) | | Returns the thread the message belongs to.
the thread the message belongs to. |
getID | public int getID()(Code) | | Returns the id of the message.
the unique id of the message. |
getModifiedDate | public Date getModifiedDate()(Code) | | Returns the date the 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.
the date the message was last modified. |
getProperty | public String getProperty(String name)(Code) | | Returns an extended property of the message. Each message can have an
arbitrary number of extended properties. This lets particular skins
or filters provide enhanced functionality that is not part of the base
interface.
For security reasons, all property values are run through an HTML filter
before being returned.
Parameters: name - the name of the property to get. the value of the property. |
getSubject | public String getSubject()(Code) | | 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.
the subject of the message. |
getUnfilteredBody | public String getUnfilteredBody()(Code) | | Returns the message body, 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
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.
the body of the message. |
getUnfilteredProperty | public String getUnfilteredProperty(String name)(Code) | | Returns an extended property of the message, bypassing the HTML filter.
Each message can have an arbitrary number of extended properties. This
lets particular skins or filters provide enhanced functionality that is
not part of the base interface.
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.
Parameters: name - the name of the property to get. the value of the property. |
getUnfilteredSubject | public String getUnfilteredSubject()(Code) | | 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
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.
the subject of the message. |
getUser | public User getUser()(Code) | | Returns the User that authored the message. If the message was created
anonymously, the Anonymous User object will be returned.
the author of the message. |
hasPermission | public boolean hasPermission(int type)(Code) | | Returns true if the handle on the object has the permission specified.
A list of possible permissions can be found in the ForumPermissions
class. Certain methods of this class are restricted to certain
permissions as specified in the method comments.
Parameters: type - a permission type. true if the specified permission is valid. See Also: ForumPermissions |
isAnonymous | public boolean isAnonymous()(Code) | | Returns whether the message was posted anonymously. This is a convenience
method and is equivalent to getUser().isAnonymous();
true if the message was posted anonymously. |
isApproved | public boolean isApproved()(Code) | | return true if the message is approved
|
propertyNames | public Iterator propertyNames()(Code) | | Returns an Iterator for all the names of the message properties.
an Iterator for the names of all message properties. |
setCreationDate | public void setCreationDate(Date creationDate) throws UnauthorizedException(Code) | | Sets the creation date of the 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 the message was created. throws: UnauthorizedException - if does not have ADMIN permissions. |
setModifiedDate | public void setModifiedDate(Date modifiedDate) throws UnauthorizedException(Code) | | Sets the date the 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: modifiedDate - the date the message was modified. throws: UnauthorizedException - if does not have ADMIN permissions. |
setProperty | public void setProperty(String name, String value)(Code) | | Sets an extended property of the message. Each message can have an
arbitrary number of extended properties. This lets particular skins
or filters provide enhanced functionality that is not part of the base
interface.
Parameters: name - the name of the property to set. Parameters: value - the new value for the property. |
|
|