Friday, March 28, 2008

Customizing IBM WebSphere V5.1 Page Administration

Have you ever tried customizing the administration pages of IBM WebSphere Portal V5.1 ? If yes you may find this article interesting to you. If you don't then try it out and come back to this page you will find it valuable :)

I recently got a customer requirement where the portal page needs to be customized similar to my.yahoo.com personalization feature. I have tried this idea before and I could not find any solution but now my customer is demanding it so we need a solution. One of the interesting fact I found was IBM Portal Server does not provide enough documentation and guidelines for how to achieve this customization. The only information we can find out is that there is a "customlayout" portlet available and you can customize the user interface for that portlet. But it is not flexible enough to meet the requirements for two reasons.

1. if you are customizing "customlayout" portlet then you will be actually modifying the user interface of the admin pages already provided and it will affect all virtual portal users as well. you cannot customize it specifically for a virtual portal.

2. customer requirement is that from the page the user should be able to launch the customized admin page for adding portlet to the page. this cannot be possible without going through the administration pages.

With this assumption and limitations I thought of writing a portlet that can be used to add portlets to the page on the desired container. I got some documentation on the service programming API from IBM web site with some code samples for getting the layout of the pages and portlets added to a given page. with that Information and using the services provided by portal server I was able to create the portlet that will do the desired functionality. If any body wanted to try it out I am leaving the below notes that might be helpful.

1. SPI API docs will be available at your \PortalServer\doc\Javadoc\spi_docs folder.
2. the portal server "shared/app/config/services/ProtletServiceRegistryService.properties" file list out all the services available in portal server.
3. Use the LayoutModel object to get the layout of a given page.
4. use ContentModel service to get the layout model of a given page from PortletRequest and PortletResponse.
5. the JNDI lookup name for the services in general follow the naming convention "portal:service/model/". e.g "portal:service/model/ContentModel".
6. To retrieve the ContentPage object for the current page use "NavigationSelectionModel" service API.
7. To add portlet to a page use "AddPortletListCommand" interface which will be available in shared/app/wp.engine.cmd.jar [ you will need to pass the layout container id and portlet id to this object and this information you can get it using the above Service API]

If you need further information on this email me at kumarsajith@google.com - Have a nice day.

No comments: