You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lenya.apache.org by Andreas Hartmann <an...@apache.org> on 2006/07/27 00:49:08 UTC

Observation support (was: [1.4] Towards a 1.4 release: Status)

Andreas Hartmann wrote:

[...]

 > To be Decided
 > =============
 >
 > - introduce UUIDs?
 > - observation support (indexing of documents)?

I added a basic observation mechanism and a test case.
Feel free to add more details to the test case.

The listeners are notified when a transaction is committed.

I'd suggest that we try to use this for indexing documents.
I'll take a look at it as soon as I find the time, but of
course any help is greatly appreciated.

-- Andreas


-- 
Andreas Hartmann
Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
http://www.wyona.com                      http://lenya.apache.org
andreas.hartmann@wyona.com                     andreas@apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: Observation support (was: [1.4] Towards a 1.4 release: Status)

Posted by Andreas Hartmann <an...@apache.org>.
Josias Thöny wrote:
> On Thu, 2006-07-27 at 00:49 +0200, Andreas Hartmann wrote:
>> Andreas Hartmann wrote:
>>
>> [...]
>>
>>  > To be Decided
>>  > =============
>>  >
>>  > - introduce UUIDs?
>>  > - observation support (indexing of documents)?
>>
>> I added a basic observation mechanism and a test case.
> 
> Thanks a lot for this cool feature!
> 
>> Feel free to add more details to the test case.
>>
>> The listeners are notified when a transaction is committed.
>> I'd suggest that we try to use this for indexing documents.
> 
> One question: is it possible to add a listener which is not specific to
> a certain document, but listens to changes in all documents?

That should be possible via
ObservationRegistry.registerListener(RepositoryListener),
but as you already pointed out it doesn't work yet.

I'll add this to the test case. Thanks a lot!


> This might be useful for the lucene module.
> The problem is that the nodeChanged() method in the ObservationManager
> only can translate from a node to a document if a listener was added
> earlier for that specific document.
> 
> Or is it recommended to add a listener for each document?

No, it should be possible to register "all-document" listeners.

-- Andreas


-- 
Andreas Hartmann
Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
http://www.wyona.com                      http://lenya.apache.org
andreas.hartmann@wyona.com                     andreas@apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: Observation support (was: [1.4] Towards a 1.4 release: Status)

Posted by Andreas Hartmann <an...@apache.org>.
Andreas Hartmann wrote:
> Josias Thöny wrote:
>> On Thu, 2006-07-27 at 00:49 +0200, Andreas Hartmann wrote:
>>> Andreas Hartmann wrote:
>>>
>>> [...]
>>>
>>>  > To be Decided
>>>  > =============
>>>  >
>>>  > - introduce UUIDs?
>>>  > - observation support (indexing of documents)?
>>>
>>> I added a basic observation mechanism and a test case.
>>
>> Thanks a lot for this cool feature!
>>
>>> Feel free to add more details to the test case.
>>>
>>> The listeners are notified when a transaction is committed.
>>> I'd suggest that we try to use this for indexing documents.
>>
>> One question: is it possible to add a listener which is not specific to
>> a certain document, but listens to changes in all documents?
>> This might be useful for the lucene module.
>>
>> The problem is that the nodeChanged() method in the ObservationManager
>> only can translate from a node to a document if a listener was added
>> earlier for that specific document.
> 
> It's not so easy to solve that, because we would have to derive the
> document from the node. I see two approaches:
> 
> - access nodes only via documents, and the document registeres itself
>   as a listener to the node
> 
> - try to resolve the document from the node source URI

Now the observation manager iterates over all documents in the node's
area. This is not fast, but it works. At least it doesn't depend on the
DocumentIdToPathMapper.

-- Andreas


-- 
Andreas Hartmann
Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
http://www.wyona.com                      http://lenya.apache.org
andreas.hartmann@wyona.com                     andreas@apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: Observation support (was: [1.4] Towards a 1.4 release: Status)

Posted by Andreas Hartmann <an...@apache.org>.
Josias Thöny wrote:
> On Thu, 2006-07-27 at 00:49 +0200, Andreas Hartmann wrote:
>> Andreas Hartmann wrote:
>>
>> [...]
>>
>>  > To be Decided
>>  > =============
>>  >
>>  > - introduce UUIDs?
>>  > - observation support (indexing of documents)?
>>
>> I added a basic observation mechanism and a test case.
> 
> Thanks a lot for this cool feature!
> 
>> Feel free to add more details to the test case.
>>
>> The listeners are notified when a transaction is committed.
>> I'd suggest that we try to use this for indexing documents.
> 
> One question: is it possible to add a listener which is not specific to
> a certain document, but listens to changes in all documents?
> This might be useful for the lucene module.
> 
> The problem is that the nodeChanged() method in the ObservationManager
> only can translate from a node to a document if a listener was added
> earlier for that specific document.

It's not so easy to solve that, because we would have to derive the
document from the node. I see two approaches:

- access nodes only via documents, and the document registeres itself
   as a listener to the node

- try to resolve the document from the node source URI

I guess I'll try the second approach first.
This issue can hopefully be resolved when we introduce UUIDs.

-- Andreas


-- 
Andreas Hartmann
Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
http://www.wyona.com                      http://lenya.apache.org
andreas.hartmann@wyona.com                     andreas@apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: Observation support (was: [1.4] Towards a 1.4 release: Status)

Posted by Josias Thöny <jo...@wyona.com>.
On Thu, 2006-07-27 at 00:49 +0200, Andreas Hartmann wrote:
> Andreas Hartmann wrote:
> 
> [...]
> 
>  > To be Decided
>  > =============
>  >
>  > - introduce UUIDs?
>  > - observation support (indexing of documents)?
> 
> I added a basic observation mechanism and a test case.

Thanks a lot for this cool feature!

> Feel free to add more details to the test case.
> 
> The listeners are notified when a transaction is committed.
> I'd suggest that we try to use this for indexing documents.

One question: is it possible to add a listener which is not specific to
a certain document, but listens to changes in all documents?
This might be useful for the lucene module.

The problem is that the nodeChanged() method in the ObservationManager
only can translate from a node to a document if a listener was added
earlier for that specific document.

Or is it recommended to add a listener for each document?

thanks,
Josias

> 
> I'll take a look at it as soon as I find the time, but of
> course any help is greatly appreciated.
> 
> -- Andreas
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org