Skip to main content
Last updated February 02, 2015 12:03, by Martin Scott Nicklous
Feedicon  
=Portlet Config= The PortletConfig object provides the portlet object with information to be used during initialization. It also provides access to the portlet context, default event namespace, public render parameter names, and the resource bundle that provides title-bar resources. ==Initialization Parameters== The getInitParameterNames and getInitParameter methods of the PortletConfig interface return the initialization parameter names and values found in the portlet definition in the deployment descriptor. ==Portlet Resource Bundle== Portlets may specify, in their deployment descriptor definition, some basic information that can be used for the portlet title-bar and for the portal’s categorization of the portlet. The specification defines a few resource elements for these purposes, title, short-title and keywords (see the PLT.25.10 Resource Bundles Section). These resource elements can be directly included in the portlet definition in the deployment descriptor, or they can be placed in a resource bundle. An example of a deployment descriptor defining portlet information inline could be: &lt;portlet&gt; ... &lt;portlet-info&gt; &lt;title&gt;Stock Quote Portlet&lt;/title&gt; &lt;short-title&gt;Stock&lt;/short-title&gt; &lt;keywords&gt;finance,stock market&lt;/keywords&gt; &lt;/portlet-info&gt; ... &lt;/portlet&gt; If the resources are defined in a resource bundle, the portlet must provide the name of the resource bundle. An example of a deployment descriptor defining portlet information in resource bundles could be: &lt;portlet&gt; ... &lt;resource-bundle&gt;com.foo.myApp.QuotePortlet&lt;/resource-bundle&gt; ... &lt;/portlet&gt; If the portlet definition defines a resource bundle, the portlet-container must look up these values in the ResourceBundle. If the root resource bundle does not contain the resources for these values and the values are defined inline, the portlet container must add the inline values as resources of the root resource bundle. If the portlet definition does not define a resource bundle and the information is defined inline in the deployment descriptor, the portlet container must create a ResourceBundle and populate it, with the inline values, using the keys defined in the PLT.25.10 Resource Bundles Section. <span id="PORTLETSPEC3-14" style="background-color: #8f8;">The &lt;portlet-info&gt; and &lt;resource-bundle&gt; elements are optional in the deployment descriptor. If neither are present, the portlet title will not be explicitly defined. In this case, it is left as a portlet container implementation detail to draw on other information, for example on the &lt;portlet-name&gt; or &lt;display-name&gt; values from the portlet descriptor, to define the portlet title.</span> The render method of the GenericPortlet uses the ResourceBundle object of the PortletConfig to retrieve the title of the portlet from the associated ResourceBundle or the inline information in the portlet definition. ==Default Event Namespace== The getDefaultNamespace method of the PortletConfig interface returns the default namespace for events and public render parameters set in the portlet deployment descriptor with the default-namespace element, or the XML default namespace XMLConstants.NULL_NS_URI if no default namespace is provided in the portlet deployment descriptor. ==Public Render Parameter Names== The getPublicRenderParameterNames method of the PortletConfig interface returns the public render parameter names found in the portlet definition in the deployment descriptor with the supported-public-render-parameter element or an empty enumeration if no public render parameters are defined for the current portlet definition. <div id="PORTLETSPEC3-18" style="background-color: #8f8;"> The getPublicRenderParameterDefinitions method returns a Map of the public render parameter names to the corresponding QNames as defined in the deployment descriptor. If a &lt;name&gt; element rather than a &lt;qname&gt; element is specified in the public render parameter definition, the QName returned by this method is built from the default namespace together with the value of the &lt;name&gt; element. </div> ==Publishing Event QNames== The getPublishingEventQNames method of the PortletConfig interface returns the publishing event QNames found in the portlet definition in the deployment descriptor with the supported-publishing-event element or an empty enumeration if no publishing events are defined for the current portlet definition. If the event was defined using the name element instead of the qname element the defined default namespace must be added as namespace for the returned QName. ==Processing Event QNames== The getProcessingEventQNames method of the PortletConfig interface returns the processing event QNames found in the portlet definition in the deployment descriptor with the supported-processing-event element or an empty enumeration if no processing events are defined for the current portlet definition. If the event was defined using the name element instead of the qname element the defined default namespace must be added as namespace for the returned QName. ==Supported Locales== The getSupportedLocales method of the PortletConfig interface returns the supported locales found in the portlet definition in the deployment descriptor with the supported-locale element or an empty enumeration if no supported locales are defined for the current portlet definition. ==Supported Container Runtime Options== The getContainerRuntimeOptions method returns an immutable Map containing portlet application level container runtime options merged with the portlet level container runtime options, containing the names as keys and the container runtime values as map values, or an empty Map if no portlet application level or portlet level container runtime options are set in the portlet.xml or supported by this portlet container. The map returned from getContainerRuntimeOptions will provide the subset the portlet container supports of the options the portlet has specified in the portlet deployment descriptor. The keys in the map are of type String. The values in the map are of type String array. If a container runtime option is set on the portlet application level and on the portlet level with the same name the setting on the portlet level takes precedence and overwrites the one set on the portal application level. See section PLT 10.4 for a list of all predefined container runtime options. <div id="PORTLETSPEC3-18" style="background-color: #8f8;"> ==Portlet Mode== The portlet descriptor allows specification of the portlet modes supported by the portlet. The supported portlet modes may be a subset of the standard portlet modes, and may include custom portlet modes. The getPortletModes method returns an enumeration of the portlet modes defined in the portlet deployment descriptor for the portlet. ==Window State== The portlet descriptor allows specification of the window states supported by the portlet. The supported window states always include the standard window states, and may include custom window states. The getWindowStates method returns an enumeration of the window states defined for the portlet in the deployment descriptor. </div>
 
 
Close
loading
Please Confirm
Close