Update of /cvsroot/monetdb/pathfinder/runtime/xrpc/demo
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv5663/demo
Added Files:
Tag: xrpcdemo
Makefile.ag MultimediaN.png cwi.bmp demo-mod.xq index.html
monet.png style.css tree.gif
Log Message:
XRPC demo GUI (in progress)
--- 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();
function getParam(tpe, val) {
return XRPC_SEQ((tpe == "element")?XRPC_ELEMENT(val):XRPC_ATOM(tpe,val));
}
function sendRequest(form) {
var params = "";
/* XRPCDEBUG makes you get an alert for each SOAP message sent/received */
XRPCDEBUG = form.debug.checked;
if (form.arity.value >= 1)
params = params + getParam(form.type1.value, form.param1.value);
if (form.arity.value >= 2)
params = params + getParam(form.type2.value, form.param2.value);
if (form.arity.value >= 3)
params = params + getParam(form.type3.value, form.param3.value);
XRPC(form.postUrl.value+"/xrpc", form.module.value, form.moduleUrl.value,
form.method.value, form.arity.value, XRPC_CALL(params), showResponse);
}
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);
}
function methodChanged(object) {
var val = object.value;
var params = 1;
var def = "";
if (val == "add") { params = 2; def = "add bla bla bla.."; }
if (val == "mul") { params = 2; def = "mul bla bla bla.."; }
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\">";
for (var i = 0; i < params; i++) {
html += "<tr><td>";
html += "<input type=\"text\" name=\"partype" + i + "\"
value=\"" + "integer" + "\" readonly=\"readonly\" />";
html += "<\/td><td>";
html += "<input type=\"text\" name=\"parval" + i + "\"
value=\"" + (i+1) + "\" />";
html += "<\/td><\/tr>";
}
html += "<\/table>";
par.innerHTML = html;
}
function debugChanged(object) {
var debug = object.checked;
var objl = document.getElementById("content");
var objr = document.getElementById("messages");
if (debug) {
objr.style.display = "block";
} else {
objr.style.display = "none";
}
}
</script>
<link rel="stylesheet" href="style.css" type="text/css" />
</head>
<body>
<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" width="150" height="80"/></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="dest">XRPC server URL</label></td>
<td><input type="text" name="dest" value="localhost" size="40"
/></td>
<td></td>
<td></td>
</tr>
<tr>
<td><label for="ns">Module namespace</label></td>
<td><input type="text" name="ns" value="" size="40" /></td>
<td></td>
<td></td>
</tr>
<tr>
<td><label for="loc">Module location</label></td>
<td><input type="text" name="loc" value="" size="40" /></td>
<td></td>
<td></td>
</tr>
<tr>
<td><label for="method">Function</label></td>
<td>
<select name="method" id="method"
onchange="methodChanged(this);">
<option value="add">Add</option>
<option value="mul">Multiply</option>
<option value="concat">Concatenate</option>
</select>
</td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td><textarea cols="40" rows="3" name="def" id="def"
readonly="readonly"></textarea></td>
<td></td>
<td></td>
</tr>
<tr>
<td>Parameters</td>
<td id="params">
</td>
<td></td>
<td></td>
</tr>
<tr>
<td><label for="debug">Show query flow</label></td>
<td><input type="checkbox" name="debug" id="debug"
checked="checked" onchange="debugChanged(this)" /></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td><input type="button" value="Submit"
onclick="sendRequest(this.form)" /></td>
<td></td>
<td></td>
</tr>
</table>
<table id="answers">
<tr>
<td>ANSWER<br /><textarea cols="59" rows="3" name="answer"
readonly="readonly"></textarea></td>
</tr>
</table>
</td>
<td>
<div id="graph" style="margin-right:10px;">
<table id="graphtable">
<tr>
<td>GRAPH<br /><img src="img/tree.gif" /></td>
</tr>
</table>
</div>
</td>
<td>
<div id="messages">
<table id="request">
<tr>
<td>REQUEST<br /><textarea cols="40" rows="8"
name="messreq" readonly="readonly"></textarea></td>
</tr>
</table>
<table id="response">
<tr>
<td>RESPONSE<br /><textarea cols="40" rows="8"
name="messres" readonly="readonly"></textarea></td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</form>
<script type="text/javascript">
methodChanged(document.getElementById("method"));
debugChanged(document.getElementById("debug"));
</script>
</body>
</html>
--- NEW FILE: MultimediaN.png ---
(This appears to be a binary file; contents omitted.)
--- NEW FILE: monet.png ---
(This appears to be a binary file; contents omitted.)
--- 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;
}
#answers {
background: white;
margin-top:20px;
padding: 10px;
border: 1px solid black;
border-bottom: 4px solid black;
border-right: 4px solid black;
}
#messages {
display: none;
}
#request, #response, #graph {
background: white;
margin-top:20px;
padding: 10px;
border: 1px solid black;
border-bottom: 4px solid black;
border-right: 4px solid black;
}
#request td, #response td, #answers td, #graph td {
font-size: 0.7em;
font-weight: bold;
background-color: black;
color: white;
}
#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 = bmp gif html js png
DIR = datadir/MonetDB/xrpc/demo
SOURCES = \
cwi.bmp \
MultimediaN.png \
monet.png \
style.css \
tree.gif \
index.html
}
headers_xq = {
HEADERS = xq
DIR = datadir/MonetDB/xrpc/demo
SOURCES = demo-mod.xq
}
--- NEW FILE: tree.gif ---
(This appears to be a binary file; contents omitted.)
--- NEW FILE: demo-mod.xq ---
module namespace f="xrpcdemo-functions";
declare function f:firstPerson($doc as xs:string) as node()
{ exactly-one(doc($doc)//person[1]) };
declare function f:firstPerson($docs as xs:string+, $dsts as xs:string+) as
node()+
{ for $d at $pos in $dsts
return execute at {$d} {f:firstPerson(exactly-one($docs[$pos]))}
};
declare function f:boughtItems($pid as xs:string, $doc as xs:string) as node()*
{ doc($doc)//closed_auction[./buyer/@person=$pid] };
declare function f:boughtItemsAllPersons($docL as xs:string, $docR as
xs:string, $dst as xs:string) as node()*
{ for $pid in doc($docL)//person/@pid
return execute at {$dst} {f:boughtItems($pid, $docR)}
};
declare updating function f:insertPerson($p as node(), $doc as xs:string)
{ do insert $p into doc($doc)//persons };
declare updating function f:deletePerson($pid as node(), $doc as xs:string)
{ do delete doc($doc)//person[./@pid=$pid] };
--- NEW FILE: cwi.bmp ---
(This appears to be a binary file; contents omitted.)
-------------------------------------------------------------------------
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