jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Luca Tagliani <l.tagli...@prismaeng.it>
Subject Re: Node search based on children properties
Date Fri, 11 May 2007 13:10:31 GMT

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?

BR
Luca Tagliani


Marcel Reutegger wrote:
> 
> Luca Tagliani wrote:
>> I have a logical hierarchy made by "Documents" and "Folders";
>> "Folders" can contain some other "Folders" and "Documents";
>> the same "Document" can logically be positioned under several "Folders".
>> 
>> I thought to model the nodes in a hierarchy of path
>> 
>> E.g.:
>> /Folder1
>> /Folder1/Folder2
>> /Folder1/Document1
>> /Folder1/Folder2/Document1
>> 
>> I have two questions:
>> 1. Is this the correct model for the entities involved?
> 
> yes that makes sense. the jsr 170 spec contains predefined node types that
> work 
> exactly that way (nt:folder / nt:file (+nt:resource)
> 
>> 2. Is it possible to have the same node under two different nodes (using
>> the
>> path)?
> 
> no, a node only has a single location. but you may use nt:likedFile to
> create 
> references to an existing nt:resource node.
> 
>> 3. How can I find a "Folder" basing the search on one of its contained
>> "Document" property?
> 
> //element(*, nt:folder)[*/jcr:content/@jcr:mimeType = 'text/xml']
> 
> finds all folders that contain XML documents, assuming you are using
> nt:file and 
> nt:resource nodes to represent your documents.
> 
> regards
>   marcel
> 
> 

-- 
View this message in context: http://www.nabble.com/Node-search-based-on-children-properties-tf3726025.html#a10431667
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Mime
View raw message