Overview | Package | Class | Tree | Deprecated | Index | Help
| OracleAS PDK for Java 9.0.4.0.2
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.portal.provider.v2.render.http
Class ResourceRenderer

    java.lang.Object
      |
      +--oracle.portal.provider.v2.render.ManagedRenderer
            |
            +--oracle.portal.provider.v2.render.http.BaseManagedRenderer
                  |
                  +--oracle.portal.provider.v2.render.http.AbstractResourceRenderer
                        |
                        +--oracle.portal.provider.v2.render.http.ResourceRenderer

All Implemented Interfaces:
  InitializableXMLObject, Validateable

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:
  `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.

Overview | Package | Class | Tree | Deprecated | Index | Help
| OracleAS PDK for Java 9.0.4.0.2
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright (c) 2002,2003 Oracle Corporation. All Rights Reserved.