org.fcrepo.server.validation
Class DOValidatorSchematron

java.lang.Object
  extended by org.fcrepo.server.validation.DOValidatorSchematron

public class DOValidatorSchematron
extends 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$
Author:
Sandy Payette

Constructor Summary
DOValidatorSchematron(String schemaPath, String preprocessorPath, String phase)
          Constructs a DOValidatorSchematron instance with a Schematron preprocessor that is provided by the calling class.
 
Method Summary
static StreamSource fileToStreamSource(File file)
           
static StreamSource fileToStreamSource(String str)
          Generates a StreamSource from a file name.
 void validate(File objectAsFile)
          Run the Schematron validation on a Fedora object.
 void validate(InputStream objectAsStream)
          Run the Schematron validation on a Fedora object.
 void validate(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(String schemaPath,
                             String preprocessorPath,
                             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(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(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(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 StreamSource fileToStreamSource(String str)
Generates a StreamSource from a file name.


fileToStreamSource

public static StreamSource fileToStreamSource(File file)


Copyright © 2011 DuraSpace. All Rights Reserved.