Question

I am reading about content repositories and I am currently reading the JCR specification and the documentation found on Apache JackRabbit. However, I still don't understand what exactly I am going to store in the Node's and Properties.

I know that the actual data goes in the properties. But I don't understand their "semantic", how are they intended to be used. Could someone explain Node and Property?

What role does it have?

Was it helpful?

Solution

A good way to think about a JCR content model is like a "fractal filesystem on steroids".

You can start by organizing your content in a macro tree, and see your various content items as micro trees with their own structures, independent of the general content tree structure.

In my team's projects we use a macro tree structure that's similar to that of a unix system, with folders like /content, /var, /etc, /tmp etc. which provide a familiar and clear structure.

Then, a Node might be a web page, with subfolders like images, comments, content and properties like title, description, tags. Storing the actual content as an ordered set of Nodes in a content folder under the page node usually makes sense, where each of these content sub-nodes plays a specific role in the content, like article header, article body, main image etc.

The actual text content will then be stored in String properties of those content sub-nodes, and the general metadata might be Properties of a metadata sub-node.

Considering the JCR tree as a (somewhat) fractal structure helps in my opinion, you need to switch between macro and micro views of the content tree (including nested micro views) to verify that each of these structures is clear and works for your use cases. In this model the Nodes are mostly used to organize the content, and the Properties store the actual content.

http://wiki.apache.org/jackrabbit/DavidsModel also provides good recommendations about JCR content model design.

OTHER TIPS

Nodes provide a simple way to regroup properties and other nodes. Think of them as folders in your filesystem while properties are more like the files (data). Think of JCR as your filesystem, it should help you feel the way you want to use it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top