oracle.clex.process
Class ValidateHTMLForm

java.lang.Object
  |
  +--oracle.cle.process.Process
        |
        +--oracle.cle.process.GenericProcess
              |
              +--oracle.clex.process.ValidateHTMLForm
All Implemented Interfaces:
Child, java.lang.Cloneable, ProcessConstants, java.io.Serializable, State

public abstract class ValidateHTMLForm
extends GenericProcess

This form performs a number of validation routines. The goal is to find as many (or all) the user input errors, instead of continually prompting the user for more information. Subclasses can register for the following types of validation:

a) registerMandatoryField(String aProcessParameterName)
b) registerIntegerField(String aProcessParameterName)
c) registerPositiveIntegerField(String aProcessParameterName)
d) registerDecimalField(String aProcessParameterName)
e) registerPositiveDecimalField(String aProcessParameterName)
f) registerDateField(String aProcessParameterName) // Defaults to MM/dd/yy
g) registerDateField(String aProcessParameterName, "format_string" )
h) registerRegularExpressionField(String aProcessParameterName, "RE_string")
All methods have versions that take a "label" as an argument. this label is used in the description of each violation. If the methods without the labels are used, then the name of the ProcessParameter is used.

Note that apart form registerMandatoryField, a registered parameter does not imply that it is mandatory. i.e. if a parameter is mandatory and has to be a valid date, it has to be registered twice - once with registerMandatoryField() and then again with registerDateField(). Additionally, all registered validations must also be registered as parameters with the process.

Additionally, subclasses can also overwrite the validateContent() method to perform any further content-specific validation not catered for here (build your own or use the Regular Expression capability!).

On completion, this Process returns a result (ValidationErrorMessages) to the infoTable --> a vector of Strings, each describing the errors encountered

Here is a typical registerValidation method:


  public void registerValidation() throws CLEException
    {
     registerMandatoryField("GasStationName", "The Station Name");
     registerMandatoryField("City", "The City Name");
     registerMandatoryField("DollarPriceOfFuel", "The Dollar Price of Fuel");
     registerDecimalField("DollarPriceOfFuel", "The Dollar Price of Fuel");
   } // end registerValidation
 

See Also:
Serialized Form

Field Summary
protected  java.util.Vector errorMsgs
           
 
Fields inherited from class oracle.cle.process.GenericProcess
parent
 
Fields inherited from class oracle.cle.process.Process
condition, DEBUG, endState, FAILURE, name, processes, service, stateMachine, SUCCESS, TRANSITION_CONDITION_FAILURE, TRANSITION_CONDITION_SUCCESS
 
Fields inherited from interface oracle.cle.process.ProcessConstants
ALLINFO, BINARYSIZE, CONNECTION_PROVIDER_DTD_NAME, CONNECTION_PROVIDER_VALIDATION_PROPERTY, CONTENTTYPE, CURRENTPAGEID, CURRENTSERVICE, ERRORMESSAGE, GENERICBINARYRESULT, GENERICTEXTRESULT, GETINFO_CHECK_ALL, GETINFO_CHECK_CONTROLLERONLY, GETINFO_CHECK_SERVICEONLY, HTML, HTMLRESULT, JSPRESULT, LOGOFF, NOMESSAGE, PAGEID, PDF, PDFRESULT, PRE_GROUP_DTD_NAME, PRE_GROUP_VALIDATION_PROPERTY, PROCESS_FEEDBACK, RESTART, RESULTTYPE, RULES_DTD_NAME, SERVICE_DESCRIPTOR, SERVICE_DTD_NAME, SERVICE_VALIDATION_PROPERTY, SERVICEINITIALSTATE, SERVICENAME, SESSIONID, SKIP, STACKTRACE, USER, USERROLE, WML, XML, XMLRESULT
 
Constructor Summary
ValidateHTMLForm()
           
 
Method Summary
protected  void registerConditionalMandatoryField(ProcessParameter aProcessParameter, java.lang.Boolean condition)
          Deprecated. use registerConditionalMandatoryField(String, Boolean) instead
protected  void registerConditionalMandatoryField(java.lang.String aProcessParameterName, java.lang.Boolean condition)
          Registers the boolean condition with the specified name.
protected  void registerDateField(ProcessParameter aProcessParameter)
          Deprecated. use registerDateField(String) instead
protected  void registerDateField(ProcessParameter aProcessParameter, java.lang.String formatString)
          Deprecated. use registerDateField(String, String) instead
protected  void registerDateField(ProcessParameter aProcessParameter, java.lang.String format, java.lang.String aLabel)
          Deprecated. use registerDateField(String, String, String) instead
protected  void registerDateField(java.lang.String aProcessParameterName)
          Register Date with the specified name
protected  void registerDateField(java.lang.String aProcessParameterName, java.lang.String formatString)
          Register Date field with the specifed name and format
protected  void registerDateField(java.lang.String aProcessParameterName, java.lang.String format, java.lang.String aLabel)
          Deprecated. use registerDateField(String, String, String) instead
protected  void registerDecimalField(ProcessParameter aProcessParameter)
          Deprecated. use registerDecimalField(String) instead
protected  void registerDecimalField(ProcessParameter aProcessParameter, java.lang.String aLabel)
          Deprecated. use registerDecimalField(String, String) instead
protected  void registerDecimalField(java.lang.String aProcessParameterName)
          Registers the decimal parameter with the specified name
protected  void registerDecimalField(java.lang.String aProcessParameterName, java.lang.String aLabel)
          Registers the Decimal parameter and a Label for the Parameter
protected  void registerInfo()
          Here is where we register all ProcessParameters and potential ProcessResults.
protected  void registerIntegerField(ProcessParameter aProcessParameter)
          Deprecated. use registerIntegerField(String) instead
protected  void registerIntegerField(ProcessParameter aProcessParameter, java.lang.String aLabel)
          Deprecated. use registerIntegerField(String, String) instead
protected  void registerIntegerField(java.lang.String aProcessParameterName)
           
protected  void registerIntegerField(java.lang.String aProcessParameterName, java.lang.String aLabel)
          Registers the Integer parameter and a Label for the Parameter
protected  void registerMandatoryField(ProcessParameter aProcessParameter)
          Deprecated. use registerMandatoryField(String) instead
protected  void registerMandatoryField(ProcessParameter aProcessParameter, java.lang.String aLabel)
          Deprecated. use registerMandatoryField(String, String) instead
protected  void registerMandatoryField(java.lang.String aProcessParameterName)
          Registers the Mandatory parameter
protected  void registerMandatoryField(java.lang.String aProcessParameterName, java.lang.String aLabel)
          Registers the Mandatory parameter and a Label for the Parameter
protected  void registerPositiveDecimalField(ProcessParameter aProcessParameter)
          Deprecated. use registerPositiveDecimalField(String) instead
protected  void registerPositiveDecimalField(ProcessParameter aProcessParameter, java.lang.String aLabel)
          Deprecated. use registerPositiveDecimalField(String, String) instead
protected  void registerPositiveDecimalField(java.lang.String aProcessParameterName)
          Registers the PositiveDecimalField parameter with the specified name
protected  void registerPositiveDecimalField(java.lang.String aProcessParameterName, java.lang.String aLabel)
          Registers the Positive Decimal parameter and a Label for the Parameter
protected  void registerPositiveIntegerField(ProcessParameter aProcessParameter)
          Deprecated. use registerPositiveIntegerField(String) instead
protected  void registerPositiveIntegerField(ProcessParameter aProcessParameter, java.lang.String aLabel)
          Deprecated. use registerPositiveIntegerField(String, String) instead
protected  void registerPositiveIntegerField(java.lang.String aProcessParameterName)
          Registers the Positive Integer parameter with the specified name.
protected  void registerPositiveIntegerField(java.lang.String aProcessParameterName, java.lang.String aLabel)
          Registers the Positive Integer parameter and a Label for the Parameter
protected  void registerRegularExpressionField(ProcessParameter aProcessParameter, java.lang.String formatString)
          Deprecated. use registerRegularExpressionField(String, String) instead
protected  void registerRegularExpressionField(java.lang.String aProcessParameterName, java.lang.String formatString)
          Register parameter with specified name and a regular expression string
protected abstract  void registerValidation()
          Subclasses register the different types of validation required for the fields by calling any one of the following:
 void start()
          Starts execution of this State
protected  boolean validateContent()
          Called by start after it has finished calling all the other validation.
 
Methods inherited from class oracle.cle.process.GenericProcess
clone, getBooleanInfo, getFloatInfo, getInfo, getInfo, getInfo, getInfoValue, getInfoValue, getInfoValueFromController, getInfoValueFromService, getIntegerInfo, getParameterNamed, getParameters, getParent, getParents, getResultNamed, getResults, getSessionId, getStringInfo, processParameters, processResults, registerBooleanParameter, registerBooleanResult, registerIntegerParameter, registerIntegerResult, registerParameter, registerProcessInfo, registerResult, registerStringArrayParameter, registerStringArrayResult, registerStringParameter, registerStringParameter, registerStringResult, registerStringResult, retrieveStringParameter, runTest, setParent, setResult, setResult, setResult
 
Methods inherited from class oracle.cle.process.Process
addCondition, addProcess, cloneProcess, debug, generateFailureCondition, generateSuccessCondition, getClassname, getCondition, getConditions, getIconName, getImageName, getName, getProcesses, getProcessNamed, getStateMachine, hashCode, isEndState, removeCondition, removeCondition, reportException, returnCondition, setCondition, setCondition, setEndState, setName, setService, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

errorMsgs

protected java.util.Vector errorMsgs
Constructor Detail

ValidateHTMLForm

public ValidateHTMLForm()
Method Detail

start

public void start()
           throws TransitionConditionException
Starts execution of this State
Overrides:
start in class GenericProcess

registerValidation

protected abstract void registerValidation()
                                    throws CLEException
Subclasses register the different types of validation required for the fields by calling any one of the following:

a) registerMandatoryField(String aProcessParameterName)
b) registerIntegerField(String aProcessParameterName)
c) registerPositiveIntegerField(String aProcessParameterName)
d) registerDecimalField(String aProcessParameterName)
e) registerPositiveDecimalField(String aProcessParameterName)
f) registerDateField(String aProcessParameterName) // Defaults to MM/dd/yy
g) registerDateField(String aProcessParameterName, "format_string" )
h) registerRegularExpressionField(String aProcessParameterName, "RE_string")

All methods have versions that take a "label" as an argument. this label is used in the description of each violation. If the methods without the labels are used, then the name of the ProcessParameter is used.


registerMandatoryField

protected void registerMandatoryField(java.lang.String aProcessParameterName)
                               throws CLEException
Registers the Mandatory parameter

registerMandatoryField

protected void registerMandatoryField(ProcessParameter aProcessParameter)
Deprecated. use registerMandatoryField(String) instead


registerMandatoryField

protected void registerMandatoryField(java.lang.String aProcessParameterName,
                                      java.lang.String aLabel)
                               throws CLEException
Registers the Mandatory parameter and a Label for the Parameter

registerMandatoryField

protected void registerMandatoryField(ProcessParameter aProcessParameter,
                                      java.lang.String aLabel)
Deprecated. use registerMandatoryField(String, String) instead

Registers the Mandatory parameter and a Label for the Parameter

registerIntegerField

protected void registerIntegerField(java.lang.String aProcessParameterName,
                                    java.lang.String aLabel)
                             throws CLEException
Registers the Integer parameter and a Label for the Parameter

registerIntegerField

protected void registerIntegerField(ProcessParameter aProcessParameter,
                                    java.lang.String aLabel)
Deprecated. use registerIntegerField(String, String) instead

Registers the Integer parameter and a Label for the Parameter

registerIntegerField

protected void registerIntegerField(java.lang.String aProcessParameterName)
                             throws CLEException

registerIntegerField

protected void registerIntegerField(ProcessParameter aProcessParameter)
Deprecated. use registerIntegerField(String) instead


registerPositiveIntegerField

protected void registerPositiveIntegerField(java.lang.String aProcessParameterName)
                                     throws CLEException
Registers the Positive Integer parameter with the specified name.

registerPositiveIntegerField

protected void registerPositiveIntegerField(ProcessParameter aProcessParameter)
Deprecated. use registerPositiveIntegerField(String) instead


registerPositiveIntegerField

protected void registerPositiveIntegerField(java.lang.String aProcessParameterName,
                                            java.lang.String aLabel)
                                     throws CLEException
Registers the Positive Integer parameter and a Label for the Parameter

registerPositiveIntegerField

protected void registerPositiveIntegerField(ProcessParameter aProcessParameter,
                                            java.lang.String aLabel)
Deprecated. use registerPositiveIntegerField(String, String) instead

Registers the Positive Integer parameter and a Label for the Parameter

registerDecimalField

protected void registerDecimalField(java.lang.String aProcessParameterName)
                             throws CLEException
Registers the decimal parameter with the specified name

registerDecimalField

protected void registerDecimalField(ProcessParameter aProcessParameter)
Deprecated. use registerDecimalField(String) instead


registerDecimalField

protected void registerDecimalField(java.lang.String aProcessParameterName,
                                    java.lang.String aLabel)
                             throws CLEException
Registers the Decimal parameter and a Label for the Parameter

registerDecimalField

protected void registerDecimalField(ProcessParameter aProcessParameter,
                                    java.lang.String aLabel)
Deprecated. use registerDecimalField(String, String) instead

Registers the Decimal parameter and a Label for the Parameter

registerPositiveDecimalField

protected void registerPositiveDecimalField(java.lang.String aProcessParameterName)
                                     throws CLEException
Registers the PositiveDecimalField parameter with the specified name

registerPositiveDecimalField

protected void registerPositiveDecimalField(ProcessParameter aProcessParameter)
Deprecated. use registerPositiveDecimalField(String) instead


registerPositiveDecimalField

protected void registerPositiveDecimalField(java.lang.String aProcessParameterName,
                                            java.lang.String aLabel)
                                     throws CLEException
Registers the Positive Decimal parameter and a Label for the Parameter

registerPositiveDecimalField

protected void registerPositiveDecimalField(ProcessParameter aProcessParameter,
                                            java.lang.String aLabel)
Deprecated. use registerPositiveDecimalField(String, String) instead

Registers the Positive Decimal parameter and a Label for the Parameter

registerDateField

protected void registerDateField(java.lang.String aProcessParameterName)
                          throws CLEException
Register Date with the specified name

registerDateField

protected void registerDateField(ProcessParameter aProcessParameter)
Deprecated. use registerDateField(String) instead


registerDateField

protected void registerDateField(java.lang.String aProcessParameterName,
                                 java.lang.String format,
                                 java.lang.String aLabel)
                          throws CLEException
Deprecated. use registerDateField(String, String, String) instead

Registers the Date parameter and a Label for the Parameter

registerDateField

protected void registerDateField(ProcessParameter aProcessParameter,
                                 java.lang.String format,
                                 java.lang.String aLabel)
Deprecated. use registerDateField(String, String, String) instead

Registers the Date parameter and a Label for the Parameter

registerDateField

protected void registerDateField(java.lang.String aProcessParameterName,
                                 java.lang.String formatString)
                          throws CLEException
Register Date field with the specifed name and format

registerDateField

protected void registerDateField(ProcessParameter aProcessParameter,
                                 java.lang.String formatString)
Deprecated. use registerDateField(String, String) instead


registerRegularExpressionField

protected void registerRegularExpressionField(java.lang.String aProcessParameterName,
                                              java.lang.String formatString)
                                       throws CLEException
Register parameter with specified name and a regular expression string

registerRegularExpressionField

protected void registerRegularExpressionField(ProcessParameter aProcessParameter,
                                              java.lang.String formatString)
Deprecated. use registerRegularExpressionField(String, String) instead


registerConditionalMandatoryField

protected void registerConditionalMandatoryField(java.lang.String aProcessParameterName,
                                                 java.lang.Boolean condition)
                                          throws CLEException
Registers the boolean condition with the specified name.

registerConditionalMandatoryField

protected void registerConditionalMandatoryField(ProcessParameter aProcessParameter,
                                                 java.lang.Boolean condition)
Deprecated. use registerConditionalMandatoryField(String, Boolean) instead


validateContent

protected boolean validateContent()
Called by start after it has finished calling all the other validation. Allows further content-specific validation to be done in the subclasses. The default implementation always returns true.

registerInfo

protected void registerInfo()
Description copied from class: GenericProcess
Here is where we register all ProcessParameters and potential ProcessResults.
Overrides:
registerInfo in class GenericProcess


Copyright © 2003 ORACLE Corp. All Rights Reserved.