public class PortletConfigWrapper extends Object implements PortletConfig
PortletConfigWrapper provides a convenient
implementation of the PortletConfig interface
that can be subclassed by developers.
This class implements the Wrapper or Decorator pattern.
Methods default to calling through to the wrapped request object.
| Modifier and Type | Field and Description |
|---|---|
protected PortletConfig |
wrapped |
| Constructor and Description |
|---|
PortletConfigWrapper(PortletConfig wrapped) |
| Modifier and Type | Method and Description |
|---|---|
Map<String,String[]> |
getContainerRuntimeOptions()
Returns the container runtime options
and values for this portlet.
|
String |
getDefaultNamespace()
Returns the default namespace for events and public render parameters.
|
String |
getInitParameter(String name)
Returns a String containing the value of the named initialization parameter,
or null if the parameter does not exist.
|
Enumeration<String> |
getInitParameterNames()
Returns the names of the portlet initialization parameters as an
Enumeration of String objects, or an empty Enumeration if the
portlet has no initialization parameters. |
PortletContext |
getPortletContext()
Returns the
PortletContext of the portlet application
the portlet is in. |
Enumeration<PortletMode> |
getPortletModes(String mimeType)
Returns an
Enumeration of PortletMode objects that are defined
for the portlet for the given MIME type. |
String |
getPortletName()
Returns the name of the portlet.
|
Enumeration<QName> |
getProcessingEventQNames()
Returns the QNames of the processing events supported by the portlet
as an
Enumeration of QName objects,
or an empty Enumeration if the
portlet has not defined any processing events. |
Map<String,QName> |
getPublicRenderParameterDefinitions()
Returns a Map of public render parameter names to their qualified names.
|
Enumeration<String> |
getPublicRenderParameterNames()
Returns the names of the public render parameters supported by the portlet
as an
Enumeration of String objects,
or an empty Enumeration if the
portlet has not defined public render parameters. |
Enumeration<QName> |
getPublishingEventQNames()
Returns the QNames of the publishing events supported by the portlet
as an
Enumeration of QName objects,
or an empty Enumeration if the
portlet has not defined any publishing events. |
ResourceBundle |
getResourceBundle(Locale locale)
Gets the resource bundle for the given locale based on the
resource bundle defined in the deployment descriptor
with
resource-bundle tag or the inlined resources
defined in the deployment descriptor. |
Enumeration<Locale> |
getSupportedLocales()
Returns the locales supported by the portlet
as an
Enumeration of Locale objects,
or an empty Enumeration if the
portlet has not defined any supported locales. |
Enumeration<WindowState> |
getWindowStates(String mimeType)
Returns an
Enumeration of WindowState objects that are defined
for the portlet for the given MIME type. |
PortletConfig |
getWrapped()
Gets the wrapped object.
|
void |
setWrapped(PortletConfig wrapped)
Sets the wrapped object.
|
protected PortletConfig wrapped
public PortletConfigWrapper(PortletConfig wrapped)
public PortletConfig getWrapped()
public void setWrapped(PortletConfig wrapped)
wrapped - the wrapped object to set.IllegalArgumentException - if the request is null.public String getPortletName()
PortletConfig
The name may be provided via server administration, assigned in the
portlet application deployment descriptor with the portlet-name
tag.
getPortletName in interface PortletConfigpublic PortletContext getPortletContext()
PortletConfigPortletContext of the portlet application
the portlet is in.getPortletContext in interface PortletConfigPortletContext object, used by the
caller to interact with its portlet containerPortletContextpublic ResourceBundle getResourceBundle(Locale locale)
PortletConfigresource-bundle tag or the inlined resources
defined in the deployment descriptor.getResourceBundle in interface PortletConfiglocale - the locale for which to retrieve the resource bundlepublic String getInitParameter(String name)
PortletConfiggetInitParameter in interface PortletConfigname - a String specifying the name
of the initialization parameterString containing the value
of the initialization parameterpublic Enumeration<String> getInitParameterNames()
PortletConfigEnumeration of String objects, or an empty Enumeration if the
portlet has no initialization parameters.getInitParameterNames in interface PortletConfigEnumeration of String
objects containing the names of the portlet
initialization parameters, or an empty Enumeration if the
portlet has no initialization parameters.public Enumeration<String> getPublicRenderParameterNames()
PortletConfigEnumeration of String objects,
or an empty Enumeration if the
portlet has not defined public render parameters.
Public render parameters are defined in the portlet deployment descriptor
with the supported-public-render-parameter element.
getPublicRenderParameterNames in interface PortletConfigEnumeration of String
objects containing the names of the public
render parameters, or an empty Enumeration if the
portlet has not defined support for any public render parameters
in the portlet deployment descriptor.public String getDefaultNamespace()
PortletConfigdefault-namespace element.
If no default namespace is defined in the portlet deployment
descriptor this methods returns the XML default namespace
XMLConstants.NULL_NS_URI.
getDefaultNamespace in interface PortletConfigXMLConstants.NULL_NS_URI is non is
defined.public Enumeration<QName> getPublishingEventQNames()
PortletConfigEnumeration of QName objects,
or an empty Enumeration if the
portlet has not defined any publishing events.
Publishing events are defined in the portlet deployment descriptor
with the supported-publishing-event element.
Note that this call does not return any events published that have not been declared in the deployment descriptor as supported.
If the event was defined using the name element instead of
the qname element the defined default namespace
is added as namespace for the returned QName.
getPublishingEventQNames in interface PortletConfigEnumeration of QName
objects containing the names of the publishing events,
or an empty Enumeration if the
portlet has not defined any support for publishing events in
the deployment descriptor.public Enumeration<QName> getProcessingEventQNames()
PortletConfigEnumeration of QName objects,
or an empty Enumeration if the
portlet has not defined any processing events.
Processing events are defined in the portlet deployment descriptor
with the supported-processing-event element.
If the event was defined using the name element instead of
the qname element the defined default namespace
is added as namespace for the returned QName.
getProcessingEventQNames in interface PortletConfigEnumeration of QName
objects containing the names of the processing events,
or an empty Enumeration if the
portlet has not defined any support for processing events in
the deployment descriptor.public Enumeration<Locale> getSupportedLocales()
PortletConfigEnumeration of Locale objects,
or an empty Enumeration if the
portlet has not defined any supported locales.
Supported locales are defined in the portlet deployment descriptor
with the supported-locale element.
getSupportedLocales in interface PortletConfigEnumeration of Locale
objects containing the supported locales,
or an empty Enumeration if the
portlet has not defined any supported locales in
the deployment descriptor.public Map<String,String[]> getContainerRuntimeOptions()
PortletConfig
The portlet can set container runtime
options in the portlet.xml via the
container-runtime-option element with a name and a
value on the application and portlet level.
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.
The map returned from this method will provide the subset the
portlet container supports of the options the portlet has specified
in the portlet.xml. Options that the portlet container
does not support will not be returned in this map.
The map will contain name of the runtime option as key of type String
and the runtime options as values of type String array (String[])
with the values specified in the portlet.xml deployment descriptor.
getContainerRuntimeOptions in interface PortletConfigMap containing portlet
container runtime options names as keys and the
container runtime values as map values, or an empty Map
if no portlet container runtime options are set
in the portlet.xml or supported by this portlet container.
The keys in the map are of type String. The values in the map are of type
String array (String[]).public Enumeration<PortletMode> getPortletModes(String mimeType)
PortletConfigEnumeration of PortletMode objects that are defined
for the portlet for the given MIME type.
Note that a supported portlet mode may not be allowed in all situations
due to security or other reasons. To
determine whether a portlet mode is allowed during a request, use the
PortletRequest.isPortletModeAllowed(PortletMode) method.
To determine which portlet modes are supported by the portal, use
PortalContext.getSupportedPortletModes()
getPortletModes in interface PortletConfigmimeType - MIME typeEnumeration of PortletMode
objects containing the defined and supported portlet modes.PortletMode,
PortletRequest.isPortletModeAllowed(PortletMode),
PortalContext.getSupportedPortletModes()public Enumeration<WindowState> getWindowStates(String mimeType)
PortletConfigEnumeration of WindowState objects that are defined
for the portlet for the given MIME type.
Note that a supported window state may not be allowed in all situations
due to security or other reasons. To
determine whether a window state is allowed during a request, use the
PortletRequest.isWindowStateAllowed(WindowState) method.
To determine which window states are supported by the portal, use
PortalContext.getSupportedWindowStates().
getWindowStates in interface PortletConfigmimeType - MIME typeEnumeration of WindowState
objects containing the defined and supported window states.WindowState,
PortletRequest.isWindowStateAllowed(WindowState),
PortalContext.getSupportedWindowStates()public Map<String,QName> getPublicRenderParameterDefinitions()
PortletConfigPortletConfig.getPublicRenderParameterNames() method.
The values are the QName values associated with the public
render parameter.
If the public render parameter is specified in the portlet descriptor
using the <.name>. tag rather than the
<.qname>. tag, the QName is built from the default namespace
from the deployment descriptor
together with the value from the <.name>. tag.
getPublicRenderParameterDefinitions in interface PortletConfigMap of String to QNamePortletConfig.getPublicRenderParameterNames()Java Portlet 3.0 API Specification. See the Copyright and License provided with this distribution. Use is subject to license terms.