Subversion Repositories Applications.papyrus

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
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
 
11
dojo.provide("dojo.rpc.JotService");
12
dojo.require("dojo.rpc.RpcService");
13
dojo.require("dojo.rpc.JsonService");
14
dojo.require("dojo.json");
15
dojo.rpc.JotService = function () {
16
	this.serviceUrl = "/_/jsonrpc";
17
};
18
dojo.inherits(dojo.rpc.JotService, dojo.rpc.JsonService);
19
dojo.lang.extend(dojo.rpc.JotService, {bind:function (method, parameters, deferredRequestHandler, url) {
20
	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});
21
}, createRequest:function (method, params) {
22
	var req = {"params":params, "method":method, "id":this.lastSubmissionId++};
23
	return dojo.json.serialize(req);
24
}});
25