ESciDoc Services ValidationService

From MPDLMediaWiki
Jump to: navigation, search
eSciDoc SOA
SOAP and REST style interfaces
Service layers
Core services
Context Handler · Item Handler
Container Handler
Organizational Unit Handler
User Account Handler
Authentication
Content Model Handler
Semantic Store Handler
Intermediate services
Validation Service
Statistics Manager
Technical Metadata extraction
PIDManager
Basket Handler
Duplication detection
ImageHandler(Digilib)

Application services
Depositing
Searching
Search&Export
Control of Named Entities
Citation style Manager
RightsChecking
DataAcquisition
Transformation
Fledged Data
PID Cache
OAI-PMH

SOA Introduction

edit

Work in progress

IDIdentifier (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

Operations Overview

Operation Status Input Output Description
validateItemXml implemented itemXml: String String Scope:Public
Validates an item (as XMLExtensible Markup Language string) based on the content-model of the item and the validation schema defined in the context the item belongs to. The default validation point is used.
validateItemXml implemented itemXml: String
validationPoint: String
String Scope:Public
Validates an item (as XMLExtensible Markup Language string) based on the content-model of the item and the validation schema defined in the context the item belongs to using the given validation point.
validateItemXmlBySchema implemented itemXml: String
validationPoint: String
validationSchema: String
String Scope:Public
Validates an item (as XMLExtensible Markup Language string) based on the content-model of the item and the given validation schema using the given validation point.
validateItemObject implemented itemXml: String String Scope:Public
Validates an item (as ValueObject) based on the content-model of the item and the validation schema defined in the context the item belongs to. The default validation point is used.
validateItemObject implemented itemXml: String
validationPoint: String
String Scope:Public
Validates an item (as ValueObject) based on the content-model of the item and the validation schema defined in the context the item belongs to using the given validation point.
validateItemObjectBySchema implemented itemXml: String
validationPoint: String
validationSchema: String
String Scope:Public
Validates an item (as ValueObject) based on the content-model of the item and the given validation schema using the given validation point.
refreshValidationSchemaCache not implemented Scope:Public
Synchronizes the service's validation schema cache with the underlying validation schema store, i.e. the eSciDocEnhanced Scientific Documentation repository.

Service interfaces

Validation service operations are offered via EJBEnterprise JavaBeans, RESTRepresentational State Transfer and SOAPSimple Object Access Protocol interfaces.

For example, see Validation service in action

Download

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("<escidocItem:item/>", "default", "simple")

where "simple" is the validation schema.

The second way currently used in PubManPublication Management 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 XMLExtensible Markup Language structure of Admin-Descriptors will not be done" (from the eSciDocEnhanced Scientific Documentation-core documentation). Here is the structure of PubManPublication Management's Admin-Descriptor (see http://coreservice.mpdl.mpg.de/ir/context/escidoc:persistent3 ):

<context:admin-descriptor name="pubman"
    xlink:type="simple" xlink:title="pubman admin descriptor." xlink:href="/ir/context/escidoc:persistent3/admin-descriptors/admin-descriptor/pubman">
    <pubman-admin-descriptor>
        <allowed-genres>
            <allowed-genre>article</allowed-genre>
            <allowed-genre>book</allowed-genre>
            <allowed-genre>book-item</allowed-genre>
   
            <allowed-genre>proceedings</allowed-genre>
            <allowed-genre>conference-paper</allowed-genre>
            <allowed-genre>talk-at-event</allowed-genre>
            <allowed-genre>conference-report</allowed-genre>
            <allowed-genre>poster</allowed-genre>
            <allowed-genre>courseware-lecture</allowed-genre>
   
            <allowed-genre>thesis</allowed-genre>
            <allowed-genre>paper</allowed-genre>
            <allowed-genre>report</allowed-genre>
            <allowed-genre>journal</allowed-genre>
            <allowed-genre>issue</allowed-genre>
            <allowed-genre>series</allowed-genre>
   
            <allowed-genre>other</allowed-genre>
        </allowed-genres>
        <template-item>escidoc:123</template-item>
       
        <!-- Here it comes -->
        <validation-schema>publication</validation-schema>

        <workflow>standard</workflow>
    </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 XPathExpression Language Used to Navigate and to Find Structures in XML Documents.
  3. Make sure your JBossOpen source Java EE-based application server is running and the validation service has been initialized before
  4. Start the Hypersonic SQLStructured Query Language Console of your JBossOpen source Java EE-based application server:
    1. Open http://localhost:8080/jmx-console/HtmlAdaptor?action=inspectMBean&name=jboss%3Aservice%3DHypersonic%2Cdatabase%3DlocalDB in your browser
    2. Invoke startDatabaseManager()
    3. A swing client will open up showing the current database structure and an SQLStructured Query Language window.
  5. Enter the new schema with SQLStructured Query Language: INSERT INTO escidoc_validation_schema (id_content_type_ref, id_context_ref, schema_content) VALUES ('<escidoc:content-model-id>', '<escidoc:validation-schema-name>', '<validation-schema-content>'); --Note: Apostrophs in the schema content should be escaped with double apostrophs whereas line breaks do not need to be escaped
  6. Open http://localhost:8080/validation/rest/refreshValidationSchemaCache to precompile the schema
  7. Add the new schema to the admin descriptor of your context as described above

Future Development