Jive API (5.0.0.0) Core Javadocs

com.jivesoftware.community
Interface CommunityManager

All Superinterfaces:
JiveManager

public interface CommunityManager
extends JiveManager

This manager provides methods to load communities by ID and to retrieve the root community. Once a handle on a community is obtained one can use the methods in this interface and other interfaces such as the ForumManager interface to retrieve subcommunities, threads, messages, documents, etc.

See Also:
JiveContext, Community

Method Summary
 Community createCommunity(Community parentCommunity, String name, String displayName, String description)
          Creates a new Community as a sub-community of a specified community using the name and description.
 Community createCommunity(String name, String displayName, String description)
          Creates a new Community as a sub-community of the root community using the name and description.
 void deleteCommunity(Community community)
          Deletes a community.
 JiveIterator<JiveContentObject> getCombinedContent(JiveContainer container, ContainableType... contentTypes)
          Returns an Iterable for all content objects in the container, depending on which ContainableTypes are supplied as an argument.
 JiveIterator<JiveContentObject> getCombinedContent(JiveContainer container, FilteredContentEnabledType... contentTypes)
          Returns an Iterable for all content objects in the container, depending on which FilteredContentEnabledTypes are supplied as an argument.
 JiveIterator<JiveContentObject> getCombinedContent(JiveContainer container, ResultFilter filter, ContainableType... contentTypes)
          Returns an Iterable for all content objects in the container, depending on which ContainableTypes are supplied as an argument, and according the the supplied ResultFilter.
 JiveIterator<JiveContentObject> getCombinedContent(JiveContainer container, ResultFilter filter, FilteredContentEnabledType... contentTypes)
          Returns an Iterable for all content objects in the container, depending on which FilteredContentEnabledTypes are supplied as an argument, and according the the supplied ResultFilter.
 JiveIterator<JiveContentObject> getCombinedContent(TagSet tagSet, ContainableType... contentTypes)
          Returns an Iterable for all content objects in the tag set, depending on which ContainableTypes are supplied as an argument.
 JiveIterator<JiveContentObject> getCombinedContent(TagSet tagSet, FilteredContentEnabledType... contentTypes)
          Returns an Iterable for all content objects in the tag set, depending on which FilteredContentEnabledTypes are supplied as an argument.
 JiveIterator<JiveContentObject> getCombinedContent(TagSet tagSet, ResultFilter filter, ContainableType... contentTypes)
          Returns an Iterable for all content objects in the tag set, depending on which ContainableTypes are supplied as an argument, and according the the supplied ResultFilter.
 JiveIterator<JiveContentObject> getCombinedContent(TagSet tagSet, ResultFilter filter, FilteredContentEnabledType... contentTypes)
          Returns an Iterable for all content objects in the tag set, depending on which FilteredContentEnabledTypes are supplied as an argument, and according the the supplied ResultFilter.
 int getCombinedContentCount(JiveContainer container, ContainableType... contentTypes)
          Returns the combined number of content objects in the container, depending on which ContainableTypes are supplied as an argument.
 int getCombinedContentCount(JiveContainer container, FilteredContentEnabledType... contentTypes)
          Returns the combined number of content objects in the container, depending on which FilteredContentEnabledTypes are supplied as an argument.
 int getCombinedContentCount(JiveContainer container, ResultFilter filter, ContainableType... contentTypes)
          Returns the combined number of content objects in the container, depending on which ContainableTypes are supplied as an argument, and restricted by the ResultFilter.
 int getCombinedContentCount(JiveContainer container, ResultFilter filter, FilteredContentEnabledType... contentTypes)
          Returns the combined number of content objects in the container, depending on which FilteredContentEnabledTypes are supplied as an argument, and restricted by the ResultFilter.
 int getCombinedContentCount(TagSet tagSet, ContainableType... contentTypes)
          Returns the combined number of content objects in the tag, depending on which ContainableTypes are supplied as an argument.
 int getCombinedContentCount(TagSet tagSet, FilteredContentEnabledType... contentTypes)
          Returns the combined number of content objects in the tag, depending on which FilteredContentEnabledTypes are supplied as an argument.
 int getCombinedContentCount(TagSet tagSet, ResultFilter filter, ContainableType... contentTypes)
          Returns the combined number of content objects in the tag set, depending on which ContainableTypes are supplied as an argument, and restricted by the ResultFilter.
 int getCombinedContentCount(TagSet tagSet, ResultFilter filter, FilteredContentEnabledType... contentTypes)
          Returns the combined number of content objects in the tag set, depending on which FilteredContentEnabledTypes are supplied as an argument, and restricted by the ResultFilter.
 JiveIterator<Community> getCommunities(Community community)
          Returns an Iterable for the child communities of the specified community.
 JiveIterator<Community> getCommunities(Community community, 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.
 Community getCommunity(long communityID)
          Returns the Community with the supplied communityID.
 int getCommunityCount(Community community)
          Returns the number of sub-communities under the specified community.
 int getCommunityDepth(Community community)
          Returns the depth of a community relative to the root.
 JiveIterator<Community> getRecursiveCommunities(Community community)
          Returns an Iterable for all sub-communities of a community, including sub-communities of sub-communities, etc.
 int getRecursiveCommunityCount(Community community)
          Returns the count of all sub-communities of a community, including sub-communities of sub-communities, etc.
 Community getRootCommunity()
          Returns the "root" community that all other communities are children of.
 boolean isUniqueDisplayName(Community community, String displayName)
          Deprecated. 
 boolean isUniqueHierarchicalDisplayName(Community parentCommunity, String subspaceName)
          Returns true if the full hierarchical display name for the parent community and its subspace is unique within the community hierarchy, false otherwise.
 boolean isUniqueHierarchicalName(Community parentCommunity, String subspaceName)
          Returns true if the full hierarchical name for the parent community and its subspace is unique within the community hiearchy, false otherwise.
 boolean isUniqueName(Community community, String name)
          Deprecated. 
 void mergeCommunities(Community destCommunity, Community srcCommunity)
          Merges the content of two communities by copying the content from srcCommunity to destCommunity.
 void moveCommunity(Community srcCommunity, Community destinationCommunity)
          Moves a community to another community.
 void setCommunityIndex(Community parent, Community subCommunity, int newIndex)
          Sets the display order of a sub-community.
 void update(Community community)
          Persists settings community changes, and broadcasts changes across the cluster.
 
Methods inherited from interface com.jivesoftware.community.JiveManager
destroy
 

Method Detail

getRootCommunity

Community getRootCommunity()
Returns the "root" community that all other communities are children of. The root community can never be deleted, so there isn't a possibility of it not being found.

Returns:
the root community.

getCommunity

Community getCommunity(long communityID)
                       throws CommunityNotFoundException,
                              UnauthorizedException
Returns the Community with the supplied communityID.

Parameters:
communityID - the ID of the community to load
Returns:
the Community with the supplied communityID.
Throws:
CommunityNotFoundException - if no community exists with the supplied id.
UnauthorizedException - if not allowed to view the community

moveCommunity

void moveCommunity(Community srcCommunity,
                   Community destinationCommunity)
                   throws UnauthorizedException
Moves a community to another community. You cannot move a community into a child community. For example, take the following community tree:

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

Moving 3 to be a child of 7 is not allowed, since that breaks the tree structure.

Parameters:
srcCommunity - the community to move.
destinationCommunity - the community to move the source community to.
Throws:
UnauthorizedException - if not an admin of the source community and the destination community.

mergeCommunities

void mergeCommunities(Community destCommunity,
                      Community srcCommunity)
Merges the content of two communities by copying the content from srcCommunity to destCommunity. srcCommunity will be deleted after all content is merged.

You may only execute this operation if you are a system administrator.

Parameters:
destCommunity - the community to merge content into.
srcCommunity - the community to move all content from.
Throws:
UnauthorizedException - if not an administrator

deleteCommunity

void deleteCommunity(Community community)
                     throws UnauthorizedException
Deletes a community. Only direct children of this community can be deleted using this method. Attempting to delete a community that is not a direct child will throw an IllegalArgumentException.

Parameters:
community - the community to delete.
Throws:
UnauthorizedException - if not an admin of the community's parent community

update

void update(Community community)
Persists settings community changes, and broadcasts changes across the cluster. When any field that bears the RequiresUpdate annotation change this method should be called to save the changes.

Parameters:
community - The community.
Throws:
com.jivesoftware.community.validation.InvalidPropertyException - if validation errors occur.

getRecursiveCommunityCount

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

Parameters:
community - The community to find recursive communities for.
Returns:
a count of all the recursive sub-communities of a community.

getRecursiveCommunities

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

Parameters:
community - The community to find recursive communities for.
Returns:
an Iterable for the recursive sub-communities of a community.

createCommunity

Community createCommunity(String name,
                          String displayName,
                          String description)
Creates a new Community as a sub-community of the root community using the name and description. Dispatches a CommunityEvent.COMMUNITY_ADDED event.

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.
com.jivesoftware.community.validation.InvalidPropertyException - if validation errors occur.

createCommunity

Community createCommunity(Community parentCommunity,
                          String name,
                          String displayName,
                          String description)
Creates a new Community as a sub-community of a specified community using the name and description. Dispatches a CommunityEvent.COMMUNITY_ADDED event.

Parameters:
parentCommunity - The community to create a community under
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.
com.jivesoftware.community.validation.InvalidPropertyException - if validation errors occur.

getCommunityCount

int getCommunityCount(Community community)
Returns the number of sub-communities under the specified community.

Parameters:
community - The community to acquire a community count for
Returns:
the number of sub-communities under the specified community.

getCommunities

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

Parameters:
community - The community to acquire communities for.
Returns:
the child communities of this community.

getCommunities

JiveIterator<Community> getCommunities(Community community,
                                       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:
community - The community to acquire communities for.
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.

getCommunityDepth

int getCommunityDepth(Community community)
Returns the depth of a 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(Community) Iterable to build a UI of hierarchical communities.

Parameters:
community - The community to get the depth for.
Returns:
the depth of the community in the community tree.

setCommunityIndex

void setCommunityIndex(Community parent,
                       Community subCommunity,
                       int newIndex)
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:
parent - The parent community.
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.

isUniqueDisplayName

@Deprecated
boolean isUniqueDisplayName(Community community,
                                       String displayName)
Deprecated. 

Returns true if the provided display name is unique within this community, false otherwise. The given community's display name is compared against the display names of all of its ancestors, siblings, and children.

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

isUniqueName

@Deprecated
boolean isUniqueName(Community community,
                                String name)
Deprecated. 

Returns true if the provided name is unique within this community, false otherwise. The given community's name is compared against the names of all of its ancestors, siblings, and children.

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

isUniqueHierarchicalDisplayName

boolean isUniqueHierarchicalDisplayName(Community parentCommunity,
                                        String subspaceName)
Returns true if the full hierarchical display name for the parent community and its subspace is unique within the community hierarchy, false otherwise.

Parameters:
parentCommunity - The parent community to test the name within
subspaceName - the parent's subspace display name
Returns:
true if the subspace's hierarchical display name is unique within the community hierarchy, false otherwise

isUniqueHierarchicalName

boolean isUniqueHierarchicalName(Community parentCommunity,
                                 String subspaceName)
Returns true if the full hierarchical name for the parent community and its subspace is unique within the community hiearchy, false otherwise.

Parameters:
parentCommunity - The parent community to test the name within
subspaceName - the parent's subspace name
Returns:
true if the subspace's hierarchical name is unique within the community hierarchy, false otherwise

getCombinedContentCount

int getCombinedContentCount(JiveContainer container,
                            ContainableType... contentTypes)
Returns the combined number of content objects in the container, depending on which ContainableTypes 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 content objects returned by the getCombinedContent(JiveContainer , ContainableType...) method.

Parameters:
container - The container to retrieve content from.
contentTypes - the ContainableTypes to include in the count.
Returns:
combined number of content objects in the container.

getCombinedContentCount

int getCombinedContentCount(JiveContainer container,
                            FilteredContentEnabledType... contentTypes)
Returns the combined number of content objects in the container, depending on which FilteredContentEnabledTypes 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 content objects returned by the getCombinedContent(JiveContainer , FilteredContentEnabledType...) method.

Parameters:
container - The container to retrieve content from.
contentTypes - the FilteredContentEnabledTypes to include in the count.
Returns:
combined number of content objects in the container.

getCombinedContentCount

int getCombinedContentCount(TagSet tagSet,
                            ContainableType... contentTypes)
Returns the combined number of content objects in the tag, depending on which ContainableTypes 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 content objects returned by the getCombinedContent(TagSet, ContainableType...) method.

Parameters:
tagSet - The tagSet to retrieve content from.
contentTypes - the ContainableTypes to include in the count.
Returns:
combined number of content objects in the container.

getCombinedContentCount

int getCombinedContentCount(TagSet tagSet,
                            FilteredContentEnabledType... contentTypes)
Returns the combined number of content objects in the tag, depending on which FilteredContentEnabledTypes 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 content objects returned by the getCombinedContent(TagSet, FilteredContentEnabledType...) method.

Parameters:
tagSet - The tagSet to retrieve content from.
contentTypes - the FilteredContentEnabledTypes to include in the count.
Returns:
combined number of content objects in the container.

getCombinedContentCount

int getCombinedContentCount(JiveContainer container,
                            ResultFilter filter,
                            ContainableType... contentTypes)
Returns the combined number of content objects in the container, depending on which ContainableTypes 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 content objects returned by the getCombinedContent(JiveContainer , ResultFilter, ContainableType...) method.

Parameters:
container - The container to retrieve content from.
filter - the ResultFilter to filter the results.
contentTypes - the ContainableTypes to include in the count.
Returns:
combined number of content objects in the container.

getCombinedContentCount

int getCombinedContentCount(JiveContainer container,
                            ResultFilter filter,
                            FilteredContentEnabledType... contentTypes)
Returns the combined number of content objects in the container, depending on which FilteredContentEnabledTypes 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 content objects returned by the getCombinedContent(JiveContainer , ResultFilter, FilteredContentEnabledType...) method.

Parameters:
container - The container to retrieve content from.
filter - the ResultFilter to filter the results.
contentTypes - the FilteredContentEnabledTypes to include in the count.
Returns:
combined number of content objects in the container.

getCombinedContentCount

int getCombinedContentCount(TagSet tagSet,
                            ResultFilter filter,
                            ContainableType... contentTypes)
Returns the combined number of content objects in the tag set, depending on which ContainableTypes 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 content objects returned by the getCombinedContent(TagSet, ResultFilter, ContainableType...) method.

Parameters:
tagSet - The tagSet to retrieve content from.
filter - the ResultFilter to filter the results.
contentTypes - the ContainableTypes to include in the count.
Returns:
combined number of content objects in the tag set.

getCombinedContentCount

int getCombinedContentCount(TagSet tagSet,
                            ResultFilter filter,
                            FilteredContentEnabledType... contentTypes)
Returns the combined number of content objects in the tag set, depending on which FilteredContentEnabledTypes 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 content objects returned by the getCombinedContent(TagSet, ResultFilter, FilteredContentEnabledType...) method.

Parameters:
tagSet - The tagSet to retrieve content from.
filter - the ResultFilter to filter the results.
contentTypes - the FilteredContentEnabledTypes to include in the count.
Returns:
combined number of content objects in the tag set.

getCombinedContent

JiveIterator<JiveContentObject> getCombinedContent(JiveContainer container,
                                                   ContainableType... contentTypes)
Returns an Iterable for all content objects in the container, depending on which ContainableTypes are supplied as an argument. The results will be sorted by descending modification date.

Parameters:
container - The container to retrieve content from.
contentTypes - the ContainableTypes to include in the result.
Returns:
an Iterable for the content objects in the container.

getCombinedContent

JiveIterator<JiveContentObject> getCombinedContent(JiveContainer container,
                                                   FilteredContentEnabledType... contentTypes)
Returns an Iterable for all content objects in the container, depending on which FilteredContentEnabledTypes are supplied as an argument. The results will be sorted by descending modification date.

Parameters:
container - The container to retrieve content from.
contentTypes - the FilteredContentEnabledTypes to include in the result.
Returns:
an Iterable for the content objects in the container.

getCombinedContent

JiveIterator<JiveContentObject> getCombinedContent(TagSet tagSet,
                                                   ContainableType... contentTypes)
Returns an Iterable for all content objects in the tag set, depending on which ContainableTypes are supplied as an argument. The results will be sorted by descending modification date.

Parameters:
tagSet - The tagSet to retrieve content from.
contentTypes - the ContainableTypes to include in the result.
Returns:
an Iterable for the content objects in the tag set.

getCombinedContent

JiveIterator<JiveContentObject> getCombinedContent(TagSet tagSet,
                                                   FilteredContentEnabledType... contentTypes)
Returns an Iterable for all content objects in the tag set, depending on which FilteredContentEnabledTypes are supplied as an argument. The results will be sorted by descending modification date.

Parameters:
tagSet - The tagSet to retrieve content from.
contentTypes - the FilteredContentEnabledTypes to include in the result.
Returns:
an Iterable for the content objects in the tag set.

getCombinedContent

JiveIterator<JiveContentObject> getCombinedContent(JiveContainer container,
                                                   ResultFilter filter,
                                                   ContainableType... contentTypes)
Returns an Iterable for all content objects in the container, depending on which ContainableTypes are supplied as an argument, and according the the supplied ResultFilter.

Parameters:
container - The container to retrieve content from.
filter - the ResultFilter to filter and sort the results.
contentTypes - the ContainableTypes to include in the result.
Returns:
an Iterable for the content objects in the container.

getCombinedContent

JiveIterator<JiveContentObject> getCombinedContent(JiveContainer container,
                                                   ResultFilter filter,
                                                   FilteredContentEnabledType... contentTypes)
Returns an Iterable for all content objects in the container, depending on which FilteredContentEnabledTypes are supplied as an argument, and according the the supplied ResultFilter.

Parameters:
container - The container to retrieve content from.
filter - the ResultFilter to filter and sort the results.
contentTypes - the FilteredContentEnabledTypes to include in the result.
Returns:
an Iterable for the content objects in the container.

getCombinedContent

JiveIterator<JiveContentObject> getCombinedContent(TagSet tagSet,
                                                   ResultFilter filter,
                                                   ContainableType... contentTypes)
Returns an Iterable for all content objects in the tag set, depending on which ContainableTypes are supplied as an argument, and according the the supplied ResultFilter.

Parameters:
tagSet - The tagSet to retrieve content from.
filter - the ResultFilter to filter and sort the results.
contentTypes - the ContainableTypes to include in the result.
Returns:
an Iterable for the content objects in the tag set.

getCombinedContent

JiveIterator<JiveContentObject> getCombinedContent(TagSet tagSet,
                                                   ResultFilter filter,
                                                   FilteredContentEnabledType... contentTypes)
Returns an Iterable for all content objects in the tag set, depending on which FilteredContentEnabledTypes are supplied as an argument, and according the the supplied ResultFilter.

Parameters:
tagSet - The tagSet to retrieve content from.
filter - the ResultFilter to filter and sort the results.
contentTypes - the FilteredContentEnabledTypes to include in the result.
Returns:
an Iterable for the content objects in the tag set.

Jive Product Page

Copyright © 1999-2007 Jive Software.