Showing posts with label Puma. Show all posts
Showing posts with label Puma. Show all posts

What is PUMA and how it works

Few information on What is PUMA and how it works...

* PUMA is Portal User Management Architecture and from developers prespective, it provides an API to get portal user information.

* PUMA is configured by default and if later on you cofigure your portal to LDAP, PUMA automatically starts pointing to LDAP.

*When you use PUMA api to get user information, basically PUMA makes a call to VMM (Virtual Member Manager) and VMM makes an internal call to your datastore( LDAP, AD, etc).

In more detail, VMM first looks into a mapping file, a file in which Portal attributes are mapped to LDAP attributes and this mapping is done automatically at the time of configuring potal to LDAP.

*In addition to above information,
when you create a new portal user using Profile Portlet, you have following attributes by default
User ID:
Password:
Confirm Password:
First Name:
Last Name:
Email:
Preferred language:

other then these attributes, if you want to add additional attributes in the list, then just go to Configure mode the portlet and select attributes that you wish to appear in the list.

PUMA scenarios in WPS

If you are planning to architect portal solutions which includes customizing the existing forms and screens for custom user management ans wants to provide solution based on the needs for individual user management, you need to have study on Portal User Management Architecture in WPS.

Here is an article which talks about Portal User Management Architecture(PUMA) and their scenarios in WPS.

Have a look at PUMA sample scenarios in IBM WebSphere Portal

Anonymously accessing PUMA api



This article explains, how to access user information anonymously using PUMA api.

PUMA(Portal User Management Architecture) API is used to access user information from within IBM WebSphere Portal.

In most of the usecases, we access user information for a logged in user but in some scenarios you might need to accessuser information for anonymous user.

Accessing user information anonymously using PUMA requires certain permission assignment to users and groups of WebSphere Portal.

By assigning anonymous user access to the virtual resources users and user groups, you can access user information anonymously using PUMA api.

here is how you can provide this access permission,

1) Login to portal as Administrator
2) Go to Administration
3) Find to Resource permissions portlet by navigating with Access - > Resource permissions
4) Click on Virtual Resources
5) Find USERS and USER GROUPS
6) Add Anonymous Portal User role for USERS and USER GROUPS.

that's it, you are done.
Now you can access user information anonymously using PUMA API.

Accessing User information from JSR 168 portlet


Accessing a logged in user name in portal using JSR168 is straightforward and it is request.getRemoteUser() but in some cases you might need additional user attributes like
first name, last name, given name etc.

If you want to access such additional users information which is normally stored in coroporate directory in JSR-168 compliant way then use these steps.

First add these entries in

<user-attribute>
<description xml:lang="en">User Given Name</description> <name>user.name.given</name>
</user-attribute>
<user-attribute>
<description xml:lang="en">User Last name</description> <name>user.name.family</name>
</user-attribute>

After that you should be able to access those two attributes in your java code by using code like this

Map userInfo = (Map)request.getAttribute(PortletRequest.USER_INFO);
if(userInfo != null){
String givenName = (String)userInfo.get("user.name.given");
String lastName =(String)userInfo.get("user.name.family");
response.getWriter().println("Hello " + givenName +" " + lastName);
}

At deployment time the portal can map the requested user profile attributes to the supported profile attributes or the portal can ignore the requested attributes.

In some scenarios, you might need to access following information
-Portal group name of user to which he belongs
-All portal groups in portal
-All users for a perticular portal group.
-List of users who belongs to multiple groups....

If this kind of requirement is for IBM WebSphere portal, you can access all these info using PUMA API.