Clearspace API (1.3.0) Core Javadocs

com.jivesoftware.community
Interface Community

All Superinterfaces:
ContentRetrieval, JiveObject

public interface Community
extends JiveObject, ContentRetrieval

A container for threads, documents and a hierarchy of other communities. In other words, the community structure is a tree, with lists of threads and documents for every community node. There is always a "root" community (ID of 1), of which all other communities are children.

Community names are not unique, therefore it is not possible to load a community by name.

See Also:
CommunityManager.getRootCommunity(), CommunityManager.getCommunity(long)

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.jivesoftware.community.ContentRetrieval
ContentRetrieval.ContentType
 
Field Summary
 
Fields inherited from interface com.jivesoftware.community.ContentRetrieval
ALL_TYPES
 
Method Summary
 void addBlog(Blog blog)
          Associates the specified Blog with this community.
 void addDocument(Document document)
          Add a document as a child of the community.
 void addDocument(Document document, com.jivesoftware.community.impl.PermissionsBundle permBundle)
          Add a document as a child of the community with permissions defined by the provided permission bundle.
 void addDocumentApprover(User user)
          Add the user as a document approver for this entire community.
 void addThread(ForumThread thread)
          Adds a new thread to the community.
 Community createCommunity(java.lang.String name, java.lang.String displayName, java.lang.String description)
          Creates a new Community as a sub-community of this community using the name and description.
 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.
 ForumThread createThread(ForumMessage rootMessage)
          Factory method to create a new thread.
 int getBlogCount()
          Returns the number of blogs associated with this community.
 JiveIterator<Blog> getBlogs()
          Returns all Blogs associated with this community.
 JiveIterator<Community> getCommunities()
          Returns an Iterable for the child communities of this community.
 JiveIterator<Community> getCommunities(int startIndex, int numResults)
          Returns an Iterable for the child communities of this community using a start index and the number of results to return.
 int getCommunityCount()
          Returns the number of sub-communities of this community.
 int getCommunityDepth()
          Returns the depth of a this community relative to the root.
 ContentRetrieval.ContentType[] getContentTypes()
          Gets an array of ContentRetrieval.ContentTypes that are enabled for this community.
 java.util.Date getCreationDate()
          Returns the Date that the community was created.
 java.lang.String getDescription()
          Returns the description of the community.
 java.lang.String getDisplayName()
          Gets the display name of the community.
 java.util.Collection<User> getDocumentApprovers()
          Returns all of the users that must approve new documents before they reach a PUBLISHED state when it is in a PENDING_APPROVAL state.
 int getDocumentCount()
          Returns the number of published documents in the community.
 int getDocumentCount(DocumentResultFilter resultFilter)
          Returns the number of documents in the community {and possibly all subcommunities} based on the specified ResultFilter.
 JiveIterator<Document> getDocuments()
          Returns an Iterable for all the published documents in the community.
 JiveIterator<Document> getDocuments(DocumentResultFilter resultFilter)
          Returns an Iterable for all the documents in the community {and possibly all subcommunities} that match the criteria specified by the ResultFilter.
 JiveIterator<Document> getDocumentsUnderEdit()
          Returns an Iterable of documents currently being editted in the community.
 int getDocumentsUnderEditCount()
          Returns the count of the number of documents currently being editted in the community.
 java.util.Locale getFinalLocale()
          Returns the locale for this community.
 InterceptorManager getInterceptorManager()
          Returns a message interceptor manager that can be used to manage interceptors for this community.
 Document getLatestDocument()
          Returns the most recently created or edited document in this community (including all sub-communities).
 ForumMessage getLatestMessage()
          Returns the most recently created or edited message in this community (including all sub-communities).
 java.util.Locale getLocale()
          Returns the locale for this community.
 int getMaxCommunityIndex()
          Returns the largest community index value for a message in the community.
 int getMinCommunityIndex()
          Returns the smallest community index value for a message in the community.
 int getModerationDefaultMessageValue()
          Returns the default number of moderation points for messages created in the community.
 int getModerationDefaultThreadValue()
          Returns the default number of moderation points for threads created in the community.
 java.util.Date getModificationDate()
          Returns the Date this community was last modified.
 java.lang.String getName()
          Returns the name of the community.
 java.lang.String getNNTPName()
          Returns the NNTP name for the community, which is the name of the community used in the NNTP protocol (newsgroups).
 Community getParentCommunity()
          Returns the parent community of this community.
 Permissions getPermissions(AuthToken authToken)
          Returns the permissions for the community that correspond to the passed-in AuthToken.
 PermissionsManager getPermissionsManager()
          Returns a permissions manager that can be used to set permissions for this community.
 JiveIterator<Document> getPopularDocuments()
          Returns the top x documents according to document views, number of comments & time passed since the document was created.
 JiveIterator<ForumThread> getPopularThreads()
          Returns the top x threads according to thread views, replies per thread & time passed since the thread was last modified.
 java.util.Map<java.lang.String,java.lang.String> getProperties()
          Retrieve a map of all the extended properties for the community.
 JiveIterator<Community> getRecursiveCommunities()
          Returns an Iterable for all sub-communities of this community, including sub-communities of sub-communities, etc.
 int getRecursiveCommunityCount()
          Returns the total count of all sub-communities of this community, including sub-communities of sub-communities, etc.
 RenderManager getRenderManager()
          Returns a render manager that can be used to manage render filters and macros for this community.
 java.util.Map<java.lang.String,java.lang.Integer> 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<java.lang.String,java.lang.Integer> getTags(TagResultFilter resultFilter, ContentRetrieval.ContentType... types)
          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.
 JiveIterator<TagSet> getTagSets()
          Returns all TagSets which are defined for this Community.
 int getViewCount()
          Returns the number of times this thread has been community.
 boolean isAuthorized(long permissionType)
          Returns true if the handle on the object has the permission specified.
 boolean isRead(User user)
          Returns true if this community has been read by the user, false otherwise.
 boolean isUniqueDisplayName(java.lang.String displayName)
          Returns true if the provided display name is unique within this community, false otherwise
 boolean isUnread(User user)
          Returns true if this community has not been read by the user, false otherwise.
 boolean isUpdated(User user)
          Returns true if this community has been updated since read by the user, false otherwise.
 void removeBlog(Blog blog)
          Disassociates the specified Blog from this community.
 void removeDocumentApprover(User user)
          Remove this user as a document approver for this community.
 void setCommunityIndex(Community subCommunity, int newIndex)
          Sets the display order of a sub-community.
 void setContentTypes(ContentRetrieval.ContentType... types)
          Sets an array of ContentRetrieval.ContentTypes that are enabled for this community;
 void setCreationDate(java.util.Date creationDate)
          Sets the creation date of the community.
 void setDescription(java.lang.String description)
          Sets the description of the community.
 void setDisplayName(java.lang.String name)
          Sets the display name of the community that is used as the URI.
 void setLocale(java.util.Locale locale)
          Sets the locale for this community.
 void setModerationDefaultMessageValue(int value)
          Sets the default number of moderation points for threads created in the community.
 void setModerationDefaultThreadValue(int value)
          Sets the default number of moderation points for threads created in the community.
 void setModificationDate(java.util.Date modificationDate)
          Sets the date the community was last modified.
 void setName(java.lang.String name)
          Sets the name of the community.
 void setNNTPName(java.lang.String nntpName)
          Sets the NNTP name for the community, which is the name of the community used in the NNTP protocol (newsgroups).
 
Methods inherited from interface com.jivesoftware.community.JiveObject
getID, getObjectType
 
Methods inherited from interface com.jivesoftware.community.ContentRetrieval
getBlogPostCount, getBlogPostCount, getBlogPosts, getBlogPosts, getCombinedContent, getCombinedContent, getCombinedContentCount, getCombinedContentCount, getMessageCount, getMessageCount, getMessages, getMessages, getThreadCount, getThreadCount, getThreads, getThreads
 

Method Detail

getName

java.lang.String getName()
Returns the name of the community.

Returns:
the name of the community.

setName

void setName(java.lang.String name)
             throws UnauthorizedException
Sets the name of the community.

Parameters:
name - the name of the community.
Throws:
UnauthorizedException - if does not have admin permissions.

getDisplayName

java.lang.String getDisplayName()
Gets the display name of the community.

Returns:
the display name of the community

setDisplayName

void setDisplayName(java.lang.String name)
                    throws UnauthorizedException,
                           NameAlreadyExistsException
Sets the display name of the community that is used as the URI. The display name will be used as part of the URI.

This method will throw an IllegalArgumentException if

Use the CommunityManager.getCommunity(String) method to find out if a community with the new name already exists and StringUtils.containsNonAlphanumeric(String) to test a string for non alphanumeric characters.

Parameters:
name - the display name
Throws:
UnauthorizedException - if does not have admin permissions.
NameAlreadyExistsException - if attempting to use an existing display name.

getNNTPName

java.lang.String getNNTPName()
Returns the NNTP name for the community, which is the name of the community used in the NNTP protocol (newsgroups). NNTP names must be unique in the system and typically contain community information in the name. For example, consider the community named "Support" in the community "Product X". The NNTP name for the community might be "product_x.support". However, this naming scheme is merely by convention; the NNTP name for a community can be anything as long as it is unique in the system and conforms to NNTP naming conventions.

NNTP names must follow certain rules. In particular:

Returns:
the NNTP name of the community.

setNNTPName

void setNNTPName(java.lang.String nntpName)
                 throws UnauthorizedException,
                        NameAlreadyExistsException
Sets the NNTP name for the community, which is the name of the community used in the NNTP protocol (newsgroups). NNTP names must be unique in the system and typically contain community information in the name. For example, consider the community named "Support" in the community "Product X". The NNTP name for the community might be "product_x.support". However, this naming scheme is merely by convention; the NNTP name for a community can be anything as long as it is unique in the system and conforms to NNTP naming conventions.

NNTP names must follow certain rules. Therefore, any name passed into this method will automatically converted based on the following rules:

Parameters:
nntpName - the NNTP name of the community.
Throws:
UnauthorizedException - if does not have admin permissions.
NameAlreadyExistsException - if attempting to use an existing NNTP name.

getDescription

java.lang.String getDescription()
Returns the description of the community.

Returns:
the description of the community.

setDescription

void setDescription(java.lang.String description)
                    throws UnauthorizedException
Sets the description of the community.

Parameters:
description - the description of the community.
Throws:
UnauthorizedException - if does not have admin permissions.

getCreationDate

java.util.Date getCreationDate()
Returns the Date that the community was created.

Returns:
the Date the community was created.

setCreationDate

void setCreationDate(java.util.Date creationDate)
                     throws UnauthorizedException
Sets the creation date of the community. In most cases, the creation date will default to when the community 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.

Parameters:
creationDate - the date the community was created.
Throws:
UnauthorizedException - if does not have admin permissions.

getModificationDate

java.util.Date getModificationDate()
Returns the Date this community was last modified. In other words, the date of the most recent community update in this community.

Returns:
the Date the community was last modified.

setModificationDate

void setModificationDate(java.util.Date modificationDate)
                         throws UnauthorizedException
Sets the date the community was last modified. In most cases, last modified will default to when the community 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.

Parameters:
modificationDate - the date the community was modified.
Throws:
UnauthorizedException - if does not have admin permissions.

getLocale

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

Returns:
the locale for this community.

setLocale

void setLocale(java.util.Locale locale)
               throws UnauthorizedException
Sets the locale for this community. A locale specifies language and country codes, and is used for internationalization.

Parameters:
locale - the locale of this community.
Throws:
UnauthorizedException - if does not have admin permissions.

getFinalLocale

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

Returns:
the final locale for this community.

getParentCommunity

Community getParentCommunity()
Returns the parent community of this community. This method will return null if the current community is the root community.

Returns:
the parent community of this community.

getCommunityCount

int getCommunityCount()
Returns the number of sub-communities of this community.

Returns:
the number of sub-communities in this community.

getCommunities

JiveIterator<Community> getCommunities()
Returns an Iterable for the child communities of this community.

Returns:
the child communities of this community.

getCommunities

JiveIterator<Community> getCommunities(int startIndex,
                                       int numResults)
Returns an Iterable for the child communities of this community 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.

Parameters:
startIndex - the index of the first result to return.
numResults - the max number of results to return.
Returns:
an Iterable for the child communities of this community.

getRecursiveCommunityCount

int getRecursiveCommunityCount()
Returns the total count of all sub-communities of this community, including sub-communities of sub-communities, etc.

Returns:
the recursive sub-community count of this community.

getRecursiveCommunities

JiveIterator<Community> getRecursiveCommunities()
Returns an Iterable for all sub-communities of this community, including sub-communities of sub-communities, etc.

Returns:
an Iterable for the recursive sub-communities of this community.

getCommunityDepth

int getCommunityDepth()
Returns the depth of a this community relative to the root. For example, consider the following tree (where 1 is the root community):

   1
   |-- 3
   |-- |-- 4
   |-- |-- |-- 7
 

The depth of community 4 is 2, the depth of community 7 is 3, etc. This method is useful in combination with the getRecursiveCommunities() Iterable to build a UI of hierarchical communities.

Returns:
the depth of the community in the community tree.

isUniqueDisplayName

boolean isUniqueDisplayName(java.lang.String displayName)
Returns true if the provided display name is unique within this community, false otherwise

Parameters:
displayName - the display name to check for uniqueness
Returns:
true if the display name is unique within this community, false otherwise

setCommunityIndex

void setCommunityIndex(Community subCommunity,
                       int newIndex)
                       throws UnauthorizedException
Sets the display order of a sub-community. For example, if a sub-community has an index of 0, then it will returned first in the Iterable resulting from the communities method call.

Parameters:
subCommunity - the sub community to set the index for
newIndex - the new index of the sub community
Throws:
UnauthorizedException - if not an admin of the community

createCommunity

Community createCommunity(java.lang.String name,
                          java.lang.String displayName,
                          java.lang.String description)
                          throws UnauthorizedException,
                                 NameAlreadyExistsException
Creates a new Community as a sub-community of this community using the name and description.

Parameters:
name - the name of the new community.
displayName - the display name of the new community.
description - the description of the new community.
Returns:
a new Community.
Throws:
UnauthorizedException - if not an admin.
NameAlreadyExistsException - if the display name of the community is not unique.

getContentTypes

ContentRetrieval.ContentType[] getContentTypes()
Gets an array of ContentRetrieval.ContentTypes that are enabled for this community.

Returns:
an array of ContentRetrieval.ContentTypes that are enabled for this community.

setContentTypes

void setContentTypes(ContentRetrieval.ContentType... types)
                     throws UnauthorizedException
Sets an array of ContentRetrieval.ContentTypes that are enabled for this community;

Parameters:
types - an array of ContentRetrieval.ContentTypes that are enabled for this community
Throws:
UnauthorizedException - if not an admin of this community

getPopularThreads

JiveIterator<ForumThread> getPopularThreads()
Returns the top x threads according to thread views, replies per thread & time passed since the thread was last modified. The algorithm is as follows:

Top x of ((thread views) * (number of messages in thread + 2)) * 1/(1 + number of days since modification date)

The number of threads to return is determined by the property "popularThreads.number", defaulting to 5 if the property is not specified. Popular threads are only calculated once every 15 minutes.

Returns:
an Iterable of the most popular threads.

createThread

ForumThread createThread(ForumMessage rootMessage)
                         throws UnauthorizedException
Factory method to create a new thread. A root message must be supplied when creating the thread. The root message can either be a new message (normal case), or an existing message in a thread. When a new message is being used, the following pattern should be applied to add a new thread to a community: When an existing message is passed to this method, the effect will be to create a new thread with the existing message and all of its children (the messages will be removed from the old thread). This is useful if an off-topic conversation begins in a thread which should be branched into a new thread.

Note: creating the ForumThread object is only one step of the process. You must also add the thread to the community with the addThread(ForumThread) method before it is saved to the database. It is illegal to create a thread in one community and then add it to another community.

Parameters:
rootMessage - the root message of the thread.
Returns:
a new ForumThread object.
Throws:
UnauthorizedException - if does not have CREATE_THREAD permissions.

addThread

void addThread(ForumThread thread)
               throws RejectedException,
                      UnauthorizedException
Adds a new thread to the community.

Adding an existing thread to a community is illegal. Instead, the moveForum method should be used.

Parameters:
thread - the thread to add to the community.
Throws:
RejectedException - if one of the installed interceptors prevents the root message from being posted.
UnauthorizedException - if does not have CREATE_THREAD permissions.

getLatestMessage

ForumMessage getLatestMessage()
Returns the most recently created or edited message in this community (including all sub-communities). If there are no messages in this community, this method will return null. This information could also be determined using a ThreadResultFilter, but this method offers a simpler, more optimized way to access the data.

Returns:
the most recently created or edited message in this community.

getLatestDocument

Document getLatestDocument()
Returns the most recently created or edited document in this community (including all sub-communities). If there are no messages in this document, this method will return null. This information could also be determined using a DocumentResultFilter, but this method offers a simpler, more optimized way to access the data.

Returns:
the most recently created or edited document in this community.

createMessage

ForumMessage createMessage()
Factory method to create a message with an anonymous author. After the message is created, all fields should be set, and then the message can be used to create a new thread or can be added to an existing thread.

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 community and then add it to a thread in another community.

Returns:
a new ForumMessage object.

createMessage

ForumMessage createMessage(User user)
                           throws UnauthorizedException
Factory method to create a message as the specified user. After the message is created, all fields should be set, and then the message can be used to create a new thread or can be added to an existing thread.

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 community and then add it to a thread in another community.

Parameters:
user - the author of the message.
Returns:
the new community message
Throws:
UnauthorizedException - if does not have permission to post as the specified user.

getBlogs

JiveIterator<Blog> getBlogs()
Returns all Blogs associated with this community.

Returns:
all Blogs associated with this community.

getBlogCount

int getBlogCount()
Returns the number of blogs associated with this community.

Returns:
returns the number of blogs associated with this community.

addBlog

void addBlog(Blog blog)
Associates the specified Blog with this community. All posts within the blog will be available for viewing through the ContentRetrieval.getBlogPosts() method. Blogs are not logically contained by a community the way threads and documents are. Instead, blogs are autonomous entities that can be associated with one or more communities.

Parameters:
blog - the Blog to associate with this community.

removeBlog

void removeBlog(Blog blog)
Disassociates the specified Blog from this community.

Parameters:
blog - the Blog to remove.

getPopularDocuments

JiveIterator<Document> getPopularDocuments()
Returns the top x documents according to document views, number of comments & time passed since the document was created. The algorithm is as follows:

Top x of ((document views) * (number of document comments + 2)) * 1/(1 + number of days since creation date)

The number of documents to return is determined by the property "popularDocuments.number", defaulting to 5 if the property is not specified. Popular documents are only calculated once every 15 minutes.

Returns:
an Iterable of the most popular documents.

getDocumentCount

int getDocumentCount()
Returns the number of published documents in the community. To get the number of documents in this community and all subcommunities, use getDocumentCount(DocumentResultFilter resultFilter) with the DocumentResultFilter.setRecusive(true).

Specified by:
getDocumentCount in interface ContentRetrieval
Returns:
the number of published documents in the community.

getDocuments

JiveIterator<Document> getDocuments()
Returns an Iterable for all the published documents in the community. To get all the published documents in this community and all subcommunities, use getDocuments(DocumentResultFilter resultFilter) with the DocumentResultFilter.setRecusive(true).

Specified by:
getDocuments in interface ContentRetrieval
Returns:
an Iterable of published Document objects for all the documents in the community

getDocumentCount

int getDocumentCount(DocumentResultFilter resultFilter)
Returns the number of documents in the community {and possibly all subcommunities} based on the specified ResultFilter. This is useful for determining such things as the number of documents in a date range, etc.

Specified by:
getDocumentCount in interface ContentRetrieval
Parameters:
resultFilter - a DocumentResultFilter to limit the query on.
Returns:
the number of Document objects in the community based on the filter.

getDocuments

JiveIterator<Document> getDocuments(DocumentResultFilter resultFilter)
Returns an Iterable for all the documents in the community {and possibly all subcommunities} that match the criteria specified by the ResultFilter. Note that attempting to sort the documents on their community index will have strange results.

Specified by:
getDocuments in interface ContentRetrieval
Parameters:
resultFilter - a DocumentResultFilter object to perform filtering and sorting with.
Returns:
an Iterable of Document objects for the documents in the community that match the ResultFilter.

getDocumentsUnderEditCount

int getDocumentsUnderEditCount()
Returns the count of the number of documents currently being editted in the community.

Returns:
the count of the number of documents currently being editted in the community.

getDocumentsUnderEdit

JiveIterator<Document> getDocumentsUnderEdit()
Returns an Iterable of documents currently being editted in the community.

Returns:
an Iterable of documents currently being editted in the community.

addDocument

void addDocument(Document document)
                 throws RejectedException,
                        DocumentAlreadyExistsException,
                        UnauthorizedException
Add a document as a child of the community. If the document already exists in this community, this method will do nothing. This method can possibly cause the documentID to change for the document - see Document.save() for more details.

Adding a document to a community may cause a DocumentAlreadyExistsException to be thrown if the subject of the document is not unique among the published documents in the community.

An UnauthorizedException will be thrown if the user is not a system administrator or does not have the proper permissions on either the document or the community.

Parameters:
document - the document to add into this community.
Throws:
RejectedException - if one of the installed interceptors prevents the document from being added.
DocumentAlreadyExistsException - if the subject of the document is not unique in the community
UnauthorizedException - if user does not have the proper permissions for the community.

addDocument

void addDocument(Document document,
                 com.jivesoftware.community.impl.PermissionsBundle permBundle)
                 throws RejectedException,
                        DocumentAlreadyExistsException,
                        UnauthorizedException
Add a document as a child of the community with permissions defined by the provided permission bundle. If the document already exists in this community, this method will do nothing. This method can possible cause the documentID to change for the document - see Document.save() for more details.

Adding a document to a community may cause a DocumentAlreadyExistsException to be thrown if the subject of the document is not unique among the published documents in the community.

An UnauthorizedException will be thrown if the user is not a system administrator or does not have the proper permissions on either the document or the community.

Parameters:
document - the document to add into this community.
permBundle - the permissions to assign to the document
Throws:
RejectedException - if one of the installed interceptors prevents the document from being added.
DocumentAlreadyExistsException - if the subject of the document is not unique in the community
UnauthorizedException - if user does not have the proper permissions for the community.

getDocumentApprovers

java.util.Collection<User> getDocumentApprovers()
Returns all of the users that must approve new documents before they reach a PUBLISHED state when it is in a PENDING_APPROVAL state.

Returns:
All of the document approvers.

addDocumentApprover

void addDocumentApprover(User user)
Add the user as a document approver for this entire community.

This user will be required to approve all document edits for all documents in this community that have document approval enabled.

Parameters:
user - The user to add as a document approver.

removeDocumentApprover

void removeDocumentApprover(User user)
Remove this user as a document approver for this community.

Parameters:
user - The user to remove as a document approver.

getTags

java.util.Map<java.lang.String,java.lang.Integer> 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.

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

java.util.Map<java.lang.String,java.lang.Integer> getTags(TagResultFilter resultFilter,
                                                          ContentRetrieval.ContentType... types)
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.

Parameters:
resultFilter - the filter to use to restrict tag results
types - the content types 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.

getTagSets

JiveIterator<TagSet> getTagSets()
Returns all TagSets which are defined for this Community.

Returns:
all TagSets which are defined for this Community.

getPermissionsManager

PermissionsManager getPermissionsManager()
                                         throws UnauthorizedException
Returns a permissions manager that can be used to set permissions for this community. Only admins can perform this function.

Returns:
a PermissionsManager to manage the permissions on this community.
Throws:
UnauthorizedException - is not an admin.

getInterceptorManager

InterceptorManager getInterceptorManager()
                                         throws UnauthorizedException
Returns a message interceptor manager that can be used to manage interceptors for this community.

Returns:
a InterceptorManager to manage interceptors.
Throws:
UnauthorizedException - if does not have admin permissions.

getRenderManager

RenderManager getRenderManager()
Returns a render manager that can be used to manage render filters and macros for this community. Render filter management is only for administrators, excluding the RenderManager.render(JiveObject,com.jivesoftware.community.renderer.RenderType,String) and RenderManager.render(JiveObject,com.jivesoftware.community.renderer.RenderType,com.jivesoftware.community.renderer.RenderStrategy,String) methods, which may be useful to skin writers.

Returns:
a RenderManager to manage render filters and macros for this community.
See Also:
RenderManager

getPermissions

Permissions getPermissions(AuthToken authToken)
Returns the permissions for the community 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.

Parameters:
authToken - the auth token to lookup permissions for.
Returns:
the permissions for the community that correspond to the passed-in AuthToken.

isAuthorized

boolean isAuthorized(long permissionType)
Returns true if the handle on the object has the permission specified. For example, if a community administrator has a handle on this object, then calling isAuthorized(Permissions.COMMUNITY_ADMIN) would return true.

A list of possible permissions can be found in the Permissions class. Certain methods of this class are restricted to certain permissions as specified in the method comments.

Parameters:
permissionType - permissionType a permission type.
Returns:
true if the handle on the object has the specified permission.
See Also:
Permissions

isRead

boolean isRead(User user)
Returns true if this community has been read by the user, false otherwise.

Parameters:
user - the user to check read stats for this community
Returns:
true if this community has been read by the user, false otherwise

isUnread

boolean isUnread(User user)
Returns true if this community has not been read by the user, false otherwise.

Parameters:
user - the user to check read stats for this community
Returns:
true if this community has not been read by the user, false otherwise

isUpdated

boolean isUpdated(User user)
Returns true if this community has been updated since read by the user, false otherwise.

Parameters:
user - the user to check read stats for this community
Returns:
true if this community has been updated since read by the user, false otherwise

getViewCount

int getViewCount()
Returns the number of times this thread has been community. A return value of -1 indicates the number of views is unknown or that the feature is disabled.

Returns:
the number of times this community has been viewed or -1 if the value is not known.

getProperties

java.util.Map<java.lang.String,java.lang.String> getProperties()
Retrieve a map of all the extended properties for the community. Each community can have an arbitrary number of extended properties. This allows for enhanced functionality that is not part of the base interface. The map is alterable if the user is authorized to modify the community. Null keys and values are not allowed.

If the user is not authorized to modify the community any method which modifies the map will fail with a UnsupportedOperationException;

Returns:
a map of community extended properties.

getModerationDefaultThreadValue

int getModerationDefaultThreadValue()
Returns the default number of moderation points for threads created in the community. This value is used to turn moderation on or off. A default value of 0 is used to turn moderation on, and a default value of 1 is used to turn it off.

Returns:
the default number of moderation points assigned to threads.

setModerationDefaultThreadValue

void setModerationDefaultThreadValue(int value)
                                     throws UnauthorizedException
Sets the default number of moderation points for threads created in the community. This value is used to turn moderation on or off. A default value of 0 is used to turn moderation on, and a default value of 1 is used to turn it off.

Parameters:
value - default number of moderation points for threads.
Throws:
UnauthorizedException - if does not have permission.

getModerationDefaultMessageValue

int getModerationDefaultMessageValue()
Returns the default number of moderation points for messages created in the community. This value is used to turn moderation on or off. A default value of 0 is used to turn moderation on, and a default value of 1 is used to turn it off.

Returns:
the default number of moderation points assigned to messages.

setModerationDefaultMessageValue

void setModerationDefaultMessageValue(int value)
                                      throws UnauthorizedException
Sets the default number of moderation points for threads created in the community. This value is used to turn moderation on or off. A default value of 0 is used to turn moderation on, and a default value of 1 is used to turn it off.

Parameters:
value - default number of moderation points for messages.
Throws:
UnauthorizedException - if does not have permission.

getMinCommunityIndex

int getMinCommunityIndex()
Returns the smallest community index value for a message in the community. The community index is used to track when messages enter the community. Each community index is assigned to a message once and then never re-used. So, there may be gaps in community index values as messages are deleted, archived, or moved. Still, a rough estimate of the number of messages in the system is max(communityIndex) - min(communityIndex) + 1;

Returns:
the smallest community index in the community.

getMaxCommunityIndex

int getMaxCommunityIndex()
Returns the largest community index value for a message in the community. The community index is used to track when messages enter the community. Each community index is assigned to a message once and then never re-used. So, there may be gaps in community index values as messages are deleted, archived, or moved. Still, a rough estimate of the number of messages in the system is max(communityIndex) - min(communityIndex) + 1;

Returns:
the largest community index in the community.

Clearspace Project Page

Copyright © 1999-2007 Jive Software.