com.raritantechnologies.searchApp.taglibrary
Class DisplayForm

java.lang.Object
  extended byBodyTagSupport
      extended bycom.raritantechnologies.searchApp.taglibrary.DisplayForm
All Implemented Interfaces:
IConfigurable, ICustomTag
Direct Known Subclasses:
AccumulatingDisplayForm, AjaxDisplayForm, BrowseDisplayForm, ParametricDisplayForm, ReadQueriesDisplayForm, SingleResultDisplayForm, SourceMapDisplayForm, StaticDisplayForm, UserLogDisplayForm

public class DisplayForm
extends BodyTagSupport
implements ICustomTag, IConfigurable

JSP Custom Tag that renders a configurable result display form. This is the "wrapper" class for all RTI result displays, which delegates display form rendering to a configurable class of type IDisplayFormRenderer.

JSP Custom Tag Template:
  <results:DisplayForm formName="[ name of display form in configuration XML (see below ) ]"
                          searchFormName="[ name of searchForm that generated the result set ]"
                          pageSize="[ number of records per page ]"
                          categoryParam="[ request parameter that has source category ]"
                          sourceTypeParam="[ request parameter that has source map type ]"
                          noResultsMessage="[ message to display for 0 results ]"
                          useCache="[ true|false - if true DisplayForm does not initiate search]"
                          searchParameters="[ optional list of name=value pairs (separated by '|') search parameters SessionData: or StringFilter: can be used ]"  />
 
XML Configuration Template (For the DisplayForm Renderer):
  <DisplayForm name="formName" 
              rendererClass="[ class of com.raritantechnologies.searchApp.taglibrary.IDisplayFormRenderer ]"
              bgcolor1="#ffffff" bgcolor2="#dddddd" >

   <!-- details needed by IDisplayFormRenderer implementation class -->

  </DisplayForm>
 

Developed by Raritan Technologies Inc..

Author:
Ted Sullivan, Jim Nicholson
See Also:
Serialized Form

Field Summary
protected  java.lang.String activeDisplayKey
           
protected  java.lang.String activeDisplayParam
           
protected  java.lang.String categoryParam
           
static int DEFAULT_PAGE_SIZE
           
protected  java.lang.String formName
           
protected  java.lang.String ignoreFormTypes
           
protected  java.lang.String noResultString
           
protected  int pageNum
           
protected  java.lang.String pageNumParam
           
protected  int pageSize
           
protected  java.util.Map queryFieldFilters
           
protected  java.lang.String resultSetKey
           
protected  java.lang.String searchFormTypes
           
protected  java.util.Map searchParameters
           
protected  java.lang.String sourceTypeParam
           
protected  java.lang.String[] userQueryParams
           
 
Constructor Summary
DisplayForm()
           
 
Method Summary
 int doAfterBody()
           
 int doStartTag()
           
 java.lang.String getBody(RaritanPageContext rpc)
          Renders the results display form given a search request encoded within the RaritanPageContext.
 java.lang.String getBody(java.lang.String searchRequest, java.lang.String fieldDelimiter, java.lang.String valueDelimiter, java.lang.String sessionID)
           
static IResultSet getCachedResultSet(RaritanPageContext rPageContext, java.lang.String cacheKey)
           
static IResultSet getCachedResultSet(RaritanPageContext rPageContext, java.lang.String cacheKey, java.lang.String formType)
           
static IDisplayFormRenderer getDisplayFormRenderer(java.util.Map sessionData, java.lang.String displayFormName)
           
static IDisplayFormRenderer getDisplayFormRenderer(RaritanPageContext rpc, java.lang.String displayFormName)
           
protected  IDisplayFormRenderer getDisplayRenderer(RaritanPageContext rpc)
           
 java.lang.String getFormName()
           
static DisplayForm getInstance(java.lang.String formName)
           
static IResultSet getNewResultSet(java.lang.String sourceCategory, java.lang.String sourceType, RaritanPageContext pageContext, int pageSize, int startRec)
           
 int getPageNum()
           
static int getPageNum(java.util.Map sessionData, RaritanPageContext pageContext)
           
static int getPageNum(java.util.Map sessionData, RaritanPageContext pageContext, java.lang.String pageNumParam)
           
static int getPageNum(RaritanPageContext pageContext)
           
 java.lang.String getpageSize()
           
static int getPageSize(java.util.Map sessionData, RaritanPageContext pageContext, int defaultSize)
           
static int getPageSize(RaritanPageContext pageContext, int defaultSize)
           
 IResultSet getResults(int pageNum, int pageSize, RaritanPageContext pageContext)
          Get the current results.
 IResultSet getResults(int pageNum, int pageSize, RaritanPageContext pageContext, java.lang.String sourceType)
           
 IResultSet getResults(int pageNum, int pageSize, RaritanPageContext pageContext, java.lang.String sourceType, java.lang.String formType)
           
 IResultSet getResults(RaritanPageContext pageContext)
           
protected  java.lang.String getResultSetKey()
           
static java.lang.String getResultSetKey(javax.servlet.http.HttpServletRequest request)
           
static java.lang.String getResultSetKey(javax.servlet.http.HttpServletRequest request, java.lang.String formName, boolean keyFromCategory)
           
static java.lang.String getResultSetKey(RaritanPageContext rPageContext, java.lang.String formName)
           
protected  java.lang.String getSearchFormName()
           
static java.util.Map getSessionData(RaritanPageContext pageContext)
           
protected  java.lang.String getSourceCategory(RaritanPageContext rPageContext)
           
protected  java.lang.String getSourceType(RaritanPageContext rPageContext)
           
protected  boolean ignoreFormType(java.lang.String formType)
           
 void initialize(org.w3c.dom.Element elem)
          This initialize method is used when the DisplayForm is contained in a wrapper object such as a TabbedCustomTag - and is an alternate way of initiating a DisplayForm from the JSP custom tag initialization via the java bean methods.
 void initialize(java.util.Map initParams)
           
 void setActiveDisplayKey(java.lang.String displayKey)
           
 void setActiveDisplayParam(java.lang.String displayParam)
           
protected  void setCachedResultSet(RaritanPageContext rPageContext, java.lang.String localKey, IResultSet resultSet)
           
 void setCachedResultsName(java.lang.String cachedResultsName)
           
 void setCategoryParam(java.lang.String categoryParam)
          Sets the request parameter used by the DisplayForm to get the search category.
 void setFormName(java.lang.String formName)
          formName is the name specified in the <DisplayForm> tag of the configuration XML
 void setIgnoreFormTypes(java.lang.String ignoreFormTypes)
           
 void setNoResultsMessage(java.lang.String noResultString)
           
 void setPageNumParam(java.lang.String pageNumParam)
           
 void setPageSize(java.lang.String pageSize)
           
protected  void setResultSetKey(RaritanPageContext rPageContext, java.lang.String formName)
           
 void setResultSetKey(java.lang.String resultSetKey)
           
 void setSearchFormName(java.lang.String searchFormName)
           
 void setSearchFormTypes(java.lang.String searchFormTypes)
           
 void setSearchParameters(java.lang.String parameterSet)
           
 void setSourceTypeParam(java.lang.String sourceType)
           
 void setUseCache(java.lang.String useCache)
           
 void setUserQueryParameters(java.lang.String queryParamsSt)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_PAGE_SIZE

public static final int DEFAULT_PAGE_SIZE
See Also:
Constant Field Values

formName

protected java.lang.String formName

noResultString

protected java.lang.String noResultString

userQueryParams

protected java.lang.String[] userQueryParams

pageSize

protected int pageSize

categoryParam

protected java.lang.String categoryParam

sourceTypeParam

protected java.lang.String sourceTypeParam

pageNum

protected int pageNum

resultSetKey

protected java.lang.String resultSetKey

searchParameters

protected java.util.Map searchParameters

ignoreFormTypes

protected java.lang.String ignoreFormTypes

searchFormTypes

protected java.lang.String searchFormTypes

activeDisplayParam

protected java.lang.String activeDisplayParam

activeDisplayKey

protected java.lang.String activeDisplayKey

pageNumParam

protected java.lang.String pageNumParam

queryFieldFilters

protected java.util.Map queryFieldFilters
Constructor Detail

DisplayForm

public DisplayForm()
Method Detail

getInstance

public static DisplayForm getInstance(java.lang.String formName)

setFormName

public void setFormName(java.lang.String formName)
formName is the name specified in the <DisplayForm> tag of the configuration XML


getFormName

public java.lang.String getFormName()

getpageSize

public java.lang.String getpageSize()

setPageSize

public void setPageSize(java.lang.String pageSize)

setSearchParameters

public void setSearchParameters(java.lang.String parameterSet)

setIgnoreFormTypes

public void setIgnoreFormTypes(java.lang.String ignoreFormTypes)

setSearchFormTypes

public void setSearchFormTypes(java.lang.String searchFormTypes)

setActiveDisplayKey

public void setActiveDisplayKey(java.lang.String displayKey)

setActiveDisplayParam

public void setActiveDisplayParam(java.lang.String displayParam)

setPageNumParam

public void setPageNumParam(java.lang.String pageNumParam)

setCachedResultsName

public void setCachedResultsName(java.lang.String cachedResultsName)

initialize

public void initialize(org.w3c.dom.Element elem)
This initialize method is used when the DisplayForm is contained in a wrapper object such as a TabbedCustomTag - and is an alternate way of initiating a DisplayForm from the JSP custom tag initialization via the java bean methods. Note that the main configuration Display form Renderer initialization is handled separately - i.e. this is NOT the initialization for the DisplayForm tags in the main configuration XML. Those tags configure the IDisplayFormRenderer used by this DisplayForm object.

Specified by:
initialize in interface IConfigurable

initialize

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

setCategoryParam

public void setCategoryParam(java.lang.String categoryParam)
Sets the request parameter used by the DisplayForm to get the search category. Categories are used by the application SourceMap to determine the search source or sources to use for a search request.

Parameters:
categoryParam - The http request parameter that should be used as the search source 'category'.

setSourceTypeParam

public void setSourceTypeParam(java.lang.String sourceType)

getPageNum

public int getPageNum()

setNoResultsMessage

public void setNoResultsMessage(java.lang.String noResultString)

setUserQueryParameters

public void setUserQueryParameters(java.lang.String queryParamsSt)

setUseCache

public void setUseCache(java.lang.String useCache)

setResultSetKey

public void setResultSetKey(java.lang.String resultSetKey)

doStartTag

public int doStartTag()
               throws JspException
Throws:
JspException

getBody

public java.lang.String getBody(java.lang.String searchRequest,
                                java.lang.String fieldDelimiter,
                                java.lang.String valueDelimiter,
                                java.lang.String sessionID)

getBody

public java.lang.String getBody(RaritanPageContext rpc)
Renders the results display form given a search request encoded within the RaritanPageContext. Key input parameters:

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.

getResults

public IResultSet getResults(RaritanPageContext pageContext)

getResults

public IResultSet getResults(int pageNum,
                             int pageSize,
                             RaritanPageContext pageContext)
Get the current results. Returns cached results for this page if the result set has already been calculated by a previous tag. If not, the search is executed.


getResults

public IResultSet getResults(int pageNum,
                             int pageSize,
                             RaritanPageContext pageContext,
                             java.lang.String sourceType)

getResults

public IResultSet getResults(int pageNum,
                             int pageSize,
                             RaritanPageContext pageContext,
                             java.lang.String sourceType,
                             java.lang.String formType)

ignoreFormType

protected boolean ignoreFormType(java.lang.String formType)

getNewResultSet

public static IResultSet getNewResultSet(java.lang.String sourceCategory,
                                         java.lang.String sourceType,
                                         RaritanPageContext pageContext,
                                         int pageSize,
                                         int startRec)

getCachedResultSet

public static IResultSet getCachedResultSet(RaritanPageContext rPageContext,
                                            java.lang.String cacheKey)

getCachedResultSet

public static IResultSet getCachedResultSet(RaritanPageContext rPageContext,
                                            java.lang.String cacheKey,
                                            java.lang.String formType)

getSessionData

public static java.util.Map getSessionData(RaritanPageContext pageContext)

getPageNum

public static int getPageNum(RaritanPageContext pageContext)

getPageNum

public static int getPageNum(java.util.Map sessionData,
                             RaritanPageContext pageContext)

getPageNum

public static int getPageNum(java.util.Map sessionData,
                             RaritanPageContext pageContext,
                             java.lang.String pageNumParam)

getPageSize

public static int getPageSize(RaritanPageContext pageContext,
                              int defaultSize)

getPageSize

public static int getPageSize(java.util.Map sessionData,
                              RaritanPageContext pageContext,
                              int defaultSize)

setCachedResultSet

protected void setCachedResultSet(RaritanPageContext rPageContext,
                                  java.lang.String localKey,
                                  IResultSet resultSet)

getResultSetKey

protected java.lang.String getResultSetKey()
Returns:
Returns the resultSetKey.

setResultSetKey

protected void setResultSetKey(RaritanPageContext rPageContext,
                               java.lang.String formName)

getResultSetKey

public static java.lang.String getResultSetKey(javax.servlet.http.HttpServletRequest request)

getResultSetKey

public static java.lang.String getResultSetKey(javax.servlet.http.HttpServletRequest request,
                                               java.lang.String formName,
                                               boolean keyFromCategory)

getResultSetKey

public static java.lang.String getResultSetKey(RaritanPageContext rPageContext,
                                               java.lang.String formName)

getSourceCategory

protected java.lang.String getSourceCategory(RaritanPageContext rPageContext)

getSourceType

protected java.lang.String getSourceType(RaritanPageContext rPageContext)

setSearchFormName

public void setSearchFormName(java.lang.String searchFormName)

getSearchFormName

protected java.lang.String getSearchFormName()

doAfterBody

public int doAfterBody()
                throws JspException
Throws:
JspException

getDisplayRenderer

protected IDisplayFormRenderer getDisplayRenderer(RaritanPageContext rpc)

getDisplayFormRenderer

public static IDisplayFormRenderer getDisplayFormRenderer(RaritanPageContext rpc,
                                                          java.lang.String displayFormName)

getDisplayFormRenderer

public static IDisplayFormRenderer getDisplayFormRenderer(java.util.Map sessionData,
                                                          java.lang.String displayFormName)