Querying and listening

4 messages Options
Embed this post
Permalink
François Cassistat

Querying and listening

Reply Threaded More More options
Print post
Permalink
Hi !

My application plan to use JackRabbit 2.0 (oh yeah!) and needs to do  
this :

- The user enter a search term (complex or not)
- We show a filtered list of nodes
- Then we listen to changes in repository (JCR rocks !)
- We apply changes to the above list of nodes by applying the same  
filter, so a node should be removed or be added to the list after each  
event.

Is it possible to easily reexecute a Query only on the node that  
changed?

 From what I see in the JCR2.0 API, the only option is to recreate a  
new request each time. Maybe JQOM could help me by keeping a part of  
the query tree so it could create query faster? Any suggestion?


Frank

François Cassistat

Re: Querying and listening

Reply Threaded More More options
Print post
Permalink
Forget this, I forget about the source parameter on  
QueryObjectModelFactory.createQuery function, I think it should work.

JQOM looks great, but it's complicated... Too bad there is not much  
example out there. Maybe when I mastered this form, I'll do a JQOM  
example page on the wiki.


Thanks !


Frank


Le 2009-11-05 à 6:29 PM, François Cassistat a écrit :

> Hi !
>
> My application plan to use JackRabbit 2.0 (oh yeah!) and needs to do  
> this :
>
> - The user enter a search term (complex or not)
> - We show a filtered list of nodes
> - Then we listen to changes in repository (JCR rocks !)
> - We apply changes to the above list of nodes by applying the same  
> filter, so a node should be removed or be added to the list after  
> each event.
>
> Is it possible to easily reexecute a Query only on the node that  
> changed?
>
> From what I see in the JCR2.0 API, the only option is to recreate a  
> new request each time. Maybe JQOM could help me by keeping a part of  
> the query tree so it could create query faster? Any suggestion?
>
>
> Frank
>

Marcel Reutegger

Re: Querying and listening

Reply Threaded More More options
Print post
Permalink
In reply to this post by François Cassistat
Hi,

2009/11/6 François Cassistat <[hidden email]>:

> Hi !
>
> My application plan to use JackRabbit 2.0 (oh yeah!) and needs to do this :
>
> - The user enter a search term (complex or not)
> - We show a filtered list of nodes
> - Then we listen to changes in repository (JCR rocks !)
> - We apply changes to the above list of nodes by applying the same filter,
> so a node should be removed or be added to the list after each event.
>
> Is it possible to easily reexecute a Query only on the node that changed?

you could add a predicate to the original query that is only true for
the changed node. if your node is referenceable you can use the
jcr:uuid property. hmm... actually, that might even work for any node
because in jackrabbit 2.0 every node exposes the UUID through
getIdentifier().

regards
 marcel

> From what I see in the JCR2.0 API, the only option is to recreate a new
> request each time. Maybe JQOM could help me by keeping a part of the query
> tree so it could create query faster? Any suggestion?
>
>
> Frank
>
>
François Cassistat

Re: Querying and listening

Reply Threaded More More options
Print post
Permalink
Good advice, it's true that Jackrabbit is fast for searching by identifier. Thank you Marcel.


Frank


Le 2009-11-11 à 4:09 AM, Marcel Reutegger a écrit :

> Hi,
>
> 2009/11/6 François Cassistat <[hidden email]>:
>> Hi !
>>
>> My application plan to use JackRabbit 2.0 (oh yeah!) and needs to do this :
>>
>> - The user enter a search term (complex or not)
>> - We show a filtered list of nodes
>> - Then we listen to changes in repository (JCR rocks !)
>> - We apply changes to the above list of nodes by applying the same filter,
>> so a node should be removed or be added to the list after each event.
>>
>> Is it possible to easily reexecute a Query only on the node that changed?
>
> you could add a predicate to the original query that is only true for
> the changed node. if your node is referenceable you can use the
> jcr:uuid property. hmm... actually, that might even work for any node
> because in jackrabbit 2.0 every node exposes the UUID through
> getIdentifier().
>
> regards
> marcel
>
>> From what I see in the JCR2.0 API, the only option is to recreate a new
>> request each time. Maybe JQOM could help me by keeping a part of the query
>> tree so it could create query faster? Any suggestion?
>>
>>
>> Frank
>>
>>