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/06/12 16:55:07 UTC

[1.4] [RT] Observation support

Hi Lenya devs,

we already considered observation to support indexing of documents
without using the index usecase as exit usecase of various other
usecases.

I think it wouldn't be very hard to implement a basic observation
support:


public class IndexManager implements RepositoryListener, Startable {

     /**
      * @see Startable
      */
     public void start() {
         RepositoryManager repoMgr = (...) manager.lookup(RepoMgr.ROLE);
         repoMgr.registerListener(this);
     }

     /**
      * @see RepositoryListener
      */
     public void onEvent(RepositoryEvent event) {
         if (event.getEvent() == RepositoryEvent.DOCUMENT_CHANGED) {
             Document doc = docFactory.get(event.getDocumentId(), ...);
             index(doc);
         }
     }

}

At the moment, the notification would be handled by session
objects on Session.commit(). The biggest problem will be that the
repository manages nodes, not documents. Maybe we have to change
this (IMO it would be a good idea to change it anyway, see the
repository module).

Maybe there are some issues about concurrency, but I guess there's
nothing that can't be managed. In any case, I'd prefer this solution
to the current situation.

WDYT?

-- 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: [1.4] [RT] Observation support

Posted by Andreas Hartmann <an...@apache.org>.
Thorsten Scherler wrote:

[...]

>>> I also think observation should be implemented at document level (not at
>>> node level). IIUC this would only work well if the repository handles
>>> documents instead of nodes. Honestly I cannot really see the
>>> implications of such a change, it seems quite fundamental. 

>> I'll think about it and maybe do some prototyping. I'll post a
>> report as soon as I know more. BTW, all devs - feel free to examine
>> the code as well, the more people are familiar with it the better :)

> Did you have a wrap up somewhere? Maybe in the sandbox?

There is no code yet. Should we address this before 1.4 is released?

-- 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: [1.4] [RT] Observation support

Posted by Thorsten Scherler <th...@apache.org>.
El lun, 12-06-2006 a las 17:58 +0200, Andreas Hartmann escribió:
> Josias Thöny wrote:
> 
> [...]
> 
> > +1 for the observation concept.
> > I wonder if any other (possible) usecases could benefit from observation
> > support. Maybe email-notifications? Automated statistical reports about
> > changes?
> 
> Another important issue is EAI - buzzword alert :) - for instance if
> your website is part of a company-wide translation process and all
> changed documents should be submitted to a translation office
> automatically.
> 
> 

lol 

yeah or another buzzword: EAIR (Renderer). If a page got updated the
renderer will be notified to regenerate the page.


> > I also think observation should be implemented at document level (not at
> > node level). IIUC this would only work well if the repository handles
> > documents instead of nodes. Honestly I cannot really see the
> > implications of such a change, it seems quite fundamental. 
> 
> I'll think about it and maybe do some prototyping. I'll post a
> report as soon as I know more. BTW, all devs - feel free to examine
> the code as well, the more people are familiar with it the better :)

Did you have a wrap up somewhere? Maybe in the sandbox?

salu2

> 
> Thanks for your comments,
> 
> -- Andreas
> 
> 
-- 
thorsten

"Together we stand, divided we fall!" 
Hey you (Pink Floyd)


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


Re: [1.4] [RT] Observation support

Posted by Andreas Hartmann <an...@apache.org>.
Josias Thöny wrote:

[...]

> +1 for the observation concept.
> I wonder if any other (possible) usecases could benefit from observation
> support. Maybe email-notifications? Automated statistical reports about
> changes?

Another important issue is EAI - buzzword alert :) - for instance if
your website is part of a company-wide translation process and all
changed documents should be submitted to a translation office
automatically.


> I also think observation should be implemented at document level (not at
> node level). IIUC this would only work well if the repository handles
> documents instead of nodes. Honestly I cannot really see the
> implications of such a change, it seems quite fundamental. 

I'll think about it and maybe do some prototyping. I'll post a
report as soon as I know more. BTW, all devs - feel free to examine
the code as well, the more people are familiar with it the better :)

Thanks for your comments,

-- 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: [1.4] [RT] Observation support

Posted by Josias Thöny <jo...@wyona.com>.
On Mon, 2006-06-12 at 16:55 +0200, Andreas Hartmann wrote:
> Hi Lenya devs,
> 
> we already considered observation to support indexing of documents
> without using the index usecase as exit usecase of various other
> usecases.
> 
> I think it wouldn't be very hard to implement a basic observation
> support:
> 
> 
> public class IndexManager implements RepositoryListener, Startable {
> 
>      /**
>       * @see Startable
>       */
>      public void start() {
>          RepositoryManager repoMgr = (...) manager.lookup(RepoMgr.ROLE);
>          repoMgr.registerListener(this);
>      }
> 
>      /**
>       * @see RepositoryListener
>       */
>      public void onEvent(RepositoryEvent event) {
>          if (event.getEvent() == RepositoryEvent.DOCUMENT_CHANGED) {
>              Document doc = docFactory.get(event.getDocumentId(), ...);
>              index(doc);
>          }
>      }
> 
> }
> 
> At the moment, the notification would be handled by session
> objects on Session.commit(). The biggest problem will be that the
> repository manages nodes, not documents. Maybe we have to change
> this (IMO it would be a good idea to change it anyway, see the
> repository module).
> 
> Maybe there are some issues about concurrency, but I guess there's
> nothing that can't be managed. In any case, I'd prefer this solution
> to the current situation.
> 
> WDYT?

+1 for the observation concept.
I wonder if any other (possible) usecases could benefit from observation
support. Maybe email-notifications? Automated statistical reports about
changes?

I also think observation should be implemented at document level (not at
node level). IIUC this would only work well if the repository handles
documents instead of nodes. Honestly I cannot really see the
implications of such a change, it seems quite fundamental. 

Josias


> 
> -- Andreas
> 
> 


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