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

Modified Files:
      Tag: xrpcdemo
        demo-xrpcmod.xq index.html 
Log Message:
- newer versions of the demo modules



U index.html
Index: index.html
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/runtime/xrpc/demo/Attic/index.html,v
retrieving revision 1.1.2.11
retrieving revision 1.1.2.12
diff -u -d -r1.1.2.11 -r1.1.2.12
--- index.html  12 Jun 2008 01:22:50 -0000      1.1.2.11
+++ index.html  12 Jun 2008 19:37:17 -0000      1.1.2.12
@@ -108,7 +108,7 @@
       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)//persons };");
+      "{ do insert $p into doc($doc)//people };");
 
   funcdefs[funcdefs.length]=new funcdef("insertPersonNested", true,
       new Array("string", "string", "node()"), new Array("+", "", ""),
@@ -117,7 +117,7 @@
       "                        $doc as xs:string, \n" +
       "                        $p as node()) \n" +
       "{ \n" +
-      "  (do insert $p into doc($doc)//persons, \n" +
+      "  (do insert $p into doc($doc)//people, \n" +
       "   for $dst in $dsts return \n" +
       "          execute at {$dst} {dfx:insertPerson($doc, $p)}) \n" +
       "};");
@@ -135,11 +135,22 @@
       "                        $doc as xs:string, \n" +
       "                        $pid as xs:string) \n" +
       "{ \n" +
-      "  (do delete doc($doc)//person[./@pid=$pid], \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("", "", "", ""), "");
@@ -339,21 +350,21 @@
       if(val == "getPerson") {
         default_val = (i==0) ? "xmark1.xml" : "person10";
       } else if(val == "auctionsAllPerson") {
-        default_val = (i==0) ? "localhost:60001" : "xmark1.xml";
+        default_val = (i==0) ? "192.168.0.1:50001" : "xmark1.xml";
       } else if (val == "nestedRPC") {
         if(i == 0)
-          default_val = "localhost:60001";
+          default_val = "192.168.0.1:50001";
         else if(i == 1)
-          default_val = "localhost:70001";
+          default_val = "jarl.ins.cwi.nl:8080";
         else if(i == 2)
-          default_val = "localhost:80001";
+          default_val = "localhost:60001";
         else
           default_val = "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 = "(localhost:60001, localhost:70001)";
+          default_val = "(jarl.ins.cwi.nl:50001, 192.168.0.1:50001)";
         else if (i== 1)
           default_val = "xmark1.xml";
         else 
@@ -362,11 +373,13 @@
         default_val = (i==0) ? "xmark1.xml" : "new1";
       } else if (val == "deletePersonNested") {
         if(i == 0)
-          default_val = "(localhost:60001, localhost:70001)";
+          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 + '\' />';

U demo-xrpcmod.xq
Index: demo-xrpcmod.xq
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/runtime/xrpc/demo/Attic/demo-xrpcmod.xq,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -d -r1.1.2.2 -r1.1.2.3
--- demo-xrpcmod.xq     12 Jun 2008 14:47:30 -0000      1.1.2.2
+++ demo-xrpcmod.xq     12 Jun 2008 19:36:50 -0000      1.1.2.3
@@ -14,20 +14,6 @@
                        $p/name }
 };
 
-(:
-declare function dfx: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
-    }
-};
-:)
-
 declare function dfx:auctionsAllPerson(
                        $dst as xs:string,
                        $doc as xs:string) as node()*
@@ -81,6 +67,15 @@
          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 := (for $i in 1 to 1000
+                                       return count(doc("xmark1.xml")//*)),
+           $d2 := execute at {$dst} {dfx:getdoc("hello.xml")}
+       return ($d1/hello, $d2/hello)
+};
+
 declare function dfx:getdoc($url as xs:string) as document-node()?
 { doc($url) };
 


-------------------------------------------------------------------------
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