com.raritantechnologies.searchApp.database.userInterface
Class UniqueAssociationServletHandler

java.lang.Object
  extended bycom.raritantechnologies.searchApp.database.userInterface.UniqueAssociationServletHandler
All Implemented Interfaces:
IConfigurable, IServletHandler

public class UniqueAssociationServletHandler
extends java.lang.Object
implements IServletHandler

Persists a set of values associated with a unique key. Values cannot be duplicated.

Maintains a session cache of current association ID, current list of associated values.

Monitors a session cache flag - 'save needed'. Sends back a Save dialog or redirects to a save URL.

XML Configuration Template:
  <SystemObject type="ServletHandler"     name="[ the name ]" 
                   configurableClass         = "com.raritantechnologies.searchApp.database.userInterface.UniqueAssociationServletHandler"
                   databaseConnectionManager = "[ name of the database connection manager ]"
                   assocChangedCacheKey      = "[ session variable containing a boolean flag with current association 'save-needed' state ]"
                   associationCacheKey       = "[ session variable containing the current associated list ]"
                   associationIDCacheKey     = "[ session variable containing the current association ID ]"
                   addValueCommand           = "[ name of http request and value that indicates that a new value has been selected ]"
                   multiValueCommand         = "[ name of http request=value that enables multiple values per association ID ]"
                   saveChangesCommand        = "[ name of http request save Changes command  ]" 
                   clearCacheCommand         = "[ name of http request clear cache command  ]"
                   loadValuesCommand         = "[ name of http reques=value command for loading ]"
                   associationIDParam        = "[ name of http request that will contain the current association ID ]"
                   saveDialogHTMLTemplate    = "[ file name of the save dialog HTML page ]"
                   saveDialogJSPPage         = "[ alternate - name of JSP page to redirect to for a save dialog page ]" >

    <DatabaseTable name="[ table Name ]"
                      associationIDColumn="[ name of the association ID column ]"
                      associationIDType="[ SQL type e.g. 'varchar(64)' ]"
                      associationGroupColumn="[ name of the association ID column ]"
                      associationGroupType="[ SQL type e.g. 'varchar(64)' ]"
                      valueColumn="[ name of the value column ]"
                      valueColumnType="[ SQL type of value column e.g. 'varchar(256)' ]" />

  </SystemObject>

 


Constructor Summary
UniqueAssociationServletHandler()
           
 
Method Summary
 void init(SearchServlet searchServlet)
           
 void initialize(org.w3c.dom.Element elem)
          Initializes the object from an XML tag or element.
 void saveAssociations(java.lang.String associationGroup, java.lang.String associationID, java.lang.String[] currentValueList)
           
 void service(DynamicHttpServletRequest pReq, HttpServletResponse pRes)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UniqueAssociationServletHandler

public UniqueAssociationServletHandler()
Method Detail

init

public void init(SearchServlet searchServlet)
Specified by:
init in interface IServletHandler

service

public void service(DynamicHttpServletRequest pReq,
                    HttpServletResponse pRes)
             throws ServletException,
                    java.io.IOException
Specified by:
service in interface IServletHandler
Throws:
ServletException
java.io.IOException

saveAssociations

public void saveAssociations(java.lang.String associationGroup,
                             java.lang.String associationID,
                             java.lang.String[] currentValueList)

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