2 [% ctx.page_title = l('Z39.50 Index Field Maps') %]
4 <div dojoType="dijit.layout.ContentPane" layoutAlign="client">
6 <div dojoType="dijit.layout.ContentPane"
7 layoutAlign="top" class='oils-header-panel'>
9 <div>[% l('Z39.50 Index Field Maps') %]</div>
11 <button dojoType='dijit.form.Button'
12 onClick='zGrid.showCreateDialog()'>
15 <button dojoType='dijit.form.Button'
16 onClick='zGrid.deleteSelected()'>
17 [% l('Delete Selected') %]
27 dojoType="openils.widget.FlattenerGrid"
28 columnPersistKey='"conify.config.z3950_index_field_map"'
34 defaultSort="['label']"
35 query="{'id': {'!=' : null}}">
38 <th field="label" fpath="label" ffilter="true"></th>
39 <th field="metabib_field_label" fpath="metabib_field.label"
40 ffilter="true" name="[% l('Metabib Field') %]"></th>
41 <th field="record_attr_label" fpath="record_attr.label"
42 ffilter="true" name="[% l('Record Attribute') %]"></th>
43 <th field="z3950_attr_label" fpath="z3950_attr.label"
44 ffilter="true" name="[% l('Z39.50 Attribute') %]"></th>
45 <th field="z3950_attr_type" fpath="z3950_attr_type"
52 [% | l %]Map Metabib Fields OR Bib Record Attributes to specific Z39.50
53 Attributes OR generic Z39.50 Attribute types (by name).[% END %]
59 dojo.require('dijit.form.Button');
60 dojo.require('dojo.data.ItemFileReadStore');
61 dojo.require('dijit.form.FilteringSelect');
62 dojo.require('openils.widget.FlattenerGrid');
63 dojo.require('openils.PermaCrud');
64 dojo.require('openils.Util');
66 dojo.addOnLoad(function() {
68 // display the z39 attr field label and source
69 zGrid.overrideWidgetArgs.z3950_attr = {
70 labelFormat : ['${0} : ${1}', 'source', 'label']
73 // fetch all of the z39 attrs and create an attr type
74 // selector from the distinct set of z39 attr names
75 new openils.PermaCrud().retrieveAll('cza', {
76 oncomplete : function(r) {
77 var attrs = openils.Util.readResponse(r);
81 dojo.forEach(attrs, function(attr) {
82 var name = attr.name();
83 if (seen[name]) return;
84 names.push({name : name});
88 var store = new dojo.data.ItemFileReadStore({
96 zGrid.overrideEditWidgets.z3950_attr_type =
97 new dijit.form.FilteringSelect({
104 // when the edit pane is rendered, update the value of our
105 // custom widget to match that of the row being edited
106 zGrid.onEditPane = function(pane) {
107 zGrid.overrideEditWidgets.z3950_attr_type.attr(
108 'value', pane.fmObject.z3950_attr_type() || ''