You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by neuropunk <ak...@gmail.com> on 2009/11/26 13:28:48 UTC

Getting node/node's property for particular version

Hi all,

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.

Thanks,
Sasha
-- 
View this message in context: http://n4.nabble.com/Getting-node-node-s-property-for-particular-version-tp788188p788188.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Re: Getting node/node's property for particular version

Posted by neuropunk <ak...@gmail.com>.


Alexander Klimetschek wrote:
> 
> On Thu, Nov 26, 2009 at 13:50, neuropunk <ak...@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
> 
> 

Alexander, thank you for reply. It helped me to solve my problem.
Just want to add: key idea which helped me to solve with problem is
contained in sections 8.2 - 8.2.2 of Content Repository Specification.

Thanks,
Sahsa

-- 
View this message in context: http://n4.nabble.com/Getting-node-node-s-property-for-particular-version-tp788188p788625.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Re: Getting node/node's property for particular version

Posted by Alexander Klimetschek <ak...@day.com>.
On Thu, Nov 26, 2009 at 13:50, neuropunk <ak...@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

Re: Getting node/node's property for particular version

Posted by neuropunk <ak...@gmail.com>.


neuropunk wrote:
> 
> Hi all,
> 
> 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.
> 
> Thanks,
> Sasha
> 

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.

Thanks,
Sasha
-- 
View this message in context: http://n4.nabble.com/Getting-node-node-s-property-for-particular-version-tp788188p788193.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.