jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joshua Portway <j...@stain.org>
Subject Re: following-sibling etc.
Date Wed, 25 Jun 2008 08:48:16 GMT
Thanks Marcel,

I must say I'm a bit baffled why JSR170 doesn't specify this, it would  
seem to rule out a lot of common uses - apart from the "previous and  
next page" case it makes it very difficult to do piecewise iteration  
(ie - returning a sequence of nodes on separate requests) in general.  
I understand that collections of nodes aren't necessarily ordered, but  
that would simply leave the behaviour of the "following" axis open to  
the implementation (presumably it would just order by some kind of  
internal id) - I think that JSR170 already mandates that even  
unordered collections of nodes have to have some kind of consistency  
in their returned order, presumably the implementation would just use  
that. The current situation does seem like a bit of a gaping hole in  
the spec to me, and from what I can tell it doesn't seem to be  
addressed by JSR283 - I find it really hard to believe that I'm the  
only person that needs this kind of thing.

Iterating over all child nodes just to find the next and previous  
pages is obviously going to have scaling issues - As a matter of  
interest can anyone give me an idea of how much work Jackrabbit is  
doing to retrieve and iterate over,say, 200 nodes? Is it something I  
should worry about for performance reasons, or is it all just cached  
in Ram anyway? At what point would it become an issue? 1000 nodes?  

The other option I had considered was having "nextPage" and  
"previousPage" properties on the page nodes in question and a  
repository observer that re-indexed the repository whenever a page was  
added,removed or moved. This is obviously going to be a considerable  
hit whenever anyone writes to the repository, but that doesn't matter  
too much to me. Does that sound reasonable?

thanks again,

On 25 Jun 2008, at 10:11, Marcel Reutegger wrote:

> Hi,
> Joshua Portway wrote:
>> It seems to me I should be able to use the "following-sibling" axis  
>> in an xpath query on the current node to find the next page, but as  
>> far as I can tell Jackrabbit seems to silently ignore "following- 
>> sibling"
> Jackrabbit does not support the following-sibling axis. The JSR 170  
> specification does not list it as a required feature.
>> The only thing I can think to do is to iterate through all children  
>> of the parent node looking for my current node - but this is  
>> presumably extraordinarily inefficient. In my case I'd be  
>> retrieving hundreds of nodes from the repository simply to find a  
>> link address, which seems crazy.
> that really is the only way.
> I'm not sure why the JSR 170 specification does support this kind of  
> use case, but I guess it's because child nodes do not necessarily  
> have to be orderable. In which case a sibling axis cannot be defined.
> As an alternative you could make your nodes referenceable and create  
> a linked list using reference properties. that way you can quickly  
> traverse the sibling axis. a major drawback however is that you have  
> to maintain the links.
> regards
> marcel

View raw message