opac wrapper
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 9 Dec 2005 19:00:39 +0000 (19:00 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 9 Dec 2005 19:00:39 +0000 (19:00 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@2306 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/server/cat/opac.js [new file with mode: 0644]
Open-ILS/xul/staff_client/server/cat/opac.xul [new file with mode: 0644]

diff --git a/Open-ILS/xul/staff_client/server/cat/opac.js b/Open-ILS/xul/staff_client/server/cat/opac.js
new file mode 100644 (file)
index 0000000..1d2aca6
--- /dev/null
@@ -0,0 +1,101 @@
+dump('entering cat.opac.js\n');
+
+if (typeof patron == 'undefined') patron = {};
+cat.opac = function (params) {
+
+       JSAN.use('util.error'); this.error = new util.error();
+}
+
+cat.opac.prototype = {
+
+       'init' : function( params ) {
+
+               netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+
+               var obj = this;
+
+               obj.session = params['session'];
+               obj.url = params['url'];
+
+               JSAN.use('main.controller'); obj.controller = new main.controller();
+               obj.controller.init(
+                       {
+                               control_map : {
+                                       'cmd_broken' : [
+                                               ['command'],
+                                               function() { alert('Not Yet Implemented'); }
+                                       ],
+                               }
+                       }
+               );
+               obj.controller.view.opac_browser = document.getElementById('opac_browser');
+
+               obj.buildProgressListener();
+               obj.controller.view.opac_browser.addProgressListener(obj.progressListener,
+                               Components.interfaces.nsIWebProgress.NOTIFY_ALL );
+
+               obj.controller.view.opac_browser.setAttribute('src',obj.url);
+
+       },
+
+       'push_variables' : function() {
+
+               netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+
+               obj.controller.view.opac_browser.contentWindow.IAMXUL = true;
+
+               if (window.xulG) obj.controller.view.opac_browser.contentWindow.xulG = xulG;
+       }
+       
+       'buildProgressListener' : function() {
+
+               netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+
+               var obj = this;
+               obj.progressListener = {
+                       onProgressChange        : function(){},
+                       onLocationChange        : function(){},
+                       onStatusChange          : function(){},
+                       onSecurityChange        : function(){},
+                       onStateChange           : function ( webProgress, request, stateFlags, status) {
+                               var s = '';
+                               const nsIWebProgressListener = Components.interfaces.nsIWebProgressListener;
+                               const nsIChannel = Components.interfaces.nsIChannel;
+                               if (stateFlags == 65540 || stateFlags == 65537 || stateFlags == 65552) { return; }
+                               s = ('onStateChange: stateFlags = ' + stateFlags + ' status = ' + status + '\n');
+                               if (stateFlags & nsIWebProgressListener.STATE_IS_REQUEST) {
+                                       s += ('\tSTATE_IS_REQUEST\n');
+                               }
+                               if (stateFlags & nsIWebProgressListener.STATE_IS_DOCUMENT) {
+                                       s += ('\tSTATE_IS_DOCUMENT\n');
+                                       if( stateFlags & nsIWebProgressListener.STATE_STOP ) obj.push_variables(); 
+                               }
+                               if (stateFlags & nsIWebProgressListener.STATE_IS_NETWORK) {
+                                       s += ('\tSTATE_IS_NETWORK\n');
+                               }
+                               if (stateFlags & nsIWebProgressListener.STATE_IS_WINDOW) {
+                                       s += ('\tSTATE_IS_WINDOW\n');
+                               }
+                               if (stateFlags & nsIWebProgressListener.STATE_START) {
+                                       s += ('\tSTATE_START\n');
+                               }
+                               if (stateFlags & nsIWebProgressListener.STATE_REDIRECTING) {
+                                       s += ('\tSTATE_REDIRECTING\n');
+                               }
+                               if (stateFlags & nsIWebProgressListener.STATE_TRANSFERING) {
+                                       s += ('\tSTATE_TRANSFERING\n');
+                               }
+                               if (stateFlags & nsIWebProgressListener.STATE_NEGOTIATING) {
+                                       s += ('\tSTATE_NEGOTIATING\n');
+                               }
+                               if (stateFlags & nsIWebProgressListener.STATE_STOP) {
+                                       s += ('\tSTATE_STOP\n');
+                               }
+                               obj.error.sdump('D_OPAC',s);    
+                       }
+               }
+               obj.progressListener.QueryInterface = function(){return this;};
+       },
+}
+
+dump('exiting cat.opac.js\n');
diff --git a/Open-ILS/xul/staff_client/server/cat/opac.xul b/Open-ILS/xul/staff_client/server/cat/opac.xul
new file mode 100644 (file)
index 0000000..e7f55f1
--- /dev/null
@@ -0,0 +1,71 @@
+<?xml version="1.0"?>
+<!-- Application: Evergreen Staff Client -->
+<!-- Screen: Patron Display -->
+
+<!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
+<!-- STYLESHEETS -->
+<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
+<?xml-stylesheet href="/xul/server/skin/evergreen.css" type="text/css"?>
+
+<!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
+<!-- LOCALIZATION -->
+<!DOCTYPE overlay SYSTEM "chrome://evergreen/locale/lang.dtd">
+
+<!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
+<!-- OVERLAYS -->
+<?xul-overlay href="/xul/server/OpenILS/util_overlay.xul"?>
+
+<window id="cat_opac_win" 
+       onload="my_init()"
+       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+
+       <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
+       <!-- BEHAVIOR -->
+        <script type="text/javascript">var myPackageDir = 'evergreen'; var IAMXUL = true; var g = {};</script>
+        <scripts id="openils_util_scripts"/>
+
+       <script type="text/javascript" src="/xul/server/main/JSAN.js"/>
+       <script>
+       <![CDATA[
+               function my_init() {
+                       try {
+                               netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+                               if (typeof JSAN == 'undefined') { throw( "The JSAN library object is missing."); }
+                               JSAN.errorLevel = "die"; // none, warn, or die
+                               JSAN.addRepository('/xul/server/');
+                               JSAN.use('util.error'); g.error = new util.error();
+                               g.error.sdump('D_TRACE','my_init() for cat_opac.xul');
+
+                               g.cgi = new CGI();
+
+                               var session = g.cgi.param('session');
+                               var url = g.cgi.param('url');
+                               if (!url) url = urls.opac;
+
+                               JSAN.use('cat.opac'); g.opac = new cat.opac();
+                               g.opac.init( 
+                                       { 
+                                               'url' : url,
+                                               'session' : session,
+                                       } 
+                               );
+       
+                       } catch(E) {
+                               var err_msg = "!! This software has encountered an error.  Please tell your friendly " +
+                                       "system administrator or software developer the following:\n" + E + '\n';
+                               try { g.error.sdump('D_ERROR',err_msg); } catch(E) { dump(err_msg); }
+                               alert(err_msg);
+                       }
+               }
+
+       ]]>
+       </script>
+
+       <commandset id="cat_opac_cmds">
+               <command id="cmd_broken" />
+       </commandset>
+
+       <browser id="opac_browser" />
+
+</window>
+