List Info

Thread: Observation support




Observation support
user name
2006-06-12 14:55:07
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.hartmannwyona.com                     andreasapache.org


------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribelenya.apache.org
For additional commands, e-mail: dev-helplenya.apache.org

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )