jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Korat" <michael.ko...@hms.org>
Subject Multiple jcr:deref in query
Date Tue, 21 Aug 2007 13:47:20 GMT
Hi all,

 

I have to do a query to retrieve all Nodes from the 'Site' 

subtree of my repository that contains certain content.The problem 

is that the actual content is stored in other nodes, and I only

hold references to them. Here's a little little overview of the 

structure of my repository:

 

Root

 |

 |+Content

 |  |+DataNodeA

 |  |  |@Content

 |          |+DataNodeB

 |  |  |@Content

 |  |

 |  |+DocumentNodeA

 |     |+LinkToDataNodeA > my:DataLink

 |     |  |@RefToData = DataNodeA

 |     |+LinkToDataNodeB

 |        |@RefToData = DataNodeB

 |

 |+Site

    |+PageA

               |+LinkToDocumentNodeA > my:LinkToDoc

                  |@RefToDoc = DocumentNodeA

 

The node i want to retrieve in this case is PageA. PageA

holds a subnode of the type my:LinkToDoc which contains 

the reference to a DocumentNode. This DocumentNode has 

subnodes which have references to DataNodes, which contain

the actual content.

 

I wrote a query that should return all the nodes that are somehow 

referenced by PageA, and contain the wanted value:

 

/jcr:root/Content//element(*, my:LinkToDoc)/jcr:deref(@RefToDoc, '*')

  //element(*, my:DataLink)/jcr:deref(@RefToData,
'*')[jcr:contains(.,'some value')]

 

Unfortunately, the result of this is always zero. If I execute the 

query without the jcr:contains constraint at the end I get the expected 

set of DataNodes back:

 

/jcr:root/Content//element(*, my:LinkToDoc)/jcr:deref(@RefToDoc, '*')

  //element(*, my:DataLink)/jcr:deref(@RefToData, '*')

 

My question is if there is a limitation to the use of multiple jcr:deref


in a single query, or mixing jcr:deref with constraints or if there

is another convenient (and fast) way to do such a query?

 

Regards,

Michael

 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message