jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sergiy Shyrkov <my.public.mail...@gmail.com>
Subject Re: 'reverse path prefix' xpath query
Date Tue, 23 Nov 2010 14:49:26 GMT
Hello,

On 23.11.2010 14:52, Torgeir Veimo wrote:
> On 23 November 2010 23:47, Nicolas Betheuil
> <Nicolas.Betheuil@europe.adp.com>  wrote:
>> Hi,
>>
>> If I understand well the question, you have some posts under
>> /blog/wildlife/
>>
>> For all nodes added or modified under this node you have an event that is published
>> You have on other hand an EventListener.
>>
>> So you receive an Event from this eventListener on which you can call event.getPath()
>> This call will give you /blog/wildlife/2010/11/17/wolfs
>>
>> On other hand you have a list of subscribers for example like that
>> /subscribers/tom/@prefix=/blog/wildlife
>>         +---/tim/@prefix=/blog/otherOne
>>         +---/titi/@prefix=/blog/wildlife/2010
> Yes that's all correct.
>
>> By the event path, you can have all of those paths by the JCR API or by an regexp
>> /blog/wildlife/2010/11/17/
>> /blog/wildlife/2010/11/
>> /blog/wildlife/2010/
>> /blog/wildlife/
>> /blog/
>>
>> So with an xpath like this it's ok ?
>> //*[@target='/blog/wildlife/2010/11/17/' or ... @target='/blog/wildlife/']
>>
>> Sorry if i don't well understand the problem ...
>> Is it this ?
> Yes. What I wanted to avoid was to traverse the parent relations to
> the event node. I don't want to query for subscribers to the path
> /blog/wildlife/2010/11/17/, then to the path /blog/wildlife/2010/11/,
> then the path /blog/wildlife/2010/ etc, I just wanted a single xpath
> or sql style query.
>
> But it seems this is just not possible to avoid.
>
>
It will be a single xpath or sql style query. It will just use all event 
path possibilities with OR condition (/blog/, /blog/wildlife/, and so on 
up to your event path).
We implemented this kind of handling for our event subscription service: 
subscribers are notified of content updates for nodes, they are 
subscribed to, including subnodes (the whole content tree underneath the 
node in question).
If someone will find a more efficient way, please, share it. Thank you!

Kind regards
Sergiy

Mime
View raw message