Commit 1b656d29 authored by prahate's avatar prahate

Updated KPI Param class

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@217478 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 792162f4
package ibase.dashboard.common.bean;
import java.rmi.RemoteException;
import java.sql.Connection;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.utility.ITMException;
public class KPIParam extends ValidatorEJB
{
public String wfValData(String xmlString, String xmlString1,String xmlString2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException
{
String errString = null;
Document dom = null;
Document dom1 = null;
Document dom2 = null;
try
{
System.out.println("xmlString:-" + xmlString );
dom = parseString(xmlString);
dom1 = parseString(xmlString1);
if (xmlString2.trim().length() > 0 )
{
dom2 = parseString("<Root>" + xmlString2+ "</Root>");
}
System.out.println("objContext["+objContext+"]\nwfValData.xmlString1["+xmlString1+"]");
System.out.println("wfValData.xmlString2["+xmlString2+"]");
errString = wfValData(dom,dom1,dom2,objContext,editFlag,xtraParams);
System.out.println("errString[" + errString+"]" );
}
catch(Exception e)
{
throw new ITMException( e );
}
return (errString);
}
@Override
public String wfValData(Document dom, Document dom1,Document dom2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException
{
E12GenericUtility genericUtility = new E12GenericUtility();
NodeList parentNodeList = null;NodeList childNodeList = null;
Node parentNode = null;Node childNode = null;
String childNodeName = null;
Connection conn = null;
int currentFormNo=0,childNodeListLength ,ctr=0;
String errString = "",userId = "",modName = "", paramName = "", paramValue = "";
try
{
conn = getConnection();
userId = getValueFromXTRA_PARAMS(xtraParams,"loginCode");
System.out.println("userId:- " + userId);
if(objContext != null && objContext.trim().length()>0)
{
currentFormNo = Integer.parseInt(objContext);
}
switch(currentFormNo)
{
case 1:
parentNodeList = dom.getElementsByTagName("Detail1");
int parentNodeListLen = parentNodeList.getLength();
System.out.println("Number of node in parentNodeListLen : "+parentNodeListLen);
for ( int rowCnt=0; rowCnt < parentNodeListLen; rowCnt++ )
{
parentNode = parentNodeList.item(rowCnt);
childNodeList = parentNode.getChildNodes();
childNodeListLength = childNodeList.getLength();
for(ctr = 0; ctr < childNodeListLength; ctr++)
{
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
System.out.println("childNodeName SP : "+childNodeName);
if("mod_name".equalsIgnoreCase(childNodeName))
{
modName = E12GenericUtility.checkNull(genericUtility.getColumnValue("mod_name", dom));
if("".equalsIgnoreCase(modName) && modName.trim().length() == 0)
{
errString = genericUtility.getErrorString("mod_name", "VTBLNKMOD", userId);
break;
}
}
else if("param_name".equalsIgnoreCase(childNodeName))
{
paramName = E12GenericUtility.checkNull(genericUtility.getColumnValue("param_name", dom));
if("".equalsIgnoreCase(paramName) && paramName.trim().length() == 0)
{
errString = genericUtility.getErrorString("param_name", "VTBPARMNAM", userId);
break;
}
}
else if("param_value".equalsIgnoreCase(childNodeName))
{
paramValue = E12GenericUtility.checkNull(genericUtility.getColumnValue("param_value", dom));
if("".equalsIgnoreCase(paramValue) && paramValue.trim().length() == 0)
{
errString = genericUtility.getErrorString("param_value", "VTBPARMVAL", userId);
break;
}
}
}
}
break;
}
}
catch (Exception e) {
System.out.println("KPIParam.wfValData() : "+e);
}
finally {
try
{
if(conn != null)
{
conn.close();
conn = null;
}
}
catch (Exception e) {
}
}
System.out.println("Returning KPIParam.wfValData()"+errString);
return errString;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment