| com.Yasna.forum.ForumMessage
All known Subclasses: com.Yasna.forum.ForumMessageFilter, com.Yasna.forum.database.DbForumMessage, com.Yasna.forum.ForumMessageProxy,
ForumMessage | public interface ForumMessage (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 |
Method Summary | |
public String | getBody() Returns the message body. | public Date | getCreationDate() Returns the date the message was created. | public ForumThread | getForumThread() Returns the thread the message belongs to. | public int | getID() Returns the id of the message. | public Date | getModifiedDate() Returns the date the message was last modified. | public String | getProperty(String name) Returns an extended property of the message. | public MessageRanking | getRanking() this method returns the ranking of the message.
If this is the root message then there is no ranking. | public int | getReplyPrivateUserId() Returns the id of the User to which the private message is posted
i.e. | public String | getSubject() Returns the message subject. | public String | getUnfilteredBody() Returns the message body, bypassing any active filters. | public String | getUnfilteredProperty(String name) Returns an extended property of the message, bypassing the HTML filter.
Each message can have an arbitrary number of extended properties. | public String | getUnfilteredSubject() Returns the message subject, bypassing any active filters. | public User | getUser() Returns the User that authored the message. | public boolean | hasPermission(int type) Returns true if the handle on the object has the permission specified.
A list of possible permissions can be found in the ForumPermissions
class. | public boolean | isAnonymous() Returns whether the message was posted anonymously. | public boolean | isApproved() Returns whether the message was approved. | public boolean | isPrivate() Indicates if message is private or not. | public Iterator | propertyNames() Returns an Iterator for all the names of the message properties. | public void | setApprovment(boolean approved) Used by moderators to approved a message in moderated forum. | public void | setBody(String body) Sets the body of the message. | public void | setCreationDate(Date creationDate) Sets the creation date of the message. | public void | setModifiedDate(Date modifiedDate) Sets the date the message was last modified. | public void | setProperty(String name, String value) Sets an extended property of the message. | public void | setRanking(int para) this method sets the ranking of the message. | public void | setReplyPrivateUserId(int replyPrivateUserId) Used only for private messages. | public void | setSubject(String subject) Sets the subject of the message. |
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. |
getRanking | public MessageRanking getRanking()(Code) | | this method returns the ranking of the message.
If this is the root message then there is no ranking. It is defaulted to neutral ranking for the message.
|
getReplyPrivateUserId | public int getReplyPrivateUserId()(Code) | | Returns the id of the User to which the private message is posted
i.e. userId of the parent message or 0 if the message is not private
user id of the of the parent message or 0 if the message is not private. |
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
Yazd 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
Yazd 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) | | Returns whether the message was approved. When forum is not modereted
this method always will return true;
true if the message was approved. |
isPrivate | public boolean isPrivate()(Code) | | Indicates if message is private or not.
true if message is private, false otherwise. |
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. |
setApprovment | public void setApprovment(boolean approved) throws UnauthorizedException(Code) | | Used by moderators to approved a message in moderated forum.
Parameters: approved - when true this message will be visible for all. throws: UnauthorizedException - if does not have ADMIN permissions. |
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. |
setRanking | public void setRanking(int para) throws UnauthorizedException(Code) | | this method sets the ranking of the message.
Note that the ranking of the message can only be set by the user who created the thread or asked the original question.
Also the user can't rank his own posts.
Parameters: para - throws: UnauthorizedException - |
setReplyPrivateUserId | public void setReplyPrivateUserId(int replyPrivateUserId) throws UnauthorizedException(Code) | | Used only for private messages. Sets the userId of the parent message.
Parameters: replyPrivateUserId - the userId of the parent message. throws: UnauthorizedException - if does not have ADMIN permissions. |
|
|