oracle.portal.provider.v1
Class RenderManager

java.lang.Object
  |
  +--oracle.portal.provider.v1.http.PortletPageLocator
        |
        +--oracle.portal.provider.v1.RenderManager
Direct Known Subclasses:
PageRenderer

public class RenderManager
extends PortletPageLocator
implements PortletRenderer, InitializableXMLObject

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. PortletPageLocator.setShowPage(Object)), which associate a renderer with a specific render mode. If you are using DefaultProvider, these calls are made automatically when you include the appropriate tags in your provider XML registry file. For example:

 <showPage class="oracle.portal.provider.v1.http.JspRenderer">
    <contentType>text/html</contentType>
    <name>hello.jsp</name>
    <appPath>/helloworld</appPath>
    <appRoot>/htdocs/helloworld</appRoot>
 </showPage>
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 PortletPageLocator.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.

For those ManagedRenderers subclassed from the Page abstract class (i.e. JspRenderer and FileRenderer, RenderManager supports a set of defaults for the individual properties of these renderers. This allows a RenderManager's Pagess to be configured by specifying only the properties of each which differ from the defaults defined at RenderManager level. These 'defaultable properties' include:

Consult the Page javadoc for more information.

If all of a Page's defaultable properties conform to the defaults set on the RenderManager, then a special 'shorthand' style of XML declaration can be used to configure an instance, where a page name is included directly inside a 'page' tag, e.g. <showPage>my.jsp</showPage>. Support for these 'shorthand' declarations are provided by the set<ModeName>Page(String) methods (e.g. PortletPageLocator.setShowPage(String)). If the page name is suffixed by ".jsp" or ".sqljsp", then it is assumed that the JspRenderer is to be used; otherwise, it is assumed that the FileRenderer should be used. 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 and if the personalization data class implements PersonalizationObject or is subclassed from BaseCustomization.


Fields inherited from interface oracle.portal.provider.v1.PortletRenderer
DEFAULT_CHARACTER_ENCODING, LEFT_CURVE, MODE_ABOUT, MODE_EDIT, MODE_EDIT_DEFAULTS, MODE_HELP, MODE_LINK, MODE_NAME_ABOUT, MODE_NAME_EDIT, MODE_NAME_EDIT_DEFAULTS, MODE_NAME_HELP, MODE_NAME_LINK, MODE_NAME_PREVIEW, MODE_NAME_SHOW, MODE_NAME_SHOW_DETAILS, MODE_PREVIEW, MODE_SHOW, MODE_SHOW_DETAILS, PAGE_COLOR, PORTLET_BODY_COLOR, PORTLET_HEADER_COLOR, PORTLET_HEADER_LINK, PORTLET_HEADER_TEXT, PORTLET_HEADING_1, PORTLET_HEADING_2, PORTLET_HEADING_3, PORTLET_HEADING_4, PORTLET_SUBHEADER_COLOR, PORTLET_SUBHEADER_LINK, PORTLET_SUBHEADER_TEXT, PORTLET_TEXT_1, PORTLET_TEXT_2, PORTLET_TEXT_3, PORTLET_TEXT_4, RIGHT_CURVE, TOTAL_MODES, TYPE_HTML, TYPE_MOBILE, TYPE_XML
 
Constructor Summary
RenderManager()
          Null Constructor
 
Method Summary
 java.lang.String getEditFormParameter()
          Gets the String to be used as the hidden action parameter on customize forms
 boolean getRenderContainer()
          Gets the boolean flag used by RenderManager to decide whether or not it renders the portlet's container.
 boolean getRenderCustomize()
          Gets the boolean flag used by RenderManager to decide whether or not it renders the portlet's customize container.
 void postInitialize()
          Performs the extra steps required to initialize and validate a RenderManager once its properties have been set with the appropriate accessor methods.
 void preInitialize(java.lang.Object o)
          Performs the steps required to initialize this RenderManager after it has been constructed.
 void render(PortletRenderRequest pr)
          Renders the requested mode in the requested content type with an appropriate renderer.
 void setEditFormParameter(java.lang.String param)
          Sets the hidden parameter used on customize forms to hold the form's action.
 void setRenderContainer(boolean value)
          Controls whether RenderManager renders the portlet's container.
 void setRenderContainer(java.lang.String value)
          Controls whether RenderManager renders the portlet's container.
 void setRenderCustomize(boolean value)
          Controls whether RenderManager renders the portlet's customize container.
 void setRenderCustomize(java.lang.String value)
          Controls whether RenderManager renders the portlet's customize container.
 
Methods inherited from class oracle.portal.provider.v1.http.PortletPageLocator
getAboutPage, getAboutPage, getAppPath, getAppRoot, getCharSet, getContentType, getDefaultPage, getDefaultPage, getEditDefaultsPage, getEditDefaultsPage, getEditPage, getEditPage, getHelpPage, getHelpPage, getLinkPage, getLinkPage, getManagedRenderer, getPageExpires, getPageParameterName, getPagePath, getPageRealPath, getPreviewPage, getPreviewPage, getShowDetailsPage, getShowDetailsPage, getShowPage, getShowPage, setAboutPage, setAboutPage, setAppPath, setAppRoot, setCharSet, setContentType, setDefaultPage, setDefaultPage, setEditDefaultsPage, setEditDefaultsPage, setEditPage, setEditPage, setHelpPage, setHelpPage, setLinkPage, setLinkPage, setPageExpires, setPageExpires, setPageParameterName, setPreviewPage, setPreviewPage, setShowDetailsPage, setShowDetailsPage, setShowPage, setShowPage
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RenderManager

public RenderManager()
Null Constructor
Method Detail

render

public void render(PortletRenderRequest pr)
            throws PortletException,
                   PortletNotFoundException,
                   AccessControlException
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.
Specified by:
render in interface PortletRenderer
Parameters:
pr - a PortletRenderRequest
Throws:
PortletException - if a ManagedRenderer for the requested render mode and content type could not be located or an error occurs while rendering
PortletNotFoundException - if the portlet instance referred to by the request does not exist
AccessControlException - if the user is not authorized to access the portlet instance referred to by the request

setEditFormParameter

public void setEditFormParameter(java.lang.String param)
Sets the hidden parameter used on customize forms to hold the form's action. If none is specified in the provider registry, the portlet's instance name is used.
Parameters:
param - the parameter name.

getEditFormParameter

public java.lang.String getEditFormParameter()
Gets the String to be used as the hidden action parameter on customize forms

setRenderContainer

public void setRenderContainer(boolean value)
Controls whether RenderManager renders the portlet's container.
Parameters:
value - Boolean flag to tell RenderManager to either render the portlet's container (true) or not (false). true by default.

setRenderContainer

public void setRenderContainer(java.lang.String value)
Controls whether RenderManager renders the portlet's container.
Parameters:
value - String representation of boolean value, indicating whether RenderManager should render the portlet's container ("true") or not ("false"). "true" by default.

getRenderContainer

public boolean getRenderContainer()
Gets the boolean flag used by RenderManager to decide whether or not it renders the portlet's container.

setRenderCustomize

public void setRenderCustomize(boolean value)
Controls whether RenderManager renders the portlet's customize container.
Parameters:
value - Boolean flag to tell RenderManager to either render the portlet's customize container (true) or not (false). true by default.

setRenderCustomize

public void setRenderCustomize(java.lang.String value)
Controls whether RenderManager renders the portlet's customize container.
Parameters:
value - String representation of boolean value, indicating whether RenderManager should render the portlet's customize container ("true") or not ("false"). "true" by default.

getRenderCustomize

public boolean getRenderCustomize()
Gets the boolean flag used by RenderManager to decide whether or not it renders the portlet's customize container.

preInitialize

public void preInitialize(java.lang.Object o)
                   throws NodeHandlerException
Performs the steps required to initialize this RenderManager after it has been constructed. Currently, this method sets the default edit form action parameter. This will be overridden if the user calls setEditFormParameter() on RenderManager, e.g. by including an information tag <editFormParameter> in the provider registry.
Specified by:
preInitialize in interface InitializableXMLObject
Parameters:
o - the object that will become this object's parent
Throws:
NodeHandlerException - if an error occurs while initializing this object

postInitialize

public void postInitialize()
                    throws NodeHandlerException
Performs the extra steps required to initialize and validate a RenderManager once its properties have been set with the appropriate accessor methods.
Specified by:
postInitialize in interface InitializableXMLObject
Throws:
NodeHandlerException - if not all properties have been set correctly