jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexander Klimetschek" <aklim...@day.com>
Subject Re: Not referenced
Date Fri, 18 Jul 2008 08:11:53 GMT
If you have lots of references in your system, maybe you could
consider using "soft" references by storing the reference in a PATH
property with simply the path to the property. Also have a look at the
content modeling tips on the Jackrabbit wiki, which explains why
references in JCR are not recommended:
http://wiki.apache.org/jackrabbit/DavidsModel#head-ed794ec9f4f716b3e53548be6dd91b23e5dd3f3a

You no longer have the getReferences() method available, but initially
you could build a simple search a la

//element(*, my:referencers)[@ref]

Then iterate over the @ref properties using the getRows() iterator and
do a query for each @ref and build a hash map of all documents that
are referenced. Then you install an observation listener for all
"my:referencers" nodes (that have references) and update the hash set
when a new reference is added or removed. This way you have a quick
lookup in your hash map for nodes that are referenced.

Regards,
Alex

On Fri, Jul 18, 2008 at 7:46 AM, Emmanuel Hugonnet <ehsavoie73@gmail.com> wrote:
> Alexander Klimetschek a écrit :
>>
>> On Thu, Jul 17, 2008 at 4:44 PM, Emmanuel Hugonnet <ehsavoie73@gmail.com>
>> wrote:
>>
>>>
>>> I would like to get all the nodes of a list that are NOT referenced.
>>> Is there a way to do this with a XPath Query  because  it looks like
>>> reference is a one way axis for xpath :( .
>>>
>>
>> I think it is not possible with a query. You can iterate over all the
>> nodes you want to inspect, call getReferences() on it and hence find
>> out, which ones are referenced by another node.
>>
>> Regards,
>> Alex
>>
>>
>
> Thanks,
> That's what I was doing but with over 3000 nodes this is quite a bottleneck
> for performance :-(
> Maybe I should add an attribute for better filtering but I am moving from
> the data to the logic :-(
> Regards,
> Emmanuel
>
>



-- 
Alexander Klimetschek
alexander.klimetschek@day.com

Mime
View raw message