Update of /cvsroot/monetdb/pathfinder/runtime/xrpc/demo
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv31086/runtime/xrpc/demo
Added Files:
Makefile.ag MultimediaN.png cwi.bmp demo-mod.xq
demo-xrpcmod.xq index.html monet.png noquery.gif req1.xml
res1.xml style.css test.map
Log Message:
propagated changes of Sunday May 25 2008 - Thursday Jul 03 2008
from the xrpcdemo branch to the development trunk
or better:
applied differences between the current head of the XQuery_0-24 branch (tag
xrpcdemo_sync) and the current head of the xrpcdemo branch (tag
xrpcdemo_done) to the development trunk
--- NEW FILE: test.map ---
<map id="G" name="G">
<area shape="rect" href="http://host2:60001/logs/res_1.xml" title="5ms" alt=""
coords="133,229,141,237"/>
<area shape="rect" href="http://host2:60001/logs/req_1.xml" title="5ms" alt=""
coords="100,356,108,364"/>
<area shape="rect" href="http://host3:60001/logs/res_1.xml" title="7ms" alt=""
coords="153,229,161,237"/>
<area shape="rect" href="http://host3:60001/logs/req_1.xml" title="7ms" alt=""
coords="205,356,213,364"/>
<area shape="rect" href="http://host1:60001/logs/res_1.xml" title="9ms" alt=""
coords="140,53,148,61"/>
<area shape="rect" href="http://host1:60001/logs/req_1.xml" title="9ms" alt=""
coords="140,181,148,189"/>
<area shape="rect" href="http://host4:60001/logs/res_1.xml" title="3ms" alt=""
coords="95,404,103,412"/>
<area shape="rect" href="http://host4:60001/logs/req_1.xml" title="3ms" alt=""
coords="99,532,107,540"/>
<area shape="rect" href="http://host4:60001/logs/res_2.xml" title="2ms" alt=""
coords="213,404,221,412"/>
<area shape="rect" href="http://host4:60001/logs/req_2.xml" title="2ms" alt=""
coords="211,532,219,540"/>
</map>
--- NEW FILE: index.html ---
<!--
The contents of this file are subject to the Pathfinder Public License
Version 1.1 (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License at
http://monetdb.cwi.nl/Legal/PathfinderLicense-1.1.html
Software distributed under the License is distributed on an "AS IS"
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limitations
under the License.
The Original Code is the Pathfinder system.
The Original Code has initially been developed by the Database &
Information Systems Group at the University of Konstanz, Germany and
is now maintained by the Database Systems Group at the Technische
Universitaet Muenchen, Germany. Portions created by the University of
Konstanz and the Technische Universitaet Muenchen are Copyright (C)
2000-2005 University of Konstanz and (C) 2005-2008 Technische
Universitaet Muenchen, respectively. All Rights Reserved.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="nl">
<head>
<title>SIGMOD 2008 - XRPC Demo</title>
<script type="text/javascript" src="../admin/xrpcwebclient.js"></script>
<script type="text/javascript">
var clnt = new XRPCWebClient();
var clntPart = new XRPCWebClientPart();
function funcdef(n, u, a, q, d) {
this.name = n;
this.arr = a;
this.upd = u;
this.quantarr = q;
this.def = d;
this.getName = function() {
return this.name;
}
this.getArrSize = function() {
return this.arr.length;
}
this.getArr = function(i) {
return this.arr[i];
}
this.getQArr = function(i) {
return this.quantarr[i];
}
this.getArrDisplay = function(i) {
if (this.arr[i] == "string") return "xs:string";
if (this.arr[i] == "integer") return "xs:integer";
return this.arr[i];
}
this.getDef = function() {
return this.def;
}
this.getUpdating = function() {
return this.upd;
}
}
var funcdefs = new Array();
funcdefs[funcdefs.length]=new funcdef("getPerson", false,
new Array("string", "string"), new Array("", ""),
"declare function dfx:getPerson( \n" +
" $doc as xs:string, \n" +
" $pid as xs:string) as node() \n" +
"{ \n" +
" for $p in doc($doc)//person[./@id = $pid] \n" +
" return \n" +
" element person { \n" +
" attribute id {$p/@id}, \n" +
" $p/name } \n" +
"}; \n");
funcdefs[funcdefs.length]=new funcdef("auctionsAllPerson", false,
new Array("string", "string"), new Array("", ""),
"declare function dfx:auctionsAllPerson( \n" +
" $dst as xs:string, \n" +
" $doc as xs:string) as node()* \n" +
"{ \n" +
" for $pid in doc($doc)//person/@id \n"+
" return \n" +
" execute at {$dst} {f2:auctionsByPerson($doc, $pid)} \n"+
"};");
funcdefs[funcdefs.length]=new funcdef("nestedRPC", false,
new Array("string", "string", "string", "string"),
new Array("", "", "", ""),
"declare function dfx:nestedRPC( \n" +
" $dst1 as xs:string, \n" +
" $dst2 as xs:string, \n" +
" $dst3 as xs:string, \n" +
" $doc as xs:string) as node()* \n" +
"{ \n" +
" (execute at {$dst1} {dfx:auctionsAllPerson($dst3, $doc)}, \n" +
" execute at {$dst2} {dfx:auctionsAllPerson($dst3, $doc)}) \n" +
"}; ");
funcdefs[funcdefs.length]=new funcdef("insertPerson", true,
new Array("string", "node()"), new Array("", ""),
"declare updating function dfx:insertPerson( \n" +
" $doc as xs:string, $p as node())\n" +
"{ do insert $p into doc($doc)//people };");
funcdefs[funcdefs.length]=new funcdef("insertPersonNested", true,
new Array("string", "string", "node()"), new Array("+", "", ""),
"declare updating function dfx:insertPersonNested( \n" +
" $dsts as xs:string+, \n" +
" $doc as xs:string, \n" +
" $p as node()) \n" +
"{ \n" +
" (do insert $p into doc($doc)//people, \n" +
" for $dst in $dsts return \n" +
" execute at {$dst} {dfx:insertPerson($doc, $p)}) \n" +
"};");
funcdefs[funcdefs.length]=new funcdef("deletePerson", true,
new Array("string", "string"), new Array("", ""),
"declare updating function f:deletePerson( \n" +
" $pid as xs:string, $doc as xs:string) \n" +
"{ do delete doc($doc)//person[./@pid=$pid] };");
funcdefs[funcdefs.length]=new funcdef("deletePersonNested", true,
new Array("string", "string", "string"), new Array("+", "", ""),
"declare updating function dfx:deletePersonNested( \n" +
" $dsts as xs:string+, \n" +
" $doc as xs:string, \n" +
" $pid as xs:string) \n" +
"{ \n" +
" (do delete doc($doc)//person[./@id=$pid], \n" +
" for $dst in $dsts return \n" +
" execute at {$dst} {dfx:deletePerson($doc, $pid)}) \n" +
"};");
funcdefs[funcdefs.length]=new funcdef("repeatable", false,
new Array("string"), new Array(""),
"declare function dfx:repeatable($dst as xs:string) as node()* \n" +
"{ \n" +
" let $d1 := execute at {$dst} {dfx:getdoc('hello.xml')}, \n" +
" $slow := (for $i in 1 to 1000 \n" +
" return count(doc('xmark1.xml')//*)),
\n" +
" $d2 := execute at {$dst} {dfx:getdoc('hello.xml')} \n" +
" return ($d1/hello, $d2/hello) \n" +
"};");
funcdefs[funcdefs.length]=new funcdef("custom...", false,
new Array("integer", "integer", "integer", "integer"),
new Array("", "", "", ""), "");
var par_types = new Array("integer", "string", "node()");
var par_types_display = new Array("xs:integer", "xs:string", "node()");
var quant_types = new Array("", "?", "+", "*");
var example_nodes = new Array(
"<person id=\"new1\"><name>X</name><\/person>");
function fillPostUrlBox() {
var obj = document.getElementById("postUrl");
obj.value = "http://" + window.location.hostname + ":" + window.location.port
+ "/xrpc";
}
function fillLocationBox() {
var obj = document.getElementById("loc");
obj.value = "http://" + window.location.hostname + ":" +
window.location.port + "/demo/demo-xrpcmod.xq";
}
function fillMethodBox() {
var obj = document.getElementById("method");
obj.options.length = 0;
for (var j = 0; j < funcdefs.length; j++) {
var temp = new Option(funcdefs[j].getName(),
funcdefs[j].getName());
obj.options[obj.options.length] = temp;
}
obj.selectedIndex = 0;
}
function getParam(tpe, quant, val) {
if (quant == "")
return XRPC_SEQ((tpe == "node()")?XRPC_ELEMENT(val):XRPC_ATOM(tpe,val));
else {
var l = val.length;
var sval = val.substring(1, l - 1);
var vals = sval.split(",");
var seq = "";
for (var i = 0; i < vals.length; i++) {
vals[i] = vals[i].split(" ").join(""); // this removes
whitespace
seq += (tpe ==
"node()")?XRPC_ELEMENT(vals[i]):XRPC_ATOM(tpe,vals[i]);
}
return XRPC_SEQ(seq);
}
}
function sendRequest(form) {
var obj = document.getElementById("messreq");
obj.value = "";
var obj = document.getElementById("messres");
obj.value = "";
var params = "";
var xrpc_call = "";
if (form.method.selectedIndex < 0) {
for (var l = 0; l < form.loop.value; l++) {
params = "";
for (var i = 1; i <= form.arity.value; i++) {
var value = parseInt(document.getElementById("param" +
i).value) + l;
params += getParam(document.getElementById("type" +
i).value, document.getElementById("quant" + i).value, value + '');
}
xrpc_call += XRPC_CALL(params);
}
} else {
for (var l = 0; l < form.loop.value; l++) {
params = "";
for (var i = 1; i <= form.arity.value; i++) {
params += getParam(document.getElementById("type" +
i).value, document.getElementById("quant" + i).value,
document.getElementById("param" + i).value);
}
xrpc_call += XRPC_CALL(params);
}
}
var mode = form.isolevel.value + form.mode.value +
(XRPCDEBUG?"-trace":"");
XRPC(form.postUrl.value, form.ns.value, form.loc.value,
form.method.value, form.arity.value, form.updating.checked, xrpc_call,
showResponse, form.timeout.value, mode);
}
function sendRequestPart(obj) {
var url = obj.alt;
var req = true;
if (url.indexOf("res") != -1) req = false;
var params = getParam('string', '', url);
var xrpc_call = XRPC_CALL(params);
XRPC(form.postUrl.value, form.ns.value, form.loc.value,
'getdoc', '1', false, xrpc_call, req? messreqChangedWrapper:
messresChangedWrapper, 0, 'none');
}
function messreqChangedWrapper(xmldoc) {
/* we now have two env:Envelope in the response message of 'getdoc' */
var reqnode = xmldoc.getElementsByTagName("Envelope")[1];
messreqChanged(reqnode);
}
function messresChangedWrapper(xmldoc) {
var resnode = xmldoc.getElementsByTagName("Envelope")[1];
messresChanged(resnode);
}
function sendRequestMap(url) {
XRPC_PART(url, mapChanged);
/*
var xrpc_call = XRPC_CALL(getParam('string', '', url));
XRPC(form.postUrl.value, form.ns.value, form.loc.value,
'getdoc', '1', false, xrpc_call, mapChanged, 0, 'none');
*/
}
function mapChanged(xmldoc) {
var mapobj = document.getElementById("treemap");
mapobj.innerHTML = "";
var areas = xmldoc.getElementsByTagName('area');
for (var i = 0; i < areas.length; i++) {
var thisnode = areas[i];
var newnode = document.createElement("area");
newnode.setAttribute("shape", areas[i].getAttribute("shape"));
newnode.setAttribute("coords", areas[i].getAttribute("coords"));
newnode.setAttribute("title", areas[i].getAttribute("title"));
if(areas[i].getAttribute("href") != null) {
newnode.setAttribute("alt", areas[i].getAttribute("href"));
newnode.setAttribute("onclick", "sendRequestPart(this)");
newnode.setAttribute("href", "#");
}
mapobj.appendChild(newnode);
}
}
function showResponse(xmldoc) {
var participantNodes = xmldoc.getElementsByTagName("participant");
var participantNode = null;
if (participantNodes.length > 0)
participantNode = participantNodes[0];
if (participantNode == null) {
participantNode = document.createElement("participant");
var tnode =
document.createTextNode("query,127.0.0.1:50001,1,fcn,time");
participantNode.appendChild( tnode );
}
var value = participantNode.firstChild.nodeValue;
var sepValues = value.split(",");
sepValues = sepValues[1].split(":");
var newSrcLocation = "http://" + sepValues[0] + ":" + sepValues[1] +
"/logs/qflow_" + sepValues[2];
var imgobj = document.getElementById("treeimg");
imgobj.src = newSrcLocation + ".gif";
//sendRequestMap(newSrcLocation + ".xml")
var newMapLocation = "http://" + window.location.hostname + ":"
+ window.location.port + "/logs/qflow_" + sepValues[2];
sendRequestMap(newMapLocation + ".xml")
}
function methodChanged(object) {
var val = object.value;
var idx = object.selectedIndex;
var params = funcdefs[idx].getArrSize();
var def = funcdefs[idx].getDef();
var defobj = document.getElementById("def");
defobj.value = def;
var obj = document.getElementById("arity");
obj.value = params;
var par = document.getElementById("params");
var html = "<table cellpadding=\"0\" cellspacing=\"0\">";
var last = (idx == funcdefs.length - 1);
for (var i = 0; i < params; i++) {
html += "<tr><td>";
html += "<select name=\"type" + (i+1) + "\" id=\"type" + (i+1)
+ "\">";
if (!last) {
html += "<option value=\"" + funcdefs[idx].getArr(i) +
"\">" + funcdefs[idx].getArrDisplay(i) + "<\/option>";
} else {
for (var j = 0; j < par_types.length; j++) {
var s = funcdefs[idx].getArr(i) == par_types[j];
var sel = s? " selected=\"selected\"": "";
html += "<option value=\"" + par_types[j] +
"\""+ sel + ">" + par_types_display[j] + "<\/option>";
}
}
html += "<\/select>";
html += "<\/td><td> ";
html += "<select name=\"quant" + (i+1) + "\" id=\"quant" +
(i+1) + "\">";
if (!last) {
html += "<option value=\"" + funcdefs[idx].getQArr(i) +
"\">" + funcdefs[idx].getQArr(i) + " <\/option>";
} else {
for (var j = 0; j < quant_types.length; j++) {
var s = funcdefs[idx].getQArr(i) ==
quant_types[j];
var sel = s? " selected=\"selected\"": "";
html += "<option value=\"" + quant_types[j] +
"\""+ sel + ">" + quant_types[j] + " <\/option>";
}
}
html += "<\/select>";
html += "<\/td><td> ";
var default_val = "";
if(val == "getPerson") {
default_val = (i==0) ? "xmark1.xml" : "person10";
} else if(val == "auctionsAllPerson") {
default_val = (i==0) ? "192.168.0.1:50001" : "xmark1.xml";
} else if (val == "nestedRPC") {
if(i == 0)
default_val = "localhost:50001";
else if(i == 1)
default_val = "localhost:60001";
else if(i == 2)
default_val = "localhost:60005";
else
default_val = "file:///home/jennie/xmark1.xml";
} else if (val == "insertPerson") {
default_val = (i==0) ? "xmark1.xml" : '<person
id=\"new1\"><name>Ronald</name></person>';
} else if (val == "insertPersonNested") {
if(i == 0)
default_val = "(jarl.ins.cwi.nl:50001, 192.168.0.1:50001)";
else if (i== 1)
default_val = "xmark1.xml";
else
default_val = '<person id=\"new1\"><name>Ronald</name></person>';
} else if (val == "deletePerson") {
default_val = (i==0) ? "xmark1.xml" : "new1";
} else if (val == "deletePersonNested") {
if(i == 0)
default_val = "(jarl.ins.cwi.nl:50001, 192.168.0.1:50001)";
else if (i== 1)
default_val = "xmark1.xml";
else
default_val = "new1";
} else if(val == "repeatable") {
default_val = "192.168.0.1:50001";
}
html += "<input type=\"text\" name=\"param" + (i+1) + "\"
id=\"param" + (i+1) + '\" value=\'' + default_val + '\' />';
html += "<\/td><\/tr>";
}
html += "<\/table>";
par.innerHTML = html;
defobj.readOnly = !last;
var updobj = document.getElementById("updating");
updobj.checked = funcdefs[idx].getUpdating();
}
function clickreq(vis) {
var objv = document.getElementById("reqvis");
var objr = document.getElementById("reqraw");
objv.style.display = vis?"block":"none";
objr.style.display = vis?"none":"block";
}
function clickres(vis) {
var objv = document.getElementById("resvis");
var objr = document.getElementById("resraw");
objv.style.display = vis?"block":"none";
objr.style.display = vis?"none":"block";
}
function isolevelChanged(object) {
var lev = object.value;
var obj = document.getElementById("timeout");
if (lev == "none") {
obj.value = "0";
obj.readOnly = true;
} else {
obj.value = "100";
obj.readOnly = false;
}
}
function escapeForHTML(s) {
return
s.split("&").join("&").split("<").join("<").split(">").join(">")
}
function messreqChanged(xmldoc) {
document.getElementById("messreq").value = serializeXML(xmldoc);
var obj = document.getElementById("reqvis");
obj.innerHTML = "changed";
var qidN = xmldoc.getElementsByTagName("Identifier");
var qid = "None";
if(qidN.length == 1) {
qid = qidN[0].firstChild.nodeValue;
}
var reqnode = xmldoc.getElementsByTagName("request")[0];
var funcn = reqnode.getAttribute("xrpc:method");
var ns = reqnode.getAttribute("xrpc:module");
var loc = reqnode.getAttribute("xrpc:location");
var htm =
'<table>' +
'<tr><td>QID<\/td><td>' + qid + '<\/td><\/tr>' +
'<tr><td>Function<\/td><td>' + funcn + '<\/td><\/tr>' +
'<tr><td>NS<\/td><td>' + ns + '<\/td><\/tr>' +
'<tr><td>Loc<\/td><td>' + loc + '<\/td><\/tr>' +
'<\/table><table><tr><td>iter<\/td><td>param<\/td><\/tr>';
var callnodes = xmldoc.getElementsByTagName("call");
for (var i = 0; i < callnodes.length; i++) {
var seqnodes = callnodes[i].childNodes;
var sval = '';
for (var k = 0; k < seqnodes.length; k++) {
var atvals = seqnodes[k].childNodes;
if (k > 0) sval += ', ';
sval += '( ';
for (var j = 0; j < atvals.length; j++) {
if (j > 0) sval += ', ';
var tval = atvals[j].firstChild.nodeValue;
if (tval == null) tval =
escapeForHTML(serializeXML(atvals[j].firstChild));
sval += tval + ' ';
}
sval += ') ';
}
htm += '<tr><td>' + (i+1) + '<\/td><td>' + sval +
'<\/td><\/tr>';
}
htm += '<\/table>';
obj.innerHTML = htm;
}
function messresChanged(xmldoc) {
document.getElementById("messres").value = serializeXML(xmldoc);
var obj = document.getElementById("resvis");
obj.innerHTML = "changed";
var qid = 'None';
try {qid =
xmldoc.getElementsByTagName("Identifier")[0].firstChild.nodeValue;} catch(err)
{}
var resnode = xmldoc.getElementsByTagName("response")[0];
var funcn = resnode.getAttribute("xrpc:method");
var ns = resnode.getAttribute("xrpc:module");
var htm =
'<table>' +
'<tr><td>QID<\/td><td>' + qid + '<\/td><\/tr>' +
'<tr><td>Function<\/td><td>' + funcn + '<\/td><\/tr>' +
'<tr><td>NS<\/td><td>' + ns + '<\/td><\/tr>' +
'<tr><td> <\/td><td><\/td><\/tr>' +
'<\/table><table><tr><td>iter<\/td><td>result<\/td><\/tr>';
var seqnodes = resnode.getElementsByTagName("sequence");
for (var k = 0; k < seqnodes.length; k++) {
var atvals = seqnodes[k].childNodes;
var sval = '( ';
for (var j = 0; j < atvals.length; j++) {
if (j > 0) sval += ', ';
var tval = atvals[j].firstChild.nodeValue;
if (tval == null) tval =
escapeForHTML(serializeXML(atvals[j].firstChild));
sval += tval + ' ';
}
sval += ') ';
htm += '<tr><td>' + (k+1) + '<\/td><td>' + sval +
'<\/td><\/tr>';
}
htm += '<\/table>';
obj.innerHTML = htm;
}
function init() {
XRPCDEBUG = true;
fillPostUrlBox();
fillLocationBox();
fillMethodBox();
clickreq(true);
clickres(true);
methodChanged(document.getElementById("method"));
}
</script>
<link rel="stylesheet" href="style.css" type="text/css" />
</head>
<body onload="init()" id="thebody">
<table id="header">
<tr>
<td>
<a href="http://www.multimedian.nl" title="MultimediaN"
target="_blank"><img src="MultimediaN.png" border="0" /></a>
</td>
<td>
<h1>XRPC - Interoperable and Efficient distributed XQuery</h1>
</td>
<td>
<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="monet.png" border="0" /></a>
</td>
<td>
<a href="http://www.cwi.nl" title="CWI is the Dutch national center for
Computer Science and Mathematics Research" target="_blank"><img src="cwi.bmp"
border="0" /></a>
</td>
</tr>
</table>
<form name="form" action="actionaddress">
<input type="hidden" name="arity" id="arity" />
<table id="all" cellpadding="0" cellspacing="0">
<tr><td>
<table id="content">
<tr>
<td><label for="postUrl">XRPC server URL</label></td>
<td><input type="text" name="postUrl" id="postUrl" value=""
size="40" readonly="readonly" /></td>
</tr>
<tr>
<td><label for="ns">Module namespace</label></td>
<td><input type="text" name="ns" value="demo-functions-xrpc"
size="40" /></td>
</tr>
<tr>
<td><label for="loc">Module location</label></td>
<td><input type="text" name="loc" id="loc" value="" size="40"
/></td>
</tr>
<tr>
<td><label for="method">Function</label></td>
<td>
<select name="method" id="method"
onchange="methodChanged(this);">
</select>
</td>
</tr>
<tr>
<td colspan="2"><textarea cols="65" rows="20" name="def"
id="def" readonly="readonly"></textarea></td>
</tr>
<tr>
<td><label for="loop">Loop counter</label></td>
<td>
<input type="text" name="loop" id="loop" value="1"
size="6" />
Mode <select name="mode" id="mode">
<option value="">all-at-once</option>
<option
value="-iterative">one-at-a-time</option>
</select>
</td>
</tr>
<tr style="height:100px">
<td>Parameters</td>
<td id="params">
</td>
</tr>
<tr>
<td><label for="updating">Updating Function</label></td>
<td><input type="checkbox" name="updating" id="updating" /></td>
</tr>
<tr>
<td><label for="isolevel">Isolation Level</label></td>
<td>
<select name="isolevel" id="isolevel"
onchange="isolevelChanged(this);">
<option value="none">None</option>
<option value="repeatable">Repeatable</option>
</select>
Timeout <input type="text" value="0" name="timeout"
id="timeout" readonly="readonly" size="10" />
</td>
</tr>
<tr>
<td></td>
<td><input type="button" value="Submit"
onclick="sendRequest(this.form)" /></td>
</tr>
</table>
</td>
<td>
<div id="graph">
<map name="treemap" id="treemap">
<area shape="rect" onclick="sendRequestPart(this)"
href="#" title="5ms" alt="http://127.0.0.1:50001/demo/res1.xml"
coords="133,229,141,237"/>
<area shape="rect" onclick="sendRequestPart(this)"
href="#" title="5ms" alt="http://127.0.0.1:50001/demo/req1.xml"
coords="100,356,108,364"/>
<area shape="rect" onclick="sendRequestPart(this)"
href="#" title="7ms" alt="http://127.0.0.1:50001/demo/res1.xml"
coords="153,229,161,237"/>
<area shape="rect" onclick="sendRequestPart(this)"
href="#" title="7ms" alt="http://127.0.0.1:50001/demo/req1.xml"
coords="205,356,213,364"/>
<area shape="rect" onclick="sendRequestPart(this)"
href="#" title="9ms" alt="http://127.0.0.1:50001/demo/res1.xml"
coords="140,53,148,61"/>
<area shape="rect" onclick="sendRequestPart(this)"
href="#" title="9ms" alt="http://127.0.0.1:50001/demo/req1.xml"
coords="140,181,148,189"/>
<area shape="rect" onclick="sendRequestPart(this)"
href="#" title="3ms" alt="http://127.0.0.1:50001/demo/res1.xml"
coords="95,404,103,412"/>
<area shape="rect" onclick="sendRequestPart(this)"
href="#" title="3ms" alt="http://127.0.0.1:50001/demo/req1.xml"
coords="99,532,107,540"/>
<area shape="rect" onclick="sendRequestPart(this)"
href="#" title="2ms" alt="http://127.0.0.1:50001/demo/res1.xml"
coords="213,404,221,412"/>
<area shape="rect" onclick="sendRequestPart(this)"
href="#" title="2ms" alt="http://127.0.0.1:50001/demo/req1.xml"
coords="211,532,219,540"/>
</map>
<table id="graphtable">
<tr>
<td>Query Flow:<br/><br/>
<img id="treeimg" src="noquery.gif" usemap="#treemap" border="0"
alt="messageflow"/></td>
</tr>
</table>
</div>
</td>
<td>
<div id="messages">
<table id="request">
<tr class="myheader">
<td>REQUEST</td>
<td class="tab"><a href="#"
onclick="clickreq(true)">VISUAL</a></td>
<td class="tab"><a href="#"
onclick="clickreq(false)">RAW</a></td>
</tr>
<tr>
<td colspan="3">
<div id="reqraw">
<textarea cols="48" rows="15"
name="messreq" id="messreq" readonly="readonly"></textarea>
</div>
<div id="reqvis">
No message
</div>
</td>
</tr>
</table>
<table id="response">
<tr class="myheader">
<td>RESPONSE</td>
<td class="tab"><a href="#"
onclick="clickres(true)">VISUAL</a></td>
<td class="tab"><a href="#"
onclick="clickres(false)">RAW</a></td>
</tr>
<tr>
<td colspan="3">
<div id="resraw">
<textarea cols="48" rows="15"
name="messres" id="messres" readonly="readonly"></textarea>
</div>
<div id="resvis">
No message
</div>
</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</form>
</body>
</html>
--- NEW FILE: MultimediaN.png ---
(This appears to be a binary file; contents omitted.)
--- NEW FILE: demo-xrpcmod.xq ---
module namespace dfx="demo-functions-xrpc";
import module namespace f2 = "demo-functions"
at "http://localhost:50001/demo/demo-mod.xq";
declare function dfx:getPerson(
$doc as xs:string,
$pid as xs:string) as node()*
{
for $p in doc($doc)//person[./@id = $pid]
return
element person {
attribute id {$p/@id},
$p/name }
};
declare function dfx:auctionsAllPerson(
$dst as xs:string,
$doc as xs:string) as node()*
{
for $pid in subsequence(doc($doc)//person/@id,0,5)
return
execute at {$dst} {f2:auctionsByPerson($doc, 'person10')}
};
declare function dfx:nestedRPC(
$dst1 as xs:string,
$dst2 as xs:string,
$dst3 as xs:string,
$doc as xs:string) as node()*
{
(execute at {$dst1} {dfx:auctionsAllPerson($dst3, $doc)},
execute at {$dst2} {dfx:auctionsAllPerson($dst3, $doc)})
};
declare updating function dfx:insertPerson(
$doc as xs:string,
$p as node())
{
do insert $p into doc($doc)//people
};
declare updating function dfx:insertPersonNested(
$dsts as xs:string+,
$doc as xs:string,
$p as node())
{
(do insert $p into doc($doc)//people,
for $dst in $dsts return
execute at {$dst} {dfx:insertPerson($doc, $p)})
};
declare updating function dfx:deletePerson(
$doc as xs:string,
$pid as xs:string)
{
do delete doc($doc)//person[./@id=$pid]
};
declare updating function dfx:deletePersonNested(
$dsts as xs:string+,
$doc as xs:string,
$pid as xs:string)
{
(do delete doc($doc)//person[./@id=$pid],
for $dst in $dsts return
execute at {$dst} {dfx:deletePerson($doc, $pid)})
};
declare function dfx:repeatable($dst as xs:string) as node()*
{
let $d1 := execute at {$dst} {dfx:getdoc("hello.xml")},
$slow := count(for $i in 1 to 10 return element bla
{doc("xmark2.xml")}),
$d2 := execute at {$dst} {dfx:getdoc("hello.xml")}
return ($d1//hello, $d2//hello, <slow>{$slow}</slow>)
};
declare function dfx:getdoc($url as xs:string) as document-node()?
{ doc($url) };
--- NEW FILE: req1.xml ---
<?xml version="1.0" encoding="utf-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"
xmlns:xrpc="http://monetdb.cwi.nl/XQuery"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://monetdb.cwi.nl/XQuery
http://monetdb.cwi.nl/XQuery/XRPC.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema"><env:Header>
<wscoor:CoordinationContext
xmlns:wscoor="http://docs.oasis-open.org/ws-tx/wscoor/2006/06"
env:mustUnderstand="true">
<wscoor:Identifier>localhost:50001|663|453</wscoor:Identifier>
<wscoor:Expires>0</wscoor:Expires>
<wscoor:CoordinationType>http://docs.oasis-open.org/ws-tx/wsat/2006/06</wscoor:CoordinationType>
</wscoor:CoordinationContext></env:Header><env:Body><xrpc:request
xrpc:module="xrpcdemo-functions"
xrpc:location="http://localhost:50001/demo/demo-mod.xq" xrpc:method="add"
xrpc:mode="none-trace"
xrpc:arity="2"><xrpc:call><xrpc:sequence><xrpc:atomic-value
xsi:type="xs:integer">1</xrpc:atomic-value></xrpc:sequence><xrpc:sequence><xrpc:atomic-value
xsi:type="
xs:integer">2</xrpc:atomic-value></xrpc:sequence></xrpc:call></xrpc:request></env:Body></env:Envelope>
--- NEW FILE: noquery.gif ---
(This appears to be a binary file; contents omitted.)
--- NEW FILE: monet.png ---
(This appears to be a binary file; contents omitted.)
--- NEW FILE: demo-mod.xq ---
module namespace df="demo-functions";
declare function df:auctionsByPerson(
$doc as xs:string,
$pid as xs:string) as node()*
{
for $ca in doc($doc)//closed_auction[./buyer/@person=$pid]
return
element closed_auction {
attribute buyer {$ca/buyer/@person},
$ca/price
}
};
--- NEW FILE: style.css ---
body {
background: orange;
font-family: arial, verdana;
}
#header {
background: white;
padding-left: 30px;
padding-right:30px;
border: 1px solid black;
border-bottom: 4px solid black;
border-right: 4px solid black;
width:100%;
height:100px;
}
table td h1 {
font-size: 20pt;
text-align: center;
}
#all {
width: 100%;
}
#all tr {
vertical-align: top;
}
#content {
background: white;
margin-top:20px;
padding: 10px;
border: 1px solid black;
border-bottom: 4px solid black;
border-right: 4px solid black;
height: 646px;
}
#answers {
background: white;
margin-top:20px;
padding: 10px;
border: 1px solid black;
border-bottom: 4px solid black;
border-right: 4px solid black;
}
#request, #response, #graph {
background: white;
margin-top:20px;
padding: 10px;
border: 1px solid black;
border-bottom: 4px solid black;
border-right: 4px solid black;
width: 410px;
height: 326px;
}
#graph {
width: 430px;
height: 670px;
margin-right: 5px;
overflow:auto;
padding: 0px;
}
#request tr.myheader, #response tr.myheader, #answers tr.myheader, #graph
tr.myheader {
font-size: 0.7em;
font-weight: bold;
background-color: black;
color: white;
height: 0.7em;
}
#request td.tab, #response td.tab {
width: 75px;
text-align: center;
}
#request tr.myheader td a, #response tr.myheader td a {
color: orange;
}
#request td table, #response td table {
border: 1px solid black;
width: 100%;
font-size: 0.9em;
}
#reqvis, #reqraw, #resvis, #resraw {
overflow:auto;
height: 260px;
}
#content tr {
vertical-align:top;
}
.myinput {
margin-bottom: 4px;
}
--- NEW FILE: Makefile.ag ---
# Copyright Notice:
# -----------------
#
# The contents of this file are subject to the Pathfinder Public License
# Version 1.1 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License at
# http://monetdb.cwi.nl/Legal/PathfinderLicense-1.1.html
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
# the License for the specific language governing rights and limitations
# under the License.
#
# The Original Code is the Pathfinder system.
#
# The Original Code has initially been developed by the Database &
# Information Systems Group at the University of Konstanz, Germany and
# is now maintained by the Database Systems Group at the Technische
# Universitaet Muenchen, Germany. Portions created by the University of
# Konstanz and the Technische Universitaet Muenchen are Copyright (C)
# 2000-2005 University of Konstanz and (C) 2005-2008 Technische
# Universitaet Muenchen, respectively. All Rights Reserved.
#
headers_html = {
HEADERS = html js css xml
DIR = datadir/MonetDB/xrpc/demo
SOURCES = \
style.css \
res1.xml \
req1.xml \
index.html
}
headers_xq = {
HEADERS = xq
DIR = datadir/MonetDB/xrpc/demo
SOURCES = demo-mod.xq demo-xrpcmod.xq
}
headers_img = {
HEADERS = bmp gif png gif map
DIR = datadir/MonetDB/xrpc/demo
SOURCES = \
cwi.bmp \
MultimediaN.png \
monet.png \
noquery.gif
}
--- NEW FILE: res1.xml ---
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"
xmlns:xrpc="http://monetdb.cwi.nl/XQuery"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://monetdb.cwi.nl/XQuery
http://monetdb.cwi.nl/XQuery/XRPC.xsd"><env:Body><xrpc:response
xrpc:module="xrpcdemo-functions"
xrpc:method="add"><xrpc:sequence><xrpc:atomic-value
xsi:type="xs:integer">3</xrpc:atomic-value></xrpc:sequence></xrpc:response></env:Body></env:Envelope>
--- NEW FILE: cwi.bmp ---
(This appears to be a binary file; contents omitted.)
-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins