com.raritantechnologies.utils.tree.taglibrary
Class TreeResultRenderer

java.lang.Object
  extended bycom.raritantechnologies.utils.tree.taglibrary.TreeResultRenderer
All Implemented Interfaces:
IConfigurable, IResultRenderer

public class TreeResultRenderer
extends java.lang.Object
implements IResultRenderer

Renders a tree object that is obtained from an IResult in one of several ways: From a nested result set with a set of tree paths; from a multiple value field with a set of paths or from a single path value, linked to a Tree object.

Displaying a subpath in a tree: The treeName and renderedTreePath fields should be used be used to 'prune' the tree. When the tree is built from the IResult path data, a new root node (treeName) will be prepended. To avoid displaying this extra path, use a renderedTreePath that starts with the new tree name and includes any other portions of the tree that can be eliminated. For example, if the treeName attribute is set to "DisplayTree_{RESULTNUM}", choose a renderedTreePath of "/DisplayTree_{RESULTNUM}/OldRoot/[etc]" to start the displayed tree below the "OldRoot" node.

XML Configuration Template:
    <!-- Configuration version that uses a ResultPathTreeBuilder to create a tree from a set of result path values -->
    <ResultRenderer class="com.raritantechnologies.utils.tree.taglibrary.TreeResultRenderer" 
                       nestedResultField="[ field containing nested ResultSet ]"
                       nestedPathField="[ field within nested results with tree path ]"
                       multiValueField="[ alternate result field with multiple tree path values ]"
                       treeNameField="[ field that is used to specify name of tree ]"
                       treeName="[ fixed Tree name - if unique needed: use _{RESULTNUM} ]"
                       treeURL="[ fixed Tree URL ]"
                       renderedTreePath="[ starting point of rendered Tree ]"
                       treeAttributeFields="[ comma separated result fields to be included in tree result ]"
                       resultTreeField="[ result field where complete tree should be set/retrieved ]"
                       alwaysBuildTree="[true|false(default)]"
                       preBuiltTree="[ true|false(default)] - if true - tree has already been added ]" >

      <!-- Optional FieldFormatter to modify result before rendering -->
      <FieldFormatter class="[ class of com.raritantechnologies.searchApp.IFieldFormatter ]" >

      </FieldFormatter>

      <!-- Optional TreeFilter to modify built tree before rendering -->
      <TreeFilter class="[ class of com.raritantechnologies.utils.tree.ITreeFilter ]" >

      </TreeFilter>

      <TreeRenderer class="[ class of com.raritantechnologies.utils.tree.taglibrary.ITreeRenderer ]" >

      </TreeRenderer>

      <LinkRenderer class="[ class of com.raritantechnologies.tree.ITreeNodeHyperlinkRenderer ]" >

      </LinkRenderer>

    </ResultRenderer>

    <!-- Configuration Version that renders a portion of a tree based on a single path result value -->
    <ResultRenderer class="com.raritantechnologies.utils.tree.taglibrary.TreeResultRenderer" >

      <!-- Optional FieldFormatter to modify result before rendering -->
      <FieldFormatter class="[ class of com.raritantechnologies.searchApp.IFieldFormatter ]" >

      </FieldFormatter>
                   
      <!-- TreeBuilder for use with treePathField -->
      <TreeBuilder class="[ class of com.raritantechnologies.utils.tree.ITreeBuilder ]"
                      treePathField="[ result field with single tree path value ]" >

      </TreeBuilder>

      <TreeRenderer class="[ class of com.raritantechnologies.utils.tree.taglibrary.ITreeRenderer ]" >

      </TreeRenderer>

      <LinkRenderer class="[ class of com.raritantechnologies.tree.ITreeNodeHyperlinkRenderer ]" >

      </LinkRenderer>

    </ResultRenderer>
 

Developed by Raritan Technologies Inc..

Author:
Ted Sullivan

Field Summary
 
Fields inherited from interface com.raritantechnologies.searchApp.taglibrary.IResultRenderer
TEMPLATE
 
Constructor Summary
TreeResultRenderer()
           
 
Method Summary
 java.lang.String getConfigurationXML()
           
 java.lang.String getConfigurationXML(java.lang.String configurationTemplate)
           
 IResultRenderer getRenderer(java.lang.String name)
          Provides for nested result renderers.
 void initialize(org.w3c.dom.Element elem)
          IResultRenderers are XML configurable.
 boolean isEnabled()
           
 java.lang.String renderResult(IResult result, int firstResult, int lastResult, int resultNum, RaritanPageContext pageContext)
          return an HTML fragment using the data contained within the IResult object.
 void setEnable(boolean enabled)
          provides show/hide control.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TreeResultRenderer

public TreeResultRenderer()
Method Detail

renderResult

public java.lang.String renderResult(IResult result,
                                     int firstResult,
                                     int lastResult,
                                     int resultNum,
                                     RaritanPageContext pageContext)
Description copied from interface: IResultRenderer
return an HTML fragment using the data contained within the IResult object.

Specified by:
renderResult in interface IResultRenderer

initialize

public void initialize(org.w3c.dom.Element elem)
Description copied from interface: IResultRenderer
IResultRenderers are XML configurable.

Specified by:
initialize in interface IResultRenderer

getConfigurationXML

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

getConfigurationXML

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

setEnable

public void setEnable(boolean enabled)
Description copied from interface: IResultRenderer
provides show/hide control.

Specified by:
setEnable in interface IResultRenderer

isEnabled

public boolean isEnabled()
Specified by:
isEnabled in interface IResultRenderer

getRenderer

public IResultRenderer getRenderer(java.lang.String name)
Description copied from interface: IResultRenderer
Provides for nested result renderers. returns an instance of IResultRenderer or null if result renderer of given name is not found.

Specified by:
getRenderer in interface IResultRenderer