com.raritantechnologies.quickstart.userInterface
Class SecureDocumentContentHandler

java.lang.Object
  extended bycom.raritantechnologies.quickstart.userInterface.SecureDocumentContentHandler
All Implemented Interfaces:
IConfigurable, IDocumentContentHandler
Direct Known Subclasses:
ERoomDocumentContentHandler

public class SecureDocumentContentHandler
extends java.lang.Object
implements IDocumentContentHandler

Retrieves a document from a secure source. Uses HTTPUnit. Wraps all hyperlinks back to this content handler to maintain session scope.

XML Configuration Template:
   <ContentHandler "[content handler name]"
           contentType="[Quickstart content type]" 
           class="com.raritantechnologies.quickstart.userInterface.SecureDocumentContentHandler"
           sourceName="[name of secure SearchSource ]"
           baseURL="[base URL for correcting relative links]"
           enableJavascript="true(default)|false" >

      <!-- Login step process - see com.raritantechnologies.federated.html.HTMLSearchSource 
              configuration for details -->
      <LoginProcess>
        <Step type="[ step type ]" URL="[the URL that the form should be posted to]" >
          <params>
            <param formName="m" value="s" alwaysOutput="true" />
            <param formName="q" value="" alwaysOutput="true" />
          </params>
        </Step>
      </LoginProcess>

      <PageFilter class="[ class of com.raritantechnologies.utils.filter.IStringFilter ]" >

      </PageFilter>

      <SecurityManager class="[class of com.raritantechnologies.searchApp.ISecurityManager" >

      </SecurityManager>

   </ContentHandler>
 

Developed by Raritan Technologies Inc..

Author:
Ted Sullivan

Field Summary
protected  java.lang.String errorPage
           
protected  org.w3c.dom.Element loginProcess
           
protected  IStringFilter pageFilter
           
protected  ISecurityManager securityManager
           
protected  java.lang.String urlParam
           
 
Constructor Summary
SecureDocumentContentHandler()
           
 
Method Summary
 java.lang.String getErrorPage(HttpServletRequest pReq)
           
 java.lang.String getHandlerName()
          Returns the name of document handler
 java.lang.String getLastContentType()
           
 java.lang.String getLastDocumentName()
           
 java.util.Map getLastDocumentParamMap()
          Returns a Map of document param=value
 java.util.List getRequestParameters()
          returns the list of parameters needed in the HTTP request.
 void initialize(org.w3c.dom.Element initElem)
          Initializes the object from an XML tag or element.
 void sendDocumentContent(ILoginInfo userInfo, HttpServletRequest pReq, HttpServletResponse pRes)
          Sends the document content to the HttpServletResponse using parameters in the HttpServletRequest.
 byte[] sendDocumentContent(java.util.Map handlerInfo)
          Sends the document content to the whatever class calls it using parameters defined in a Map.
 void setCheckSecurityAccess(boolean checkSecurityAccess)
           
 void setLoginProcess(org.w3c.dom.Element loginProcess)
           
 void setSecurityManager(ISecurityManager securityManager)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

securityManager

protected ISecurityManager securityManager

loginProcess

protected org.w3c.dom.Element loginProcess

pageFilter

protected IStringFilter pageFilter

errorPage

protected java.lang.String errorPage

urlParam

protected java.lang.String urlParam
Constructor Detail

SecureDocumentContentHandler

public SecureDocumentContentHandler()
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
Parameters:
userInfo - User information for this session user. May be used to restrict access to content.
pReq - The HttpServletRequest for the requested content.
pRes - The HttpServletResponse. The content handler will obtain a ServletOutputStream from this object and write the content to this stream.
Throws:
ServletException

initialize

public void initialize(org.w3c.dom.Element initElem)
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

setSecurityManager

public void setSecurityManager(ISecurityManager securityManager)

setCheckSecurityAccess

public void setCheckSecurityAccess(boolean checkSecurityAccess)

getErrorPage

public java.lang.String getErrorPage(HttpServletRequest pReq)
Specified by:
getErrorPage in interface IDocumentContentHandler

getLastDocumentName

public java.lang.String getLastDocumentName()
Specified by:
getLastDocumentName in interface IDocumentContentHandler

getHandlerName

public java.lang.String getHandlerName()
Returns the name of document handler

Specified by:
getHandlerName in interface IDocumentContentHandler

getLastDocumentParamMap

public java.util.Map getLastDocumentParamMap()
Returns a Map of document param=value

Specified by:
getLastDocumentParamMap in interface IDocumentContentHandler

getLastContentType

public java.lang.String getLastContentType()
Specified by:
getLastContentType in interface IDocumentContentHandler

setLoginProcess

public void setLoginProcess(org.w3c.dom.Element loginProcess)

getRequestParameters

public java.util.List getRequestParameters()
Description copied from interface: IDocumentContentHandler
returns the list of parameters needed in the HTTP request.

Specified by:
getRequestParameters in interface IDocumentContentHandler

sendDocumentContent

public byte[] sendDocumentContent(java.util.Map handlerInfo)
Description copied from interface: IDocumentContentHandler
Sends the document content to the whatever class calls it using parameters defined in a Map.

Specified by:
sendDocumentContent in interface IDocumentContentHandler
Parameters:
handlerInfo - Information needed by the implementing class to retrieve and send content.