com.raritantechnologies.searchApp.sourceMap.taglibrary
Class SourceMapCheckboxSelector

java.lang.Object
  extended bycom.raritantechnologies.searchApp.sourceMap.taglibrary.SourceMapCheckboxSelector
All Implemented Interfaces:
IConfigurable, ISearchElementRenderer

public class SourceMapCheckboxSelector
extends java.lang.Object
implements ISearchElementRenderer

Triggers a source selection(s) using a set of checkboxes. Provides a list of sources suitable for processing by a ISourceMap. Works in coordination with the application SourceMap XML where category names are mapped to one or more search sources.

Should be used within a JSP SearchForm tag where the categoryName attribute is absent, because this renderer will set the category name HTTP request parameter.

XML Configuration Template:
   <SearchElementRenderer class="com.raritantechnologies.searchApp.sourceMap.taglibrary.SourceMapCheckboxSelector"
                             fieldID="category(default)"
                             sourceMapName="[ name of source map ]"
                             sourceMapType="[ type of source map e.g. 'category']"
                             cols="[ number of columns ]"
                             submitOnChange="true|false(default)"
                             allKeys"true|false(default) - select getAllSourceKeys method"
                             securityCheck="true|false(default)|login - check category names for user access (false if these are aliases)"
                               loginHandlerName="[ optional javascript handler for login redirect ]"
                             javascriptHandler="[ optional javascript handler for other onClick behaviors]"
                             loginPage="[ url for login page ]"
                             noAccessPage="[ url for page that provides no access message ]"
                             showDescription="left|right|top|bottom|flyover" 
                             defaultSelected="[true|false(default)]"
                             externalForm="[ optional name of external form to set the selected sources ]"
                             externalField="[ name of external form field to set when a checkbox is selected/deselected ]" >

     <LabelRenderers sourceNameParam="[ parameter name to pass display name to renderer via RaritanPageContext ]" >

         <LabelRenderer class="[ class of com.raritantechnologies.searchApp.taglibrary.ICustomTag ]"
                           sourceNames="[ ALL | comma separated list of source Names to use this label renderer with ]" >

         </LabelRenderer>
     </LabelRenderers>

   </SearchElementRenderer>
 

Developed by Raritan Technologies .

Author:
Ted Sullivan

Constructor Summary
SourceMapCheckboxSelector()
           
 
Method Summary
 java.lang.String getBody(ISearchFormRenderer parent, RaritanPageContext pageContext)
          Builds a set of checkboxes that will cause an immediate source selection OR a source selection when the parent form is submitted.
 int getCols()
           
 java.lang.String getConfigurationXML()
           
 void getConfigurationXML(java.io.Writer writer)
           
 java.lang.String getFieldID()
           
 ISearchElementRenderer getRenderer(java.lang.String name)
          Returns ISearchElementRenderer of this render or a nested renderer matching the name given or null if no match is found.
 java.lang.String getSourceMapName()
           
 java.lang.String getSourceMapType()
           
 boolean getSubmitOnChange()
           
 void initialize(org.w3c.dom.Element elem)
          Initialize renderer-specific parameters from the configuration XML tag.
 boolean isHidden(ISearchFormRenderer parent, RaritanPageContext pageContext)
           
 void setCols(int cols)
           
 void setDescription(java.lang.String sourceName, java.lang.String description)
           
 void setEnable(boolean enabled)
          Enable/Disable the renderer.
 void setFieldID(java.lang.String fieldID)
           
 void setSourceMapName(java.lang.String sourceMapName)
           
 void setSourceMapType(java.lang.String sourceMapType)
           
 void setSubmitOnChange(boolean submitOnChange)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SourceMapCheckboxSelector

public SourceMapCheckboxSelector()
Method Detail

initialize

public void initialize(org.w3c.dom.Element elem)
Description copied from interface: ISearchElementRenderer
Initialize renderer-specific parameters from the configuration XML tag.

Specified by:
initialize in interface ISearchElementRenderer

getBody

public java.lang.String getBody(ISearchFormRenderer parent,
                                RaritanPageContext pageContext)
Builds a set of checkboxes that will cause an immediate source selection OR a source selection when the parent form is submitted. Adds sourceMap parameters to the search form (dependent on the type of ISourceMap used by the application.)

Specified by:
getBody in interface ISearchElementRenderer

setEnable

public void setEnable(boolean enabled)
Enable/Disable the renderer. Disabled renderers are not included in the html output of an ISearchFormRenderer.

Specified by:
setEnable in interface ISearchElementRenderer

getRenderer

public ISearchElementRenderer getRenderer(java.lang.String name)
Returns ISearchElementRenderer of this render or a nested renderer matching the name given or null if no match is found.

Specified by:
getRenderer in interface ISearchElementRenderer

setDescription

public void setDescription(java.lang.String sourceName,
                           java.lang.String description)

isHidden

public boolean isHidden(ISearchFormRenderer parent,
                        RaritanPageContext pageContext)
Specified by:
isHidden in interface ISearchElementRenderer

setSourceMapName

public void setSourceMapName(java.lang.String sourceMapName)

getSourceMapName

public java.lang.String getSourceMapName()

setSourceMapType

public void setSourceMapType(java.lang.String sourceMapType)

getSourceMapType

public java.lang.String getSourceMapType()

setFieldID

public void setFieldID(java.lang.String fieldID)

getFieldID

public java.lang.String getFieldID()

setCols

public void setCols(int cols)

getCols

public int getCols()

setSubmitOnChange

public void setSubmitOnChange(boolean submitOnChange)

getSubmitOnChange

public boolean getSubmitOnChange()

getConfigurationXML

public void getConfigurationXML(java.io.Writer writer)
                         throws java.io.IOException
Throws:
java.io.IOException

getConfigurationXML

public java.lang.String getConfigurationXML()