jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Hang <jh...@bea.com>
Subject Re: Version history - paths and node types
Date Wed, 01 Nov 2006 23:25:56 GMT

Makes sense.  Thanks!



Jukka Zitting-3 wrote:
> 
> Hi,
> 
> 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
>     frozen.getProperty("jcr:frozenPrimaryType");
>     frozen.getProperty("jcr:frozenMixinTypes");
>     frozen.getProperty("jcr:frozenUUID");
>     // You can also access the normal properties
>     frozen.getProperty("someProperty");
> 
> The path of a versioned node is not a part of the frozen state.
> 
> BR,
> 
> Jukka Zitting
> 
> 

-- 
View this message in context: http://www.nabble.com/Version-history---paths-and-node-types-tf2556306.html#a7124913
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Mime
View raw message