org.dbforms.event
Class AbstractDatabaseEvent

java.lang.Object
  extended by org.dbforms.event.AbstractWebEvent
      extended by org.dbforms.event.AbstractDatabaseEvent
Direct Known Subclasses:
AbstractValidationEvent, DeleteEvent, DeleteEvent

public abstract class AbstractDatabaseEvent
extends AbstractWebEvent

Abstract base class for all web-events related to database operations like inserts, updates, deletes.

Author:
Joe Peer

Constructor Summary
AbstractDatabaseEvent(int tableId, String keyId, HttpServletRequest request, DbFormsConfig config)
          Creates a new DatabaseEvent object.
 
Method Summary
 void doValidation(String formValidatorName, ServletContext context)
          DO the validation of the form with Commons-Validator.
abstract  FieldValues getFieldValues()
          Get the hash table containing the form field names and values taken from the request object.
protected  FieldValues getFieldValues(boolean insertMode)
          Get the FieldValues object representing the collection of FieldValue objects builded from the request parameters
 String getKeyId()
          Get the keyId parameter value
protected  String getKeyValues()
          Return the key values string from the request object
abstract  void processEvent(Connection con)
          Process this event.
 
Methods inherited from class org.dbforms.event.AbstractWebEvent
getConfig, getFollowUp, getFollowUpOnError, getProperties, getRequest, getTable, getType, hasUserPrivileg, setFollowUp, setFollowUpOnError, setProperties, setRequest, setTable, setType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractDatabaseEvent

public AbstractDatabaseEvent(int tableId,
                             String keyId,
                             HttpServletRequest request,
                             DbFormsConfig config)
Creates a new DatabaseEvent object.

Parameters:
tableId - the table id
keyId - the key id
request - the request object
config - the configuration object
Method Detail

getFieldValues

public abstract FieldValues getFieldValues()
Get the hash table containing the form field names and values taken from the request object.
Example of a request parameter:
name = f_0_insroot_6 value = foo-bar

Returns:
the hash map containing the names and values taken from the request object

getKeyId

public String getKeyId()
Get the keyId parameter value

Returns:
keyId parameter value

doValidation

public void doValidation(String formValidatorName,
                         ServletContext context)
                  throws MultipleValidationException
DO the validation of the form with Commons-Validator.

Parameters:
formValidatorName - The form name to retreive in validation.xml
context - The servlet context we are processing
Throws:
MultipleValidationException - The Vector of errors throwed with this exception

processEvent

public abstract void processEvent(Connection con)
                           throws SQLException,
                                  MultipleValidationException
Process this event.

Parameters:
con - the jdbc connection object
Throws:
SQLException - if any data access error occurs
MultipleValidationException - if any validation error occurs

getFieldValues

protected FieldValues getFieldValues(boolean insertMode)
Get the FieldValues object representing the collection of FieldValue objects builded from the request parameters

Parameters:
insertMode - true DOCUMENT ME!
Returns:
the FieldValues object representing the collection of FieldValue objects builded from the request parameters

getKeyValues

protected String getKeyValues()
Return the key values string from the request object

Returns:
the key values string from the request object


Copyright © 2002-2006 DbForms. All Rights Reserved.