|
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 |
public interface Forum
A container for a list of threads. Each forum belongs to a single category. A forum offers the finest granularity of permissions in the system.
A forum corresponds to an NNTP newsgroup when the NNTP server feature is enabled. Therefore, each forum has a unique NNTP name.
Method Summary | |
---|---|
void |
addThread(ForumThread thread)
Adds a new thread to the forum. |
ForumMessage |
createMessage()
Factory method to create a message with an anonymous author. |
ForumMessage |
createMessage(User user)
Factory method to create a message as the specified user. |
Query |
createQuery()
Creates a query object to search the forum. |
ForumThread |
createThread(ForumMessage rootMessage)
Factory method to create a new thread. |
void |
deleteProperty(java.lang.String name)
Deletes an extended property. |
void |
deleteThread(ForumThread thread)
Deletes a thread and all of its messages. |
java.util.Date |
getCreationDate()
Returns the Date that the forum was created. |
java.lang.String |
getDescription()
Returns the description of the forum. |
java.util.Locale |
getFinalLocale()
Returns the locale for this forum. |
ForumCategory |
getForumCategory()
Returns the forum category that this forum belongs to. |
long |
getID()
Returns the unique id of the forum. |
InterceptorManager |
getInterceptorManager()
Returns an interceptor manager that can be used to manage the interceptors for this forum. |
ForumMessage |
getLatestMessage()
Returns the most recently created or edited message in this forum. |
java.util.Locale |
getLocale()
Returns the locale for this forum. |
int |
getMaxForumIndex()
Returns the largest forum index value for a message in the forum. |
int |
getMessageCount()
Returns the number of messages in the forum. |
int |
getMessageCount(ResultFilter resultFilter)
Returns the number of messages in the forum based on the specified ResultFilter. |
ForumMessageIterator |
getMessages()
Returns an Iterator for all the messages in the forum. |
ForumMessageIterator |
getMessages(ResultFilter resultFilter)
Returns a Iterator for all the messages in the forum that match the criteria specified by the ResultFilter. |
int |
getMinForumIndex()
Returns the smallest forum index value for a message in the forum. |
int |
getModerationDefaultMessageValue()
Returns the default number of moderation points for messages created in the forum. |
int |
getModerationDefaultThreadValue()
Returns the default number of moderation points for threads created in the forum. |
java.util.Date |
getModificationDate()
Returns the Date that the forum was last modified. |
java.lang.String |
getName()
Returns the name of the forum. |
java.lang.String |
getNNTPName()
Returns the NNTP name for the forum, which is the name of the forum used in the NNTP protocol (newsgroups). |
Permissions |
getPermissions(AuthToken authToken)
Returns the permissions for the forum that correspond to the passed-in AuthToken. |
PermissionsManager |
getPermissionsManager()
Returns a permissions manager that can be used to set permissions for this forum. |
java.util.Iterator |
getPopularThreads()
Returns an Iterator for the most popular threads in the forum. |
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 the forum. |
java.util.Iterator |
getPropertyNames()
Returns an Iterator for the names of the forum properties. |
ForumRenderManager |
getRenderManager()
Returns a render manager that can be used to manage render filters and macros for this forum. |
java.util.Map |
getTags()
Returns all tags for a given forum in a Map where the key is the
name of tag and the value is the number of times the tag has been used in this forum. |
java.util.Map |
getTags(TagResultFilter resultFilter)
Returns all tags for a given forum in a Map where the key is the
name of tag and the value is the number of times the tag has been used in this forum
filtered by the TagResultFilter. |
ForumThread |
getThread(long threadID)
Returns the thread specified by id. |
int |
getThreadCount()
Returns the number of threads in the forum. |
int |
getThreadCount(ResultFilter resultFilter)
Returns the number of threads in the forum based on the specified ResultFilter. |
ForumThreadIterator |
getThreads()
Returns a Iterator for all the threads in the forum. |
ForumThreadIterator |
getThreads(ResultFilter resultFilter)
Returns a Iterator for all the threads in the forum that match the criteria specified by the ResultFilter. |
boolean |
isAuthorized(long permissionType)
Returns true if the handle on the object has the permission specified. |
void |
moveThread(ForumThread thread,
Forum newForum)
Moves a thread from one forum to another. |
void |
setCreationDate(java.util.Date creationDate)
Sets the creation date of the forum. |
void |
setDescription(java.lang.String description)
Sets the description of the forum. |
void |
setLocale(java.util.Locale locale)
Sets the locale for this forum. |
void |
setModerationDefaultMessageValue(int value)
Sets the default number of moderation points for threads created in the forum. |
void |
setModerationDefaultThreadValue(int value)
Sets the default number of moderation points for threads created in the forum. |
void |
setModificationDate(java.util.Date modificationDate)
Sets the date the forum was last modified. |
void |
setName(java.lang.String name)
Sets the name of a the forum. |
void |
setNNTPName(java.lang.String nntpName)
Sets the NNTP name for the forum, which is the name of the forum used in the NNTP protocol (newsgroups). |
void |
setProperty(java.lang.String name,
java.lang.String value)
Sets an extended property of the forum. |
Method Detail |
---|
long getID()
java.lang.String getName()
void setName(java.lang.String name) throws UnauthorizedException
name
- the name of the forum.
UnauthorizedException
- if does not have admin permissions.java.lang.String getNNTPName()
NNTP names must follow certain rules. In particular:
void setNNTPName(java.lang.String nntpName) throws UnauthorizedException, NameAlreadyExistsException
NNTP names must follow certain rules. Therefore, any name passed into this method will automatically converted based on the following rules:
nntpName
- the NNTP name of the forum.
UnauthorizedException
- if does not have admin permissions.
NameAlreadyExistsException
- if attempting to use an existing NNTP name.java.lang.String getDescription()
void setDescription(java.lang.String description) throws UnauthorizedException
description
- the description of the forum.
UnauthorizedException
- if does not have ADMIN permissions.java.util.Date getCreationDate()
void setCreationDate(java.util.Date creationDate) throws UnauthorizedException
creationDate
- the date the forum was created.
UnauthorizedException
- if does not have ADMIN permissions.java.util.Date getModificationDate()
void setModificationDate(java.util.Date modificationDate) throws UnauthorizedException
modificationDate
- the date the forum was modified.
UnauthorizedException
- if does not have ADMIN permissions.int getModerationDefaultThreadValue()
void setModerationDefaultThreadValue(int value) throws UnauthorizedException
value
- default number of moderation points for threads.
UnauthorizedException
- if does not have permission.int getModerationDefaultMessageValue()
void setModerationDefaultMessageValue(int value) throws UnauthorizedException
value
- default number of moderation points for messages.
UnauthorizedException
- if does not have permission.int getMinForumIndex()
int getMaxForumIndex()
java.util.Locale getLocale()
void setLocale(java.util.Locale locale) throws UnauthorizedException
locale
- the locale of this forum.
UnauthorizedException
- if does not have admin permissions.java.util.Locale getFinalLocale()
java.lang.String getProperty(java.lang.String name)
name
- the name of the property to get.
java.util.Collection getProperties(java.lang.String parentName)
parentName
- the name of the parent property to return the children for.
void setProperty(java.lang.String name, java.lang.String value) throws UnauthorizedException
If the property referenced by name
already exists, its
value will be updated.
name
- the name of the property to set.value
- the new value for the property.
UnauthorizedException
- if does not have ADMIN permissions.void deleteProperty(java.lang.String name) throws UnauthorizedException
name
does not exist, this method will do nothing.
name
- the name of the property to delete.
UnauthorizedException
- if does not have ADMIN permissions.java.util.Iterator getPropertyNames()
ForumCategory getForumCategory()
ForumThread getThread(long threadID) throws ForumThreadNotFoundException
threadID
- the id of the thread to get.
threadID
ForumThreadNotFoundException
- if the specified thread cannot be
loaded.ForumThread createThread(ForumMessage rootMessage) throws UnauthorizedException
Create
a new message, and set each of its
fields such as the subject and body.
addThread
method.Note: creating the ForumThread object is only one step of the process. You must also add the thread to the forum with the addThread(ForumThread) method before it is saved to the database. It is illegal to create a thread in one forum and then add it to another forum.
rootMessage
- the root message of the thread.
UnauthorizedException
- if does not have CREATE_THREAD permissions.ForumMessage createMessage()
Note: creating the ForumMessage object is only one step of the process. You must also add the message to a thread before it is saved to the database. It is illegal to create a message in one forum and then add it to a thread in another forum.
ForumMessage createMessage(User user) throws UnauthorizedException
Note: creating the ForumMessage object is only one step of the process. You must also add the message to a thread before it is saved to the database. It is illegal to create a message in one forum and then add it to a thread in another forum.
user
- the author of the message.
UnauthorizedException
- if does not have permission to post as the specified user.void addThread(ForumThread thread) throws MessageRejectedException, UnauthorizedException
Adding an existing thread to a forum is illegal. Instead, the
moveForum
method should be used.
thread
- the thread to add to the forum.
MessageRejectedException
- if one of the installed interceptors prevents the
root message from being posted.
UnauthorizedException
- if does not have CREATE_THREAD permissions.void deleteThread(ForumThread thread) throws UnauthorizedException
thread
- the thread to delete.
UnauthorizedException
- if not an admin or moderator.void moveThread(ForumThread thread, Forum newForum) throws UnauthorizedException, java.lang.IllegalArgumentException
newForum
.The main purpose of this method is to allow admins to move non-topical threads into a more appropriate forum.
thread
- the thread to move to another forum.newForum
- the forum to move the thread to.
UnauthorizedException
- if does not have admin or moderator
permissions for this forum and newForum
.
java.lang.IllegalArgumentException
- if thread
does not belong
to the forum that this method was invoked on.ForumThreadIterator getThreads()
ForumThreadIterator getThreads(ResultFilter resultFilter)
resultFilter
- a ResultFilter object to perform filtering and
sorting with.
java.util.Iterator getPopularThreads()
A number of configurable Jive properties control how the popular threads feature works:
popularThreads.numThreads
-- The number of
messages that will be returned in the list of popular threads.
Default is 4 threads.
popularThreads.timeWindow
-- The number of hours
to consider new messages in a thread from. Default is 24 hours,
which is suitable for sites with moderate to high amounts of
traffic. Sites with less traffic may wish to set the window
to a number of days.
ForumMessageIterator getMessages()
ForumMessageIterator getMessages(ResultFilter resultFilter)
resultFilter
- a ResultFilter object to perform filtering and
sorting with.
int getThreadCount()
int getThreadCount(ResultFilter resultFilter)
resultFilter
- a resultFilter to limit the query on.
int getMessageCount()
int getMessageCount(ResultFilter resultFilter)
resultFilter
- a resultFilter to limit the query on.
ForumMessage getLatestMessage()
ResultFilter
, but this
method offers a simpler, more optimized way to access the data.
Query createQuery()
InterceptorManager getInterceptorManager() throws UnauthorizedException
UnauthorizedException
- if not an administrator.PermissionsManager getPermissionsManager() throws UnauthorizedException
UnauthorizedException
- is not an admin.ForumRenderManager getRenderManager()
RenderManager.render(Object, com.jivesoftware.forum.renderer.RenderType, String)
and
RenderManager.render(Object, com.jivesoftware.forum.renderer.RenderType, com.jivesoftware.forum.renderer.RenderStrategy, String)
methods, which may be useful to skin writers.
RenderManager
Permissions getPermissions(AuthToken authToken)
authToken
- the auth token to lookup permissions for.
boolean isAuthorized(long permissionType)
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.
permissionType
- a permission type.
ForumPermissions
java.util.Map getTags()
Map
where the key is the
name of tag and the value is the number of times the tag has been used in this forum.
Map
where the key is the
name of tag and the value is the number of times the tag has been used in this forum.java.util.Map getTags(TagResultFilter resultFilter)
Map
where the key is the
name of tag and the value is the number of times the tag has been used in this forum
filtered by the TagResultFilter.
resultFilter
- the filter to use to restrict tag results
Map
where the key is the
name of tag and the value is the number of times the tag has been used in this forum
filtered by the TagResultFilter.
|
Jive Forums Project Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |