Overview | Package | Class | Tree | Deprecated | Index | Help
| The PDK Java API is part of the Portal Developer Kit on Portal Studio
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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

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

All Implemented Interfaces:
  InitializableXMLObject, Validateable

public abstract class ResourceValidateRenderer
extends ResourceRenderer

ResourceValidateRenderer is an abstract class which should be used as the basis for a `ManagedRenderer` which has responsibility for rendering a single mode from a web container resource using validation based caching. Since this requires control over the HTTP headers of the renderer's response, this must be achieved by overriding the `ManagedRenderer.prepareResponse(PortletRenderRequest)` method.

Users should provide their own implementations of `isValid(PortletRenderRequest,String)` and `getNewVersion(PortletRenderRequest)` in order to enforce their own validation criteria.

Constructor Summary
`ResourceValidateRenderer()`

Method Summary
`abstract java.lang.String` | `getNewVersion(PortletRenderRequest pr)` Decide the current version of the page to be generated.
`abstract boolean` | `isValid(PortletRenderRequest pr, java.lang.String oldVersion)` Determine whether the given version of the page to be generated is still valid.
`boolean` | `prepareResponse(PortletRenderRequest pr)` Performs any protocol specific preparation that is needed before the page is generated.

Methods inherited from class oracle.portal.provider.v2.render.http.ResourceRenderer
`getContext, getResourcePath, postInitialize, renderBody, setCharSet, setContext, setResourcePath, validate`

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

### ResourceValidateRenderer

    public ResourceValidateRenderer()

Method Detail

### prepareResponse

    public boolean prepareResponse(PortletRenderRequest pr)
                            throws PortletException,
                                   PortletNotFoundException

  Performs any protocol specific preparation that is needed before the page is generated. If the request contains a cached version string for the current page, the `isValid(PortletRenderRequest,String)` method is called in order to decide whether the cached page with this version is still valid. If so, the page is marked as valid, and `false` is returned to indicate that the page need not be generated. Otherwise, `getNewVersion(PortletRenderRequest)` is called in order to derive a new version string the page, and `true` is returned to indicate that the page body should be generated.

  Overrides:
    `prepareResponse` in class `ResourceRenderer`
  Parameters:
    `pr` - a `PortletRenderRequest`
  Returns:
    boolean flag indicating whether or not to render the portlet's contents

### isValid

    public abstract boolean isValid(PortletRenderRequest pr,
                                    java.lang.String oldVersion)

  Determine whether the given version of the page to be generated is still valid. Users implementing this method may want to compare the given version string with the one returned by `getNewVersion(PortletRenderRequest)`.
  Parameters:
    `pr` - the request object containing the current request details.
    `oldVersion` - String identifying the cached version of the page to be generated.
  Returns:
    `true` if the given version is still valid.

### getNewVersion

    public abstract java.lang.String getNewVersion(PortletRenderRequest pr)

  Decide the current version of the page to be generated.
  Parameters:
    `pr` - the request object containing the current request details.
  Returns:
    the current version of the page to be generated.

Overview | Package | Class | Tree | Deprecated | Index | Help
| The PDK Java API is part of the Portal Developer Kit on Portal Studio
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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