|
Jive Forums API (5.5.8) Developer Javadocs | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.jivesoftware.forum.proxy.ForumThreadProxy
public class ForumThreadProxy
Protection proxy for ForumThread objects. It restricts access to protected methods by throwing UnauthorizedExceptions if the user does not have permission to access the class.
| Field Summary | |
|---|---|
protected Permissions |
permissions
|
| Fields inherited from interface com.jivesoftware.forum.JiveContentObject |
|---|
PLAIN_STRATEGY |
| Constructor Summary | |
|---|---|
ForumThreadProxy(ForumThread thread,
AuthToken authToken,
Permissions permissions)
Creates a new proxy. |
|
| Method Summary | |
|---|---|
void |
addMessage(ForumMessage parentMessage,
ForumMessage newMessage)
Adds a new message to this thread. |
void |
deleteMessage(ForumMessage message)
Deletes a message in this thread. |
void |
deleteMessage(ForumMessage message,
boolean deleteChildren)
Deletes a message in this thread, optionally recusively deleting child messages. |
void |
deleteProperty(java.lang.String name)
Deletes an extended property. |
boolean |
equals(java.lang.Object object)
|
java.lang.String |
getBody()
Return a summary of the jive object content. |
java.util.Date |
getCreationDate()
Returns the date that this thread was created. |
Forum |
getForum()
Returns the forum this thread belongs to. |
long |
getID()
Retrieve the unique identifier for the jive object. |
ForumMessage |
getLatestMessage()
Returns the most recently created messages in this thread. |
ForumMessage |
getMessage(long messageID)
Returns a message from this thread based on its id. |
int |
getMessageCount()
Returns the number of messages in the thread. |
int |
getMessageCount(ResultFilter resultFilter)
Returns the number of messages in this thread based on the specified result filter. |
java.util.Iterator |
getMessages()
Return an Iterator for all the messages in this thread. |
java.util.Iterator |
getMessages(ResultFilter resultFilter)
Returns a Iterator for all the messages in the thread that match the criteria specified by the ResultFilter. |
int |
getModerationValue()
Returns the number of moderation points this thread has. |
java.util.Date |
getModificationDate()
Returns the date that this thread was last modified. |
java.lang.String |
getName()
Returns the subject of the root message of this thread. |
int |
getObjectType()
Return the object type of the jive object. |
java.lang.String |
getPlainBody()
Returns the body of the jive object content with no markup applied. |
java.lang.String |
getPlainSubject()
Returns the title of the jive object content with no markup applied |
java.util.Collection |
getProperties(java.lang.String parentName)
Return all immediate children property values of a parent property as an unmodifiable Collection of String values. |
java.lang.String |
getProperty(java.lang.String name)
Returns an extended property of this thread. |
java.util.Iterator |
getPropertyNames()
Returns an Iterator for the names of this thread's properties. |
ForumThread |
getProxiedForumThread()
Provides access to the underlying thread object. |
ForumMessage |
getRootMessage()
Returns the root message this thread. |
java.lang.String |
getSubject()
Return the title of the jive object content |
TagDelegator |
getTagDelegator()
Retrieve a tag delegator to manage thread tags. |
TreeWalker |
getTreeWalker()
Returns the TreeWalker for this thread. |
java.lang.String |
getUnfilteredBody()
Returns the body, bypassing any active filters. |
java.lang.String |
getUnfilteredSubject()
Returns the subject, bypassing any active filters. |
User |
getUser()
Returns the user who authored of the jive object. |
int |
hashCode()
|
boolean |
isAuthorized(long type)
Returns true if the handle on the object has the permission specified. |
void |
setCreationDate(java.util.Date creationDate)
Sets the creation date of this thread. |
void |
setModerationValue(int value,
AuthToken authToken)
Sets the number of moderation points this thread has. |
void |
setModificationDate(java.util.Date modificationDate)
Sets the date this thread was last modified. |
void |
setProperty(java.lang.String name,
java.lang.String value)
Sets an extended property of this thread. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected Permissions permissions
| Constructor Detail |
|---|
public ForumThreadProxy(ForumThread thread,
AuthToken authToken,
Permissions permissions)
| Method Detail |
|---|
public long getID()
JiveObject
getID in interface JiveObjectgetID in interface ForumThreadpublic java.lang.String getName()
ForumThreadgetRootMessage().getSubject().
getName in interface ForumThreadpublic java.lang.String getSubject()
JiveContentObject
getSubject in interface JiveContentObjectpublic java.lang.String getPlainSubject()
JiveContentObject
getPlainSubject in interface JiveContentObjectpublic java.lang.String getBody()
JiveContentObject
getBody in interface JiveContentObjectpublic java.lang.String getPlainBody()
JiveContentObject
getPlainBody in interface JiveContentObjectpublic User getUser()
JiveContentObject
getUser in interface JiveContentObjectpublic java.lang.String getUnfilteredSubject()
JiveContentObjectUnfiltered content is necessary for a few reasons. One is when saving Jive content to another persistence mechanism such as an XML format.
getUnfilteredSubject in interface JiveContentObjectpublic java.lang.String getUnfilteredBody()
JiveContentObjectUnfiltered content is necessary for a few reasons. One is when saving Jive content to another persistence mechanism such as an XML format.
getUnfilteredBody in interface JiveContentObjectpublic java.util.Date getCreationDate()
ForumThread
getCreationDate in interface ForumThreadgetCreationDate in interface JiveContentObjectpublic int getObjectType()
JiveObject
getObjectType in interface JiveObject
public void setCreationDate(java.util.Date creationDate)
throws UnauthorizedException
ForumThread
setCreationDate in interface ForumThreadcreationDate - the date this thread was created.
UnauthorizedException - if not an administrator.public java.util.Date getModificationDate()
ForumThread
getModificationDate in interface ForumThreadgetModificationDate in interface JiveContentObject
public void setModificationDate(java.util.Date modificationDate)
throws UnauthorizedException
ForumThread
setModificationDate in interface ForumThreadmodificationDate - the date this thread was modified.
UnauthorizedException - if not an administrator.public int getModerationValue()
ForumThreadForum.getModerationDefaultThreadValue()
If the moderation value is less than JiveConstants.FORUM_MODERATION_VISIBLE
then the thread will not be displayed by default. Because a thread and
its root message are intrinsically bound together, their moderation values
are linked and are always the same. This means that setting the moderation
value on the thread or setting the moderation value of a root message will
always affect both objects.
getModerationValue in interface ForumThread
public void setModerationValue(int value,
AuthToken authToken)
throws UnauthorizedException
ForumThreadJiveConstants.FORUM_MODERATION_VISIBLE
then the thread will not be displayed by default. Because a thread and its
root message must always go together, their moderation values are linked
and are always the same. This means that setting the moderation value on
the thread or setting the moderation value of a root message will always
affect both objects.The authToken token of the user must be passed into this method as a paramater for auditing purposes.
setModerationValue in interface ForumThreadvalue - the number of moderation points for this thread.authToken - the AuthToken token of the user that is making the
moderation decision.
UnauthorizedException - if not a moderator or administrator.public java.lang.String getProperty(java.lang.String name)
ForumThread
getProperty in interface ForumThreadname - the name of the property to get.
public java.util.Collection getProperties(java.lang.String parentName)
ForumThread
getProperties in interface ForumThreadparentName - the name of the parent property to return the children for.
public void setProperty(java.lang.String name,
java.lang.String value)
throws UnauthorizedException
ForumThreadThe user that created the thread (author of rootMessage), or system or forum admins can always call this method. Additionally, anyone (including anonymous users) can call this method before the thread has been added to a Forum.
setProperty in interface ForumThreadname - the name of the property to set.value - the new value for the property.
UnauthorizedException - if not allowed to set extended properties.
public void deleteProperty(java.lang.String name)
throws UnauthorizedException
ForumThreadname does not exist, this method will do nothing.The user that created the thread (author of rootMessage), or system or forum admins can always call this method. Additionally, anyone (including anonymous users) can call this method before the thread has been added to a Forum.
deleteProperty in interface ForumThreadname - the name of the property to delete.
UnauthorizedException - if not allowed to delete extended properties.public java.util.Iterator getPropertyNames()
ForumThread
getPropertyNames in interface ForumThreadpublic Forum getForum()
ForumThread
getForum in interface ForumThreadpublic int getMessageCount()
ForumThread
getMessageCount in interface ForumThreadpublic int getMessageCount(ResultFilter resultFilter)
ForumThread
getMessageCount in interface ForumThreadresultFilter - a filter to limit the message count query, such as
date or moderation value range.
public ForumMessage getRootMessage()
ForumThread
getRootMessage in interface ForumThread
public void addMessage(ForumMessage parentMessage,
ForumMessage newMessage)
throws MessageRejectedException,
UnauthorizedException
ForumThreadWhen a message is being added, it is first run through all message interceptors that are installed. Each interceptor has the option to reject the message by throwing a MessageRejectedException. For example, an interceptor might reject all messages coming from a certain IP.
addMessage in interface ForumThreadparentMessage - some message in this thread that will be parent.newMessage - message to add to this thread under the parent.
MessageRejectedException - if one of the installed interceptors prevents the
message from being posted.
UnauthorizedException - if does not have CREATE_MESSAGE permissions.MessageInterceptor
public void deleteMessage(ForumMessage message)
throws UnauthorizedException
ForumThread
deleteMessage in interface ForumThreadmessage - the message to delete.
UnauthorizedException - if does not have permission to delete messages.
public void deleteMessage(ForumMessage message,
boolean deleteChildren)
throws UnauthorizedException
ForumThreadForumThread.deleteMessage(ForumMessage) method since it will recursively delete all
child messages of the message. If deleteChildren is false,
then child messages will not be deleted. Instead, they will be made children of
the message's parent message. As an example, consider the following thread:
A
|-- B
|-- C
|-- D
|-- E
If message B is deleted with deleteChildren set to true,
then messages C, D, and E will also be deleted. If deleteChildren
is set to false, then the new message structure will be:
A
|-- C
|-- D
|-- E
Note: because the root message has no parent messages, an IllegalArgumentException
will thrown if message is the root message and deleteChildren is
true.
deleteMessage in interface ForumThreadmessage - the message to delete.deleteChildren - true if child messages should be deleted, false if child
messages should be moved to be children of the message's parent.
UnauthorizedException - if does not have permission to delete messages.
public ForumMessage getMessage(long messageID)
throws ForumMessageNotFoundException
ForumThread
getMessage in interface ForumThreadmessageID - the ID of the message to get from this thread.
ForumMessageNotFoundExceptionpublic ForumMessage getLatestMessage()
ForumThreadResultFilter, but this
method offers a simpler, more optimized way to access the data.
getLatestMessage in interface ForumThreadpublic TreeWalker getTreeWalker()
ForumThread
getTreeWalker in interface ForumThreadpublic java.util.Iterator getMessages()
ForumThread
getMessages in interface ForumThreadpublic java.util.Iterator getMessages(ResultFilter resultFilter)
ForumThread
getMessages in interface ForumThreadresultFilter - a ResultFilter object to perform filtering and
sorting with.
public boolean isAuthorized(long type)
ForumThreadA 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.
isAuthorized in interface ForumThreadtype - a permission type.
ForumPermissionspublic TagDelegator getTagDelegator()
ForumThread
getTagDelegator in interface ForumThreadpublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object object)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object
public ForumThread getProxiedForumThread()
throws UnauthorizedException
UnauthorizedException
|
Jive Forums Project Page | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||