jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcel Reutegger <marcel.reuteg...@gmx.net>
Subject Re: XPath queries for versions
Date Thu, 19 Oct 2006 14:49:17 GMT

Alexandru Popescu wrote:
> Considering a node:
> /foo/bar/mynode with a property @my:property
> I would like
> 1/ to find the version of this node whose my:property was 'data':

//element(*, nt:frozenNode)[@my:property = 'data'
	and jcr:frozenUuid = '<the uuid of /foo/bar/mynode>']

please note that you need the uuid of the node in question, because the current 
path of a node in a workspace does not identify the node in the version storage. 
A version of a node can be checked out to any place in a workspace.

> 2/ to find a labeled version of mynode (label that I know)

//element(*, nt:versionLabels)/jcr:deref(@labelIKnow, '*')/*[jcr:frozenUuid = 
'<the uuid of /foo/bar/mynode>']

The query dereferences all nt:versionLabel nodes with a @labelIKnow reference 
property in the version storage. The target of the references are nt:version 
nodes and their children are the nt:frozenNodes with the versioned properties.


View raw message