com.raritantechnologies.utils.tree
Class LookupTreeBuilder

java.lang.Object
  extended bycom.raritantechnologies.utils.tree.LookupTreeBuilder
All Implemented Interfaces:
IConfigurable, ITreeBuilder

public class LookupTreeBuilder
extends java.lang.Object
implements ITreeBuilder

Composite TreeBuilder that uses a SearchSource to add data to a tree built by a delegate ITreeBuilder. Uses the node ID (usually path) as a search value.

XML Configuration Template:
   <TreeBuilder class="com.raritantechnologies.utils.tree.LookupTreeBuilder"
                   searchSourceName="[ name of search source ]"
                   IDField="[ search field that will get node ID as value]"
                   addResultObjects="true(default)|false" >

     <!-- Source tree builder -->
     <TreeBuilder class="[ class of ITreeBuilder ]" >

     </TreeBuilder>

     <SearchFields>

       <!-- One or more Field elements... -->

       <Field nodeAttribute="[ TreeNode attribute ]" searchField="[ field to search on source ]" />
       <!-- etc ... -->

     </SearchFields>

     <!-- Optional IFieldFormatters to apply to the search results before creating the TreeNodes -->
     <FieldFormatters>
       <Formatter class="[ class of com.raritantechnologies.searchApp.IFieldFormatter ]" >

       </Formatter>

       <!-- etc. . . -->

     </FieldFormatters>

     <ResultFields>
       <Field nodeAttribute="[ TreeNode attribute ]" resultField="[ field in search result ]" />
     </ResultFields>

   </TreeBuilder>

 

Developed by Raritan Technologies Inc..

Author:
Ted Sullivan

Field Summary
 
Fields inherited from interface com.raritantechnologies.utils.tree.ITreeBuilder
TEMPLATE
 
Constructor Summary
LookupTreeBuilder()
           
 
Method Summary
 TreeRoot buildTree(RaritanPageContext pageContext)
           
 java.lang.String getConfigurationXML()
           
 java.lang.String getConfigurationXML(java.lang.String configurationTemplate)
           
 void getConfigurationXML(java.io.Writer writer)
           
 java.lang.String getIDField()
           
 ITreeBuilder getInputBuilder()
           
 java.lang.String getSearchSourceName()
           
 void initialize(org.w3c.dom.Element elem)
          Initializes the object from an XML tag or element.
 TreeRoot refreshTree(TreeRoot theTree, RaritanPageContext pContext)
          Method to enable dynamic or refreshable trees.
 void setIDField(java.lang.String idField)
           
 void setInputBuilder(ITreeBuilder inputBuilder)
           
 void setSearchSourceName(java.lang.String searchSourceName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LookupTreeBuilder

public LookupTreeBuilder()
Method Detail

buildTree

public TreeRoot buildTree(RaritanPageContext pageContext)
Specified by:
buildTree in interface ITreeBuilder

refreshTree

public TreeRoot refreshTree(TreeRoot theTree,
                            RaritanPageContext pContext)
Description copied from interface: ITreeBuilder

Method to enable dynamic or refreshable trees. Static tree builders should implement this by returning the passed in tree object. Dynamic tree builders should implement this by returning the output of their buildTree( ) method or by pruning/growing the given tree as appropriate.

ITreeBuilders that support "lazy tree node evaluation" should use this method to determine which nodes in the tree need to be updated (TreeNode.needsUpdate( ) method returns true.

Specified by:
refreshTree in interface ITreeBuilder

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 IConfigurable

setSearchSourceName

public void setSearchSourceName(java.lang.String searchSourceName)

getSearchSourceName

public java.lang.String getSearchSourceName()

setInputBuilder

public void setInputBuilder(ITreeBuilder inputBuilder)

getInputBuilder

public ITreeBuilder getInputBuilder()

setIDField

public void setIDField(java.lang.String idField)

getIDField

public java.lang.String getIDField()

getConfigurationXML

public void getConfigurationXML(java.io.Writer writer)
                         throws java.io.IOException
Throws:
java.io.IOException

getConfigurationXML

public java.lang.String getConfigurationXML()

getConfigurationXML

public java.lang.String getConfigurationXML(java.lang.String configurationTemplate)