com.raritantechnologies.searchApp.query
Class DisplayQueryFormatter

java.lang.Object
  extended bycom.raritantechnologies.searchApp.query.DisplayQueryFormatter
All Implemented Interfaces:
IConfigurable, IDisplayControlRenderer, IQueryFormatter

public class DisplayQueryFormatter
extends java.lang.Object
implements IQueryFormatter, IDisplayControlRenderer

Formats query for "Search was" displays or to be put in an HMTL comment.

XML Configuration Template:
  <SystemObjects>
   <SystemObject type="QueryFormatter" name="someName" 
                    class="com.raritantechnologies.searchApp.query.DisplayQueryFormatter"
                    displayTitle="Query was:"
                    inComment="[1|0|yes|no|true|false]"
                    useTable="[1|0|yes|no|true|false]"
                    titleClass="[css class for title]"
                    labelClass="[css class for label]"
                    valueClass="[css class for value]"
                    initFrom="request|lastQuery" 
                    maxLength=" maximum query length" >

      <Fields>
        <Field ID="[the field ID]" label="[Label for Output]" />
        <Field ID="[Another field ID]" label="output label" >
           <!-- StringFilter for this field alone -->
           <StringFilter class="[string filter class]" >
           </StringFilter>
        </Field>
      </Fields>

      <!-- StringFilter to be applied to all fields -->
      <StringFilter class="[IStringFilter class]" >

      </StringFilter>
   </SystemObject>
  </SystemObjects>
 

Developed by Raritan Technologies .

Author:
Ted Sullivan

Constructor Summary
DisplayQueryFormatter()
           
 
Method Summary
 void appendCounts(boolean addCounts)
          if true - add result counts to query display
 java.lang.String formatQuery(RaritanPageContext pageContext)
          Format a query from the current input context:
 java.lang.String formatQuery(java.lang.String sessionID, OrderedMap queryParams)
           
 java.lang.String formatQuery(java.lang.String sessionID, QueryResultBean qrb)
          Returns a string for the form parameters submitted in queryParams that is in the correct format.
 java.lang.String getBody(IDisplayFormRenderer parent, java.lang.String displayForm, RaritanPageContext pageContext)
           
 void initialize(org.w3c.dom.Element elem)
          Initializes the object from an XML tag or element.
 void initialize(java.util.Map paramMap)
           
 void setDisplayTitle(java.lang.String displayTitle)
           
 void setFieldLabelMap(java.util.Map fieldLabelMap)
          Maps the fieldID to the Label to use.
 void setFieldLabelMap(java.lang.String packedFieldList)
           
 void setLabelClass(java.lang.String labelClass)
           
 void setTitleClass(java.lang.String titleClass)
           
 void setValueClass(java.lang.String valueClass)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DisplayQueryFormatter

public DisplayQueryFormatter()
Method Detail

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 IQueryFormatter

initialize

public void initialize(java.util.Map paramMap)
Specified by:
initialize in interface IDisplayControlRenderer

setDisplayTitle

public void setDisplayTitle(java.lang.String displayTitle)

setTitleClass

public void setTitleClass(java.lang.String titleClass)

setLabelClass

public void setLabelClass(java.lang.String labelClass)

setValueClass

public void setValueClass(java.lang.String valueClass)

appendCounts

public void appendCounts(boolean addCounts)
if true - add result counts to query display

Specified by:
appendCounts in interface IQueryFormatter

setFieldLabelMap

public void setFieldLabelMap(java.lang.String packedFieldList)

setFieldLabelMap

public void setFieldLabelMap(java.util.Map fieldLabelMap)
Maps the fieldID to the Label to use. Selects the fields that are to be extracted from the query parameters. Map of fieldID --> Field Label


formatQuery

public java.lang.String formatQuery(java.lang.String sessionID,
                                    QueryResultBean qrb)
Description copied from interface: IQueryFormatter
Returns a string for the form parameters submitted in queryParams that is in the correct format.

Specified by:
formatQuery in interface IQueryFormatter

formatQuery

public java.lang.String formatQuery(java.lang.String sessionID,
                                    OrderedMap queryParams)
Specified by:
formatQuery in interface IQueryFormatter

getBody

public java.lang.String getBody(IDisplayFormRenderer parent,
                                java.lang.String displayForm,
                                RaritanPageContext pageContext)
Specified by:
getBody in interface IDisplayControlRenderer

formatQuery

public java.lang.String formatQuery(RaritanPageContext pageContext)
Description copied from interface: IQueryFormatter
Format a query from the current input context:

Specified by:
formatQuery in interface IQueryFormatter