<%
/*
 *		Name			:	EgModifyParamsJson.jsp
 *		Purpose			:	To modify test parameters in IC
 */
%>
<%@ include file = "../../EgTrackerAJSON.jsp"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ page import = "net.sf.json.JSONObject"%>
<%@ page import= "egurkha.EgUIUtils"%>

<%
	response.setHeader("Cache-Control","no-store");
	response.setHeader("Pragma","no-cache");
	response.setDateHeader("Expires", -1);
	response.setContentType("application/json;charset=UTF-8");
%>

<%!
	Vector veckey=new Vector();
%>
<%
	JSONObject rootJSON = new JSONObject();
	JSONObject hiddens = new JSONObject();
	rootJSON.put("success","true");
	boolean isDouble=EgDbInfo.doubleByteEnabled;
	String test = request.getParameter("test");
	String org_test = request.getParameter("org_test");
	String testType = request.getParameter("testtype");
	String param_name = request.getParameter("param");
	veckey=(Vector)session.getAttribute("veckey");
	if(veckey==null)
	  veckey=new Vector();
	veckey.removeElement(param_name);
	
	String param_value = EgUIUtils.decodeSecurityChar(request.getParameter("value"));
	String org_param = param_name + ":" + param_value;
	
	if(testType != null && testType.equalsIgnoreCase("Snmp"))
	{
		rootJSON.put("isSnmpParam",true);
	}
	else if(testType != null && testType.equalsIgnoreCase("JMX"))
	{
		rootJSON.put("isJmxParam",true);
	}
	else
	{
		rootJSON.put("isSnmpParam",false);
	}
	rootJSON.put("paramName",param_name);
	rootJSON.put("paramValue",param_value);
	hiddens.put("mod","modify_params");
	hiddens.put("org_param",org_param);
	hiddens.put("org_test",org_test);
	hiddens.put("test",test);
	hiddens.put("testtype",testType);
	rootJSON.put("hiddens",hiddens);

	out.println(rootJSON);
%>




