com.plumtree.taskapi.portalui
Class TaskAPIUICommunity

java.lang.Object
  extended by com.plumtree.taskapi.portalui.TaskAPIUICommunity

public class TaskAPIUICommunity
extends java.lang.Object

Community related TaskAPI functions.


Field Summary
static java.lang.String URLDATA_CLASSID
           
static java.lang.String URLDATA_COMMID
           
static java.lang.String URLDATA_COMMNAME
           
static java.lang.String URLDATA_OBJECTID
           
static java.lang.String URLDATA_PAGEID
           
static java.lang.String URLDATA_PAGENAME
           
 
Constructor Summary
TaskAPIUICommunity()
           
 
Method Summary
static boolean CheckUserAccessLevelToCommunity(AActivitySpace owner, int nAccessLevel, int nCommunityID)
          Check the if the current user has at least the accesslevel specified to the current community
static boolean CheckUserAccessLevelToCurrentCommunity(AActivitySpace owner, int nAccessLevel)
          Check the if the current user has at least the accesslevel specified to the current community
static boolean CheckUserAccessLevelToCurrentCommunityPage(AActivitySpace owner, int nAccessLevel)
          Check the if the current user has at least the accesslevel specified to the current community page
static IPTURL CreateCommunityCommonOpenerURL(AActivitySpace owner, int nCommunityID, java.lang.String strCommunityName)
          Helper function to create an URL to a specified Community.
static IPTURL CreateCommunityPageCommonOpenerURL(AActivitySpace owner, int nCommunityID, int nCommunityPageID, java.lang.String strCommunityPageName)
          Helper function to create an URL to a specified Community Page.
static IPTURL CreateUserProfilePageCommonOpenerURL(AActivitySpace owner, int nProfileUserID, java.lang.String sProfileUserName)
          Gets an URL to a UserProfile page for the specified user.
static IPTURL CreateUserProfilePageCommonOpenerURL(AActivitySpace owner, int nProfileUserID, java.lang.String sProfileUserName, java.lang.String strURLTitle)
          Gets an URL to a UserProfile page for the specified user.
static IPTURL CreateUserProfilePageCommonOpenerURL(AActivitySpace owner, int nProfileUserID, java.lang.String sProfileUserName, java.lang.String strURLTitle, int nPageId, java.lang.String strPageName)
          Gets an URL to a UserProfile page for the specified user.
static XPArrayList GetCommunityActionsAsURLs(AActivitySpace owner)
          Gets Community Actions as an XPArrayList with IPTURL entries.
static XPArrayList GetCommunityActionsAsURLs(AActivitySpace owner, boolean bIncludeOneClick, boolean bInheritTemplate, int nPageTemplate)
          Gets Community Actions as an XPArrayList with IPTURL entries.
static int GetCommunityIDFromPTURL(IPTURL ptURL)
          Gets the Community ID from an IPTURL with an URL to a Community or Community Page.
static java.lang.String GetCommunityName(AActivitySpace owner, int nCommunityID)
          Gets the name of the specified Community.
static int GetCommunityPageIDFromPTURL(IPTURL ptURL)
          Gets the Community Page ID from an IPTURL with an URL to a Community Page.
static XPArrayList GetCommunityPagesAsURLs(AActivitySpace owner, int nCommunityID)
          Get Community Pages in the specified Community as a list of IPTURLs.
static int GetCurrentCommunityID(AActivitySpace owner)
          Gets the Community ID of the current Community.
static java.lang.String GetCurrentCommunityName(AActivitySpace owner)
          Gets the Community Name of the current Community.
static int GetCurrentCommunityPageID(AActivitySpace owner)
          Gets the current Community Page ID, If current page is not a Community page, the TaskAPIUICommon.INVALID_OBJECTID value is returned.
static java.lang.String GetCurrentCommunityPageName(AActivitySpace owner)
          Gets the Community Page Name of the current Community Page.
static XPArrayList GetCurrentCommunityPagesAsURLs(AActivitySpace owner)
          Gets the Community Pages of the current Community as an XPArraylist with IPTURL entries.
static IPTURL GetCurrentPageAsURL(AActivitySpace owner)
          Gets the current Page as an object of typeIPTURL.
static IPTURL GetCurrentParentCommunityAsURL(AActivitySpace owner)
          Gets the URL to the parent Community of the current Community.
static int GetCurrentParentCommunityID(AActivitySpace owner)
          Gets the Object ID of the parent Community in the current Community.
static XPArrayList GetCurrentRelatedCommunitiesAsURLs(AActivitySpace owner)
          Gets URLs to Related Communities for for the current Community in a list of IPTURLs.
static int[] GetCurrentRelatedCommununityIDs(AActivitySpace owner)
          Gets Related Communities (a.k.a.
static XPArrayList GetCurrentSubCommunitiesAsURLs(AActivitySpace owner)
          Gets Subcommunities in the current Community as an XPArrayList with IPTURL entries.
static int[] GetCurrentSubCommunityIDs(AActivitySpace owner)
          Gets the Subcommunities of the current Community as a integer array.
static int GetDefaultCommunityID(AActivitySpace owner)
          Gets the default Community ID, the first Community in a user's My Community list.
static XPArrayList GetMyCommunitiesAsURLs(AActivitySpace owner, boolean bUseCachedData)
          Gets a user's My Communities list as an XPArrayList with IPTURL entries.
static XPArrayList GetMyMandatoryCommunitiesWithTabsAsURLs(AActivitySpace owner, boolean bUseCachedData)
          Gets a user's Mandatory with Tab Communities as an XPArrayList with IPTURL entries.
static IPTURL GetParentCommunityAsURL(AActivitySpace owner, int nCommunityID)
          Gets the URL to the parent Community of the specified Community.
static int GetParentCommunityID(AActivitySpace owner, int nCommunityID)
          Gets the Object ID of the parent Community in the specified Community.
static XPArrayList GetRelatedCommununitiesAsURLs(AActivitySpace owner, int nCommunityID)
          Gets URLs to Related Communities for the specified Community in a list of IPTURLs.
static int[] GetRelatedCommununityIDs(AActivitySpace owner, int nCommunityID)
          Gets the Related Communities for the specified Community as an integer array.
static XPArrayList GetSubCommununitiesAsURLs(AActivitySpace owner, int nCommunityID)
          Gets the Subcommunities for the specified Community as a list with IPTURL entries.
static int[] GetSubCommununityIDs(AActivitySpace owner, int nCommunityID)
          Gets the Subcommunities for the specified Community as an integer array.
static IPTURL GetURLForAddCommunityPortletsEditor(AActivitySpace owner)
          Gets the URL to the Community Add Portlets Editor.
static IPTURL GetURLForAddCommunityPortletsFlyout(AActivitySpace owner)
          Gets the URL to the Community Add Portlets Flyout.
static IPTURL GetURLForCommunityKnowledgeDirectory(AActivitySpace owner, int nCommunityID)
          Gets to URL to the Community Knowledge Directory f0r the current Community.
static IPTURL GetURLForCreateCommunityPage(AActivitySpace owner)
          Gets the URL to the Create Community page in the Community Editor.
static IPTURL GetURLForCreateCommunityPageOneClick(AActivitySpace owner, boolean bInheritTemplate, int nPageTemplate)
          Gets the URL to the Create Community page in the Community Editor.
static XPArrayList GetURLForCurrentCommunity(AActivitySpace owner)
          Gets an XPArrayList with a single entry for the URL for the current Community.
static IPTURL GetURLForCurrentCommunityEditor(AActivitySpace owner)
          Gets the URL to the Community Editor for the current Community.
static IPTURL GetURLForEditPortletPreferencesEditor(AActivitySpace owner)
          Gets the URL to the Community Edit Portlet Preferences Editor.
static IPTURL GetURLForJoinCommunitiesEditor(AActivitySpace owner)
          Gets the URL for the Join Community Editor where users add Communities to their My Communities list.
static IPTURL GetURLForJoinCommunitiesFlyout(AActivitySpace owner)
          Gets the URL for the Join Community Editor where users add Communities to their My Communities list.
static IPTURL GetURLForJoinCurrentCommunityAction(AActivitySpace owner)
          Gets the URL to Join Current Community Action.
static IPTURL GetURLForUnsubscribeCommunitiesEditor(AActivitySpace owner)
          Gets the URL to the Unsubscribe from Communities Editor.
static IPTURL GetURLForUnsubscribeCurrentCommunityAction(AActivitySpace owner)
          Gets the URL to Unsubscribe Current Community Action.
static boolean IsCurrentCommunityUserProfileCommunity(AActivitySpace owner)
          Checks if the current Community is the User Profile Community.
static boolean IsCurrentPageCommunityPage(AActivitySpace owner)
          Checks if the current page is in a Community.
static boolean IsCurrentPageMyPortalPage(AActivitySpace owner)
          Checks if the current page is a Myportal page, i.e.
static boolean IsCurrentUserAbleToEditCurrentCommunityPage(AActivitySpace owner)
          Checks if the current user has access (requires EDIT access) to use the Community Editor on the current Community Page.
static boolean IsCurrentUserCommunityOwner(AActivitySpace owner)
          Checks if the current user is the owner of the current Community.
static boolean IsUserAbleToAccessCurrentCommunity(AActivitySpace owner)
          Checks if the current user has at least READ access to the current Community.
static boolean IsUserAbleToJoinCurrentCommunity(AActivitySpace owner)
          Checks if the current user has at least SELECT access to the current Community.
static boolean IsUserMemberOfCurrentCommunity(AActivitySpace owner)
          Checks if the current user is already subscribed to the current Community, i.e.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

URLDATA_PAGEID

public static final java.lang.String URLDATA_PAGEID
See Also:
Constant Field Values

URLDATA_PAGENAME

public static final java.lang.String URLDATA_PAGENAME
See Also:
Constant Field Values

URLDATA_COMMID

public static final java.lang.String URLDATA_COMMID
See Also:
Constant Field Values

URLDATA_COMMNAME

public static final java.lang.String URLDATA_COMMNAME
See Also:
Constant Field Values

URLDATA_OBJECTID

public static final java.lang.String URLDATA_OBJECTID
See Also:
Constant Field Values

URLDATA_CLASSID

public static final java.lang.String URLDATA_CLASSID
See Also:
Constant Field Values
Constructor Detail

TaskAPIUICommunity

public TaskAPIUICommunity()
Method Detail

GetCommunityName

public static java.lang.String GetCommunityName(AActivitySpace owner,
                                                int nCommunityID)
Gets the name of the specified Community.

Parameters:
owner - Current Activityspace.
nCommunityID - Object ID of the Community to retrieve the name for.
Returns:
Name of the specified Community.
Throws:
XPIllegalAccessException - If the user does not have sufficient access to the Community.

GetSubCommununityIDs

public static int[] GetSubCommununityIDs(AActivitySpace owner,
                                         int nCommunityID)
Gets the Subcommunities for the specified Community as an integer array. Subcommunites are Communities directly below a Community in the administrative folder hierarchy.

Parameters:
owner - Current Activityspace.
nCommunityID - Object ID for the Community to retrieve Subcommunities from.
Returns:
Array of integers with Object IDs of the Subcommunities in the specified Community.
Throws:
XPException - If the Community could not be accessed, for example if the Object ID is not valid.
XPIllegalAccessException - If the user does not have sufficient access to the Community.

GetRelatedCommununityIDs

public static int[] GetRelatedCommununityIDs(AActivitySpace owner,
                                             int nCommunityID)
Gets the Related Communities for the specified Community as an integer array. Related Communities are Communities in the same administrative folder.

Parameters:
owner - Current Activityspace.
nCommunityID - Object ID for the Community to retrieve Related Communities from.
Returns:
Array of integers with Object IDs of the Related Communities in the specified Community.
Throws:
XPException - If the Community could not be accessed, for example if the Object ID is not valid.
XPIllegalAccessException - If the user does not have sufficient access to the Community.

GetCommunityPagesAsURLs

public static XPArrayList GetCommunityPagesAsURLs(AActivitySpace owner,
                                                  int nCommunityID)
Get Community Pages in the specified Community as a list of IPTURLs. The PTURLConstants.KEY_CURRENTMARKER flag is set on an URL entry if is leading to the current Community Page.

Parameters:
owner - Current Activityspace.
nCommunityID - Object Id of the Communitu to list pages of.
Returns:
A list with Community Pages as IPTURL objects or an empty list of no pages exist.
Throws:
XPIllegalArgumentException - If the user does not have sufficient access to the Community.

GetURLForCommunityKnowledgeDirectory

public static IPTURL GetURLForCommunityKnowledgeDirectory(AActivitySpace owner,
                                                          int nCommunityID)
Gets to URL to the Community Knowledge Directory f0r the current Community. The PTURLConstants.KEY_CURRENTMARKER flag is set on the URL if the current page is a Community Knowledge Directory page.

Parameters:
owner - Current Activityspace
nCommunityID - Object ID of the Community to get pages from.
Returns:
IPTURL with the URL to the Community Knowledge Directory for the specified Community.
Throws:
XPIllegalAccessException - If the user does not have sufficient access to the Community.
See Also:
PTURLConstants

GetRelatedCommununitiesAsURLs

public static XPArrayList GetRelatedCommununitiesAsURLs(AActivitySpace owner,
                                                        int nCommunityID)
Gets URLs to Related Communities for the specified Community in a list of IPTURLs. Related Communities are Communities in the same administrative folder.

Parameters:
owner - Current Activityspace.
nCommunityID - Object ID for the Community to retrieve Related Communities from.
Returns:
XPArrayList with IPTURLs to Related Communities or an empty XPArrayList if none exists.
Throws:
XPIllegalAccessException - If the user does not have sufficient access to the Community.

GetCurrentCommunityName

public static java.lang.String GetCurrentCommunityName(AActivitySpace owner)
                                                throws XPIllegalArgumentException
Gets the Community Name of the current Community.

Parameters:
owner - Current Activityspace.
Returns:
Community Name of the current community or null value if not currently on a Community Page.
Throws:
XPIllegalArgumentException - If the provided AActivityspace is null.

GetCurrentCommunityPageName

public static java.lang.String GetCurrentCommunityPageName(AActivitySpace owner)
                                                    throws XPIllegalArgumentException
Gets the Community Page Name of the current Community Page. If current page is not a Community related page, i.e., Community portlet, Sitemap or Community Gatewaypage page, a null value is returned.

Parameters:
owner - Current Activityspace.
Returns:
Community Page Name of the current community pageor null value if not currently on a Community Page.
Throws:
XPIllegalArgumentException - If the provided AActivityspace is null

GetCurrentCommunityID

public static int GetCurrentCommunityID(AActivitySpace owner)
Gets the Community ID of the current Community. If current page is not a Community page, i.e., Community portlet, Sitemap or Community Gatewaypage page, TaskAPIUICommon.INVALID_OBJECTID is returned.

Parameters:
owner - Current Activityspace
Returns:
Community ID of the current community or TaskAPIUICommon.INVALID_OBJECTID if not in a Community.
Throws:
XPIllegalArgumentException - If the provided AActivityspace is null

GetCurrentCommunityPageID

public static int GetCurrentCommunityPageID(AActivitySpace owner)
                                     throws XPIllegalArgumentException
Gets the current Community Page ID, If current page is not a Community page, the TaskAPIUICommon.INVALID_OBJECTID value is returned.

Parameters:
owner - Current Activityspace.
Returns:
Current Community Page ID or TaskAPIUICommon.INVALID_OBJECTID if not in on Community Page.
Throws:
XPIllegalArgumentException - If the provided AActivityspace is null.

GetCurrentPageAsURL

public static IPTURL GetCurrentPageAsURL(AActivitySpace owner)
                                  throws XPIllegalArgumentException
Gets the current Page as an object of typeIPTURL. Returns

Parameters:
owner - Current Activityspace
Returns:
IPTURL to the current community page or null if the current page is not a community page.
Throws:
XPIllegalArgumentException

GetCurrentSubCommunitiesAsURLs

public static XPArrayList GetCurrentSubCommunitiesAsURLs(AActivitySpace owner)
Gets Subcommunities in the current Community as an XPArrayList with IPTURL entries.

Parameters:
owner - Current Activityspace.
Returns:
Array list with IPTURL of Subcommunities. An empty list is returned if there are no subcommunities exist or not in a Community.
Throws:
XPIllegalAccessException - If the user does not have sufficient access to the Community.

GetURLForUnsubscribeCommunitiesEditor

public static IPTURL GetURLForUnsubscribeCommunitiesEditor(AActivitySpace owner)
Gets the URL to the Unsubscribe from Communities Editor.

Parameters:
owner - Current Activityspace.
Returns:
IPTURL with URL to the Unsubscribe from Communities Editor, or null if the URL is not valid in the current context.
Throws:
XPIllegalAccessException - If the user does not have sufficient access to the Community.

GetURLForCurrentCommunityEditor

public static IPTURL GetURLForCurrentCommunityEditor(AActivitySpace owner)
Gets the URL to the Community Editor for the current Community.

Parameters:
owner - Current Activityspace.
Returns:
IPTURL with URL to the Editor for the current Community, or null if the URL is not valid in the current context.
Throws:
XPIllegalAccessException - If the user does not have sufficient access to the Community.

GetURLForCurrentCommunity

public static XPArrayList GetURLForCurrentCommunity(AActivitySpace owner)
Gets an XPArrayList with a single entry for the URL for the current Community.

Parameters:
owner - Current Activityspace.
Returns:
XPArrayList list containing a single URL to the current Community, or null if the URL is not valid in the current context.
Throws:
XPIllegalAccessException - If the user does not have sufficient access to the Community.

GetURLForAddCommunityPortletsEditor

public static IPTURL GetURLForAddCommunityPortletsEditor(AActivitySpace owner)
Gets the URL to the Community Add Portlets Editor.

Parameters:
owner - Current Activityspace.
Returns:
IPTURL with URL to the Community Add Portlets Editor, or null if the URL is not valid in the current context.
Throws:
XPIllegalAccessException - If the user does not have sufficient access to the Community.

GetURLForAddCommunityPortletsFlyout

public static IPTURL GetURLForAddCommunityPortletsFlyout(AActivitySpace owner)
Gets the URL to the Community Add Portlets Flyout.

Parameters:
owner - Current Activityspace.
Returns:
IPTURL with URL to the Community Add Portlets Flyout, or null if the URL is not valid in the current context.
Throws:
XPIllegalAccessException - If the user does not have sufficient access to the Community.

GetURLForCreateCommunityPage

public static IPTURL GetURLForCreateCommunityPage(AActivitySpace owner)
Gets the URL to the Create Community page in the Community Editor.

Parameters:
owner - Current Activityspace.
Returns:
IPTURL with URL to Create Community Page in the Community Editor, or null if the URL is not valid in the current context.
Throws:
XPIllegalAccessException - If the user does not have sufficient access to the Community.

GetURLForCreateCommunityPageOneClick

public static IPTURL GetURLForCreateCommunityPageOneClick(AActivitySpace owner,
                                                          boolean bInheritTemplate,
                                                          int nPageTemplate)
Gets the URL to the Create Community page in the Community Editor.

Parameters:
owner - Current Activityspace.
Returns:
IPTURL with URL to Create Community Page in the Community Editor, or null if the URL is not valid in the current context.
Throws:
XPIllegalAccessException - If the user does not have sufficient access to the Community.

GetURLForJoinCommunitiesEditor

public static IPTURL GetURLForJoinCommunitiesEditor(AActivitySpace owner)
Gets the URL for the Join Community Editor where users add Communities to their My Communities list.

Parameters:
owner - Current Activityspace.
Returns:
IPTURL with URL to the Join Communities Editor, or null if the URL is not valid in the current context.
Throws:
XPIllegalAccessException - If the user does not have sufficient access to the Community.

GetURLForJoinCommunitiesFlyout

public static IPTURL GetURLForJoinCommunitiesFlyout(AActivitySpace owner)
Gets the URL for the Join Community Editor where users add Communities to their My Communities list.

Parameters:
owner - Current Activityspace.
Returns:
IPTURL with URL to the Join Communities Editor, or null if the URL is not valid in the current context.
Throws:
XPIllegalAccessException - If the user does not have sufficient access to the Community.

GetURLForEditPortletPreferencesEditor

public static IPTURL GetURLForEditPortletPreferencesEditor(AActivitySpace owner)
Gets the URL to the Community Edit Portlet Preferences Editor.

Parameters:
owner - Current Activityspace.
Returns:
IPTURL with URL to the Community Edit Portlet Preferences Editor, or null if the URL is not valid in the current context.
Throws:
XPIllegalAccessException - If the user does not have sufficient access to the Community.

IsUserMemberOfCurrentCommunity

public static boolean IsUserMemberOfCurrentCommunity(AActivitySpace owner)
Checks if the current user is already subscribed to the current Community, i.e. if the current Community is already on the user's My Community list.

Parameters:
owner - Current activityspace.
Returns:
true if current Community is already subscribed by the user, false if not member, or on User profile community or not or if not currently in a Community.
Throws:
XPIllegalAccessException - If the user does not have sufficient access to the Community.

IsCurrentPageCommunityPage

public static boolean IsCurrentPageCommunityPage(AActivitySpace owner)
Checks if the current page is in a Community. Note that this function does NOT check if this is a Community Portlet Page. Use IsCurrentPageMyPortalPage

Parameters:
owner - Current Activityspace.
Returns:
true if the current page is in a Community, false otherwise.
Throws:
XPIllegalAccessException - If the user does not have sufficient access to the Community.

IsCurrentCommunityUserProfileCommunity

public static boolean IsCurrentCommunityUserProfileCommunity(AActivitySpace owner)
Checks if the current Community is the User Profile Community.

Parameters:
owner - Current Activityspace.
Returns:
true if the current Community is the User Profile Community, false otherwise.
Throws:
XPIllegalAccessException - If the user does not have sufficient access to the Community.

IsCurrentUserAbleToEditCurrentCommunityPage

public static boolean IsCurrentUserAbleToEditCurrentCommunityPage(AActivitySpace owner)
Checks if the current user has access (requires EDIT access) to use the Community Editor on the current Community Page.

Parameters:
owner - Current Activityspace.
Returns:
true if the current user has at least EDIT access to the current Community Page, false otherwise.
Throws:
XPIllegalAccessException - If the user does not have sufficient access to the Community.

IsCurrentUserCommunityOwner

public static boolean IsCurrentUserCommunityOwner(AActivitySpace owner)
Checks if the current user is the owner of the current Community. The check only works on Community pages or Community Knowledge directory pages, not in Community editors.

Parameters:
owner - Current Activityspace.
Returns:
true if the current user has at least EDIT access to the current Community, false otherwise.
Throws:
XPIllegalAccessException - If the user does not have sufficient access to the Community.

IsUserAbleToJoinCurrentCommunity

public static boolean IsUserAbleToJoinCurrentCommunity(AActivitySpace owner)
Checks if the current user has at least SELECT access to the current Community. Only works on Community pages or Community Knowledge directory pages, not in Community Editors.

Parameters:
owner - Current Activityspace.
Returns:
true if the current user has at least SELECT access to the current Community, false otherwise.
Throws:
XPIllegalAccessException - If the user does not have sufficient access to the Community.

IsUserAbleToAccessCurrentCommunity

public static boolean IsUserAbleToAccessCurrentCommunity(AActivitySpace owner)
Checks if the current user has at least READ access to the current Community. Only works on Community pages or Community Knowledge directory pages, not in Community editors.

Parameters:
owner - Current Activityspace.
Returns:
true if the current user has at least READ access to the current Community, false otherwise.
Throws:
XPIllegalAccessException - If the user does not have sufficient access to the Community.

IsCurrentPageMyPortalPage

public static boolean IsCurrentPageMyPortalPage(AActivitySpace owner)
Checks if the current page is a Myportal page, i.e. either a MyPage or Community Portlet Page.

Parameters:
owner - Current Activityspace.
Returns:
true if the current page is either a MyPage or Community Page, false otherwise.
Throws:
XPIllegalAccessException - If the user does not have sufficient access to the Community.

GetCommunityActionsAsURLs

public static XPArrayList GetCommunityActionsAsURLs(AActivitySpace owner)
Gets Community Actions as an XPArrayList with IPTURL entries. Most Community actions only display when in an Community and only if a user has access to perform the actions.

Parameters:
owner - Current Activityspace.
Returns:
An XPArrayList with IPTURL entries with Community Actions.
Throws:
XPIllegalAccessException - If the user does not have sufficient access to the Community.

GetCommunityActionsAsURLs

public static XPArrayList GetCommunityActionsAsURLs(AActivitySpace owner,
                                                    boolean bIncludeOneClick,
                                                    boolean bInheritTemplate,
                                                    int nPageTemplate)
Gets Community Actions as an XPArrayList with IPTURL entries. Most Community actions only display when in an Community and only if a user has access to perform the actions.

Parameters:
owner - Current Activityspace.
includeOneClick - Flag to include the "one-click page creation" link
Returns:
An XPArrayList with IPTURL entries with Community Actions.
Throws:
XPIllegalAccessException - If the user does not have sufficient access to the Community.

CreateCommunityCommonOpenerURL

public static IPTURL CreateCommunityCommonOpenerURL(AActivitySpace owner,
                                                    int nCommunityID,
                                                    java.lang.String strCommunityName)
Helper function to create an URL to a specified Community. The PTURLConstants.KEY_CURRENTMARKER flag is set on the URL if is leading to the current Community.

Parameters:
owner - Current Activityspace.
nCommunityID - Object ID of the Community to create an URL to.
strCommunityName - Name of the URL, normally the name of the Community.
Returns:
IPTURL with an URL to the specified Community.
Throws:
XPIllegalAccessException - If the user does not have sufficient access to the Community.

CreateCommunityPageCommonOpenerURL

public static IPTURL CreateCommunityPageCommonOpenerURL(AActivitySpace owner,
                                                        int nCommunityID,
                                                        int nCommunityPageID,
                                                        java.lang.String strCommunityPageName)
Helper function to create an URL to a specified Community Page. The PTURLConstants.KEY_CURRENTMARKER flag is set on the URL if is leading to the current Community Page. In case the page is a profile page, the link generated will be of the viewed profile, not the current user's.

Parameters:
owner - Current Activityspace.
nCommunityID - Object ID of the Community where the Page is located in.
nCommunityPageID - Object ID of the Page to create a URL to.
strCommunityPageName - Title of the URL, normally the name of the Page.
Returns:
IPTURL with an URL to the specified Community Page.
Throws:
XPIllegalArgumentException - If the user does not have sufficient access to the Community.

CreateUserProfilePageCommonOpenerURL

public static IPTURL CreateUserProfilePageCommonOpenerURL(AActivitySpace owner,
                                                          int nProfileUserID,
                                                          java.lang.String sProfileUserName)
Gets an URL to a UserProfile page for the specified user.

Parameters:
owner - Current Activityspace.
nProfileUserID - The Object ID of the user to open the User Profile page for.
sProfileUserName - The name of the user to open the User Profile page for. Also used for the link title.
Returns:
IPTURL with the URL to the user profile page for the specified user.
Throws:
XPIllegalAccessException - If the user does not have sufficient access to the Community.

CreateUserProfilePageCommonOpenerURL

public static IPTURL CreateUserProfilePageCommonOpenerURL(AActivitySpace owner,
                                                          int nProfileUserID,
                                                          java.lang.String sProfileUserName,
                                                          java.lang.String strURLTitle)
Gets an URL to a UserProfile page for the specified user.

Parameters:
owner - Current Activityspace.
nProfileUserID - The Object ID of the user to open the User Profile page for.
sProfileUserName - The name of the user to open the User Profile page for.
strURLTitle - The title of the URL.
Returns:
IPTURL with the URL to the user profile page for the specified user.
Throws:
XPIllegalAccessException - If the user does not have sufficient access to the Community.

CreateUserProfilePageCommonOpenerURL

public static IPTURL CreateUserProfilePageCommonOpenerURL(AActivitySpace owner,
                                                          int nProfileUserID,
                                                          java.lang.String sProfileUserName,
                                                          java.lang.String strURLTitle,
                                                          int nPageId,
                                                          java.lang.String strPageName)
Gets an URL to a UserProfile page for the specified user.

Parameters:
owner - Current Activityspace.
nProfileUserID - The Object ID of the user to open the User Profile page for.
sProfileUserName - The name of the user to open the User Profile page for.
strURLTitle - The title of the URL.
Returns:
IPTURL with the URL to the user profile page for the specified user.
Throws:
XPIllegalAccessException - If the user does not have sufficient access to the Community.

CheckUserAccessLevelToCommunity

public static boolean CheckUserAccessLevelToCommunity(AActivitySpace owner,
                                                      int nAccessLevel,
                                                      int nCommunityID)
Check the if the current user has at least the accesslevel specified to the current community

Parameters:
AccessLevel - to check for. Example: PT_ACCESS_LEVELS.PT_ACCESS_LEVEL_READ or PT_ACCESS_LEVELS.PT_ACCESS_LEVEL_SELECT
nCommunityID - Object ID of the Community to check security of
Returns:
boolean True if the current user has at least the specified accesslevel, false if the user does not have access or there is no current community.
Throws:
XPIllegalAccessException - If the user does not have sufficient access to the Community.
See Also:
PT_ACCESS_LEVELS

CheckUserAccessLevelToCurrentCommunity

public static boolean CheckUserAccessLevelToCurrentCommunity(AActivitySpace owner,
                                                             int nAccessLevel)
Check the if the current user has at least the accesslevel specified to the current community

Parameters:
AccessLevel - to check for. Example: PT_ACCESS_LEVELS.PT_ACCESS_LEVEL_READ or PT_ACCESS_LEVELS.PT_ACCESS_LEVEL_SELECT
Returns:
boolean True if the current user has at least the specified accesslevel, false if the user does not have access or there is no current community.
Throws:
XPIllegalAccessException - If the user does not have sufficient access to the Community.
See Also:
PT_ACCESS_LEVELS

CheckUserAccessLevelToCurrentCommunityPage

public static boolean CheckUserAccessLevelToCurrentCommunityPage(AActivitySpace owner,
                                                                 int nAccessLevel)
Check the if the current user has at least the accesslevel specified to the current community page

Parameters:
AccessLevel - to check for. Example: PT_ACCESS_LEVELS.PT_ACCESS_LEVEL_READ or PT_ACCESS_LEVELS.PT_ACCESS_LEVEL_SELECT
Returns:
boolean True if the current user has at least the specified accesslevel, false if the user does not have access or there is no current community page.
Throws:
XPIllegalAccessException - If the user does not have sufficient access to the Community.
See Also:
PT_ACCESS_LEVELS

GetParentCommunityID

public static int GetParentCommunityID(AActivitySpace owner,
                                       int nCommunityID)
Gets the Object ID of the parent Community in the specified Community. (the Community where the current Community is located in the administrative hierarchy).

Parameters:
owner - Current Activityspace.
nCommunityID - Object ID of the Community to get the parent Community from.
Returns:
Object ID of current parent Community ID, or 0 /code> if non-existant.
Throws:
XPIllegalAccessException - If the user does not have sufficient access to the Community.

GetCurrentParentCommunityID

public static int GetCurrentParentCommunityID(AActivitySpace owner)
Gets the Object ID of the parent Community in the current Community. Parent Community is the Community where the current Community is located in the administrative hierarchy.

Parameters:
owner - Current Activityspace.
Returns:
Object ID of current parent Community ID, or 0 if not currently in a Community or the current Community does not have a parent Community.
Throws:
XPIllegalAccessException - If the user does not have sufficient access to the Community.

GetCurrentRelatedCommununityIDs

public static int[] GetCurrentRelatedCommununityIDs(AActivitySpace owner)
Gets Related Communities (a.k.a. peer Communities) of the current Community as an integer array. Related Communities are Communities located in one Community in the administrative hierarchy.

Parameters:
owner - Current Activityspace.
Returns:
Array with Object IDs of Related Community to the current Community. Empty array if the current Community has no Related communities or if not in a Community.
Throws:
XPIllegalAccessException - If the user does not have sufficient access to the Community.

GetURLForJoinCurrentCommunityAction

public static IPTURL GetURLForJoinCurrentCommunityAction(AActivitySpace owner)
Gets the URL to Join Current Community Action. The URL goes to a page that subscribes the user to the current Community. This URL is only visible on Communities a user is not already member of.

Parameters:
owner - Current Activityspace.
Returns:
IPTURL to join current community or null if the current user is already a member or does not have access to join the current community.
Throws:
XPIllegalAccessException - If the user does not have sufficient access to the Community.

GetURLForUnsubscribeCurrentCommunityAction

public static IPTURL GetURLForUnsubscribeCurrentCommunityAction(AActivitySpace owner)
Gets the URL to Unsubscribe Current Community Action. The URL goes to a page that unsubscribes the user to the current Community. This URL is only visible on Communities a user is not already member of.

Parameters:
owner - Current Activityspace.
Returns:
IPTURL to unsubscribe current community or null if the current user is already not a member or does not have access to unsubscribe the current community.
Throws:
XPIllegalAccessException - If the user does not have sufficient access to the Community.

GetCurrentSubCommunityIDs

public static int[] GetCurrentSubCommunityIDs(AActivitySpace owner)
Gets the Subcommunities of the current Community as a integer array. Subcommunties are Communities located in another Community in the adminstrative hierarchy.

Parameters:
owner - Current Activityspace.
Returns:
An integer array with Object IDs to Subcommunity. Returns an empty array if the current Community has no Subcommunities or not currently in a Community.
Throws:
XPIllegalAccessException - If the user does not have sufficient access to the Community.

GetCurrentCommunityPagesAsURLs

public static XPArrayList GetCurrentCommunityPagesAsURLs(AActivitySpace owner)
Gets the Community Pages of the current Community as an XPArraylist with IPTURL entries.

Parameters:
owner - Current Activityspace.
Returns:
An XPArrayList with IPTURL to CommunityPages, or empty XPArrayList if the current page is not a Community Page or valid Page.
Throws:
XPIllegalAccessException - If the user does not have sufficient access to the Community.

GetCurrentRelatedCommunitiesAsURLs

public static XPArrayList GetCurrentRelatedCommunitiesAsURLs(AActivitySpace owner)
Gets URLs to Related Communities for for the current Community in a list of IPTURLs. Related Communities are Communities in the same administrative folder.

Parameters:
owner - Current Activityspace.
Returns:
XPArrayList with IPTURLs to Related Communities or an empty XPArrayList if none exists.
Throws:
XPIllegalAccessException - If the user does not have sufficient access to the Community.

GetCurrentParentCommunityAsURL

public static IPTURL GetCurrentParentCommunityAsURL(AActivitySpace owner)
Gets the URL to the parent Community of the current Community. Parent Community is the Community where the current Community is located in the administrative hierarchy.

Parameters:
owner - Current Activityspace.
Returns:
IPTURL to current Parent Community or null if no parent Community exists, or if not currently in a Community.
Throws:
XPIllegalAccessException - If the user does not have sufficient access to the Community.

GetParentCommunityAsURL

public static IPTURL GetParentCommunityAsURL(AActivitySpace owner,
                                             int nCommunityID)
Gets the URL to the parent Community of the specified Community. Parent Community is the Community where the current Community is located in the administrative hierarchy.

Parameters:
owner - Current Activityspace.
nCommunityID -
Returns:
IPTURL to current Parent Community or null if no parent Community exists, or if the specified Community is invalid.
Throws:
XPIllegalAccessException - If the user does not have sufficient access to the Community.

GetSubCommununitiesAsURLs

public static XPArrayList GetSubCommununitiesAsURLs(AActivitySpace owner,
                                                    int nCommunityID)
Gets the Subcommunities for the specified Community as a list with IPTURL entries. Subcommunities are Community located below another Community in the administrative hierarchy.

Parameters:
owner - Current Activityspace.
nCommunityID - Object ID for the Community to get Subcommunities from.
Returns:
An XPArrayList with IPTURL entries to Subcommunities, or empty array if the specified Community does no thave any Subcommunities or it is invalid.
Throws:
XPIllegalAccessException - If the user does not have sufficient access to the Community.

GetDefaultCommunityID

public static int GetDefaultCommunityID(AActivitySpace owner)
Gets the default Community ID, the first Community in a user's My Community list.

Parameters:
owner - Current Activityspace.
Returns:
Object ID of the first Community in the current user's My Community list, or -1 if the user is not a member of any communities.
Throws:
XPIllegalAccessException - If the user does not have sufficient access to the Community.

GetMyCommunitiesAsURLs

public static XPArrayList GetMyCommunitiesAsURLs(AActivitySpace owner,
                                                 boolean bUseCachedData)
Gets a user's My Communities list as an XPArrayList with IPTURL entries. The PTURLConstants.KEY_CURRENTMARKER flag is set on an URL entry if is leading to the current Community.

Parameters:
owner - Current Activityspace.
bUseCachedData - Get the current user's mandatory Communities with Tabs from a cache that contains at most 15 minutes old data if true. Will query the database for the mandatory communities if false.
Returns:
XPArrayList with IPTURLs to the current user's My Communities , or null if Communities features is disabled in the current Experience Definition.
Throws:
XPIllegalAccessException - If the user does not have sufficient access to the Community.

GetMyMandatoryCommunitiesWithTabsAsURLs

public static XPArrayList GetMyMandatoryCommunitiesWithTabsAsURLs(AActivitySpace owner,
                                                                  boolean bUseCachedData)
Gets a user's Mandatory with Tab Communities as an XPArrayList with IPTURL entries.

Parameters:
owner - Current Activityspace.
bUseCachedData - Get the current user's mandatory Communities with Tabs from a cache that contains at most 15 minutes old data if true. Will query the database for the mandatory communities if false.
Returns:
XPArrayList with IPTURLs to the current user's mandatory Communities with Tabs, or null if Communities features is disabled in the current Experience Definition.
Throws:
XPIllegalAccessException - If the user does not have sufficient access to the Community.

GetCommunityIDFromPTURL

public static int GetCommunityIDFromPTURL(IPTURL ptURL)
Gets the Community ID from an IPTURL with an URL to a Community or Community Page.

Parameters:
ptURL - IPTURL to a Community or Community Page.
Returns:
The Community ID, or 0 if none is found in the URL.
Throws:
XPIllegalAccessException - If the user does not have sufficient access to the Community.

GetCommunityPageIDFromPTURL

public static int GetCommunityPageIDFromPTURL(IPTURL ptURL)
Gets the Community Page ID from an IPTURL with an URL to a Community Page.

Parameters:
ptURL - IPTURL to a Community Page.
Returns:
The Community Page ID, or 0 if none is found in the URL.
Throws:
XPIllegalAccessException - If the user does not have sufficient access to the Community.



Copyright © 2002,2003,2004,2005 Plumtree Software, Inc., All Rights Reserved.