com.plumtree.taskapi.portalui
Class TaskAPIUIUser

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

public class TaskAPIUIUser
extends java.lang.Object

TaskAPI functions for user related URLs and functions, such as getting personal preferences, getting object ID of current user and checking user access.


Constructor Summary
TaskAPIUIUser()
           
 
Method Summary
static AccessStyles GetAccessStyle(AActivitySpace owner)
          Gets the Access Style for the current user.
static int GetCurrentUserID(AActivitySpace owner)
          Gets the object ID of the current user.
static java.lang.String GetCurrentUserName(AActivitySpace owner)
          Gets the name of the current user.
static XPLocale GetPersonalSettingsLocale(AActivitySpace owner)
          Gets the locale set in user's My Account settings for the current user
static java.lang.Object GetPersonalSettingValue(AActivitySpace owner, java.lang.String sSettingName)
          Call this method to obtain the value of a personal setting.
static IPTURL GetURLForLoginLogoff(AActivitySpace owner)
          Gets the URL for the Login/Logoff link.
static IPTURL GetURLForMyAccountPage(AActivitySpace owner)
          Gets the URL to the My Account settings page, where user's can edit their Portal setttings.
static IPTURL GetURLForMyHome(AActivitySpace owner)
           
static java.lang.String GetWelcomeMessage(AActivitySpace owner)
          This method gets the user's personalized greeting, normally displayed in the Topbar.
static boolean HasAccessToActivityRight(AActivitySpace owner, int nActivityRightID)
          Checks if the current user has access to the specified Activity Right.
static boolean HasAdminLinkAccess(AActivitySpace owner)
          Checks if the link the Administration portal should display or not.
static boolean IsAccessStyleAccessibility(AActivitySpace owner)
          Checks if the Access Style mode for the current user is the Accessibility style.
static boolean IsAccessStyleLowBandwidth(AActivitySpace owner)
          Checks if the Access Style mode for the current user is the Low-bandwidth style.
static boolean IsAccessStyleStandard(AActivitySpace owner)
          Checks if the Access Style mode for the current user is the Standard style.
static boolean IsCurrentUserAdministrator(AActivitySpace owner)
          Checks if the current user is a member of Administrators Group.
static boolean IsCurrentUserGuestUser(AActivitySpace owner)
          Checks if the current user is a guest user.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TaskAPIUIUser

public TaskAPIUIUser()
Method Detail

GetPersonalSettingValue

public static java.lang.Object GetPersonalSettingValue(AActivitySpace owner,
                                                       java.lang.String sSettingName)
Call this method to obtain the value of a personal setting.

This value will be retrieved from the user's web session if possible, otherwise the portal server will be queried.

Parameters:
owner - Current Activityspace.
sSettingName - String name of personal setting as defined in com.plumtree.portaluiinfrastructure.login.PersonalSettingNames, null value if the setting does not exist.
Throws:
XPException - This method will throw an XPException if you do not pass an ISessionManager already containing the correct subSession. The ISessionManager obtained from your Activity Space will contain the correct subsession.
XPIllegalArgumentException - if the provided AActivityspace is null or not valid.
See Also:
PersonalSettingNames

GetPersonalSettingsLocale

public static XPLocale GetPersonalSettingsLocale(AActivitySpace owner)
Gets the locale set in user's My Account settings for the current user

Parameters:
owner - Current Activityspace.
Returns:
XPLocale with the user's locale.
Throws:
XPIllegalArgumentException - if the provided AActivityspace is null or not valid.

IsCurrentUserGuestUser

public static boolean IsCurrentUserGuestUser(AActivitySpace owner)
Checks if the current user is a guest user.

Parameters:
owner - Current Activityspace.
Returns:
true if the current user is a guest user, false otherwise.
Throws:
XPIllegalArgumentException - if the provided AActivityspace is null or not valid.

GetCurrentUserID

public static int GetCurrentUserID(AActivitySpace owner)
Gets the object ID of the current user.

Parameters:
owner - Current Activityspace.
Returns:
Object ID of the current user.
Throws:
XPIllegalArgumentException - if the provided AActivityspace is null or not valid.

GetCurrentUserName

public static java.lang.String GetCurrentUserName(AActivitySpace owner)
Gets the name of the current user.

Parameters:
owner - Current Activityspace.
Returns:
Name of the current user.
Throws:
XPIllegalArgumentException - if the provided AActivityspace is null or not valid.

GetURLForMyHome

public static IPTURL GetURLForMyHome(AActivitySpace owner)
See Also:
TaskAPIUISubPortal.GetURLForMyHome(AActivitySpace)

GetURLForLoginLogoff

public static IPTURL GetURLForLoginLogoff(AActivitySpace owner)
Gets the URL for the Login/Logoff link. Only one link is shown at any one time. The login link appears if the user is not logged in, while the logoff link appears if the user is already logged in.

Parameters:
owner - Current Activityspace.
Returns:
IPTURL with login or logoff URL, or null if the link should not be displayed, for example in Edit Default Profile or Preview Page mode.
Throws:
XPIllegalArgumentException - if the provided AActivityspace is null or not valid.

HasAccessToActivityRight

public static boolean HasAccessToActivityRight(AActivitySpace owner,
                                               int nActivityRightID)
Checks if the current user has access to the specified Activity Right.

Parameters:
owner - Current Activityspace.
nActivityRightID - An Activity Rights ID defined in com.plumtree.server.PT_ACTIVITY_RIGHTS
Returns:
true if the user has access to the Activity Right, false otherwise.
Throws:
XPIllegalArgumentException - if the provided AActivityspace is null or not valid.
See Also:
PT_ACTIVITY_RIGHTS

GetWelcomeMessage

public static java.lang.String GetWelcomeMessage(AActivitySpace owner)
This method gets the user's personalized greeting, normally displayed in the Topbar. E.g. "Hi Administrator"

Parameters:
owner - Current Activityspace.
Returns:
String with the user greeting, or if user greeting cannot be retrieved, a default greeting message.
Throws:
XPIllegalArgumentException - if the provided AActivityspace is null or not valid.

IsCurrentUserAdministrator

public static boolean IsCurrentUserAdministrator(AActivitySpace owner)
Checks if the current user is a member of Administrators Group.

Parameters:
owner - Current Activityspace.
Returns:
true if the current user is a member of the Administrators Group, false otherwise.

HasAdminLinkAccess

public static boolean HasAdminLinkAccess(AActivitySpace owner)
Checks if the link the Administration portal should display or not. The link is displayed in STANDARD mode and only on non-Preview pages.

Parameters:
owner - Current Activityspace.
Returns:
true if the link to Administration Portal should be displayed, false otherwise.
Throws:
XPIllegalArgumentException - if the provided AActivityspace is null or not valid.

GetAccessStyle

public static AccessStyles GetAccessStyle(AActivitySpace owner)
Gets the Access Style for the current user. The constants for the supported access styles, Standard, Low-bandwidth and Accessibility, are defined in AccessStyles.

Parameters:
owner - Current Activityspace.
Returns:
An AccessStyles constant with the current Access Style mode.
Throws:
XPIllegalArgumentException - if the provided AActivityspace is null or not valid.
See Also:
AccessStyles

IsAccessStyleStandard

public static boolean IsAccessStyleStandard(AActivitySpace owner)
Checks if the Access Style mode for the current user is the Standard style.

Parameters:
owner - Current Activityspace.
Returns:
true if the Access Style for the current user is set to AccessStyles.STANDARD
Throws:
XPIllegalArgumentException - if the provided AActivityspace is null or not valid.
See Also:
AccessStyles

IsAccessStyleAccessibility

public static boolean IsAccessStyleAccessibility(AActivitySpace owner)
Checks if the Access Style mode for the current user is the Accessibility style.

Parameters:
owner - Current Activityspace.
Returns:
true if the Access Style for the current user is set to AccessStyles.SECTION_508
Throws:
XPIllegalArgumentException - if the provided AActivityspace is null or not valid.
See Also:
AccessStyles

IsAccessStyleLowBandwidth

public static boolean IsAccessStyleLowBandwidth(AActivitySpace owner)
Checks if the Access Style mode for the current user is the Low-bandwidth style.

Parameters:
owner - Current Activityspace.
Returns:
true if the Access Style for the current user is set to AccessStyles.LOW_BANDWIDTH
Throws:
XPIllegalArgumentException - if the provided AActivityspace is null or not valid.
See Also:
AccessStyles

GetURLForMyAccountPage

public static IPTURL GetURLForMyAccountPage(AActivitySpace owner)
Gets the URL to the My Account settings page, where user's can edit their Portal setttings.

Parameters:
owner - Current Activity space.
Returns:
IPTURL with the URL to user's My Account settings page, or null value if the URL is not applicable for the current user or page.
Throws:
XPIllegalArgumentException - if the provided AActivityspace is null or not valid.



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