Admin/contentValidation

From Omar Wiki

Jump to: navigation, search

This page provides tip and tricks for writing custom Content Validation Services for freebXML Registry. More details will be added over time.

Contents

Content Validation Concepts

Defining a New Content Validation Service

SOAP Based Service

Java Plugin Service

XML Validation Service

A Schematron is used to validate content using the XML Validation Service. An example of a Schematron being used to validate content is the "InvocationControlFile_WSDLValidation.schematron" Schematron object in the demo database. Follow these steps to add content validation to an object type (TestType in this example):

  • Make a new object of the Schematron type (under ExtrinsicObject) and add a Schematron RepositoryItem to it.
  • Make an Association of type ValidationControlFileFor between the new Schematron object (source) and the TestType ClassificationNode (target).
  • Make an Association of type ContentManagementServiceFor between the CanonicalXMLValidationService Service object (source) and the TestType ClassificationNode (target).

Note: The CanonicalXMLValidationService Service object has a Unique ID of urn:oasis:names:tc:ebxml-regrep:Service:CanonicalXMLValidationService.

Adding Usable Namespaces in Schematron

In order to use namespaces in the Schematron tests they must be in to <omar.home>/src/java/org/freebxml/omar/server/cms/conf/skeleton1-5.xsl. To add a usable namespace simply add an xmlns attribute to the root xsl:stylesheet element like you would normally add a namespace.

Schematron Error Messages

The error messages given by the Schematron in the <assert> tag needs to be a key in the localization ResourceBundle located in the following directory:

<omar.home>/src/resources/org/freebxml/omar/server

Simply edit the ResourceBundle for any locale you would like to have the error message for (currently only the en_US file is there, which is the default ResourceBundle.properties file) and re-build/deploy the application.

Debugging Content Validation Problem

  • Problem: I don't know how to build the CPPA Cataloging and Validation unit tests.
    • These tests don't build unless the ebxmlrr-spec directory is available at build time. You need to check ebxmlrr-spec out of cvs and re-run the build.
  • Problem: I'm seeing a build problem when I try to build one of the unit tests that builds a war file on Windows. It looks like a problem with wscompile.
    • There build actually was broken on Windows because wscompile on Windows doesn't work the way it is documented to work. A change to the ebxmlrr build-compile.xml to work around this problem was submitted, so you should download this change from cvs.

How Do I Do XXX: Typical Problems and their Solution

Please add questions as first level bullet here and answers as second level bullets under the question.

  • Q: How do I submit an InvocationControlFile and related Associations as defined by ebRS spec
    • InvocationControlFile (Schematron if using Default XML Validation Service) is submitted like any other RepositoryItem. Same is true for the Associations that are required for the feature to work according to the spec.

Links