node versioning

View: New views
2 Messages — Rating Filter:   Alert me  

node versioning

by Richard Huddleston :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm a little confused when reading the JCR spec in regards to
versioning.  I understand that a node's properties can be versioned,
but what about the heirarchy of a node.  That is, if I moved a node
from parent A to parent B, how would this be reflected in versioning.

-Richard

Re: node versioning

by Tobias Bocanegra :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 7/15/08, Richard Huddleston <rhuddusa@...> wrote:
> I'm a little confused when reading the JCR spec in regards to
>  versioning.  I understand that a node's properties can be versioned,
>  but what about the heirarchy of a node.  That is, if I moved a node
>  from parent A to parent B, how would this be reflected in versioning.

hi richard,
the way how the 'hierarchy' of a node, i.e. it's child nodes are
versioned depends on the on parent version (OPV) attribute of their
definitions (in the node type). for example:

[MyNodeType]
+ foo version
+ bar copy

defines 'foo' with an OPV=version and 'bar' with OPV=copy

when you create a node A with childnodes 'foo' and 'bar' and make it
versionable (by adding mix:versionable), and then checkin A, the
entire tree of 'bar' is always copied into the version storage. if
'foo' itself is versionable, only a reference to it's version
hierarchy is recorded in the version of A. if 'foo' is not
versionable, it behaves like OPV=copy and it's entire subtree is
copied into the version.

on restore, the former OPV=copy child nodes are restored entirely,
where as the OPV=version nodes are left untouched, unless if they does
not exist anymore. then jackrabbit does restore the latest version of
them.

so if you more a node below 'bar' and then restore A, that move will
be reverted.

regards, toby
LightInTheBox - Buy quality products at wholesale price