Changes between Version 6 and Version 7 of XmlRpcDeveloping


Ignore:
Timestamp:
04/28/06 19:56:43 (18 years ago)
Author:
sauermann
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • XmlRpcDeveloping

    v6 v7  
    4848Note that when the server throws an exception, the exception message will be passed to the xml/rpc client, so you know whats happening when it fails. 
    4949 
    50 = Now to the cool example = 
     50= The real rocking cool example = 
    5151Download gnowsis and run this page: 
    5252 * http://127.0.0.1:9993/gnowsis-server/ajax_example.html 
    5353 * press ok there. 
    54  * see how we run a SERQL query from javascript, parse the results using ultra-cool jsolait framework and render HTML of it. 
     54 * see how  
     55   * '''we run a SERQL query from javascript, ''' 
     56   * '''parse the results using ultra-cool jsolait framework'''  
     57   * '''and render HTML of it.''' 
     58 
     59using only these lines of code: 
     60{{{ 
     61function runSerqlExample() 
     62{ 
     63   // turn debug alerts off 
     64   gnowsis_showdebugalert = false; 
     65   var formC = document.forms["formserqlexample"]; 
     66   var queryString = formC.elements["rquery"].value;   
     67   try  { 
     68           var res = gnowsis_callXmlMethod("gnowsis-server", "dataaccess", "querySelect",  
     69          queryString, "serql"); 
     70   } catch (e) 
     71   { 
     72     alert("error querying: "+e); 
     73   } 
     74   renderSerqlExample(res); 
     75} 
     76 
     77/** 
     78 * render the serql query result. 
     79 * query result is a vector of hashmaps, pretty easy. 
     80 */ 
     81function renderSerqlExample(res) 
     82{ 
     83   gnowsis_debug("rendering table"); 
     84   var render = "<table>"; 
     85   for (var i = 0; i < res.length; i++) 
     86   { 
     87      var row = res[i]; 
     88       
     89      // render header? 
     90      if (i==0) 
     91      { 
     92        render+="<tr>"; 
     93                for (col in row) 
     94                { 
     95          render += "<td>"+col+"</td>";    
     96        } 
     97        render += "</tr>"; 
     98      } 
     99       
     100      // render row 
     101      render+="<tr>"; 
     102      for (col in row) 
     103      { 
     104        render += "<td>"+row[col]+"</td>";   
     105      } 
     106      render += "</tr>"; 
     107   } 
     108   render += "</table>"; 
     109   var exampleOut = document.getElementById('SerqlExampleoutput'); 
     110   gnowsis_debug(render); 
     111   exampleOut.innerHTML = render; 
     112   gnowsis_debug("finished"); 
     113} 
     114}}} 
    55115 
    56116yes, you want to dig this? 
    57  * [src:branches/gnowsis0.9/gnowsis-server/service/gnowsis-server/ajax_example.html] use the source, luke 
     117 * source:branches/gnowsis0.9/gnowsis-server/service/gnowsis-server/ajax_example.html use the source, luke 
    58118 
    59119= So what services can I call? =