Package ddf.services.schematron
Class SchematronValidationService
java.lang.Object
ddf.services.schematron.SchematronValidationService
- All Implemented Interfaces:
ddf.catalog.util.Describable,ddf.catalog.validation.MetacardValidator,ddf.catalog.validation.ReportingMetacardValidator,org.codice.ddf.platform.services.common.Describable
public class SchematronValidationService
extends Object
implements ddf.catalog.validation.MetacardValidator, ddf.catalog.util.Describable, ddf.catalog.validation.ReportingMetacardValidator
This pre-ingest service provides validation of an ingested XML document against a Schematron
schema file.
When this service is instantiated at deployment time to the OSGi container it goes through 3 different preprocessing stages on the Schematron schema file. (These steps are required by the ISO Schematron implementation)
- 1. Preprocess the Schematron schema with iso_dsdl_include.xsl. This is a macro processor to assemble the schema from various parts.
- 2. Preprocess the output from stage 1 with iso_abstract_expand.xsl. This is a macro processor to convert abstract patterns to real patterns.
- 3. Compile the Schematron schema into an XSLT script. This will use iso_svrl_for_xslt2.xsl (which in turn invokes iso_schematron_skeleton_for_saxon.xsl)
When XML documents are ingested, this service will run the XSLT generated by stage 3 against the XML document, validating it against the "compiled" Schematron schema file.
This service is using the SVRL script, hence the output of the validation will be an SVRL-formatted XML document.
- Author:
- rodgersh
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetId()getTitle()voidinit()voidvoidsetNamespace(String namespace) voidsetPriority(int priority) voidsetSchematronFileNames(List<String> schematronFileNames) voidsetSuppressWarnings(boolean suppressWarnings) voidvalidate(ddf.catalog.data.Metacard metacard) Optional<ddf.catalog.validation.report.MetacardValidationReport>validateMetacard(ddf.catalog.data.Metacard metacard)
-
Field Details
-
DEFAULT_THREAD_POOL_SIZE
- See Also:
-
-
Constructor Details
-
SchematronValidationService
public SchematronValidationService()
-
-
Method Details
-
init
-
setSuppressWarnings
public void setSuppressWarnings(boolean suppressWarnings) -
setSchematronFileNames
public void setSchematronFileNames(List<String> schematronFileNames) throws SchematronInitializationException -
setNamespace
-
setPriority
public void setPriority(int priority) -
validate
public void validate(ddf.catalog.data.Metacard metacard) throws ddf.catalog.validation.ValidationException - Specified by:
validatein interfaceddf.catalog.validation.MetacardValidator- Throws:
ddf.catalog.validation.ValidationException
-
getVersion
- Specified by:
getVersionin interfaceddf.catalog.util.Describable- Specified by:
getVersionin interfaceorg.codice.ddf.platform.services.common.Describable
-
getId
- Specified by:
getIdin interfaceddf.catalog.util.Describable- Specified by:
getIdin interfaceorg.codice.ddf.platform.services.common.Describable
-
setId
-
getTitle
- Specified by:
getTitlein interfaceddf.catalog.util.Describable- Specified by:
getTitlein interfaceorg.codice.ddf.platform.services.common.Describable
-
getDescription
- Specified by:
getDescriptionin interfaceddf.catalog.util.Describable- Specified by:
getDescriptionin interfaceorg.codice.ddf.platform.services.common.Describable
-
getOrganization
- Specified by:
getOrganizationin interfaceddf.catalog.util.Describable- Specified by:
getOrganizationin interfaceorg.codice.ddf.platform.services.common.Describable
-
validateMetacard
public Optional<ddf.catalog.validation.report.MetacardValidationReport> validateMetacard(ddf.catalog.data.Metacard metacard) - Specified by:
validateMetacardin interfaceddf.catalog.validation.ReportingMetacardValidator
-