Hi,

I have a tree of nodes and each node has a set of scoring criteria, e.g. most 
popular, most rated, most recent etc. The criteria are not implemented as 
properties against the nodes, i.e. the node guids are stored on a separate 
database with stats against them. The reason it is like this is an architecture 
decision, since other parts of the system do not need to know about jcr.

Implementing a class that extends the NodeIterator to use these stats (scores) 
is the easy part, however I have no idea how to get jcr to use this 
implementation. Looking at the jcr 1.4 source I can see that the 
QueryResultImpl uses either of two hardcoded types of NodeIterator in the 
private method getNodeIterator(), wherein it creates new instances at that 
point. There seems to be no obvious option for the user to specify the type of 
iterator and although the class is not final, I cannot override 
getNodeIterator() as it is private.

Can someone give me pointers on how to provide a custom node iterator? Also, 
can someone please tell me why there are two ScoreNodeIterator interfaces and 
the difference between the jcr2spi package and the core.query.lucene package? I 
think I should be using the jcr2spi interface somewhere and not trying to fudge 
the existing jcr queryresultimpl into using my implementation however Googling 
and looking at the jcr site and wiki have (not yet) yielded results.

Thanks,

Benjamin

Reply via email to