]> git.evergreen-ils.org Git - Evergreen.git/commit
JSAN module autoloader for "add-ons"
authorJason Etheridge <jason@esilibrary.com>
Fri, 21 Dec 2012 05:19:37 +0000 (00:19 -0500)
committerMike Rylander <mrylander@gmail.com>
Thu, 12 Sep 2013 17:50:39 +0000 (13:50 -0400)
commit8095a2efaa6ce9c264c531a46dc3983012686457
treef86e22b4b75ffd852f556dd0bf0dfbfce628b288
parent6de0fc1489856c74af2b0a5f55bb841aec74834d
JSAN module autoloader for "add-ons"

This adds a "Server Add-ons" menu entry under Admin -> Workstation
Administration in the staff client.  Choosing this allows you to edit or set a
list of identifiers that correspond to JSAN-style modules found in
/server/addons/, and is meant mainly for activating 3rd party modules within the
staff client on a per-workstation basis.  You need the
ADMIN_SERVER_ADDON_FOR_WORKSTATION permission to use it.

Configuration options for activated add-ons may also show up in this interface.

More technical details:

This Server Add-ons list is stored as a JSON array in the Mozilla preference
'oils.addon.autoload.list'.

We also add an addon.autoloader module that gets called in most XUL interfaces
via the util_overlay file.  This autoloader will loop through the modules
specified in 'oils.addon.autoload.list' and instantiate each, storing a
reference to each of the newly created objects in a data structure in
window.oils_autoloaded.

So, as an example, let's say there is a module: /xul/server/addon/uber_scan.js
And we have the identifier 'uber_scan' in our Server Add-ons list.  Then, on
every page load of a XUL interface using the stock util overlay, we will
effectively call:

    new addon.uber_scan();

Causing the code in the module to execute.  It is up to the module to determine
whether it needs to do anything within a given interface.

Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Conflicts [permission numbering]:
Open-ILS/src/sql/Pg/950.data.seed-values.sql
12 files changed:
Open-ILS/src/sql/Pg/950.data.seed-values.sql
Open-ILS/src/sql/Pg/upgrade/XXXX.data.server_addon_perms.sql [new file with mode: 0644]
Open-ILS/web/opac/locale/en-US/lang.dtd
Open-ILS/xul/staff_client/chrome/content/OpenILS/global_util.js
Open-ILS/xul/staff_client/chrome/content/main/constants.js
Open-ILS/xul/staff_client/chrome/content/main/menu.js
Open-ILS/xul/staff_client/chrome/content/main/menu_frame_menus.xul
Open-ILS/xul/staff_client/server/addon/addons.js [new file with mode: 0644]
Open-ILS/xul/staff_client/server/addon/addons.xul [new file with mode: 0644]
Open-ILS/xul/staff_client/server/addon/autoloader.js [new file with mode: 0644]
Open-ILS/xul/staff_client/server/locale/en-US/addon/addons.properties [new file with mode: 0644]
docs/RELEASE_NOTES_NEXT/xul_server_addons.txt [new file with mode: 0644]