|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.fcrepo.server.validation.DOValidatorImpl
public class DOValidatorImpl
The implementation of the digital object validation module (see DOValidator.class and DOValidatorModule.class). The validator operates on digital object XML files encoded in one of the Fedora-supported encoding formats (i.e., FOXML, Fedora METS, and possibly others in the future). The following types of validation can be run:
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.
| Field Summary | |
|---|---|
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 |
static int |
VALIDATE_ALL
|
static int |
VALIDATE_SCHEMATRON
|
static int |
VALIDATE_XML_SCHEMA
|
protected static String |
xmlSchemaPath
Configuration variable: xmlSchemaPath is the location of the XML Schema. |
| Constructor Summary | |
|---|---|
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. |
|
| Method Summary | |
|---|---|
void |
validate(File objectAsFile,
String format,
int validationType,
String phase)
Validates a digital object. |
void |
validate(InputStream objectAsStream,
String format,
int validationType,
String phase)
Validates a digital object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static boolean debug
public static final int VALIDATE_ALL
public static final int VALIDATE_XML_SCHEMA
public static final int VALIDATE_SCHEMATRON
protected static String tempDir
protected static String xmlSchemaPath
protected static String schematronPreprocessorPath
protected static String schematronSchemaPath
| Constructor Detail |
|---|
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 METS
ServerException - If construction fails for any reason.| Method Detail |
|---|
public void validate(InputStream objectAsStream,
String format,
int validationType,
String phase)
throws ObjectValidityException
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 phase
ObjectValidityException - If validation fails for any reason.
GeneralException - If validation fails for any reason.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||