|
|||||||||
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.ValidateAttributes
Class validates a set of attributes defined in an XML file, based on the
corresponding values in the info table. Validation errors are accumulated
in a Hashtable which is stored in a result labeled processfeedback.
processfeedback is specified as
ProcessConstants.PROCESS_FEEDBACK
This class should be extended to
add functionality, using the runCustomValidation method.
The DTD for this file can be found here: http://xmlns.oracle.com/ias/mvc/cle-validation-rules.dtd
Example1: For conditonal validation <attribute name="lastname" descriptiveName="last name"> <conditionalvalidation value="REQUIRED" message="firstname and SSN have to be entered when lastname is entered"> <dependentAttribute descriptiveName="first name" >firstname</dependentAttribute> <dependentAttribute descriptiveName="SSN" >ssn</dependentAttribute> </conditionalvalidation> <conditionalvalidation value="NULL"> <dependentAttribute descriptiveName="Search Type" >searchtype</dependentAttribute> </conditionalvalidation> <conditionalvalidation value="REQUIRESONE" > <dependentAttribute descriptiveName="first name" >firstname</dependentAttribute> <dependentAttribute descriptiveName="SSN" >ssn</dependentAttribute> </conditionalvalidation> </attribute> Example2: lt&;attribute name="ssn" descriptiveName="ssn"> lt&;datatype message="SSN must be a number">intlt&;/datatype> lt&;mandatory message="SSN is required">Ylt&;/mandatory> lt&;length message="SSN must be a nine digit number">9lt&;/length> lt&;/attribute>
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 | |
ValidateAttributes(java.lang.String aXMLRuleFileKey)
Deprecated. This constructor may be changed to behave the same as ValidateAttributes(filename, false) in future releases. Currently, this constructor currently uses the aXMLRuleFileKey to lookup the location of a file from the info table... |
|
ValidateAttributes(java.lang.String aXMLRuleFile,
boolean lookupFileLocation)
This constructor provides a mechanism to lookup the xml rule file as a resource (pass the filename for the xml file if the file can be found at the top of the classpath) or based on a URL (i.e. |
|
ValidateAttributes(java.lang.String aXMLRuleFile,
boolean lookupFileLocation,
boolean complexResults)
If complexResults is true, then the
PROCESS_FEEDBACK result will be a Hashtable of Lists. |
Method Summary | |
java.lang.Object |
clone()
|
protected java.util.Hashtable |
getDependentValues(java.util.Vector dependents)
Returns all the dependent values from the infoTable as key :value pairs in a Hashtable. |
protected java.lang.String |
getParameterValue(java.lang.String name)
Gets the parameter value from the infotable |
protected TransitionCondition |
getValidateFailureCondition()
Get the condition in the event that the validation fails. |
protected TransitionCondition |
getValidateSuccessCondition()
Get the condition in the event that the validate is successful. |
java.util.Map |
loadAttributes(java.lang.String locationOrFile)
Processes the xml rule file. |
protected java.lang.String |
lookupPageLocation(java.lang.String key)
Does the infoTable lookup for an HTML page keyed by the specified String. |
protected void |
registerInfo()
Register ProcessResults(PROCESS_FEEDBACK). |
protected boolean |
runCustomValidation(java.util.Hashtable errorMessages)
Run validations and add errors to the specified errorMessages Hashtable. |
protected boolean |
runCustomValidation(java.util.Vector errorMessages)
Run validations and add errors to the specified errorMessages Vector. |
void |
start()
Start method of the process |
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 |
Constructor Detail |
public ValidateAttributes(java.lang.String aXMLRuleFileKey)
public ValidateAttributes(java.lang.String aXMLRuleFile, boolean lookupFileLocation)
java.lang.String
- boolean
- public ValidateAttributes(java.lang.String aXMLRuleFile, boolean lookupFileLocation, boolean complexResults)
complexResults
is true, then the
PROCESS_FEEDBACK
result will be a Hashtable of Lists.
Each Hashtable entry would be keyed by the attribute name (ie. ssn)
and the List
value would contain all the error messages
for that attribute.
Otherwise, this Constructor is the same as
ValidateAttributes(aXMLRuleFile, boolean lookup)
java.lang.String
- boolean
- boolean
- Method Detail |
public void start()
start
in class GenericProcess
protected void registerInfo()
registerInfo
in class GenericProcess
protected java.lang.String getParameterValue(java.lang.String name)
protected java.util.Hashtable getDependentValues(java.util.Vector dependents)
key
:value
pairs in a Hashtable.public java.util.Map loadAttributes(java.lang.String locationOrFile) throws java.lang.Exception
attributes
attribute. By doing this, the default
implementation of ValidateAttributes
avoids parsing
the rules xml file for each request.
NOTE: This method replaces getAttributes()
in previous
releases
protected TransitionCondition getValidateSuccessCondition()
protected TransitionCondition getValidateFailureCondition()
protected java.lang.String lookupPageLocation(java.lang.String key) throws java.lang.Exception
java.lang.Exception
- protected boolean runCustomValidation(java.util.Vector errorMessages)
protected boolean runCustomValidation(java.util.Hashtable errorMessages)
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class GenericProcess
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |