[Grok-dev] Grok Application and content initialization
Martijn Faassen
faassen at startifact.com
Wed Oct 7 16:15:06 EDT 2009
Hey Souheil,
Sorry for being late in responding to this. It is indeed a very
important topic.
> Currently, when one adds a Grok Application, indexes and local
> utilities are created using an event subscriber plugged on
> IObjectAddedEvent. However, if one wants to add any content inside the
> Application during the creation process, there is a very high
> probability that he will use the same event (the only useable and
> reliable one) and his event subscriber has a very high probability to
> be fired BEFORE the indexes and the local utilities ones. It means
> that the content created by his subscriber won't be cataloged, nor
> added to the IntIds utility, etc...
>
> This situation is very annoying, since the creation of content as the
> site creation is a fairly common usecase (yes... one of mine, you've
> got it). I propose the creation of a new event we could call
> ApplicationInitializedEvent, for instance, and that would be fired
> AFTER the ObjectCreatedEvent. This would permit a more flexible
> handling of the different application statuses => instanciated,
> persisted, ready to be used. Obviously, this can't be plugged in
> grokui.base, it belongs to Grok itself. What do you guys think ?
I'm +1 on sending an ApplicationInitializedEvent after the
ObjectCreatedEvent. We can then document people should use this if they
want code to run after the application is installed. I agree it
shouldn't be in grokui.base but in Grok itself, as any method of
installing the application would work independently of which admin tool
is used.
I'd be very happy to see you work on this. Looking forward to code,
tests and docs. (the developer's notes in the official docs are a good
place for now).
Regards,
Martijn
More information about the Grok-dev
mailing list