public class DOValidatorImpl extends Object implements DOValidator
0=VALDIATE_ALL : All validation will be done.
1=VALIDATE_XML_SCHEMA : the digital object will be validated against
the the appropriate XML Schema. An ObjectValidityException
will be thrown if the object fails the schema test.
2=VALIDATE_SCHEMATRON : the digital object will be validated
against a set of rules expressed by a Schematron schema.
These rules are beyond what can be expressed in XML Schema.
The Schematron schema expresses rules for different phases
of the object. There are rules appropriate to a digital
object when it is first ingested into the repository
(ingest phase). There are additional rules that must be met
before a digital object is considered valid for permanent
storage in the repository (completed phase). These rules
pertain to aspects of the object that are system assigned,
such as created dates and state codes.
An ObjectValidityException will be thrown if the object fails
the Fedora rules test.
| Modifier and Type | Field and Description |
|---|---|
protected static boolean |
debug |
protected static String |
schematronPreprocessorPath
Configuration variable: schematronPreprocessorPath is the Schematron
stylesheet that is used to transform a Schematron schema into a
validating stylesheet based on the rules in the schema.
|
protected static String |
schematronSchemaPath
Configuration variable: schematronSchemaPath is the Schematron schema
that expresses Fedora-specific validation rules.
|
protected static String |
tempDir
Configuration variable: tempdir is a working area for validation
|
protected static String |
xmlSchemaPath
Configuration variable: xmlSchemaPath is the location of the XML Schema.
|
PHASE_INGEST, PHASE_STORE, VALIDATE_ALL, VALIDATE_NONE, VALIDATE_SCHEMATRON, VALIDATE_XML_SCHEMA| Constructor and Description |
|---|
DOValidatorImpl(String tempDir,
Map<String,String> xmlSchemaMap,
String schematronPreprocessorPath,
Map<String,String> ruleSchemaMap)
Constructs a new DOValidatorImpl to support all forms of digital object
validation, using specified values for configuration values.
|
protected static boolean debug
protected static String tempDir
protected static String xmlSchemaPath
protected static String schematronPreprocessorPath
protected static String schematronSchemaPath
public DOValidatorImpl(String tempDir, Map<String,String> xmlSchemaMap, String schematronPreprocessorPath, Map<String,String> ruleSchemaMap) throws ServerException
Constructs a new DOValidatorImpl to support all forms of digital object validation, using specified values for configuration values.
Any parameter may be given as null, in which case the default value is assumed.
tempDir - Working area for validation, default is temp/xmlSchemaMap - Location of XML Schemas (W3 Schema) configured with Fedora (see
Fedora.fcfg). Current options are xsd/foxml1-1.xsd for
FOXML or xsd/mets-fedora-ext1-1.xsd for METS (Fedora
extension)schematronPreprocessorPath - Location of the Schematron pre-processing stylesheet configured
with Fedora.ruleSchemaMap - Location of rule schemas (Schematron), configured with Fedora (see
Fedora.fcfg). Current options are schematron/foxmlRules1-0.xml
for FOXML or schematron/metsExtRules1-0.xml for METSServerException - If construction fails for any reason.public void validate(InputStream objectAsStream, String format, int validationType, String phase) throws ObjectValidityException, GeneralException
Validates a digital object.
validate in interface DOValidatorobjectAsStream - The digital object provided as a stream.format - The format URI of the object serialization.validationType - The level of validation to perform on the digital object. This is
an integer from 0-2 with the following meanings: 0 = VALIDATE_ALL
(do all validation levels) 1 = VALIDATE_XML_SCHEMA (perform only
XML Schema validation) 2 = VALIDATE_SCHEMATRON (perform only
Schematron Rules validation)phase - The stage in the workflow for which the validation should be
contextualized. "ingest" = the object is encoded for ingest into
the repository "store" = the object is encoded with all final
assignments so that it is appropriate for storage as the
authoritative serialization of the object.ObjectValidityException - If validation fails for any reason.GeneralException - If validation fails for any reason.public void validate(File objectAsFile, String format, int validationType, String phase) throws ObjectValidityException, GeneralException
Validates a digital object.
validate in interface DOValidatorobjectAsFile - The digital object provided as a file.validationType - The level of validation to perform on the digital object. This is
an integer from 0-2 with the following meanings: 0 = VALIDATE_ALL
(do all validation levels) 1 = VALIDATE_XML_SCHEMA (perform only
XML Schema validation) 2 = VALIDATE_SCHEMATRON (perform only
Schematron Rules validation)phase - The stage in the work flow for which the validation should be
contextualized. "ingest" = the object is in the submission format
for the ingest phase "store" = the object is in the authoritative
format for the final storage phaseObjectValidityException - If validation fails for any reason.GeneralException - If validation fails for any reason.Copyright © 2013 DuraSpace. All Rights Reserved.