https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24544
--- Comment #8 from Marcel de Rooy <[email protected]> --- Created attachment 106463 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=106463&action=edit DO NOT PUSH: Example plugins This patch contains a few example plugins for testing and illustrating the use of the various plugin hooks. Prerequisites: [1] Fill PID_Domain with http://[your_domain] Note: This domain is used for pid recognition. [2] Fill PID_Field with say 'auth:024,biblio:024,item'. In other words: enable PIDs for all categories and use 024. [3] Where we refer to (un)install plugin X below, we mean: perl -MKoha::Plugin::Test::PID::X -e"Koha::Plugin::Test::PID::X->install;" perl -MKoha::Plugin::Test::PID::X -e"Koha::Plugin::Test::PID::X->uninstall;" Replace X by the plugin name. Test plan: [1] Koha::Plugin::Test::PID::External with opac/svc/pid_test This part shows the use of pid_create_hook. [a] Install the External plugin. [b] Execute shell command: export PID_SERVICE=http://[your_server:opac_port]/cgi-bin/koha/svc/pid_test [c] Edit your first authority record, add a 024 with $a. Make sure that it fully includes your PID_Domain. [d] Run insert_persistent_id.pl -a -c -v -records 2 Should report back: records 2, updates 1. [e] Verify that your first authority was not modified again and that your second authority record contains a new 024. [2] Koha::Plugin::Test::PID::Orgcode This part shows all three hooks, one hook from External and two other hooks from Orgcode. For instance note the move from $a to $z in the insert hook here. [a] Keep the External plugin, also install the Orgcode plugin. [b] Replace PID_Field by biblio:035$a [c] Fill MARCOrgCode with some string. [d] Edit first biblio record. Add a 035 with $a containing orgcode but with another domain than PID_Domain. Edit the second biblio record. Add a 035 with PID_Domain in $a but without a prefixing orgcode. [e] Run insert_persistent_id.pl -a -c -v -updates 2 Should report back: records 2, updates 2 [f] Check that the first two biblio records contain a 035 with your orgcode in $a before PID_Domain and a new identifier. The first biblio should contain a 035 with $a and $z where $z contains the edit from step [d]. The second biblio record should also contain the 035 from step [d]. [g] Replace PID_Field by: item [h] Run insert_persistent_id.pl -a -c -v -updates 4 Should insert pid's in 4 item records. [3] Koha::Plugin::Test::PID::Cleanup This part shows a 'creative' use of get and insert in order to actually remove identifiers from a record, just illustrating the power of plugins. [a] Uninstall plugins External and Orgcode. [b] Install the Cleanup plugin. [c] Run insert_persistent_id.pl -a -c -v -updates 3 Verify that first three items were cleaned up. Fourth untouched. [d] Uninstall Cleanup. Signed-off-by: Marcel de Rooy <[email protected]> -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list [email protected] https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
