jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jukka Zitting" <jukka.zitt...@gmail.com>
Subject Re: Version history - paths and node types
Date Wed, 01 Nov 2006 22:22:09 GMT

On 11/2/06, James Hang <jhang@bea.com> wrote:
> I noticed that when traversing a node's version history by calling
> Node.getVersionHistory(), the versions returned contains paths and node
> types of the node in the version workspace, not in the workspace of the node
> that was versioned.  So calling Version.getPath() returns something like
> "/jcr:system/jcr:versionStorage/b1/5352456..." and calling
> Version.getPrimaryNodeType() returns "nt:version".
> I assume this is because the path and type of a node is not part of its
> state?  Is there a way to get this information in the version history
> besides having to store the path and type as properties of the node?

The Version object represents the nt:version node within the version
storage. The node contains a jcr:frozenNode child that represents the
actual frozen state of the node when the version was created. You can
get the frozen type and UUID information as follows:

    Node frozen = version.getNode("jcr:frozenNode");
    // Access the type and UUID information
    // You can also access the normal properties

The path of a versioned node is not a part of the frozen state.


Jukka Zitting

View raw message