|
Jive Forums API (5.5.20.2-oracle) 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 JiveObject
getID
in interface ForumThread
public java.lang.String getName()
ForumThread
getRootMessage().getSubject()
.
getName
in interface ForumThread
public java.lang.String getSubject()
JiveContentObject
getSubject
in interface JiveContentObject
public java.lang.String getPlainSubject()
JiveContentObject
getPlainSubject
in interface JiveContentObject
public java.lang.String getBody()
JiveContentObject
getBody
in interface JiveContentObject
public java.lang.String getPlainBody()
JiveContentObject
getPlainBody
in interface JiveContentObject
public User getUser()
JiveContentObject
getUser
in interface JiveContentObject
public java.lang.String getUnfilteredSubject()
JiveContentObject
Unfiltered 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 JiveContentObject
public java.lang.String getUnfilteredBody()
JiveContentObject
Unfiltered 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 JiveContentObject
public java.util.Date getCreationDate()
ForumThread
getCreationDate
in interface ForumThread
getCreationDate
in interface JiveContentObject
public int getObjectType()
JiveObject
getObjectType
in interface JiveObject
public void setCreationDate(java.util.Date creationDate) throws UnauthorizedException
ForumThread
setCreationDate
in interface ForumThread
creationDate
- the date this thread was created.
UnauthorizedException
- if not an administrator.public java.util.Date getModificationDate()
ForumThread
getModificationDate
in interface ForumThread
getModificationDate
in interface JiveContentObject
public void setModificationDate(java.util.Date modificationDate) throws UnauthorizedException
ForumThread
setModificationDate
in interface ForumThread
modificationDate
- the date this thread was modified.
UnauthorizedException
- if not an administrator.public int getModerationValue()
ForumThread
Forum.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
ForumThread
JiveConstants.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 ForumThread
value
- 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 ForumThread
name
- the name of the property to get.
public java.util.Collection getProperties(java.lang.String parentName)
ForumThread
getProperties
in interface ForumThread
parentName
- the name of the parent property to return the children for.
public void setProperty(java.lang.String name, java.lang.String value) throws UnauthorizedException
ForumThread
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.
setProperty
in interface ForumThread
name
- 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
ForumThread
name
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 ForumThread
name
- the name of the property to delete.
UnauthorizedException
- if not allowed to delete extended properties.public java.util.Iterator getPropertyNames()
ForumThread
getPropertyNames
in interface ForumThread
public Forum getForum()
ForumThread
getForum
in interface ForumThread
public int getMessageCount()
ForumThread
getMessageCount
in interface ForumThread
public int getMessageCount(ResultFilter resultFilter)
ForumThread
getMessageCount
in interface ForumThread
resultFilter
- 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
ForumThread
When 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 ForumThread
parentMessage
- 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 ForumThread
message
- the message to delete.
UnauthorizedException
- if does not have permission to delete messages.public void deleteMessage(ForumMessage message, boolean deleteChildren) throws UnauthorizedException
ForumThread
ForumThread.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 |-- EIf 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 |-- ENote: 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 ForumThread
message
- 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 ForumThread
messageID
- the ID of the message to get from this thread.
ForumMessageNotFoundException
public ForumMessage getLatestMessage()
ForumThread
ResultFilter
, but this
method offers a simpler, more optimized way to access the data.
getLatestMessage
in interface ForumThread
public TreeWalker getTreeWalker()
ForumThread
getTreeWalker
in interface ForumThread
public java.util.Iterator getMessages()
ForumThread
getMessages
in interface ForumThread
public java.util.Iterator getMessages(ResultFilter resultFilter)
ForumThread
getMessages
in interface ForumThread
resultFilter
- a ResultFilter object to perform filtering and
sorting with.
public boolean isAuthorized(long type)
ForumThread
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.
isAuthorized
in interface ForumThread
type
- a permission type.
ForumPermissions
public TagDelegator getTagDelegator()
ForumThread
getTagDelegator
in interface ForumThread
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
public 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 |