diff --git a/webservice/amf/testclient/AMFConnector.as b/webservice/amf/testclient/AMFConnector.as index 683ab3bf358..036040a3f0f 100644 --- a/webservice/amf/testclient/AMFConnector.as +++ b/webservice/amf/testclient/AMFConnector.as @@ -30,9 +30,9 @@ package { /** * executes a command on the remote server, passing all the given arguments along */ - public function exec(command:String, ... args:Array):void + public function exec(command:String, args:Array = null):void { - if (!args) args = []; + if (args == null) args = []; args.unshift(responder); args.unshift(command); (call as Function).apply(this, args); diff --git a/webservice/amf/testclient/AMFTester.mxml b/webservice/amf/testclient/AMFTester.mxml index e26aa97c709..deef8ec8a2d 100644 --- a/webservice/amf/testclient/AMFTester.mxml +++ b/webservice/amf/testclient/AMFTester.mxml @@ -137,6 +137,7 @@ methods.push({label: cls+'.'+meth, docs: api.data[cls]['methods'][meth]['docs'], args: api.data[cls]['methods'][meth]['params']}); } } + methods.sortOn('label', Array.CASEINSENSITIVE); this.panelDebug.enabled = true; this.maintabs.selectedIndex = 1; @@ -154,9 +155,13 @@ protected function process(event:Event):void { if (api.error) { - push(input, time() + ": Exception (faultString: "+api.data.faultString+", extendedData: "+api.data.extendedData+", faultDetail: "+api.data.faultDetail+")\n"); + var keys:String = ''; + for (var key:String in api.data){ + keys += key+' '; + } + push(output, time() + ": Exception (code: "+api.data.code+", description: "+api.data.description+" (line: "+api.data.line+") detail:\n "+api.data.detail+")\n"); } else { - push(input, time() + ": "+JSON.encode(api.data)+"\n"); + push(output, time() + ": "+JSON.encode(api.data)+"\n"); } // MonsterDebugger.trace(this, {"data":api.data, "error":api.error}); // MonsterDebugger.trace(this, api.data); @@ -175,18 +180,31 @@ this['arg'+i].includeInLayout = false; this['larg'+i].visible = false; this['larg'+i].includeInLayout = false; + this['cbarg'+i].visible = false; + this['cbarg'+i].includeInLayout = false; this['JSONV'+i].enabled = false; } i = 1; for (var arg:String in func.selectedItem.args) { (this['arg'+i] as TextInput).visible = true; (this['arg'+i] as TextInput).includeInLayout = true; + if (func.selectedItem.args[arg]['required']){ + (this['arg'+i] as TextInput).enabled = true; + this['cbarg'+i].selected = true; + } (this['larg'+i] as Label).visible = true; (this['larg'+i] as Label).includeInLayout = true; - this['JSONV'+i].enabled = true; - this['JSONV'+i].required = func.selectedItem.args[arg]['required']; + this['cbarg'+i].visible = !func.selectedItem.args[arg]['required']; + this['cbarg'+i].includeInLayout = !func.selectedItem.args[arg]['required']; + this['JSONV'+i].enabled = this['cbarg'+i].selected; + this['JSONV'+i].required = true; - (this['larg'+i++] as Label).text = func.selectedItem.args[arg]['name'] + (func.selectedItem.args[arg]['required'] ? "*":""); + (this['larg'+i] as Label).text = func.selectedItem.args[arg]['name'] + (func.selectedItem.args[arg]['required'] ? "*":""); + i++; + } + while (i <= 7) { + this['cbarg'+i].selected = false; + i++; } if (func.selectedItem.docs == ""){ (this.methodDescription as TextArea).text = ""; @@ -199,6 +217,23 @@ } } + public function toggleCheckBoxes(startAt:uint):void{ + var i:uint= startAt; + if (this['cbarg'+i].selected){ + i--; + while (i >= 1){ + this['cbarg'+i].selected = true; + i--; + } + } else { + i++; + while (i <= 7){ + this['cbarg'+i].selected = false; + i++; + } + } + } + /** * calls a method on the server */ @@ -211,12 +246,14 @@ // MonsterDebugger.trace(this, argumentErrors); return; } - for(var i:int = 1; i < 8; i++) + for(var i:int = 1; i <= 7; i++) { input = this['arg' +i] as TextInput; - if(input) + if(input && input.visible) { - if (input.text.indexOf("{") == 0 || input.text.indexOf("[") == 0) + if (!this['cbarg' +i].selected){ + break; + } else if (input.text.indexOf("\"") == 0 || input.text.indexOf("{") == 0 || input.text.indexOf("[") == 0) try { argumentArray.push(JSON.decode(input.text)); } catch (err:Error){ @@ -228,7 +265,7 @@ } - api.exec(func.selectedLabel, argumentArray[0], argumentArray[1], argumentArray[2], argumentArray[3], argumentArray[4], argumentArray[5], argumentArray[6]); + api.exec(func.selectedLabel, argumentArray); // MonsterDebugger.trace(this, [func.selectedLabel, argumentArray[0], argumentArray[1], argumentArray[2], argumentArray[3], argumentArray[4], argumentArray[5], argumentArray[6]]); push(output, time() + ": Calling "+func.selectedLabel+" with arguments - "+JSON.encode(argumentArray)); } @@ -238,7 +275,7 @@ */ protected function clear():void { - input.text = output.text = ""; + output.text = output.text = ""; } /** @@ -266,7 +303,7 @@ */ public function netStatusHandler(event:NetStatusEvent):void { - push(input, time() + ": Error("+event.type+"): "+event.info.code+", "+event.info.description+", "+event.info.details); + push(output, time() + ": Error("+event.type+"): "+event.info.code+", "+event.info.description+", "+event.info.details); } /** @@ -274,7 +311,7 @@ */ public function securityErrorHandler(event:SecurityErrorEvent):void { - push(input, time() + ": Error("+event.type+"): "+event.text); + push(output, time() + ": Error("+event.type+"): "+event.text); } /** @@ -282,7 +319,7 @@ */ public function ioErrorHandler(event:IOErrorEvent):void { - push(input, time() + ": Error("+event.type+"): "+event.text); + push(output, time() + ": Error("+event.type+"): "+event.text); } /** @@ -297,13 +334,13 @@ ]]> - - - - - - - + + + + + + + @@ -359,38 +396,44 @@ - + + - + + - + + - + + - + + - + + - + + - - + diff --git a/webservice/amf/testclient/AMFTester.swf b/webservice/amf/testclient/AMFTester.swf index 4aac723da37..e7c9443dbbe 100644 Binary files a/webservice/amf/testclient/AMFTester.swf and b/webservice/amf/testclient/AMFTester.swf differ