
<!--
***************************************************************************************
*	File name		: endUserDashboardMain.jsp
*	Purpose			: This is the main page for End User Dashboard
*	Version			: eG 6.0.1 and Above
*	Creation Date	: 04/12/2014
*	Authtor			: Saravanan . A
*	Design			: Jaiwin
******************************************************************************************/
-->
<%@ taglib prefix="egui" uri="../WEB-INF/eg-taglib.tld" %>
<%@ page errorPage = "EgProbsM.jsp"%>
<%@ page import = "com.eg.EgMappingInfo"%>
<%@ page import = "com.eg.IniFile"%>
<%@ page import = "com.eg.EgInstallInfo"%>
<%@ page import = "com.eg.EgDbInfo"%>
<%@ page import = "com.eg.EgDbaseInfo"%>
<%@ page import = "com.eg.EgURLEncoder" %>
<%@ page import = "com.egurkha.monitor.*" %>
<%@ page import = "com.egurkha.util.StringUtils"%>
<%@ page import = "java.util.*" %>
<%@ page import = "com.egurkha.*"%>
<%@ page import = "egurkha.reporter.ErUtils"%>
<%@ page import = "com.eg.*"%>
<%@ page import = "egurkha.reporter.ErUserData"%>
<%@ page import = "com.egurkha.ini.IniUI"%>
<%@ page import = "com.egurkha.monitor.VmDashboardHelper"%>
<%@ page import = "com.eg.IniFile"%>
<%@ page import = "java.text.*" %>
<%@ page import = "java.math.*" %>
<%@ page import="net.sf.json.*"%>
<%@ page language="java" contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" %>
<%@ page autoFlush="true" buffer="1094kb"%>
<script language="JavaScript1.2" type="text/JavaScript"> 
	var vdComboArray = new Array();
</script>

<%
	response.setHeader("Cache-Control","no-store");
	response.setHeader("Pragma","no-cache");
	response.setDateHeader ("Expires", -1);
	request.setCharacterEncoding("UTF-8");
%>

<%

	UserRegistry registry = UserRegistry.getInstance();
	User user = null; //registry.getUser(session.getId());

	String fromMenuStr = request.getParameter("fromMenu");
	boolean isFromMenu=false;
	if(fromMenuStr!=null && (fromMenuStr.equalsIgnoreCase("true") || fromMenuStr.equalsIgnoreCase("yes")))
	{
		isFromMenu=true;
	}

	String showKeyUserStr = request.getParameter("showKeyUser");
	boolean showKeyUser=false;
	if(showKeyUserStr!=null && (showKeyUserStr.equalsIgnoreCase("true") || showKeyUserStr.equalsIgnoreCase("yes")))
	{
		showKeyUser=true;
	}

	String updateUserAssociateStr = request.getParameter("updateUserAssociate");
	boolean updateUserAssociateFlag=false;
	if(showKeyUser && updateUserAssociateStr!=null && (updateUserAssociateStr.equalsIgnoreCase("true") || updateUserAssociateStr.equalsIgnoreCase("yes")))
	{
		updateUserAssociateFlag=true;
	}

	boolean isFromGeo=false;
	String fromGeoStr = request.getParameter("fromGeo");
	if(fromGeoStr!=null && (fromGeoStr.equalsIgnoreCase("true") || fromGeoStr.equalsIgnoreCase("yes")))
	{
		isFromGeo=true;
	}
	if(isFromMenu || isFromGeo)
	{
		user = registry.getUser(session.getId(),true);
	}
	else
	{
		user = registry.getUser(session.getId());
	}

	EgUserRole userRole = null;
	boolean isAllCompAccess=false;
	boolean isManagerLogin=false;
	String userName = "admin";
	String desktopName = request.getParameter("username");
	desktopName=(desktopName==null)?"":desktopName;

	String installdir = EgInstallInfo.getInstallDir();
	IniFile in = new IniFile(installdir+"/manager/config/eg_endUserDetails.ini");

	String strEGManagerUser=in.getValue("END_USER_DASHBOARD_SETTINGS","eGManagerUser");
	strEGManagerUser=(strEGManagerUser==null || strEGManagerUser.trim().length()==0)?"false":strEGManagerUser;
	boolean isEGManagerUser = strEGManagerUser.equalsIgnoreCase("true")?true:false;

	String moreOptionsWithGrid = in.getValue("END_USER_DASHBOARD_SETTINGS","MoreOptionsWithGrid");
	moreOptionsWithGrid = (moreOptionsWithGrid==null || moreOptionsWithGrid.trim().length()==0)?"false":moreOptionsWithGrid;
	boolean isMoreOptionsGrid = (moreOptionsWithGrid.equalsIgnoreCase("true") || moreOptionsWithGrid.equalsIgnoreCase("yes"))?true:false;

	if(user==null && (!isFromMenu || !isFromGeo))
	{
		String login_user = "";
		if(isEGManagerUser)
			login_user = request.getParameter("user");

		userName=(login_user==null || login_user.trim().length()==0)?"admin":login_user;
		ErUserData userData = new ErUserData(userName,false);
		if(userData==null)
		{
			userName="admin";
			userData = new ErUserData(userName,false);
			user = userData.usr;
		}
		else if(userData!=null)
		{
			user = userData.usr;
		}

		if(user!=null)
		{
			userRole = user.getUserRole();
			isAllCompAccess = userRole.hasAllComponentAccess();
		}
	}
	else if(user!=null)
	{
		userName = user.getLoginID();
		userRole = user.getUserRole();
		isAllCompAccess = userRole.hasAllComponentAccess();
		isManagerLogin = true;
	}

	String userType = request.getParameter("userType");
	if(userType==null || userType.trim().length()==0)
		userType = request.getParameter("usertype");
	userType = (userType==null || userType.equalsIgnoreCase(""))?"VDI":userType;

	boolean isOnlyVMAssigned=false;
	boolean isVMAssigned=false;
	if(user!=null && user.isOnlyVMAssigned() && (!user.isVMAssigned()) && user.getOnlyVMs().size()>0 && userType!=null && userType.equalsIgnoreCase("VDI"))
	{
		isOnlyVMAssigned=true;
	}
	else if(user!=null && (!user.isOnlyVMAssigned()) && user.isVMAssigned() && user.getOnlyVMs().size()>0 && userType!=null && userType.equalsIgnoreCase("VDI"))
	{
		isVMAssigned=true;
	}
	else if(user!=null && user.isOnlyVMAssigned() && user.isVMAssigned() && user.getOnlyVMs().size()>0 && userType!=null && userType.equalsIgnoreCase("VDI"))
	{
		isOnlyVMAssigned=true;
		isVMAssigned=true;
	}
	IniUI iniUI = IniUI.getInstance();
	String thisLanguage = iniUI.getDefaultLanguage();
	if (user!=null)
	{
		user.setUserLanguageAndSkins();
		String userLang = user.getLanguage();
		if (userLang!=null && !userLang.equalsIgnoreCase("NULL"))
		{
			thisLanguage=userLang;
		}
	}
	
	
	boolean showComboFil=false;
	if(userType!=null && (userType.equalsIgnoreCase("ESX")|| userType.equalsIgnoreCase("VCDataStore")))
	{
		showComboFil=true;
	}

	ArrayList enableadList = new ArrayList();
	String enablead = in.getValue("END_USER_DASHBOARD_SETTINGS","EnableADGroup");
	String byDefaultADGroupView = in.getValue("END_USER_DASHBOARD_SETTINGS","ByDefaultADGroupView");

	if(enablead != null && enablead.trim().length() > 0){
		enableadList = com.egurkha.util.StringUtils.egTokenizer(enablead, ",", true,false,true);
	}
	boolean enableAd = false;
	boolean byDefaultAdView = false;
	boolean byDefaultAdViewWithText = false;
	if(userType != null && !userType.equalsIgnoreCase("ESX") && enableadList.contains(userType))
		enableAd = true;

	if(enableAd && byDefaultADGroupView!=null && (byDefaultADGroupView.equalsIgnoreCase("true") || byDefaultADGroupView.equalsIgnoreCase("yes")))
	{
		byDefaultAdView = true;
	}
	else if(enableAd && byDefaultADGroupView!=null && byDefaultADGroupView.trim().length()>0 && !byDefaultADGroupView.equalsIgnoreCase("false") && !byDefaultADGroupView.equalsIgnoreCase("no"))
	{
		byDefaultAdViewWithText = true;
	}

	ArrayList enableFilterList = new ArrayList();
	String enableFilter = in.getValue("END_USER_DASHBOARD_SETTINGS","EnableFilter");
	String defaultFilter = in.getValue("END_USER_DASHBOARD_SETTINGS","defaultFilter");
	String subFilterStr = in.getValue("END_USER_DASHBOARD_SETTINGS","subFilter");
	if(defaultFilter == null || defaultFilter.trim().length() == 0)
		defaultFilter="Vendor";
	
	if(enableFilter != null && enableFilter.trim().length() > 0){
		enableFilterList = com.egurkha.util.StringUtils.egTokenizer(enableFilter, ",", true,false,true);
	}
	String subFilLbl1 = "Search";
	String subFilLbl2 = "Search";
	if(subFilterStr != null && subFilterStr.trim().length() > 0 && subFilterStr.indexOf(",")!=-1){
		subFilLbl1 = subFilterStr.substring(0,subFilterStr.indexOf(","));
		subFilLbl2 = subFilterStr.substring(subFilterStr.indexOf(",")+1);
	} else {
		subFilLbl1 = subFilterStr;
	}

	boolean enableFilt = false;
	if(userType != null && enableFilterList.contains(userType))
		enableFilt = true;

	//Citrix Dashboard params
	String iniName = null,user_name = null,isUserBased = null,dashboard_name = null,view_name = null,geoInfo = null, filterName = null,filterViewName = null,countryCode = null,time_line = null,regionName = "",usercountval = null,dashboard_mapping = null,fromServiceHomePage = null,fromZonePage = null,selectedTest=null,selectedMeasure=null;

	String isFromXenVdi = request.getParameter("isFromXenVdi");
	boolean isFromXenVdiFlag=false;
	if(isFromXenVdi!=null && (isFromXenVdi.equalsIgnoreCase("true") || isFromXenVdi.equalsIgnoreCase("yes")))
	{
		isFromXenVdiFlag=true;
	}
	boolean is_csv_pdf_hide=false;
	if(isFromXenVdi!=null && (isFromXenVdi.equals("true") || isFromXenVdi.equals("yes")))
	{
		isMoreOptionsGrid  = false;
		is_csv_pdf_hide=true;
	}

	if(isFromGeo){
		IniFile geoIni = new IniFile(EgInstallInfo.getInstallDir()+"/manager/config/eg_geodetails.ini",true);

		iniName = request.getParameter("iniName");
		user_name = request.getParameter("user_name");
		isUserBased = request.getParameter("isUserBased");
		dashboard_name = request.getParameter("dashboard_name");
		view_name = request.getParameter("view_name");
		time_line = request.getParameter("time_line");
		geoInfo = request.getParameter("ginfo");
		usercountval = request.getParameter("usercountval");
		dashboard_mapping = request.getParameter("dashboard_mapping");
		fromServiceHomePage = request.getParameter("fromServiceHomePage");
		fromZonePage = request.getParameter("fromZonePage");
		selectedTest = request.getParameter("selectedTest");
		selectedTest=(selectedTest==null)?"":selectedTest;
		selectedMeasure = request.getParameter("selectedMeasure");
		selectedMeasure=(selectedMeasure==null)?"":selectedMeasure;
		if(geoInfo != null && !geoInfo.equalsIgnoreCase("null") && geoInfo.trim().length() > 0){
			if(geoInfo.indexOf("-") > 0){
				regionName = geoInfo.substring(0,geoInfo.indexOf("-"));
				regionName = regionName.trim();
				String countryInfo = geoInfo.substring(geoInfo.indexOf("-")+1);
				String locCode = geoIni.getValue("COUNTRY_NAME_TO_CODE_MAPPING",countryInfo.trim());
				if(locCode == null || locCode.trim().length() == 0)
					locCode = countryInfo;
				countryCode = locCode;
				filterName = geoInfo;
				filterViewName = "Geo_Region_View";
			}
			else if(!geoInfo.equalsIgnoreCase("All") && !geoInfo.equalsIgnoreCase("World")){
				String locCode = geoIni.getValue("COUNTRY_NAME_TO_CODE_MAPPING",geoInfo);
				if(locCode == null || locCode.trim().length() == 0)
					locCode = geoInfo;
				filterName = locCode;
				filterViewName="Geo_Country_View";
			}
			else{
				filterName = "World";
				filterViewName="";
			}
		}
		else{
			filterName = "World";
			filterViewName="";
		}
	}else{
		iniName = request.getParameter("iniName");
		user_name = request.getParameter("user_name");
		isUserBased = request.getParameter("isUserBased");
		dashboard_name = request.getParameter("dashboard_name");
		view_name = request.getParameter("view_name");
		dashboard_mapping = request.getParameter("dashboard_mapping");
		fromServiceHomePage = request.getParameter("fromServiceHomePage");
		selectedTest = request.getParameter("selectedTest");
		selectedTest=(selectedTest==null)?"":selectedTest;
		selectedMeasure = request.getParameter("selectedMeasure");
		selectedMeasure=(selectedMeasure==null)?"":selectedMeasure;
	}
	selectedMeasure = (selectedMeasure==null ||selectedMeasure.trim().length() == 0)?"":EgURLEncoder.encode(selectedMeasure,"UTf-8");
	ErUtils erUtils = new ErUtils();
	String monitor_Skin = user.getMonitorSkin();
	String  script_src="script_item_"+thisLanguage+".js";
	EgMappingInfo mappingInfo = new EgMappingInfo(thisLanguage);
	String title = mappingInfo.getTextDescription("monitor.endUserDashboard.END USER DASHBOARD");
	String strVdiHostCombo=in.getValue("END_USER_DASHBOARD_SETTINGS","showVdiHostCombo");
	strVdiHostCombo=(strVdiHostCombo==null || strVdiHostCombo.trim().length()==0)?"false":strVdiHostCombo;
	boolean showVdiHostCombo = strVdiHostCombo.equalsIgnoreCase("true")?true:false;
	String default_vdi_type=in.getValue("END_USER_DASHBOARD_SETTINGS","Default_VdiType");
	default_vdi_type=(default_vdi_type==null || default_vdi_type.trim().length()==0)?"":default_vdi_type;
	String default_vdi_type2 = "";
	String default_vdi_Name = "";

	String vdiReq = request.getParameter("vdiType");
	if(vdiReq!=null && vdiReq.length()>0)
	{
			default_vdi_type = vdiReq;
			if(vdiReq.indexOf(":") >0)
			{
				default_vdi_type2 = vdiReq.substring(0,vdiReq.indexOf(":"));
				default_vdi_Name = vdiReq.substring(vdiReq.indexOf(":")+1);

			}
			else
				default_vdi_type2 = vdiReq;
	}
	else
		default_vdi_type2 = default_vdi_type;
	
	boolean addtionalSearchFlag = false;
	String addSeachSubject = "Additional_Search";
	String additionalSearch = in.getValue(addSeachSubject,"EnableAddtionalSearch");
	if (additionalSearch!=null && additionalSearch.trim().length()>0 && (additionalSearch.equalsIgnoreCase("true") || additionalSearch.equalsIgnoreCase("yes")))
		addtionalSearchFlag = true;

	String adtnlSearchStr = request.getParameter("adtnlSearchStr");
	adtnlSearchStr = (adtnlSearchStr==null || adtnlSearchStr.trim().length()==0 || adtnlSearchStr.equalsIgnoreCase("NULL"))?"":adtnlSearchStr;
	if (adtnlSearchStr!=null && adtnlSearchStr.trim().length()>0)
		adtnlSearchStr = com.egurkha.util.StringUtils.replace(adtnlSearchStr, "\\", "\\\\");

	StringTokenizer s_colTokens = null;
	String adtnlSearchEmptyText = "";
	StringBuffer addSearchBuf = new StringBuffer();
	String adtnlSearchColumns = in.getValue(addSeachSubject,userType+":SelectedSearchColumn");
	if(adtnlSearchColumns!=null && adtnlSearchColumns.trim().length()>0 && !adtnlSearchColumns.equalsIgnoreCase("NULL"))
		s_colTokens = new StringTokenizer(adtnlSearchColumns,",");
	else
		addtionalSearchFlag = false;

	ArrayList addString=new ArrayList();
	if(s_colTokens!=null)
	{
		while(s_colTokens.hasMoreTokens())
		{
			String tmpSearchCol = (String)s_colTokens.nextToken();
			if(tmpSearchCol!=null && tmpSearchCol.trim().length()>0 && tmpSearchCol.indexOf(":")!=-1)
			{
				String new_addString=tmpSearchCol.substring(tmpSearchCol.lastIndexOf(":")+1);
				if(new_addString!=null && !addString.contains(new_addString))
				{
					addSearchBuf.append(new_addString +",");

					addString.add(new_addString);
				}
			}
		}
	}

	if(addSearchBuf!=null)
		adtnlSearchEmptyText = "Search "+addSearchBuf.toString();
	if(adtnlSearchEmptyText!=null && adtnlSearchEmptyText.endsWith(","))
		adtnlSearchEmptyText = adtnlSearchEmptyText.substring(0,adtnlSearchEmptyText.lastIndexOf(","));

	String searchStringReq = request.getParameter("searchString");
	if(searchStringReq==null || searchStringReq.trim().length()==0)
		searchStringReq = request.getParameter("selectedString");
	searchStringReq=(searchStringReq==null || searchStringReq.trim().length()==0)?"":searchStringReq;
	searchStringReq = com.egurkha.util.StringUtils.replace(searchStringReq, "\\", "\\\\");
	String searchStringReqVCDS="";
	if(userType!=null && userType.equalsIgnoreCase("VDIESX") && searchStringReq!=null && searchStringReq.trim().length()>0)
	{
		searchStringReqVCDS=searchStringReq;
		searchStringReq="";
	}
	
	String pageNo = request.getParameter("pageNo");

	String refreshFreq=in.getValue("END_USER_DASHBOARD_SETTINGS","Refresh frequency");
	long refFrequency = 60 * 1000L;
	if(refreshFreq!=null && refreshFreq.length()>0)
	{
		refFrequency =  Long.valueOf(refreshFreq).longValue() * 1000L;
	}
	
	String s_default_priority=in.getValue("User_Default_Limits",userName);
	if(s_default_priority==null || s_default_priority.trim().length()==0)
		s_default_priority=in.getValue("END_USER_DASHBOARD_SETTINGS","Default");
	//if(userType!=null && userType.equalsIgnoreCase("VCDataStore"))
		//s_default_priority=in.getValue("END_USER_DASHBOARD_SETTINGS","DefaultDatastore");
	String s_default_limit=s_default_priority;
	String limitReq = request.getParameter("priority");
	if(limitReq!=null && limitReq.length()>0)
		s_default_priority = limitReq;

	if((s_default_limit==null || s_default_limit.trim().length()==0) && limitReq!=null && limitReq.length()>0)
	{
		s_default_limit=limitReq;
	}
	String searchEmptyText = "";
	if(searchStringReq==null || searchStringReq.trim().length()==0 || searchStringReq.equalsIgnoreCase("null"))
	{
		if(userType!=null && userType.equalsIgnoreCase("VCDataStore"))
			searchEmptyText = "Search Datastores";
		else if(userType!=null && userType.equalsIgnoreCase("VDIESX"))
			searchEmptyText = "Search Users/Desktops";
		else if(userType.equalsIgnoreCase("XenApp") || userType.equalsIgnoreCase("XenApp7") || userType.equalsIgnoreCase("CitrixXenVDI"))
		{
			searchEmptyText = "Search Users";
		}
		else if(userType.equalsIgnoreCase("VDI") || userType.equalsIgnoreCase("Terminal") || userType.equalsIgnoreCase("Horizon"))
		{
			searchEmptyText = "Search Users/Desktops";
		}
		else if(userType.equalsIgnoreCase("ESX"))
		{
			searchEmptyText = "Search VMs";
		}
		else if(userType.equalsIgnoreCase("AppXenApp7") || userType.equalsIgnoreCase("AppDDXenApp7") || userType.equals("OverviewAppXenApp7") || userType.equals("OverviewAppVDI"))
		{
			searchEmptyText = "Search Applications";
		}
	}
	String userExpDashTitle = mappingInfo.getTextDescription("monitor.endUserDashboard.User Experience Overview for")+" "+userType;
	boolean endUserOverviewFlag = false;

	String usersByLocation = in.getValue("END_USER_DASHBOARD_SETTINGS","UsersByLocation");
	usersByLocation = (usersByLocation==null || usersByLocation.trim().length()==0)?"false":usersByLocation;
	boolean isUsersByLocation = (usersByLocation.equalsIgnoreCase("true") || usersByLocation.equalsIgnoreCase("yes"))?true:false;

	String showUsersByLocation = in.getValue("END_USER_DASHBOARD_SETTINGS","ShowUsersByLocation");
	showUsersByLocation = (showUsersByLocation==null || showUsersByLocation.trim().length()==0)?"false":showUsersByLocation;
	boolean isShowUsersByLocation = (showUsersByLocation.equalsIgnoreCase("true") || showUsersByLocation.equalsIgnoreCase("yes"))?true:false;

	String endUserDashOverview = request.getParameter("endUserDashOverview");
	endUserDashOverview = (endUserDashOverview==null || endUserDashOverview.trim().length()==0)?"":endUserDashOverview;
	String endUserOverviewParams = "";
	if(endUserDashOverview!=null && endUserDashOverview.trim().length()>0 && (endUserDashOverview.equalsIgnoreCase("yes")||endUserDashOverview.equalsIgnoreCase("true")))
	{
		endUserOverviewFlag =  true;
		String groupByStr = in.getValue("LOC_USER_DESKTOP_METRICS","Header:"+userType);
		if(groupByStr!=null && groupByStr.trim().length()>0 && !groupByStr.equalsIgnoreCase("null"))
		{
			if(groupByStr.indexOf(":")>-1 && groupByStr.indexOf(",")>-1)
				groupByStr = groupByStr.substring(groupByStr.indexOf(":")+1,groupByStr.indexOf(","));
			if(groupByStr!=null && groupByStr.trim().length()>0)
				searchEmptyText = "Search "+groupByStr;
		}

		if(userType!=null && userType.trim().length()>0 && (userType.equalsIgnoreCase("XenApp") || userType.equalsIgnoreCase("XenApp7")))
			userExpDashTitle = mappingInfo.getTextDescription("monitor.endUserDashboard.Citrix User Experience By Location for")+" "+userType;
		else
			userExpDashTitle = mappingInfo.getTextDescription("monitor.endUserDashboard.User Experience By Location for")+" "+userType;
	}
	searchEmptyText = mappingInfo.getTextDescription("monitor.common."+searchEmptyText);
	String enableBackButton = request.getParameter("enableBackButton");
	enableBackButton=(enableBackButton==null || enableBackButton.trim().length()==0)?"false":enableBackButton;
	String overviewSearchStr = request.getParameter("overviewsearchstr");
	overviewSearchStr = (overviewSearchStr==null || overviewSearchStr.trim().length()==0)?"":overviewSearchStr;
	String isFromUEDOverview = request.getParameter("isfromuedoverview");
	isFromUEDOverview = (isFromUEDOverview==null || isFromUEDOverview.trim().length()==0)?"":isFromUEDOverview;
	boolean isFromUEDSort = false;
	String fromuedsort = request.getParameter("isfromuedsort");
	fromuedsort = (fromuedsort==null || fromuedsort.trim().length()==0)?"":fromuedsort;
	if(fromuedsort!=null && fromuedsort.trim().length()>0 && (fromuedsort.equalsIgnoreCase("true")||fromuedsort.equalsIgnoreCase("yes")))
		isFromUEDSort = true;
	String Limits_to=in.getValue("END_USER_DASHBOARD_SETTINGS","Limits to");
	VmDashboardHelper vmDashHelper=new VmDashboardHelper(user);
	List types =vmDashHelper.getUserTypeComponentsComboData(userType);
	int size = (types!=null && types.size()>0)?types.size():0;
	String access = request.getParameter("access");
	if(access==null)
		access = request.getParameter("Access");
	access=(access==null || access.trim().length()==0)?"":access;

	if(desktopName!=null && desktopName.trim().length()>0 && (access==null || access.trim().length()==0))
		access="allusers";

	IniFile dashIni = new IniFile(EgInstallInfo.getInstallDir()+"/manager/config/eg_dashboardConfig.ini",true);
	boolean isDetailsFromADOnly = false;
	String locStr = dashIni.getValue("USER_LOCATION_TEST_CONFIG",userType+":ShowLocationFromADOnly");
	if(locStr != null && locStr.trim().length() > 0 && (locStr.equalsIgnoreCase("true") || locStr.equalsIgnoreCase("yes"))){
		isDetailsFromADOnly = true;
	}

	ArrayList uedMenuList=new ArrayList();
	List serverTypeList = user.getServerTypes();
	List vmTypeList = user.getOnlyVMTypes();
	List vmServersList = user.getOnlyVMServers(false);
	Object [] ued_vars = in.getVariables("USER_TYPE_COMPONENTS");
	if (ued_vars!=null)
	{
		for (int i=0;i<ued_vars.length ;i++ )
		{
			String thisVar = (String)ued_vars[i];
			String comptypesIni = in.getValue("USER_TYPE_COMPONENTS",thisVar);
			StringTokenizer st = new StringTokenizer(comptypesIni,",");
			while(st.hasMoreTokens())
			{
				String type = st.nextToken();
				if(type!=null)
				{
					type = type.trim();
					if(serverTypeList!=null && serverTypeList.contains(type))
					{
						uedMenuList.add(thisVar);
						break;
					}
					else if((user.isOnlyVMAssigned() || user.isVMAssigned()) && user.getOnlyVMs().size()>0 && vmTypeList!=null && vmTypeList.contains(type))
					{
						uedMenuList.add(thisVar);
						break;
					}
				}
			}
		}
	}

	Object [] ued_utc_vars = in.getVariables("USERTYPE_IN_COMBO");
	List utc_list = new LinkedList();

	List new_types = new LinkedList();
	String new_selection="";
	String fMV = request.getParameter("fromMetricView");
	
	if(!isFromGeo && (fMV == null || (!fMV.equalsIgnoreCase("true") && !fMV.equalsIgnoreCase("yes")))  && types!=null && uedMenuList!=null)
	{
		if (ued_utc_vars!=null)
		{
			for (int i=0;i<ued_utc_vars.length ;i++ )
			{
				String thisVar = (String)ued_utc_vars[i];
				String utc_str = in.getValue("USERTYPE_IN_COMBO",thisVar);
				if(thisVar!=null && utc_str!=null && utc_str.trim().length()>0 && (utc_str.equalsIgnoreCase("yes") || utc_str.equalsIgnoreCase("true")) && uedMenuList.contains(thisVar))
				{
					utc_list.add(thisVar);
					if(userType!=null && !userType.equalsIgnoreCase(thisVar) && (thisVar.equalsIgnoreCase("XenApp") || thisVar.equalsIgnoreCase("XenApp7")))
					{
						new_types.addAll(vmDashHelper.getUserTypeComponentsComboData(thisVar));
					}
					else if(userType!=null && !thisVar.equalsIgnoreCase("XenApp") && !thisVar.equalsIgnoreCase("XenApp7"))
					{
						new_types.add(thisVar);
					}
				}
			}
		}
		if(new_types!=null && new_types.size()>0)
		{
			if(utc_list!=null && utc_list.contains(userType) && userType.equalsIgnoreCase("XenApp") || userType.equalsIgnoreCase("XenApp7"))
			{
				types.addAll(new_types);
				//showVdiHostCombo = true;
				size = (types!=null && types.size()>0)?types.size():0;
				if(size>1)
					showVdiHostCombo = true;
				else
					showVdiHostCombo = false;
			}
			else if(utc_list!=null && utc_list.contains(userType))
			{
				types.clear();
				types.addAll(new_types);
				size = (types!=null && types.size()>0)?types.size():0;
				if(size>1)
					showVdiHostCombo = true;
				else
					showVdiHostCombo = false;
			}
			else
			{
				showVdiHostCombo = false;
			}
		}
	}

	String currOrderBy =request.getParameter("orderBy");
	currOrderBy=(currOrderBy==null || currOrderBy.trim().length()==0)?"":currOrderBy;

	String currOrderByColumn = request.getParameter("orderByColumn");
	currOrderByColumn=(currOrderByColumn==null || currOrderByColumn.trim().length()==0)?"":EgURLEncoder.encode(currOrderByColumn,"UTf-8");
	String currColType = request.getParameter("columnType");
	currColType = (currColType==null || currColType.trim().length()==0)?"":currColType;
	String currColdispName = request.getParameter("columnDispName");
	currColdispName = (currColdispName==null || currColdispName.trim().length()==0)?"":currColdispName;
	
	String fromctx = request.getParameter("fromctx");
	fromctx = (fromctx==null || fromctx.trim().length()==0)?"":fromctx;

	String fromMetricView = request.getParameter("fromMetricView");
	fromMetricView = (fromMetricView==null || fromMetricView.trim().length()==0)?"":fromMetricView;
	
	String comptype = request.getParameter("comptype");
	String treeTitle = request.getParameter("treeTitle");
	String componentNameSearch = request.getParameter("componentNameSearch");
	String fromPageView = request.getParameter("fromPageView");
	String selectedState = request.getParameter("selectedState");
	String viewPageTitle = request.getParameter("viewPageTitle");
	String action = request.getParameter("action");
	String fromHomepage = request.getParameter("fromHomepage");
	String isfromCitrix = request.getParameter("isfromCitrix");
	String isfromRum = request.getParameter("isfromRum");
	String isFromZone = request.getParameter("isFromZone");
	String iszoneName = request.getParameter("iszoneName");
	String parentZone = request.getParameter("parentZone");
	String appliesTo = request.getParameter("appliesTo");
	String fromSerComboChange = request.getParameter("fromSerComboChange");
	String filterByFlag = request.getParameter("filterByFlag");
	String filterByParamFlag = request.getParameter("filterByParamFlag");
	String aduserFilter = request.getParameter("aduserFilter");
	String overviewType = request.getParameter("overviewType");
	String uedOverviewType = request.getParameter("uedOverviewType");
	//back to service 
	
	String filter = request.getParameter("filter");
	String selectedRum = request.getParameter("selectedRum");
	String isFromServiceMenu = request.getParameter("isFromServiceMenu");
	String isFromZoneMain = request.getParameter("isFromZoneMain");
	String isFromZoneMenu = request.getParameter("isFromZoneMenu");
	String isFromServiceGroup = request.getParameter("isFromServiceGroup");
	String serviceComponent = request.getParameter("serviceComponent");
	String segmentComponent = request.getParameter("segmentComponent");
	String fromHostPanel = request.getParameter("fromHostPanel");
	String zoneComponent = request.getParameter("zoneComponent");
	String zoneAggregate = request.getParameter("zoneAggregate");
	if(byDefaultAdView)
		aduserFilter = (aduserFilter==null || aduserFilter.trim().length()==0)?"All":aduserFilter;
	else if(byDefaultAdViewWithText)
		aduserFilter = (aduserFilter==null || aduserFilter.trim().length()==0)?byDefaultADGroupView:aduserFilter;
	else
		aduserFilter = (aduserFilter==null || aduserFilter.trim().length()==0)?"":aduserFilter;

	aduserFilter=  com.egurkha.util.StringUtils.replace(aduserFilter,"|eq|","=");

	String filterParam="";

	String filterFlag = request.getParameter("filterFlag");
	String detail = request.getParameter("detail");
	String compCombo = request.getParameter("compCombo");
	String filterBy = request.getParameter("filterBy");
	if(filterBy==null || filterBy.trim().length()==0)
	{
		if(isOnlyVMAssigned && !isVMAssigned)
		{
			filterBy="Virtual_Machine";
		}
		else
			filterBy="All";
	}
	String subFilter = request.getParameter("subFilter");
	String searchFilter = request.getParameter("searchFilter");
	String nextSearch = request.getParameter("nextSearch");
	String nextSubSearch = request.getParameter("nextSubSearch");
	String fromf5 = request.getParameter("fromf5");
	String priorityFilter = request.getParameter("priorityFilter");
	String gatewayFilter = request.getParameter("gatewayFilter");

	String gatewayOption=in.getValue("END_USER_DASHBOARD_SETTINGS",userType+":Gateway");
	boolean isGateway=true;
	if(gatewayOption==null || gatewayOption.trim().length()==0 || gatewayOption.equalsIgnoreCase("false") || gatewayOption.equalsIgnoreCase("no"))
	{
		gatewayFilter = "";
		isGateway=false;
	}

	String isFromVCDS = request.getParameter("isFromVCDS");
	isFromVCDS = (isFromVCDS==null || isFromVCDS.trim().length()==0)?"":isFromVCDS;

	if(filterFlag != null && filterFlag.equalsIgnoreCase("true")){
		//if(isFromVCDS!=null && (isFromVCDS.equalsIgnoreCase("true") || isFromVCDS.equalsIgnoreCase("yes")))
		//{
			//filterParam ="&filterFlag=false";
		//}
		//else
			filterParam ="&filterFlag=true";

		filterParam+="&detail="+detail;
		filterParam+="&compCombo="+compCombo;
		filterParam+="&filterBy="+filterBy;
		filterParam+="&searchFilter="+searchFilter;
		filterParam+="&nextSearch="+nextSearch;
		filterParam+="&nextSubSearch="+nextSubSearch;
		filterParam+="&fromf5="+fromf5;
		filterParam+="&priorityFilter="+priorityFilter;
		filterParam+="&gatewayFilter="+gatewayFilter;
	}

	if(isFromVCDS!=null && (isFromVCDS.equalsIgnoreCase("true") || isFromVCDS.equalsIgnoreCase("yes")))
	{
		String dscomp = request.getParameter("dscomp");
		String dscomptype = request.getParameter("dscomptype");
		String dsInfo = request.getParameter("dsInfo");
		String dscompName = request.getParameter("dscompName");
		String dscomponentName = request.getParameter("dscomponentName");
		String dsmsmt_host = request.getParameter("dsmsmt_host");

		filterParam+="&isFromVCDS="+isFromVCDS;
		filterParam+="&dscomp="+dscomp;
		filterParam+="&dscomptype="+dscomptype;
		filterParam+="&dsInfo="+dsInfo;
		filterParam+="&dscompName="+dscompName;
		filterParam+="&dscomponentName="+dscomponentName;
		filterParam+="&dsmsmt_host="+dsmsmt_host;
	}
	

	String aggregateTab = request.getParameter("aggregateTab");
	String selectedParam=request.getParameter("selectedParam");
	String currentTab=request.getParameter("currentTab");
	String selectNode = request.getParameter("selectNode");
	String ctxCsrfToken = request.getParameter("com.eg.CSRF_NONCE");
	ctxCsrfToken = (ctxCsrfToken==null||ctxCsrfToken.trim().length()==0)?"":ctxCsrfToken;
	String fromCtxParams = "";
	if(fromctx!=null && fromctx.trim().length()>0 && !fromctx.equalsIgnoreCase("null"))
	{
		String sel_Node= "Zone^"+selectedParam;
		sel_Node = com.egurkha.util.StringUtils.replace(sel_Node, "^", "|cap|");
		fromCtxParams = "&fromctx="+fromctx+"&selectNode="+EgURLEncoder.encode(sel_Node,"UTf-8")+"&selectedParam="+selectedParam+"&fromHomepage="+fromHomepage+"&aggregateTab="+aggregateTab+"&zoneName="+selectedParam;
		filterParam+="&comptype="+comptype;
		
		fromCtxParams+="&parentZone="+parentZone+"&iszoneName="+iszoneName+"&isFromZoneMenu="+isFromZoneMenu+"&fromPageView="+fromPageView+"&filterBy="+filterBy;
	
		filterParam += fromCtxParams;
	}
	if(ctxCsrfToken!=null && ctxCsrfToken.trim().length()>0 && !ctxCsrfToken.equalsIgnoreCase("null"))
		fromCtxParams = fromCtxParams + "&com.eg.CSRF_NONCE="+ctxCsrfToken;
	String treeFlag_SBD = request.getParameter("treeFlag_SBD");
	String outsideService_SBD = request.getParameter("outsideService_SBD");
	String titleText_SBD = request.getParameter("titleText_SBD");
	String selectNode_SBD = request.getParameter("selectNode_SBD");
	String isEmulTrans_SBD = request.getParameter("isEmulTrans_SBD");
	String serviceName = request.getParameter("serviceName");
	String serviceState_SBD = request.getParameter("serviceState_SBD");
	String isServiceBusiDash = request.getParameter("isServiceBusiDash");
	String isServiceBusiViewMetrics = request.getParameter("isServiceBusiViewMetrics");

	String showUserLocations = in.getValue("GEO_LOCATION_SETTINGS",userType+":ShowUserLocations");
	showUserLocations = (showUserLocations==null || showUserLocations.trim().length()==0)?"":showUserLocations;
	boolean isShowUserLocation = false;
	if(showUserLocations!=null && showUserLocations.trim().length()>0 && (showUserLocations.equalsIgnoreCase("true") || showUserLocations.equalsIgnoreCase("yes")))
	{
		isShowUserLocation = true;
	}
	String cityFilter = "";
	String vendorFilter = "";
	String filterNames = new String();
%>
<html>
<head>
		<script language="JavaScript1.2" type="text/JavaScript"> 
			var backObject = new Object();
			backObject.comptype='<%=comptype%>';
			backObject.cmpType='<%=default_vdi_type2%>';
			backObject.cmpName='<%=default_vdi_Name%>';
			backObject.treeTitle='<%=treeTitle%>';
			backObject.componentNameSearch='<%=componentNameSearch%>';
			backObject.fromPageView='<%=fromPageView%>';
			backObject.selectedState='<%=selectedState%>';
			backObject.viewPageTitle='<%=viewPageTitle%>';
			backObject.action='<%=action%>';
			backObject.fromHomepage='<%=fromHomepage%>';
			backObject.overviewType='<%=overviewType%>';
			backObject.uedOverviewType='<%=uedOverviewType%>';

			var searchComponents='<%= mappingInfo.getTextDescription("monitor.common.Components")%>';
			var searchSimulations='<%= mappingInfo.getTextDescription("monitor.common.Simulations")%>';
			var searchSystems='<%= mappingInfo.getTextDescription("monitor.common.Systems")%>';
			var searchRecords='<%= mappingInfo.getTextDescription("monitor.common.Records")%>';
			var searchNo='<%= mappingInfo.getTextDescription("monitor.common.No")%>';
			var searchFound='<%= mappingInfo.getTextDescription("monitor.common.found")%>';

			var isFromXenVdi=<%=isFromXenVdiFlag%>;

			var strSkin='<%=monitor_Skin%>';
			var timeZoneOffsetVal='';
			var fromctx="<%=fromctx%>";
			var fromctxparams = '';
			var marginHeader='0 0 0 0';
			if(fromctx != undefined && (fromctx || fromctx=='true'))
			{
				marginHeader='0 0 0 10';
				fromctxparams ="<%=fromCtxParams%>"
			}
			var fromMetricView="<%=fromMetricView%>";
			var disptxt = '<egui:intnl text="monitor.common.Displaying"/>';
			var res_consum_Lbl = '<egui:intnl text="monitor.common.Server Resource Consumption"/>';
			var oftxt = '<egui:intnl text="monitor.common.of"/>';
			var isOnlyVMAssigned=<%=isOnlyVMAssigned%>;
			var isfromCitrix="<%=isfromCitrix%>";
			var isfromRum="<%=isfromRum%>";
			var isFromZone="<%=isFromZone%>";
			var iszoneName="<%=iszoneName%>";
			var parentZone="<%=parentZone%>";
			var appliesTo="<%=appliesTo%>";
			var fromSerComboChange="<%=fromSerComboChange%>";
			var filterByFlag="<%=filterByFlag%>";
			var filter="<%=filter%>";
			var filterByParamFlag="<%=filterByParamFlag%>";
			var enableAd="<%=enableAd%>";
			var enableFilt="<%=enableFilt%>";
			var filterParam="<%=filterParam%>";
			//back to service
			
			var selectedRum = "<%=selectedRum%>";
			
			var isFromServiceMenu = "<%=isFromServiceMenu%>";
			var isFromZoneMain = "<%=isFromZoneMain%>";
			var isFromZoneMenu = "<%=isFromZoneMenu%>";
			var isFromServiceGroup = "<%=isFromServiceGroup%>";
			var serviceComponent = "<%=serviceComponent%>";
			var segmentComponent = "<%=segmentComponent%>";
			var fromHostPanel = "<%=fromHostPanel%>";
			var zoneComponent = "<%=zoneComponent%>";
			var zoneAggregate = "<%=zoneAggregate%>";

			var filterByGl="<%=filterBy%>";
			var subFilterGl="<%=subFilter%>";
			var searchFilterGl="<%=searchFilter%>";
			var nextSearchGl="<%=nextSearch%>";
			var nextSubSearchGl="<%=nextSubSearch%>";
			var priorityFilterGl="<%=priorityFilter%>";
			var gatewayFilterGl="<%=gatewayFilter%>";
			var detail="<%=detail%>";
			var compComboValues="<%=compCombo%>";
			var compComboArray=[];
			if(compComboValues != null && compComboValues != undefined && compComboValues != "null")
			{
				if(compComboValues.indexOf(",")>-1)
					compComboArray=compComboValues.split(",");
				else
					compComboArray[0] = compComboValues;
			}

			var fromf5="<%=fromf5%>";
			var ShowComEnableFilt=<%=showComboFil%>;
			var defaultFilter="<%=defaultFilter%>";
			var isDetailsFromADOnly = <%=isDetailsFromADOnly%>;
			var isGateway = <%=isGateway%>;

			var showFilter = true;
			if(enableFilt == true || enableFilt == 'true')
				showFilter = false;


			var showComFilter = true;
			if(ShowComEnableFilt)
				showComFilter = false;

			var showgroupInfo = true;
			if(enableAd == true || enableAd == 'true')
				showgroupInfo = false;
			
			var panelADFilter=false;
			if(showFilter && showgroupInfo )
				panelADFilter = true;

			var aduserFilter="<%=aduserFilter%>";
			var advalue='user';
			if(aduserFilter != null && aduserFilter != undefined && aduserFilter !="")
				advalue='ad_group';

			var monSkin='<%=monitor_Skin%>';

			var groupInfo = new Array();
			groupInfo.push({
					name:'User',
					value:'user'
				});

				groupInfo.push({
					name:'AD Group',
					value:'ad_group'
				});

			var vdiComboListJSON = new Array();
<%
			for(int i=0;i<size;i++)
			{
				String type = (String)types.get(i);
				String selected = "";
				if((default_vdi_type2 == null || default_vdi_type2.trim().length() == 0) && (userType!=null  && 
					utc_list!=null && utc_list.contains(userType) && userType.equalsIgnoreCase("XenApp7") && type.trim().equals("Citrix_XcXenApp_server")))
					default_vdi_type2 = type;
				else if((default_vdi_type2 == null || default_vdi_type2.trim().length() == 0) && (userType!=null  && 
					utc_list!=null && utc_list.contains(userType) && userType.equalsIgnoreCase("XenApp") && type.trim().equals("Citrix_server")))
					default_vdi_type2 = type;
				else if((default_vdi_type2 == null || default_vdi_type2.trim().length() == 0) && userType!=null && 
					utc_list!=null && utc_list.contains(userType))
					default_vdi_type2 = userType;

				if(default_vdi_type2!=null && default_vdi_type2.trim().length()>0 && type.equalsIgnoreCase(default_vdi_type2))
					selected = "true";

				String newUserType = userType;
				if(types!=null && uedMenuList!=null && uedMenuList.contains("XenApp") && uedMenuList.contains("XenApp7"))
				{
					if(userType!=null && userType.equalsIgnoreCase("XenApp"))
					{
						new_selection=mappingInfo.getComponentTypeDescription("Citrix_server");
						if(new_types!=null && new_types.contains(type))
						{
							newUserType="XenApp7";
						}
					}
					else if(userType!=null && userType.equalsIgnoreCase("XenApp7"))
					{
						new_selection=mappingInfo.getComponentTypeDescription("Citrix_XcXenApp_server");
						if(new_types!=null && new_types.contains(type))
						{
							newUserType="XenApp";
						}
					}
				}

				boolean isLocOverviewSupport=false;

				if(isUsersByLocation && isShowUsersByLocation)
				{
					String groupByStrtmp = in.getValue("LOC_USER_DESKTOP_METRICS","Header:"+type);

					if(type!=null && type.trim().equals("Citrix_XcXenApp_server"))
						groupByStrtmp = in.getValue("LOC_USER_DESKTOP_METRICS","Header:XenApp7");
					else if(type!=null && type.trim().equals("Citrix_server"))
						groupByStrtmp = in.getValue("LOC_USER_DESKTOP_METRICS","Header:XenApp");

					if(groupByStrtmp!=null && groupByStrtmp.trim().length()>0 && !groupByStrtmp.equalsIgnoreCase("null"))
					{
						isLocOverviewSupport=true;
					}
				}

%>
				vdiComboListJSON.push({
					name:'<%=mappingInfo.getComponentTypeDescription(type)%>',
					value:'<%=type%>',
					selected:'<%=selected%>',
					usertype:'<%=newUserType%>',
					isLocOverviewSupport:'<%=isLocOverviewSupport%>'
				});
<%
			}
%>
			var limtsComboJson = new Array();
<%
			if(Limits_to.indexOf(",")>-1){
				String[] limitsArray = Limits_to.split(",");
				for(int k=0;k<limitsArray.length;k++){
					String limit = limitsArray[k];
%>
					limtsComboJson.push({
						name:'<%=limit%>',
						value:'<%=limit%>'	
					});
<%				}
			}
%>			
			var iniName="<%=iniName%>";
			var user_name="<%=user_name%>";
			var isUserBased="<%=isUserBased%>";
			var dashboard_name="<%=dashboard_name%>";
			var view_name="<%=view_name%>";
			var filterName="<%=filterName%>";
			var filterViewName="<%=filterViewName%>";
			var countryCode="<%=countryCode%>";
			var time_line="<%=time_line%>";
			var geoInfo="<%=geoInfo%>";
			var regionName="<%=regionName%>";
			var usercountval="<%=usercountval%>";
			var dashboard_mapping="<%=dashboard_mapping%>";
			var fromServiceHomePage="<%=fromServiceHomePage%>";
			var fromZonePage="<%=fromZonePage%>";
			var selectedTest="<%=selectedTest%>";
			var selectedMeasure="<%=selectedMeasure%>";
			var searchString='<%=searchStringReq%>';
			var searchStringVCDS='<%=searchStringReqVCDS%>';
			var searchEmptyText = '<%=searchEmptyText%>';
			var adtnlSearchStr='<%=adtnlSearchStr%>';
			var adtnlSearchEmptyText = '<%=adtnlSearchEmptyText%>';
			var addtionalSearchFlag=<%=addtionalSearchFlag%>;
			var userExpDashTitle = '<%=userExpDashTitle%>';
			var endUserDashOverview = '<%=endUserDashOverview%>';
			var enableBackButton = '<%=enableBackButton%>';
			var overviewSearchStr = '<%=overviewSearchStr%>';
			var isFromUEDOverview = '<%=isFromUEDOverview%>';
			var endUserOverviewParams = '';
			var endUserOverviewFlag = <%=endUserOverviewFlag%>;
			var isfromuedsort = <%=isFromUEDSort%>;
			var pageNo='<%=pageNo%>';
			var userType='<%=userType%>';
			var isFromVCDS='<%=isFromVCDS%>';
			var refFreq = '<%=refFrequency%>';
			var refreshFreq = '<%=refreshFreq%>';
			var defaultLimit = '<%=s_default_limit%>';
			var defaultDispLimit = '<%=s_default_priority%>';
			var defaultVdiType = '<%=default_vdi_type%>';
			var defaultVdiType2 = '<%=default_vdi_type2%>'
			var showVdiHostCombo = <%=!showVdiHostCombo%>;
			var user = '<%=EgURLEncoder.encode(userName,"UTF-8")%>';
			var userName = '<%=EgURLEncoder.encode(desktopName,"UTF-8")%>';
			var desktopName = '<%=EgURLEncoder.encode(desktopName,"UTF-8")%>';
			var orderByColumn = "<%=currOrderByColumn%>";
			var orderBy = '<%=request.getParameter("orderBy")%>';
			var freqError = '<%= mappingInfo.getTextDescription("monitor.endUserDashboard.Refresh Frequency must be valid positive Integer and greater than 0")%>';
			var measureError = '<%= mappingInfo.getTextDescription("monitor.endUserDashboard.Please Select Measure")%>';
			var displayNameError = '<%= mappingInfo.getTextDescription("monitor.endUserDashboard.Please Enter Display Name")%>';
			var vdiComboLabel = '<%= mappingInfo.getTextDescription("monitor.endUserDashboard.Type")%>';

			var currOrderByColumn="<%=currOrderByColumn%>";
			var currOrderBy="<%=currOrderBy%>";
			var currColumnType="<%=currColType%>";
			var currColumndispName="<%=currColdispName%>";
			var tipSpe='<egui:intnl text="monitor.services.Special characters are not allowed"/>';
			var isFromMenu=<%=isFromMenu%>;
			var isFromGeo=<%=isFromGeo%>;
			var showKeyUser=<%=showKeyUser%>;
			var updateUserAssociateFlag=<%=updateUserAssociateFlag%>;
			var isDataAva = true;
			var noDataMsg = '<%= mappingInfo.getTextDescription("monitor.endUserDashboard.No Records Found")%>';
			var csrfToken = "<%=ctxCsrfToken%>";
			var requestParams=new Object();
			requestParams.isServiceBusiDash="<%=isServiceBusiDash%>";
			requestParams.treeFlag_SBD = "<%=treeFlag_SBD%>";
			requestParams.outsideService_SBD = "<%=outsideService_SBD%>";
			requestParams.titleText_SBD = "<%=titleText_SBD%>";
			requestParams.selectNode_SBD = "<%=selectNode_SBD%>";
			requestParams.isEmulTrans_SBD = "<%=isEmulTrans_SBD%>";
			requestParams.serviceState_SBD = "<%=serviceState_SBD%>";
			requestParams.serviceName = "<%=serviceName%>";
			requestParams.isServiceBusiViewMetrics = "<%=isServiceBusiViewMetrics%>";
			requestParams.selectedParam = "<%=selectedParam%>";
			requestParams.currentTab = "<%=currentTab%>";
			requestParams.selectNode = "<%=selectNode%>";
			requestParams.aggregateTab = "<%=aggregateTab%>";
			requestParams.fromPageView="<%=fromPageView%>";
			var isServiceBusiViewMetrics = "<%=isServiceBusiViewMetrics%>";
<%
			if(new_types!=null && new_types.size()>0)
			{
%>
			var vdiComboEmptyText = '<%=new_selection%>';
<%
			}
			else
			{
%>
			var vdiComboEmptyText = '<%= mappingInfo.getTextDescription("monitor.endUserDashboard.Select a Type")%>';
<%
			}
%>
			var searchLabel = '<%= mappingInfo.getTextDescription("monitor.endUserDashboard.Search")%>';
			var limitComboLabel = '<%= mappingInfo.getTextDescription("monitor.endUserDashboard.Limits")%>';
			var limitComboEmptyText = '<%= mappingInfo.getTextDescription("monitor.endUserDashboard.Select a Limit")%>';
			var defaultSettings = '<%= mappingInfo.getTextDescription("monitor.endUserDashboard.Default Settings")%>';
			var refFrequency = '<%= mappingInfo.getTextDescription("monitor.endUserDashboard.Refresh Frequency")%>';
			var addOrDelete = '<%= mappingInfo.getTextDescription("monitor.endUserDashboard.Add/Delete")%>';
			var addLabel = '<%= mappingInfo.getTextDescription("monitor.endUserDashboard.Add")%>';
			var deleteLabel = '<%= mappingInfo.getTextDescription("monitor.endUserDashboard.Delete")%>';
			var TestLabel = '<%= mappingInfo.getTextDescription("monitor.endUserDashboard.Test")%>';
			var MeasureLabel = '<%= mappingInfo.getTextDescription("monitor.endUserDashboard.Measure")%>';
			var DisplayLabel = '<%= mappingInfo.getTextDescription("monitor.endUserDashboard.Display Name")%>';
			var priority='<%= mappingInfo.getTextDescription("monitor.endUserDashboard.Priority")%>';
			var gateway='<%= mappingInfo.getTextDescription("monitor.endUserDashboard.Gateway")%>';
			var submit='<%= mappingInfo.getTextDescription("monitor.endUserDashboard.Submit")%>';
			var UpdateLabel = '<%= mappingInfo.getTextDescription("monitor.endUserDashboard.Update")%>';
			var UpdateError = '<%= mappingInfo.getTextDescription("monitor.endUserDashboard.Already Exists")%>';
			var optionsLabel = '<egui:intnl text="monitor.endUserDashboard.What would you like to do?"/>';
			var savePdfLabel = '<egui:intnl text="monitor.endUserDashboard.Save as PDF"/>';
			var saveExcelLabel = '<egui:intnl text="monitor.endUserDashboard.Save as Excel"/>';
			var dragDisabledMsg = '<egui:intnl text="monitor.endUserDashboard.Dragging not allowed for disabled measures"/>';
			var dragUnSelectedMsg = '<egui:intnl text="monitor.endUserDashboard.Dragging not allowed for unselected measures"/>';
			var resourceUsageBack = '<egui:intnl text="monitor.common.Back"/>';
			var filterLabel = (<%=isDetailsFromADOnly%> == true || <%=isDetailsFromADOnly%> == 'true')?'Filter BY':defaultFilter;
			var subFilLbl1 = '<%=subFilLbl1%>';
			var subFilLbl2 = '<%=subFilLbl2%>';
			var desktopNameHideFlag=false;
			if(userName!=null && userName!= undefined && userName!="")
			{
				desktopNameHideFlag=true;
			}
			var isMoreOptionsGrid = <%=isMoreOptionsGrid%>;
			var csv_pdf_hide = <%=is_csv_pdf_hide%>;
			if(fromctx!=null && fromctx!='null' && fromctx!='' && fromctx!='undefined')
				csv_pdf_hide = true;
			//var headerPadding ='0 0 0 10';
			//if(endUserOverviewFlag)
			var headerPadding = '10 0 0 0'; 
		</script>
<%
	if((access!=null && access.equalsIgnoreCase("allusers")) || (desktopName!=null && desktopName.trim().length()>0))
	{
%>
		<egui:loadApp baseDir="/final/monitor/eg_scripts" appName="endUserDashboard" appFile="app.js"/>
		<link rel="stylesheet" href="/final/resources/css/ext-eg.css" />
		<egui:skin ui="monitor"/>
		<script language = "JavaScript1.2" src = "/final/scripts/<%=script_src%>"></script>
		<!-- <script src="/final/jquery/jquery.js"></script> -->
		<script src="/final/jquery/highchart_export.js"></script>
		<script language = "JavaScript1.2" src = "/final/monitor/eg_scripts/dashboardutils.js"></script>
		<!--<link rel="stylesheet" href="/final/styles/ext-custom-com-uxdashboard.css" />-->
		<!-- Grid ster ----------->
		<link rel="stylesheet" type="text/css" href="/final/styles/gridster/css/jquery.gridster.css"><!-- Added -->
		<link rel="stylesheet" type="text/css" href="/final/styles/gridster/css/demo.css"><!-- Added -->
		<link rel="stylesheet" type="text/css" href="/final/styles/gridster/css/digitalfont/stylesheet.css"><!-- Added -->
		<script type="text/javascript" src="/final/jquery/jquery.scrollTo.js"></script> <!--Added -->
		<script type="text/javascript" src="/final/jquery/jquery.gridster.js"></script><!-- Added -->
		<script language="JavaScript1.2" src="/final/Highcharts/js/highstock.js"></script>
		<script src="/final/Highcharts/js/highcharts-more.js"></script>
		<script src="/final/Highcharts/js/solid-gauge.src.js"></script>
		<script src="../monitor/eg_scripts/EgHighChart.js"></script>
		<script language="javascript" type="text/javascript" src="/final/monitor/eg_scripts/egDashboardHighChart.js"></script>
		
		<script src="../monitor/eg_scripts/dashboards/GeneralMeasuresGrid.js"></script>
		<script src="../monitor/eg_scripts/dashboards/GeneralMeasuresGridPanel.js"></script>
		<style>
		span.decimal-align{float: left; text-align: right; width:50%;}
		span.decimal-align2{float: right; text-align: left; width:50%;}
		.uxTool .x-form-item-label
		{
			padding:3px 0px 0px 0px !important;
		}
	</style>
	<script>
		Ext.onReady(function()
		{
			Ext.Ajax.extraParams = {"com.eg.CSRF_NONCE" : csrfToken};
			Ext.data.Connection.prototype.extraParams = {"com.eg.CSRF_NONCE" : csrfToken};
			Ext.data.ScriptTagProxy.prototype.extraParams = {"com.eg.CSRF_NONCE" : csrfToken};
		});
	</script>
<%
		if(monitor_Skin!=null && monitor_Skin.equalsIgnoreCase("Dark"))
		{
%>
			<style>
				.multiselect .x-toolbar{
					border-color: #252525 !important;
					border-width: 1px 1px 0px 1px !important;
					border-style: solid !important;
					background: #444444 !important;
				}
			</style>
<%
		}
		else
		{
%>
				<style>
					.multiselect .x-toolbar{
						border-color:#abb2bd !important;
						border-width:1px 1px 0px 1px !important;
						border-style:solid !important;
					}
				</style>
<%
		}
%>
	</head>
<%
	if(isFromXenVdiFlag)
%>
		<body class="">
<%
	else
%>
		<body class="content-frame">
<%
	}else
	{
%>
		<link rel="stylesheet" href="/final/resources/css/ext-eg.css" />
		<egui:skin ui="monitor"/>

		<!--<link rel="stylesheet" type="text/css" href="/final/styles/eGDarkTheme.css" />
		<link rel="stylesheet" type="text/css" href="/final/styles/eGDarkThemeIcons.css" />
		<link rel="stylesheet" href="/final/styles/ext-custom-com-uxdashboard.css" />-->
		<script language = "JavaScript1.2" src = "/final/scripts/<%=script_src%>"></script>
		<!-- <script src="/final/jquery/jquery.js"></script> -->
		<script src="/final/jquery/highchart_export.js"></script>
		<script language = "JavaScript1.2" src = "/final/monitor/eg_scripts/dashboardutils.js"></script>
		<!-- Grid ster ----------->
		<link rel="stylesheet" type="text/css" href="/final/styles/gridster/css/jquery.gridster.css"><!-- Added -->
		<link rel="stylesheet" type="text/css" href="/final/styles/gridster/css/demo.css"><!-- Added -->
		<link rel="stylesheet" type="text/css" href="/final/styles/gridster/css/digitalfont/stylesheet.css"><!-- Added -->
		<script type="text/javascript" src="/final/jquery/jquery.scrollTo.js"></script> <!--Added -->
		<script type="text/javascript" src="/final/jquery/jquery.gridster.js"></script><!-- Added -->

		<script src="../monitor/eg_scripts/dashboards/GeneralMeasuresGrid.js"></script>
		<script src="../monitor/eg_scripts/dashboards/GeneralMeasuresGridPanel.js"></script>
		<style>
			span.decimal-align{float: left; text-align: right; width:50%;}
			span.decimal-align2{float: right; text-align: left; width:50%;}
		</style>
<%
		if(monitor_Skin!=null && monitor_Skin.equalsIgnoreCase("Dark"))
		{
%>
			<style>
				.multiselect .x-toolbar{
					border-color: #252525 !important;
					border-width: 1px 1px 0px 1px !important;
					border-style: solid !important;
					background: #444444 !important;
				}
			</style>
<%
		}
		else
		{
%>
				<style>
					.multiselect .x-toolbar{
						border-color:#abb2bd !important;
						border-width:1px 1px 0px 1px !important;
						border-style:solid !important;
					}
				</style>
<%
		}
%>
	</head>
	<body class="content-frame"><div class="content-frame" style="border:0px solid red;" id="endUserDashboardDiv">
		<table border="0" width="100%" height="100%" bordercolor="green">
			<tr>
				<td align="center" class="commonErrorMsgText" width="100%" height="100%">
					<img src = "/final/images/spacer.gif" class="iconInformation" align = "center" border = "0"  vspace = "10"/>
					<br><egui:intnl text='monitor.endUserDashboard.UnAuthorised Access'/>&nbsp;!
				</td>
			</tr>
		</table>
	</div>
<%
	}
%>
	
</body>
</html>