jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Torgeir Veimo <torg...@netenviron.com>
Subject Re: 'reverse path prefix' xpath query
Date Tue, 23 Nov 2010 12:49:27 GMT
On 18 November 2010 12:16, Torgeir Veimo <torgeir@netenviron.com> wrote:
> 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

It looks like this is not possible to do using a query, so an
iteration over parent nodes seems necessary.

Given a node, traverse up its parent nodes, and find subscriber nodes:

1) if subscribers are stored as subnodes of the node, just retrieve a
nodeiterator for the subscriber child nodes, or

2) if subscribers are stored elsewhere, eg as subscriber nodes under a
users 'home' node, with references to the subscribed-to nodes, fetch
all such nodes with node.getReferences() (and check if correct

Anyone got any other ideas worth pursuing for subscriptions?


View raw message