JCR Deep Dive
Shareable Nodes
In JSR170, a node can only be the child node of one other node. This makes it impossible to file nodes under multiple taxonomies, i.e. defining multiple paths to get to the same node. JSR283 hence introduces the (optional) concept of shareable nodes. A shareable node is a node which can share its properties and children with other nodes. A node type is made shareable by adding the mixin mix:shareable.

Shareable Nodes in JSR283
It is important to note that by adding shareable nodes, the path of a node does not identify a unique node anymore. Rather, there may be different paths to reach a node, such as A/S1/Y and B/S2/Y both identify node Y in the above example. It is up to the particular implementation to define a deemed path, i.e. the default return value of Node.getPath().
Comments
9 Responses to “JCR Deep Dive”
Leave a Reply
First, thank you for providing this very informative site. And Secondly, just in case it has not been brought to your attention: the URI links to the http://www.jcp.org/ site are out of date (used in section 3. Defining Content).
Regards
Duncan Reade
Thanks for that great post.
It seems node type folder is missing?
Really good post.. thanks for the effort
Hi, great article.
But as Thomas said previously, it seems you forgot to put the node type “samples:folder” definition. It seems it’s a copy/paste of the “samples:content” definition instead.
Really great article.
With regards to the missing definition for samples:folder, I believe the below works.
[samples:folder] > samples:content
// accept any subnodes of type samples:content
+ * (samples:content) multiple
I adapted this from the example in the CND in a nutshell section of this blog.
Thanks! I need to spend some time updating my blog at some point :-)
Great content. Are there some good interative builder for CND Types ? Would be interesting links
Building an interactive builder shouldn’t be that hard. Back when I worked for CoreMedia we had a tool that would take the XMI from any old UML tool and XSLT’ed it to a content definition file. Wasn’t CND but XML, but same idea.
Java Content Repository Deep Dive…
I found an interesting “article” online about Java Content Repositories (JCR). I’m going to look into this further because it may be useful as a replacement to our current JPA workflow. JCR supports many features that should be useful,……