fedora.server.validation
Class DOValidatorSchematron

java.lang.Object
  extended by fedora.server.validation.DOValidatorSchematron

public class DOValidatorSchematron
extends java.lang.Object

Schematron validation for fedora objects encoded in schematron schema for Fedora. The schematron schema (metsExtRules1-0.xml) expresses a set of rules using XPATH that enable us to check for things that are either not expressed in the METS XML schema, or that cannot be expressed with XML Schema language. Generally we will look for things that are requirements of Fedora objects, which are not requirements for METS objects in general.

Version:
$Id: DOValidatorSchematron.java 5218 2006-11-20 05:10:11Z cwilper $
Author:
payette@cs.cornell.edu

Constructor Summary
DOValidatorSchematron(java.lang.String schemaPath, java.lang.String preprocessorPath, java.lang.String phase)
          Constructs a DOValidatorSchematron instance with a Schematron preprocessor that is provided by the calling class.
 
Method Summary
static javax.xml.transform.stream.StreamSource fileToStreamSource(java.io.File file)
           
static javax.xml.transform.stream.StreamSource fileToStreamSource(java.lang.String str)
          Generates a StreamSource from a file name.
 void validate(java.io.File objectAsFile)
          Run the Schematron validation on a Fedora object.
 void validate(java.io.InputStream objectAsStream)
          Run the Schematron validation on a Fedora object.
 void validate(javax.xml.transform.stream.StreamSource objectSource)
          Run the Schematron validation on a Fedora object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DOValidatorSchematron

public DOValidatorSchematron(java.lang.String schemaPath,
                             java.lang.String preprocessorPath,
                             java.lang.String phase)
                      throws ObjectValidityException
Constructs a DOValidatorSchematron instance with a Schematron preprocessor that is provided by the calling class. This will allow the DOValidator module to pass in the preprocessor that is configured with the Fedora repository.

Parameters:
schemaPath - the URL of the Schematron schema
preprocessorPath - the location of the Schematron preprocessor
phase - the phase in the fedora object lifecycle to which validation should pertain. (Currently options are "ingest" and "store"
Throws:
ObjectValidityException
Method Detail

validate

public void validate(java.io.File objectAsFile)
              throws ServerException
Run the Schematron validation on a Fedora object.

Parameters:
objectAsFile - the Fedora object as a File
Throws:
ServerException

validate

public void validate(java.io.InputStream objectAsStream)
              throws ServerException
Run the Schematron validation on a Fedora object.

Parameters:
objectAsStream - the Fedora object as an Inputstream
Throws:
ServerException

validate

public void validate(javax.xml.transform.stream.StreamSource objectSource)
              throws ServerException
Run the Schematron validation on a Fedora object.

Parameters:
objectSource - the Fedora object as an StreamSource
Throws:
ServerException

fileToStreamSource

public static javax.xml.transform.stream.StreamSource fileToStreamSource(java.lang.String str)
Generates a StreamSource from a file name.


fileToStreamSource

public static javax.xml.transform.stream.StreamSource fileToStreamSource(java.io.File file)