com.raritantechnologies.searchApp.taglibrary
Class PageParameterMapTag

java.lang.Object
  extended byBodyTagSupport
      extended bycom.raritantechnologies.searchApp.taglibrary.PageParameterMapTag
All Implemented Interfaces:
IConfigurable, ICustomTag

public class PageParameterMapTag
extends BodyTagSupport
implements ICustomTag

Custom tag which enables configurable parameter sets to be selected via an HTTP "AppID" request parameter.

The http request parameter "AppID" is used to lookup a Parameter Map table containing application specific data. The custom tag defines three page variables "AppID", "appName" and "sourceName". The values for these variables are defined in the configuration XML, keyed by the "AppID" passed in the URL request:


http://the.host.domain/thePage.jsp?AppID=abdefg123

The two parameters set by this tag: Application Name and Source Name can be used to drive other dynamic or context-switchable behaviors to achieve different "looks" or functional connectivity.

XML Configuration Template:
  <ParamMaps>
   <ParamMap param="AppID" value="abcdefg123" >
     <field name="appName" value="[Application Name]" />
     <field name="sourceName" value="[Search Source Name]" />
   </ParamMap>
  </ParamMaps>
  
Creates these page parameters: The page parameters can then be used in the JSP page using the <%= %> operator. For example:
<The Application Name is:<%= appName %></b>
Developed by Raritan Technologies Inc..

Author:
Ted Sullivan
See Also:
Serialized Form

Constructor Summary
PageParameterMapTag()
           
 
Method Summary
 int doAfterBody()
           
 int doStartTag()
           
 java.lang.String getAppId()
           
 java.lang.String getAppName()
           
 java.lang.String getBody(RaritanPageContext rpc)
          Returns the tag body.
 java.lang.String getDefaultAppID()
           
 OrderedMap getParamMap(java.lang.String type, java.lang.String name)
           
 java.lang.String getParamMapValue(java.lang.String type, java.lang.String name, java.lang.String param)
           
 java.lang.String getSourceName()
           
 void initialize(org.w3c.dom.Element elem)
          Initializes the object from an XML tag or element.
 void initialize(java.util.Map initParams)
           
 void setAppId(java.lang.String appId)
           
 void setAppName(java.lang.String appName)
           
 void setDefaultAppID(java.lang.String defaultAppID)
           
 void setSourceName(java.lang.String sourceName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PageParameterMapTag

public PageParameterMapTag()
Method Detail

setAppId

public void setAppId(java.lang.String appId)

getAppId

public java.lang.String getAppId()

setAppName

public void setAppName(java.lang.String appName)

getAppName

public java.lang.String getAppName()

setSourceName

public void setSourceName(java.lang.String sourceName)

getSourceName

public java.lang.String getSourceName()

setDefaultAppID

public void setDefaultAppID(java.lang.String defaultAppID)

getDefaultAppID

public java.lang.String getDefaultAppID()

doStartTag

public int doStartTag()

getBody

public java.lang.String getBody(RaritanPageContext rpc)
Description copied from interface: ICustomTag
Returns the tag body.

Specified by:
getBody in interface ICustomTag
Parameters:
rpc - Platform-neutral page context ( can be used in non J2EE environments such as ASP).
Returns:
The tag body text string.

doAfterBody

public int doAfterBody()
                throws JspException
Throws:
JspException

getParamMap

public OrderedMap getParamMap(java.lang.String type,
                              java.lang.String name)

getParamMapValue

public java.lang.String getParamMapValue(java.lang.String type,
                                         java.lang.String name,
                                         java.lang.String param)

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 IConfigurable

initialize

public void initialize(java.util.Map initParams)
Specified by:
initialize in interface ICustomTag