com.raritantechnologies.quickstart.userInterface
Class CacheParamsContentHandlerFilter

java.lang.Object
  extended bycom.raritantechnologies.quickstart.userInterface.DocumentContentHandlerFilter
      extended bycom.raritantechnologies.quickstart.userInterface.CacheParamsContentHandlerFilter
All Implemented Interfaces:
IConfigurable, IDocumentContentHandler, IProcessDocumentContentHandler

public class CacheParamsContentHandlerFilter
extends DocumentContentHandlerFilter

Caches the current data acquired by a nested IDocumentContentHandler. Can be used in cache mode to cache the output of its proxy IDocumentContentHandler or in restoreMode in which it acts as the primary DocumentContentHandler by returning its cached data to the ServletOutputStream.

XML Configuration Template:
    <ContentHandler 
           contentType="[Quickstart content type]" 
           class="com.raritantechnologies.quickstart.userInterface.CacheParamsContentHandlerFilter"
           cacheBodyKey="[ key to use to store content in session data cache]"
           cacheBodyRequestParam="[request param value to use as session data cache key]"
           restoreMode="true|false(default) - determines is cacheing or restoring from cache)"
           clearCache="true|false(default) - determines if cache is cleared after restoring content" >

      <Param requestField="[a request param to cache]"       sessionField="[name in session data]" />
      <Param requestField="[another request param to cache]" sessionField="[name in session data]/>

      <ContentHandler class="real content handler class" .../>

    </ContentHandler>
  

Developed by Raritan Technologies Inc..

Author:
Ted Sullivan

Field Summary
 
Fields inherited from class com.raritantechnologies.quickstart.userInterface.DocumentContentHandlerFilter
theHandler
 
Constructor Summary
CacheParamsContentHandlerFilter()
           
 
Method Summary
 java.lang.String getCacheBodyKey()
           
 java.lang.String getCacheBodyRequestParam()
           
 boolean getClearCache()
           
 java.lang.String getConfigurationXML()
           
 boolean getRestoreMode()
           
 void initialize(org.w3c.dom.Element elem)
          Initializes the object from an XML tag or element.
protected  byte[] processContent(java.io.ByteArrayOutputStream baos, RaritanPageContext rpc, java.lang.Integer queryID)
           
 void sendDocumentContent(ILoginInfo userInfo, HttpServletRequest pReq, HttpServletResponse pRes)
          Sends the document content to the HttpServletResponse using parameters in the HttpServletRequest.
 void setCacheBodyKey(java.lang.String cacheBodyKey)
           
 void setCacheBodyRequestParam(java.lang.String cacheBodyRequestParam)
           
 void setClearCache(boolean clearCache)
           
 void setRestoreMode(boolean restoreMode)
           
 
Methods inherited from class com.raritantechnologies.quickstart.userInterface.DocumentContentHandlerFilter
getErrorPage, getHandlerName, getLastContentType, getLastDocumentName, getLastDocumentParamMap, getRequestParameters, sendDocumentContent, setDocumentContentHandler
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CacheParamsContentHandlerFilter

public CacheParamsContentHandlerFilter()
Method Detail

sendDocumentContent

public void sendDocumentContent(ILoginInfo userInfo,
                                HttpServletRequest pReq,
                                HttpServletResponse pRes)
                         throws ServletException
Description copied from interface: IDocumentContentHandler
Sends the document content to the HttpServletResponse using parameters in the HttpServletRequest.

Specified by:
sendDocumentContent in interface IDocumentContentHandler
Overrides:
sendDocumentContent in class DocumentContentHandlerFilter
Throws:
ServletException

processContent

protected byte[] processContent(java.io.ByteArrayOutputStream baos,
                                RaritanPageContext rpc,
                                java.lang.Integer queryID)
Overrides:
processContent in class DocumentContentHandlerFilter

initialize

public void initialize(org.w3c.dom.Element elem)
Description copied from interface: IConfigurable
Initializes the object from an XML tag or element. This method is called by the Framework as part of the application initializtion. see ConfigurationManager, XMLConfigurationManager, XMLSearchFieldMapFactory, XMLSearchSourceFactory. Configurable objects that are owned or contained by other configurable objects will be initialized in by the parent object.

Specified by:
initialize in interface IDocumentContentHandler
Overrides:
initialize in class DocumentContentHandlerFilter

setCacheBodyKey

public void setCacheBodyKey(java.lang.String cacheBodyKey)

getCacheBodyKey

public java.lang.String getCacheBodyKey()

setCacheBodyRequestParam

public void setCacheBodyRequestParam(java.lang.String cacheBodyRequestParam)

getCacheBodyRequestParam

public java.lang.String getCacheBodyRequestParam()

setRestoreMode

public void setRestoreMode(boolean restoreMode)

getRestoreMode

public boolean getRestoreMode()

setClearCache

public void setClearCache(boolean clearCache)

getClearCache

public boolean getClearCache()

getConfigurationXML

public java.lang.String getConfigurationXML()