com.raritantechnologies.quickstart.userInterface
Class HighlightingDocumentContentHandler

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

public class HighlightingDocumentContentHandler
extends DocumentContentHandlerFilter

Applies highlighting of query words (and stemmed variants) found in a content stream:

XML Configuration schema:
    <ContentHandler 
           contentType="[Quickstart content type]" 
           class="com.raritantechnologies.quickstart.userInterface.HighlightingDocumentContentHandler"
           queryParam="[name of query parameter in last query to use for highlighting]"
           hlBegin="[ tag to start highlighted section e.g. <span class="foo">]"
           hlEnd="[tag to end highlighted section e.g. </span>"
           minWordLength="3" >

      <StopWords>
          <StopWord>ignore word 1</StopWord>
          <StopWord>ignore word 2</StopWord>
      </StopWords>


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

    </ContentHandler>
  


Developed by Raritan Technologies Inc..

Author:
Kepler Gelotte

Field Summary
protected  int minWordLength
           
protected  java.util.HashSet stopWords
           
 
Fields inherited from class com.raritantechnologies.quickstart.userInterface.DocumentContentHandlerFilter
theHandler
 
Constructor Summary
HighlightingDocumentContentHandler()
           
 
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.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
 

Field Detail

minWordLength

protected int minWordLength

stopWords

protected java.util.HashSet stopWords
Constructor Detail

HighlightingDocumentContentHandler

public HighlightingDocumentContentHandler()
Method Detail

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