You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by "Seidel. Robert" <Ro...@aeb.de> on 2011/02/17 11:36:12 UTC

Question about child nodes of a versioned node

Hi,

I've a node structure like this:

A (top node)
  B (nt:file)
    C (nt:resource)

The top node A is versionable (has the mixin type), the others have no mixin type.

I've checked out and in the node A to create some versions and the version history for A shows correctly 3 versions.

If I inspect a frozenNode of a version, than all properties are correct set.

But if I look below the frozenNode, then I find nodes for B, but not for C and the B nodes lack of all properties, they have only two properties:

Jcr:childVersionHistory | <some UUID>
Jcr:primaryType | nt:versionedChild

How can I get the the frozenNodes with all original set properties for B and C?

Regards, Robert


AW: AW: Question about child nodes of a versioned node

Posted by "Seidel. Robert" <Ro...@aeb.de>.
Hi Alex,

this helped a lot.

The child nodes were not checked in seperately and so only the root version existed. After seeing this and thinking about it, it was clear that we have to use OVP COPY.

Thanks for the help.

Regards, Robert

-----Ursprüngliche Nachricht-----
Von: Alexander Klimetschek [mailto:aklimets@adobe.com] 
Gesendet: Donnerstag, 17. Februar 2011 13:51
An: users@jackrabbit.apache.org
Betreff: Re: AW: Question about child nodes of a versioned node

On 17.02.11 13:16, "Seidel. Robert" <Ro...@aeb.de> wrote:
>the OPV for B is VERSION.
>...
>My question now is how can I access this child node from the parent
>frozen node?
>
>I fear I have to do something like
>
>((VersionHistory)Session.getNodeById(jcr:childVersionHistory-Property)).ge
>tRootVersion().getFrozenNode()
>
>Is there an easier way to do so?

I don't know if there is an API method for that. But there is nothing
wrong with that "call", because with OPV=VERSION, afaiu, parent and child
node have separate version histories, that are only linked to each other,
so you have to follow the pointers (an API method would probably do the
same thing).

If you want the full tree directly under the jcr:frozenNode, you need to
work with OPV=COPY all the way through.

Regards,
Alex

-- 
Alexander Klimetschek
Developer // Adobe (Day) // Berlin - Basel





Re: AW: Question about child nodes of a versioned node

Posted by Alexander Klimetschek <ak...@adobe.com>.
On 17.02.11 13:16, "Seidel. Robert" <Ro...@aeb.de> wrote:
>the OPV for B is VERSION.
>...
>My question now is how can I access this child node from the parent
>frozen node?
>
>I fear I have to do something like
>
>((VersionHistory)Session.getNodeById(jcr:childVersionHistory-Property)).ge
>tRootVersion().getFrozenNode()
>
>Is there an easier way to do so?

I don't know if there is an API method for that. But there is nothing
wrong with that "call", because with OPV=VERSION, afaiu, parent and child
node have separate version histories, that are only linked to each other,
so you have to follow the pointers (an API method would probably do the
same thing).

If you want the full tree directly under the jcr:frozenNode, you need to
work with OPV=COPY all the way through.

Regards,
Alex

-- 
Alexander Klimetschek
Developer // Adobe (Day) // Berlin - Basel





AW: Question about child nodes of a versioned node

Posted by "Seidel. Robert" <Ro...@aeb.de>.
Hi,

the OPV for B is VERSION.

I've found this in the specification (C is a child node of a versioned node):

Under full versioning, if C is mix:versionable, then a special
nt:versionedChild node with a reference to the version history of C is
substituted in place of C as a child of the frozen node. The nt:versionedChild node has the same name as C and, in a repository that supports orderable child nodes, the relative ordering of any such child
node C is preserved. The definition of nt:versionedChild is:
[nt:versionedChild]
- jcr:childVersionHistory (REFERENCE) mandatory
autocreated protected ABORT
< 'nt:versionHistory'
The property jcr:childVersionedHistory points to the nt:versionHistory of C.

My question now is how can I access this child node from the parent frozen node?

I fear I have to do something like

((VersionHistory)Session.getNodeById(jcr:childVersionHistory-Property)).getRootVersion().getFrozenNode()

Is there an easier way to do so?

Regards, Robert

-----Ursprüngliche Nachricht-----
Von: Alexander Klimetschek [mailto:aklimets@adobe.com] 
Gesendet: Donnerstag, 17. Februar 2011 11:46
An: users@jackrabbit.apache.org
Betreff: Re: Question about child nodes of a versioned node

On 17.02.11 11:36, "Seidel. Robert" <Ro...@aeb.de> wrote:
>I've a node structure like this:
>
>A (top node)
>  B (nt:file)
>    C (nt:resource)
>
>The top node A is versionable (has the mixin type), the others have no
>mixin type.
>
>I've checked out and in the node A to create some versions and the
>version history for A shows correctly 3 versions.
>
>If I inspect a frozenNode of a version, than all properties are correct
>set.
>
>But if I look below the frozenNode, then I find nodes for B, but not for
>C and the B nodes lack of all properties, they have only two properties:
>
>Jcr:childVersionHistory | <some UUID>
>Jcr:primaryType | nt:versionedChild
>
>How can I get the the frozenNodes with all original set properties for B
>and C?

How "far" the subtree is included in the version depends on the
on-parent-version (OPV) setting of the involved node types.

http://www.day.com/specs/jcr/2.0/3_Repository_Model.html#3.13.9%20Versionab
le%20State
http://jtoee.com/jsr-170/the_jcr_primer/5/
http://jackrabbit.apache.org/node-type-notation.html

Regards,
Alex

-- 
Alexander Klimetschek
Developer // Adobe (Day) // Berlin - Basel





Re: Question about child nodes of a versioned node

Posted by Alexander Klimetschek <ak...@adobe.com>.
On 17.02.11 11:36, "Seidel. Robert" <Ro...@aeb.de> wrote:
>I've a node structure like this:
>
>A (top node)
>  B (nt:file)
>    C (nt:resource)
>
>The top node A is versionable (has the mixin type), the others have no
>mixin type.
>
>I've checked out and in the node A to create some versions and the
>version history for A shows correctly 3 versions.
>
>If I inspect a frozenNode of a version, than all properties are correct
>set.
>
>But if I look below the frozenNode, then I find nodes for B, but not for
>C and the B nodes lack of all properties, they have only two properties:
>
>Jcr:childVersionHistory | <some UUID>
>Jcr:primaryType | nt:versionedChild
>
>How can I get the the frozenNodes with all original set properties for B
>and C?

How "far" the subtree is included in the version depends on the
on-parent-version (OPV) setting of the involved node types.

http://www.day.com/specs/jcr/2.0/3_Repository_Model.html#3.13.9%20Versionab
le%20State
http://jtoee.com/jsr-170/the_jcr_primer/5/
http://jackrabbit.apache.org/node-type-notation.html

Regards,
Alex

-- 
Alexander Klimetschek
Developer // Adobe (Day) // Berlin - Basel