Luca Tagliani wrote:
Thanks Marcel!
I have another question regarding search:
I follow your suggestion and model the document with nt:file (and
nt:linkedFile) nodes.
Using the same example as before, if we tought to /Folder1/Document1 as
nt:file and /Folder2/Document1 as nt:linkedFile, the query you wrote returns
only the first folder.
How can I have returned both folders?
you need to search for nt:resource nodes and then expand the query result
manually. jackrabbit currently does not support using the jcr:deref() function
in the predicate of an XPath statement.
NodeIterator nodes = result.getNodes();
while (nodes.hasNext()) {
for (PropertyIterator it = nodes.nextNode().getReferences(); it.hasNext(); ) {
Node linkedFile = it.nextProperty().getParent();
linkedFile.getPath();
// ...
}
}
regards
marcel