jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Klimetschek <aklim...@day.com>
Subject Re: Versioning
Date Tue, 15 Dec 2009 11:21:59 GMT
On Mon, Dec 14, 2009 at 14:53, Ben Short <ben@benshort.co.uk> wrote:
>                        Version version = it.nextVersion();
>
>                        NodeIterator nodeIterator = version.getNodes();
>
>                        while(nodeIterator.hasNext()){
>
>                                Node node = nodeIterator.nextNode();
>
>                                System.out.println(node.getProperty("name").getString()
+ " " +
> node.getProperty("published").getString());
>                        }
>
> Why do I need to skip passed the first version?

The original node is stored as "jcr:frozenNode" child node below the
version node. This allows the version node to contain its own
metadata, like version tags etc.

See the JCR specs (1.0 [1] and 2.0 [2]). In JCR 2.0, a helper method
Version.getFrozenNode() was added for that [3].

[1] http://www.day.com/specs/jcr/1.0/8.2.2.5_nt_version.html
[2] http://www.day.com/specs/jcr/2.0/3_Repository_Model.html#ntversion
[3] http://www.day.com/maven/jsr170/javadocs/jcr-2.0/javax/jcr/version/Version.html#getFrozenNode()

Regards,
Alex

-- 
Alexander Klimetschek
alexander.klimetschek@day.com

Mime
View raw message