Update of /cvsroot/monetdb/pathfinder/runtime/xrpc/admin
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv25370/admin

Modified Files:
      Tag: xrpcdemo
        xrpcwebclient.js 
Log Message:
more work on display the query flow graph.  There is one (last?) problem
to solve: JS is not allowed to send HTTP request to a different domain,
hence, to GET the request/response message an arbitrary participating
peer has received/sent, we need to ask the local XRPC server to do this.



U xrpcwebclient.js
Index: xrpcwebclient.js
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/runtime/xrpc/admin/xrpcwebclient.js,v
retrieving revision 1.10.4.3
retrieving revision 1.10.4.4
diff -u -d -r1.10.4.3 -r1.10.4.4
--- xrpcwebclient.js    5 Jun 2008 12:54:21 -0000       1.10.4.3
+++ xrpcwebclient.js    8 Jun 2008 10:04:06 -0000       1.10.4.4
@@ -16,7 +16,7 @@
 function XRPC_PART(geturl,    /* Your XRPC server. Usually: 
"http://yourhost:yourport/xrpc"; */ 
               callback)   /* callback function to call with the XML response */
 {
-    clnt.sendReceivePart(geturl, callback);
+    clntPart.sendReceivePart(geturl, callback);
 }
 
 /**********************************************************************
@@ -139,17 +139,29 @@
     }
 }
 
+XRPCWebClientPart = function () {
+    if (window.XMLHttpRequest) {
+        this.xmlhttp = new XMLHttpRequest();
+    } else if (window.ActiveXObject) {
+        try {
+            this.xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
+        } catch(e) {
+            this.xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
+        }
+    }
+}
+
 XRPCWebClient.prototype.sendReceive = function(posturl, method, request, 
callback) {
     try {
-        this.xmlhttp.open("POST", posturl, true);
+       this.xmlhttp.open("POST", posturl, true);
         if (XRPCDEBUG) {
                //document.getElementById("messreq").value = request; 
                        messreqChanged(string2XML(request));
                }
                this.xmlhttp.send(request);
-
-        var app = this;
-        this.xmlhttp.onreadystatechange = function() {
+               var app = this;
+    
+       this.xmlhttp.onreadystatechange = function() {
             if (app.xmlhttp.readyState == 4 ) {
                 if (app.xmlhttp.status == 200 &&
                     app.xmlhttp.responseText.indexOf("!ERROR") < 0 && 
@@ -157,9 +169,8 @@
                 {
                                    if (XRPCDEBUG) {
                                        if (app.xmlhttp.responseText) {
-                                               
//document.getElementById("messres").value = 
serializeXML(app.xmlhttp.responseXML);
-                                               
callback(app.xmlhttp.responseXML);
-                                               
messresChanged(app.xmlhttp.responseXML);
+                                               
messresChanged(app.xmlhttp.responseXML? app.xmlhttp.responseXML: 
string2XML(app.xmlhttp.responseText));
+                                               
callback(app.xmlhttp.responseXML? app.xmlhttp.responseXML: 
string2XML(app.xmlhttp.responseText));
                                        }
                                    }
                 } else {
@@ -177,21 +188,23 @@
     }
 }
 
-XRPCWebClient.prototype.sendReceivePart = function(geturl, callback) {
+XRPCWebClientPart.prototype.sendReceivePart = function(geturl, callback) {
     try {
+       //alert("get " + geturl);
         this.xmlhttp.open("GET", geturl, true);
         this.xmlhttp.send("");
         var app = this;
-        this.xmlhttp.onreadystatechange = function() {
+    
+       this.xmlhttp.onreadystatechange = function() {
+               //alert("back");
             if (app.xmlhttp.readyState == 4 ) {
                 if (app.xmlhttp.status == 200 &&
                     app.xmlhttp.responseText.indexOf("!ERROR") < 0 && 
                     app.xmlhttp.responseText.indexOf("<env:Fault>") < 0) 
                 {
                                    if (XRPCDEBUG) {
-                                       if (app.xmlhttp.responseText) {
-                                               
callback(app.xmlhttp.responseXML);
-                                       }
+                                       if (app.xmlhttp.responseText)
+                                               
callback(app.xmlhttp.responseXML? app.xmlhttp.responseXML: 
string2XML(app.xmlhttp.responseText));
                                    }
                 } else {
                     var errmsg =


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins

Reply via email to