On Apr 13, 2012, at 5:47 PM, Paul Libbrecht wrote:
Vincent,
on IRC you had suggested me to use such an event. I couldn't find it.
Each module can create events. For AppStarted/ReadyEvent they're currently in commons-observation-api
Is there an overview of such events?
* Observation module: http://extensions.xwiki.org/xwiki/bin/view/Extension/Observation+Module * For events you need to check the javadoc for each module since each module can provides its own events. There's no centralized place where all events are listed ATM. Thanks -Vincent
thanks in advance
Paul
Le 13 avr. 2012 à 17:43, Vincent Massol a écrit :
Hi devs,
We already have ApplicationStartedEvent and ApplicationReadyEvent (when DB is ready). We also need an event when the wiki is ready since in s a multiwiki environment when you create a new wiki for example, you might need to init some stuff (like initialize mandatory classes). It's also needed the first time a request comes in for a given wiki.
Thus I propose to add a WikiReadyEvent next to ApplicationStartedEvent and to send it in XWiki.updateDatabase():
... synchronized (wikiName) { if (!wikiList.contains(wikiName)) { wikiList.add(wikiName);
// Make sure these classes exists if (initClasses) { initializeMandatoryClasses(context); getPluginManager().virtualInit(context); getRenderingEngine().virtualInit(context); }
--> send WikiReadyEvent here
} }
WDYT?
Note that I was tempted to have a WikiCreatedEvent event sent when creating a wiki but that wouldn't fill the use case of initializing the wiki on the first request to it.
Thanks -Vincent