You can create the helper classes PortletWCMContextHelper
from the sample code that is provided here to programmatically determine the current web content context. The context indicates a content item or site area that is rendered by a web content viewer.
These helper classes are not provided by default with IBM
® Web Content Manager. Example code is provided here that you can take and use to implement the classes yourself.
The helper classes can be used by custom themes or custom portlets that need to render information that is related to the current context.
The web content viewer determines the context to be rendered by evaluating several conditions in the following order:
- Private render parameter
- path-info parameter
- Public render parameter
- Portlet configuration setting for the web content viewer
- Web content association defined for the page
The viewer evaluates each condition in turn until it finds a valid context. As soon as the viewer finds a context, remaining conditions are not evaluated.
Private render parameters and portlet configuration settings are visible only to the web content viewer. However, path-info
parameters, public render parameters, and content associations are visible to all portlets on a page and to portal code (for example, in a theme).
PortletWCMContextHelperParent topic: Developing
Use the PortletWCMContextHelper
class to determine the web content context from within a portlet.
Use the PortalWCMContextHelper
class to determine the web content context from within portal code, such as a theme.
helper class is an abstract class that is used by the PortalWCMContextHelper
class and the PortletWCMContextHelper