jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lukas Eder <lukas.e...@gmail.com>
Subject An org.w3c.dom implementation wrapping a JCR repository to leverage XPath, XSLT, JAXB, and many other higher-level DOM-based APIs
Date Wed, 10 Apr 2013 08:25:23 GMT
Hello,

JCR shares many features with XML. It also supports exporting /
importing JCR data in XML format, following rules defined in the JCR
specs. However, it does so at a very low level without leveraging
popular standard APIs, such as org.w3c.dom. I have implemented a quick
draft version of a DOM implementation wrapping JCR entities into their
corresponding DOM types:

- javax.jcr.Node -> org.w3c.dom.Element
- javax.jcr.NodeIterator -> org.w3c.dom.NodeList
- javax.jcr.Property -> org.w3c.dom.Attr
- javax.jcr.PropertyIterator -> org.w3c.dom.NamedNodeMap
- javax.jcr.Item -> org.w3c.dom.Node
- javax.jcr.Session -> org.w3c.dom.Document

With this model, it is very easy to perform sophisticated XPath
queries, XSL transformations, JAXB bindings, and use higher-level
DOM-based XML APIs, such as jOOX and many others. An important
advantage of such a feature addition would be the possibility of
natively supporting XSLT as an alternative rendering mechanism in
Apache Sling, instead of JSP -> HTML or JSON dumping.

Unlike going through Session.exportXXXView(), having a "lazy" DOM API
wrapping the actual repository seems much more natural and will lead
to much better results, performance-wise.

I have pushed the current status of my draft implementation, along
with some examples and unit tests here:
https://github.com/lukaseder/jcr-stuff

Please let me know what you think, and if this idea should make it
into Jackrabbit (I think it should!)

Cheers
Lukas

Mime
View raw message