Oracle Fusion Middleware
Java API Reference for Oracle PDK Java
11g Release 1 (11.1.1)
E10691-01

oracle.portal.provider.v2.render.http
Class AbstractResourceRenderer

java.lang.Object
  extended by oracle.portal.provider.v2.render.ManagedRenderer
      extended by oracle.portal.provider.v2.render.http.BaseManagedRenderer
          extended by oracle.portal.provider.v2.render.http.AbstractResourceRenderer
All Implemented Interfaces:
Validateable, InitializableXMLObject
Direct Known Subclasses:
FacesRenderer, ResourceRenderer, StrutsRenderer

public abstract class AbstractResourceRenderer
extends BaseManagedRenderer

This is the base class for renderers that use a request dispatcher to render content.


Constructor Summary
AbstractResourceRenderer()
          Null Constructor.
 
Method Summary
 java.lang.String getCharSet()
          Gets the character set to be used for rendering resource content.
 java.lang.String getContext()
          Gets the context root of the javax.servlet.ServletContext containing the resource.
abstract  java.lang.String getRequestResourcePath(PortletRenderRequest prr)
          Override this method to return a path to the resource to be rendered.
 boolean prepareResponse(PortletRenderRequest pr)
          In addition to setting default http headers for the response (see BaseManagedRenderer), this method ensures that the HttpServletResponse is wrapped in the correct manner.
 void renderBody(PortletRenderRequest pr)
          Render the specified page's contents from the required resource.
 void setCharSet(java.lang.String charSet)
          Sets the character set to be used for rendering resource content.
 
Methods inherited from class oracle.portal.provider.v2.render.http.BaseManagedRenderer
addParameter, getContentType, getGeneratesESI, postInitialize, preInitialize, setContentType, setGeneratesESI, setGeneratesESI, setPageExpires, setPageExpires, setUseInvalidationCaching, setUseInvalidationCaching, validate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractResourceRenderer

public AbstractResourceRenderer()
Null Constructor. The BaseManagedRenderer.preInitialize(Object) method should be called after creating an object with this constructor and the BaseManagedRenderer.postInitialize() method should be called after setting up page properties with the various accessor methods. Normally taken care of by DefaultNodeHandler takes care of these details.

Method Detail

getContext

public java.lang.String getContext()
Gets the context root of the javax.servlet.ServletContext containing the resource. If the resource is located in the same context as the current provider, this method returns null.

Returns:
the context root, or null if the context is the same as the current provider.

setCharSet

public void setCharSet(java.lang.String charSet)
Sets the character set to be used for rendering resource content. Overrides the default behaviour where the character set is defined in the content type request header or defaults to ISO-8859-1.


getCharSet

public java.lang.String getCharSet()
Gets the character set to be used for rendering resource content.


prepareResponse

public boolean prepareResponse(PortletRenderRequest pr)
                        throws PortletException
In addition to setting default http headers for the response (see BaseManagedRenderer), this method ensures that the HttpServletResponse is wrapped in the correct manner.

Overrides:
prepareResponse in class BaseManagedRenderer
Parameters:
pr - a PortletRenderRequest.
Returns:
boolean flag indicating whether or not to render the portlet's contents (e.g. is the cached version still valid)
Throws:
PortletException

getRequestResourcePath

public abstract java.lang.String getRequestResourcePath(PortletRenderRequest prr)
                                                 throws PortletException
Override this method to return a path to the resource to be rendered.

Throws:
PortletException

renderBody

public void renderBody(PortletRenderRequest pr)
                throws PortletException
Render the specified page's contents from the required resource. This resource may be any that the servlet container can return a valid javax.servlet.RequestDispatcher for. Examples include JSPs, servlets and static HTML files.

Specified by:
renderBody in class ManagedRenderer
Parameters:
pr - a PortletRenderRequest.
Throws:
PortletException

Oracle Fusion Middleware
Java API Reference for Oracle PDK Java
11g Release 1 (11.1.1)
E10691-01

Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved.