Determine which client side APIs the current portal page provides
At any time during portlet request processing, a portlet can query on the server side which client side APIs are available in the theme of the current page.To obtain this information, use the portlet request attribute com.ibm.portal.theme.client.capabilities. This works both for standard portlets and for IBM portlets. Example code snippet:
Map<String, String> themeClientCapabilities = (Map<String, String>) request.getAttribute("com.ibm.portal.theme.client.capabilities"); String dojoVersion = themeClientCapabilities.get("dojo");As the sample shows, the returned object is a java.util.Map with String keys and String values. A value is always a version number of the format major.minor.revision, where the revision information is optional. The following list shows the predefined keys and their meaning:
dojo
The version of the Dojo Toolkit.
iwidget
The version of the iWidget API. The portal sets the version only if the portlet is currently rendered as iWidget in client side mode.
mashups.enabler
The version of the Enabler API of Lotus Mashups.
oneUI
The version of the IBM One UI initiative.
You can override and extend these API key and version pairs by editing the metadata of the current theme. To perform this task, do the following:
- Navigate to the following WebDAV URL: http://server_name:WC_default_host/wps/mycontenthandler/dav/themelist/all/theme.name/
- Edit metadata.properties as appropriate.
The syntax of a valid entry is as follows: theme.capability.api-key=version. For example, for DOJO, use an entry as follows: theme.capability.dojo=1.4.3
December 14, 2011
Apr 1, 2011 1:26:17 PM
});