com.raritantechnologies.quickstart.userInterface
Class SplitPageDocumentContentHandler

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

public class SplitPageDocumentContentHandler
extends StringFilterDocumentContentHandler

DocumentContentHandlerFilter that splits text pages into segments. The incoming page data is stored in an temporary IResult object field so that it can modified by a set of IFieldFormatters. The modified IResult data is then rendered either by IResultRenderers or ISearchFormRenderers in two or more page sections.

Note that the field formatters may add new fields to the temporary result based on the content of the document or of any other fields added to the temporary result from the HTTP request.

Example Uses: Annotations, entity extraction results, classification extractor...,

XML Configuration Template:
    <ContentHandler 
           contentType="[Quickstart content type]" 
           class="com.raritantechnologies.quickstart.userInterface.SplitPageDocumentContentHandler"
           splitType="[LEFT_RIGHT | TOP_BOTTOM ]"
           htmlBodyField="[ name of field that will hold input HTML ]"
           cacheResultKey="[ key to use to store content in session data cache]"
           restoreMode="true|false(default) - determines is cacheing or restoring from cache" >

      <!-- Optional header tag
      <HeaderTag>
         <![CData[<link rel="stylesheet" type="text/css" href="css/styles_factiva.css">>]]>
      </HeaderTag>

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

      <!-- One or more Request parameters to be added to temporary result for processing by FieldFormatters -->
      <RequestParam ID="[ field ID in result ] name="[ name of HTTP request param ]" />

      <!-- multi-value fields should be marked -->
      <RequestParam ID="[ field ID in result ] name="[ name of HTTP request param ]" multiValue="true" />


      <!-- One or more IFieldFormatters that can manipulate the temporary IResult object -->
      <FieldFormatter class="[ class of com.raritantechnologies.searchApp.IFieldFormatter ]" >

      </FieldFormatter>

      <FieldFormatter ... >

      <!-- Two PageQuadrant elements - describe how the temporary IResult fields are to be partitioned -->
      <PageQuadrant width="[ width of this quadrant ]"
                       splitType="[LEFT_RIGHT|TOP_BOTTOM - (if contains a pair of sub PageQuadrant tags)]" >

        <!-- PageQuadrant can use a ResultRenderer -->
        <ResultRenderer class="[ class of com.raritantechnologies.searchApp.taglibrary.IResultRenderer ]" >
            <!-- configuration parameters for ResultRenderer -->
        </ResultRenderer>

        <!-- Alternatively, PageQuadrant can use a SearchFormRenderer -->
        <SearchFormRenderer class="[ class of com.raritantechnologies.searchApp.taglibrary.ISearchFormRenderer ]" >
            <!-- configuration parameters for SearchFormRenderer -->
        </SearchFormRenderer>

        <!-- OR another ContentHandler -->
        <ContentHandler class="[ class of com.raritantechnologies.quickstart.userInterface.IDocumentContentHandler ]" >

        </ContentHandler>

        <!-- OR Can subdivide with a nested PageQuadrant -->
        <PageQuadrant>
          <!-- etc... -->
        </PageQuadrant>

      </PageQuadrant>

    </ContentHandler>
 
Configuration for Composite ContentHandler:
    <ContentHandler 
           contentType="[Quickstart content type]" 
           class="com.raritantechnologies.quickstart.userInterface.SplitPageDocumentContentHandler"
           splitType="[LEFT_RIGHT | TOP_BOTTOM ]" >

      <!-- Two PageQuadrant elements -->
      <PageQuadrant width="[ width of this quadrant ]"
                       splitType="[LEFT_RIGHT|TOP_BOTTOM - (if contains a pair of sub PageQuadrant tags)]" >

        <!-- ContentHandler -->
        <ContentHandler class="[ class of com.raritantechnologies.quickstart.userInterface.IDocumentContentHandler ]" >

        </ContentHandler>

        <!-- OR Can subdivide with a nested PageQuadrant -->
        <PageQuadrant>
          <!-- etc... -->
        </PageQuadrant>

      </PageQuadrant>

    </ContentHandler> 
 

Developed by Raritan Technologies Inc..

Author:
Ted Sullivan

Field Summary
 
Fields inherited from class com.raritantechnologies.quickstart.userInterface.DocumentContentHandlerFilter
theHandler
 
Constructor Summary
SplitPageDocumentContentHandler()
           
 
Method Summary
 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)
           
 
Methods inherited from class com.raritantechnologies.quickstart.userInterface.StringFilterDocumentContentHandler
contentTypeOK, filterString
 
Methods inherited from class com.raritantechnologies.quickstart.userInterface.DocumentContentHandlerFilter
getErrorPage, getHandlerName, getLastContentType, getLastDocumentName, getLastDocumentParamMap, getRequestParameters, sendDocumentContent, sendDocumentContent, setDocumentContentHandler
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SplitPageDocumentContentHandler

public SplitPageDocumentContentHandler()
Method Detail

processContent

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

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 StringFilterDocumentContentHandler