Migrating to WebSphere Portal 6.1, PUMA API

There are some minor chages related to PUMA. To get the user and group information make these changes,

Usage of class com.ibm.portal.puma.User should be rpelaced with com.ibm.portal.um.User
and

com.ibm.portal.puma.Group should be rpelaced with com.ibm.portal.um.Group

List attributes = new ArrayList();
attributes.add("cn");
//Get User Name

PumaProfile userProfile = pumaHomeSvc.getProfile(PortletRequest);
PumaLocator locator = pumaHomeSvc.getLocator(PortletRequest);
com.ibm.portal.um.User wpUser = (com.ibm.portal.um.User) userProfile.getCurrentUser();

List attribUser = userProfile.getDefinedGroupAttributeDefinitions();
Map userAttributes = userProfile.getAttributes(wpUser,attributes);
String userName = (String) userAttributes.get("cn");

//Get Group
com.ibm.portal.um.Group wpGroup;
List groups = locator.findGroupsByPrincipal(wpUser, false);

for (Iterator i = groups.iterator(); i.hasNext();) {
wpGroup = (com.ibm.portal.um.Group) i.next();
Map groupAttributes = userProfile.getAttributes(wpGroup, attributes);
String groupName = (String) groupAttributes.get("cn");
}


2 comments:

  1. Chandra, had a question for you on the developerworks forums. Do reply when u get a chance.

    ReplyDelete
  2. Hi Chandra,

    I am involved in migrating a WP 5.1 environment to WP 6.1, and the portlets use JSF(1.0), Portlet API on 5.1. I had a few questions as I get started...

    0. Can you point me to some reference links that talk about migration. I am looking for code migration and portlet migration as well.
    1. There are migration guides (redbooks/ whitepapers) that provide a set of steps for the migration, How relevant were they while you carried out your migration.
    2. Regarding code migration, in your blog, you've mentioned the creation of a new portlet project. Did you happen to create a new Portal project as well?

    Hope you get to see this message. Looking forward to seeing your reply.

    Thanks
    Mohan

    ReplyDelete