//>>built
define("mill/dataBrowser/rtti",["dojo/DeferredList","mill/mill"],function(){mill.dataBrowser||(mill.dataBrowser={});dojo.declare("mill.dataBrowser.rtti",null,{handle:null,constructor:function(a){dojo.mixin(this,a)},data:null,byHandle:function(a){var b=dojo.filter(this.data,function(c){return c.handle==a});return b.length?b[0].data:null},get:function(a,b,c){if(b=dojo.filter(this.byHandle(a)||[],this.comparer(b,c))[0])b.handle=a;return b},getAll:function(a,b,c){b=dojo.filter(this.byHandle(a)||[],this.comparer(b,
c));dojo.forEach(b,function(d){d.handle=a});return b},getDomain:function(a,b){return this.get("TBlobDomain",a,b)||this.get("TBooleanDomain",a,b)||this.get("TClassDomain",a,b)||this.get("TDateDomain",a,b)||this.get("TDateTimeDomain",a,b)||this.get("TEnumerationDomain",a,b)||this.get("TFloatDomain",a,b)||this.get("TIntegerDomain",a,b)||this.get("TStringDomain",a,b)||this.get("TFileNameDomain",a,b)||this.get("TFolderNameDomain",a,b)||this.get("TTimeDomain",a,b)||this.get("TExternalDataDomain",a,b)},
getRoutine:function(a){return this.get("TRoutine",a,null)||this.get("TExcelTemplate",a,null)||this.get("TMethod",a,null)||this.get("TOleObjectMethod",a,null)||this.get("TPDFTemplate",a,null)||this.get("TWordTemplate",a,null)||this.get("TXSLTTemplate",a,null)},listParameters:function(a){var b=this.byHandle("TParameter"),c=this.getRoutine(a);a=this.byHandle(c.handle);for(var d=[],g=this.get("TClass",c.Master);g;)d=d.concat(dojo.filter(a,function(e){return e.Master==g.ID&&e.Name==c.Name})),g=this.get("TClass",
g.Parent);for(var f=[],h=d.length-1;0<=h;h--)dojo.forEach(dojo.filter(b,function(e){return e.Master==d[h].ID}),function(e){for(var k=!1,l=0;l<f.length;l++)e.Name==f[l].Name&&(f[l]=e,k=!0);k||f.push(e)});return f},comparer:function(a,b){return a?function(c){return c.ID==a}:function(c){return c.Name==b}},load:function(){return dojo.xhrGet({handleAs:"json",sync:!1,url:"/"+this.handle+"/rtti.js",load:dojo.hitch(this,function(a){this.data=a;strings=[];for(var b=this.data.length-1;0<=b;b--)dojo.isArray(this.data[b])&&
(strings=strings.concat(this.data.splice(b,1)[0]));dojo.forEach(this.data,function(c){var d=c.strings,g=c.map||null;g?dojo.forEach(c.data,function(f){dojo.forEach(g,function(h,e){var k=f[e];f[h]=k?d?strings[k]:k:null})}):d&&dojo.forEach(c.data,function(f){for(var h in f){var e=f[h];f[h]=e?strings[e]:null}})});return a})})},domainStore:function(a,b){if("TClassDomain"==a.handle){var c=this.get("TClass",a.ClassOfDomain),d=[{part:0,name:"ID"}];a.FilterCondition&&d.push({part:1,name:a.ID,special:"4",context:b||
null});var g="soName"==this.get("TEnumerationItem",a.ShowObjectInfoType).Name?"Name":"Description";d.push({part:0,name:g});d.push({part:2,name:g});return new mill.data({className:c.Name,handler:this.handle,clientFiltering:!0,request:d})}return null}})});