Ext.Msg.bodyPadding="0 0";Ext.Msg.cls="adminAlert";Ext.Msg.layout={type:"vbox",pack:"start",align:"left"};Ext.define("TestDescriptors.controller.Main",{extend:"Ext.app.Controller",refs:[{selector:"testdescriptors",ref:"testdescriptors"},{selector:"applytoothercomponents",ref:"applytoothercomponents"}],init:function(){main=this;
me=this;this.control({"testdescriptors":{"boxready":this.afterMainRender},'testdescriptors combo[id="compTypeCombo"]':{"select":this.compTypeComboLoad},'testdescriptors combo[id="compNameCombo"]':{"select":this.compNameComboLoad},'testdescriptors combo[id="testCombo"]':{"select":this.testNameComboLoad},'testdescriptors combo[id="timeLineCombo"]':{"select":this.timeLineComboLoad},'testdescriptors button[id="disableDeleteBtn"]':{"click":this.deleteData},'testdescriptors button[id="updateBtn"]':{"click":this.updateData},'testdescriptors trigger[id="strEnabledSearch"]':{"change":this.textFieldSearch},'testdescriptors trigger[id="strDisabledSearch"]':{"change":this.textFieldSearch},"applytoothercomponents":{"afterrender":this.applyAllMainRender},'applytoothercomponents button[id="applyBtn"]':{"click":this.apply},'applytoothercomponents button[id="applyBackBtn"]':{"click":this.applyBackBtnEvent},'testdescriptors button[id="applyToOtherBtn"]':{"click":this.populate},'testdescriptors combo[id="criteria"]':{"select":this.getCriteriaDetails},'testdescriptors combo[id="userOption"]':{"select":this.getUserOptionDetails},});
},getCriteriaDetails:function(e){var d=Ext.getCmp("userOption");var h=Ext.getCmp("criteria");var b=Ext.getCmp("compTypeCombo");var a=sessionStorage.getItem("criteria");var c=Ext.getCmp("criteria").getValue();if(!Ext.isEmpty(a)&&!Ext.isEmpty(c)){if(a!=c){compType="";comp="";test="";d="";duration="";sessionStorage.removeItem("userOption");
}}if(h.getValue()=="Component"){Ext.getCmp("userOption").setValue("");sessionStorage.removeItem("userOption");}var g="criteria="+h.getValue();Ext.Ajax.request({url:"TestDescriptors/data/EgTestInfoViewJson.jsp?",method:"POST",timeout:120000,params:g,success:function(j){if(j.status==200&&!Ext.isEmpty(j.responseText)){publicJson=Ext.decode(j.responseText);
sessionStorage.setItem("criteria",publicJson.selectedCriteria);if(publicJson.selectedCriteria!="Component"){Ext.getCmp("userOption").getStore().loadRawData(publicJson.specViewByArr);Ext.getCmp("userOption").setValue(publicJson.selectedUserOptionText);Ext.getCmp("userOption").setFieldLabel(publicJson.specViewByTitle);
Ext.getCmp("userOption").show();var k=sessionStorage.getItem("userOption");if(!Ext.isEmpty(k)&&k!=null&&k!="undefined"&&k!="-1"){Ext.getCmp("userOption").setValue(k);}else{Ext.getCmp("userOption").setValue(publicJson.selectedUserOptionText);if(!Ext.isEmpty(publicJson.selectedUserOptionText)&&publicJson.selectedUserOptionText!="-1"){sessionStorage.setItem("userOption",publicJson.selectedUserOptionText);
}}Ext.getCmp("userOption").fireEvent("select",Ext.getCmp("userOption"));}else{sessionStorage.removeItem("userOption");Ext.getCmp("userOption").hide();var i=publicJson.descCompTypeArr;if(!Ext.isEmpty(i)){b.getStore().removeAll();b.getStore().loadRawData(i);b.setValue(i[0].valueField);b.setDisabled(false);
}if(!Ext.isEmpty(compType)){b.setValue(compType);b.fireEvent("select",b);}else{if(!Ext.isEmpty(publicJson["descCompNameArr"])){Ext.getCmp("compNameCombo").getStore().clearFilter(true);Ext.getCmp("compNameCombo").getStore().removeAll();Ext.getCmp("compNameCombo").getStore().loadRawData(publicJson["descCompNameArr"]);
Ext.getCmp("compNameCombo").setValue(publicJson["descCompNameArr"][0].valueField);}if(!Ext.isEmpty(publicJson["descTestNameArr"])){Ext.getCmp("testCombo").getStore().clearFilter(true);Ext.getCmp("testCombo").getStore().removeAll();Ext.getCmp("testCombo").getStore().loadRawData(publicJson["descTestNameArr"]);
Ext.getCmp("testCombo").setValue(publicJson["descTestNameArr"][0].valueField);}Ext.getCmp("timeLineCombo").getStore().loadRawData(publicJson["descTimeLimitArr"]);Ext.getCmp("timeLineCombo").setValue(publicJson["selectedTime"]);Ext.getCmp("timeLineCombo").setDisabled(true);if(!Ext.getCmp("testDescItemSelector").isHidden()){Ext.getCmp("testDescItemSelectorCont").hide();
Ext.getCmp("testDescItemSelector").hide();Ext.getCmp("btnContainer").hide();Ext.getCmp("searchContainer").hide();}Ext.getCmp("noDataContainer").hide();Ext.getCmp("processUpdateContainer").hide();}}}},failure:function(i,j){Ext.MessageBox.alert("Ajax Failed","Error in updating details");}});},getUserOptionDetails:function(g){var b=Ext.getCmp("userOption");
var i=Ext.getCmp("compTypeCombo");var c=Ext.getCmp("testType");var d=Ext.getCmp("components");var j=sessionStorage.getItem("userOption");var a=Ext.getCmp("userOption").getValue();if(!Ext.isEmpty(j)&&!Ext.isEmpty(a)){if(j!=a){compType="";comp="";test="";b="";duration="";}}var h=Ext.getCmp("criteria").getValue();
var e="criteria="+h+"&userOption="+a;Ext.Ajax.request({url:"TestDescriptors/data/EgTestInfoViewJson.jsp?",method:"POST",timeout:120000,params:e,success:function(l){if(l.status==200&&!Ext.isEmpty(l.responseText)){publicJson=Ext.decode(l.responseText);sessionStorage.setItem("userOption",publicJson.selectedUserOptionText);
var k=publicJson.descCompTypeArr;i.getStore().removeAll();i.getStore().loadRawData(k);i.setValue(k[0].valueField);i.setDisabled(false);if(!Ext.isEmpty(compType)){i.setValue(compType);i.fireEvent("select",i);}else{Ext.getCmp("compNameCombo").getStore().clearFilter(true);Ext.getCmp("compNameCombo").getStore().removeAll();
Ext.getCmp("compNameCombo").getStore().loadRawData(publicJson["descCompNameArr"]);Ext.getCmp("compNameCombo").setValue(publicJson["descCompNameArr"][0].valueField);Ext.getCmp("testCombo").getStore().clearFilter(true);Ext.getCmp("testCombo").getStore().removeAll();Ext.getCmp("testCombo").getStore().loadRawData(publicJson["descTestNameArr"]);
Ext.getCmp("testCombo").setValue(publicJson["descTestNameArr"][0].valueField);Ext.getCmp("timeLineCombo").getStore().loadRawData(publicJson["descTimeLimitArr"]);Ext.getCmp("timeLineCombo").setValue(publicJson["selectedTime"]);Ext.getCmp("timeLineCombo").setDisabled(true);if(!Ext.getCmp("testDescItemSelector").isHidden()){Ext.getCmp("testDescItemSelectorCont").hide();
Ext.getCmp("testDescItemSelector").hide();Ext.getCmp("btnContainer").hide();Ext.getCmp("searchContainer").hide();}Ext.getCmp("noDataContainer").hide();Ext.getCmp("processUpdateContainer").hide();}}},failure:function(k,l){Ext.MessageBox.alert("Ajax Failed","Error in updating details");}});},apply:function(){var q=Ext.getCmp("serversItemSelectors");
var y=q.fromField.store.getCount();var b=false;var j=true;var z="";var g=Ext.getCmp("paramsGrid").getStore().getCount();var p="";var m="";for(var w=0;w<g;w++){var c=Ext.getCmp("paramsGrid").getStore().getAt(w);isChecked=Ext.getCmp("paramsGrid").getSelectionModel().isSelected(c);if(isChecked){b=true;var v=c.get("Action");
var o=c.get("DescriptorName");var u=c.get("valueField");if(v.toLowerCase()=="disable"){m;if(m!=""){m+=","+u;}else{m=u;}}else{if(p!=""){p+=","+u;}else{p=u;}}}}if(y>=1&&!b){Ext.Msg.show({title:applyTitle,msg:alertMsg4,buttons:Ext.Msg.OK,icon:"iconExclamation",});j=false;}else{if(y==0&&b){Ext.Msg.show({title:applyTitle,msg:alertMsg5,buttons:Ext.Msg.OK,icon:"iconExclamation",});
j=false;}else{if(y==0&&!b){Ext.Msg.show({title:applyTitle,msg:confirmMsg1,buttons:Ext.Msg.YESNO,icon:"iconConfirmation",fn:function(F){if(F=="yes"){j=true;K="";params="requestFrom=EgApplyToOtherComponents.jsp";var J=publicJson["compName"];var K=publicJson["testName"];var C=publicJson["server"];var E=publicJson["duration"];
params+="&server="+C+"&comp="+encodeURIComponent(J)+"&testName="+encodeURIComponent(K)+"&duration="+encodeURIComponent(E);var N="server="+C+"&comp="+encodeURIComponent(J)+"&testName="+K+"&duration="+E+"&requestFrom=processUpdated";var M=publicJson["criteria"];var B=publicJson["userOption"];N+="&criteria="+M+"&userOption="+B;
for(var G=0;G<y;G++){var D=q.fromField.store.getAt(G).get("valueField");if(z!=""){z=z+",";}z=z+D;}var I="TestDescriptors/data/Egtestinfoviewp.jsp?"+params;var H=me.getApplytoothercomponents().getForm();if(H.isValid()){var L=new Ext.LoadMask(Ext.getBody(),{msg:"Updating..."});L.show();Ext.getCmp("selectedEnableParams").setValue(p);
Ext.getCmp("selectedDisableParams").setValue(m);Ext.getCmp("selectedComponents").setValue(z);me.getApplytoothercomponents().submit({url:I,method:"POST",timeout:9000,success:function(i,P){L.hide();if(P.response.status==200&&!Ext.isEmpty(P.response.responseText)){var O=Ext.decode(P.response.responseText);
if(O.successUpdate){Ext.Msg.show({title:applyTitle,msg:alertMsg78,buttons:Ext.Msg.OK,icon:"iconInformation",fn:function(){Ext.getCmp("disabledDescList").setValue("");Ext.getCmp("enabledDescList").setValue("");var Q=Ext.create("TestDescriptors.view.TestDescriptors");var R=Ext.getCmp("testDescViewPort");
myMask=new Ext.LoadMask(R,{msg:"Loading..."});R.removeAll();myMask.show();R.add(Q);myMask.hide();}});}}},failure:function(i,O){L.hide();Ext.getCmp("disabledDescList").setValue("");Ext.getCmp("enabledDescList").setValue("");switch(O.failureType){case Ext.form.action.Action.CLIENT_INVALID:Ext.Msg.show({title:pageName,msg:"Form fields may not be submitted with invalid values",buttons:Ext.MessageBox.OK,icon:"iconExclamation",});
break;case Ext.form.action.Action.CONNECT_FAILURE:Ext.Msg.show({title:pageName,msg:"Ajax communication failed",buttons:Ext.MessageBox.OK,icon:"iconExclamation",});break;case Ext.form.action.Action.SERVER_INVALID:Ext.Msg.show({title:O.result.msg,msg:"Ajax communication failed",buttons:Ext.MessageBox.OK,icon:"iconExclamation",});
}}});}}else{j=false;}}});}else{if(j){h="";params="requestFrom=EgApplyToOtherComponents.jsp";var l=publicJson["compName"];var h=publicJson["testName"];var r=publicJson["server"];var a=publicJson["duration"];params+="&server="+r+"&comp="+encodeURIComponent(l)+"&testName="+encodeURIComponent(h)+"&duration="+encodeURIComponent(a);
var s="server="+r+"&comp="+encodeURIComponent(l)+"&testName="+h+"&duration="+a+"&requestFrom=processUpdated";var e=publicJson["criteria"];var d=publicJson["userOption"];s+="&criteria="+e+"&userOption="+d;for(var w=0;w<y;w++){var A=q.fromField.store.getAt(w).get("valueField");if(z!=""){z=z+",";}z=z+A;
}var n="TestDescriptors/data/Egtestinfoviewp.jsp?"+params;var k=this.getApplytoothercomponents().getForm();if(k.isValid()){var x=new Ext.LoadMask(Ext.getBody(),{msg:"Updating..."});x.show();Ext.getCmp("selectedEnableParams").setValue(p);Ext.getCmp("selectedDisableParams").setValue(m);Ext.getCmp("selectedComponents").setValue(z);
this.getApplytoothercomponents().submit({url:n,method:"POST",timeout:9000,success:function(i,C){x.hide();if(C.response.status==200&&!Ext.isEmpty(C.response.responseText)){var B=Ext.decode(C.response.responseText);if(B.successUpdate){Ext.Msg.show({title:applyTitle,msg:alertMsg78,buttons:Ext.Msg.OK,icon:"iconInformation",fn:function(){Ext.getCmp("disabledDescList").setValue("");
Ext.getCmp("enabledDescList").setValue("");var D=Ext.create("TestDescriptors.view.TestDescriptors");var E=Ext.getCmp("testDescViewPort");myMask=new Ext.LoadMask(E,{msg:"Loading..."});E.removeAll();myMask.show();E.add(D);myMask.hide();}});}}},failure:function(i,B){x.hide();Ext.getCmp("disabledDescList").setValue("");
Ext.getCmp("enabledDescList").setValue("");switch(B.failureType){case Ext.form.action.Action.CLIENT_INVALID:Ext.Msg.show({title:pageName,msg:"Form fields may not be submitted with invalid values",buttons:Ext.MessageBox.OK,icon:"iconExclamation",});break;case Ext.form.action.Action.CONNECT_FAILURE:Ext.Msg.show({title:pageName,msg:"Ajax communication failed",buttons:Ext.MessageBox.OK,icon:"iconExclamation",});
break;case Ext.form.action.Action.SERVER_INVALID:Ext.Msg.show({title:B.result.msg,msg:"Ajax communication failed",buttons:Ext.MessageBox.OK,icon:"iconExclamation",});}}});}}}}}},applyBackBtnEvent:function(){var b=Ext.getCmp("testDescViewPort");myMask=new Ext.LoadMask(Ext.getBody(),{msg:"Loading..."});
myMask.show();var a=Ext.create("TestDescriptors.view.TestDescriptors");b.removeAll();b.add(a);myMask.hide();},populate:function(m){var G=Ext.getCmp("testDescItemSelector").fromField.store;var s=Ext.getCmp("testDescItemSelector").toField.store;var D="";var l="";for(var z=0;z<G.getCount();z++){var x=G.getAt(z).get("groupField");
if(!Ext.isEmpty(x)){continue;}D+=G.getAt(z).get("valueField")+",";}for(var z=0;z<s.getCount();z++){l+=s.getAt(z).get("valueField")+",";}if(D.length>1){D=D.substring(0,D.length-1);}if(l.length>1){l=l.substring(0,l.length-1);}var E=false;var J=new Array();var p=D;var c=publicJson["checkEnabledDesc"];c=","+c+",";
var H="";var y=p.split(",");for(z=0;z<y.length;z++){H=y[z];if(c.indexOf(","+H+",")==-1){J[z]=H;E=true;}}var a=false;var A="false";var B=new Array();var n=l;var g=publicJson["checkDisabledDesc"];var b="";var h=n.split(",");g=","+g+",";for(z=0;z<h.length;z++){b=h[z];if(g.indexOf(","+b+",")==-1){B[z]=b;
A="true";a=true;}}var q=Ext.getCmp("testDescItemSelector").fromField.getValue();var r=Ext.getCmp("testDescItemSelector").toField.getValue();if(!Ext.isEmpty(q)){q=q.filter(function(i){return B.indexOf(i)==-1;});if(q.length>0){E=true;}for(f=0;f<q.length;f++){J.push(q[f]);}}if(!Ext.isEmpty(r)){r=r.filter(function(i){return J.indexOf(i)==-1;
});if(r.length>0){a=true;}for(t=0;t<r.length;t++){B.push(r[t]);}}J=J.filter(function(K,i){return(K!=null&&K!=undefined&&K!=""&&J.indexOf(K)===i);});B=B.filter(function(K,i){return(K!=null&&K!=undefined&&K!=""&&B.indexOf(K)===i);});Ext.getCmp("enabledDescList").setValue(J);Ext.getCmp("disabledDescList").setValue(B);
if(E||a){var o=Ext.getCmp("testDescForm").getForm();var k=publicJson["testName"];var j=m.id;var C=false;var j=m.id;if(!Ext.isEmpty(j)&&j!=undefined&&j=="applyToOtherBtn"){C=true;}existingParams=o.getValues(true);if(C){var F=Ext.getCmp("hiddenURLs");var w="";if(!Ext.isEmpty(F)){w=F.getValue();}var v={xtype:"container",id:"hiddenFieldContainer",layout:{type:"vbox",align:"center",pack:"center"},items:[]};
var d=Ext.create("Ext.selection.CheckboxModel",{selType:"checkboxmodel",mode:"MULTI",checkOnly:true,deselectAll:function(){var N=0;while(typeof(Ext.getCmp("paramsGrid").getStore().getAt(N))!="undefined"){var K=Ext.getCmp("paramsGrid").getStore().getAt(N);Ext.getCmp("paramsGrid").getSelectionModel().deselect(N,true);
N++;}var i=Ext.getCmp("paramsGrid").getView();var M=i.headerCt;var L=M.child("gridcolumn[isCheckerHd]");if(L){}}});var u=Ext.getCmp("testDescViewPort");myMask=new Ext.LoadMask(u,{msg:"Updating..."});u.removeAll();myMask.show();u.add({xtype:"applytoothercomponents"});var e={xtype:"grid",ui:"newGridPanel whiteHeader",id:"paramsGrid",name:"paramsGrid",store:new Ext.data.Store({fields:["DescriptorName","Action","valueField"],data:[]}),title:"Parameters of Testname | Component : Nickname (Componrnt type)",autoScroll:true,selModel:d,columns:{defaults:{sortable:false,hideable:false,menuDisabled:true,draggable:false,resizable:false,isCheckerHd:true},items:[{text:paramName,dataIndex:"DescriptorName",id:"pNameId",checked:true,width:250,},{text:paramValue,dataIndex:"Action",id:"pValueId",flex:1}]},margin:"15 20 15 20",height:150};
var I=Ext.getCmp("tmpApplyToOther");Ext.suspendLayouts();I.removeAll();I.add(e);Ext.resumeLayouts(true);myMask.hide();}}else{Ext.Msg.show({title:pageName,msg:alert7+".<br />"+" (OR) "+"  <br />"+alert8+".",buttons:Ext.Msg.OK,icon:"iconExclamation"});return;}},encodeFieldParamsForQryString:function(e){var e=Ext.Object.fromQueryString(params,true);
var d="";for(var c in e){var b=c;var a=e[c];if(Ext.isEmpty(b)){continue;}d+="&"+b+"="+encodeURIComponent(window.parent.filterEncode(a));}return d;},applyAllMainRender:function(){params="requestFrom=EgConfigureComponentTests.jsp";var c=publicJson["selectedCType"];var b=publicJson["selectedCName"];var g=publicJson["selectedTestName"];
var d=publicJson["selectedTime"];var e="";if(c!=null&&c!="undefined"&&c.length>0){e="componentType="+encodeURIComponent(c);}if(b!=null&&b!="undefined"&&b.length>0){e+="&componentName="+encodeURIComponent(b);}if(g!=null&&g!="undefined"&&g.length>0){e+="&testName="+encodeURIComponent(g);}if(d!=null&&d!="undefined"&&d.length>0){e+="&testPeriod="+d;
}if(e!=null&&e.length>0){params=e;}params+="&"+existingParams;params=main.encodeFieldParamsForQryString(params);var a=Ext.Object.fromQueryString(params,true);Ext.Ajax.request({url:"TestDescriptors/data/EgApplyToOtherComponentsJson.jsp?",method:"POST",params:a,scope:this,success:function(h){var w=h.responseText;
if(h.status==200&&!Ext.isEmpty(w)){publicJson=Ext.decode(w);var r=publicJson["paramsGridArr"];var y=publicJson["viewByArr"];var A=publicJson["selectedViewBy"];var j=publicJson["vecUserOptionsArr"];var s=publicJson["selectedUserOption"];var l=publicJson["dispTestName"];var p=publicJson["displayComponentName"];
var m=publicJson["isEnableUserOptionCombo"];var x=publicJson["allParamsChecked"];var v=publicJson["unmanServersArr"];var z=Ext.getCmp("paramsGrid");var q=Ext.getCmp("ea_criteria");var i=Ext.getCmp("ea_userOption");var u=Ext.getCmp("serversItemSelectors");var n=Ext.getCmp("compFieldSet");var o=publicJson["fieldSetTitle"];
var k=publicJson["gridTitle"];if(!Ext.isEmpty(k)){z.setTitle(k);}if(!Ext.isEmpty(r)&&r!=undefined){z.getStore().loadRawData(r);z.getSelectionModel().selectAll(true);}Ext.getCmp("enabledDescList").setValue(publicJson["enabledDescList"]);Ext.getCmp("disabledDescList").setValue(publicJson["disabledDescList"]);
if(!Ext.isEmpty(o)){n.setTitle(o);}if(u.fromField.store.getCount()>=1){u.fromField.store.removeAll();}if(u.toField.store.getCount()>=1){u.toField.store.removeAll();}if(!Ext.isEmpty(v)&&v!=undefined){u.toField.store.add(v);}}}});},textFieldSearch:function(g){var i=Ext.getCmp("compTypeCombo").getValue();
var j=Ext.getCmp("compNameCombo").getValue();var c=Ext.getCmp("testCombo").getValue();var p=Ext.getCmp("timeLineCombo").getValue();var n="";var q="";if(i=="-1"){Ext.Msg.show({title:pageName,msg:alert1,width:alert1.length*7,buttons:Ext.MessageBox.OK,icon:"iconExclamation",});return false;}var b="";if(g.id=="strEnabledSearch"){var l=Ext.getCmp("strEnabledSearch").getValue();
if(l==""||l.length==0){Ext.get("MyTrigger_"+g.id+"_0").setStyle("display","none");Ext.get("MyTrigger_"+g.id+"_1").setStyle("display","block");}else{Ext.get("MyTrigger_"+g.id+"_1").setStyle("display","none");Ext.get("MyTrigger_"+g.id+"_0").setStyle("display","block");}var k=Ext.getCmp("strDisabledSearch").getValue();
if(k!=null){n=k;if(n==null||n=="undefined"||n=="Search"){n="";}}if(l==null||l==""||l=="Search"||l=="null"){l="";}var m=Ext.getCmp("testDescItemSelector");if(!Ext.isEmpty(m)&&m.hasOwnProperty("fromField")){m=m["fromField"];}if(Ext.String.trim(l).length>0&&(Ext.String.trim(l)!=""||Ext.String.trim(l)!=null)){var h="";
for(var r=0;r<l.length;r++){var s=l.charAt(r);check_char="+*?$.\\([^".indexOf(s);if(check_char!=-1){if(s=="+"){h=l.replace(s,"\\+");}else{if(s=="*"){h=l.replace(s,"\\*");}else{if(s=="?"){h=l.replace(s,"\\?");}else{if(s=="\\"){h=l.replace(s,"\\\\");}else{if(s=="."){h=l.replace(s,"\\.");}else{if(s=="^"){h=l.replace(s,"\\^");
}else{if(s=="$"){h=l.replace(s,"\\$");}else{if(s=="("){h=l.replace(s,"\\(");}else{if(s=="["){h=l.replace(s,"\\[");}}}}}}}}}}}if(!Ext.isEmpty(h)){l=h;}var e=RegExp(l,"i");var a=m.getStore();a.clearFilter(true);a.filter(new Ext.util.Filter({caseSensitive:true,filterFn:function(v){var d=false;Ext.Object.each(v.data,function(x,w){d=d||e.test(String(w));
});return d;}}));}else{m.getStore().clearFilter();}Ext.getCmp("strEnabledSearch").focus();}else{if(g.id=="strDisabledSearch"){var k=Ext.getCmp("strDisabledSearch").getValue();var l=Ext.getCmp("strEnabledSearch");if(k==""||k.length==0){Ext.get("MyTrigger_"+g.id+"_0").setStyle("display","none");Ext.get("MyTrigger_"+g.id+"_1").setStyle("display","block");
}else{Ext.get("MyTrigger_"+g.id+"_1").setStyle("display","none");Ext.get("MyTrigger_"+g.id+"_0").setStyle("display","block");}if(!Ext.isEmpty(l)){q=l.value;if(Ext.isEmpty(q)||q=="Search"||q==""){q="";}}if(Ext.isEmpty(k)||k==""||k=="Search"){k="";}var m=Ext.getCmp("testDescItemSelector");var o=null;if(!Ext.isEmpty(m)&&m.hasOwnProperty("fromField")){o=m["toField"];
}if(Ext.String.trim(k).length>0&&(Ext.String.trim(k)!=""||Ext.String.trim(k)!=null)){var h="";for(var r=0;r<k.length;r++){var s=k.charAt(r);check_char="+*?$.\\^([".indexOf(s);if(check_char!=-1){if(s=="+"){h=k.replace(s,"\\+");}else{if(s=="*"){h=k.replace(s,"\\*");}else{if(s=="?"){h=k.replace(s,"\\?");
}else{if(s=="\\"){h=k.replace(s,"\\\\");}else{if(s=="."){h=k.replace(s,"\\.");}else{if(s=="^"){h=k.replace(s,"\\^");}else{if(s=="$"){h=k.replace(s,"\\$");}else{if(s=="("){h=k.replace(s,"\\(");}else{if(s=="["){h=k.replace(s,"\\[");}}}}}}}}}}}if(!Ext.isEmpty(h)){k=h;}var e=RegExp(k,"i");var u=o.getStore();
u.clearFilter(true);u.filter(new Ext.util.Filter({caseSensitive:true,filterFn:function(v){var d=false;Ext.Object.each(v.data,function(x,w){d=d||e.test(String(w));});return d;}}));}else{o.getStore().clearFilter();}Ext.getCmp("strDisabledSearch").focus();}}},descriptorSearch:function(l){var j=Ext.getCmp("compTypeCombo").getValue();
var d=Ext.getCmp("compNameCombo").getValue();var h=Ext.getCmp("testCombo").getValue();var i=Ext.getCmp("timeLineCombo").getValue();var m=Ext.getCmp("criteria").getValue();var b=Ext.getCmp("userOption").getValue();var g="criteria="+m+"&userOption="+b;var n="";var c="";if(j=="-1"){Ext.Msg.show({title:pageName,msg:alert1,width:alert1.length*7,buttons:Ext.MessageBox.OK,icon:"iconExclamation",});
return false;}var a="";if(l.id=="strEnabledSearch"){var e=Ext.getCmp("strEnabledSearch").getValue();if(e==""||e.length==0){Ext.get("MyTrigger_"+l.id+"_0").setStyle("display","none");Ext.get("MyTrigger_"+l.id+"_1").setStyle("display","block");}else{Ext.get("MyTrigger_"+l.id+"_1").setStyle("display","none");
Ext.get("MyTrigger_"+l.id+"_0").setStyle("display","block");}var k=Ext.getCmp("strDisabledSearch").getValue();if(k!=null){n=k;if(n==null||n=="undefined"||n=="Search"){n="";}}if(e==null||e==""||e=="Search"||e=="null"){a="TestDescriptors/data/EgTestInfoViewJson.jsp?server="+encodeURIComponent(j)+"&comp="+encodeURIComponent(d)+"&testName="+encodeURIComponent(h)+"&duration="+i+"&strEnabledSearch="+e+"&strDisabledSearch="+n;
}else{a="TestDescriptors/data/EgTestInfoViewJson.jsp?server="+encodeURIComponent(j)+"&comp="+encodeURIComponent(d)+"&testName="+encodeURIComponent(h)+"&duration="+encodeURIComponent(i)+"&strEnabledSearch="+e+"&strDisabledSearch="+n;}}else{if(l.id=="strDisabledSearch"){var k=Ext.getCmp("strDisabledSearch").getValue();
var e=Ext.getCmp("strEnabledSearch");if(k==""||k.length==0){Ext.get("MyTrigger_"+l.id+"_0").setStyle("display","none");Ext.get("MyTrigger_"+l.id+"_1").setStyle("display","block");}else{Ext.get("MyTrigger_"+l.id+"_1").setStyle("display","none");Ext.get("MyTrigger_"+l.id+"_0").setStyle("display","block");
}if(!Ext.isEmpty(e)){c=e.value;if(Ext.isEmpty(c)||c=="Search"||c==""){c="";}}if(Ext.isEmpty(k)||k==""||k=="Search"){a="TestDescriptors/data/EgTestInfoViewJson.jsp?server="+encodeURIComponent(j)+"&comp="+encodeURIComponent(d)+"&testName="+encodeURIComponent(h)+"&duration="+i+"&strEnabledSearch="+c+"&strDisabledSearch="+k;
}else{a="TestDescriptors/data/EgTestInfoViewJson.jsp?server="+encodeURIComponent(j)+"&comp="+encodeURIComponent(d)+"&testName="+encodeURIComponent(h)+"&duration="+encodeURIComponent(i)+"&strEnabledSearch="+c+"&strDisabledSearch="+k;}}}Ext.Ajax.request({url:a,method:"post",params:g,scope:this,success:function(q){var p=q.responseText;
publicJson=Ext.decode(p);var w=publicJson["No_descriptor"];var z=publicJson["commonDescListArr"];var u=publicJson["requestFrom"];if(u=="processUpdated"){Ext.getCmp("processUpdateContainer").show();}if(Ext.isEmpty(w)){var y=publicJson["commonDescListArr"];var x=publicJson["disableDescListObj"];Ext.getCmp("noDataContainer").hide();
Ext.getCmp("testDescItemSelectorCont").show();Ext.getCmp("testDescItemSelector").show();Ext.getCmp("btnContainer").show();var o=publicJson["applyOtherComps"];if(o){Ext.getCmp("applyToOtherBtn").setDisabled(false);Ext.getCmp("applyToOtherBtn").show();}else{Ext.getCmp("applyToOtherBtn").setDisabled(true);
Ext.getCmp("applyToOtherBtn").hide();}var v=publicJson["enableDescListArr"];var r=publicJson["disableDescListArr"];var s=Ext.getCmp("testDescItemSelector");s.getStore().clearFilter(true);if(s.fromField.store.getCount()>=1){s.fromField.store.removeAll();}if(s.toField.store.getCount()>=1){s.toField.store.removeAll();
}if(!Ext.isEmpty(v)&&v!=undefined){s.fromField.store.add(v);}if(!Ext.isEmpty(r)&&r!=undefined){s.toField.store.add(r);}}else{Ext.getCmp("processUpdateContainer").hide();Ext.getCmp("testDescItemSelectorCont").hide();Ext.getCmp("testDescItemSelector").hide();Ext.getCmp("btnContainer").hide();Ext.getCmp("searchContainer").hide();
Ext.getCmp("noDataContainer").show();}}});},deleteData:function(){var m=this;var k=Ext.getCmp("compTypeCombo").getValue();var a=Ext.getCmp("compNameCombo").getValue();var g=Ext.getCmp("testCombo").getValue();var h=Ext.getCmp("timeLineCombo").getValue();var l=Ext.getCmp("testDescItemSelector").toField.getSelected();
var q=false;var e=publicJson["disableDescListObj"];var p="";for(var d=0;d<l.length;d++){var o=l[d].get("valueField");p+=o+",";}if(e!=null&&e!="undefined"){for(var d=0;d<l.length;d++){var n=l[d].get("valueField");for(var c=0;c<e.length;c++){if(n==e[c]){q=true;break;}}}}if(p==""){Ext.MessageBox.show({title:pageName,msg:alert2,width:alert2.length*7,icon:"iconExclamation",buttons:Ext.Msg.OK,});
}else{if(!q){Ext.MessageBox.show({title:pageName,msg:alert3,icon:"iconExclamation",buttons:Ext.Msg.OK,width:alert3.length*7});}else{if(p.length>1){p=p.substring(0,p.length-1);}var b="server="+encodeURIComponent(k)+"&comp="+encodeURIComponent(a)+"&testName="+encodeURIComponent(g)+"&duration="+encodeURIComponent(h)+"&from=delete";
Ext.Msg.show({title:pageName,msg:alert4,width:alert4.length*7,icon:"iconConfirmation",buttons:Ext.Msg.YESNO,fn:function(i){if(i=="yes"){Ext.getCmp("disabledDescList").setValue(p);var j="TestDescriptors/data/Egtestinfoviewp.jsp?"+b;m.deleteSelectedComponent(j);}}});}}},deleteSelectedComponent:function(g){var k=this;
var j=Ext.getCmp("compTypeCombo").getValue();var b=Ext.getCmp("compNameCombo").getValue();var h=Ext.getCmp("testCombo").getValue();var i=Ext.getCmp("timeLineCombo").getValue();var c=new Ext.LoadMask(Ext.getBody(),{msg:"Updating..."});c.show();var e=this.getTestdescriptors().getForm();var o=Ext.getCmp("enabledDescList").getValue();
var d=Ext.getCmp("enabledDescList").getValue();var n="server="+encodeURIComponent(j)+"&comp="+b+"&testName="+h+"&duration="+i+"&requestFrom=processUpdated";var p=Ext.getCmp("strEnabledSearch").getValue();var m=Ext.getCmp("strDisabledSearch").getValue();if(p!=null&&p!="undefined"){n+="&strEnabledSearch="+p;
}if(m!=null&&m!="undefined"){n+="&strDisabledSearch="+m;}var l=Ext.getCmp("criteria").getValue();var a=Ext.getCmp("userOption").getValue();n+="&criteria="+l+"&userOption="+a;if(e.isValid()){this.getTestdescriptors().submit({url:g,method:"POST",success:function(q,r){c.hide();k.afterDescriptorDeleted(n);
Ext.getCmp("disabledDescList").setValue("");Ext.getCmp("enabledDescList").setValue("");},failure:function(q,s){var r=Ext.decode(s.response.responseText);if(r.successUpdate=="true"){c.hide();k.afterDescriptorDeleted(n);Ext.getCmp("disabledDescList").setValue("");Ext.getCmp("enabledDescList").setValue("");
}else{c.hide();k.afterDescriptorDeleted(n);Ext.getCmp("disabledDescList").setValue("");Ext.getCmp("enabledDescList").setValue("");}}});}},afterDescriptorDeleted:function(a){var c="TestDescriptors/data/EgTestInfoViewJson.jsp?"+a;var b=this;Ext.Ajax.request({url:c,method:"post",params:a,scope:this,success:function(h){var g=h.responseText;
publicJson=Ext.decode(g);var n=publicJson["No_descriptor"];var u=publicJson["commonDescListArr"];var l=publicJson["requestFrom"];if(l=="processUpdated"){Ext.getCmp("processUpdateContainer").show();}if(n==null||Ext.isEmpty(n)){var s=publicJson["commonDescListArr"];var m=publicJson["enableDescListArr"];
var j=publicJson["disableDescListArr"];var r=publicJson["disableDescListObj"];var v=publicJson["avail_desc_search"];var q=publicJson["disable_desc_search"];var o=false;var e=false;if(v!=null&&v!="undefined"&&v=="true"){Ext.getCmp("searchContainer").show();Ext.getCmp("strEnabledSearch").show();o=true;
if(Ext.isEmpty(q)||v!="true"){Ext.getCmp("strDisabledSearch").setValue("");Ext.getCmp("strDisabledSearch").hide();e=false;}}if(q!=null&&q!="undefined"&&q=="true"){Ext.getCmp("searchContainer").show();Ext.getCmp("strDisabledSearch").show();e=true;if(Ext.isEmpty(v)||v!="true"){Ext.getCmp("strEnabledSearch").setValue("");
Ext.getCmp("strEnabledSearch").hide();o=false;}}if((v!=null&&v!="true")&&(q!=null&&q!="true")){Ext.getCmp("searchContainer").hide();Ext.getCmp("strEnabledSearch").hide();Ext.getCmp("strDisabledSearch").hide();e=false;o=false;}Ext.getCmp("noDataContainer").hide();Ext.getCmp("testDescItemSelectorCont").show();
Ext.getCmp("testDescItemSelector").show();Ext.getCmp("btnContainer").show();var d=publicJson["applyOtherComps"];if(d){Ext.getCmp("applyToOtherBtn").setDisabled(false);Ext.getCmp("applyToOtherBtn").show();}else{Ext.getCmp("applyToOtherBtn").setDisabled(true);Ext.getCmp("applyToOtherBtn").hide();}var k=Ext.getCmp("testDescItemSelector");
k.getStore().clearFilter(true);if(k.fromField.store.getCount()>=1){k.fromField.store.removeAll();}if(k.toField.store.getCount()>=1){k.toField.store.removeAll();}if(!Ext.isEmpty(m)&&m!=undefined){k.fromField.store.add(m);}if(!Ext.isEmpty(j)&&j!=undefined){k.toField.store.add(j);}if(o){var p=Ext.getCmp("strEnabledSearch").getValue();
if(!Ext.isEmpty(p)){Ext.getCmp("strEnabledSearch").fireEvent("change",Ext.getCmp("strEnabledSearch"));}}if(e){var i=Ext.getCmp("strDisabledSearch").getValue();if(!Ext.isEmpty(i)){Ext.getCmp("strDisabledSearch").fireEvent("change",Ext.getCmp("strDisabledSearch"));}}}else{Ext.getCmp("processUpdateContainer").hide();
Ext.getCmp("testDescItemSelectorCont").hide();Ext.getCmp("testDescItemSelector").hide();Ext.getCmp("btnContainer").hide();Ext.getCmp("searchContainer").hide();Ext.getCmp("noDataContainer").show();}}});},afterMainRender:function(){var a="";var c=sessionStorage.getItem("criteria");var b=sessionStorage.getItem("userOption");
if(!Ext.isEmpty(c)&&c!=null&&c!="undefined"){a="criteria="+c;if(c!="component"){if(!Ext.isEmpty(b)&&b!=null&&b!="undefined"&&b!="-1"){a+="&userOption="+b;}}}Ext.Ajax.request({url:"TestDescriptors/data/EgTestInfoViewJson.jsp?",method:"post",params:a,scope:this,success:function(e){var h=e.responseText;
publicJson=Ext.decode(h);var j=publicJson["isNoData"];if(j){var g=publicJson["No_data"];Ext.getCmp("comboContainer").hide();Ext.getCmp("noDataContainer").show();Ext.getCmp("noDataLabel").update(g);}else{Ext.getCmp("comboContainer").show();Ext.getCmp("noDataContainer").hide();var d=Ext.getCmp("userOption");
var i=Ext.getCmp("criteria");i.getStore().loadRawData(publicJson["viewByArr"]);i.setValue(publicJson.selectedCriteria);if(Ext.isEmpty(c)||c==null||c=="undefined"){sessionStorage.setItem("criteria",publicJson.selectedCriteria);}if(publicJson.selectedCriteria!="Component"){d.getStore().loadRawData(publicJson.specViewByArr);
d.setFieldLabel(publicJson.specViewByTitle);d.setValue(publicJson.selectedUserOptionText);d.show();if(Ext.isEmpty(b)||b==null||b=="undefined"||b=="-1"){sessionStorage.setItem("userOption",publicJson.selectedUserOptionText);}}else{d.hide();}if(!Ext.isEmpty(publicJson.selectedCriteria)){Ext.getCmp("criteria").fireEvent("select",Ext.getCmp("criteria"));
}}}});},compNameComboLoad:function(){var a=Ext.getCmp("compNameCombo").getValue();if(!Ext.isEmpty(comp)&&!Ext.isEmpty(a)){if(comp!=a){test="";duration="";}}var b=Ext.getCmp("compTypeCombo").getValue();var e=Ext.getCmp("criteria").getValue();var c=Ext.getCmp("userOption").getValue();var d="criteria="+e+"&userOption="+c;
if(Ext.isEmpty(b)||(b==null||b=="undefined"||b=="-1")){if(!Ext.getCmp("testDescItemSelector").isHidden()){Ext.getCmp("testDescItemSelectorCont").hide();Ext.getCmp("testDescItemSelector").hide();Ext.getCmp("btnContainer").hide();Ext.getCmp("searchContainer").hide();}Ext.getCmp("processUpdateContainer").hide();
Ext.getCmp("noDataContainer").hide();comp="";test="";this.afterMainRender();}else{if((b!=null&&b!="undefined"&&b!="-1")&&(Ext.isEmpty(a)||(a==null||a=="undefined"||a=="-1"))){comp="";Ext.Ajax.request({url:"TestDescriptors/data/EgTestInfoViewJson.jsp?server="+encodeURIComponent(b),method:"post",params:d,scope:this,async:false,success:function(g){var h=g.responseText;
publicJson=Ext.decode(h);Ext.getCmp("compNameCombo").getStore().removeAll();Ext.getCmp("compNameCombo").getStore().clearFilter(true);Ext.getCmp("compNameCombo").getStore().loadRawData(publicJson["descCompNameArr"]);Ext.getCmp("testCombo").getStore().removeAll();Ext.getCmp("testCombo").getStore().clearFilter(true);
Ext.getCmp("testCombo").getStore().loadRawData(publicJson["descTestNameArr"]);Ext.getCmp("timeLineCombo").getStore().removeAll();Ext.getCmp("timeLineCombo").getStore().loadRawData(publicJson["descTimeLimitArr"]);if(!Ext.getCmp("testDescItemSelector").isHidden()){Ext.getCmp("testDescItemSelectorCont").hide();
Ext.getCmp("testDescItemSelector").hide();Ext.getCmp("btnContainer").hide();Ext.getCmp("searchContainer").hide();Ext.getCmp("strEnabledSearch").setValue("");Ext.getCmp("strDisabledSearch").setValue("");}Ext.getCmp("noDataContainer").hide();Ext.getCmp("processUpdateContainer").hide();Ext.getCmp("compNameCombo").setValue(publicJson["descCompNameArr"][0].valueField);
Ext.getCmp("testCombo").setValue(publicJson["descTestNameArr"][0].valueField);Ext.getCmp("timeLineCombo").setValue(publicJson["selectedTime"]);Ext.getCmp("timeLineCombo").setDisabled(true);}});}else{comp=a;Ext.Ajax.request({url:"TestDescriptors/data/EgTestInfoViewJson.jsp?server="+encodeURIComponent(b)+"&comp="+encodeURIComponent(a),method:"post",params:d,scope:this,async:false,success:function(g){var h=g.responseText;
publicJson=Ext.decode(h);Ext.getCmp("testCombo").getStore().removeAll();Ext.getCmp("testCombo").getStore().clearFilter(true);Ext.getCmp("testCombo").getStore().loadRawData(publicJson["descTestNameArr"]);if(!Ext.isEmpty(test)){Ext.getCmp("testCombo").setValue(test);Ext.getCmp("testCombo").fireEvent("select",Ext.getCmp("testCombo"));
}else{Ext.getCmp("timeLineCombo").getStore().removeAll();Ext.getCmp("timeLineCombo").getStore().loadRawData(publicJson["descTimeLimitArr"]);if(!Ext.getCmp("testDescItemSelector").isHidden()){Ext.getCmp("testDescItemSelectorCont").hide();Ext.getCmp("testDescItemSelector").hide();Ext.getCmp("btnContainer").hide();
Ext.getCmp("searchContainer").hide();Ext.getCmp("strEnabledSearch").setValue("");Ext.getCmp("strDisabledSearch").setValue("");}Ext.getCmp("noDataContainer").hide();Ext.getCmp("processUpdateContainer").hide();Ext.getCmp("testCombo").setValue(publicJson["descTestNameArr"][0].valueField);Ext.getCmp("timeLineCombo").setValue(publicJson["selectedTime"]);
Ext.getCmp("timeLineCombo").setDisabled(true);}}});}}},testNameComboLoad:function(){var a=Ext.getCmp("testCombo").getValue();if(!Ext.isEmpty(test)&&!Ext.isEmpty(a)){if(test!=a){duration="";}}var c=Ext.getCmp("compTypeCombo").getValue();var b=Ext.getCmp("compNameCombo").getValue();var g=Ext.getCmp("criteria").getValue();
var d=Ext.getCmp("userOption").getValue();var e="criteria="+g+"&userOption="+d;if(Ext.isEmpty(c)||(c==null||c=="undefined"||c=="-1")){if(!Ext.getCmp("testDescItemSelector").isHidden()){Ext.getCmp("testDescItemSelectorCont").hide();Ext.getCmp("testDescItemSelector").hide();Ext.getCmp("btnContainer").hide();
Ext.getCmp("searchContainer").hide();}Ext.getCmp("processUpdateContainer").hide();Ext.getCmp("noDataContainer").hide();comp="";test="";this.afterMainRender();}else{if((c!=null&&c!="undefined"&&c!="-1")&&(Ext.isEmpty(b)||(b==null||b=="undefined"||b=="-1"))){comp="";test="";Ext.Ajax.request({url:"TestDescriptors/data/EgTestInfoViewJson.jsp?server="+encodeURIComponent(c),method:"post",params:e,scope:this,async:false,success:function(h){var i=h.responseText;
publicJson=Ext.decode(i);Ext.getCmp("compNameCombo").getStore().removeAll();Ext.getCmp("compNameCombo").getStore().clearFilter(true);Ext.getCmp("compNameCombo").getStore().loadRawData(publicJson["descCompNameArr"]);Ext.getCmp("testCombo").getStore().removeAll();Ext.getCmp("testCombo").getStore().clearFilter(true);
Ext.getCmp("testCombo").getStore().loadRawData(publicJson["descTestNameArr"]);Ext.getCmp("timeLineCombo").getStore().removeAll();Ext.getCmp("timeLineCombo").getStore().loadRawData(publicJson["descTimeLimitArr"]);if(!Ext.getCmp("testDescItemSelector").isHidden()){Ext.getCmp("testDescItemSelectorCont").hide();
Ext.getCmp("testDescItemSelector").hide();Ext.getCmp("btnContainer").hide();Ext.getCmp("searchContainer").hide();}Ext.getCmp("noDataContainer").hide();Ext.getCmp("processUpdateContainer").hide();Ext.getCmp("compNameCombo").setValue(publicJson["descCompNameArr"][0].valueField);Ext.getCmp("testCombo").setValue(publicJson["descTestNameArr"][0].valueField);
Ext.getCmp("timeLineCombo").setValue(publicJson["selectedTime"]);Ext.getCmp("timeLineCombo").setDisabled(true);}});}else{if((c!=null&&c!="undefined"&&c!="-1")&&(b!=null&&b!="undefined"&&b!="-1")&&(Ext.isEmpty(a)||(a==null||a=="undefined"||a=="-1"))){test="";Ext.Ajax.request({url:"TestDescriptors/data/EgTestInfoViewJson.jsp?server="+encodeURIComponent(c)+"&comp="+encodeURIComponent(b),method:"post",params:e,scope:this,async:false,success:function(h){var i=h.responseText;
publicJson=Ext.decode(i);Ext.getCmp("testCombo").getStore().removeAll();Ext.getCmp("testCombo").getStore().clearFilter(true);Ext.getCmp("testCombo").getStore().loadRawData(publicJson["descTestNameArr"]);Ext.getCmp("timeLineCombo").getStore().removeAll();Ext.getCmp("timeLineCombo").getStore().loadRawData(publicJson["descTimeLimitArr"]);
if(!Ext.getCmp("testDescItemSelector").isHidden()){Ext.getCmp("testDescItemSelectorCont").hide();Ext.getCmp("testDescItemSelector").hide();Ext.getCmp("btnContainer").hide();Ext.getCmp("searchContainer").hide();}Ext.getCmp("noDataContainer").hide();Ext.getCmp("processUpdateContainer").hide();Ext.getCmp("testCombo").setValue(publicJson["descTestNameArr"][0].valueField);
Ext.getCmp("timeLineCombo").setValue(publicJson["selectedTime"]);Ext.getCmp("timeLineCombo").setDisabled(true);}});}else{test=a;Ext.Ajax.request({url:"TestDescriptors/data/EgTestInfoViewJson.jsp?server="+encodeURIComponent(c)+"&comp="+encodeURIComponent(b)+"&testName="+encodeURIComponent(a),method:"post",params:e,scope:this,async:false,success:function(k){var j=k.responseText;
publicJson=Ext.decode(j);Ext.getCmp("timeLineCombo").getStore().removeAll();Ext.getCmp("timeLineCombo").getStore().loadRawData(publicJson["descTimeLimitArr"]);Ext.getCmp("timeLineCombo").setValue(publicJson["selectedTime"]);Ext.getCmp("timeLineCombo").setDisabled(false);if(!Ext.isEmpty(duration)){Ext.getCmp("timeLineCombo").setValue(duration);
Ext.getCmp("timeLineCombo").fireEvent("select",Ext.getCmp("timeLineCombo"));}else{var u=publicJson["commonDescListArr"];Ext.getCmp("processUpdateContainer").hide();if(u!=null&&u!="undefined"&&u.length>0){Ext.getCmp("testDescItemSelectorCont").show();Ext.getCmp("testDescItemSelector").show();Ext.getCmp("btnContainer").show();
Ext.getCmp("searchContainer").hide();Ext.getCmp("noDataContainer").hide();Ext.getCmp("strEnabledSearch").setValue("");Ext.getCmp("strDisabledSearch").setValue("");Ext.getCmp("strEnabledSearch").hide();Ext.getCmp("strDisabledSearch").hide();var h=publicJson["applyOtherComps"];if(h){Ext.getCmp("applyToOtherBtn").setDisabled(false);
Ext.getCmp("applyToOtherBtn").show();}else{Ext.getCmp("applyToOtherBtn").setDisabled(true);Ext.getCmp("applyToOtherBtn").hide();}var n=publicJson["enable_delete_btn"];var v=publicJson["avail_desc_search"];var s=publicJson["disable_desc_search"];var q=false;var i=false;if(!Ext.isEmpty(v)&&v!="undefined"&&v=="true"){Ext.getCmp("searchContainer").show();
Ext.getCmp("strEnabledSearch").show();Ext.getCmp("strDisabledSearch").hide();q=true;}if(!Ext.isEmpty(s)&&s!="undefined"&&s=="true"){Ext.getCmp("searchContainer").show();Ext.getCmp("strDisabledSearch").show();i=true;if(!Ext.isEmpty(v)&&v!="true"){q=false;Ext.getCmp("strEnabledSearch").hide();}}Ext.getCmp("testDescItemSelector").getStore().clearFilter(true);
var o=Ext.getCmp("testDescItemSelector");if(o.fromField.store.getCount()>=1){o.fromField.store.removeAll();}if(o.toField.store.getCount()>=1){o.toField.store.removeAll();}var p=publicJson["enableDescListArr"];var m=publicJson["disableDescListArr"];if(!Ext.isEmpty(p)&&p!=undefined){o.fromField.store.add(p);
}if(!Ext.isEmpty(m)&&m!=undefined){o.toField.store.add(m);}if(q){var r=Ext.getCmp("strEnabledSearch").getValue();if(!Ext.isEmpty(r)){Ext.getCmp("strEnabledSearch").fireEvent("change",Ext.getCmp("strEnabledSearch"));}}if(i){var l=Ext.getCmp("strDisabledSearch").getValue();if(!Ext.isEmpty(l)){Ext.getCmp("strDisabledSearch").fireEvent("change",Ext.getCmp("strDisabledSearch"));
}}}else{Ext.getCmp("testDescItemSelectorCont").hide();Ext.getCmp("testDescItemSelector").hide();Ext.getCmp("btnContainer").hide();Ext.getCmp("searchContainer").hide();Ext.getCmp("noDataContainer").show();Ext.getCmp("strEnabledSearch").setValue("");Ext.getCmp("strDisabledSearch").setValue("");Ext.getCmp("strEnabledSearch").hide();
Ext.getCmp("strDisabledSearch").hide();}}}});}}}},compTypeComboLoad:function(){var a=Ext.getCmp("compTypeCombo").getValue();if(!Ext.isEmpty(compType)&&!Ext.isEmpty(a)){if(compType!=a){comp="";test="";duration="";}}if(Ext.isEmpty(a)||(a==null||a=="undefined"||a=="-1")){compType="";if(!Ext.getCmp("testDescItemSelector").isHidden()){Ext.getCmp("testDescItemSelectorCont").hide();
Ext.getCmp("testDescItemSelector").hide();Ext.getCmp("btnContainer").hide();Ext.getCmp("searchContainer").hide();}Ext.getCmp("processUpdateContainer").hide();Ext.getCmp("noDataContainer").hide();comp="";test="";this.afterMainRender();}else{if(a!=null&&a!="undefined"&&a!="-1"){var d=Ext.getCmp("criteria").getValue();
var b=Ext.getCmp("userOption").getValue();var c="criteria="+d+"&userOption="+b;compType=a;Ext.Ajax.request({url:"TestDescriptors/data/EgTestInfoViewJson.jsp?server="+encodeURIComponent(a),method:"post",params:c,scope:this,async:false,success:function(e){var g=e.responseText;publicJson=Ext.decode(g);Ext.getCmp("compNameCombo").getStore().removeAll();
Ext.getCmp("compNameCombo").getStore().clearFilter(true);Ext.getCmp("compNameCombo").getStore().loadRawData(publicJson["descCompNameArr"]);Ext.getCmp("compNameCombo").setValue(publicJson["descCompNameArr"][0].valueField);if(!Ext.isEmpty(comp)){Ext.getCmp("compNameCombo").setValue(comp);Ext.getCmp("compNameCombo").fireEvent("select",Ext.getCmp("compNameCombo"));
}else{Ext.getCmp("testCombo").getStore().removeAll();Ext.getCmp("testCombo").getStore().clearFilter(true);Ext.getCmp("testCombo").getStore().loadRawData(publicJson["descTestNameArr"]);Ext.getCmp("testCombo").setValue(publicJson["descTestNameArr"][0].valueField);Ext.getCmp("timeLineCombo").getStore().removeAll();
Ext.getCmp("timeLineCombo").getStore().loadRawData(publicJson["descTimeLimitArr"]);Ext.getCmp("timeLineCombo").setValue(publicJson["selectedTime"]);Ext.getCmp("timeLineCombo").setDisabled(true);if(!Ext.getCmp("testDescItemSelector").isHidden()){Ext.getCmp("testDescItemSelectorCont").hide();Ext.getCmp("testDescItemSelector").hide();
Ext.getCmp("btnContainer").hide();Ext.getCmp("searchContainer").hide();}Ext.getCmp("processUpdateContainer").hide();Ext.getCmp("noDataContainer").hide();}}});}}},timeLineComboLoad:function(){var c=Ext.getCmp("compTypeCombo").getValue();var b=Ext.getCmp("compNameCombo").getValue();var a=Ext.getCmp("testCombo").getValue();
var e=Ext.getCmp("timeLineCombo").getValue();Ext.getCmp("processUpdateContainer").hide();if(Ext.isEmpty(c)||(c==null||c=="undefined"||c=="-1")){if(!Ext.getCmp("testDescItemSelector").isHidden()){Ext.getCmp("testDescItemSelectorCont").hide();Ext.getCmp("testDescItemSelector").hide();Ext.getCmp("btnContainer").hide();
Ext.getCmp("searchContainer").hide();}Ext.getCmp("processUpdateContainer").hide();Ext.getCmp("noDataContainer").hide();this.afterMainRender();}else{var h=Ext.getCmp("criteria").getValue();var d=Ext.getCmp("userOption").getValue();var g="criteria="+h+"&userOption="+d;duration=e;Ext.Ajax.request({url:"TestDescriptors/data/EgTestInfoViewJson.jsp?server="+encodeURIComponent(c)+"&comp="+encodeURIComponent(b)+"&testName="+encodeURIComponent(a)+"&duration="+encodeURIComponent(e),method:"post",params:g,scope:this,async:false,success:function(l){var k=l.responseText;
publicJson=Ext.decode(k);var u=publicJson["commonDescListArr"];if(u!=null&&u!="undefined"&&u.length>0){var q=false;var j=false;var v=publicJson["avail_desc_search"];var s=publicJson["disable_desc_search"];if(!Ext.isEmpty(v)||!Ext.isEmpty(s)){Ext.getCmp("searchContainer").show();if(Ext.isEmpty(v)||v!="true"){Ext.getCmp("strEnabledSearch").hide();
}else{Ext.getCmp("strEnabledSearch").show();q=true;}if(Ext.isEmpty(s)||s!="true"){Ext.getCmp("strDisabledSearch").hide();}else{Ext.getCmp("strDisabledSearch").show();j=true;}}Ext.getCmp("noDataContainer").hide();Ext.getCmp("testDescItemSelectorCont").show();Ext.getCmp("testDescItemSelector").show();Ext.getCmp("btnContainer").show();
Ext.getCmp("testDescItemSelector").getStore().removeAll();Ext.getCmp("testDescItemSelector").getStore().clearFilter(true);var p=publicJson["enableDescListArr"];var n=publicJson["disableDescListArr"];var o=Ext.getCmp("testDescItemSelector");o.getStore().clearFilter(true);if(o.fromField.store.getCount()>=1){o.fromField.store.removeAll();
}if(o.toField.store.getCount()>=1){o.toField.store.removeAll();}if(!Ext.isEmpty(p)&&p!=undefined){o.fromField.store.add(p);}if(!Ext.isEmpty(n)&&n!=undefined){o.toField.store.add(n);}var i=publicJson["applyOtherComps"];if(i){Ext.getCmp("applyToOtherBtn").setDisabled(false);Ext.getCmp("applyToOtherBtn").show();
}else{Ext.getCmp("applyToOtherBtn").setDisabled(true);Ext.getCmp("applyToOtherBtn").hide();}if(q){var r=Ext.getCmp("strEnabledSearch").getValue();if(!Ext.isEmpty(r)){Ext.getCmp("strEnabledSearch").fireEvent("change",Ext.getCmp("strEnabledSearch"));}}if(j){var m=Ext.getCmp("strDisabledSearch").getValue();
if(!Ext.isEmpty(m)){Ext.getCmp("strDisabledSearch").fireEvent("change",Ext.getCmp("strDisabledSearch"));}}}else{Ext.getCmp("testDescItemSelectorCont").hide();Ext.getCmp("testDescItemSelector").hide();Ext.getCmp("btnContainer").hide();Ext.getCmp("searchContainer").hide();Ext.getCmp("noDataContainer").show();
}}});}},updateData:function(n){var C=this;var j=Ext.getCmp("compTypeCombo").getValue();var k=Ext.getCmp("compNameCombo").getValue();var d=Ext.getCmp("testCombo").getValue();var s=Ext.getCmp("timeLineCombo").getValue();Ext.getCmp("processUpdateContainer").hide();var p=Ext.getCmp("strEnabledSearch");var l=Ext.getCmp("strDisabledSearch");
var b="";if(j=="-1"){Ext.Msg.show({title:pageName,msg:alert1,width:alert1.length*7,buttons:Ext.MessageBox.OK,icon:"iconExclamation",});return;}else{if(k=="-1"){Ext.Msg.show({title:pageName,msg:alert5,width:alert5.length*7,buttons:Ext.MessageBox.OK,icon:"iconExclamation",});return;}else{if(d=="-1"){Ext.Msg.show({title:pageName,msg:alert6,width:alert6.length*7,buttons:Ext.MessageBox.OK,icon:"iconExclamation",});
return;}}}if(p!=null){if(p==null||p=="undefined"||p=="null"){tmpVal="";b="false";}else{tmpVal=p.getValue();if(tmpVal==null||tmpVal=="undefined"||tmpVal=="null"||tmpVal==""||tmpVal=="Search"){tmpVal="";b="flase";}else{b="true";}}}var D=Ext.getCmp("testDescItemSelector").fromField.store;var u=Ext.getCmp("testDescItemSelector").toField.store;
var A="";var m="";for(var w=0;w<D.getCount();w++){A+=D.getAt(w).get("valueField")+",";}for(var w=0;w<u.getCount();w++){m+=u.getAt(w).get("valueField")+",";}if(A.length>1){A=A.substring(0,A.length-1);}if(m.length>1){m=m.substring(0,m.length-1);}Ext.getCmp("enabledDescList").setValue((window.parent.filterEncode(A)));
Ext.getCmp("disabledDescList").setValue((window.parent.filterEncode(m)));var B=false;var F=new Array();var r=A;var e=publicJson["checkEnabledDesc"];e=","+e+",";var E="";var v=r.split(",");for(w=0;w<v.length;w++){E=v[w];if(e.indexOf(","+E+",")==-1){F[w]=E;B=true;}}var a=false;var y="false";var x=new Array();
var o=m;var g=publicJson["checkDisabledDesc"];var c="";var h=o.split(",");g=","+g+",";for(w=0;w<h.length;w++){c=h[w];if(g.indexOf(","+c+",")==-1){x[w]=c;y="true";a=true;}}if(B||a){var z="server="+encodeURIComponent(j)+"&comp="+encodeURIComponent(k)+"&testName="+encodeURIComponent(d)+"&duration="+encodeURIComponent(s)+"&isSearchBox="+b+"&disableaction="+y;
var q="TestDescriptors/data/Egtestinfoviewp.jsp?"+z;C.updateSelectedDescriptors(q);}else{Ext.Msg.show({title:pageName,msg:alert7,width:alert7.length*7,buttons:Ext.MessageBox.OK,icon:"iconExclamation",});return;}},updateSelectedDescriptors:function(g){var k=this;var j=Ext.getCmp("compTypeCombo").getValue();
var b=Ext.getCmp("compNameCombo").getValue();var h=Ext.getCmp("testCombo").getValue();var i=Ext.getCmp("timeLineCombo").getValue();var c=new Ext.LoadMask(Ext.getBody(),{msg:"Updating..."});c.show();var e=this.getTestdescriptors().getForm();var o=Ext.getCmp("enabledDescList").getValue();var d=Ext.getCmp("enabledDescList").getValue();
var p=Ext.getCmp("strEnabledSearch").getValue();var n=Ext.getCmp("strDisabledSearch").getValue();var m="server="+encodeURIComponent(j)+"&comp="+encodeURIComponent(b)+"&testName="+h+"&duration="+i+"&requestFrom=processUpdated";if(p!=null&&p!="undefined"){m+="&strEnabledSearch="+p;}if(n!=null&&n!="undefined"){m+="&strDisabledSearch="+n;
}var l=Ext.getCmp("criteria").getValue();var a=Ext.getCmp("userOption").getValue();m+="&criteria="+l+"&userOption="+a;if(e.isValid()){this.getTestdescriptors().submit({url:g,method:"POST",timeout:9000,success:function(q,r){c.hide();k.afterDescriptorDeleted(m);Ext.getCmp("disabledDescList").setValue("");
Ext.getCmp("enabledDescList").setValue("");},failure:function(q,r){Ext.getCmp("disabledDescList").setValue("");Ext.getCmp("enabledDescList").setValue("");c.hide();switch(r.failureType){case Ext.form.action.Action.CLIENT_INVALID:Ext.Msg.show({title:pageName,msg:"Form fields may not be submitted with invalid values",buttons:Ext.MessageBox.OK,icon:"iconExclamation",});
break;case Ext.form.action.Action.CONNECT_FAILURE:Ext.Msg.show({title:pageName,msg:"Ajax communication failed",buttons:Ext.MessageBox.OK,icon:"iconExclamation",});break;case Ext.form.action.Action.SERVER_INVALID:Ext.Msg.show({title:r.result.msg,msg:"Ajax communication failed",buttons:Ext.MessageBox.OK,icon:"iconExclamation",});
}}});}}});