On Sat, Apr 14, 2012 at 10:40 AM, Vincent Massol <[email protected]> wrote:

>
> On Apr 14, 2012, at 12:12 AM, Eduard Moraru wrote:
>
> > Hi,
> >
> > On Fri, Apr 13, 2012 at 6:43 PM, Vincent Massol <[email protected]>
> wrote:
> >
> >> 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?
> >>
> >
> > +1. I could have used that on the annotations migrator instead of
> > ApplicationReadyEvent.
>
> Does it mean you're not using a Migrator?
>

A poor choice of words on my side. I was actually talking about this
https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwiki-platform-annotations/xwiki-platform-annotation-io/src/main/java/org/xwiki/annotation/internal/CheckAnnotationClassEventListener.javawhich
targeted the currently configured annotations class.

For the rest, yes, I`ve used a migrator (migration 40001:
https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwiki-platform-annotations/xwiki-platform-annotation-io/src/main/java/org/xwiki/annotation/io/internal/migration/hibernate/R40001XWIKI7540DataMigration.java).


Thanks,
Eduard

>
> Thanks
> -Vincent
>
> > Thanks,
> > Eduard
> >
> >
> >>
> >> 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
> _______________________________________________
> devs mailing list
> [email protected]
> http://lists.xwiki.org/mailman/listinfo/devs
>
_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs

Reply via email to