|
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.ForumCategoryProxy
public class ForumCategoryProxy
A protection proxy for ForumCategories. A proxy has a set of permissions that are specified at creation time of the proxy. Subsequently, those permissions are use to restrict access to protected methods. If a user does not have the right to execute a particular method, an UnauthorizedException is thrown.
ForumCategory
,
UnauthorizedException
Field Summary |
---|
Fields inherited from interface com.jivesoftware.forum.ContentRetrieval |
---|
ALL_TYPES, THREAD |
Constructor Summary | |
---|---|
ForumCategoryProxy(ForumCategory category,
AuthToken authToken,
Permissions permissions)
Creates a new ForumCategoryProxy object. |
Method Summary | |
---|---|
ForumCategory |
createCategory(java.lang.String name,
java.lang.String description)
Creates a new ForumCategory as a sub-category of this category using the name and description. |
void |
deleteCategory(ForumCategory forumCategory)
Deletes a sub-category. |
void |
deleteForum(Forum forum)
Deletes a forum and all of its content. |
void |
deleteProperty(java.lang.String name)
Deletes an extended property. |
boolean |
equals(java.lang.Object object)
|
java.util.Iterator |
getCategories()
Returns an Iterator for the child categories of this category. |
java.util.Iterator |
getCategories(int startIndex,
int numResults)
Returns an Iterator for the child categories of this category using a start index and the number of results to return. |
int |
getCategoryCount()
Returns the number of sub-categories of this category. |
int |
getCategoryDepth()
Returns the depth of a this category relative to the root. |
java.util.Iterator |
getCombinedContent(long[] types)
Returns an Iterable for all threads, documents, and blog posts in the community, depending on which ContentTypes are supplied as an argument. |
java.util.Iterator |
getCombinedContent(ResultFilter filter,
long[] types)
Returns an Iterable for all threads, documents, and blog posts in the community, depending on which ContentTypes are supplied as an argument, and according the the supplied ResultFilter . |
int |
getCombinedContentCount(long[] types)
Returns the combined number of threads, documents, and blog posts in the community, depending on which ContentTypes are supplied as an argument. |
int |
getCombinedContentCount(ResultFilter filter,
long[] types)
Returns the combined number of threads, documents, and blog posts in the community, depending on which ContentTypes are supplied as an argument, and restricted by the ResultFilter. |
java.util.Date |
getCreationDate()
Returns the Date that the category was created. |
java.lang.String |
getDescription()
Returns the description of the forum category. |
java.util.Locale |
getFinalLocale()
Returns the locale for this category. |
int |
getForumCount()
Returns the number of forums in the category. |
int |
getForumCount(ResultFilter resultFilter)
Returns the number of forums in the category based on the specified ResultFilter. |
java.util.Iterator |
getForums()
Returns an Iterator for all the forums in the category. |
java.util.Iterator |
getForums(ResultFilter resultFilter)
Returns a Iterator for all the forums in the category that match the criteria specified by the ResultFilter. |
long |
getID()
Retrieve the unique identifier for the jive object. |
InterceptorManager |
getInterceptorManager()
Returns a message interceptor manager that can be used to manage interceptors for this category. |
ForumMessage |
getLatestMessage()
Returns the most recently created or edited message in this category (including all sub-categories). |
java.util.Iterator |
getLatestMessages()
Returns an Iterator for the most recently created or edited messages in this category (including all sub-categories). |
java.util.Locale |
getLocale()
Returns the locale for this category. |
int |
getMessageCount()
Returns the number of messages in the community. |
int |
getMessageCount(ResultFilter resultFilter)
Returns the number of messages in the community based on the specified ResultFilter. |
java.util.Iterator |
getMessages()
Returns an Iterable for all the messages in the community. |
java.util.Iterator |
getMessages(ResultFilter resultFilter)
Returns an Iterable for all the messages in the community that match the criteria specified by the ResultFilter. |
java.util.Date |
getModificationDate()
Returns the Date this category was last modified. |
java.lang.String |
getName()
Returns the name of the category. |
int |
getObjectType()
Return the object type of the jive object. |
ForumCategory |
getParentCategory()
Returns the parent category of this category. |
Permissions |
getPermissions(AuthToken authToken)
Returns the permissions for the category that correspond to the passed-in AuthToken. |
PermissionsManager |
getPermissionsManager()
Returns a permissions manager that can be used to set permissions for this category. |
java.util.Iterator |
getPopularThreads()
Returns an Iterator for the most popular threads in the category. |
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 category. |
java.util.Iterator |
getPropertyNames()
Returns an Iterator for the names of the forum category properties. |
java.util.Iterator |
getRecursiveCategories()
Returns an Iterator for all sub-categories of this category, including sub-categories of sub-categories, etc. |
int |
getRecursiveCategoryCount()
Returns the total count of all sub-categories of this category, including sub-categories of sub-categories, etc. |
int |
getRecursiveForumCount()
Returns the number of forums in the category and all sub-categories. |
int |
getRecursiveForumCount(ResultFilter resultFilter)
Returns the number of forums in the category and all sub-categories based on the specified ResultFilter. |
java.util.Iterator |
getRecursiveForums()
Returns an Iterator for all the forums in the category and all sub-categories. |
java.util.Iterator |
getRecursiveForums(ResultFilter resultFilter)
Returns a Iterator for all the forums in the category and sub-categories that match the criteria specified by the ResultFilter. |
ForumRenderManager |
getRenderManager()
Returns a render manager that can be used to manage render filters and macros for this category. |
java.util.Map |
getTags()
Returns all tags for a given community 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 community. |
java.util.Map |
getTags(TagResultFilter resultFilter)
Returns all tags for a given community 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 community
filtered by the TagResultFilter. |
int |
getThreadCount()
Returns the number of threads in the community. |
int |
getThreadCount(ResultFilter resultFilter)
Returns the number of threads in the community based on the specified ResultFilter. |
java.util.Iterator |
getThreads()
Returns an Iterable for all the threads in the community. |
java.util.Iterator |
getThreads(ResultFilter resultFilter)
Returns an Iterable for all the threads in the community that match the criteria specified by the ResultFilter. |
int |
hashCode()
|
boolean |
isAuthorized(long type)
Returns true if the handle on the object has the permission specified. |
void |
moveCategory(ForumCategory forumCategory,
ForumCategory destinationCategory)
Moves a sub-category to another category. |
void |
moveForum(Forum forum,
ForumCategory destinationCategory)
Moves a forum from this category to another. |
void |
setCategoryIndex(ForumCategory forumCategory,
int newIndex)
Sets the display order of a sub-category. |
void |
setCreationDate(java.util.Date creationDate)
Sets the creation date of the category. |
void |
setDescription(java.lang.String description)
Sets the description of the forum category. |
void |
setForumIndex(Forum forum,
int newIndex)
Sets the index of the forum in the category. |
void |
setLocale(java.util.Locale locale)
Sets the locale for this category. |
void |
setModificationDate(java.util.Date modificationDate)
Sets the date the category was last modified. |
void |
setName(java.lang.String name)
Sets the name of the forum category. |
void |
setProperty(java.lang.String name,
java.lang.String value)
Sets an extended property of the category. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ForumCategoryProxy(ForumCategory category, AuthToken authToken, Permissions permissions)
category
- the category to protect by proxyauthToken
- the user's auth token.permissions
- the permissions to use with this proxy.Method Detail |
---|
public long getID()
JiveObject
getID
in interface JiveObject
getID
in interface ForumCategory
public java.lang.String getName()
ForumCategory
getName
in interface ForumCategory
public void setName(java.lang.String name) throws UnauthorizedException
ForumCategory
setName
in interface ForumCategory
name
- the name of the forum category.
UnauthorizedException
- if does not have admin permissions.public java.lang.String getDescription()
ForumCategory
getDescription
in interface ForumCategory
public void setDescription(java.lang.String description) throws UnauthorizedException
ForumCategory
setDescription
in interface ForumCategory
description
- the description of the forum category.
UnauthorizedException
- if does not have admin permissions.public java.util.Map getTags()
ForumCategory
Map
where the key is the
name of tag and the value is the number of times the tag has been used in this community.
getTags
in interface ForumCategory
Map
where the key is the
name of tag and the value is the number of times the tag has been used in this community.public java.util.Map getTags(TagResultFilter resultFilter)
ForumCategory
Map
where the key is the
name of tag and the value is the number of times the tag has been used in this community
filtered by the TagResultFilter.
getTags
in interface ForumCategory
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 community
filtered by the TagResultFilter.public java.util.Date getCreationDate()
ForumCategory
getCreationDate
in interface ForumCategory
public void setCreationDate(java.util.Date creationDate) throws UnauthorizedException
ForumCategory
setCreationDate
in interface ForumCategory
creationDate
- the date the forum category was created.
UnauthorizedException
- if does not have admin permissions.public java.util.Date getModificationDate()
ForumCategory
By default, this feature is
getModificationDate
in interface ForumCategory
public void setModificationDate(java.util.Date modificationDate) throws UnauthorizedException
ForumCategory
setModificationDate
in interface ForumCategory
modificationDate
- the date the forum was modified.
UnauthorizedException
- if does not have admin permissions.public java.util.Locale getLocale()
ForumCategory
getLocale
in interface ForumCategory
public void setLocale(java.util.Locale locale) throws UnauthorizedException
ForumCategory
setLocale
in interface ForumCategory
locale
- the locale of this category.
UnauthorizedException
- if does not have admin permissions.public java.util.Locale getFinalLocale()
ForumCategory
getFinalLocale
in interface ForumCategory
public java.lang.String getProperty(java.lang.String name)
ForumCategory
getProperty
in interface ForumCategory
name
- the name of the property to get.
public java.util.Collection getProperties(java.lang.String parentName)
ForumCategory
getProperties
in interface ForumCategory
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
ForumCategory
If the property referenced by name
already exists, its
value will be updated.
setProperty
in interface ForumCategory
name
- the name of the property to set.value
- the new value for the property.
UnauthorizedException
- if does not have admin permissions.public void deleteProperty(java.lang.String name) throws UnauthorizedException
ForumCategory
deleteProperty
in interface ForumCategory
name
- the name of the property to delete.
UnauthorizedException
- if does not have admin permissions.public java.util.Iterator getPropertyNames()
ForumCategory
getPropertyNames
in interface ForumCategory
public int getForumCount()
ForumCategory
ForumCategory.getForums()
since
that method only returns forums that a user has read permission for.
getForumCount
in interface ForumCategory
public int getForumCount(ResultFilter resultFilter)
ForumCategory
ForumCategory.getForums()
since that
method only returns forums that a user has read permission for.
getForumCount
in interface ForumCategory
resultFilter
- a resultFilter to limit the query on.
public int getRecursiveForumCount()
ForumCategory
ForumCategory.getRecursiveForums()
since that method only returns forums
that a user has read permission for.
getRecursiveForumCount
in interface ForumCategory
public int getRecursiveForumCount(ResultFilter resultFilter)
ForumCategory
ForumCategory.getRecursiveForums()
since that method only returns forums
that a user has read permission for.
getRecursiveForumCount
in interface ForumCategory
resultFilter
- a resultFilter to limit the query on.
public java.util.Iterator getForums()
ForumCategory
getForums
in interface ForumCategory
public java.util.Iterator getForums(ResultFilter resultFilter)
ForumCategory
getForums
in interface ForumCategory
resultFilter
- a ResultFilter object to perform filtering and
sorting with.
public java.util.Iterator getRecursiveForums()
ForumCategory
getRecursiveForums
in interface ForumCategory
public java.util.Iterator getRecursiveForums(ResultFilter resultFilter)
ForumCategory
getRecursiveForums
in interface ForumCategory
resultFilter
- a ResultFilter object to perform filtering and
sorting with.
public void setForumIndex(Forum forum, int newIndex) throws UnauthorizedException
ForumCategory
setForumIndex
in interface ForumCategory
forum
- the forum to adjust the index of.newIndex
- the new index value for the forum.
UnauthorizedException
- if not an admin for this categorypublic void moveForum(Forum forum, ForumCategory destinationCategory) throws UnauthorizedException
ForumCategory
moveForum
in interface ForumCategory
forum
- the forum to move.destinationCategory
- the category to move the forum to.
UnauthorizedException
- if not an admin for this category and
the destination category.public ForumCategory getParentCategory()
ForumCategory
getParentCategory
in interface ForumCategory
public int getCategoryCount()
ForumCategory
getCategoryCount
in interface ForumCategory
public java.util.Iterator getCategories()
ForumCategory
getCategories
in interface ForumCategory
public java.util.Iterator getCategories(int startIndex, int numResults)
ForumCategory
getCategories
in interface ForumCategory
startIndex
- the index of the first result to return.numResults
- the max number of results to return.
public int getRecursiveCategoryCount()
ForumCategory
getRecursiveCategoryCount
in interface ForumCategory
public java.util.Iterator getRecursiveCategories()
ForumCategory
getRecursiveCategories
in interface ForumCategory
public int getCategoryDepth()
ForumCategory
1 |-- 3 |-- |-- 4 |-- |-- |-- 7The depth of message 4 is 2, the depth of category 7 is 3, etc. This method is useful in combination with the
ForumCategory.getRecursiveCategories()
Iterator to build a UI of hierarchical categories.
getCategoryDepth
in interface ForumCategory
public void setCategoryIndex(ForumCategory forumCategory, int newIndex) throws UnauthorizedException
ForumCategory
setCategoryIndex
in interface ForumCategory
forumCategory
- the sub category to set the index fornewIndex
- the new index of the sub category
UnauthorizedException
public void moveCategory(ForumCategory forumCategory, ForumCategory destinationCategory) throws UnauthorizedException
ForumCategory
1 |-- 3 |-- |-- 4 |-- |-- |-- 7Moving 3 to be a child of 7 is not allowed, since that breaks the tree structure.
moveCategory
in interface ForumCategory
forumCategory
- the ForumCategory to move.destinationCategory
- the category to move the sub-category to.
UnauthorizedException
- if not an admin of this category and
the destination category.public ForumCategory createCategory(java.lang.String name, java.lang.String description) throws UnauthorizedException
ForumCategory
createCategory
in interface ForumCategory
name
- the name of the new category.description
- the description of the new category.
UnauthorizedException
- if not an admin.public void deleteCategory(ForumCategory forumCategory) throws UnauthorizedException
ForumCategory
deleteCategory
in interface ForumCategory
forumCategory
- the ForumCategory to delete.
UnauthorizedException
- if not an admin.public void deleteForum(Forum forum) throws UnauthorizedException
ForumCategory
This method is not always guaranteed to be safe to call. For example, if multiple clients have handles on a forum, and that forum is subsequently deleted, the behavior of the forum objects that the clients have handles on is unspecified and may result in errors.
deleteForum
in interface ForumCategory
forum
- the forum to delete.
UnauthorizedException
- if not allowed to delete a forum.public java.util.Iterator getPopularThreads()
ForumCategory
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.
getPopularThreads
in interface ForumCategory
public java.util.Iterator getThreads()
ContentRetrieval
getThreads
in interface ContentRetrieval
getThreads
in interface ForumCategory
public java.util.Iterator getThreads(ResultFilter resultFilter)
ContentRetrieval
getThreads
in interface ContentRetrieval
getThreads
in interface ForumCategory
resultFilter
- a ResultFilter object to perform filtering and sorting with.
public int getThreadCount()
ContentRetrieval
ContentRetrieval.getThreads()
method.
getThreadCount
in interface ContentRetrieval
getThreadCount
in interface ForumCategory
public int getThreadCount(ResultFilter resultFilter)
ContentRetrieval
ContentRetrieval.getThreads(com.jivesoftware.forum.ResultFilter)
method.
getThreadCount
in interface ContentRetrieval
getThreadCount
in interface ForumCategory
resultFilter
- a resultFilter to limit the query on.
public int getMessageCount()
ContentRetrieval
ContentRetrieval.getMessages()
method.
getMessageCount
in interface ContentRetrieval
getMessageCount
in interface ForumCategory
public int getMessageCount(ResultFilter resultFilter)
ContentRetrieval
ContentRetrieval.getMessages(ResultFilter)
method.
getMessageCount
in interface ContentRetrieval
getMessageCount
in interface ForumCategory
resultFilter
- a resultFilter to limit the query on.
public java.util.Iterator getMessages()
ContentRetrieval
getMessages
in interface ContentRetrieval
getMessages
in interface ForumCategory
public java.util.Iterator getMessages(ResultFilter resultFilter)
ContentRetrieval
getMessages
in interface ContentRetrieval
getMessages
in interface ForumCategory
resultFilter
- a ResultFilter object to perform filtering and sorting with.
public ForumMessage getLatestMessage()
ForumCategory
ResultFilter
, but this method offers a simpler, more optimized way to
access the data.
getLatestMessage
in interface ForumCategory
public java.util.Iterator getLatestMessages()
ForumCategory
getLatestMessages
in interface ForumCategory
public PermissionsManager getPermissionsManager() throws UnauthorizedException
ForumCategory
getPermissionsManager
in interface ForumCategory
UnauthorizedException
- if not an admin.public ForumRenderManager getRenderManager()
ForumCategory
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.
getRenderManager
in interface ForumCategory
RenderManager
public InterceptorManager getInterceptorManager() throws UnauthorizedException
ForumCategory
getInterceptorManager
in interface ForumCategory
UnauthorizedException
- if not an adminpublic Permissions getPermissions(AuthToken authToken)
ForumCategory
getPermissions
in interface ForumCategory
authToken
- the auth token to lookup permissions for.
public boolean isAuthorized(long type)
ForumCategory
ForumPermissions.FORUM_CATEGORY_ADMIN
)
would return true.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 ForumCategory
type
- permissionType a permission type.
ForumPermissions
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 int getObjectType()
JiveObject
getObjectType
in interface JiveObject
public int getCombinedContentCount(long[] types)
ContentRetrieval
ContentRetrieval.getCombinedContent(long[])
method.
getCombinedContentCount
in interface ContentRetrieval
types
- the ContentTypes to include in the count.
public int getCombinedContentCount(ResultFilter filter, long[] types)
ContentRetrieval
ContentRetrieval.getCombinedContent(ResultFilter, long[])
method.
getCombinedContentCount
in interface ContentRetrieval
filter
- the ResultFilter
to filter the results.types
- the ContentTypes to include in the count.
public java.util.Iterator getCombinedContent(long[] types)
ContentRetrieval
getCombinedContent
in interface ContentRetrieval
types
- the ContentTypes to include in the result.
public java.util.Iterator getCombinedContent(ResultFilter filter, long[] types)
ContentRetrieval
ResultFilter
.
getCombinedContent
in interface ContentRetrieval
filter
- the ResultFilter
to filter and sort the results.types
- the ContentTypes to include in the result.
|
Jive Forums Project Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |