When I set a node to versionable, it does not seem that its children will be automatically versionable too.
I don't know if this is required by the specification, but it seems that this behiavior is present in some JCR implementation.
Is there a way to tell modeshape to automatically set children versionable when the parent node is versionable?
That may apply to the root node?
Versioning in JCR is complicated, perhaps more than it needs to be.
Yes, a node must be "mix:versionable" before it can be checked in. But the rules that govern what the version snapshot will include are governed entirely by the "on-parent versioning" (OPV) attribute of the property definitions and child node definitions defined by the primary type and/or mixin types of the versionable node. The default OPV is "COPY", which means the corresponding properties and child nodes will be included in the version snapshot of the parent node, assuming the parent node is "mix:versionable". All the behavior of what happens when checking in a versionable node is spelled out in Section 15.2 of the JSR-283 specification, but the rules that are followed (with respect to the OPV) is specified in Section 3.13.9. Note that ModeShape implements "full versioning" (not "simple versioning").
Basically, when a versionable node A is checked in, all of the child nodes C will be handled based upon the C's child node definition 'Ac' (that is, the applicable child node definition from the primary type or mixin types) as follows:
Note that an OPV of COPY can be expensive if the subgraph of that child node contains a lot of descendants.
|Retrieving data ...|