com.raritantechnologies.utils.tree
Class TaxonomySearchHyperlinkRenderer

java.lang.Object
  extended bycom.raritantechnologies.utils.tree.TaxonomySearchHyperlinkRenderer
All Implemented Interfaces:
IConfigurable, ITreeNodeHyperlinkRenderer

public class TaxonomySearchHyperlinkRenderer
extends java.lang.Object
implements ITreeNodeHyperlinkRenderer

Generates a search hyperlink from the data in a TreeNode. It can map search parameters originating from an external source (such as an HTTP request) or will use the tree node attributes 'as is' to generate a node hyperlink. It can also use a pattern string to format the hyperlink from tree node attributes.

XML Configuration Template:
   <LinkRenderer class="com.raritantechnologies.utils.tree.TaxonomySearchHyperlinkRenderer"
                    hrefParam="[ optional Tree node attribute with hyperlink URL ]"
                    hrefPattern="[ pattern for href {path} {name} will get path and name respectively ]"
                    onlyLeafNodes="[true|false(default)]"
                    appendAttributes="[true|false(default)] - if true multiple attribute values are appended ]"
                    requestParams="[ comma separated list of request parameters to include in link ]"
                    sessionParams="[ comma separated list of session data parameters to include in link ]"
                    renderRoot="[ true(default)|false - if tree include tree name in path ]" >

      <!-- ==================================================================  -->
      <!-- Direct map of attribute name to http Request Parameter              -->
      <!-- ==================================================================  -->
      <AttributeFieldMap  resultFieldDelimiter="[ optional delimiter if multiple values expected ]">
         <Field nodeAttribute="[ NAME | PATH | ID | name of node attribute ]" httpParameter="[ name of http parameter ]"
                   required="[true|false(default)]" />
         <!-- ====================== -->
         <!-- Optional String Filter -->
         <!-- ====================== -->
         <Field nodeAttribute="[ NAME | PATH | ID | name of node attribute ]" httpParameter="[ name of http parameter ]" >
           <StringFilter class="[ class of IStringFilter ]" >

           </StringFilter>
         </Field>

         <!-- Extracting values from nested IResult objects -->
         <ResultField ID="[ name of nested IResult attribute ]" httpParameter="[ name of http parameter ]"  />

         <!-- Extract a value from a nested IResult object and apply a StringFilter operation -->
         <ResultField ID="[ name of nested IResult attribute ]" httpParameter="[ name of http parameter ]" >
           <StringFilter class="[ class of com.raritantechnologies.utils.filter.IStringFilter ]" >

           </StringFilter>
         </ResultField>

      </AttributeFieldMap>

      <!-- ==================================================================  -->
      <!-- Optional: use a MapFilter to modify the external search attributes  -->
      <!-- Creates a map of http parameter to TreeNode attribute name          -->
      <!-- ==================================================================  -->
      <MapFilter class="[ class of com.raritantechnologies.utils.filter.IMapFilter ]" >

      </MapFilter>

      <!-- ===================================================================== -->
      <!-- Optional: ITreeNodeFilter to filter node before generating hyperlinks -->
      <!-- ===================================================================== -->
      <TreeNodeFilter class="[ class of com.raritantechnologies.utils.tree.filter.ITreeNodeFilter ]" >

      </TreeNodeFilter>

      <!-- ===================================================================== -->
      <!-- Optional: List of request parameters to EXCLUDE from the hyperlink    -->
      <!-- ===================================================================== -->
      <ExcludedRequestParameters>
        <ExcludedParam name="[ name of http request parameter to exclude ]" />
        <Comparator class="[ class of com.raritantechnologies.utils.comparators.IComparator ]" />
      </ExcludedRequestParameters>

      <!-- ===================================================================== -->
      <!--      Optional QueryParser to manipulate query parameter map           -->
      <!-- ===================================================================== -->
      <QueryParser class="[ class of com.raritantechnologies.searchApp.IQueryParser ]"
                      useWithURL="[ optional url to use parser with ]" >

      </QueryParser>

      <!-- ===================================================================== -->
      <!-- One or more Fixed Parameters: NOTE: fixed parameters will override    -->
      <!-- parameters in input request                                           -->
      <!-- ===================================================================== -->
      <FixedParam name="[ param name ]" value="[ value of param ]" />

      <!-- ===================================================================== -->
      <!-- Can include a nested Renderer that can be used to create an embedded  -->
      <!-- hyperlink. (Can be used to send a redirect link).                     -->
      <!-- ===================================================================== -->
      <NestedLinkRenderer requestParam="[ parameter used in parent link ]"
                             class="[ class of com.raritantechnologies.utils.tree.ITreeNodeHyperlinkRenderer ]" >
      </NestedLinkRenderer>

   </LinkRenderer>

  

Developed by Raritan Technologies Inc..

Author:
Ted Sullivan

Constructor Summary
TaxonomySearchHyperlinkRenderer()
           
 
Method Summary
 java.lang.String getConfigurationXML()
           
 java.lang.String getHrefParam()
           
 java.lang.String getHyperlink(java.lang.String sessionID, java.lang.String targetURL, TreeNode trNode, OrderedMap searchAttributes)
          searchAttributes has http request param = treeNode attribute - renderer uses this map to build a query from the TreeNode data.
 IMapFilter getMapFilter()
           
 IQueryParser getQueryParser()
           
 void initialize(org.w3c.dom.Element elem)
          Initializes the object from an XML tag or element.
 void setHrefParam(java.lang.String hrefParam)
           
 void setMapFilter(IMapFilter searchMapFilter)
           
 void setQueryParser(IQueryParser queryParser)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TaxonomySearchHyperlinkRenderer

public TaxonomySearchHyperlinkRenderer()
Method Detail

getHyperlink

public java.lang.String getHyperlink(java.lang.String sessionID,
                                     java.lang.String targetURL,
                                     TreeNode trNode,
                                     OrderedMap searchAttributes)
Description copied from interface: ITreeNodeHyperlinkRenderer
searchAttributes has http request param = treeNode attribute - renderer uses this map to build a query from the TreeNode data.

Specified by:
getHyperlink in interface ITreeNodeHyperlinkRenderer

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

setHrefParam

public void setHrefParam(java.lang.String hrefParam)

getHrefParam

public java.lang.String getHrefParam()

setMapFilter

public void setMapFilter(IMapFilter searchMapFilter)

getMapFilter

public IMapFilter getMapFilter()

setQueryParser

public void setQueryParser(IQueryParser queryParser)

getQueryParser

public IQueryParser getQueryParser()

getConfigurationXML

public java.lang.String getConfigurationXML()