jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Klimetschek <aklim...@day.com>
Subject Re: Getting node/node's property for particular version
Date Thu, 26 Nov 2009 13:57:45 GMT
On Thu, Nov 26, 2009 at 13:50, neuropunk <akula.register@gmail.com> wrote:
>> I have versionable node which type is nt:file. Every node's version
>> contains content and properties.
>> Please, help me create XPath query to:
>> 1) particular version of this node;
>> 2) content (file's content) of node with particular version;
>> 3) property of node with particular version.
>
> Addition to previous email:
> Or maybe somebody knows a way to get:
> 1) content (file's content) of node with particular version;
> 2) property of node with particular version.

You can search below "/jcr:root/jcr:system/jcr:versionStorage", see
section 8.2.2.2 of the JCR 1.0 spec [1]. For example, to do a fulltext
search for "foobar", you would do:

/jcr:root/jcr:system/jcr:versionStorage//jcr:frozenNode[jcr:contains(.,
"foobar")]

Note that for the above to work the repository.xml must have a
"global" SearchIndex configured (see bottom of default repository.xml
where it is enabled by default).

However, if you already have the node in question from the API, it is
recommended to use the versioning API rather than XPath.

[1] http://www.day.com/specs/jcr/1.0/8.2.2.2_Searching_and_Traversing_Version_Storage.html

Regards,
Alex

-- 
Alexander Klimetschek
alexander.klimetschek@day.com

Mime
View raw message