Ext.define("ErReportBuilderDrillDown.controller.ErReportBuilderDrillDownController",{extend:"ErReportBuilderDrillDown.controller.BuilderController",refs:[{selector:"main",ref:"main"},{selector:"buildersettings",ref:"buildersettings"},{selector:"templateformalias",ref:"templateformalias"},{selector:"templateformitemsalias",ref:"templateformitemsalias"},{selector:"newUtilities",ref:"newUtilities"},{selector:"gridster",ref:"gridster"},{selector:"#widgetLayoutPane",ref:"widgetLayoutPane"},],method:appConstants.method,init:function(){this.control({"templateformalias":{"render":this.invokeSettings,"afterrender":this.onAjaxSuccess},"templateformalias combo[id=er_option]":{"select":this.ajaxQueryMaker},"templateformalias combo[id=er_site]":{"select":this.ajaxQueryMaker},"templateformalias combo[id=er_compType]":{"select":this.ajaxQueryMaker},"egcomponenttype multiselectfield[id=er_mutiSelComp]":{"change":this.ajaxQueryMaker},"templateformalias combo[id=er_test]":{"select":this.ajaxQueryMaker},"templateformalias combo[id=er_measure]":{"select":this.ajaxQueryMaker},"templateformalias multiselectfield[id=er_measure]":{"change":this.ajaxQueryMaker},"templateformalias button[id=submit]":{"click":this.beforeSubmit},"templateformalias button[id=saveReport]":{"click":this.goTo},"newUtilities > #printTool > button":{"click":this.printReport},"newUtilities > #diagnosisTool > button":{"click":this.showDD},"newUtilities > #dataTool > button":{"click":this.dataGridReport},"newUtilities > #saveTool > button":{"click":this.saveFile},"newUtilities > #mailTool > button":{"click":this.sendMail},"newUtilities > #csvTool > button":{"click":this.printCsvReport},'buildersettings combo[name="reportGeneration"]':{"select":this.reportGenChange},'egcomponent button[id="expandSelectorComponent"]':{},});
},showDD:function(){var a=window.open(dd_Url,"DDWindow","width=1012,height=603,left=0,top=105,scrollbars=1,scrollbars=yes,resizable");a.focus();},saveFile:function(){qryString="/final/reporter/ErHtmlToSavePdf.jsp?dataDrill=yes&drillSes=yes&savereport=save&isBuilderTimeline=yes&compName="+compName+"&graphIndex="+graphIndex+"&widgetIdInfo="+widgetIdInfo;
if(Ext.isEmpty(appConstants.erUtils)){appConstants.erUtils=Ext.widget("erutils");}appConstants.erUtils.savePDF(qryString);},expandMe:function(c){var b="";var a="";var d=c.getItemId();if(d=="expandSelectorComponent"){b="er_component";a="compmultipane";}if(Ext.isEmpty(appConstants.erUtils)){appConstants.erUtils=Ext.widget("erutils");
}appConstants.erUtils.expandMultiComboButton(Ext.getCmp(b),Ext.getCmp(a).text,c);},toggleForm:function(b){var a=Ext.getCmp("templateFormItms");if(a.isHidden()){a.show();Ext.getCmp("selectionDetails").hide();}else{a.hide();Ext.getCmp("selectionDetails").show();}},reportGenChange:function(){Ext.getCmp("resultcontainer").hide();
this.enableDisableTools(true);var a=Ext.getCmp("reportGeneration").getValue();if(a=="background"){Ext.getCmp("bgReportName").setValue("");Ext.getCmp("bgReportName").show();}else{Ext.getCmp("bgReportName").hide();}},sendMail:function(){drillDownParams="&isBuilderTimeline=yes&dataDrill=yes&DrillDown=yes&compName="+compName+"&graphIndex="+graphIndex+"&widgetIdInfo="+widgetIdInfo;
var a=Ext.widget("sendmail");a.show();},goTo:function(a){appConstants.formButtonId=a.getId();var b=appConstants.fromScheduleModify;if((b!=null&&b=="Yes")){this.saveSchedule();}else{this.saveFavorite();}},saveSchedule:function(c){var b=this.getQueryString(true);b="/final/reporter/ErSaveSchedule.jsp?"+b+"&dataDrill=yes&pdfPrint=yes&pdfprint=yes&recordInfo="+appConstants.recordInfo;
var a="";if(appConstants.formButtonId=="saveReport"){b+="&showSchWindow=no";var e=b.substr(0,b.indexOf("?"));var f=b.substr(b.indexOf("?")+1,b.length-1);var d=Ext.create("Ext.form.Panel");d.submit({url:e,params:f,standardSubmit:true,method:"POST"});}else{parent.scheduleWindowFn(b);}},saveFavorite:function(c){var b=this.getQueryString(true);
b="/final/reporter/ErSaveFavorite.jsp?"+b+"&dataDrill=yes&pdfPrint=yes&pdfprint=yes&recordInfo="+appConstants.recordInfo+"&deleteTemplate=no";var a=appConstants.FavoriteId;if(appConstants.formButtonId=="saveReport"){document.location=b+"&showWindow=no"+"&FavoriteId="+a;}else{parent.favouriteWindowFn(b);
}},printReport:function(){var a=this.getQueryString(false);console.log("qryString::::::::::   "+a);a="/final/reporter/ErPrintReportBuilder.jsp?"+a+"&dataDrill=yes&printBy=drillDown&pdfPrint=yes&pdfprint=yes&compName="+compName+"&graphIndex="+graphIndex+"&widgetIdInfo="+widgetIdInfo+"&titleDisp="+appConstants.tempName;
parent.printWindowFn(a);},dataGridReport:function(){var a=this.getQueryString(false);console.log("qryString::::::::::   "+a);a="/final/reporter/ErPrintReportBuilder.jsp?"+a+"&dataDrill=yes&pdfPrint=yes&compName="+compName+"&pdfprint=yes&graphIndex="+graphIndex+"&widgetIdInfo="+widgetIdInfo+"";parent.printWindowFn(a);
},printCsvReport:function(){var a=this.getQueryString(false);console.log("qryString::::::::::   "+a);window.location="/final/reporter/ErPrintReportBuilder.jsp?"+a+"&dataDrill=yes&compName="+compName+"&pdfPrint=yes&pdfprint=yes&graphIndex="+graphIndex+"&widgetIdInfo="+widgetIdInfo+"&option=csv";},beforeSubmit:function(e){var b=Ext.getCmp("resultcontainer");
b.removeAll();b.show();if(appConstants.isCustomLayout=="yes"){var c=0.01;var d=this;var a=new Ext.util.DelayedTask(function(f){d.ajaxQueryMaker(e);});a.delay(20);}else{this.ajaxQueryMaker(e);}},getQueryString:function(c){var h="method=submit";h+="&er_option="+Ext.getCmp("er_option").getValue();var f=Ext.getCmp("er_site");
if(!f.isHidden()){h+="&er_site="+f.getValue();if(Ext.getCmp("er_option").getValue()=="Zone"){h+="&er_site="+Ext.getCmp("er_subZone").getValue();}}h+="&er_compType="+Ext.getCmp(appConstants.erCompType).getValue();if(Ext.getCmp("showLegend")!="undefined"&&Ext.getCmp("showLegend")!=undefined){h+="&showLegendsEnable="+Ext.getCmp("showLegend").getValue();
}var a=new Array();a=Ext.getCmp("er_component").getValue();for(var d in a){h+="&er_component="+a[d];}h+="&er_test="+Ext.getCmp("er_test").getValue();if(appConstants.isMultiMeasureSupport=="yes"){var a=new Array();a=Ext.getCmp("er_measure").getValue();for(var d in a){h+="&er_measure="+a[d];}}else{h+="&er_measure="+Ext.getCmp("er_measure").getValue();
}a=Ext.getCmp("er_info").getValue();for(var d in a){h+="&er_info="+a[d];}h+="&er_timeline="+Ext.getCmp("er_timeline").getValue();h+="&er_stdate="+Ext.getCmp("er_stdate").dataArray;h+="&startdate="+Ext.getCmp("er_stdate").dataArray;h+="&er_enddate="+Ext.getCmp("er_enddate").dataArray;h+="&enddate="+Ext.getCmp("er_enddate").dataArray;
h+="&er_sthr="+Ext.getCmp("er_sthr").getValue();h+="&starthr="+Ext.getCmp("er_sthr").getValue();h+="&er_endhr="+Ext.getCmp("er_endhr").getValue();h+="&endhr="+Ext.getCmp("er_endhr").getValue();h+="&timefrom="+Ext.getCmp("timefrom").getValue();h+="&timeto="+Ext.getCmp("timeto").getValue();h+="&minfrom="+Ext.getCmp("minfrom").getValue();
h+="&startmin="+mgr_stmin+"&endmin="+mgr_enmin+"&er_secs=00";h+="&er_stmin="+mgr_stmin+"&er_endmin="+mgr_enmin;h+="&minto="+Ext.getCmp("minto").getValue();h+="&er_reportgenration="+Ext.getCmp("reportGeneration").getValue();h+="&er_excwe="+Ext.getCmp("er_excwe").getValue();h+="&sorted_col="+Ext.getCmp("groupBy_list").getValue();
h+="&aggregate_server="+Ext.getCmp("aggregate_server").getValue();h+="&er_showBy="+Ext.getCmp("er_showBy").getValue();h+="&timeline_showBy="+Ext.getCmp("timeline_showBy").getValue();h+="&bar_showBy="+Ext.getCmp("bar_showBy").getValue();h+="&serverAggregate="+appConstants.serverAggregate;h+="&dynamicRangesInfo="+this.getDynamicRangesInfo();
h+="&fromReportBuilder="+appConstants.fromReportBuilder;if(appConstants.isCustomLayout=="yes"){h+="&er_top="+Ext.getCmp("er_top").getValue();}else{h+="&chartInfo="+appConstants.chartInfo;h+="&er_top="+Ext.getCmp("er_top").getValue();}h+="&isCustomLayout="+appConstants.isCustomLayout;if(!Ext.isEmpty(appConstants.builderJson)){if(!Ext.isEmpty(appConstants.builderJson.hiddenFields)){for(var d in appConstants.builderJson.hiddenFields){var g=appConstants.builderJson.hiddenFields[d];
h+="&"+d+"="+g;}}}h+="&tempDesc="+appConstants.tempDesc;var e=new Array();e=(Ext.getCmp("er_webAppCombo").getValue()).split(",");for(var b=0;e.length>b;b++){h+="&er_webAppCombo="+e[b];}if(wildcardSearch&&appConstants.clientVersionn!=undefined&&appConstants.clientVersionn!="undefined"){h+="&clientVersionn="+appConstants.clientVersionn;
}return h;},enableDisableTools:function(a){if(drillDownchartType!=undefined&&Ext.getCmp("showLegend")!=undefined&&(drillDownchartType=="timeline"||drillDownchartType=="area")){Ext.getCmp("showLegend").show();this.getNewUtilities().loadIcon(true,true,true,true,true,false,false,true,false,false);Ext.getCmp("csvTool").setDisabled(a);
Ext.getCmp("dataTool").setDisabled(a);if(isDDEnabled!=undefined&&isDDEnabled=="yes"){Ext.getCmp("diagnosisTool").setDisabled(a);}else{Ext.getCmp("diagnosisTool").setDisabled(true);}}else{this.getNewUtilities().loadIcon(true,true,true,false,false,false,false,false,false,false);}Ext.getCmp("saveTool").setDisabled(a);
Ext.getCmp("printTool").setDisabled(a);Ext.getCmp("mailTool").setDisabled(a);},validateMainForm:function(){var a=true;if(isSettingsEnabled){a=this.validateSettings();}return a;},ajaxQueryMaker:function(g){var t=this;if(appConstants.isSubmit!=undefined&&appConstants.isSubmit=="true"){return;}if(!isSettingsEnabled){this.invokeSettings();
}if(this.validateMainForm()){var a=g.getId();var c="/final/reporter/ErReportBuilderDrillDownController.jsp";var r;if(a=="er_option"){this.method="optionchange";r="method="+this.method+"&er_option="+Ext.getCmp("er_option").getValue();}else{if(a=="er_site"){this.method="sitechange";r="method="+this.method+"&er_option="+Ext.getCmp("er_option").getValue()+"&er_site="+Ext.getCmp("er_site").getValue()+"&er_subZone="+Ext.getCmp("er_subZone").getValue();
}else{if(a=="er_mutiSelComp"||a=="er_compType"){this.method="comptypechange";r="method="+this.method;r+="&er_option="+Ext.getCmp("er_option").getValue();var g=Ext.getCmp("er_site");if(!g.isHidden()){r+="&er_site="+g.getValue();}r+="&er_compType="+Ext.getCmp(appConstants.erCompType).getValue();}else{if(a=="er_test"){this.method="testchange";
r="method="+this.method;r+="&er_compType="+Ext.getCmp(appConstants.erCompType).getValue();var b=new Array();b=Ext.getCmp("er_component").getValue();for(var v in b){r+="&er_component="+b[v];}r+="&er_test="+Ext.getCmp("er_test").getValue();}else{if(a=="er_measure"){this.method="measurechange";r="method="+this.method;
r+="&er_compType="+Ext.getCmp(appConstants.erCompType).getValue();r+="&er_test="+Ext.getCmp("er_test").getValue();var b=new Array();b=Ext.getCmp("er_component").getValue();for(var v in b){r+="&er_component="+b[v];}if(appConstants.isMultiMeasureSupport=="yes"){b=new Array();b=Ext.getCmp("er_measure").getValue();
for(var v in b){r+="&er_measure="+b[v];}}else{r+="&er_measure="+Ext.getCmp("er_measure").getValue();}if(appConstants.isCustomLayout!="yes"){appConstants.isCustomLayout="no";}r+="&isCustomLayout="+appConstants.isCustomLayout;}else{if(a=="submit"){var o=Ext.getCmp("reportGeneration").getValue();this.method="submit";
r="method="+this.method;r+="&popupWindow="+appConstants.popupWindow;r+="&clickValue="+appConstants.clickValue;r+="&er_option="+Ext.getCmp("er_option").getValue();var g=Ext.getCmp("er_site");if(!g.isHidden()){r+="&er_site="+g.getValue();if(Ext.getCmp("er_option").getValue()=="Zone"){r+="&er_site="+Ext.getCmp("er_subZone").getValue();
}}r+="&er_compType="+Ext.getCmp(appConstants.erCompType).getValue();if(Ext.getCmp("showLegend")!="undefined"&&Ext.getCmp("showLegend")!=undefined){r+="&showLegendsEnable="+Ext.getCmp("showLegend").getValue();}var b=new Array();b=Ext.getCmp("er_component").getValue();for(var v in b){r+="&er_component="+b[v];
}r+="&er_test="+Ext.getCmp("er_test").getValue();if(appConstants.isMultiMeasureSupport=="yes"){var b=new Array();b=Ext.getCmp("er_measure").getValue();for(var v in b){r+="&er_measure="+b[v];}}else{r+="&er_measure="+Ext.getCmp("er_measure").getValue();}b=Ext.getCmp("er_info").getValue();for(var v in b){r+="&er_info="+b[v];
}r+="&er_timeline="+Ext.getCmp("er_timeline").getValue();r+="&er_stdate="+Ext.getCmp("er_stdate").dataArray;r+="&startdate="+Ext.getCmp("er_stdate").dataArray;r+="&er_enddate="+Ext.getCmp("er_enddate").dataArray;r+="&enddate="+Ext.getCmp("er_enddate").dataArray;r+="&er_sthr="+Ext.getCmp("er_sthr").getValue();
r+="&starthr="+Ext.getCmp("er_sthr").getValue();r+="&er_endhr="+Ext.getCmp("er_endhr").getValue();r+="&endhr="+Ext.getCmp("er_endhr").getValue();r+="&startmin="+mgr_stmin+"&endmin="+mgr_enmin+"&er_secs=00";r+="&er_stmin="+mgr_stmin+"&er_endmin="+mgr_enmin;r+="&timefrom="+Ext.getCmp("timefrom").getValue();
r+="&timeto="+Ext.getCmp("timeto").getValue();r+="&minfrom="+Ext.getCmp("minfrom").getValue();r+="&minto="+Ext.getCmp("minto").getValue();r+="&er_reportgenration="+Ext.getCmp("reportGeneration").getValue();r+="&er_excwe="+Ext.getCmp("er_excwe").getValue();r+="&sorted_col="+Ext.getCmp("groupBy_list").getValue();
r+="&aggregate_server="+Ext.getCmp("aggregate_server").getValue();r+="&er_showBy="+Ext.getCmp("er_showBy").getValue();r+="&timeline_showBy="+Ext.getCmp("timeline_showBy").getValue();r+="&bar_showBy="+Ext.getCmp("bar_showBy").getValue();r+="&dynamicRangesInfo="+this.getDynamicRangesInfo();r+="&templateName="+appConstants.templateName;
r+="&user_dispName="+appConstants.tempName;r+="&fromReportBuilder="+appConstants.fromReportBuilder;r+="&serverAggregate="+appConstants.serverAggregate;if(appConstants.isCustomLayout=="yes"){r+="&er_top="+Ext.getCmp("er_top").getValue();}else{r+="&chartInfo="+appConstants.chartInfo;r+="&er_top="+Ext.getCmp("er_top").getValue();
}r+="&recordInfo="+appConstants.recordInfo;var m=new Array();m=(Ext.getCmp("er_webAppCombo").getValue()).split(",");for(var j=0;m.length>j;j++){r+="&er_webAppCombo="+m[j];}if(wildcardSearch&&appConstants.clientVersionn!=undefined&&appConstants.clientVersionn!="undefined"){r+="&clientVersionn="+appConstants.clientVersionn;
}}else{this.method=null;return;}}}}}}r+="&isCustomLayout="+appConstants.isCustomLayout;if(!Ext.isEmpty(appConstants.builderJson)){if(!Ext.isEmpty(appConstants.builderJson.hiddenFields)){for(var v in appConstants.builderJson.hiddenFields){var x=appConstants.builderJson.hiddenFields[v];r+="&"+v+"="+x;}}}if(Ext.isEmpty(initLdgMask)){initLdgMask=new Ext.LoadMask(Ext.getBody(),{msg:"Loading ..."});
}if(o!=null&&o=="background"){c="/final/servlet/com.eg.ErStartBackGroundReportC";var d=Ext.getCmp("backgroundresults");var q=Ext.getCmp("resultcontainer");q.hide();var w=Ext.getCmp("bgReportName").getValue();r+="&tempDesc="+appConstants.tempDesc;initLdgMask.show();Ext.Ajax.request({url:c,params:r+"&bg_reportname="+w,scope:this,method:"POST",success:function(i){var B=i.responseText;
var z=Ext.decode(B);z=z.combo;var A=z.backgroundReportStatus;if(!Ext.isEmpty(A)&&A!="undefined"){if(A=="success"){var k=z.bgroundResponseTxt;var C=z.bgroundReportsURL;var y=z.backgroundAnchor;d.update('<center><div style="font-size:13px;padding:8px;margin-top:50px;text-align:left;display:block;width:480px;height:90" class="panelwithoutheader"><div style="margin:20px;display:block;width:38px;height:34px;float:left;" class="iconSuccess"></div><div style="margin-top:20px"><b>'+k+'</b><br/><a class="backgroundMsgLink" href='+C+">"+y+"</a></div></div></center>");
}else{if(A=="duplicate"){var k=z.bgroundResponseTxt;var C=z.bgroundReportsURL;var y=z.backgroundAnchor;d.update('<center><div style="font-size:13px;padding:8px;margin-top:50px;text-align:left;display:block;width:480px;height:90" class="panelwithoutheader"><div style="margin:20px;display:block;width:38px;height:34px;float:left;" class="iconExists"></div><div style="margin-top:20px"><b>'+k+'</b><br/><a class="backgroundMsgLink" href='+C+">"+y+"</a></div></div></center>");
}}}else{d.update("<span>ErroR In BackGround Generation</span>");}t.enableDisableTools(true);initLdgMask.hide();}});}else{var q=Ext.getCmp("resultcontainer");q.removeAll();initLdgMask.show();if(appConstants.isCustomLayout=="yes"&&a=="submit"){var e=Ext.getCmp(appConstants.erCompType).getValue();appConstants.widgetList=appConstants.selectedCompTypeWidgets[e];
if(Ext.isEmpty(appConstants.widgetList)){appConstants.widgetList=appConstants.selectedCompTypeWidgets["all"];}var s={};s.widgetCount=appConstants.widgetList.length;var t=this;var f=Ext.getCmp("pbar");var l=0;var h=0;var u=false;var n=new Ext.util.DelayedTask(function(k){var i=k;if(i.indexOf("$")!=-1){var y=parseInt(i.substring(i.indexOf("$")+1));
i=i.substring(0,i.indexOf("$"));h=h+y;if(h==12){h=0;u=true;}else{u=false;}}if(widgetIdInfo==i+"_detail"){t.callAjax(c,r+"&widget="+i,false,false,u);}s.ajaxCount++;});var p=new Ext.util.DelayedTask(function(k){var i=k;if(i.indexOf("$")!=-1){var y=parseInt(i.substring(i.indexOf("$")+1));i=i.substring(0,i.indexOf("$"));
h=h+y;if(h==12){h=0;u=true;}else{u=false;}}if(widgetIdInfo==i+"_detail"){t.callAjax(c,r+"&widget="+i,false,false,u);}s.ajaxCount++;});Object.defineProperty(s,"ajaxCount",{get:function(){return this.value;},set:function(i){this.value=i;l=this.value/s.widgetCount;if(f!=undefined){f.updateProgress(l,Math.round(100*l)+"% completed...");
}if(0==this.value){p.delay(0,null,null,[appConstants.widgetList[s.ajaxCount]]);}else{if(s.widgetCount!=this.value){n.delay(0,null,null,[appConstants.widgetList[s.ajaxCount]]);}else{initLdgMask.hide();if(q.items.items.length<=0){t.enableDisableTools(true);}else{}q.doComponentLayout();q.doLayout();if(Ext.getCmp("pbarcont")!=undefined){Ext.getCmp("pbarcont").hide();
}if(f!=undefined){f.hide();}}}}});if(appConstants.widgetList.length>0){s.ajaxCount=0;}}else{this.callAjax(c,r,true,false);}}}},ajaxQueryMaker11:function(){if(appConstants.fromFavouriteModify=="Yes"||appConstants.fromScheduleModify=="Yes"){return;}var a="";if(appConstants.isSubmit!=null&&appConstants.isSubmit=="true"){a="submit";
}var c="/final/reporter/ErReportBuilderDrillDownController.jsp";var p;if(appConstants.isSubmit!=null&&appConstants.isSubmit=="true"){this.method="submit";p="method="+this.method;p+="&er_option="+Ext.getCmp("er_option").getValue();p+="&serverAggregate="+appConstants.serverAggregate;if(fromOverviewReport){p+="&fromOverviewReport="+fromOverviewReport;
p+="&dateInMillisecs="+appConstants.dateInMillisecs;}var f=Ext.getCmp("er_site");if(!f.isHidden()){p+="&er_site="+f.getValue();if(Ext.getCmp("er_option").getValue()=="Zone"){p+="&er_site="+Ext.getCmp("er_subZone").getValue();}}p+="&er_compType="+Ext.getCmp(appConstants.erCompType).getValue();if(Ext.getCmp("showLegend")!="undefined"&&Ext.getCmp("showLegend")!=undefined){p+="&showLegendsEnable="+Ext.getCmp("showLegend").getValue();
}var b=new Array();b=Ext.getCmp("er_component").getValue();for(var t in b){p+="&er_component="+b[t];}p+="&er_test="+Ext.getCmp("er_test").getValue();if(appConstants.isMultiMeasureSupport=="yes"){var b=new Array();b=Ext.getCmp("er_measure").getValue();for(var t in b){p+="&er_measure="+b[t];}}else{p+="&er_measure="+Ext.getCmp("er_measure").getValue();
}b=Ext.getCmp("er_info").getValue();for(var t in b){p+="&er_info="+b[t];}p+="&er_timeline="+Ext.getCmp("er_timeline").getValue();p+="&er_stdate="+Ext.getCmp("er_stdate").dataArray;p+="&startdate="+Ext.getCmp("er_stdate").dataArray;p+="&er_enddate="+Ext.getCmp("er_enddate").dataArray;p+="&enddate="+Ext.getCmp("er_enddate").dataArray;
p+="&er_sthr="+Ext.getCmp("er_sthr").getValue();p+="&starthr="+Ext.getCmp("er_sthr").getValue();p+="&er_endhr="+Ext.getCmp("er_endhr").getValue();p+="&endhr="+Ext.getCmp("er_endhr").getValue();p+="&startmin="+mgr_stmin+"&endmin="+mgr_enmin+"&er_secs=00";p+="&er_stmin="+mgr_stmin+"&er_endmin="+mgr_enmin;
p+="&timefrom="+Ext.getCmp("timefrom").getValue();p+="&timeto="+Ext.getCmp("timeto").getValue();p+="&minfrom="+Ext.getCmp("minfrom").getValue();p+="&minto="+Ext.getCmp("minto").getValue();p+="&er_reportgenration="+Ext.getCmp("reportGeneration").getValue();p+="&er_excwe="+Ext.getCmp("er_excwe").getValue();
p+="&aggregate_server="+Ext.getCmp("aggregate_server").getValue();p+="&er_showBy="+Ext.getCmp("er_showBy").getValue();p+="&timeline_showBy="+Ext.getCmp("timeline_showBy").getValue();p+="&bar_showBy="+Ext.getCmp("bar_showBy").getValue();p+="&dynamicRangesInfo="+this.getDynamicRangesInfo();p+="&sorted_col="+Ext.getCmp("groupBy_list").getValue();
p+="&templateName="+appConstants.templateName;p+="&user_dispName="+appConstants.tempName;p+="&fromReportBuilder="+appConstants.fromReportBuilder;if(wildcardSearch&&appConstants.clientVersionn!=undefined&&appConstants.clientVersionn!="undefined"){p+="&clientVersionn="+appConstants.clientVersionn;}p+="&popupWindow="+appConstants.popupWindow;
p+="&clickValue="+appConstants.clickValue;p+="&userID="+appConstants.userId;if(appConstants.isCustomLayout=="yes"){p+="&er_top="+Ext.getCmp("er_top").getValue();}else{p+="&chartInfo="+appConstants.chartInfo;p+="&er_top="+Ext.getCmp("er_top").getValue();}p+="&recordInfo="+appConstants.recordInfo;var j=new Array();
j=(Ext.getCmp("er_webAppCombo").getValue()).split(",");for(var h=0;j.length>h;h++){p+="&er_webAppCombo="+j[h];}}else{this.method=null;return;}p+="&isCustomLayout="+appConstants.isCustomLayout;if(!Ext.isEmpty(appConstants.builderJson)){if(!Ext.isEmpty(appConstants.builderJson.hiddenFields)){for(var t in appConstants.builderJson.hiddenFields){var u=appConstants.builderJson.hiddenFields[t];
p+="&"+t+"="+u;}}}var o=Ext.getCmp("resultcontainer");o.removeAll();if(Ext.isEmpty(initLdgMask)){initLdgMask=new Ext.LoadMask(Ext.getBody(),{msg:"Loading ..."});}initLdgMask.show();if(appConstants.isCustomLayout=="yes"&&a=="submit"){var d=Ext.getCmp(appConstants.erCompType).getValue();console.log("====comptype=====>>>refresh..>>>>>>"+d);
console.log("===selecttypecomp===>>>refresh..>>>"+JSON.stringify(appConstants.selectedCompTypeWidgets));appConstants.widgetList=appConstants.selectedCompTypeWidgets[d];if(Ext.isEmpty(appConstants.widgetList)){appConstants.widgetList=appConstants.selectedCompTypeWidgets["all"];}var q={};q.widgetCount=appConstants.widgetList.length;
var r=this;var e=Ext.getCmp("pbar");var l=0;var g=0;var s=false;var m=new Ext.util.DelayedTask(function(k){var i=k;if(i.indexOf("$")!=-1){var v=parseInt(i.substring(i.indexOf("$")+1));i=i.substring(0,i.indexOf("$"));g=g+v;if(g==12){g=0;s=true;}else{s=false;}}if(widgetIdInfo==i+"_detail"){r.callAjax(c,p+"&widget="+i,false,false,s);
}q.ajaxCount++;});var n=new Ext.util.DelayedTask(function(k){var i=k;if(i.indexOf("$")!=-1){var v=parseInt(i.substring(i.indexOf("$")+1));i=i.substring(0,i.indexOf("$"));g=g+v;if(g==12){g=0;s=true;}else{s=false;}}if(widgetIdInfo==i+"_detail"){r.callAjax(c,p+"&widget="+i,false,true,s);}q.ajaxCount++;});
Object.defineProperty(q,"ajaxCount",{get:function(){return this.value;},set:function(i){this.value=i;l=this.value/q.widgetCount;if(e!=undefined){e.updateProgress(l,Math.round(100*l)+"% completed...");}if(0==this.value){n.delay(0,null,null,[appConstants.widgetList[q.ajaxCount]]);}else{if(q.widgetCount!=this.value){m.delay(0,null,null,[appConstants.widgetList[q.ajaxCount]]);
}else{initLdgMask.hide();if(o.items.items.length<=0){r.enableDisableTools(true);}else{r.enableDisableTools(false);}o.doComponentLayout();o.doLayout();if(Ext.getCmp("pbarcont")!=undefined){Ext.getCmp("pbarcont").hide();}if(e!=undefined){e.hide();}}}}});if(appConstants.widgetList.length>0){q.ajaxCount=0;
}}else{o.removeAll();this.callAjax(c,p,true,true);}},sleep:function(a){var c=new Date().getTime();for(var b=0;b<10000000;b++){if((new Date().getTime()-c)>a){break;}}},onAjaxSuccess:function(c){if(Ext.isEmpty(initLdgMask)){initLdgMask=new Ext.LoadMask(Ext.getBody(),{msg:"Loading ..."});}if(appConstants.isCustomLayout=="yes"){if(appConstants.builderJson.hasOwnProperty("selectedFields")){if(appConstants.builderJson.selectedFields.hasOwnProperty("selectedCompTypeWidgets")){appConstants.selectedCompTypeWidgets=appConstants.builderJson.selectedFields.selectedCompTypeWidgets;
}}}if(this.method=="init"||(appConstants.isSubmit!=null&&appConstants.isSubmit=="true")){var e=appConstants.tempName;if(e!=undefined&&e.indexOf(".")!=-1){e=e.substring(e.lastIndexOf(".")+1);}if(Ext.isEmpty(appConstants.erUtils)){appConstants.erUtils=Ext.widget("erutils");}e=appConstants.erUtils.specialCharDecode(e);
this.getMain().setTitle(e);this.loadComboField("er_option","analysisByCombo",null,"selectedAnalysisByCombo",appConstants.builderJson,false,null,false);this.loadComboField("er_site","siteCombo","labelSiteCombo","selectedSiteCombo",appConstants.builderJson,false,null,true);this.loadComboField("er_subZone","subZoneCombo","labelSubZoneCombo","selectedSubZoneCombo",appConstants.builderJson,false,null,false);
this.loadComboField("er_component","componentCombo",null,"selectedComponentCombo",appConstants.builderJson,true,"compmultipane",false);this.loadComboField("er_test","testCombo",null,"selectedTestCombo",appConstants.builderJson,false,null,false);if(appConstants.isMultiMeasureSupport=="yes"){this.loadComboField("er_measure","measureCombo",null,"selectedMeasureCombo",appConstants.builderJson,true,"measmultipane",false);
}else{this.loadComboField("er_measure","measureCombo",null,"selectedMeasureCombo",appConstants.builderJson,false,null,false);}if(appConstants.isMultiCompType=="true"){this.loadComboField(appConstants.erCompType,"componentTypeCombo",null,"selectedComponentTypeCombo",appConstants.builderJson,true,"compTypeMultiPane",false);
}else{this.loadComboField(appConstants.erCompType,"componentTypeCombo",null,"selectedComponentTypeCombo",appConstants.builderJson,false,null,false);}this.loadComboField("er_info","infoCombo",null,"selectedInfoCombo",appConstants.builderJson,true,"infomultipane",false);this.loadComboField("er_timeline","timelineCombo",null,"selectedTimelineCombo",appConstants.builderJson,false,null,false);
if(appConstants.builderJson.isHeaderFooterUpdate!=undefined&&appConstants.builderJson.isHeaderFooterUpdate=="yes"){return;}if(appConstants.builderJson.selectedFields.enableAggreagation=="true"){Ext.getCmp("aggregate_server").show();this.loadComboField("aggregate_server","aggregateServerCombo",null,"selectedAggregateValue",appConstants.builderJson,false,null,false);
}else{Ext.getCmp("aggregate_server").hide();}if(appConstants.builderJson.selectedFields.enableSortedBy==true){this.loadComboField("groupBy_list","groupByCombo",null,"selectTableCol",appConstants.builderJson,false,null,false);Ext.getCmp("groupBy_list").show();}else{Ext.getCmp("groupBy_list").hide();}this.loadComboField("er_excwe","excludeWeekendsCombo",null,"selectedExcludeWeekendsCombo",appConstants.builderJson,false,null,false);
this.loadComboField("er_showBy","showByCombo",null,"selectedShowByCombo",appConstants.builderJson,false,null,false);if(appConstants.builderJson.selectedFields.selectedtimeShowByCombo!=undefined){this.loadComboField("timeline_showBy","timelineShowByCombo",null,"selectedtimeShowByCombo",appConstants.builderJson,false,null,false);
Ext.getCmp("timeline_showBy").show();}else{Ext.getCmp("timeline_showBy").hide();}if(appConstants.builderJson.selectedFields.selectedbarShowByCombo!=undefined){this.loadComboField("bar_showBy","barShowByCombo",null,"selectedbarShowByCombo",appConstants.builderJson,false,null,false);Ext.getCmp("bar_showBy").show();
}else{Ext.getCmp("bar_showBy").hide();}if(appConstants.builderJson.combo.webAppCombo!=undefined){this.loadComboField("er_webAppCombo","webAppCombo",null,"selectedWebAppCombo",appConstants.builderJson.combo.webAppCombo,true,null,false);webAppCombo=appConstants.builderJson.combo.webAppCombo;Ext.getCmp("er_webAppCombo").setValue(appConstants.builderJson.selectedFields.selectedWebAppCombo);
}this.loadComboField("er_top","topCombo",null,"selectedTopCombo",appConstants.builderJson,false,null,false);this.loadComboField("reportGeneration","reportGenerationCombo",null,"selectedReportGenerationCombo",appConstants.builderJson,false,null,false);if(appConstants.builderJson.combo.dynamicRangeField!=undefined&&appConstants.builderJson.combo.dynamicRangeField.length>0){Ext.getCmp("rangeSettingsItemsId").collapse();
Ext.getCmp("rangeSettingsItemsId").expand();Ext.getCmp("rangeSettingsSplitter").show();Ext.getCmp("rangeSettingsItemsId").show();var d=Ext.getCmp("rangeSettingsItemsId");for(var b=0;b<appConstants.builderJson.combo.dynamicRangeField.length;b++){d.add({xtype:"fieldcontainer",id:appConstants.builderJson.combo.dynamicRangeField[b],layout:{type:"column",align:"stretch"},flex:1,defaults:{labelSeparator:"",labelAlign:"top",margin:"0 5 5 0",columnWidth:0.5,},items:[{xtype:"scrollcombo",store:new Ext.data.Store({fields:["displayField","valueField"],data:appConstants.builderJson.combo.dynamicRangeValue}),displayField:"displayField",value:"None",valueField:"valueField",fieldLabel:appConstants.builderJson.combo.dynamicRangeField[b],id:"dynamicRangeCombo_"+b,name:"dynamicRangeCombo_"+b,txtFieldId:"disp_MeasureName"+b,listeners:{select:function(h,g,f){if(this.getValue()!="None"){Ext.getCmp(this.txtFieldId).show();
}else{Ext.getCmp(this.txtFieldId).hide();Ext.getCmp(this.txtFieldId).setValue("");}}}},{xtype:"textfield",fieldLabel:"Range value",cls:"textbox",maskRe:/[0-9 .]/,width:200,id:"disp_MeasureName"+b,name:"disp_MeasureName"+b,hidden:true,},]});}}var a=Ext.ComponentManager.get("er_stdate");a.setValue(appConstants.builderJson.selectedFields.selectedStartDateDisp);
a.dataArray=appConstants.builderJson.selectedFields.selectedStartDateVal;a=Ext.ComponentManager.get("er_enddate");a.setValue(appConstants.builderJson.selectedFields.selectedEndDateDisp);a.dataArray=appConstants.builderJson.selectedFields.selectedEndDateVal;a=Ext.ComponentManager.get("er_sthr");a.setValue(appConstants.builderJson.selectedFields.selectedStartHour);
a=Ext.ComponentManager.get("er_endhr");a.setValue(appConstants.builderJson.selectedFields.selectedEndHour);Ext.ComponentManager.get("timefrom").setValue(appConstants.builderJson.selectedFields.selectedTimefrom);Ext.ComponentManager.get("timeto").setValue(appConstants.builderJson.selectedFields.selectedTimeto);
Ext.ComponentManager.get("minfrom").setValue(appConstants.builderJson.selectedFields.selectedMinfrom);Ext.ComponentManager.get("minto").setValue(appConstants.builderJson.selectedFields.selectedMinto);mgr_stmin=appConstants.builderJson.selectedFields.selectedStartMin;mgr_enmin=appConstants.builderJson.selectedFields.selectedEndMin;
if(Ext.isEmpty(appConstants.erUtils)){appConstants.erUtils=Ext.widget("erutils");}if(!hideBackButton){Ext.getCmp("templateform").add({xtype:"hidden",id:"ID",name:"ID",value:appConstants.builderJson.combo["ID"]});}}else{if(this.method=="optionchange"){this.loadComboField("er_site","siteCombo","labelSiteCombo","selectedSiteCombo",appConstants.builderJson,false,null,true);
this.loadComboField("er_subZone","subZoneCombo","labelSubZoneCombo","selectedSubZoneCombo",appConstants.builderJson,false,null,false);if(appConstants.isMultiCompType=="true"){this.loadComboField(appConstants.erCompType,"componentTypeCombo",null,"selectedComponentTypeCombo",appConstants.builderJson,true,"compTypeMultiPane",false);
}else{this.loadComboField(appConstants.erCompType,"componentTypeCombo",null,"selectedComponentTypeCombo",appConstants.builderJson,false,null,false);}this.loadComboField("er_component","componentCombo",null,"selectedComponentCombo",appConstants.builderJson,true,"compmultipane",false);this.loadComboField("er_test","testCombo",null,"selectedTestCombo",appConstants.builderJson,false,null,false);
if(appConstants.isMultiMeasureSupport=="yes"){this.loadComboField("er_measure","measureCombo",null,"selectedMeasureCombo",appConstants.builderJson,true,"measmultipane",false);}else{this.loadComboField("er_measure","measureCombo",null,"selectedMeasureCombo",appConstants.builderJson,false,null,false);}this.loadComboField("er_info","infoCombo",null,"selectedInfoCombo",appConstants.builderJson,true,"infomultipane",false);
}else{if(this.method=="comptypechange"){this.loadComboField("er_component","componentCombo",null,"selectedComponentCombo",appConstants.builderJson,true,"compmultipane",false);this.loadComboField("er_test","testCombo",null,"selectedTestCombo",appConstants.builderJson,false,null,false);if(appConstants.isMultiMeasureSupport=="yes"){this.loadComboField("er_measure","measureCombo",null,"selectedMeasureCombo",appConstants.builderJson,true,"measmultipane",false);
}else{this.loadComboField("er_measure","measureCombo",null,"selectedMeasureCombo",appConstants.builderJson,false,null,false);}this.loadComboField("er_info","infoCombo",null,"selectedInfoCombo",appConstants.builderJson,true,"infomultipane",false);this.loadComboField("groupBy_list","groupByCombo",null,"",appConstants.builderJson,true,null,false);
}else{if(this.method=="testchange"){if(appConstants.isMultiMeasureSupport=="yes"){this.loadComboField("er_measure","measureCombo",null,"selectedMeasureCombo",appConstants.builderJson,true,"measmultipane",false);}else{this.loadComboField("er_measure","measureCombo",null,"selectedMeasureCombo",appConstants.builderJson,false,null,false);
}this.loadComboField("er_info","infoCombo",null,"selectedInfoCombo",appConstants.builderJson,true,"infomultipane",false);}else{if(this.method=="measurechange"){this.loadComboField("er_info","infoCombo",null,"selectedInfoCombo",appConstants.builderJson,true,"infomultipane",false);}else{if(this.method=="sitechange"){if(appConstants.isMultiCompType=="true"){this.loadComboField(appConstants.erCompType,"componentTypeCombo",null,"selectedComponentTypeCombo",appConstants.builderJson,true,"compTypeMultiPane",false);
}else{this.loadComboField(appConstants.erCompType,"componentTypeCombo",null,"selectedComponentTypeCombo",appConstants.builderJson,false,null,false);}this.loadComboField("er_component","componentCombo",null,"selectedComponentCombo",appConstants.builderJson,true,"compmultipane",false);this.loadComboField("er_test","testCombo",null,"selectedTestCombo",appConstants.builderJson,false,null,false);
if(appConstants.isMultiMeasureSupport=="yes"){this.loadComboField("er_measure","measureCombo",null,"selectedMeasureCombo",appConstants.builderJson,true,"measmultipane",false);}else{this.loadComboField("er_measure","measureCombo",null,"selectedMeasureCombo",appConstants.builderJson,false,null,false);}this.loadComboField("er_info","infoCombo",null,"selectedInfoCombo",appConstants.builderJson,true,"infomultipane",false);
}else{if(this.method=="submit"){if(appConstants.isCustomLayout=="yes"){this.executeWidgetLayout(c);}else{this.executeSingleLayout(c);}this.hideComboField();}else{}}}}}}}if(appConstants.isSubmit!=null&&appConstants.isSubmit=="true"){this.ajaxQueryMaker11();appConstants.isSubmit="false";}initLdgMask.hide();
},executeWidgetLayout:function(p){var s=false;if(neeedEditableHeader=="yes"){s=true;}var z=this;var w=Ext.getCmp("resultcontainer");if(appConstants.builderJson.data.hasOwnProperty("widgetCollection")){if(p==true){Ext.getCmp("templateFormItms").show();}var d=appConstants.builderJson.data.widgetCollection;
if(!Ext.isEmpty(d)){for(var f in d){var l=d[f];if(l.widgetId+"_detail"==widgetIdInfo){drillDownchartType=l.chartType;var y=l.noMeasureIcon;var c=l.noMeasureMessage;var q=l.testCollection;for(var v in q){var m=q[v];var g=m.measureCollection;for(var e in g){var b=g[e];var r=new Array();var o=[];var i="";
if(b.hasOwnProperty("timelineChartCollection")){i="timeline";o=b.timelineChartCollection;}if(b.hasOwnProperty("heatMapChartCollection")){i="heatMap";o=b.heatMapChartCollection;}else{if(b.hasOwnProperty("barChartCollection")){i="bar";if(Ext.isEmpty(appConstants.erUtils)){appConstants.erUtils=Ext.widget("erutils");
}o=b.barChartCollection;}else{if(b.hasOwnProperty("stackedBarChartCollection")){i="stackedbar";if(Ext.isEmpty(appConstants.erUtils)){appConstants.erUtils=Ext.widget("erutils");}o=b.stackedBarChartCollection;}else{if(b.hasOwnProperty("distributedPieChartCollection")){i="distpie";if(Ext.isEmpty(appConstants.erUtils)){appConstants.erUtils=Ext.widget("erutils");
}o=b.distributedPieChartCollection;}else{if(b.hasOwnProperty("distributionChartCollection")){i="pie";if(Ext.isEmpty(appConstants.erUtils)){appConstants.erUtils=Ext.widget("erutils");}o=b.distributionChartCollection;}else{if(b.hasOwnProperty("gridCollection")){i="table";if(Ext.isEmpty(appConstants.erUtils)){appConstants.erUtils=Ext.widget("erutils");
}o=b.gridCollection;}else{if(b.hasOwnProperty("combinedChartCollection")){o=b.combinedChartCollection;}}}}}}}var a=false;if(i!=undefined&&i=="bar"){}if(o!=undefined&&o.length>0){var x=document.getElementById("main").offsetWidth;var k=document.getElementById("main").offsetHeight;var u=o[graphIndex];if(u.DataSet!=undefined&&u.DataSet.length==0){a=false;
}var u=o[0];var h=u.DataSet;if((h!=undefined&&h.length>0)||(u.gridData!=undefined&&u.gridData.length>0)){r.push(this.loadWidgetData(l.widgetId+"_panel",u,widgetIdInfo,i,700,280));var n="20 20 0 10";var j=u["isSharePointContentReport"];if(j!=undefined||j!="undefined"&&j=="true"){n="10 10 0 20";}var t=appConstants.templateName+"$~$"+l.widgetId+"$~$"+"footerDescription";
var A=appConstants.templateName+"$~$"+l.widgetId+"$~$"+"headerDescription";w.add({xtype:"panel",id:l.widgetId+"_panel",closeAction:"destroy",ui:"newGraphPanel",title:'<table cellpadding="0" cellspacing="0" border="0"><tr><td class="newFont_bold14" style="padding:4px 0px 0px 0px">'+l.widgetHeader+'</td><td id ="iconRename" style="float:left;margin-left:20px;" class="'+iconRename+'"></td></tr></table>',margin:"0 0 10 0",height:320,scroll:false,bodyPadding:n,layout:"fit",align:"stretch",autoScroll:a,overflowX:"hidden",overflowY:"auto",columnWidth:1,header:{},tools:[],dockedItems:[{xtype:"toolbar",dock:"bottom",align:"stretch",overCls:"reporterTemplateWidgetToolbarOver",layout:"fit",hidden:!s,cls:"reporterTemplateWidgetToolbar",height:42,hidden:true,items:[{xtype:"container",layout:{type:"hbox",align:"middle"},items:[{xtype:"button",width:16,height:16,padding:0,margin:"8 4 8 10",id:"widgetDescriptor"+l.widgetId,cls:"iconDescription",listeners:{afterrender:function(){Ext.create("Ext.tip.ToolTip",{target:this.id,anchor:"top",cls:"yellowTip",trackMouse:true,html:"Widget Descriptor"});
}}},{xtype:"label",text:l.widgetFooter,margin:"5 10 0 5",flex:1,cls:"handSymbol",listeners:{afterrender:function(B){B.el.on("click",this.onEdit,this);},},onEdit:function(D,B,E){var C=this;if(!C.editor){C.editor=Ext.create("Ext.Editor",{updateEl:true,completeOnEnter:true,cancelOnEsc:true,floating:false,alignment:"tl",autoSize:{width:"boundEl",height:"21"},hideEl:false,offsets:[0,-2],field:{xtype:"textfield",cls:"textbox",},listeners:{complete:{fn:function(H,K,G,J){var I="/final/reporter/ErReportBuilderDrillDownController.jsp";
var F=appConstants.appObj.getController(appConstants.appController);var L="&widgetHeaderFooterInfo="+K;L+="&method=setWidgetHeaderFooter";L+="&isCustomLayout="+appConstants.isCustomLayout;L+="&templateName="+appConstants.templateName;L+="&idDescription="+t;F.callAjax(I,L,false,true);},scope:C,}}});}C.editor.startEdit(B);
}}]}]}],listeners:{boxready:function(C){if(!Ext.isEmpty(C.header)){var B=Ext.get(C.header.id+"_hd-textEl");if(s){Ext.get(C.header.id).on("click",function(G,F){var E=B.dom.innerText;var D=new Ext.Editor({width:150,alignment:"tl",floating:false,shadow:false,updateEl:true,completeOnEnter:true,cancelOnEsc:true,field:{xtype:"textfield",cls:"textbox",maxLength:32,enforceMaxLength:true},listeners:{"complete":function(M,L,I,K){B.dom.innerHTML=L;
B.dom.innerHTML='<div style="float:left" class="font_normal12">'+L+'</div><div id ="iconRename" style="float:left;margin-left:20px" class="iconRename"></div>';var J="/final/reporter/ErReportBuilderDrillDownController.jsp";var H=appConstants.appObj.getController(appConstants.appController);var N="&widgetHeaderFooterInfo="+L;
N+="&method=setWidgetHeaderFooter";N+="&templateName="+appConstants.templateName;N+="&isCustomLayout="+appConstants.isCustomLayout;N+="&fromReportBuilder="+appConstants.fromReportBuilder;N+="&idDescription="+A;H.callAjax(J,N,false,true);}}});D.startEdit(B,E);},C,{delegate:"#"+C.header.id+"_hd-textEl"});
}}}},items:r});}else{this.getCustomNoMeasure(y,c,w);}}else{this.getCustomNoMeasure(y,c,w);}}}}}if(p==true){}}else{this.getCustomNoMeasure(y,c,w);}}else{w.add(this.getNoMeasure());}w.doLayout();w.doComponentLayout();},getCustomNoMeasure:function(c,d,a){var b='<div class="egFlexCenterByColumnWise" style="height:100%">';
if(c!=undefined||d!=undefined){if(c!=undefined){b+='<div class="'+c+'"></div>';}if(d!=undefined){b+='<div class="commonErrorMsgText">'+d+"</div>";}}else{b+='<div class="iconInformation"></div><div class="commonErrorMsgText">No Measures Available!</div>';}b+="</div>";a.add({xtype:"panel",height:370,items:[{xtype:"container",cls:"containerShadow",html:b}]});
},executeSingleLayout:function(p){var A=Ext.getCmp("resultcontainer");if(!Ext.isEmpty(appConstants.builderJson.data)&&appConstants.builderJson.data.hasOwnProperty("measureCollection")){A.removeAll();var i=appConstants.builderJson.data.measureCollection;var u=appConstants.builderJson.data.headerDescription;
var f=appConstants.builderJson.data.widgetHeader;if(!Ext.isEmpty(i)){var h="testWise";if(p){this.enableDisableTools(false);}for(var g in i){var d=i[g];var a="widget";var x=true,y=true,t=true;var o;var j="";var w="";if(d.hasOwnProperty("timelineChartCollection")){j="timeline";w="timelineChartCollection";
o=d.timelineChartCollection;}else{if(d.hasOwnProperty("heatMapChartCollection")){j="heatMap";w="heatMapChartCollection";o=d.heatMapChartCollection;}else{if(d.hasOwnProperty("barChartCollection")){j="bar";w="barChartCollection";if(Ext.isEmpty(appConstants.erUtils)){appConstants.erUtils=Ext.widget("erutils");
}o=d.barChartCollection;}else{if(d.hasOwnProperty("stackedBarChartCollection")){j="stackedbar";w="stackedBarChartCollection";if(Ext.isEmpty(appConstants.erUtils)){appConstants.erUtils=Ext.widget("erutils");}o=d.stackedBarChartCollection;}else{if(d.hasOwnProperty("distributedPieChartCollection")){j="distpie";
w="distributedPieChartCollection";if(Ext.isEmpty(appConstants.erUtils)){appConstants.erUtils=Ext.widget("erutils");}o=d.distributedPieChartCollection;}else{if(d.hasOwnProperty("distributionChartCollection")){j="pie";w="distributionChartCollection";if(Ext.isEmpty(appConstants.erUtils)){appConstants.erUtils=Ext.widget("erutils");
}o=d.distributionChartCollection;}else{if(d.hasOwnProperty("gridCollection")){j="table";w="gridCollection";if(Ext.isEmpty(appConstants.erUtils)){appConstants.erUtils=Ext.widget("erutils");}o=d.gridCollection;}}}}}}}if(o instanceof Array){var l=o[graphIndex];var B=document.getElementById("main").offsetWidth;
var k=document.getElementById("main").offsetHeight;var q=k*0.15;var r=((B)/12);r=Ext.util.Format.round(r,0);r=r*12;var b=4*q;b=Ext.util.Format.round(b,0);var n="5 20 0 10";if(j=="table"){n="10";}var s=new Array();s.push(this.loadWidgetData(a+graphIndex+"_panel",l,a,j,r,b));var v=appConstants.templateName+"$~$widget$~$"+"footerDescription";
if(l.title==""||l.title==" "||l.title=="title"){l.title=f;}A.add({xtype:"panel",id:a+graphIndex+"_panel",closeAction:"destroy",ui:"newGraphPanel",title:'<div style="float:left" class="font_normal12">'+l.title+'</div><div id ="iconRename" style="float:left;margin-left:20px" class="iconRename"></div>',margin:"0 0 10 0",height:370,scroll:false,bodyPadding:n,layout:"fit",align:"stretch",autoScroll:true,overflowX:"hidden",overflowY:"auto",chartCollectionVal:l,graphIndex:graphIndex,columnWidth:1,chartType:j,chartTypeCollection:w,dockedItems:[{xtype:"toolbar",dock:"bottom",align:"stretch",layout:"fit",overCls:"reporterTemplateWidgetToolbarOver",cls:"reporterTemplateWidgetToolbar",height:42,items:[{xtype:"container",layout:{type:"hbox",align:"middle"},items:[{xtype:"button",width:16,height:16,padding:0,margin:"8 4 8 10",id:"widgetDescriptor"+a+graphIndex,cls:"iconDescription",listeners:{afterrender:function(){Ext.create("Ext.tip.ToolTip",{target:this.id,anchor:"top",cls:"yellowTip",trackMouse:true,html:"Widget Descriptor"});
}}},{xtype:"label",id:v+graphIndex,text:appConstants.builderJson.data.widgetFooter,margin:"5 10 5 5",flex:1,cls:"handSymbol",listeners:{afterrender:function(C){C.el.on("click",this.onEdit,this);},},onEdit:function(E,C,F){var D=this;if(!D.editor){D.editor=Ext.create("Ext.Editor",{updateEl:true,completeOnEnter:true,cancelOnEsc:true,floating:false,alignment:"tl",autoSize:{width:"boundEl",height:"21"},hideEl:false,offsets:[0,-2],field:{xtype:"textfield",cls:"textbox",},listeners:{complete:{fn:function(I,L,H,K){var J="/final/reporter/ErReportBuilderDrillDownController.jsp";
var G=appConstants.appObj.getController(appConstants.appController);var M="&widgetHeaderFooterInfo="+L;M+="&isCustomLayout="+appConstants.isCustomLayout;M+="&method=graphHeaderFooter";M+="&templateName="+appConstants.templateName;M+="&chartType="+thisPanel.chartType;M+="&chartTypeCollection="+thisPanel.chartTypeCollection;
M+="&idDescription=footer$~$"+thisPanel.graphIndex;G.callAjax(J,M,false,true);},scope:D,}}});}D.editor.startEdit(C);}},]}]}],listeners:{boxready:function(D){if(!Ext.isEmpty(D.header)){var C=Ext.get(D.header.id+"_hd-textEl");Ext.get(D.header.id).on("click",function(H,G){var F=C.dom.innerText;var E=new Ext.Editor({width:150,alignment:"tl",floating:false,shadow:false,updateEl:true,completeOnEnter:true,cancelOnEsc:true,field:{xtype:"textfield",cls:"textbox",maxLength:32,enforceMaxLength:true},listeners:{"complete":function(O,N,J,L){C.dom.innerHTML=N;
C.dom.innerHTML='<div style="float:left" class="font_normal12">'+N+'</div><div id ="iconRename" style="float:left;margin-left:20px" class="iconRename"></div>';var K="/final/reporter/ErReportBuilderDrillDownController.jsp";var I=appConstants.appObj.getController(appConstants.appController);var M=D;var P="&widgetHeaderFooterInfo="+N;
P+="&isCustomLayout="+appConstants.isCustomLayout;P+="&method=graphHeaderFooter";P+="&templateName="+appConstants.templateName;P+="&fromReportBuilder="+appConstants.fromReportBuilder;P+="&idDescription=header$~$"+M.graphIndex;P+="&chartType="+M.chartType;P+="&chartTypeCollection="+M.chartTypeCollection;
I.callAjax(K,P,false,true);}}});E.startEdit(C,F);},D,{delegate:"#"+D.header.id+"_hd-textEl"});}}},items:s});}else{h="componentWise";chartCollectionComp=o[compName];var m=new Array();if(chartCollectionComp instanceof Array){var z=1;var e=chartCollectionComp[graphIndex];var B=document.getElementById("main").offsetWidth;
var k=document.getElementById("main").offsetHeight;var q=k*0.15;var r=((B)/12);r=Ext.util.Format.round(r,0);r=r*12;var b=4*q;b=Ext.util.Format.round(b,0);var n="5 20 0 10";var s=new Array();s.push(this.loadWidgetData(a+compName+graphIndex+"_panel",e,a,j,r,b));var v=appConstants.templateName+"$~$widget$~$"+"footerDescription";
m.push({xtype:"panel",id:a+compName+graphIndex+"_panel",closeAction:"destroy",ui:"newGraphPanel",title:'<div style="float:left" class="font_normal12">'+e.title+'</div><div id ="iconRename" style="float:left;margin-left:20px" class="iconRename"></div>',margin:"0 5 10 5",height:350,scroll:false,bodyPadding:n,layout:"fit",align:"stretch",autoScroll:true,overflowX:"hidden",overflowY:"auto",columnWidth:z,chartCollectionVal:e,graphIndex:graphIndex,compName:compName,chartType:j,chartTypeCollection:w,dockedItems:[{xtype:"toolbar",dock:"bottom",align:"stretch",layout:"fit",overCls:"reporterTemplateWidgetToolbarOver",cls:"reporterTemplateWidgetToolbar",height:42,items:[{xtype:"container",layout:{type:"hbox",align:"middle"},items:[{xtype:"button",width:16,height:16,padding:0,margin:"8 4 8 10",id:"widgetDescriptor"+a+compName+graphIndex,cls:"iconDescription",listeners:{afterrender:function(){Ext.create("Ext.tip.ToolTip",{target:this.id,anchor:"top",cls:"yellowTip",trackMouse:true,html:"Widget Descriptor"});
}}},{xtype:"label",id:v+compName+graphIndex,text:appConstants.builderJson.data.widgetFooter,margin:"5 10 5 5",flex:1,cls:"handSymbol",listeners:{afterrender:function(C){C.el.on("click",this.onEdit,this);},},onEdit:function(E,C,F){var D=this;if(!D.editor){D.editor=Ext.create("Ext.Editor",{updateEl:true,completeOnEnter:true,cancelOnEsc:true,floating:false,alignment:"tl",autoSize:{width:"boundEl",height:"21"},hideEl:false,offsets:[0,-2],field:{xtype:"textfield",cls:"textbox",},listeners:{complete:{fn:function(I,L,H,K){var J="/final/reporter/ErReportBuilderDrillDownController.jsp";
var G=appConstants.appObj.getController(appConstants.appController);var M="&widgetHeaderFooterInfo="+L;M+="&isCustomLayout="+appConstants.isCustomLayout;M+="&method=graphHeaderFooter";M+="&templateName="+appConstants.templateName;M+="&compName="+thisPanel.compName;M+="&idDescription=footer$~$"+thisPanel.graphIndex;
M+="&chartType="+thisPanel.chartType;M+="&chartTypeCollection="+thisPanel.chartTypeCollection;G.callAjax(J,M,false,true);},scope:D,}}});}D.editor.startEdit(C);}},]}]}],listeners:{boxready:function(D){if(!Ext.isEmpty(D.header)){var C=Ext.get(D.header.id+"_hd-textEl");Ext.get(D.header.id).on("click",function(H,G){var F=C.dom.innerText;
var E=new Ext.Editor({width:150,alignment:"tl",floating:false,shadow:false,updateEl:true,completeOnEnter:true,cancelOnEsc:true,field:{xtype:"textfield",cls:"textbox",maxLength:32,enforceMaxLength:true},listeners:{"complete":function(O,N,J,L){C.dom.innerHTML=N;C.dom.innerHTML='<div style="float:left" class="font_normal12">'+N+'</div><div id ="iconRename" style="float:left;margin-left:20px" class="iconRename"></div>';
var K="/final/reporter/ErReportBuilderDrillDownController.jsp";var I=appConstants.appObj.getController(appConstants.appController);var M=D;var P="&widgetHeaderFooterInfo="+N;P+="&isCustomLayout="+appConstants.isCustomLayout;P+="&method=graphHeaderFooter";P+="&templateName="+appConstants.templateName;
P+="&fromReportBuilder="+appConstants.fromReportBuilder;P+="&compName="+M.compName;P+="&idDescription=header$~$"+M.graphIndex;P+="&chartType="+M.chartType;P+="&chartTypeCollection="+M.chartTypeCollection;I.callAjax(K,P,false,true);}}});E.startEdit(C,F);},D,{delegate:"#"+D.header.id+"_hd-textEl"});}}},items:s});
}var c=1;if(m.length>1){c=2;}A.add({xtype:"panel",id:compName+"basepanel",closeAction:"destroy",ui:"groupPanel",bodyPadding:"10 5 0 5",title:compName,columns:c,margin:"0 0 10 0",sortable:true,autoScroll:true,layout:{type:"table",columns:c,tableAttrs:{style:{width:"100%",tableLayout:"fixed"}}},items:m});
}}A.doLayout();}else{A.add(this.getNoMeasure());this.enableDisableTools(true);}}else{A.add(this.getNoMeasure());}},getDynamicRangesInfo:function(){var c=new Array();var a=Ext.getCmp("rangeSettingsItemsId");if(!a.isHidden()&&a.items!=undefined){for(var b=0;b<a.items.length;b++){var d=Ext.getCmp("dynamicRangeCombo_"+b).fieldLabel+"~";
d+=Ext.getCmp("dynamicRangeCombo_"+b).getValue()+"*";if(Ext.getCmp("dynamicRangeCombo_"+b).getValue()=="None"){d+="0";}else{d+=Ext.getCmp("disp_MeasureName"+b).getValue();}c.push(d);}}console.log(c);return c;}});