ESciDoc Services ValidationService

 Work in progress

ID (Label)
validation

Complete Name
Validation Service

Status
Implemented

Description
The validation service provides interfaces for validation of the item and container resources in accordance with defined set of rules. Validation rules are defined for a combination of a content model, validation schema, metadata schema version and a validation point. The validation rules are defined with Schematron

Service interfaces
Validation service operations are offered via EJB, REST and SOAP interfaces.

For example, see Validation service in action

Download

 * Validation service
 * Service interfaces Service interfaces

How to describe which validation schema shall be used
The first and easiest way is to use "validateItem(Xml|Object)BySchema": Then, only the desired schema has to be named in the method call e.g. validateItemXmlBySchema("", "default", "simple") where "simple" is the validation schema. The second way currently used in PubMan is to define the validation schema in the Admin-Descriptor defined in the Context. "An AdminDescriptor keeps settings from application. A Context may have multiple Admin-Descriptors as well as no one. The Admin-Descriptors are stored as data streams with unique names. Specifications for XML structure of Admin-Descriptors will not be done" (from the eSciDoc-core documentation). Here is the structure of PubMan's Admin-Descriptor (see http://coreservice.mpdl.mpg.de/ir/context/escidoc:persistent3 ):    article book book-item proceedings conference-paper talk-at-event</allowed-genre> conference-report</allowed-genre> poster</allowed-genre> courseware-lecture</allowed-genre> thesis</allowed-genre> paper</allowed-genre> report</allowed-genre> journal</allowed-genre> issue</allowed-genre> series</allowed-genre> other</allowed-genre> </allowed-genres> <template-item>escidoc:123</template-item> <validation-schema>publication</validation-schema>

standard </pubman-admin-descriptor> </context:admin-descriptor>

How to enter a new validation schema
There is no tool for entering new validation schemas yet, so a little bit of manual work is needed.


 * 1) Make a copy of one of the existing schemas that you can find here
 * 2) Edit the file and add new rules or remove existing rules. The syntax of the file is defined by Schematron and by your data structure (e.g. an eSciDoc application profile) expressed in XPath.
 * 3) Make sure your JBoss is running and the validation service has been initialized before
 * 4) Start the Hypersonic SQL Console of your JBoss:
 * 5) Open http://localhost:8080/jmx-console/HtmlAdaptor?action=inspectMBean&name=jboss%3Aservice%3DHypersonic%2Cdatabase%3DlocalDB in your browser
 * 6) Invoke startDatabaseManager
 * 7) A swing client will open up showing the current database structure and an SQL window.
 * 8) Enter the new schema with SQL:   --Note: Apostrophs in the schema content should be escaped with double apostrophs whereas line breaks do not need to be escaped
 * 9) Open http://localhost:8080/validation/rest/refreshValidationSchemaCache to precompile the schema
 * 10) Add the new schema to the admin descriptor of your context as described above