z39.50 import
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 25 Jul 2005 18:35:42 +0000 (18:35 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 25 Jul 2005 18:35:42 +0000 (18:35 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@1444 dcc99617-32d9-48b4-a31d-7c20da2025e4

Evergreen/staff_client/chrome/content/evergreen/main/app_shell_overlay.xul
Evergreen/staff_client/chrome/content/evergreen/util/spawn_win.js
Evergreen/staff_client/chrome/content/evergreen/z39_50/z39_50.js [new file with mode: 0644]
Evergreen/staff_client/chrome/content/evergreen/z39_50/z39_50.xul [new file with mode: 0644]
Evergreen/staff_client/chrome/content/evergreen/z39_50/z39_50_bundle.xul [new file with mode: 0644]
Evergreen/staff_client/chrome/content/evergreen/z39_50/z39_50_overlay.xul [new file with mode: 0644]

index 5199cb6..746b822 100644 (file)
@@ -57,7 +57,7 @@
        <command id="cmd_receipt_template_editor" oncommand="
                mw.spawn_receipt_template_editor(document,'replace_tab','main_tabbox',{}); "/>  
 
-       <command id="cmd_z39_50_import_old" oncommand="
+       <command id="cmd_z39_50_import" oncommand="
                mw.spawn_z3950_import(document,'replace_tab','main_tabbox',{}); "/>     
 
        <command id="cmd_console" oncommand="
index 27f98a6..988c6ed 100644 (file)
@@ -155,24 +155,26 @@ function spawn_oclc_import(d,placement,place,passthru_params,clone) {
        sdump('D_SPAWN','trying to spawn_oclc_import('+js2JSON(passthru_params)+')\n');
        // sample TCN: 03715963 
        try {
-               if (params.tcn.length < 6) {
+               if (passthru_params.tcn.length < 6) {
                        throw("Too short.  At the moment, we're really doing a search rather than a retrieve, and it's a substring search at that.  We grab the result that matches exactly.  But sending a short query would just be mean. :)");
                }
                var result = user_request(
                        'open-ils.search',
                        'open-ils.search.z3950.import',
-                       [ G.auth_ses[0], params.tcn ]
+                       [ mw.G.auth_ses[0], passthru_params.tcn ]
                )[0];
-               if (typeof result == 'object') {
-                       if (result.records.length > 0) {        
-                               params['import_tree'] = result.records[0];
+               if (result) {
+                       if (typeof result == 'object') {
+                               if (result.records && result.records.length > 0) {      
+                                       passthru_params['import_tree'] = result.records[0];
+                               } else {
+                                       throw('no records. result = ' + js2JSON(result) + '\n');
+                               }
                        } else {
-                               throw('no records. result = ' + js2JSON(result) + '\n');
+                               throw('result: ' + js2JSON(result) + '\n');
                        }
-               } else {
-                       throw('result: ' + js2JSON(result) + '\n');
+                       spawn_marc_editor(d,placement,place,passthru_params);
                }
-               spawn_marc_editor(d,placement,place,params);
        } catch(E) {
                handle_error(E);
        }
diff --git a/Evergreen/staff_client/chrome/content/evergreen/z39_50/z39_50.js b/Evergreen/staff_client/chrome/content/evergreen/z39_50/z39_50.js
new file mode 100644 (file)
index 0000000..88e556a
--- /dev/null
@@ -0,0 +1,7 @@
+dump('Loading z39_50.js\n');
+
+function z39_50_init() {
+       dump('**** TESTING: z39_50.js: z39_50_init(): ' + mw.G.main_test_variable + '\n');
+       focus_widget( 't1' );
+}
+
diff --git a/Evergreen/staff_client/chrome/content/evergreen/z39_50/z39_50.xul b/Evergreen/staff_client/chrome/content/evergreen/z39_50/z39_50.xul
new file mode 100644 (file)
index 0000000..9e3e5ed
--- /dev/null
@@ -0,0 +1,32 @@
+<?xml version="1.0"?>
+<!-- Application: Evergreen Staff Client -->
+
+<!-- Stylesheets -->
+<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
+<?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
+<?xml-stylesheet href="chrome://evergreen/skin/z39_50.css" type="text/css"?>
+
+<!-- Localization -->
+<!DOCTYPE page SYSTEM "chrome://evergreen/locale/z39_50.dtd">
+
+<page id="z39_50_win" orient="vertical" style="overflow: auto;" persist="width height"
+       onload="z39_50_init();" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+
+       <script>dump('z39_50_win\n');</script>
+
+       <!-- Initial Overlays for this XUL file -->
+       <?xul-overlay href="chrome://evergreen/content/OpenSRF/OpenSRF_overlay.xul"?>
+       <?xul-overlay href="chrome://evergreen/content/util/util_overlay.xul"?>
+       <?xul-overlay href="chrome://evergreen/content/z39_50/z39_50_bundle.xul"?>
+
+       <!-- OpenSRF -->
+       <script>var myPackageDir = "evergreen";</script>
+       <OpenSRF id="OpenSRF_js" />
+       <!-- other javascript -->
+       <Util/>
+
+       <!-- Layout to be filled in by overlays and javascript -->
+       <vbox id="z39_50_vbox" class="test_class"/>
+
+</page>
+
diff --git a/Evergreen/staff_client/chrome/content/evergreen/z39_50/z39_50_bundle.xul b/Evergreen/staff_client/chrome/content/evergreen/z39_50/z39_50_bundle.xul
new file mode 100644 (file)
index 0000000..be7f1ca
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<!DOCTYPE overlay SYSTEM "chrome://evergreen/locale/z39_50.dtd">
+<overlay id="z39_50_bundle" 
+       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+
+       <script>dump('z39_50_bundle\n');</script>
+
+       <?xul-overlay href="chrome://evergreen/content/z39_50/z39_50_overlay.xul"?>
+
+       <script src="z39_50.js" />
+
+</overlay>
diff --git a/Evergreen/staff_client/chrome/content/evergreen/z39_50/z39_50_overlay.xul b/Evergreen/staff_client/chrome/content/evergreen/z39_50/z39_50_overlay.xul
new file mode 100644 (file)
index 0000000..fc68bd3
--- /dev/null
@@ -0,0 +1,21 @@
+<?xml version="1.0"?>
+<!DOCTYPE overlay SYSTEM "chrome://evergreen/locale/z39_50.dtd">
+<overlay id="z39_50_overlay" 
+       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+
+       <script>dump('z39_50_overlay\n');</script>
+
+       <vbox id="z39_50_vbox" flex="1">
+               <description id="d1">
+                       This screen will likely evolve into a federated z39.50 search interface that will allow you to search a range of z39.50 servers using all of the search operators defined by the z39.50 spec.  For now, however, you may enter an Ascession ID to pull an OCLC record into our MARC editor.
+               </description>
+               <hbox id="z39_50_hbox">
+                       <label id="l1" value="Ascession ID (or TCN): "/>
+                       <textbox id="t1" />
+                       <button id="b1" label="Retrieve" oncommand="
+                               spawn_oclc_import(parent.document,'replace_tab','main_tabbox', { 'tcn' : document.getElementById('t1').value });
+                       "/>
+               </hbox>
+       </vbox>
+
+</overlay>