User and group management

 

+

Search Tips   |   Advanced Search

 

The Portal User Management Architecture (PUMA) System programming interface (SPI) provides interfaces for accessing the profiles of a portal User or Group. It is used to find, create, modify and delete users and groups. Also, profile information about the currently logged in user can be retrieved. The User and Group interfaces returned by the SPI inherit the getObjectID() method from the com.ibm.portal.Identifiable interface of the Model SPI. This method is used to obtain the ObjectID that uniquely identifies a resource, in this case a user or group in the portal user registry. The following provider objects are used to access the User and Group objects.

PumaProfile

contains methods that provide read-only access the User and Group attributes and identifiers. We can use this interface to get the User object for the current user.

PumaLocator

contains methods for looking up User and Group objects. We can use this interface to obtain a List of Group objects for all of the groups in which the current user is a member.

PumaController

contains methods for creating and deleting Users and Groups and for modifying the User and Group profiles and membership.
Before the portlet can use these provider objects, it must first retrieve the appropriate home interface, depending on the type of application.

Standard portlet

com.ibm.portal.um.portletservice.PumaHome

IBM portlet

com.ibm.portal.um.portletservice.legacy.PumaHome

Portal application (for example, theme or skin)

com.ibm.portal.um.PumaHome

Examples of how these interfaces are retrieved are provided in the accompanying Javadoc. The following example shows how a standard portlet would obtain the identifier of a User as a String.

PortletServiceHome psh;
try {
   javax.naming.Context ctx = new javax.naming.InitialContext();
   psh = (PortletServiceHome) 
         ctx.lookup("portletservice/com.ibm.portal.um.portletservice.PumaHome");

   if (psh != null)
   {
      PumaHome service = (PumaHome) psh.getPortletService(PumaHome.class);
      PumaProfile pp = service.getProfile(request);
      User user = pp.getCurrentUser();
      String user_objid = pp.getIdentifier(user);
   }
}
catch (PumaException pe)
{
   //... error handling...
} 
catch(javax.naming.NameNotFoundException ex) 
{
   //... error handling...
} 
catch(javax.naming.NamingException ex) 
{
   //... error handling...
}

The PUMA SPI cannot be used with WSRP and remote portlets.

 

Related Information