Control
Control to access and modify the user profile. The methods all use the ProfileWrapper as the object for which the profile will be associated. This control is deprecated as of Portal 8.1.x. It may only be used with the older UserManagerControl (which has also been deprecated).
As of 8.1 SP3, pleaseuse the UserProviderControl and GroupProviderControl in conjunction with ProfileControl and PropertyControl.
This control is backed by three EJBs, all of which must be deployed into this application. Those EJBs are:
Using ProfileWrapper, as opposed to the user name, allows the default properties to be retrieved, if they are set. The ProfileWrapper is available in every Session, regardless of wheter the user is registered. In addition to the username, it also provides APIs for determining the user type (eg, registered, anonymous, or tracked).
Support to retrieve profile information is provided in the event that the HttpSession cannot be obtained. For example, JWS currently provides no means to get the HttpSession object. In this case, you may create the ProfileWrapper by using the ProfileFactory.
Using EntityPropertyCache as the container for the returned properties, as opposed to a Map, makes it clear to the user how the properties should be extracted from the cache. The EntityPropertyCache stores properties as a HashMap of PropertySetKey/propertyValue, where PropertySetKey is the propertySet/propertyName pair.
You may get the backing HashMap of the EntityPropertyCache by calling its getMap() method, then step through it as follows:
if ( ! cache.isEmpty()) { Iterator = cache.getMap().entrySet().iterator(); while ( iter.hasNext()) { Map.Entry entry = (Map.Entry)iter.next(); PropertyMapKey pmKey = (PropertyMapKey)entry.getKey(); String propertySetName = pmKey.getPropertySetName(); String propertyName = pmKey.getPropertyName(); Object value = entry.getValue(); } }
Related Topics
SessionHelper
PropertyMapKey
EntityPropertyCache
ProfileWrapper
ProfileFactory
Control
, Control
, Serializable
Method Summary |
public |
|
public |
|
public |
|
public |
|
public |
|
public |
|
public |
|
public |
|
public |
|
public |
|
public void |
|
public void |
|
public boolean |
|
public boolean |
|
Method Detail |
DEPRECATED as of Portal 8.1 Use ProfileControl.getUserProfileManager().getAllProfileNames() or Use ProfileControl.getGroupProfileManager().getAllProfileNames()
publicGet a list of all the profile names in the databaseString
[] getAllProfileNames()
throwsP13nControlException
P13nControlException
DEPRECATED as of Portal 8.1 Use ProfileControl.getProfile(username, groupname)
publicCreate a ProfileWrapper for the given username and groupname. Access the user's profile and use the provided groupname as an explicit successor when calling the ProfileManager.ProfileWrapper
getProfile(String
username,String
groupname)
throwsP13nControlException
P13nControlException
DEPRECATED as of Portal 8.1 Use ProfileControl.getProfileForGroup(groupname)
publicCreate a ProfileWrapper for the given usernameProfileWrapper
getProfileForGroup(String
groupname)
throwsP13nControlException
P13nControlException
DEPRECATED as of Portal 8.1 Use ProfileControl.getProfileForUser(username)
publicCreate a ProfileWrapper for the given username, with no default explicit successor.ProfileWrapper
getProfileForUser(String
username)
throwsP13nControlException
P13nControlException
DEPRECATED as of Portal 8.1 Use ProfileControl.getProfileFromRequest(request)
publicGet the existing ProfileWrapper from the request, or return null if none exists.ProfileWrapper
getProfileFromRequest(HttpServletRequest
request)
throwsP13nControlException
P13nControlException
DEPRECATED as of Portal 8.1 Use ProfileControl.getProperties(profileName)
publicGet all properties for this profile, and return as an EntityPropertyCache. Use this API when you have access to the HttpSession; eg, in Page Groups and JSP.EntityPropertyCache
getProperties(ProfileWrapper
pw)
throwsP13nControlException
P13nControlException
DEPRECATED as of Portal 8.1 Use ProfileControl.getProfileManager().getProperties(profileName, propertyMapKeys)
publicGet all properties that match the set of PropertyMapKeys for this profile A PropertyMapKey is a 'propertySet/propertyName' pair. Use this API when you have access to the HttpSession; eg, in Page Groups and JSP.EntityPropertyCache
getPropertiesFromKeys(ProfileWrapper
pw,Set
propertyMapKeys)
throwsP13nControlException
String propertySet = "BogusProperties"
String propertyName = "ColorPreference"
PropertyMapKey pmk = new PropertyMapKeyImpl(propertySet, propertyName);
Set set = new HashSet();
set.add(pmk);
P13nControlException
DEPRECATED as of Portal 8.1 Use ProfileControl.getProfileManager().getProperties(profileName, propertySetName)
publicEntityPropertyCache
getPropertiesFromSet(ProfileWrapper
pw,String
propertySetName)
throwsP13nControlException
P13nControlException
DEPRECATED as of Portal 8.1 Use ProfileControl.getProfileManager().getProperty(profileName, propertySet, property)
publicGet an individual property.Object
getProperty(ProfileWrapper
pw,String
propertySet,String
property)
throwsP13nControlException
P13nControlException
DEPRECATED as of Portal 8.1 Use UserProviderControl.getUserNames(searchExpression, limit)
publicGet a list of all user namesList
getUserNames(String
searchExpression, int limit)
throwsP13nControlException
P13nControlException
DEPRECATED as of Portal 8.1 Use multiple invocations of ProfileControl.setProperty(profileName, propertySet, property, value)
public void setProperties(Set properties in this EntityPropertyCache back into the user's profile.ProfileWrapper
pw,EntityPropertyCache
cache)
throwsP13nControlException
P13nControlException
DEPRECATED as of Portal 8.1 Use ProfileControl.setProperty(profileName, propertySet, property, value)
public void setProperty(Set an individual property.ProfileWrapper
pw,String
propertySet,String
property,Object
value)
throwsP13nControlException
P13nControlException
DEPRECATED as of Portal 8.1 Use UserProviderControl.userExists(username)
public boolean userExists(Determine whether a user existsString
username)
throwsP13nControlException
P13nControlException
DEPRECATED as of Portal 8.1 Use ProfileControl.getUserProfileManager().profileExists(username)
public boolean userProfileExists(Determine whether a user profile existsString
username)
throwsP13nControlException
P13nControlException