com.raritantechnologies.utils.tree.filter
Class MergeTreeNodesFilter

java.lang.Object
  extended bycom.raritantechnologies.utils.tree.filter.MergeTreeNodesFilter
All Implemented Interfaces:
IConfigurable, IMergeTreeNodesFilter, ITreeNodeFilter

public class MergeTreeNodesFilter
extends java.lang.Object
implements ITreeNodeFilter, IMergeTreeNodesFilter

TreeNode filter that uses another tree source to add attribute data from the source tree nodes the target tree nodes. Uses a TreeSearchSource to find matching nodes in the source tree.

XML Configuration Template:
   <MergeNodeFilter class="com.raritantechnologies.utils.tree.filter.MergeTreeNodesFilter"
                       sourceTreeBuilder="[ name of source tree builder (system object ) ]"
                       debug_xml="[true|false(default)]" 
                       debug="[true|false(default) ]" >

     <SourceTreeBuilder class="[ class of com.raritantechnologies.utils.tree.ITreeBuilder ]" >

     </SourceTreeBuilder>

     <!-- Search attributes to use to match target TreeNode with a source node -->
     <SearchAttributes caseSensitive="true(default)|false" fieldOperator="[AND|OR(default)]" >
       <!-- one or more Attribute tags -->
       <!-- target attribute can be one of Attribute:[attribute name ] or ResultPath:[ result path name ] -->
       <Attribute targetAttribute="[ name of attribute in target node ]" searchField=[ name of field in search ]" />
       <Attribute targetAttribute="[ name of attribute in target node ]" value=[ field value ]" />
     </SearchAttributes>

     <!-- One or more MergeNodeFilters to operate on the matching nodes -->
     <MergeAttributesFilter class="[ class of com.raritantechnologies.utils.tree.filter.IMergeTreeNodesFilter ]" >

     </MergeAttributesFilter>

   </MergeNodeFilter>
 

Developed by Raritan Technologies Inc..

Author:
Ted Sullivan

Field Summary
 
Fields inherited from interface com.raritantechnologies.utils.tree.filter.ITreeNodeFilter
TEMPLATE
 
Constructor Summary
MergeTreeNodesFilter()
           
 
Method Summary
 TreeNode filterNode(TreeNode treeNode, RaritanPageContext pageContext)
          Filters a treeNode by adding attributes from matching node(s) in a source tree.
 TreeNode filterNode(TreeNode treeNode, TreeRoot sourceTree, RaritanPageContext pageContext)
          Filters a 'target' TreeNode by looking up corresponding nodes in the source tree and adding attributes from the source tree to the target tree node.
 void initialize(org.w3c.dom.Element elem)
          Initializes the object from an XML tag or element.
 void initializeTreeSearchSource()
           
 TreeNode mergeNodes(TreeNode node1, TreeNode node2, TreeRoot sourceTree, RaritanPageContext rpc)
          Delegates merge operation to nested IMergeTreeNodesFilter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MergeTreeNodesFilter

public MergeTreeNodesFilter()
Method Detail

filterNode

public TreeNode filterNode(TreeNode treeNode,
                           RaritanPageContext pageContext)
Filters a treeNode by adding attributes from matching node(s) in a source tree.

Specified by:
filterNode in interface ITreeNodeFilter

filterNode

public TreeNode filterNode(TreeNode treeNode,
                           TreeRoot sourceTree,
                           RaritanPageContext pageContext)
Filters a 'target' TreeNode by looking up corresponding nodes in the source tree and adding attributes from the source tree to the target tree node.


mergeNodes

public TreeNode mergeNodes(TreeNode node1,
                           TreeNode node2,
                           TreeRoot sourceTree,
                           RaritanPageContext rpc)
Delegates merge operation to nested IMergeTreeNodesFilter.

Specified by:
mergeNodes in interface IMergeTreeNodesFilter

initializeTreeSearchSource

public void initializeTreeSearchSource()

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