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 FileRenderer

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.FileRenderer
All Implemented Interfaces:
Validateable, InitializableXMLObject

public class FileRenderer
extends BaseManagedRenderer

When maintained by a RenderManager, a FileRenderer renders a single page's contents from a static file.

The properties contentType, pageExpires, charSet may be set at page level or defaulted at RenderManager level. However the page name must be set at page level via a call to setName(String) or by use of the &ltname&gt provider.xml tag.


Field Summary
static int CHAR_BUFFER_SIZE
           
 
Constructor Summary
FileRenderer()
          Null Constructor.
FileRenderer(RenderManager parent, java.lang.String pageName)
          Creates and initializes a FileRenderer owned by the given RenderManager, describing a page with the given name.
 
Method Summary
 java.lang.String getAppRoot()
          Gets the root physical path for the renderer's pages.
 java.lang.String getCharSet()
          Gets the Default IANA character encoding to be used for this renderer's pages.
 java.lang.String getName()
          Gets the name of the page described by this Page.
 void renderBody(PortletRenderRequest pr)
          Render the specified page's contents using the current appRoot and page name.
 void setAppRoot(java.lang.String path)
          Sets the root physical path for the renderer's pages.
 void setCharSet(java.lang.String charSet)
          Sets the Default IANA character encoding to be used for this renderer's pages.
 void setName(java.lang.String pageName)
          Sets the name of the page described by this Page.
 void validate(java.lang.String context, ValidationError errors)
          Validates the internal state of this FileRenderer instance.
 
Methods inherited from class oracle.portal.provider.v2.render.http.BaseManagedRenderer
addParameter, getContentType, getGeneratesESI, postInitialize, preInitialize, prepareResponse, setContentType, setGeneratesESI, setGeneratesESI, setPageExpires, setPageExpires, setUseInvalidationCaching, setUseInvalidationCaching
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CHAR_BUFFER_SIZE

public static final int CHAR_BUFFER_SIZE
See Also:
Constant Field Values
Constructor Detail

FileRenderer

public FileRenderer()
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.


FileRenderer

public FileRenderer(RenderManager parent,
                    java.lang.String pageName)
             throws PortletException
Creates and initializes a FileRenderer owned by the given RenderManager, describing a page with the given name.

Parameters:
parent - the RenderManager that owns this page
pageName - the appPath relative name of the renderer's page
Throws:
PortletException - if an error occurs while initializing the object
Method Detail

setName

public void setName(java.lang.String pageName)
Sets the name of the page described by this Page.

Parameters:
pageName - appRoot relative name of the page

getName

public java.lang.String getName()
Gets the name of the page described by this Page.

Returns:
appRoot relative name of the page

setAppRoot

public void setAppRoot(java.lang.String path)
Sets the root physical path for the renderer's pages.

Parameters:
path - the root physical path for the renderer's pages.

getAppRoot

public java.lang.String getAppRoot()
Gets the root physical path for the renderer's pages.

Returns:
the root physical path for the renderer's pages.

setCharSet

public void setCharSet(java.lang.String charSet)
Sets the Default IANA character encoding to be used for this renderer's pages.

Parameters:
charSet - IANA character encoding to be used for this renderer's pages

getCharSet

public java.lang.String getCharSet()
Gets the Default IANA character encoding to be used for this renderer's pages. If a character encoding hasn't been set explicitly on this BaseManagedRenderer, then the value returned by calling the RenderManager.getCharSet() method on the parent RenderManager is returned.

Returns:
IANA character encoding to be used for this renderer's pages

renderBody

public void renderBody(PortletRenderRequest pr)
                throws PortletException
Render the specified page's contents using the current appRoot and page name. File Renderer does this by copying the contents of the static file to the output stream.

Specified by:
renderBody in class ManagedRenderer
Parameters:
pr - a PortletRenderRequest
Throws:
PortletException - if an error occurs while rendering.

validate

public void validate(java.lang.String context,
                     ValidationError errors)
Validates the internal state of this FileRenderer 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.

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.