public class SchemEditValidator
extends java.lang.Object
The fields to be validated are filtered from the request, and the fields of
like "type" (Attribute, Element, MulitValue) are validated as a set. The
validation methods return ActionErrors
instances that have been populated by the org.dlese.dpc.schemedit.SchemEditErrors
.
Modifier and Type | Field and Description |
---|---|
protected DocMap |
docMap
NOT YET DOCUMENTED
|
protected MetaDataFramework |
framework
NOT YET DOCUMENTED
|
protected InputManager |
im
NOT YET DOCUMENTED
|
protected javax.servlet.http.HttpServletRequest |
request
NOT YET DOCUMENTED
|
protected SchemaHelper |
schemaHelper
the schemaHelper provided schema info
|
protected SchemEditForm |
sef
the ActionForm providing fields to validate
|
Constructor and Description |
---|
SchemEditValidator(SchemEditForm sef,
MetaDataFramework framework,
org.apache.struts.action.ActionMapping mapping,
javax.servlet.http.HttpServletRequest request)
Constructor for the SchemEditValidator object
|
Modifier and Type | Method and Description |
---|---|
protected void |
exposeField(InputField field)
Description of the Method
|
SchemEditActionErrors |
getEntityErrors()
Gets the entityErrors attribute of the SchemEditValidator object
|
InputManager |
getInputManager()
Gets the inputManager attribute of the SchemEditValidator object
|
boolean |
hasEntityErrors()
Predicate to identify if the input contains entities that could not be resolved.
|
boolean |
isLastRequiredRepeatingElement(java.lang.String pathArg)
Guards against deletion of the last required element, causing a new empty
element to be automatically inserted after the last one is deleted.
|
void |
pruneInstanceDoc()
Rid the instanceDocument of any non-required empty fields
|
protected void |
pruneRepeatingFields()
Removes empty elements of repeating fields.
|
protected boolean |
skipFieldValidation(InputField inputField) |
void |
updateMultiValueFields()
Validate the multivalue parameters managed by the input manager.
|
protected SchemEditActionErrors |
validateAttributeFields()
Checks all required attribute fields for a value, and all populated
attributes for schema-type compliance.
|
SchemEditActionErrors |
validateDeletion(java.lang.String pathArg)
Guard against deletion of last member of a required repeating sequence.
|
SchemEditActionErrors |
validateDocument()
Description of the Method
|
protected SchemEditActionErrors |
validateElementFields()
Validate the input fields corresponding to elements in the DocMap.
|
SchemEditActionErrors |
validateForm()
Validates the metadata fields contained in a request by calling
validateMultiValueFields
, then validateAttributeFields , and finally validateElementFields
. |
protected SchemEditActionErrors |
validateMultiValueFields()
Ensures that all fields expecting 1 or more values have at least one value;
|
protected SchemEditForm sef
protected SchemaHelper schemaHelper
protected MetaDataFramework framework
protected javax.servlet.http.HttpServletRequest request
protected InputManager im
protected DocMap docMap
public SchemEditValidator(SchemEditForm sef, MetaDataFramework framework, org.apache.struts.action.ActionMapping mapping, javax.servlet.http.HttpServletRequest request)
sef
- Description of the Parameterframework
- Description of the Parameterrequest
- Description of the Parametermapping
- NOT YET DOCUMENTEDpublic InputManager getInputManager()
protected boolean skipFieldValidation(InputField inputField)
public SchemEditActionErrors validateForm()
validateMultiValueFields
, then validateAttributeFields
, and finally validateElementFields
.public boolean hasEntityErrors()
public SchemEditActionErrors getEntityErrors()
public SchemEditActionErrors validateDocument()
protected void pruneRepeatingFields()
DISABLED 5/11/04 - the repository will contain non-valid elements, so we don't worry so much about getting rid of the empty elements (many of which will be invalid due to the "stringTextType" convention) Removes empty child elements from each repeating field in the toPrune list. Children are pruned if they are empty and their occurance attribute allows them to be deleted.
protected SchemEditActionErrors validateElementFields()
protected SchemEditActionErrors validateAttributeFields()
public void updateMultiValueFields()
protected SchemEditActionErrors validateMultiValueFields()
public boolean isLastRequiredRepeatingElement(java.lang.String pathArg)
pathArg
- NOT YET DOCUMENTEDpublic SchemEditActionErrors validateDeletion(java.lang.String pathArg)
pathArg
- Description of the Parameterprotected void exposeField(InputField field)
field
- Description of the Parameterpublic void pruneInstanceDoc()