1318 |
alexandre_ |
1 |
/*
|
|
|
2 |
Copyright (c) 2004-2006, The Dojo Foundation
|
|
|
3 |
All Rights Reserved.
|
|
|
4 |
|
|
|
5 |
Licensed under the Academic Free License version 2.1 or above OR the
|
|
|
6 |
modified BSD license. For more information on Dojo licensing, see:
|
|
|
7 |
|
|
|
8 |
http://dojotoolkit.org/community/licensing.shtml
|
|
|
9 |
*/
|
|
|
10 |
|
1422 |
alexandre_ |
11 |
|
|
|
12 |
|
1318 |
alexandre_ |
13 |
dojo.provide("dojo.rpc.JotService");
|
|
|
14 |
dojo.require("dojo.rpc.RpcService");
|
|
|
15 |
dojo.require("dojo.rpc.JsonService");
|
|
|
16 |
dojo.require("dojo.json");
|
|
|
17 |
dojo.rpc.JotService = function () {
|
|
|
18 |
this.serviceUrl = "/_/jsonrpc";
|
|
|
19 |
};
|
|
|
20 |
dojo.inherits(dojo.rpc.JotService, dojo.rpc.JsonService);
|
|
|
21 |
dojo.lang.extend(dojo.rpc.JotService, {bind:function (method, parameters, deferredRequestHandler, url) {
|
|
|
22 |
dojo.io.bind({url:url || this.serviceUrl, content:{json:this.createRequest(method, parameters)}, method:"POST", mimetype:"text/json", load:this.resultCallback(deferredRequestHandler), error:this.errorCallback(deferredRequestHandler), preventCache:true});
|
|
|
23 |
}, createRequest:function (method, params) {
|
|
|
24 |
var req = {"params":params, "method":method, "id":this.lastSubmissionId++};
|
|
|
25 |
return dojo.json.serialize(req);
|
|
|
26 |
}});
|
|
|
27 |
|