com.raritantechnologies.quickstart.taglibrary.request
Class DynamicRequestFormatter

java.lang.Object
  extended bycom.raritantechnologies.quickstart.taglibrary.request.DynamicRequestFormatter
All Implemented Interfaces:
IConfigurable, IRequestFormatter

public class DynamicRequestFormatter
extends java.lang.Object
implements IRequestFormatter

Formats an http request based on the properties of the request and/or user.

XML Configuration Template:
   <SystemObject type="RequestFormatter" name="System Object Name"
                    configurableClass="com.raritantechnologies.quickstart.taglibrary.request.DynamicRequestFormatter" >

    <!-- ============================================================= -->
    <!--   One or more <UseFormatter> tags. A UseFormatter contains    -->
    <!--   two sections. One that defines what request or user         -->
    <!--   criteria are used to select a RequestFormatter (one of      -->
    <!--   <RequestParams>, <UserParams> tags). Each UseFormatter tag  -->
    <!--   tag also contains a nested <RequestFormatter> tag that will -->
    <!--   be used if the selection criteria match.                    -->
    <!-- ============================================================= -->
    <UseFormatter>

     <RequestParams>
       <Param name="[request parameter name]">
         <ValidValues>  <!-- Any of these values will activate the element renderer -->
           <Value matchType="equals(default)|contains" >A valid value</Value>
           <Value matchType="equals(default)|contains" >Another valid value</Value>

           <!-- Can also match if the value EXISTS -->
           <Value>EXISTS | NOT_NULL</Value>
         </ValidValues>
       </Param>

       <!-- If the above field is valid, check this field (fields are ANDed) -->
       <Param name="[another field]">
         <ValidValues>  <!-- Any of these values will activate the element renderer: -->
           <Value>A value</Value>
           <Value>Another good value</Value>
         </ValidValues>
       </Param>
     </RequestParams>

     <UserParams>
       <Param name="[user attribute name]">
         <ValidValues>  <!-- Any of these values will activate the element renderer -->
           <Value matchType="equals(default)|contains" >A valid value</Value>
           <Value>Abother valid value</Value>
         </ValidValues>
       </Param>

       <!-- If the above field is valid, check this field (fields are ANDed) -->
       <Param name="[another user attribute]">
         <ValidValues>  <!-- Any of these values will activate the element renderer: -->
           <Value>A value</Value>
           <Value>Another good value</Value>
         </ValidValues>
       </Param>
     </UserParams>

     <!-- The RequestFormatter to use if the input parameters match the above: -->
       <RequestFormatter class="[some com.raritantechnologies.quickstart.taglibrary.request.IRequestFormatter class]" >
           <!-- configuration parameters for IRequestFormatter -->
       </RequestFormatter> 

    </UseFormatter>

    <UseFormatter>
       <!-- etc... -->
    </UseFormatter>

    <!-- Request Formatter to use if none of the UseFormatter criterion matches -->
    <DefaultFormatter
         class="[some com.raritantechnologies.quickstart.taglibrary.request.IRequestFormatter class]" >
       <!-- configuration parameters for IRequestFormatter -->
    </DefaultFormatter>

   </SystemObject>
 

Developed by Raritan Technologies Inc..

Author:
Ted Sullivan

Constructor Summary
DynamicRequestFormatter()
           
 
Method Summary
 java.lang.String formatSearchRequest(RaritanPageContext pageContext)
          Reformat the http request as a String.
 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

DynamicRequestFormatter

public DynamicRequestFormatter()
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

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