com.raritantechnologies.utils.tree
Class TreeBuilderOutputProcessor

java.lang.Object
  extended bycom.raritantechnologies.utils.tree.TreeBuilderOutputProcessor
All Implemented Interfaces:
IGatewayOutputProcessor

public class TreeBuilderOutputProcessor
extends java.lang.Object
implements IGatewayOutputProcessor

Creates a Tree from a set of IResultSet objects generated by an ICollectionGateway. Then uses a TreeXMLGenerator to create an XML output of the tree which is then written to an output file.

XML Configuration Template:
   <GatewayOutputProcessor class="com.raritantechnologies.utils.tree.TreeBuilderOutputProcessor"
                              treePathField="[result path to get tree paths from]"
                              treeName="[name of root node]"
                              treeRootClass="[optional class name of root node]"
                              treeNodeClass="[optional class name of nodes]"
                              filename="[name of output xml file]"
                              dbTreeManager="[ name of DBTreeManager ]"
                              addCounts="[true(default)|false]"
                              pathSeparator="[ tree path separator default='/' ]" >

      <ResultAttributeMap>
        <Field resultField="[ fieldID in result ]" attribute="[ tree node attribute ]" />
      </ResultAttributeMap>

     <!-- Optional ITreeNodeFilter -->
     <TreeFilter >
       <NodeFilter class="class of com.raritantechnologies.utils.tree.filter.ITreeNodeFilter ]" >

       </NodeFilter>
     </TreeFilter>

     <!-- Optional ITreeXMLGenerator -->
     <TreeXMLGenerator class="[ class of ITreeXMLGenerator ]"
                            rootTagName="[tag name of xml root]"
                          nodeTagName="[tag name of nodes]"
                          parentTagName="[tag name of parent node]" />

     <!-- Optional ITreeProcessor -->
     <TreeProcessor class="[ class of com.raritantechnologies.utils.tree.ITreeProcessor ]" >

     </TreeProcessor>

     <!-- A delegate IGatewayOutputProcessor: If this is used - tree will be converted to a set of IResult objects -->
     <!-- and sent for processing. -->
     <OutputProcessor class="[ class of com.raritantechnologies.searchApp.dataCollection.IGatewayOutputProcessor ]"
                         nameField="[ result field that gets TreeNode name ]"
                         idField="[ result field that gets treeNode ID ]" >

     </OutputProcessor>

   </GatewayOutputProcessor>
 

Developed by Raritan Technologies Inc..

Author:
Ted Sullivan

Constructor Summary
TreeBuilderOutputProcessor()
           
 
Method Summary
 void dataComplete()
          Data feed is complete.
 java.lang.String getConfigurationXML()
           
 void initialize(org.w3c.dom.Element outputProcElem, ISearchFieldMap sfMap)
          Initialize the GatewayOutputProcessor from XML Configuration Element.
 void initialize(java.util.Map initParams)
          Use this to initialize dynamic properties: treePathField, treeName, outputFileName
 java.lang.String processData(IResultSet data)
          returns name of XML File created/appended.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TreeBuilderOutputProcessor

public TreeBuilderOutputProcessor()
Method Detail

processData

public java.lang.String processData(IResultSet data)
Description copied from interface: IGatewayOutputProcessor
returns name of XML File created/appended.

Specified by:
processData in interface IGatewayOutputProcessor

dataComplete

public void dataComplete()
Description copied from interface: IGatewayOutputProcessor
Data feed is complete.

Specified by:
dataComplete in interface IGatewayOutputProcessor

initialize

public void initialize(java.util.Map initParams)
Use this to initialize dynamic properties: treePathField, treeName, outputFileName

Specified by:
initialize in interface IGatewayOutputProcessor

initialize

public void initialize(org.w3c.dom.Element outputProcElem,
                       ISearchFieldMap sfMap)
Description copied from interface: IGatewayOutputProcessor
Initialize the GatewayOutputProcessor from XML Configuration Element.

Specified by:
initialize in interface IGatewayOutputProcessor

getConfigurationXML

public java.lang.String getConfigurationXML()
Specified by:
getConfigurationXML in interface IGatewayOutputProcessor