Portal offers a filtering feature for Standards Portlets (168/286) that enhances the situation without adding additional logic to the portlet to check for that condition. This filtering feature is based on the existing client side capabilities.
A portlet can define a set of portlet preferences that declare the capabilities the portlet depends on. The portal can then be configured to check those capabilities against the ones provided by the page in two scenarios:
- A runtime filter that displays a message at the place the portlet markup is displayed in case that there is a capabilities mismatch.
- A build-time filter that displays a message in the administration user interface in case a page is saved and to that page a portlet was added, and for that portlet there is a capabilities mismatch.
In scenarios, where portlets are not added to pages in the production environment, disable the feature in the production environment for maximum performance.
The runtime filter can also be used in the remote rendering use case (WSRP), with the restriction that both the consumer and the producer must be of the type WebSphere
Portal. If other consumers exist, disable this function for WSRP. However, this function is independent from the setting for the local rendering use case.
How a page author can use the feature
Depending on the filter settings the page author is notified when saving the page after a modification (Error Codes: EJPNK0022E
) or when the page is rendered (Error Codes: EJPNK0026E
). The messages contain detailed information for each portlet about which capabilities are missing or which of them have the wrong version.
When the page author receives such a message, she needs to change the theme profile that is assigned to the page and assign one that meets all the requirements of the portlets on that page. Often the person in the page author role will not be the one that has the Theme Profile Manager role. Therefore, the Profile Manager needs to provide documentation for each profile that explains its purpose and also lists for each capability provided by the profile the ID and the version. The page author then needs to be educated where the information can be obtained and how to read it.
With this information, the page author can map the information shown in the message to the correct profile and select it.
In order to create the documentation, the profile manager can use the module documentation for the ready-to-use modules. For custom developed modules, the module owner is responsible to provide the documentation as part of this development task and needs to make it available for profile managers.
How a portlet programmer can use the feature
Define two preferences for each capability the portlet depends upon. One preference that describes the ID of the capability and one that defines the minimal value/version in the following format, major.minor.revision:
Preference Name: capability.<sequence-number>.id
Preference Value : <the capability name>
Preference Name: capability.<sequence-number>.minValue
Preference Value: <the capability value>
In addition to the definition of the capabilities, the portlet must define a preference that describes whether the portlet handles the lack of the capabilities itself or not. So in order to delegate the handling of the error case to portal, the preference capabilities.selfManaged
must be set to false.
Portlet can either handle all capability dependencies or none
If this preference is not set, the framework expects that the portlet manages the capability dependencies itself.
For the list of available capabilities, see Modules provided with the WebSphere Portal theme.
Parent topic: The module framework
Modules that are provided with the modularized theme
Configuration settings for capability filters