RenderManager implements a model whereby users can plug
in individual renderers which handle a request for a specific render
mode in a specific content type. Any class that implements the ManagedRenderer interface can be used with RenderManager.
Consult the JPDK documentation for information about the various renderers
supplied with the JPDK.

The individual ManagedRenderers controlled by a
RenderManager are registered by calling the
set<ModeName>Page(Object) methods (e.g. setShowPage(Object)), which associate a renderer with a
specific render mode. If you are using DefaultProviderLoader, these calls are made
automatically when you include the appropriate tags in your provider XML
registry file. For example:

Multiple ManagedRenderers can be registered for a single render
mode, provided they all handle different content types (i.e. their ManagedRenderer.getContentType() methods return different values). When
locating the appropriate ManagedRenderer to service a
particular render request, RenderManager will look for the
first ManagedRenderer registered for the requested render mode
whose content type matches the 'preferred content type' of the request. This
allows a RenderManager to be configured so that it supports
'standard' browsers (e.g. with a "text/html" content type) as
well as mobile devices (e.g. with a "text/vnd.oracle.mobilexml"
content type).

RenderManager also supports registration of default
renderers, controlled by setDefaultPage(Object) or the
<defaultPage> tag. If unable to locate a
ManagedRenderer for the requested render mode and content type
and a default renderer has been registered with the appropriate content
type, RenderManager will pass the request on to that
renderer.

RenderManager supports 'short-hand' XML declarations where a
resourcePath is included directly inside a 'page' tag,
e.g. <showPage>/my/resource/path</showPage>. Support for
these 'short-hand' declarations are provided by the
set<ModeName>Page(String) methods (e.g. setShowPage(String)). These declarations result in a new
ResourceRenderer being
initialized with the supplied resourcePath. Consult the
supplied documentation for more detailed instructions and examples.

By default, RenderManager will automatically render portlet
containers for you. To disable the automatic rendering of the container call
setRenderContainer(false). Alternatively, you can set this in
the provider XML registry:
<renderContainer>false</renderContainer>

When renderering a Portlet's container, RenderManager will
render the user's customized title (label), if the Portlet supports
personalization.

RenderManager

render

Renders the requested mode in the requested content type with an
appropriate renderer. If no renderer with the appropriate content type
has been declared for this mode, rendering will fall back to the
default renderer. The renderer is asked to prepare its response, its
portlet header is drawn, the renderer is asked to render its body and
finally the portlet footer is drawn.

Note: If the JPDK is not rendering the portlet container, then it is
the responsibility of the portlet developer to correctly handle the
various state in which the portlet can be rendered (eg collapsed,
not collapsed)

setContentType

public void setContentType(java.lang.String contentType)

Sets the MIME type to be used as the default content type for all
BaseManagedRenderers. This parameter will be inherited by any
of this renderer's BaseManagedRenderers for which the
corresponding parameter has not been directly specified.

setPageExpires

public void setPageExpires(int expires)

Sets the default expiration time (in minutes) of a page produced by a
BaseManagedRenderer. This parameter will be inherited by any of
this renderer's BaseManagedRenderers for which the
corresponding parameter has not been directly specified.

Parameters:

expires - the default integer number of minutes that the Portal
should cache the output of a BaseManagedRenderer. If zero,
indicates that the output should not be cached by default.

setPageExpires

public void setPageExpires(java.lang.String expires)

Sets the default expiration time (in minutes) of a page produced by a
BaseManagedRenderer. This parameter will be inherited by any of
this renderer's BaseManagedRenderers for which the
corresponding parameter has not been directly specified.

Parameters:

expires - String representation of the default integer number of
minutes that the Portal should cache the output of a BaseManagedRenderer. If zero, indicates that the output should not be
cached by default.

getPageExpires

default expiration time in minutes for output from a BaseManagedRenderer. If non-zero, indicates the number of minutes the
page should be cached by the Portal.

setCharSet

public void setCharSet(java.lang.String charSet)

Sets the Default IANA character encoding to be used. This parameter
will be inherited by any of this renderer's ManagedRenderers
for which the corresponding parameter has not been directly specified.

Parameters:

charSet - default IANA character encoding.

getCharSet

public java.lang.String getCharSet()

Gets the Default IANA character encoding to be used for pages rendered
by ManagedRenderers.

Returns:

default IANA character encoding.

setPageParameterName

public void setPageParameterName(java.lang.String name)

Sets the default name of the request parameter that is used to override
the name of the page used by a ManagedRenderer. Used to
communicate the "next" page in a portlet that uses multiple pages to
render itself. This parameter will be inherited by any of this
renderer's Pages for which the corresponding parameter has
not been directly specified.

Parameters:

name - the default name of the request parameter that is used to
override the page name.

getPageParameterName

public java.lang.String getPageParameterName()

Gets the default name of the request parameter that is used to override
the name of the page used by a ManagedRenderer.

Returns:

the default name of the request parameter that is used to
override the page name.

getDefaultPage

Gets the ManagedRenderer that renders this portlet's 'default' page with
the given content type. This renderer is used when no ManagedRenderer
has been specified for the specific mode of the render request.

Returns:

the ManagedRenderer that renders this 'default' page with the
given content type or null if no such renderer exists.

addAllowedPath

Adds a resource URL pattern to the list of those allowed to be rendered
when using the page parameter functionality. The path matching only
applies if the pageParameterName provider definition tag
is used.

The rules for the pattern matching are as follows:

For a resource path to be accepted it must match every
character in the pattern, with the exception of two types of
wildcard.

A string beginning with '/' and ending in '/*' is used for path
matching. For example, the pattern '/a/b/*' will match the
resource path /a/b/c/file.jsp.

A string starting with '*.' acts as a file extension wildcard.
For example, the pattern '*.jsp' will match any jsp resource.

An asterisk at any other point in the path does not act as a
wildcard.

If no paths are specified the default files behaviour is to
allow resource paths immediately beneath the servlet root and
those which start with '/htdocs'. For example, /index.jsp and
/htdocs/multipage/first.jsp would be acceptable but
'/WEB-INF/web.xml would not.

getManagedRenderer

Returns the ManagedRenderer object to be used to render this
request. The method looks for a ManagedRenderer registered
for the appropriate mode whose content type matches the preferred
content type of the render request. If no such
ManagedRenderer exists, the method returns the
ManagedRenderer registered as the 'default' for that
content type, if one exists.