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 ResourceRenderer

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
              extended by oracle.portal.provider.v2.render.http.ResourceRenderer
All Implemented Interfaces:
Validateable, InitializableXMLObject
Direct Known Subclasses:
ResourceValidateRenderer

public class ResourceRenderer
extends AbstractResourceRenderer

When maintained by a RenderManager, a ResourceRenderer renders a single page's contents from resource known to the servlet container. Examples of such resources include JSPs, servlets and static HTML files. Any resource can be used as long as the servlet container can return a valid javax.servlet.RequestDispatcher for it. The resource can be located in the same servlet context as the current provider or a different one. The resource path is defined by a call to setResourcePath.


Constructor Summary
ResourceRenderer()
          Null Constructor.
ResourceRenderer(RenderManager parent, java.lang.String path)
          Creates and initializes a ResourceRenderer owned by the given RenderManager, to render from the resource at the given path.
 
Method Summary
 java.lang.String getRequestResourcePath(PortletRenderRequest prr)
          This method returns the path of the resource to be rendered as set by setResourcePath.
 java.lang.String getResourcePath()
          Gets the path to the resource used for rendering.
 void postInitialize()
          Performs the extra steps required to initialize and validate a ResourceRenderer object once its properties have been set with the appropriate accessor methods.
 void setContext(java.lang.String context)
          Sets the context root of the javax.servlet.ServletContext containing the resource.
 void setResourcePath(java.lang.String path)
          Sets the path of the resource used for rendering.
 void validate(java.lang.String context, ValidationError errors)
          Validates the internal state of this ResourceRenderer instance.
 
Methods inherited from class oracle.portal.provider.v2.render.http.AbstractResourceRenderer
getCharSet, getContext, prepareResponse, renderBody, setCharSet
 
Methods inherited from class oracle.portal.provider.v2.render.http.BaseManagedRenderer
addParameter, getContentType, getGeneratesESI, preInitialize, setContentType, setGeneratesESI, setGeneratesESI, setPageExpires, setPageExpires, setUseInvalidationCaching, setUseInvalidationCaching
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceRenderer

public ResourceRenderer()
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 a DefaultNodeHandler takes care of these details.


ResourceRenderer

public ResourceRenderer(RenderManager parent,
                        java.lang.String path)
                 throws PortletException
Creates and initializes a ResourceRenderer owned by the given RenderManager, to render from the resource at the given path. This constructor is called by RenderManager when no renderer has been specified in the provider definition and ResourceRenderer is used by default to render page content.

Parameters:
parent - RenderManager that owns this page
path - the path to the resource.
Throws:
PortletException - if an error occurs while initializing the object
Method Detail

getResourcePath

public java.lang.String getResourcePath()
Gets the path to the resource used for rendering. This path is relative to the context root of the J2EE Application.

Returns:
the resource path, relative to the context root.

setResourcePath

public void setResourcePath(java.lang.String path)
Sets the path of the resource used for rendering. This path should be relative to the context root of the J2EE Application. It should fully locate the resource so, in the case of JSPs and static files, should include the file name.

Parameters:
path - resource location.

postInitialize

public void postInitialize()
                    throws NodeHandlerException
Performs the extra steps required to initialize and validate a ResourceRenderer object once its properties have been set with the appropriate accessor methods. A ResourceRenderer object must be supplied with a non null resource path.

Specified by:
postInitialize in interface InitializableXMLObject
Overrides:
postInitialize in class BaseManagedRenderer
Throws:
NodeHandlerException - if a resource path has not been specified.

validate

public void validate(java.lang.String context,
                     ValidationError errors)
Validates the internal state of this ResourceRenderer instance. Errors found are reported using the supplied ValidationError instance.

Specified by:
validate in interface Validateable
Overrides:
validate in class BaseManagedRenderer
Parameters:
context - The context of the calling instance.
errors - The current list of errors.

getRequestResourcePath

public java.lang.String getRequestResourcePath(PortletRenderRequest prr)
This method returns the path of the resource to be rendered as set by setResourcePath.

Specified by:
getRequestResourcePath in class AbstractResourceRenderer
Parameters:
prr - the request object
Throws:
PortletException

setContext

public void setContext(java.lang.String context)
Sets the context root of the javax.servlet.ServletContext containing the resource. This should only be set if the resource is located in a different servlet context than the current provider.

Parameters:
context - context root known to the server.

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.