com.bea.apps.groupspace.profile
Class UserProfileManager

java.lang.Object
  extended by com.bea.apps.groupspace.profile.UserProfileManager

public class UserProfileManager
extends Object

Defines interaction with user profile data, taking into account unified user profile integration.


Method Summary
 String getDisplayName(HttpServletRequest request)
          Returns the display name defined by the displayNameFormat property for the user that is currently logged in.
static UserProfileManager getInstance(HttpServletRequest request)
          Returns an instance of UserProfileManager based on the locale defined in the HttpServletRequest.
 com.bea.apps.groupspace.profile.UserProfileConfig getProfileConfig(String propertyName)
          Returns the associated configuration for the specified property name.
 String getProfileValue(ProfileWrapper pw, String propertyName)
          Retrieves a user property set based on the provided ProfileWrapper.
 String getProfileValue(String username, String propertyName)
          Returns the user profile value specified by propertyName for a a user in the current security domain.
 String[] getPropertyNames()
          Returns the array of property names defined in the defaultprofile.properties in the order as they appear in the userProfile.supportedProperties property.
 void setProfileValue(HttpServletRequest request, String propertyName, String propertyValue)
          Sets the user profile value specified by propertyName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static UserProfileManager getInstance(HttpServletRequest request)
Returns an instance of UserProfileManager based on the locale defined in the HttpServletRequest.

Parameters
request - HttpServletRequest - Required
Returns
Localized version of the UserProfileManager

getProfileConfig

public com.bea.apps.groupspace.profile.UserProfileConfig getProfileConfig(String propertyName)
Returns the associated configuration for the specified property name.

This method must coincide with one of the properties defined by userProfile.supportedProperties, separated by comma.

Parameters
propertyName - The name of the property as specified by the userProfile.supportedProperties.
Returns
the associated UserProfileConfig, or null if the property does not exist.

getDisplayName

public String getDisplayName(HttpServletRequest request)
                      throws RemoteException,
                             ProfileNotFoundException
Returns the display name defined by the displayNameFormat property for the user that is currently logged in.

Parameters
request - The current HttpServletRequest
Returns
The derived display name, or null if none of the display name properties contain values.
Throws
ProfileNotFoundException - If the user profile cannot be found
RemoteException - If the ejb is not available

getProfileValue

public String getProfileValue(String username,
                              String propertyName)
                       throws IllegalArgumentException,
                              RemoteException,
                              ProfileNotFoundException
Returns the user profile value specified by propertyName for a a user in the current security domain.

This method must coincide with one of the properties defined by userProfile.supportedProperties, separated by comma.

Parameters
username - The domain username of the user you wish to retrieve the property of.
propertyName - The name of the property as specified by the userProfile.supportedProperties.
Returns
The user profile value defined by propertyName
Throws
IllegalArgumentException - if the specified propertyName does not exist or is misconfigured.
ProfileNotFoundException - If the user profile cannot be found
RemoteException - If the ejb is not available

setProfileValue

public void setProfileValue(HttpServletRequest request,
                            String propertyName,
                            String propertyValue)
                     throws PropertyValidationException,
                            RemoteException,
                            ProfileNotFoundException
Sets the user profile value specified by propertyName

This method must coincide with one of the properties defined by userProfile.supportedProperties, separated by comma.

Parameters
request - The current HttpServletRequest
propertyName - The name of the property as specified by the userProfile.supportedProperties.
propertyValue - The new value of the property.
Throws
ProfileNotFoundException
RemoteException
PropertyValidationException
IllegalArgumentException - if the specified propertyName does not exist or is misconfigured.

getPropertyNames

public String[] getPropertyNames()
Returns the array of property names defined in the defaultprofile.properties in the order as they appear in the userProfile.supportedProperties property.

Returns
The array of property names.

getProfileValue

public String getProfileValue(ProfileWrapper pw,
                              String propertyName)
                       throws IllegalArgumentException,
                              RemoteException,
                              ProfileNotFoundException
Retrieves a user property set based on the provided ProfileWrapper.

Using this method, the caller is responsible for retrieving the ProfileWrapper through their own means.

Parameters
pw - The caller's ProfileWrapper.
propertyName - The user profile configured property to retrieve.
Returns
The configured user property value, or null if the property is not set.
Throws
IllegalArgumentException
RemoteException
ProfileNotFoundException


Copyright © 2006 BEA Systems, Inc. All Rights Reserved