|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--oracle.cle.process.Process | +--oracle.cle.process.GenericProcess | +--oracle.clex.process.ValidateHTMLForm
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
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 |
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.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 |
protected java.util.Vector errorMsgs
Constructor Detail |
public ValidateHTMLForm()
Method Detail |
public void start() throws TransitionConditionException
start
in class GenericProcess
protected abstract void registerValidation() throws CLEException
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.
protected void registerMandatoryField(java.lang.String aProcessParameterName) throws CLEException
protected void registerMandatoryField(ProcessParameter aProcessParameter)
protected void registerMandatoryField(java.lang.String aProcessParameterName, java.lang.String aLabel) throws CLEException
protected void registerMandatoryField(ProcessParameter aProcessParameter, java.lang.String aLabel)
protected void registerIntegerField(java.lang.String aProcessParameterName, java.lang.String aLabel) throws CLEException
protected void registerIntegerField(ProcessParameter aProcessParameter, java.lang.String aLabel)
protected void registerIntegerField(java.lang.String aProcessParameterName) throws CLEException
protected void registerIntegerField(ProcessParameter aProcessParameter)
protected void registerPositiveIntegerField(java.lang.String aProcessParameterName) throws CLEException
protected void registerPositiveIntegerField(ProcessParameter aProcessParameter)
protected void registerPositiveIntegerField(java.lang.String aProcessParameterName, java.lang.String aLabel) throws CLEException
protected void registerPositiveIntegerField(ProcessParameter aProcessParameter, java.lang.String aLabel)
protected void registerDecimalField(java.lang.String aProcessParameterName) throws CLEException
protected void registerDecimalField(ProcessParameter aProcessParameter)
protected void registerDecimalField(java.lang.String aProcessParameterName, java.lang.String aLabel) throws CLEException
protected void registerDecimalField(ProcessParameter aProcessParameter, java.lang.String aLabel)
protected void registerPositiveDecimalField(java.lang.String aProcessParameterName) throws CLEException
protected void registerPositiveDecimalField(ProcessParameter aProcessParameter)
protected void registerPositiveDecimalField(java.lang.String aProcessParameterName, java.lang.String aLabel) throws CLEException
protected void registerPositiveDecimalField(ProcessParameter aProcessParameter, java.lang.String aLabel)
protected void registerDateField(java.lang.String aProcessParameterName) throws CLEException
protected void registerDateField(ProcessParameter aProcessParameter)
protected void registerDateField(java.lang.String aProcessParameterName, java.lang.String format, java.lang.String aLabel) throws CLEException
protected void registerDateField(ProcessParameter aProcessParameter, java.lang.String format, java.lang.String aLabel)
protected void registerDateField(java.lang.String aProcessParameterName, java.lang.String formatString) throws CLEException
protected void registerDateField(ProcessParameter aProcessParameter, java.lang.String formatString)
protected void registerRegularExpressionField(java.lang.String aProcessParameterName, java.lang.String formatString) throws CLEException
protected void registerRegularExpressionField(ProcessParameter aProcessParameter, java.lang.String formatString)
protected void registerConditionalMandatoryField(java.lang.String aProcessParameterName, java.lang.Boolean condition) throws CLEException
protected void registerConditionalMandatoryField(ProcessParameter aProcessParameter, java.lang.Boolean condition)
protected boolean validateContent()
protected void registerInfo()
GenericProcess
registerInfo
in class GenericProcess
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |