1
votes

Given a JCR (Java content repository, implementing standards jsr-170 and/or jsr-283, like Apache Jackrabbit, JBoss Modeshape), I would like to build a cms-like editor that given a specified JCR-node can edit all datatypes defined as part of that node.

e.g: a JCR-node, might have the datatypes: date, venue, name, description defined. Venue might be a child-node with datatypes: latitude/longitude, name, capacity.

This code would generate the editor based on the declaration of the JCR-node alone, no other input would be needed.

This code would follow the builder-pattern (http://en.wikipedia.org/wiki/Builder_pattern) Of course, I could write this code myself but I'm looking for existing open-source implementations. I feel there must be CMS's built on top of JCR that use this approach: Magnolia, Sling, Hippo, others? Or some not well-known projects which sole purpose is to provide a core (the model part parhaps) of this builder-implementation.

Any pointers to these libraries of the relevant code within these open-source CMS's would be more than welcome.

Any help appreciated. Thanks, Geert-Jan

3

3 Answers

3
votes

The Apache Sling explorer might be a good start for this - it doesn't support editing custom node types currently, but could be fairly easily extended to do that. See [1] for source code.

Sling already supports the notion of a "resource type" for each node, which can be derived from either the node type, from a sling:resourceType property on the node or from anything using custom (OSGi) plugins. This could be used to generate the appropriate client-side code for editing.

The VIE editor [2] is also interesting in this context: the Sling explorer could annotate the content with RDFa metadata that VIE can use to generate custom editing UIs.

[1] http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/explorer

[2] http://bergie.github.com/VIE/

0
votes

Magnolia has a JCR browser built into its admin console. It's not canny enough to adjust the UI to the datatypes that are specified for the node, but it's still useful as a generic editor for a JCR store.

Of course, one can also use dialog-building tools that come in Magnolia to create something with a nicer form-based UI, but it's not really designed to pay direct attention to the node type definition to create that UI. (That would be pretty cool, though!)

0
votes

Magnolia 5 or one of its successors should however have such an ui, auto-generated based on node types.