jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nicolas Betheuil" <Nicolas.Bethe...@europe.adp.com>
Subject RE: 'reverse path prefix' xpath query
Date Tue, 23 Nov 2010 13:47:11 GMT
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

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 ?

-----Message d'origine-----
De : Torgeir Veimo [mailto:torgeir@netenviron.com] 
Envoyé : jeudi 18 novembre 2010 03:17
À : users@jackrabbit.apache.org
Objet : Re: 'reverse path prefix' xpath query

On 18 November 2010 00:21, Clemens Wyss <clemensdev@mysign.ch> wrote:
> I re-read your initial post ;-)
> How about:
> //element(*)[@prefix='<path prefix extracted from the nodes path>']

The trick is to get that path prefix extracted

What I was thinking was that if the subscription contained a reference
to a node instead of it's path, then if it was possible to implicitly
dereference this reference in the query, and check if it refers to a
parent node of the given node / path from the event listeners onevent
call.

> If your subscription nodes have a specific nodetype, e.g. 'myblog:subscription':
> //element(*, myblog:subscription)[@prefix='<path prefix extracted from the nodes path>']



-- 
-Tor

Mime
View raw message