Interface PortletConfig
-
- All Known Implementing Classes:
GenericPortlet,PortletConfigWrapper
public interface PortletConfigThePortletConfiginterface provides the portlet with its configuration. The configuration holds information about the portlet that is valid for all users. The configuration is retrieved from the portlet definition in the deployment descriptor. The portlet can only read the configuration data.The configuration information contains the portlet name, the portlet initialization parameters, the portlet resource bundle and the portlet application context.
- See Also:
Portlet
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Map<String,String[]>getContainerRuntimeOptions()Returns the container runtime options and values for this portlet.StringgetDefaultNamespace()Returns the default namespace for events and public render parameters.StringgetInitParameter(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 anEnumerationof String objects, or an emptyEnumerationif the portlet has no initialization parameters.PortletContextgetPortletContext()Returns thePortletContextof the portlet application the portlet is in.Enumeration<PortletMode>getPortletModes(String mimeType)Returns anEnumerationof PortletMode objects that are defined for the portlet for the given MIME type.StringgetPortletName()Returns the name of the portlet.Enumeration<QName>getProcessingEventQNames()Returns the QNames of the processing events supported by the portlet as anEnumerationofQNameobjects, or an emptyEnumerationif 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 anEnumerationofStringobjects, or an emptyEnumerationif the portlet has not defined public render parameters.Enumeration<QName>getPublishingEventQNames()Returns the QNames of the publishing events supported by the portlet as anEnumerationofQNameobjects, or an emptyEnumerationif the portlet has not defined any publishing events.ResourceBundlegetResourceBundle(Locale locale)Gets the resource bundle for the given locale based on the resource bundle defined in the deployment descriptor withresource-bundletag or the inlined resources defined in the deployment descriptor.Enumeration<Locale>getSupportedLocales()Returns the locales supported by the portlet as anEnumerationofLocaleobjects, or an emptyEnumerationif the portlet has not defined any supported locales.Enumeration<WindowState>getWindowStates(String mimeType)Returns anEnumerationof WindowState objects that are defined for the portlet for the given MIME type.
-
-
-
Method Detail
-
getPortletName
String getPortletName()
Returns the name of the portlet.The name may be provided via server administration, assigned in the portlet application deployment descriptor with the
portlet-nametag.- Returns:
- the portlet name
-
getPortletContext
PortletContext getPortletContext()
Returns thePortletContextof the portlet application the portlet is in.- Returns:
- a
PortletContextobject, used by the caller to interact with its portlet container - See Also:
PortletContext
-
getResourceBundle
ResourceBundle getResourceBundle(Locale locale)
Gets the resource bundle for the given locale based on the resource bundle defined in the deployment descriptor withresource-bundletag or the inlined resources defined in the deployment descriptor.- Parameters:
locale- the locale for which to retrieve the resource bundle- Returns:
- the resource bundle for the given locale
-
getInitParameter
String getInitParameter(String name)
Returns a String containing the value of the named initialization parameter, or null if the parameter does not exist.- Parameters:
name- aStringspecifying the name of the initialization parameter- Returns:
- a
Stringcontaining the value of the initialization parameter - Throws:
IllegalArgumentException- if name isnull.
-
getInitParameterNames
Enumeration<String> getInitParameterNames()
Returns the names of the portlet initialization parameters as anEnumerationof String objects, or an emptyEnumerationif the portlet has no initialization parameters.- Returns:
- an
EnumerationofStringobjects containing the names of the portlet initialization parameters, or an emptyEnumerationif the portlet has no initialization parameters.
-
getPublicRenderParameterNames
Enumeration<String> getPublicRenderParameterNames()
Returns the names of the public render parameters supported by the portlet as anEnumerationofStringobjects, or an emptyEnumerationif the portlet has not defined public render parameters.Public render parameters are defined in the portlet deployment descriptor with the
supported-public-render-parameterelement.- Returns:
- an
EnumerationofStringobjects containing the names of the public render parameters, or an emptyEnumerationif the portlet has not defined support for any public render parameters in the portlet deployment descriptor. - Since:
- 2.0
-
getDefaultNamespace
String getDefaultNamespace()
Returns the default namespace for events and public render parameters. This namespace is defined in the portlet deployment descriptor with thedefault-namespaceelement.If no default namespace is defined in the portlet deployment descriptor this methods returns the XML default namespace
XMLConstants.NULL_NS_URI.- Returns:
- the default namespace defined in the portlet deployment
descriptor, or
XMLConstants.NULL_NS_URIis non is defined. - Since:
- 2.0
-
getPublishingEventQNames
Enumeration<QName> getPublishingEventQNames()
Returns the QNames of the publishing events supported by the portlet as anEnumerationofQNameobjects, or an emptyEnumerationif the portlet has not defined any publishing events.Publishing events are defined in the portlet deployment descriptor with the
supported-publishing-eventelement.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
nameelement instead of theqnameelement the defined default namespace is added as namespace for the returned QName.- Returns:
- an
EnumerationofQNameobjects containing the names of the publishing events, or an emptyEnumerationif the portlet has not defined any support for publishing events in the deployment descriptor. - Since:
- 2.0
-
getProcessingEventQNames
Enumeration<QName> getProcessingEventQNames()
Returns the QNames of the processing events supported by the portlet as anEnumerationofQNameobjects, or an emptyEnumerationif the portlet has not defined any processing events.Processing events are defined in the portlet deployment descriptor with the
supported-processing-eventelement.If the event was defined using the
nameelement instead of theqnameelement the defined default namespace is added as namespace for the returned QName.- Returns:
- an
EnumerationofQNameobjects containing the names of the processing events, or an emptyEnumerationif the portlet has not defined any support for processing events in the deployment descriptor. - Since:
- 2.0
-
getSupportedLocales
Enumeration<Locale> getSupportedLocales()
Returns the locales supported by the portlet as anEnumerationofLocaleobjects, or an emptyEnumerationif the portlet has not defined any supported locales.Supported locales are defined in the portlet deployment descriptor with the
supported-localeelement.- Returns:
- an
EnumerationofLocaleobjects containing the supported locales, or an emptyEnumerationif the portlet has not defined any supported locales in the deployment descriptor. - Since:
- 2.0
-
getContainerRuntimeOptions
Map<String,String[]> getContainerRuntimeOptions()
Returns the container runtime options and values for this portlet.The portlet can set container runtime options in the
portlet.xmlvia thecontainer-runtime-optionelement 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 theportlet.xmldeployment descriptor.- Returns:
- an immutable
Mapcontaining portlet container runtime options names as keys and the container runtime values as map values, or an emptyMapif no portlet container runtime options are set in theportlet.xmlor 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[]). - Since:
- 2.0
-
getPortletModes
Enumeration<PortletMode> getPortletModes(String mimeType)
Returns anEnumerationof 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, usePortalContext.getSupportedPortletModes()- Parameters:
mimeType- MIME type- Returns:
- an
EnumerationofPortletModeobjects containing the defined and supported portlet modes. - Since:
- 3.0
- See Also:
PortletMode,PortletRequest.isPortletModeAllowed(PortletMode),PortalContext.getSupportedPortletModes()
-
getWindowStates
Enumeration<WindowState> getWindowStates(String mimeType)
Returns anEnumerationof 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, usePortalContext.getSupportedWindowStates().- Parameters:
mimeType- MIME type- Returns:
- an
EnumerationofWindowStateobjects containing the defined and supported window states. - Since:
- 3.0
- See Also:
WindowState,PortletRequest.isWindowStateAllowed(WindowState),PortalContext.getSupportedWindowStates()
-
getPublicRenderParameterDefinitions
Map<String,QName> getPublicRenderParameterDefinitions()
Returns a Map of public render parameter names to their qualified names. The names are the values returned by thegetPublicRenderParameterNames()method. The values are theQNamevalues 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.- Returns:
- an
MapofStringtoQName - Since:
- 3.0
- See Also:
getPublicRenderParameterNames()
-
-