Saturday 22 September 2012

Re-ordering of portal pages in WebSphere Portal Server

WebSphere Portal Server maintains the portal pages in a hierarchy. They are arranged as a tree hierarchy with Content Root as the top. Each node, called content node, in the tree can be a page, a label, or a URL (internal or external). Pages and labels can be created by using out of the box portlet : Manage Pages portlet. 

By default after login, portal server picks the first child in the hierarchy, and if that child is a label (say A) then it fetches the fist child of A. The pages or labels can be reordered either using Manage Pages portlet or XMLAccess scripting interface provided by portal server.

  Re-Ordering using Manage Pages portlet.

 To reorder open the Portal Administration console and click on Manage pages link on left navigation. In manage pages portlet navigate to the page/label to be reordered. Then click on up or down arrow to move the page up or down in hierarchy.

 Re-Ordering pages using XMLAccess.

To use this method the creation of pages needs to be done using XMLAccess tool provided by portal server. Sample XMLs can be located on portal installation directory at following path:
\/docs/xml-samples/

 The position of a content node under a parent node in the hierarchy can be ranked by its ordinal, an integer. The smaller the ordinal, the higher the rank. The display and rendering of the content tree in Portal is according to the page ordinals.

When you add a node, you can specify its ordinal which can take the following values
first: this puts the content-node at the top of the hierarchy;
last: this puts the content-node at the bottom of the hierarchy;
• an integer: this puts the content-node by comparing the ordinals of those currently in the system and inserting it in the proper position;
• an hash mark "#" followed by an integer: this puts the page to the absolute location by counting the top one as 0, the second 1, and so on. Thus, "#12" will put the new content node to the 13th position in the current hierarchy.

Monday 28 May 2012

IBM WebSphere Portlet Factory: IPC Error - EJPKB0991E


WebSphere Portlet Factory: Property Broker Error while IPC - EJPKB0991E

Eventing is a wonderful feature provided by JSR 286 for Inter-portlet Communication. In IBM WebSphere Portlet Factory 6.1.5 onwards, there are 2 builders provided to achieve Inter portlet Communication (JSR 286 way). These builders are:

· Cooperative Portlet Source builder
· Cooperative Portlet Target builder

Cooperative Source builder is added in model which is going to publish the event. Cooperative target builder is added in model which is going to Consume the events.

Apart from using these 2 builders, we need to wire the source and target portlets, so that IBM WPS Property Broker can determine from where to send the event and to whom.

Sometimes a weird error comes whenever we perform inter-portlet communication. The error that comes is:

[5/16/12 14:45:09:043 IST] 0000004c PropertyDispa E com.ibm.wps.propertybroker.dispatch.PropertyDispatcherImpl dispatchSourceEvents EJPKB0991E: The propertybroker encountered a problem finding a communication source with name MyEvent for portlet definition PortletDefinition: com.ibm.wps.datastore.impl.PortletDescriptorImpl@50f73720
objectID: [ObjectIDImpl '3_P3668B1A001P70ITIMHLOS2084', PORTLET_DEFINITION, VP: 0, [Domain: rel], DB: 0000-791883565000847C80ECD2C68AB90088]
created: 1336999629870
lastModified: 1337153197840
portletName: SourcePortlet
isActive: true
expires: null
isShared: null
applicationDescriptorObjectID: [ObjectIDImpl '2_P3668B1A001P70ITIMHLOS2004', PORTLET_APPLICATION_DEFINITION, VP: 0, [Domain: rel], DB: 0000-791883565000847C80ECD2C68AB90080]
defaultLocale: en
servletDescriptorObjectID: [ObjectIDImpl 'V_P3668B1A001P70ITIMHLOS2080', SERVLET_DEFINITION, VP: 0, [Domain: rel], DB: 0000-791883565000847C80ECD2C68AB90008]
wspIsProvided: false
initParameters: {}
localeData: Supported locales=[ar ca cs da de el en es fi fr hr hu it iw ja ko nl no pl pt pt_BR ro ru sk sl sv th tr uk zh zh_TW ] Loaded locales=[en: Source Portlet Title, Source Portlet , Source Portlet Title, null, ]
preferences: {}

The error message states that Property Broker could not find source for MyEvent event. The problem appears because of class files present in /WEB-INF/classes folder in application.

To rectify it delete all the java class present files in /WEB-INF/classes folder, also delete WPF model class files (if present) under genjava directory in /WEB-INF/classes folder. Restart the application after deletion.

Hope this solution helps.

Please post your comments on this article.