Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.forum.proxy
Class ForumCategoryProxy

java.lang.Object
  extended by com.jivesoftware.forum.proxy.ForumCategoryProxy
All Implemented Interfaces:
JiveObject, ContentRetrieval, ForumCategory

public class ForumCategoryProxy
extends java.lang.Object
implements ForumCategory

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.

See Also:
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

ForumCategoryProxy

public ForumCategoryProxy(ForumCategory category,
                          AuthToken authToken,
                          Permissions permissions)
Creates a new ForumCategoryProxy object.

Parameters:
category - the category to protect by proxy
authToken - the user's auth token.
permissions - the permissions to use with this proxy.
Method Detail

getID

public long getID()
Description copied from interface: JiveObject
Retrieve the unique identifier for the jive object.

Specified by:
getID in interface JiveObject
Specified by:
getID in interface ForumCategory
Returns:
the unique identifier for the jive object.

getName

public java.lang.String getName()
Description copied from interface: ForumCategory
Returns the name of the category.

Specified by:
getName in interface ForumCategory
Returns:
the name of the category.

setName

public void setName(java.lang.String name)
             throws UnauthorizedException
Description copied from interface: ForumCategory
Sets the name of the forum category.

Specified by:
setName in interface ForumCategory
Parameters:
name - the name of the forum category.
Throws:
UnauthorizedException - if does not have admin permissions.

getDescription

public java.lang.String getDescription()
Description copied from interface: ForumCategory
Returns the description of the forum category.

Specified by:
getDescription in interface ForumCategory
Returns:
the description of the forum category.

setDescription

public void setDescription(java.lang.String description)
                    throws UnauthorizedException
Description copied from interface: ForumCategory
Sets the description of the forum category.

Specified by:
setDescription in interface ForumCategory
Parameters:
description - the description of the forum category.
Throws:
UnauthorizedException - if does not have admin permissions.

getTags

public java.util.Map getTags()
Description copied from interface: ForumCategory
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.

Specified by:
getTags in interface ForumCategory
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.

getTags

public java.util.Map getTags(TagResultFilter resultFilter)
Description copied from interface: ForumCategory
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.

Specified by:
getTags in interface ForumCategory
Parameters:
resultFilter - the filter to use to restrict tag results
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.

getCreationDate

public java.util.Date getCreationDate()
Description copied from interface: ForumCategory
Returns the Date that the category was created.

Specified by:
getCreationDate in interface ForumCategory
Returns:
the Date the forum category was created.

setCreationDate

public void setCreationDate(java.util.Date creationDate)
                     throws UnauthorizedException
Description copied from interface: ForumCategory
Sets the creation date of the category. In most cases, the creation date will default to when the category was entered into the system. However, the creation date needs to be set manually when importing data. In other words, skin authors should ignore this method since it only intended for system maintenance.

Specified by:
setCreationDate in interface ForumCategory
Parameters:
creationDate - the date the forum category was created.
Throws:
UnauthorizedException - if does not have admin permissions.

getModificationDate

public java.util.Date getModificationDate()
Description copied from interface: ForumCategory
Returns the Date this category was last modified. In other words, the date of the most recent forum update in this category.

By default, this feature is

Specified by:
getModificationDate in interface ForumCategory
Returns:
the Date the forum was last modified.

setModificationDate

public void setModificationDate(java.util.Date modificationDate)
                         throws UnauthorizedException
Description copied from interface: ForumCategory
Sets the date the category was last modified. In most cases, last modifed will default to when the category data was last changed. However, the last modified date needs to be set manually when importing data. In other words, skin authors should ignore this method since it only intended for system maintenance.

Specified by:
setModificationDate in interface ForumCategory
Parameters:
modificationDate - the date the forum was modified.
Throws:
UnauthorizedException - if does not have admin permissions.

getLocale

public java.util.Locale getLocale()
Description copied from interface: ForumCategory
Returns the locale for this category. A locale specifies language and country codes, and is used for internationalization. If a locale has not been specified for this category, this method will return null. If you want to get the inherited locale for this category, you should call getFinalLocale().

Specified by:
getLocale in interface ForumCategory
Returns:
the locale for this category.

setLocale

public void setLocale(java.util.Locale locale)
               throws UnauthorizedException
Description copied from interface: ForumCategory
Sets the locale for this category. A locale specifies language and country codes, and is used for internationalization.

Specified by:
setLocale in interface ForumCategory
Parameters:
locale - the locale of this category.
Throws:
UnauthorizedException - if does not have admin permissions.

getFinalLocale

public java.util.Locale getFinalLocale()
Description copied from interface: ForumCategory
Returns the locale for this category. A locale specifies language and country codes, and is used for internationalization. If a locale has not been specified for this category, this method will return an inherited locale. A category will inherit the locale from it's chain of parent categories, if one exists. Otherwise it will inherit the default locale used by Jive. If you want to get the explicit locale for this category, you should call getLocale().

Specified by:
getFinalLocale in interface ForumCategory
Returns:
the final locale for this category.

getProperty

public java.lang.String getProperty(java.lang.String name)
Description copied from interface: ForumCategory
Returns an extended property of the category. Each category can have an arbitrary number of extended properties. This allows for enhanced functionality that is not part of the base interface.

Specified by:
getProperty in interface ForumCategory
Parameters:
name - the name of the property to get.
Returns:
the value of the property specified by name.

getProperties

public java.util.Collection getProperties(java.lang.String parentName)
Description copied from interface: ForumCategory
Return all immediate children property values of a parent property as an unmodifiable Collection of String values. A parent/child relationship is denoted by the "." character. For example, given the properties X.Y.A, X.Y.B, X.Y.C and X.Y.C.D, then the immediate child properties of X.Y are X.Y.A, X.Y.B, and X.Y.C (the value of X.Y.C.D would not be returned using this method).

Specified by:
getProperties in interface ForumCategory
Parameters:
parentName - the name of the parent property to return the children for.
Returns:
all Collection of all child property values for the given parent.

setProperty

public void setProperty(java.lang.String name,
                        java.lang.String value)
                 throws UnauthorizedException
Description copied from interface: ForumCategory
Sets an extended property of the category. Each category can have an arbitrary number of extended properties. This allows for enhanced functionality that is not part of the base interface.

If the property referenced by name already exists, its value will be updated.

Specified by:
setProperty in interface ForumCategory
Parameters:
name - the name of the property to set.
value - the new value for the property.
Throws:
UnauthorizedException - if does not have admin permissions.

deleteProperty

public void deleteProperty(java.lang.String name)
                    throws UnauthorizedException
Description copied from interface: ForumCategory
Deletes an extended property. If the property specified by name does not exist, this method will do nothing.

Specified by:
deleteProperty in interface ForumCategory
Parameters:
name - the name of the property to delete.
Throws:
UnauthorizedException - if does not have admin permissions.

getPropertyNames

public java.util.Iterator getPropertyNames()
Description copied from interface: ForumCategory
Returns an Iterator for the names of the forum category properties.

Specified by:
getPropertyNames in interface ForumCategory
Returns:
an Iterator for the names of the forum category properties.

getForumCount

public int getForumCount()
Description copied from interface: ForumCategory
Returns the number of forums in the category. This number might not agree with the number of forums returned by ForumCategory.getForums() since that method only returns forums that a user has read permission for.

Specified by:
getForumCount in interface ForumCategory
Returns:
the number of forums in the category.

getForumCount

public int getForumCount(ResultFilter resultFilter)
Description copied from interface: ForumCategory
Returns the number of forums in the category based on the specified ResultFilter. This is useful for determining such things as the number of forums in a date range, etc. This number might not agree with the number of forums returned by ForumCategory.getForums() since that method only returns forums that a user has read permission for.

Specified by:
getForumCount in interface ForumCategory
Parameters:
resultFilter - a resultFilter to limit the query on.
Returns:
the number of forums in the category based on the filter.

getRecursiveForumCount

public int getRecursiveForumCount()
Description copied from interface: ForumCategory
Returns the number of forums in the category and all sub-categories. This number might not agree with the number of forums returned by ForumCategory.getRecursiveForums() since that method only returns forums that a user has read permission for.

Specified by:
getRecursiveForumCount in interface ForumCategory
Returns:
the number of forums in the category and sub-categories.

getRecursiveForumCount

public int getRecursiveForumCount(ResultFilter resultFilter)
Description copied from interface: ForumCategory
Returns the number of forums in the category and all sub-categories based on the specified ResultFilter. This is useful for determining such things as the number of forums in a date range, etc. This number might not agree with the number of forums returned by ForumCategory.getRecursiveForums() since that method only returns forums that a user has read permission for.

Specified by:
getRecursiveForumCount in interface ForumCategory
Parameters:
resultFilter - a resultFilter to limit the query on.
Returns:
the number of forums in the category and sub-categories based on the filter.

getForums

public java.util.Iterator getForums()
Description copied from interface: ForumCategory
Returns an Iterator for all the forums in the category. Forums will be sorted based on their category index.

Specified by:
getForums in interface ForumCategory
Returns:
an Iterator for all the forums in the category.

getForums

public java.util.Iterator getForums(ResultFilter resultFilter)
Description copied from interface: ForumCategory
Returns a Iterator for all the forums in the category that match the criteria specified by the ResultFilter.

Specified by:
getForums in interface ForumCategory
Parameters:
resultFilter - a ResultFilter object to perform filtering and sorting with.
Returns:
an Iterator for the forums in the category that match the ResultFilter.

getRecursiveForums

public java.util.Iterator getRecursiveForums()
Description copied from interface: ForumCategory
Returns an Iterator for all the forums in the category and all sub-categories. The ordering of forums in unspecified.

Specified by:
getRecursiveForums in interface ForumCategory
Returns:
an Iterator for all the forums in the category and sub-categories.

getRecursiveForums

public java.util.Iterator getRecursiveForums(ResultFilter resultFilter)
Description copied from interface: ForumCategory
Returns a Iterator for all the forums in the category and sub-categories that match the criteria specified by the ResultFilter. Note that attempting to sort the forums on their category index will have strange results.

Specified by:
getRecursiveForums in interface ForumCategory
Parameters:
resultFilter - a ResultFilter object to perform filtering and sorting with.
Returns:
an Iterator for the forums in the category and sub-categories that match the ResultFilter.

setForumIndex

public void setForumIndex(Forum forum,
                          int newIndex)
                   throws UnauthorizedException
Description copied from interface: ForumCategory
Sets the index of the forum in the category. The index value can be used to display the forums in a category in an arbitrary order. Index values are from 0 to getForumCount() - 1.

Specified by:
setForumIndex in interface ForumCategory
Parameters:
forum - the forum to adjust the index of.
newIndex - the new index value for the forum.
Throws:
UnauthorizedException - if not an admin for this category

moveForum

public void moveForum(Forum forum,
                      ForumCategory destinationCategory)
               throws UnauthorizedException
Description copied from interface: ForumCategory
Moves a forum from this category to another.

Specified by:
moveForum in interface ForumCategory
Parameters:
forum - the forum to move.
destinationCategory - the category to move the forum to.
Throws:
UnauthorizedException - if not an admin for this category and the destination category.

getParentCategory

public ForumCategory getParentCategory()
Description copied from interface: ForumCategory
Returns the parent category of this category. This method will return null if the current category is the root category.

Specified by:
getParentCategory in interface ForumCategory
Returns:
the parent category of this category.

getCategoryCount

public int getCategoryCount()
Description copied from interface: ForumCategory
Returns the number of sub-categories of this category.

Specified by:
getCategoryCount in interface ForumCategory
Returns:
the number of sub-categories in this category.

getCategories

public java.util.Iterator getCategories()
Description copied from interface: ForumCategory
Returns an Iterator for the child categories of this category.

Specified by:
getCategories in interface ForumCategory
Returns:
the child categories of this category.

getCategories

public java.util.Iterator getCategories(int startIndex,
                                        int numResults)
Description copied from interface: ForumCategory
Returns an Iterator for the child categories of this category using a start index and the number of results to return. This method can be used to perform pagination of results. Note: the number of results returned may be less than numResults depending on the data that's actually available to return.

Specified by:
getCategories in interface ForumCategory
Parameters:
startIndex - the index of the first result to return.
numResults - the max number of results to return.
Returns:
an Iterator for the child categories of this category.

getRecursiveCategoryCount

public int getRecursiveCategoryCount()
Description copied from interface: ForumCategory
Returns the total count of all sub-categories of this category, including sub-categories of sub-categories, etc.

Specified by:
getRecursiveCategoryCount in interface ForumCategory
Returns:
the recursive sub-category count of this category.

getRecursiveCategories

public java.util.Iterator getRecursiveCategories()
Description copied from interface: ForumCategory
Returns an Iterator for all sub-categories of this category, including sub-categories of sub-categories, etc.

Specified by:
getRecursiveCategories in interface ForumCategory
Returns:
an Iterator for the recursive sub-categories of this category.

getCategoryDepth

public int getCategoryDepth()
Description copied from interface: ForumCategory
Returns the depth of a this category relative to the root. For example, consider the following tree (where 1 is the root category):
   1
   |-- 3
   |-- |-- 4
   |-- |-- |-- 7
 
The 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.

Specified by:
getCategoryDepth in interface ForumCategory
Returns:
the depth of the category in the category tree.

setCategoryIndex

public void setCategoryIndex(ForumCategory forumCategory,
                             int newIndex)
                      throws UnauthorizedException
Description copied from interface: ForumCategory
Sets the display order of a sub-category. For example, if a sub-category has an index of 0, then it will returned first in the Iterator resulting from the categories method call.

Specified by:
setCategoryIndex in interface ForumCategory
Parameters:
forumCategory - the sub category to set the index for
newIndex - the new index of the sub category
Throws:
UnauthorizedException

moveCategory

public void moveCategory(ForumCategory forumCategory,
                         ForumCategory destinationCategory)
                  throws UnauthorizedException
Description copied from interface: ForumCategory
Moves a sub-category to another category. You cannot move a category into a child category. For example, take the following category tree:
   1
   |-- 3
   |-- |-- 4
   |-- |-- |-- 7
 
Moving 3 to be a child of 7 is not allowed, since that breaks the tree structure.

Specified by:
moveCategory in interface ForumCategory
Parameters:
forumCategory - the ForumCategory to move.
destinationCategory - the category to move the sub-category to.
Throws:
UnauthorizedException - if not an admin of this category and the destination category.

createCategory

public ForumCategory createCategory(java.lang.String name,
                                    java.lang.String description)
                             throws UnauthorizedException
Description copied from interface: ForumCategory
Creates a new ForumCategory as a sub-category of this category using the name and description.

Specified by:
createCategory in interface ForumCategory
Parameters:
name - the name of the new category.
description - the description of the new category.
Returns:
a new ForumCategory.
Throws:
UnauthorizedException - if not an admin.

deleteCategory

public void deleteCategory(ForumCategory forumCategory)
                    throws UnauthorizedException
Description copied from interface: ForumCategory
Deletes a sub-category. Only direct children of this category can be deleted using this method. Attempting to delete a category that is not a direct child will throw an IllegalArgumentException.

Specified by:
deleteCategory in interface ForumCategory
Parameters:
forumCategory - the ForumCategory to delete.
Throws:
UnauthorizedException - if not an admin.

deleteForum

public void deleteForum(Forum forum)
                 throws UnauthorizedException
Description copied from interface: ForumCategory
Deletes a forum and all of its content. The forum must belong to this category or to a sub-category.

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.

Specified by:
deleteForum in interface ForumCategory
Parameters:
forum - the forum to delete.
Throws:
UnauthorizedException - if not allowed to delete a forum.

getPopularThreads

public java.util.Iterator getPopularThreads()
Description copied from interface: ForumCategory
Returns an Iterator for the most popular threads in the category. Popular threads are defined as those that have the most new messages over a period of time (e.g. the last 24 hours). When two threads have identical numbers of new messages, newer threads will be ordered first.

A number of configurable Jive properties control how the popular threads feature works:

Specified by:
getPopularThreads in interface ForumCategory
Returns:
an Iterator for the most popular threads in the category.

getThreads

public java.util.Iterator getThreads()
Description copied from interface: ContentRetrieval
Returns an Iterable for all the threads in the community. Threads will be sorted on their modified date.

Specified by:
getThreads in interface ContentRetrieval
Specified by:
getThreads in interface ForumCategory
Returns:
an Iterable for the threads in the community.

getThreads

public java.util.Iterator getThreads(ResultFilter resultFilter)
Description copied from interface: ContentRetrieval
Returns an Iterable for all the threads in the community that match the criteria specified by the ResultFilter.

Specified by:
getThreads in interface ContentRetrieval
Specified by:
getThreads in interface ForumCategory
Parameters:
resultFilter - a ResultFilter object to perform filtering and sorting with.
Returns:
an Iterable for the threads in the community that match the ResultFilter.

getThreadCount

public int getThreadCount()
Description copied from interface: ContentRetrieval
Returns the number of threads in the community. Note: this method ignores permissions because it's not possible to do a database query for the count that obeys permissions counts. Therefore, the count returned by this method may not be the same as the number of threads returned by the ContentRetrieval.getThreads() method.

Specified by:
getThreadCount in interface ContentRetrieval
Specified by:
getThreadCount in interface ForumCategory
Returns:
the number of threads in the community.

getThreadCount

public int getThreadCount(ResultFilter resultFilter)
Description copied from interface: ContentRetrieval
Returns the number of threads in the community based on the specified ResultFilter. This is useful for determining such things as the number of threads in a date range, etc. Note: this method ignores permissions because it's not possible to do a database query for the count that obeys permissions counts. Therefore, the count returned by this method may not be the same as the number of threads returned by the ContentRetrieval.getThreads(com.jivesoftware.forum.ResultFilter) method.

Specified by:
getThreadCount in interface ContentRetrieval
Specified by:
getThreadCount in interface ForumCategory
Parameters:
resultFilter - a resultFilter to limit the query on.
Returns:
the number of threads in the community based on the filter.

getMessageCount

public int getMessageCount()
Description copied from interface: ContentRetrieval
Returns the number of messages in the community. Note: this method ignores permissions because it's not possible to do a database query for the count that obeys permissions counts. Therefore, the count returned by this method may not be the same as the number of messages returned by the ContentRetrieval.getMessages() method.

Specified by:
getMessageCount in interface ContentRetrieval
Specified by:
getMessageCount in interface ForumCategory
Returns:
the number of messages in the community.

getMessageCount

public int getMessageCount(ResultFilter resultFilter)
Description copied from interface: ContentRetrieval
Returns the number of messages in the community based on the specified ResultFilter. This is useful for determining such things as the number of messages in a date range, etc. Note: this method ignores permissions because it's not possible to do a database query for the count that obeys permissions counts. Therefore, the count returned by this method may not be the same as the number of messages returned by the ContentRetrieval.getMessages(ResultFilter) method.

Specified by:
getMessageCount in interface ContentRetrieval
Specified by:
getMessageCount in interface ForumCategory
Parameters:
resultFilter - a resultFilter to limit the query on.
Returns:
the number of messages in the community based on the filter.

getMessages

public java.util.Iterator getMessages()
Description copied from interface: ContentRetrieval
Returns an Iterable for all the messages in the community.

Specified by:
getMessages in interface ContentRetrieval
Specified by:
getMessages in interface ForumCategory
Returns:
an Iterable for the messages in the community.

getMessages

public java.util.Iterator getMessages(ResultFilter resultFilter)
Description copied from interface: ContentRetrieval
Returns an Iterable for all the messages in the community that match the criteria specified by the ResultFilter.

Specified by:
getMessages in interface ContentRetrieval
Specified by:
getMessages in interface ForumCategory
Parameters:
resultFilter - a ResultFilter object to perform filtering and sorting with.
Returns:
an Iterable for the messages in the community that match the ResultFilter.

getLatestMessage

public ForumMessage getLatestMessage()
Description copied from interface: ForumCategory
Returns the most recently created or edited message in this category (including all sub-categories). If there are no messages in this category, this method will return null. This information could also be determined using a ResultFilter, but this method offers a simpler, more optimized way to access the data.

Specified by:
getLatestMessage in interface ForumCategory
Returns:
the most recently created or edited message in this category.

getLatestMessages

public java.util.Iterator getLatestMessages()
Description copied from interface: ForumCategory
Returns an Iterator for the most recently created or edited messages in this category (including all sub-categories). If there are no messages in this category, this method will return null.

Specified by:
getLatestMessages in interface ForumCategory
Returns:
the most recently created or edited messages in this category.

getPermissionsManager

public PermissionsManager getPermissionsManager()
                                         throws UnauthorizedException
Description copied from interface: ForumCategory
Returns a permissions manager that can be used to set permissions for this category. Only admins can perform this function.

Specified by:
getPermissionsManager in interface ForumCategory
Returns:
a PermissionsManager to manage the permissions on this forum.
Throws:
UnauthorizedException - if not an admin.

getRenderManager

public ForumRenderManager getRenderManager()
Description copied from interface: ForumCategory
Returns a render manager that can be used to manage render filters and macros for this category. Render filter management is only for administrators, excluding the 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.

Specified by:
getRenderManager in interface ForumCategory
Returns:
a RenderManager to manage render filters and macros for this category.
See Also:
RenderManager

getInterceptorManager

public InterceptorManager getInterceptorManager()
                                         throws UnauthorizedException
Description copied from interface: ForumCategory
Returns a message interceptor manager that can be used to manage interceptors for this category.

Specified by:
getInterceptorManager in interface ForumCategory
Returns:
a InterceptorManager to manage interceptors.
Throws:
UnauthorizedException - if not an admin

getPermissions

public Permissions getPermissions(AuthToken authToken)
Description copied from interface: ForumCategory
Returns the permissions for the category that correspond to the passed-in AuthToken. This method is not generally useful to skin writers. Instead, the isAuthorized(int) method should be used for permission checking.

Specified by:
getPermissions in interface ForumCategory
Parameters:
authToken - the auth token to lookup permissions for.
Returns:
the permissions for the category that correspond to the passed-in AuthToken

isAuthorized

public boolean isAuthorized(long type)
Description copied from interface: ForumCategory
Returns true if the handle on the object has the permission specified. For example, if a category administrator has a handle on this object, then calling isAuthorized(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.

Specified by:
isAuthorized in interface ForumCategory
Parameters:
type - permissionType a permission type.
Returns:
true if the handle on the object has the specified permission.
See Also:
ForumPermissions

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object object)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

getObjectType

public int getObjectType()
Description copied from interface: JiveObject
Return the object type of the jive object.

Specified by:
getObjectType in interface JiveObject
Returns:
the object type of the jive object.

getCombinedContentCount

public int getCombinedContentCount(long[] types)
Description copied from interface: ContentRetrieval
Returns the combined number of threads, documents, and blog posts in the community, depending on which ContentTypes are supplied as an argument. Note: this method ignores permissions because it's not possible to do a database query for the count that obeys permissions counts. Therefore, the count returned by this method may not be the same as the number of conten objects returned by the ContentRetrieval.getCombinedContent(long[]) method.

Specified by:
getCombinedContentCount in interface ContentRetrieval
Parameters:
types - the ContentTypes to include in the count.
Returns:
combined number of threads, documents, and blog posts in the community.

getCombinedContentCount

public int getCombinedContentCount(ResultFilter filter,
                                   long[] types)
Description copied from interface: ContentRetrieval
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. Note: this method ignores permissions because it's not possible to do a database query for the count that obeys permissions counts. Therefore, the count returned by this method may not be the same as the number of conten objects returned by the ContentRetrieval.getCombinedContent(ResultFilter, long[]) method.

Specified by:
getCombinedContentCount in interface ContentRetrieval
Parameters:
filter - the ResultFilter to filter the results.
types - the ContentTypes to include in the count.
Returns:
combined number of threads, documents, and blog posts in the community.

getCombinedContent

public java.util.Iterator getCombinedContent(long[] types)
Description copied from interface: ContentRetrieval
Returns an Iterable for all threads, documents, and blog posts in the community, depending on which ContentTypes are supplied as an argument. The results will be sorted by descending modification date.

Specified by:
getCombinedContent in interface ContentRetrieval
Parameters:
types - the ContentTypes to include in the result.
Returns:
an Iterable for the threads, documents, and blog posts in the community.

getCombinedContent

public java.util.Iterator getCombinedContent(ResultFilter filter,
                                             long[] types)
Description copied from interface: ContentRetrieval
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.

Specified by:
getCombinedContent in interface ContentRetrieval
Parameters:
filter - the ResultFilter to filter and sort the results.
types - the ContentTypes to include in the result.
Returns:
an Iterable for the threads, documents, and blog posts in the community.

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.