atg.search.query.formhandlers
Class MapXMLBuilder

java.lang.Object
  extended by atg.search.query.formhandlers.MapXMLBuilder
All Implemented Interfaces:
XMLBuilder
Direct Known Subclasses:
CustomCatalogXMLBuilder

public class MapXMLBuilder
extends java.lang.Object
implements XMLBuilder

This class supports building arbitrarily complex constraints tags in JSP via form handler input tags.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
Constructor Summary
MapXMLBuilder()
           
 
Method Summary
 java.lang.String buildXML(BaseSearchFormHandler pFormHandler, ClientRequest pClientRequest, java.lang.String pTagName)
          Build the constraints XML and return it as a string.
 java.lang.String buildXML(GenericFormHandler pFormHandler, java.lang.String pTagName)
           
protected  void dumpHashMapMap(java.util.Map pMap, java.lang.String pIndent)
          For debugging, dump the map of tag data using the form handler's logDebug()
 java.lang.String getDefaultValue()
          Get the default XML value to return from buildXML
protected  GenericFormHandler getFormHandler()
          Get the form handler invoking buildXML()
protected  java.lang.String getTagName()
          Get the name of the constraints tag passed to buildXML()
 java.util.Map getTags()
          Get the map used to store tag creation/value data
protected  java.lang.String getWrappedXML(java.lang.String pXML)
          Get XML request wrapped with optional wrappingXML.
 java.lang.String getWrappingXML()
          Get the wrapping XML.
 void setDefaultValue(java.lang.String pDefaultValue)
          Set the default value to return from buildXML()
 void setWrappingXML(java.lang.String pWrappingXML)
          Set the wrapping XML.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string

Constructor Detail

MapXMLBuilder

public MapXMLBuilder()
Method Detail

buildXML

public java.lang.String buildXML(BaseSearchFormHandler pFormHandler,
                                 ClientRequest pClientRequest,
                                 java.lang.String pTagName)
Build the constraints XML and return it as a string.

Specified by:
buildXML in interface XMLBuilder
Parameters:
pFormHandler - the invoking form handler
pClientRequest - the client request
pTagName - the name of the tag into which to put the constraints.
Returns:
the constraints String or null

buildXML

public java.lang.String buildXML(GenericFormHandler pFormHandler,
                                 java.lang.String pTagName)
Specified by:
buildXML in interface XMLBuilder

getTags

public java.util.Map getTags()
Get the map used to store tag creation/value data

Returns:
a map to hold tag data

getWrappingXML

public java.lang.String getWrappingXML()
Get the wrapping XML. This XML is used to wrap any result XML. This functionality uses MessageFormat to format the wrapped XML, so the wrapping XML should indicate where the wrapped XML is to appear with {0}. For example, "<and><strprop...>{0}</and>"

Returns:
the wrapping XML
See Also:
getWrappedXML(java.lang.String)

setWrappingXML

public void setWrappingXML(java.lang.String pWrappingXML)
Set the wrapping XML. This XML is used to wrap any result XML. This functionality uses MessageFormat to format the wrapped XML, so the wrapping XML should indicate where the wrapped XML is to appear with {0}. For example, "<and><strprop...>{0}</and>"

Parameters:
pWrappingXML - the wrapping XML or null
See Also:
getWrappedXML(java.lang.String)

setDefaultValue

public void setDefaultValue(java.lang.String pDefaultValue)
Set the default value to return from buildXML()

Parameters:
pDefaultValue - the default XML as a string

getDefaultValue

public java.lang.String getDefaultValue()
Get the default XML value to return from buildXML

Returns:
the default XML

getWrappedXML

protected java.lang.String getWrappedXML(java.lang.String pXML)
Get XML request wrapped with optional wrappingXML. Returns pXML if wrappingXML is empty or null, otherwise, returns pXML wrapped with wrappingXML. This functionality uses MessageFormat to format the wrapped XML, so the wrapping XML should indicate where the wrapped XML is to appear with {0}. For example, "<and><strprop...>{0}</and>"

Parameters:
pXML - the XML to wrap
See Also:
setWrappingXML(java.lang.String)

getFormHandler

protected GenericFormHandler getFormHandler()
Get the form handler invoking buildXML()

Returns:
the form handler

getTagName

protected java.lang.String getTagName()
Get the name of the constraints tag passed to buildXML()

Returns:
the name of the constraints tag

dumpHashMapMap

protected void dumpHashMapMap(java.util.Map pMap,
                              java.lang.String pIndent)
For debugging, dump the map of tag data using the form handler's logDebug()

Parameters:
pMap - the root level map
pIndent - the indent string or null for top-level map