Hi,
I have been looking at how to notify when an event has been finished. Here
what I have currently understood and I got some confusion.
In order to get notified when login event finished, I think I have to do the
following things.
1. Create a LoginListener class that implements EventListener
2. Create object of DefaultObservationManager class
(DefaultObservationManager implements ObservationManager)
3. Define class UserLoginEvent similar to DocumentSaveEvent
4. call addListener() of ObjectManager interface (using
DefaultObjectManager) with parameters - object of UserLoginEvent and
reference to login listener.
5. get reference to DefaultObjectManager instance
6. call notify() of DefaultObjectManager instance when user successfully
logged in, with parameters - object of UserLoginEvent, doc and context
7. Implement notify() in LoginListener class.
Q. But I have several confusions when I looked at XWiki class,
saveDocument()
1. Where does it create and add a listener to ObservationManager object??
2. And also it takes ObservationManager object from Util.getComponent()but
where does this observationManager instance is added or set ?
Please clarify me on what I currently understood and let me know if its the
right steps to go with.
Kind Regards,
-Tharindu