com.raritantechnologies.verity.query
Class VerityQueryFormatter

java.lang.Object
  extended bycom.raritantechnologies.verity.query.VerityQueryFormatter
All Implemented Interfaces:
IConfigurable, IQueryFormatter

public class VerityQueryFormatter
extends java.lang.Object
implements IQueryFormatter, IConfigurable

Formats a readable version of a VQL 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.verity.query.VerityQueryFormatter"
                    displayTitle="Query was:"
                    inComment=[1|0|yes|no|true|false]
                    titleClass="[css class for title]"
                    labelClass="[css class for label]"
                    valueClass="[css class for value]" >

      <Fields>
        <Field ID="[the field ID]" label="[Label for Output]" />
      </Fields>
   </SystemObject>
  </SystemObjects>
 


Developed by Raritan Technologies .

Author:
Ted Sullivan

Constructor Summary
VerityQueryFormatter()
           
 
Method Summary
 void appendCounts(boolean addCounts)
           
 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.
 void initialize(org.w3c.dom.Element elem)
          Initializes the object from an XML tag or element.
 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

VerityQueryFormatter

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

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)

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

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

appendCounts

public void appendCounts(boolean addCounts)
Specified by:
appendCounts in interface IQueryFormatter