a:15:{s:9:"#provides";s:19:"dojo.rpc.RpcService";s:9:"#resource";s:17:"rpc/RpcService.js";s:19:"dojo.rpc.RpcService";a:5:{s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:4:"args";a:2:{s:4:"type";s:6:"object";s:7:"summary";s:641:"Takes a number of properties as kwArgs for defining the service. It also accepts a string. When passed a string, it is treated as a url from which it should synchronously retrieve an smd file. Otherwise it is a kwArgs object. It accepts serviceUrl, to manually define a url for the rpc service allowing the rpc system to be used without an smd definition. strictArgChecks forces the system to verify that the # of arguments provided in a call matches those defined in the smd. smdString allows a developer to pass a jsonString directly, which will be converted into an object or alternatively smdObject is accepts an smdObject directly.";}}s:6:"source";s:1042:" if(args){ //if the arg is a string, we assume it is a url to retrieve an smd definition from if( (dojo.isString(args)) || (args instanceof dojo._Url)){ if (args instanceof dojo._Url){ var url = args + ""; }else{ url = args; } var def = dojo.xhrGet({ url: url, handleAs: "json-comment-optional", sync: true }); def.addCallback(this, "processSmd"); def.addErrback(function() { throw new Error("Unable to load SMD from " + args); }); }else if(args.smdStr){ this.processSmd(dojo.eval("("+args.smdStr+")")); }else{ // otherwise we assume it's an arguments object with the following // (optional) properties: // - serviceUrl // - strictArgChecks // - smdStr // - smdObj if(args.serviceUrl){ this.serviceUrl = args.serviceUrl; } this.timeout = args.timeout || 3000; if("strictArgChecks" in args){ this.strictArgChecks = args.strictArgChecks; } this.processSmd(args); } }";s:7:"summary";s:123:"Take a string as a url to retrieve an smd or an object that is an smd or partial smd to use as a definition for the service";s:9:"classlike";b:1;}s:35:"dojo.rpc.RpcService.strictArgChecks";a:3:{s:9:"prototype";s:19:"dojo.rpc.RpcService";s:8:"instance";s:19:"dojo.rpc.RpcService";s:7:"summary";s:0:"";}s:30:"dojo.rpc.RpcService.serviceUrl";a:3:{s:9:"prototype";s:19:"dojo.rpc.RpcService";s:8:"instance";s:19:"dojo.rpc.RpcService";s:7:"summary";s:0:"";}s:32:"dojo.rpc.RpcService.parseResults";a:5:{s:9:"prototype";s:19:"dojo.rpc.RpcService";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:3:"obj";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:2398:"dojo.provide("dojo.rpc.RpcService"); dojo.declare("dojo.rpc.RpcService", null, { constructor: function(args){ //summary: //Take a string as a url to retrieve an smd or an object that is an smd or partial smd to use //as a definition for the service // // args: object // Takes a number of properties as kwArgs for defining the service. It also // accepts a string. When passed a string, it is treated as a url from // which it should synchronously retrieve an smd file. Otherwise it is a kwArgs // object. It accepts serviceUrl, to manually define a url for the rpc service // allowing the rpc system to be used without an smd definition. strictArgChecks // forces the system to verify that the # of arguments provided in a call // matches those defined in the smd. smdString allows a developer to pass // a jsonString directly, which will be converted into an object or alternatively // smdObject is accepts an smdObject directly. // if(args){ //if the arg is a string, we assume it is a url to retrieve an smd definition from if( (dojo.isString(args)) || (args instanceof dojo._Url)){ if (args instanceof dojo._Url){ var url = args + ""; }else{ url = args; } var def = dojo.xhrGet({ url: url, handleAs: "json-comment-optional", sync: true }); def.addCallback(this, "processSmd"); def.addErrback(function() { throw new Error("Unable to load SMD from " + args); }); }else if(args.smdStr){ this.processSmd(dojo.eval("("+args.smdStr+")")); }else{ // otherwise we assume it's an arguments object with the following // (optional) properties: // - serviceUrl // - strictArgChecks // - smdStr // - smdObj if(args.serviceUrl){ this.serviceUrl = args.serviceUrl; } this.timeout = args.timeout || 3000; if("strictArgChecks" in args){ this.strictArgChecks = args.strictArgChecks; } this.processSmd(args); } } }, strictArgChecks: true, serviceUrl: "", parseResults: function(obj){ // summary // parse the results coming back from an rpc request. this // base implementation, just returns the full object // subclasses should parse and only return the actual results // obj: Object // Object that is the return results from an rpc request return obj;";s:7:"summary";s:0:"";}s:33:"dojo.rpc.RpcService.errorCallback";a:5:{s:9:"prototype";s:19:"dojo.rpc.RpcService";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:22:"deferredRequestHandler";a:2:{s:4:"type";s:13:"dojo.Deferred";s:7:"summary";s:48:"Deferred The deferred object handling a request.";}}s:6:"source";s:78:" return function(data){ deferredRequestHandler.errback(data.message); };";s:7:"summary";s:54:"create callback that calls the Deferres errback method";}s:34:"dojo.rpc.RpcService.resultCallback";a:5:{s:9:"prototype";s:19:"dojo.rpc.RpcService";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:22:"deferredRequestHandler";a:2:{s:4:"type";s:13:"dojo.Deferred";s:7:"summary";s:48:"Deferred The deferred object handling a request.";}}s:6:"source";s:482:" var tf = dojo.hitch(this, function(obj){ if(obj.error!=null){ var err; if(typeof obj.error == 'object'){ err = new Error(obj.error.message); err.code = obj.error.code; err.error = obj.error.error; }else{ err = new Error(obj.error); } err.id = obj.id; err.errorObject = obj; deferredRequestHandler.errback(err); }else{ deferredRequestHandler.callback(this.parseResults(obj)); } } ); return tf;";s:7:"summary";s:57:"create callback that calls the Deferred's callback method";}s:34:"dojo.rpc.RpcService.generateMethod";a:5:{s:9:"prototype";s:19:"dojo.rpc.RpcService";s:4:"type";s:8:"Function";s:10:"parameters";a:3:{s:6:"method";a:2:{s:4:"type";s:6:"string";s:7:"summary";s:40:"The name of the method we are generating";}s:10:"parameters";a:2:{s:4:"type";s:5:"array";s:7:"summary";s:38:"the array of parameters for this call.";}s:3:"url";a:2:{s:4:"type";s:6:"string";s:7:"summary";s:29:"the service url for this call";}}s:6:"source";s:523:" return dojo.hitch(this, function(){ var deferredRequestHandler = new dojo.Deferred(); // if params weren't specified, then we can assume it's varargs if( (this.strictArgChecks) && (parameters != null) && (arguments.length != parameters.length) ){ // put error stuff here, no enough params throw new Error("Invalid number of parameters for remote method."); }else{ this.bind(method, dojo._toArray(arguments), deferredRequestHandler, url); } return deferredRequestHandler; });";s:7:"summary";s:53:"generate the local bind methods for the remote object";}s:30:"dojo.rpc.RpcService.processSmd";a:5:{s:9:"prototype";s:19:"dojo.rpc.RpcService";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:6:"object";a:2:{s:4:"type";s:3:"smd";s:7:"summary";s:29:"object defining this service.";}}s:6:"source";s:534:" if(object.methods){ dojo.forEach(object.methods, function(m){ if(m && m.name){ this[m.name] = this.generateMethod( m.name, m.parameters, m.url||m.serviceUrl||m.serviceURL); if(!dojo.isFunction(this[m.name])){ throw new Error("RpcService: Failed to create" + m.name + "()"); /*console.log("RpcService: Failed to create", m.name, "()");*/ } } }, this); } this.serviceUrl = object.serviceUrl||object.serviceURL; this.required = object.required; this.smd = object;";s:7:"summary";s:107:"callback method for reciept of a smd object. Parse the smd and generate functions based on the description";}s:28:"dojo.rpc.RpcService.required";a:2:{s:8:"instance";s:19:"dojo.rpc.RpcService";s:7:"summary";s:0:"";}s:23:"dojo.rpc.RpcService.smd";a:2:{s:8:"instance";s:19:"dojo.rpc.RpcService";s:7:"summary";s:0:"";}s:27:"dojo.rpc.RpcService.timeout";a:2:{s:8:"instance";s:19:"dojo.rpc.RpcService";s:7:"summary";s:0:"";}s:8:"dojo.rpc";a:2:{s:4:"type";s:6:"Object";s:7:"summary";s:0:"";}s:4:"dojo";a:2:{s:4:"type";s:6:"Object";s:7:"summary";s:0:"";}}