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

Modified Files:
      Tag: XQuery_0-24
        xrpc.html 
Log Message:
Get the server URL automatically from the URL of the current window,
this is because JavaScript does not think 127.0.0.1 and localhost are
the same, and thus refuse to send a request, of the POST URL of the
request does not match the URL of the current browser window/tab.



U xrpc.html
Index: xrpc.html
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/runtime/xrpc/export/xrpc.html,v
retrieving revision 1.4.6.1
retrieving revision 1.4.6.2
diff -u -d -r1.4.6.1 -r1.4.6.2
--- xrpc.html   28 May 2008 13:01:15 -0000      1.4.6.1
+++ xrpc.html   31 May 2008 21:26:50 -0000      1.4.6.2
@@ -24,6 +24,15 @@
          form.method.value,  form.arity.value, XRPC_CALL(params), 
showResponse);
   }
 
+  function fillDefaultValues() {
+    var obj = document.getElementById("postUrl");
+    obj.value = "http://"; + window.location.hostname + ":" + 
window.location.port + "/xrpc";
+    obj = document.getElementById("module");
+    obj.value = "xrpc-test-function";
+    obj = document.getElementById("moduleUrl");
+    obj.value =  "http://"; + window.location.hostname + ":" + 
window.location.port + "/export/xrpc-mod.xq";
+  }
+
   function showResponse(response)  {
     /* sorry, we only show the first item of the result sequence */
     document.form.result.value =  
serializeXML(getnodesXRPC(response,"sequence")[0].firstChild.firstChild); 
@@ -31,7 +40,7 @@
  </script>
 </head>
 
-<body>
+<body onload="fillDefaultValues()">
  <a href="http://monetdb.cwi.nl"; title="MonetDB is a high-performance 
open-source SQL and XQuery database system, developed by CWI" 
target="_blank"><img src="../admin/monetdb_med_abstract.png" border="0"/></a>
  <a href="http://www.cwi.nl"; title="CWI is the Dutch national center for 
Computer Science and Mathematics Research" target="_blank"><img 
src="../admin/cwi.bmp" border="0"/></a>
  <br clear="all"/>
@@ -48,13 +57,14 @@
  <form name="form">
   <table>
    <tr><td>postUrl</td>
-       <td colspan="2"><input name="postUrl" size="65" 
value="http://127.0.0.1:50001";></td> </tr>
-   <tr><td></td><td colspan="2"><i>your XRPC server </i></td></tr>
+       <td colspan="2"><input name="postUrl" id="postUrl" size="65"
+         value="" readonly="readonly"></td> </tr>
+   <tr><td></td><td colspan="2"><i>your local XRPC server </i></td></tr>
    <tr><td>module</td>
-       <td colspan="2"><input name="module" size="65" 
value="xrpc-test-function"></td></tr>
+       <td colspan="2"><input name="module" id="module" size="65" 
value=""></td></tr>
    <tr><td></td><td colspan="2"><i>module namespace (logical) URL. Must match 
XQuery module definition!</i></td></tr>
    <tr><td>moduleUrl</td>
-       <td colspan="2"><input name="moduleUrl" size="65" 
value="http://127.0.0.1:50001/export/xrpc-mod.xq";></td></tr>
+       <td colspan="2"><input name="moduleUrl" id="moduleUrl" size="65" 
value=""></td></tr>
    <tr><td></td><td colspan="2"><i>module (physical) at-hint URL. Module file 
must be here!</i></td></tr>
    <tr><td>method</td>
        <td colspan="2"><input name="method" size="65" value="add"></td></tr>


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins

Reply via email to