com.raritantechnologies.quickstart.taglibrary.forms
Class ResultAnnotatorRenderer

java.lang.Object
  extended bycom.raritantechnologies.searchApp.taglibrary.BasicResultRenderer
      extended bycom.raritantechnologies.quickstart.taglibrary.forms.ResultAnnotatorRenderer
All Implemented Interfaces:
IConfigurable, IPreferencesBeanInfo, IResultRenderer, ISessionDataHandler

public class ResultAnnotatorRenderer
extends BasicResultRenderer
implements ISessionDataHandler, IResultRenderer

Enables annotation of results by creating a TextArea input that is updated to a database when its "save" control is clicked.

Similar to CheckboxResultRenderer: requires a <form> that encloses the results. Uses the com.raritantechologies.quickstart.userInterface.SetPersistentParameterServlet to upload changes to the annotation which are then persisted to the database.

XML Configuration Template:
   <ResultRenderer 
        rendererClass="com.raritantechnologies.quickstart.taglibrary.ResultAnnotatorRenderer" 
        connectionManager="[ name of Database ConnectionManager ]"
        annotationTable="[ name of table with annotations ]"
        annotationDBField="[ name of DB column with annotations ]"
        annotationResultField="[ name of result field containing annotation ]"
        formName="[ name of html form containing the annotation field ]"
        inputType="[ TEXT | TEXTAREA ]"
        inputWidth="[ size or columns ]"
        inputHeight="[ rows (for TEXTAREA ) ]" >

    <!-- List of fields used to construct the database key -->
    <KeyFields>
      <Field ID="[ name of result field ]" type="[ TEXT | INTEGER ]" />
      <!-- etc... -->
    </KeyFields>

   </ResultRenderer>
 

Developed by Raritan Technologies Inc..

Author:
Ted Sullivan

Field Summary
 
Fields inherited from class com.raritantechnologies.searchApp.taglibrary.BasicResultRenderer
enabled, name, prefBeanName, prefCompareValue, prefEnableIfInChecklist, prefEnableIfInYesno
 
Fields inherited from interface com.raritantechnologies.searchApp.taglibrary.IResultRenderer
TEMPLATE
 
Constructor Summary
ResultAnnotatorRenderer()
           
 
Method Summary
protected  java.lang.String doRenderResult(IResult result, int firstResult, int lastResult, int resultNum, RaritanPageContext pageContext)
           
 java.lang.String getConfigurationXML()
           
 java.lang.String getConfigurationXML(java.lang.String configurationTemplate)
           
 void handleSessionData(java.util.Map sessionDataMap, RaritanPageContext pageContext)
          Updates the annotation in the DB: gets the current value of the annotation and the keyField data from the sessionDataMap ( ).
 void initialize(org.w3c.dom.Element elem)
          IResultRenderers are XML configurable.
 void registerDataHandler(ISessionDataManager manager, java.util.Map params)
          Register this SessionDataHandler with a SessionDataManager.
 
Methods inherited from class com.raritantechnologies.searchApp.taglibrary.BasicResultRenderer
getPrefBeanName, getPrefCompareValue, getPrefEnableIfInChecklist, getPrefEnableIfInYesno, getRenderer, isEnabled, renderResult, setEnable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.raritantechnologies.searchApp.taglibrary.IResultRenderer
getRenderer, isEnabled, renderResult, setEnable
 

Constructor Detail

ResultAnnotatorRenderer

public ResultAnnotatorRenderer()
Method Detail

initialize

public void initialize(org.w3c.dom.Element elem)
Description copied from interface: IResultRenderer
IResultRenderers are XML configurable.

Specified by:
initialize in interface IResultRenderer
Overrides:
initialize in class BasicResultRenderer

doRenderResult

protected java.lang.String doRenderResult(IResult result,
                                          int firstResult,
                                          int lastResult,
                                          int resultNum,
                                          RaritanPageContext pageContext)
Specified by:
doRenderResult in class BasicResultRenderer

registerDataHandler

public void registerDataHandler(ISessionDataManager manager,
                                java.util.Map params)
Description copied from interface: ISessionDataHandler
Register this SessionDataHandler with a SessionDataManager.

Specified by:
registerDataHandler in interface ISessionDataHandler
Parameters:
manager - The ISessionDataManager that this handler should register with by calling manager.addSessionDataHandler( "handler name", this );
params - Initialization parameters for this handler (typically obtained from the Configuration layer.

handleSessionData

public void handleSessionData(java.util.Map sessionDataMap,
                              RaritanPageContext pageContext)
Updates the annotation in the DB: gets the current value of the annotation and the keyField data from the sessionDataMap ( ).

Specified by:
handleSessionData in interface ISessionDataHandler
Parameters:
sessionDataMap - The entire param=value map cached for the current user session. The handler should update any of its params based on the current page context.
pageContext - The current page context. Contains request parameters that the handler should use to update its and/or the SessionData's context.

getConfigurationXML

public java.lang.String getConfigurationXML()
Specified by:
getConfigurationXML in interface IResultRenderer

getConfigurationXML

public java.lang.String getConfigurationXML(java.lang.String configurationTemplate)
Specified by:
getConfigurationXML in interface IResultRenderer