Page 1 of 1

Partial update for J1.5 events

Posted: Wed Dec 20, 2006 7:25 pm
by instance
Attached zip has wiki format updates to J1.5 system and user events, plus an alphabetical event index. (I hope I got the markup right, I just guessed based on what was there).

I'll try to get to the other events later.

Re: Partial update for J1.5 events

Posted: Wed Dec 20, 2006 10:06 pm
by Chris Davenport
Hi instance,

Excellent work, it is much appreciated.  I have amended the wiki appropriately.

Thank you and keep 'em coming.  :)

Regards,
Chris.

Re: Partial update for J1.5 events

Posted: Thu Dec 21, 2006 4:58 am
by instance
Here's the next (and probably final) update. This covers all the events (except those related to the back-end editor) in detail. I've made every attempt to get it right, but I've also corrected a large number of errors and faulty assumptions that I made in earlier passes, a humbling experience.

I simply didn't have time to dig into the "editor" events, and since they're not particularly relevant to my work, I'm not likely to return to them.

I also tried to get the headers consistent (and numbered correctly -- what a pain!), the formatting correct, and the language clear (my Canadian spelling will be less at odds with the rest of the documentation than if I was south of the border ;)), but working blind like this I am sure there are errors. As with most writing, and editor's eye will be required.

Re: Partial update for J1.5 events

Posted: Thu Dec 21, 2006 3:41 pm
by Chris Davenport
Hi instance,

I have updated the wiki.
instance wrote: As with most writing, and editor's eye will be required.
Very little editing was required.  Well done!  ;D

This work is very much appreciated.  Thank you.

Regards,
Chris.

Re: Partial update for J1.5 events

Posted: Thu Dec 21, 2006 4:47 pm
by instance
Of course, one read on the wiki and I find errors. Typical!
This topic is aimed at the events which are called within every page load.
Would be accurate if it read:
This topic is aimed at "global" system events, including those triggered on every page load (onBeforeStart, onAfterStart); those supporting search within multiple plugins (onSearch, onSearchAreas), and those supporting the presentation of web services (onGetWebServices).
Sorry, but I detest even slightly misleading documentation, especially when I wrote it.

This section also needs an explanation of the "legacy" versus "new" event handling mechanisms. The "new" model passes a parameter called ['event'] in an associative array to the update() method of an object that is derived from JPlugin. The update method then invokes a method with the same name as the event name, if it exists. This makes it possible to encapsulate plugins in a class. $mainframe->triggerEvent() uses the JEventDispatcher singleton to either call a function (old style) or the update() method of an object that's listed as an observer. So the old method still works but the new method is preferable for new plugins.

An explanation of the whole observer mechanism would be nice too, but I don't have my head around that -- yet!

Re: Partial update for J1.5 events

Posted: Sat Dec 23, 2006 9:42 pm
by Chris Davenport
Thanks instance,

I've applied your amendment and also spent a bit of time improving other parts of the text.

Thanks again for your contribution.

Regards,
Chris.