|
Baylys Just practicing to pass the Turing test. |
||||||||||||||||||||||||||
|
ManilaSiteCallbacks Suite
The standard way of creating a Manila callback is to insert a script, or the address of a script, in the config.Manila.callbacks table. Manila calls scripts in the changedmessage table every time a message is changed in any Manila website. So the callback script must be written to know for which sites it should do its thing and to exit if a message is changed in another site. Such scripts harder to write and more error prone than is desirable. This mini suite allows you to define Manila callbacks specific to each Manila website.
To use it run manilaSiteCallbacks.init - which constructs the necessary entries in config.manila.callbacks and internally to ensure that all callback loops get to manilaSiteCallbacks.dispatcher. The dispatcher checks for entries in myManilawebsite.#callbacks with the same name as the entries in config.manila.callbacks.
The net result is that if you have a script, an address or a string value at myManilawebsite.#callbacks.changedMessage it will be called when a message is changed in myManilaWebsite.
The gains in maintenance ease are not the only advantage of this technique. With callbacks limited to single webistes, it is easier to programatically manage callbacks for each site, as the manilaFixer and metadata plug-ins do with filter patches.
|
|||||||||||||||||||||||||