Z39.50 Batch Search/Overlay Z-Index Admin UI
authorBill Erickson <berick@esilibrary.com>
Mon, 25 Feb 2013 15:37:11 +0000 (10:37 -0500)
committerDan Wells <dbw2@calvin.edu>
Fri, 7 Jun 2013 18:52:25 +0000 (14:52 -0400)
Admin -> Server Admin -> Z-Index Field Maps

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/src/templates/conify/global/config/z3950_index_field_map.tt2 [new file with mode: 0644]
Open-ILS/web/opac/locale/en-US/lang.dtd
Open-ILS/xul/staff_client/chrome/content/main/menu.js
Open-ILS/xul/staff_client/chrome/content/main/menu_frame_menus.xul

diff --git a/Open-ILS/src/templates/conify/global/config/z3950_index_field_map.tt2 b/Open-ILS/src/templates/conify/global/config/z3950_index_field_map.tt2
new file mode 100644 (file)
index 0000000..4c603ad
--- /dev/null
@@ -0,0 +1,118 @@
+[% WRAPPER base.tt2 %]
+[% ctx.page_title = l('Z39.50 Index Field Maps') %]
+
+<div dojoType="dijit.layout.ContentPane" layoutAlign="client">
+
+    <div dojoType="dijit.layout.ContentPane" 
+            layoutAlign="top" class='oils-header-panel'>
+
+        <div>[% l('Z39.50 Index Field Maps') %]</div>
+        <div>
+            <button dojoType='dijit.form.Button' 
+                onClick='zGrid.showCreateDialog()'>
+                [% l('New') %]
+            </button>
+            <button dojoType='dijit.form.Button' 
+                onClick='zGrid.deleteSelected()'>
+                [% l('Delete Selected') %]
+            </button>
+        </div>
+    </div>
+
+    <br/>
+
+    <table
+        id="zGrid"
+        jsid="zGrid"
+        dojoType="openils.widget.FlattenerGrid"
+        columnPersistKey='"conify.config.z3950_index_field_map"'
+        autoHeight="true"
+        editOnEnter="true"
+        editStyle="pane"
+        showLoadFilter="true"
+        fmClass="'czifm'"
+        defaultSort="['label']"
+        query="{'id': {'!=' : null}}">
+        <thead>
+            <tr>
+                <th field="label" fpath="label" ffilter="true"/>
+                <th field="metabib_field_label" fpath="metabib_field.label" 
+                    ffilter="true" name="[% l('Metabib Field') %]"/>
+                <th field="record_attr_label" fpath="record_attr.label" 
+                    ffilter="true" name="[% l('Record Attribute') %]"/>
+                <th field="z3950_attr_label" fpath="z3950_attr.label" 
+                    ffilter="true" name="[% l('Z39.50 Attribute') %]"/>
+                <th field="z3950_attr_type" fpath="z3950_attr_type" 
+                    ffilter="true"/>
+            </tr>
+        </thead>
+    </table>
+
+    <p><i>
+[% | l %]Map Metabib Fields OR Bib Record Attributes to specific Z39.50 
+Attributes OR generic Z39.50 Attribute types (by name).[% END %]
+    </i></p>
+
+</div>
+
+<script>
+    dojo.require('dijit.form.Button');
+    dojo.require('dojo.data.ItemFileReadStore');
+    dojo.require('dijit.form.FilteringSelect');
+    dojo.require('openils.widget.FlattenerGrid');
+    dojo.require('openils.PermaCrud');
+    dojo.require('openils.Util');
+
+    dojo.addOnLoad(function() {
+
+        // display the z39 attr field label and source
+        zGrid.overrideWidgetArgs.z3950_attr = {
+            labelFormat : ['${0} : ${1}', 'source', 'label']
+        }
+
+        // fetch all of the z39 attrs and create an attr type
+        // selector from the distinct set of z39 attr names
+        new openils.PermaCrud().retrieveAll('cza', {
+            oncomplete : function(r) {
+                var attrs = openils.Util.readResponse(r);
+                var names = [];
+                var seen = {};
+
+                dojo.forEach(attrs, function(attr) {
+                    var name = attr.name();
+                    if (seen[name]) return;
+                    names.push({name : name});
+                    seen[name] = 1;
+                });
+
+                var store = new dojo.data.ItemFileReadStore({ 
+                    data : {
+                        identifier : 'name', 
+                        label : 'name', 
+                        items : names
+                    }
+                });  
+
+                zGrid.overrideEditWidgets.z3950_attr_type = 
+                    new dijit.form.FilteringSelect({
+                        searchAttr : 'name',
+                        valueAttr : 'name',
+                        labelAttr : 'name',
+                        store : store
+                    });
+
+                // when the edit pane is rendered, update the value of our
+                // custom widget to match that of the row being edited
+                zGrid.onEditPane = function(pane) {
+                    zGrid.overrideEditWidgets.z3950_attr_type.attr(
+                        'value', pane.fmObject.z3950_attr_type() || ''
+                    );
+                }
+            }
+        });
+    });
+
+</script>
+
+[% END %]
+
index a0ba7bf..ccf0a95 100644 (file)
 <!ENTITY staff.main.menu.admin.server_admin.conify.sms_carrier.label "SMS Carriers">
 <!ENTITY staff.main.menu.admin.server_admin.conify.z3950_source.label "Z39.50 Servers">
 <!ENTITY staff.main.menu.admin.server_admin.conify.org_unit_proximity_adjustment.label "Org Unit Proximity Adjustments">
+<!ENTITY staff.main.menu.admin.server_admin.conify.z3950_index_field_map.label "Z39.50 Index Field Maps">
 <!ENTITY staff.main.menu.admin.server_admin.conify.circulation_modifier.label "Circulation Modifiers">
 <!ENTITY staff.main.menu.admin.server_admin.conify.org_unit_setting_type "Organization Unit Setting Types">
 <!ENTITY staff.main.menu.admin.server_admin.conify.import_match_set "Import Match Sets">
index aab9000..cc7a91a 100644 (file)
@@ -1032,6 +1032,10 @@ main.menu.prototype = {
             'cmd_server_admin_org_unit_proximity_adjustment' : [
                 ['oncommand'],
                 function(event) { open_eg_web_page('conify/global/config/org_unit_proximity_adjustment', null, event); }
+                       ],
+            'cmd_server_admin_z39_index_field_map' : [
+                ['oncommand'],
+                function(event) { open_eg_web_page('conify/global/config/z3950_index_field_map', null, event); }
             ],
             'cmd_server_admin_circ_mod' : [
                 ['oncommand'],
index 63bc923..647ad70 100644 (file)
              perm="ADMIN_Z3950_SOURCE"
              />
     <command id="cmd_server_admin_org_unit_proximity_adjustment" />
+    <command id="cmd_server_admin_z39_index_field_map" 
+             perm="ADMIN_Z3950_SOURCE"
+             />
     <command id="cmd_server_admin_circ_mod" 
              perm="CREATE_CIRC_MOD DELETE_CIRC_MOD UPDATE_CIRC_MOD ADMIN_CIRC_MOD"
              />
                 <menuitem label="&staff.main.menu.admin.server_admin.conify.billing_type.label;" command="cmd_server_admin_billing_type"/>
                 <menuitem label="&staff.main.menu.admin.server_admin.conify.sms_carrier.label;" command="cmd_server_admin_sms_carrier"/>
                 <menuitem label="&staff.main.menu.admin.server_admin.conify.z3950_source.label;" command="cmd_server_admin_z39_source"/>
+                <menuitem label="&staff.main.menu.admin.server_admin.conify.z3950_index_field_map.label;" command="cmd_server_admin_z39_index_field_map"/>
                 <menuitem label="&staff.main.menu.admin.server_admin.conify.circulation_modifier.label;" command="cmd_server_admin_circ_mod"/>
                 <menuitem label="&staff.main.menu.admin.server_admin.conify.circulation_limit_group.label;" command="cmd_server_admin_circ_limit_group"/>
                 <menuitem label="&staff.main.menu.admin.server_admin.conify.global_flag.label;" command="cmd_server_admin_global_flag"/>