Clearspace API (1.7.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 the Community interface to retrieve subcommunities, threads, messages, documents, etc.

See Also:
JiveContext, Community

Method Summary
 void deleteCommunity(Community community)
          Deletes a community.
 Community getCommunity(long communityID)
          Returns the Community with the supplied communityID.
 Community getCommunity(java.lang.String nntpName)
          Returns the community with the specified NNTP name.
 JiveContentObject getJiveContentObject(int objectType, long objectID)
          Returns the JiveContentObject with the supplied objectType and objectID or null if the specified objectType is not a valid JiveContentObject.
 JiveObject getJiveObject(int objectType, long objectID)
          Returns the JiveObject with the supplied objectType and objectID or null if the specified objectType is not a valid JiveObject.
 Community getRootCommunity()
          Returns the "root" community that all other communities are children of.
 void mergeCommunities(Community destCommunity, Community srcCommunity)
          Merges the content of two communities by copying the threads, documents and blogs from community2 to community1.
 void moveCommunity(Community srcCommunity, Community destinationCommunity)
          Moves a community to another community.
 
Methods inherited from interface com.jivesoftware.community.JiveManager
destroy, initialize
 

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

getCommunity

Community getCommunity(java.lang.String nntpName)
                       throws CommunityNotFoundException,
                              UnauthorizedException
Returns the community with the specified NNTP name.

Parameters:
nntpName - the NNTP name of the community to return.
Returns:
the Community.
Throws:
CommunityNotFoundException - if the requested community does not exist.
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 threads, documents and blogs from community2 to community1. community2 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 threads, document and blogs 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

getJiveContentObject

JiveContentObject getJiveContentObject(int objectType,
                                       long objectID)
                                       throws NotFoundException
Returns the JiveContentObject with the supplied objectType and objectID or null if the specified objectType is not a valid JiveContentObject.

Parameters:
objectType - the type of the content object to load
objectID - the id of the content object to load
Returns:
the JiveContentObject with the supplied objectType and objectID or null if the specified objectType is not a valid JiveContentObject
Throws:
NotFoundException - if no object exists with the supplied type and id.

getJiveObject

JiveObject getJiveObject(int objectType,
                         long objectID)
                         throws NotFoundException
Returns the JiveObject with the supplied objectType and objectID or null if the specified objectType is not a valid JiveObject.

Parameters:
objectType - the type of the jive, object to load
objectID - the id of the jive object to load
Returns:
the JiveObject with the supplied objectType and objectID or null if the specified objectType is not a valid JiveObject
Throws:
NotFoundException - if no object exists with the supplied type and id.

Clearspace Project Page

Copyright © 1999-2007 Jive Software.