Hi Corne,

Corne Kloppers wrote:
Hi all
I'm currently investing a lot of time looking into utilizing JCR for
getting a huge amount of content under control (Legislative- and
parliamentary data).
I'm busy writing XSD's for defining the document content structures for
each document type found within a Legislative context, documents like
Gazettes, Case Law, Journals, Bill, e.g. I'm planning to use these XSD's
to validate the XML documents while creating new XML content and
transforming existing content.
To my understanding XSD's can be used/imported into Nuxeo Core/Jackrabbit to
automatically setup the Node structures, do you know of any real world
example of such a use? After the XSD has been imported I would then like to import the validated XML documents (data) into the Nuxeo Core/Jackrabbit repository to take advantage of the
features offered by JCR and Nuxeo Core. Would this be feasible?
Can you recommend any Open Source application(s)? I've briefly looked
at Nuxeo 5 (Nuxeo Core) and the feature set looks very attractive.
Your use case seems interesting to us.
Theoretically, Nuxeo Core is able to do what you want but with some restrictions: - the XSD schemas import works (mapping between XSD and JCR node types) but not the entire set of XSD specifications are supported
(for example the "xs:attribute" element is not yet supported).
XSD support will be improved as we will need more features in our ECM product or at your (and other people) request.
- the  data import based on XML documents is not implemented.
But this is relatively an easy task (max. 2-3 days of development)

What kind of XSD do you want to support? Are they standard XSD or custom ones? If they are standard, could you tell which one they are?


To define new types of document based on your own XSD schemas you need to create a component contributing 2 extensions:
- the new XSD schema files
- the new document types based on your previously declared schemas

For an example of how you can do that look at the NXCore.jar module.
This module is contributing all default schemas and document types for Nuxeo5.
Look at the file:
OSGI-INF/CoreExtensions.xml

Inside this file you have these schemas declarations:
 <extension target="org.nuxeo.ecm.core.schema.TypeService" point="schema">
   <schema name="common" src="schema/common.xsd" />
   <schema name="core-types" src="schema/core-types.xsd" />
   <schema name="dublincore" src="schema/dublincore.xsd" />
   <schema name="uid" src="schema/uid.xsd" />
   <schema name="file" src="schema/file.xsd" />
   <schema name="note" src="schema/note.xsd" />
 </extension>

The name is internal to NXCore and is used as an identifier for the schema (i.e. it must be unique) src is the location of you XSD file that defines this schema inside your bundle (e.g. .jar module) Now that you have registered your schemas you can define a new type of document based on this (these) schema(s):
Look in the same file and you will find for example:

<extension target="org.nuxeo.ecm.core.schema.TypeService" point="doctype">
   <doctype name="File" extends="Document">
     <schema name="common" />
     <schema name="file" />
     <schema name="dublincore" prefix="dc" />
     <schema name="uid" />
     <facet name="Downloadable" />
     <facet name="Versionable" />
</doctype> ...
</extension>

This is defining a new document type "File" that is implementing the schemas:
common, file, dublincore and uid
You can see document types as Java classes and schemas as java interfaces. A document type may implement several schemas and/or extend other document types
Note: facet elements are optional - you may ignore them

Your document type will be mapped to a JCR node type and each schema to a mixin node type that will be set as a super type for your document node type.

When first starting your JBoss the Jackrabbit repository will be pupolated with your new node types and so you can begin use your schemas. Be aware that you need to have a non initialized Jackrabbit repository (remove ${jboss}/server/deploy/data/NXRuntime) if it exists before importing your schemas. You can also update an existing repository (that contains data) by forcing node types remapping but this can be dangerous (The current Jackrabbit version is not handling correctly node type updates (reregistering) - and when forcing a remapping you may get a broken repository)

There is a hack to reload your types in an existing repository. To force the type reloading you need to modify the demo-repository-ds.xml (or your repository definition file) and add the: forceReloadTypes="true" attribute

<extension target="org.nuxeo.ecm.core.repository.RepositoryService" point="repository"> <repository name="demo" factory="org.nuxeo.ecm.core.jcr.JCRRepositoryFactory" securityManager="org.nuxeo.ecm.core.jcr.JCRSecurityManager"
forceReloadTypes="true">


Please feel free to ask on the list more details about this.

So, all we need to implemented is to be able to import a document in the form of a XML data document and improve the XSD support) We will let you know when this feature will be available (I think it's a matter of days)

If you want to join on this effort, you are very welcome. :-)


Regards,
Bogdan

My apologies for the million questions :-) But any insight will be much
appreciated.
Kind regards, Corné Kloppers
Juta Law, South Africa
Tel  +2721 763 3575
Mobile +2784 913 0391
http://www.jutalaw.co.za/
------------------------------------------------------------------------

_______________________________________________
ECM mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm

_______________________________________________
ECM mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm

Reply via email to