com.raritantechnologies.utils.tree.taglibrary
Class TreeRequestFormatter

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

public class TreeRequestFormatter
extends java.lang.Object
implements IRequestFormatter, ITreeNodeHyperlinkRenderer

Creates a tree that formats hyperlinks given an HTTP Request.

Builds node hyperlink from tree Attributes and http request parameters. The hrefTemplateAttribute should contain a URL template with {Request Parameter} placeholders using '{' and '}'. The node hyperlink will be built by replacing these placeholders with request values.

XML Configuration Template:
   <RequestFormatter class="com.raritantechnologies.utils.tree.taglibrary.TreeRequestFormatter"
                        hrefTemplateAttribute="[ tree node attribute that has the href template ]" >

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

     </TreeBuilder>

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

     </TreeRenderer>

   </RequestFormatter>
 


Constructor Summary
TreeRequestFormatter()
           
 
Method Summary
 java.lang.String formatSearchRequest(RaritanPageContext pageContext)
          Reformat the http request as a String.
 java.lang.String getHyperlink(java.lang.String sessionID, java.lang.String targetURL, TreeNode treeNode, OrderedMap searchAttributes)
          searchAttributes has http request param = treeNode attribute - renderer uses this map to build a query from the TreeNode data.
 void initialize(org.w3c.dom.Element elem)
          Initializes the object from an XML tag or element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TreeRequestFormatter

public TreeRequestFormatter()
Method Detail

formatSearchRequest

public java.lang.String formatSearchRequest(RaritanPageContext pageContext)
Description copied from interface: IRequestFormatter
Reformat the http request as a String.

Specified by:
formatSearchRequest in interface IRequestFormatter

getHyperlink

public java.lang.String getHyperlink(java.lang.String sessionID,
                                     java.lang.String targetURL,
                                     TreeNode treeNode,
                                     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 IRequestFormatter