[Koha-devel] Koha events

Galen Charlton galen.charlton at liblime.com
Tue May 26 17:09:54 CEST 2009


Hi,

On Mon, May 25, 2009 at 4:32 AM, Andrei V. Toutoukine <tut at isuct.ru> wrote:
> I'm wondering if anyone ever wanted events in Koha? Events may be like
> onpatronremove, onbibliosave, onbiblionew etc... For example if one
> wants to check spelling and marc-correctness of the record before it is
> saved to the database one could put either 'default' or home-made perl
> script to a special place like $KOHA/events/scripts/ and make links to
> these scripts from $KOHA/events/onbibliosave/ folder. Every time koha
> saves a biblio it calls scripts from $KOHA/events/onbibliosave/ in
> default order provided by fs passing there all the information on biblio
> available at the moment.

I think a system for defining events and hooking into them is a good
idea.  Some things to consider:

* should an event handler be able to abort an event?  E.g., if there's
a spell checker for onbibliosave, would it just give warnings to the
cataloger or be able to stop the save action?
* each event should have a well-defined API specifying the data coming
in and out
* it should be possible to chain together event handlers
* could some event handlers be a matter of user preference as opposed
to administrator preference?

One thing that I don't think event handlers should be used for is
maintaining data integrity - that should be the responsibility of C4
code or database triggers.

Regards,

Galen
-- 
Galen Charlton
VP, Research & Development, LibLime
galen.charlton at liblime.com
p: 1-888-564-2457 x709
skype: gmcharlt



More information about the Koha-devel mailing list