You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Vidar Ramdal <vi...@idium.no> on 2009/04/30 14:42:12 UTC

Tips for a simple kind of versioning

Hi, I have a bit of trouble understanding how I can implement a certain
versioning scheme.
We're developing a web CMS (on top of Sling). The requirement for versioning
is actually quite simple: All changes made by an author should be saved to a
'draft', which is not visible publicly. The author should then be able to
either publish the draft (making it public), or discard it.

There's also the concept of a 'page', which must be an atomic unit when it
comes to versioning. A page will consist of several child nodes containing
the contents of the page. A page may also have child pages. An author should
be able to create a draft of a page (and work on it), without creating
drafts of child pages.

Take this node structure as an example:
- Parent page
- - content[1]
- - content[2]
- - - forumpost[1]
- - Child page
- - - content[1]
- - - content[2]

When the author is about to make a change to the parent page, a copy (the
draft) of the parent page and its content nodes should be created, but the
Child page is not copied.

To complicate things a bit, the public may also create content, like
discussion forum posts. A forum will be a 'content' node under a page, and
forum posts will be nodes under the forum. Forum posts should not be
'drafted', but immediately appear below the public page where the forum
lives. They should also be visible to an author viewing a draft of a page.

When the author decides to publish a draft, the draft should replace the
original page, but leave the child pages untouched. Forum posts must, of
course, also not be replaced, so that any forum posts created while the
author was working on the page, is kept.

Are these requirements possible to implement with versioning in Jackrabbit -
if so, how? I have read the JSR-283 section on on-parent-version, but I'm
not sure how to use it correctly. Or maybe the versioning feature is not
really what I need here?

We also do not want to store a full version history, for space reasons. It
is sufficient to store the two states of 'published' and 'draft'.

-- 
Vidar S. Ramdal <vi...@idium.no> - http://www.idium.no
Akersgata 16, N-0158 Oslo, Norway
+47 21 531941, ext 2070