Skip navigation links
javax.portlet

Class GenericPortlet

Parameters:
request - the render request
response - the render response
Throws:
PortletException - if the portlet cannot fulfilling the request
UnavailableException - if the portlet is unavailable to perform render at this time
PortletSecurityException - if the portlet cannot fullfill this request because of security reasons
IOException - if the streaming causes an I/O problem
See Also:
doView(RenderRequest, RenderResponse), doEdit(RenderRequest, RenderResponse), doHelp(RenderRequest, RenderResponse)
  • getPortletConfig

    public PortletConfig getPortletConfig()
    Returns the PortletConfig object of this portlet.
    Returns:
    the PortletConfig object of this portlet
  • destroy

    public void destroy()
    Called by the portlet container to indicate to a portlet that the portlet is being taken out of service.

    The default implementation does nothing.

    Specified by:
    destroy in interface Portlet
  • getResourceBundle

    public 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.
    Specified by:
    getResourceBundle in interface PortletConfig
    Parameters:
    locale - the locale for which to retrieve the resource bundle
    Returns:
    the resource bundle for the given locale
  • getInitParameter

    public String getInitParameter(String name)
    Returns a String containing the value of the named initialization * parameter, or null if the parameter does not exist.
    Specified by:
    getInitParameter in interface PortletConfig
    Parameters:
    name - a String specifying the name of the initialization parameter
    Returns:
    a String containing the value of the initialization parameter
    Throws:
    IllegalArgumentException - if name is null.
  • getInitParameterNames

    public 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.
    Specified by:
    getInitParameterNames in interface PortletConfig
    Returns:
    an Enumeration of String objects containing the names of the portlet initialization parameters, or an empty Enumeration if the portlet has no initialization parameters.
  • getProcessingEventQNames

    public Enumeration<QName> getProcessingEventQNames()
    Description copied from interface: PortletConfig
    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.

    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.

    Specified by:
    getProcessingEventQNames in interface PortletConfig
    Returns:
    an Enumeration 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.
  • getPublishingEventQNames

    public Enumeration<QName> getPublishingEventQNames()
    Description copied from interface: PortletConfig
    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.

    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.

    Specified by:
    getPublishingEventQNames in interface PortletConfig
    Returns:
    an Enumeration 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.
  • getSupportedLocales

    public Enumeration<Locale> getSupportedLocales()
    Description copied from interface: PortletConfig
    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.

    Supported locales are defined in the portlet deployment descriptor with the supported-locale element.

    Specified by:
    getSupportedLocales in interface PortletConfig
    Returns:
    an Enumeration of Locale objects containing the supported locales, or an empty Enumeration if the portlet has not defined any supported locales in the deployment descriptor.
  • getContainerRuntimeOptions

    public Map<String,String[]> getContainerRuntimeOptions()
    Description copied from interface: PortletConfig
    Returns the container runtime options and values for this portlet.

    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.

    Specified by:
    getContainerRuntimeOptions in interface PortletConfig
    Returns:
    an immutable Map 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[]).
  • serveResource

    public void serveResource(ResourceRequest request,
                              ResourceResponse response)
                       throws PortletException,
                              IOException
    Default resource serving.

    The default implemention of this method is to call a RequestDispatcher.foward with the ResourceID of the ResourceRequest.

    If no ResourceID is set on the resource URL the default implementation does nothing.

    Specified by:
    serveResource in interface ResourceServingPortlet
    Parameters:
    request - the resource request
    response - the resource response
    Throws:
    PortletException - if the portlet has problems fulfilling the rendering request
    UnavailableException - if the portlet is unavailable to perform render at this time
    PortletSecurityException - if the portlet cannot fullfill this request because of security reasons
    IOException - if the streaming causes an I/O problem
    Since:
    2.0
  • doHeaders

    protected void doHeaders(RenderRequest request,
                             RenderResponse response)
    Used by the render method to set the response properties and headers.

    The portlet should override this method and set its response header using this method in order to ensure that they are set before anything is written to the output stream.

    The default implemention of this method is emtpy.

    Parameters:
    request - the render request
    response - the render response
    Since:
    2.0
  • getNextPossiblePortletModes

    protected Collection<PortletMode> getNextPossiblePortletModes(RenderRequest request)
    Used by the render method to set the next possible portlet modes.

    The portlet should override this method and set the next possible portlet modes using this method in order to ensure that they are set before anything is written to the output stream.

    The default implemention of this method returns null.

    Since:
    2.0
  • getPublicRenderParameterNames

    public 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 no public render parameters.
    Specified by:
    getPublicRenderParameterNames in interface PortletConfig
    Returns:
    an Enumeration of String objects containing the names of the public render parameters, or an empty Enumeration if the portlet does not define any public render parameters.
    See Also:
    PortletConfig.getPublicRenderParameterNames()
  • getDefaultNamespace

    public String getDefaultNamespace()
    Returns the default namespace for events and public parameters. This namespace is defined in the portlet deployment descriptor with the default-namespace element.

    If no default namespace is defined in the portlet deployment descriptor this methods returns the XML default namespace XMLConstants.NULL_NS_URI.

    Specified by:
    getDefaultNamespace in interface PortletConfig
    Returns:
    the default namespace defined in the portlet deployment descriptor, or XMLConstants.NULL_NS_URI is non is defined.
    See Also:
    PortletConfig.getDefaultNamespace()

Copyright © 2017. All rights reserved.