Determining 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. The set of capabilities combines all capabilities from the theme modules used for the current page and the capabilities set as theme meta data.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 One UI initiative.
These capabilities are provided by theme modules. If we added client side capabilities to the theme without using theme moduleso that is by adding a JavaScript tag that loads a library, but you still want to propagato that information to portlets we can sethat information on the theme.
We can define the theme metadata as follows:
The syntax of a valid entry is as follows: theme.capability.api-key=version.
- Navigate to the following WebDAV URL: http://server:WC_default_host/wps/mycontenthandler/dav/themelist/all/theme.name/
- Edit metadata.properties as appropriate.
Parent: Interaction between widgets and portlets by shared render parameters
Related:http://www.dojotoolkit.org/ - Dojo Toolkit
http://www-01.ibm.com/software/info/mashup-center/ - IBM Mashup Center