Hello community,
I have to search documents, but only current versions of them. The first
idea was to search under /jcr:system/jcr:versionStorage, but how can I find
"base versions" only? I've decided to search by means of jcr:deref function
to dereference jcr:baseVersion property of versionable node. I've added a
couple of documents and buit a query:
//element(*, cssns:file)/jcr:deref(@jcr:baseVersion,
'*')/jcr:frozenNode[jcr:like(@cssns:title, '%Picture%')]/(@cssns:title |
@jcr:created | @jcr:mimeType | @jcr:lastModified) order by @cssns:title
ascending
Unfortunately nothing is found (0 hits). If I use JCR API like these
Node file = ....
file.checkin();
javax.jcr.Property prop = file.getProperty("jcr:baseVersion");
Node baseVersion = prop.getNode();
Node frozenNode = baseVersion.getNode("jcr:frozenNode");
String title = frozenNode.getProperty("cssns:title").getValue().getString();
then everything is okey. I can read current versions of added files and get
e.g. titles.
The question is now what is wrong in the query above?
Thanks in advance.
--
View this message in context:
http://n4.nabble.com/Search-in-current-versions-with-jcr-deref-tp1751486p1751486.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.