com.plumtree.server
Interface IPTCommunityManager


public interface IPTCommunityManager

Author:
Robert Zhang, Michael DeCourcey

Method Summary
 IPTCommunityInfo CachedOpenCommunityInfo(int nCommunityID, boolean bCheckLastModified)
          Returns an IPTCommunityInfo, which can be used by the UI to display a cached version of the community.
 void FlushMandatoryTabsCache()
          Flush the mandatory tabs cache.
 void FlushObjectIdLookupCache()
          Flush the object name to object id cache.
 int GetCommunityIDGivenPageID(int nPageID)
          Returns the community id of the community which owns passed in page id.
 void JoinCommunity(int nCommunityID, int nMembershipType)
          Join the current user to a community with a particular membership type.
 int LookupPageIdFromCommunityPageName(int commId, java.lang.String pageName)
          Looksup the page id or page ids if there are more than one page with the specified name in the specified community.
 IPTQueryResult QueryAvailableCommunities()
          Query for communities that are available to the current user.
 IPTQueryResult QueryCommunitiesForGadget(int nGadgetID)
          Returns a query result of object IDs for the communities that contain the given gadget.
 IPTQueryResult QueryMandatoryTabs()
          Query for current user's list of mandatory communities that appear with navigation tabs.
 IPTQueryResult QueryMemberships()
          Query for the current user's community memberships, which includes communities that the user has joined and communities that are mandatory for groups that the user is in.
 void QuitCommunity(int nCommunityID)
          Remove the current user from a community that they are currently joined to.
 

Method Detail

CachedOpenCommunityInfo

IPTCommunityInfo CachedOpenCommunityInfo(int nCommunityID,
                                         boolean bCheckLastModified)
Returns an IPTCommunityInfo, which can be used by the UI to display a cached version of the community.

Parameters:
nCommunityID - ID of the Community to open
bCheckLastModified - Checks the last modified date of the Community in the DB and loads a fresh entry to cache if the Community info in the cache is old.
Returns:
IPTCommunityInfo

QueryCommunitiesForGadget

IPTQueryResult QueryCommunitiesForGadget(int nGadgetID)
Returns a query result of object IDs for the communities that contain the given gadget.

Parameters:
nGadgetID - ID of the gadget to query for.
Returns:
IPTQueryResult Communities that contains the specified gadget with these columns: PT_PROPIDS.PT_PROPID_OBJECTID, PT_PROPIDS.PT_PROPID_NAME
See Also:
PT_PROPIDS

GetCommunityIDGivenPageID

int GetCommunityIDGivenPageID(int nPageID)
Returns the community id of the community which owns passed in page id.

Parameters:
nPageID - ID of the page
Returns:
int ID of the community

QueryMemberships

IPTQueryResult QueryMemberships()
Query for the current user's community memberships, which includes communities that the user has joined and communities that are mandatory for groups that the user is in.

Returns:
IPTQueryResult - query result with the following PROPIDS: PT_PROPID_NAME PT_PROPID_OBJECTID PT_PROPID_MEMBERSHIP_TYPE

QueryAvailableCommunities

IPTQueryResult QueryAvailableCommunities()
Query for communities that are available to the current user.

Returns:
IPTQueryResult - query result with the following PROPIDS: PT_PROPID_NAME PT_PROPID_ISLOCALIZED PT_PROPID_OBJECTID

JoinCommunity

void JoinCommunity(int nCommunityID,
                   int nMembershipType)
Join the current user to a community with a particular membership type.

Parameters:
nCommunityID - - community id to join
nMembershipType - - of type PT_COMMUNITY_MEMBERSHIPTYPE

QuitCommunity

void QuitCommunity(int nCommunityID)
Remove the current user from a community that they are currently joined to.

Parameters:
nCommunityID - - community id to quit

QueryMandatoryTabs

IPTQueryResult QueryMandatoryTabs()
Query for current user's list of mandatory communities that appear with navigation tabs.

Returns:
IPTQueryResult - query result with the following PROPIDS: PT_PROPID_OBJECTID PT_PROPID_NAME PT_PROPID_ISLOCALIZED

FlushMandatoryTabsCache

void FlushMandatoryTabsCache()
Flush the mandatory tabs cache. Calling this function frequently will result in performance problems.


FlushObjectIdLookupCache

void FlushObjectIdLookupCache()
Flush the object name to object id cache. Use only for testing!


LookupPageIdFromCommunityPageName

int LookupPageIdFromCommunityPageName(int commId,
                                      java.lang.String pageName)
Looksup the page id or page ids if there are more than one page with the specified name in the specified community.

Parameters:
commId - The id of the community to lookup the specified page name
pageName - Page name to lookup
Returns:
Id of the page with the specified name
Throws:
PTException - with result code PT_RESULTCODES.PT_E_FAIL if the community is not accessible or if the page is not accessible by the user or not found