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 BaseManagedRenderer

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

public abstract class BaseManagedRenderer
extends ManagedRenderer
implements InitializableXMLObject, Validateable

BaseManagedRenderer is the JPDK's base implementation of the ManagedRenderer interface. BaseManagedRenderer maintains information about the page's content type (MIME type) and cache expiry time. These may be set via calls to the appropriate methods or declared at page level in provider.xml using the &ltcontentType&gt and &ltpageExpires&gt tags.

BaseManagedRenderer also maintains a reference to its parent RenderManager object so that page level attributes can be defaulted at RenderManager level. Implementations needing to set HTTP headers other than content type and page expiry should subclass BaseManagedRenderer and override the prepareResponse(PortletRenderRequest) method, taking care to call super.prepareResponse(pr) as a first step.


Constructor Summary
BaseManagedRenderer()
           
 
Method Summary
 void addParameter(java.lang.Object o)
          Adds entries from a NameValue object to a parameter list stored by this BaseManagedRenderer.
 java.lang.String getContentType()
          Gets the default MIME type to be used as the content type for this renderer's pages.
 boolean getGeneratesESI()
          Returns a flag indicating whether or not ESI processing should be performed on the rendered output.
 void postInitialize()
          Performs the extra steps required to initialize and validate a BaseManagedRenderer object once its properties have been set with the appropriate accessor methods.
 void preInitialize(java.lang.Object o)
          Performs the steps required to initialize a BaseManagedRenderer object after it has been constructed.
 boolean prepareResponse(PortletRenderRequest pr)
          Sets default HTTP headers for the response.
 void setContentType(java.lang.String contentType)
          Sets the default MIME type to be used as the content type for this renderer's pages.
 void setGeneratesESI(boolean generatesESI)
          Sets a flag to indicate whether or not ESI processing should be performed on the rendered output.
 void setGeneratesESI(java.lang.String generatesESI)
          Sets a flag to indicate whether or not ESI processing should be performed on the rendered output.
 void setPageExpires(int expires)
          Sets the expiration time (in minutes) of the page cache.
 void setPageExpires(java.lang.String expires)
          Sets the expiration time (in minutes) of the page cache.
 void setUseInvalidationCaching(boolean useInvalidation)
          Sets a flag to indicate whether or not to use invalidation caching
 void setUseInvalidationCaching(java.lang.String useInvalidation)
          Sets a flag to indicate whether or not to use invalidation caching
 void validate(java.lang.String context, ValidationError errors)
          Validates the internal state of this BaseManagedRenderer instance.
 
Methods inherited from class oracle.portal.provider.v2.render.ManagedRenderer
renderBody
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseManagedRenderer

public BaseManagedRenderer()
Method Detail

preInitialize

public void preInitialize(java.lang.Object o)
                   throws NodeHandlerException
Performs the steps required to initialize a BaseManagedRenderer object after it has been constructed.

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 BaseManagedRenderer object 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

addParameter

public void addParameter(java.lang.Object o)
                  throws PortletException
Adds entries from a NameValue object to a parameter list stored by this BaseManagedRenderer.

Parameters:
o - Object representing the name-value pair (a NameValue).
Throws:
PortletException - if the given Object is not a valid NameValue

setContentType

public void setContentType(java.lang.String contentType)
Sets the default MIME type to be used as the content type for this renderer's pages.

Parameters:
contentType - MIME type to be used as the content type for this renderer's pages.

getContentType

public java.lang.String getContentType()
Gets the default MIME type to be used as the content type for this renderer's pages. If a content type hasn't been set explicitly on this BaseManagedRenderer, then the value returned by calling the RenderManager.getContentType() method on the parent RenderManager is returned.

Specified by:
getContentType in class ManagedRenderer
Returns:
MIME type to be used as the content type for this renderer's pages.

setPageExpires

public void setPageExpires(int expires)
Sets the expiration time (in minutes) of the page cache.

Parameters:
expires - the number of minutes a page should be cached by the Portal.

setPageExpires

public void setPageExpires(java.lang.String expires)
Sets the expiration time (in minutes) of the page cache.

Parameters:
expires - String representation of the integer number of minutes a page should be cached by the Portal.

setUseInvalidationCaching

public void setUseInvalidationCaching(boolean useInvalidation)
Sets a flag to indicate whether or not to use invalidation caching

Parameters:
useInvalidation - if true use invalidation caching, otherwise don't

setUseInvalidationCaching

public void setUseInvalidationCaching(java.lang.String useInvalidation)
Sets a flag to indicate whether or not to use invalidation caching

Parameters:
useInvalidation - if true use invalidation caching, otherwise don't

getGeneratesESI

public boolean getGeneratesESI()
Returns a flag indicating whether or not ESI processing should be performed on the rendered output.

Returns:
boolean - true if ESI processing should be performed on the rendered output. Otherwise false.

setGeneratesESI

public void setGeneratesESI(boolean generatesESI)
Sets a flag to indicate whether or not ESI processing should be performed on the rendered output.

Parameters:
generatesESI - true if ESI processing should be performed on the rendered output. Otherwise false.

setGeneratesESI

public void setGeneratesESI(java.lang.String generatesESI)
Sets a flag to indicate whether or not ESI processing should be performed on the rendered output.

Parameters:
generatesESI - "true" if ESI processing should be performed on the rendered output. Otherwise "false".

prepareResponse

public boolean prepareResponse(PortletRenderRequest pr)
                        throws PortletException,
                               PortletNotFoundException
Sets default HTTP headers for the response. This consists of content type and page expiry time, both of which may be set programatically via calls to setContentType(String) and setPageExpires(String) or declaritivley in provider.xml with the &ltcontentType&gt and &ltpageExpires&gt tags.

Specified by:
prepareResponse in class ManagedRenderer
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
PortletNotFoundException

validate

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

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

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.