added initial z39 source config interface
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 2 Dec 2008 23:57:21 +0000 (23:57 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 2 Dec 2008 23:57:21 +0000 (23:57 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@11379 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/examples/oils_web.xml.example
Open-ILS/web/js/ui/default/conify/global/config/z3950_source.js [new file with mode: 0644]
Open-ILS/web/templates/default/conify/global/config/z3950_source.tt2 [new file with mode: 0644]

index acbf9e8..92fe526 100644 (file)
@@ -39,6 +39,7 @@
 
         <handler path='conify/global/config/billing_type' template='conify/global/config/billing_type.tt2'/>
         <handler path='conify/global/config/standing_penalty' template='conify/global/config/standing_penalty.tt2'/>
+        <handler path='conify/global/config/z3950_source' template='conify/global/config/z3950_source.tt2'/>
         <handler path='conify/global/permission/grp_penalty_threshold' template='conify/global/permission/grp_penalty_threshold.tt2'/>
     </handlers>
 </oils_web>
diff --git a/Open-ILS/web/js/ui/default/conify/global/config/z3950_source.js b/Open-ILS/web/js/ui/default/conify/global/config/z3950_source.js
new file mode 100644 (file)
index 0000000..9e323ed
--- /dev/null
@@ -0,0 +1,53 @@
+dojo.require('dojox.grid.DataGrid');
+dojo.require('dojo.data.ItemFileReadStore');
+dojo.require('dijit.form.NumberTextBox');
+dojo.require('dijit.form.CheckBox');
+dojo.require('fieldmapper.OrgUtils');
+dojo.require('openils.widget.OrgUnitFilteringSelect');
+
+var zsList;
+
+function buildZSGrid() {
+    fieldmapper.standardRequest(
+        ['open-ils.permacrud', 'open-ils.permacrud.search.czs.atomic'],
+        {   async: true,
+            params: [openils.User.authtoken, {name:{'!=':null}}],
+            oncomplete: function(r) {
+                if(zsList = openils.Util.readResponse(r)) {
+                    var store = new dojo.data.ItemFileReadStore(
+                        {data:czs.toStoreData(zsList, 'name',{identifier:'name'})});
+                    zsGrid.setStore(store);
+                    zsGrid.render();
+                }
+            }
+        }
+    );
+}
+
+function zsCreate(args) {
+    return alert(js2JSON(args));
+    if(!args.name || args.owner == null) 
+        return;
+    if(args.default_price == '' || isNaN(args.default_price))
+        args.default_price = null;
+
+    var zsype = new czs();
+    zsype.name(args.name);
+    zsype.owner(args.owner);
+    zsype.default_price(args.default_price);
+
+    fieldmapper.standardRequest(
+        ['open-ils.permacrud', 'open-ils.permacrud.create.czs'],
+        {   async: true,
+            params: [openils.User.authtoken, zsype],
+            oncomplete: function(r) {
+                if(new String(openils.Util.readResponse(r)) != '0')
+                    buildBTGrid();
+            }
+        }
+    );
+}
+
+openils.Util.addOnLoad(buildZSGrid);
+
+
diff --git a/Open-ILS/web/templates/default/conify/global/config/z3950_source.tt2 b/Open-ILS/web/templates/default/conify/global/config/z3950_source.tt2
new file mode 100644 (file)
index 0000000..343ef62
--- /dev/null
@@ -0,0 +1,71 @@
+[% WRAPPER default/base.tt2 %]
+<script src='[% ctx.media_prefix %]/js/ui/default/conify/global/config/z3950_source.js'> </script>
+<h1>Z39.50 Servers</h1><br/>
+
+<div dojoType="dijit.form.DropDownButton">
+    <span>Z39.50 Servers</span>
+    <div dojoType="dijit.TooltipDialog" execute="zsCreate(arguments[0]);">
+        <table class='dijitTooltipTable'>
+            <tr>
+                <td><label for="name">Name: </label></td>
+                <td><input dojoType="dijit.form.TextBox" name="name"/></td>
+            </tr>
+            <tr>
+                <td><label for="label">Label: </label></td>
+                <td><input dojoType="dijit.form.TextBox" name="label"/></td>
+            </tr>
+            <tr>
+                <td><label for="host">Host: </label></td>
+                <td><input dojoType="dijit.form.TextBox" name="host"/></td>
+            </tr>
+            <tr>
+                <td><label for="port">Port: </label></td>
+                <td><input dojoType="dijit.form.NumberTextBox" name="port"/></td>
+            </tr>
+            <tr>
+                <td><label for="db">Database: </label></td>
+                <td><input dojoType="dijit.form.TextBox" name="db"/></td>
+            </tr>
+            <tr>
+                <td><label for="record_format">Record Format: </label></td>
+                <td><input dojoType="dijit.form.TextBox" name="record_format"/></td>
+            </tr>
+            <tr>
+                <td><label for="transmission_format">Transmission Format: </label></td>
+                <td><input dojoType="dijit.form.TextBox" name="transmission_format"/></td>
+            </tr>
+            <tr>
+                <td><label for="auth">Requires Authentication: </label></td>
+                <td><input dojoType="dijit.form.CheckBox" name="auth"/></td>
+            </tr>
+            <tr>
+                <td colspan='2' align='center'>
+                    <button dojoType='dijit.form.Button' type="submit">Create</button>
+                </td>
+            </tr>
+        </table>
+    </div>
+</div> 
+
+<div dojoType="dijit.layout.ContentPane" layoutAlign="top">
+    <div dojoType="dijit.layout.ContentPane" layoutAlign="client" style='height:600px;'>
+        <table jsId="zsGrid" dojoType="dojox.grid.DataGrid" query="{name: '*'}" rowSelector='20px'>
+            <thead>
+                <tr>
+                    <th field="name">Name</th>
+                    <th field="label" width='auto'>Label</th>
+                    <th field="host" width='auto'>Host</th>
+                    <th field="port">Port</th>
+                    <th field="db" width='auto'>Database</th>
+                    <th field="record_format" width='auto'>Record Format</th>
+                    <th field="transmission_format" width='auto'>Transmission Format</th>
+                    <th field="auth" width='auto'>Requires Authentication</th>
+                </tr>
+            </thead>
+        </table>    
+    </div>
+</div>
+
+[% END %]
+
+