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 IBM One UI initiative.
Note: These capabilities are provided by theme modules.
If you added client side capabilities to the theme without using theme modules, that is by adding a JavaScript tag that loads a library, but you still want to propagate that information to portlets you can set that information on the theme.
You can define the theme metadata as follows:
  1. Navigate to the following WebDAV URL: http://server_name:WC_default_host/wps/mycontenthandler/dav/themelist/all/theme.name/
  2. Edit metadata.properties as appropriate.
The syntax of a valid entry is as follows: theme.capability.api-key=version.