Commit 676dcac8 authored by pshinde's avatar pshinde

EJB for Generalized Validation


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@97091 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 40b65ee0
......@@ -5,6 +5,7 @@ import java.text.SimpleDateFormat;
import java.sql.*;
import java.io.*;
import org.w3c.dom.*;
import javax.xml.parsers.*;
import ibase.webitm.ejb.*;
import ibase.webitm.utility.GenericUtility;
......@@ -19,6 +20,7 @@ public class GenVal
CommonConstants commonConstants = new CommonConstants();
boolean flag =false;
boolean xFlag = true;
boolean isFromButton=false;
//changed by msalam on 26/09/07 start
//field added to store focused Row of the form
int formCtxFocusedRow = 0;
......@@ -29,23 +31,39 @@ public class GenVal
File logDir ;
String logDirName = "";
HashMap<String, String> errorMap=new HashMap<String, String>();
String formNo="";
int Ctr=0;
//end added by msalam on 22/11/07 for appending log in jboss log
//public String genVal(String modName ,String objContext,Document data ,Connection conn)
//public String genVal(String modName ,String objContext,Document data ) //comment added by sagar on 24/12/14
public HashMap genVal(String modName ,String objContext,Document data )
{
//System.out.println("Generalized Validation Is In Process.************************************.......");
System.out.println("Generalized Validation Is In Process.************************************.......");
Statement stmt = null;
ResultSet rs = null;
Connection conn = null;
String fldName ="",valType = "",fldMin = "",sqlInput = "",fldMax = "",errCD = "",blankOpt = "",fldData ="",fldType="";
String errCode ="";
//HashMap<String, String> errorMap=new HashMap<String, String>();
String sql = " SELECT FLD_NAME,VAL_TYPE,FLD_MIN,SQL_INPUT,FLD_MAX,ERROR_CD,BLANK_OPT ,FLD_TYPE FROM GENMST WHERE MOD_NAME= '"+modName.toUpperCase()+"'";
//System.out.println("SQL :: "+sql);
System.out.println(">>>>>>>>sql in genVal:"+sql);
String errMsg =" ";
NodeList dataList=null;
StringTokenizer st = null;
String colValue="";
String colName1="";
java.util.Vector sqlInputVec = new java.util.Vector();
//added by priyanka on 31/12/14
if( this.isFromButton)
{
sql = " SELECT FLD_NAME,VAL_TYPE,FLD_MIN,SQL_INPUT,FLD_MAX,ERROR_CD,BLANK_OPT ,FLD_TYPE,FORM_NO FROM GENMST WHERE MOD_NAME= '"+modName.toUpperCase()+"' and trim(FORM_NO) is not null ";
}
else
{
sql = " SELECT FLD_NAME,VAL_TYPE,FLD_MIN,SQL_INPUT,FLD_MAX,ERROR_CD,BLANK_OPT ,FLD_TYPE,FORM_NO FROM GENMST WHERE MOD_NAME= '"+modName.toUpperCase()+"' and trim(FORM_NO) is null ";
}
System.out.println("SQL :: "+sql);
//ended by added by priyanka
try
{
ConnDriver connDriver = new ConnDriver();
......@@ -65,15 +83,108 @@ public class GenVal
errCD = rs.getString(6);
blankOpt = rs.getString(7);
fldType = rs.getString(8);
fldData = getValueFromDom(data,fldName,objContext);
formNo=rs.getString(9);//added by priyanka
// added by priyanka on 31/12/14
if(isFromButton)
{
if(formNo!=null && formNo.trim().length()>0)
{
objContext=formNo;
}
}
System.out.println("Getting objcontext ==form_no>>>>>"+objContext);
System.out.println(">>>>>>>>>in while fldName:"+fldName);
System.out.println(">>>>>>>>>in while valType:"+valType);
System.out.println(">>>>>>>>>in while fldData:"+fldData);
System.out.println(">>>>>>>>>in while flag:"+flag);
//System.out.println("Fld Name :["+fldName+"] Value : "+fldData+"] Present["+flag+"]");
//System.out.println("validation Type********************["+valType+"]");
System.out.println("Getting sqlInput====="+sqlInput);
if( sqlInput != null )
{
System.out.println("SQL Input==not null");
st = new StringTokenizer( sqlInput, ":" );
sqlInputVec.clear();
while ( st.hasMoreTokens() )
{
sqlInputVec.add( st.nextToken() );
}
System.out.println("sqlInputVec============="+sqlInputVec);
}
if(isFromButton)
{
if( sqlInputVec.size() != 0 )
{
System.out.println("SQL Input=!=0========"+sqlInputVec.size());
for(int ctr=0; ctr < sqlInputVec.size(); ctr++)
{
System.out.println("For===========");
String colName = (String)sqlInputVec.get( ctr );
System.out.println("colName======"+colName);
//added on 310107
int objContextInt = Integer.parseInt( colName.substring( 0, colName.indexOf( "." ) ) );
objContextInt++;
String objContext1 = new Integer( objContextInt ).toString();
System.out.println("objContext1======"+objContext1);
colName1 = colName.substring( colName.indexOf( "." ) + 1 );
// 21-09-2007 manoharan
colName1 = colName1.replaceAll( ",", " " );
colName1 = colName1.trim();
System.out.println("get colName1======"+colName1);
}
}
dataList = data.getElementsByTagName("Detail"+formNo );
System.out.println("Getting dataList lenght===="+dataList.getLength());
//System.out.println("len===["+dataList.getLength()+"]=-=============fldName["+fldName+"]");
for (Ctr = 0; Ctr < dataList.getLength(); Ctr++)
{
System.out.println("*************1st for");
Node detailListNode = dataList.item(Ctr);
NodeList valueList= detailListNode.getChildNodes();
System.out.println("valueList.getLength()============="+valueList.getLength());
for (int cntr = 0; cntr < valueList.getLength(); cntr++)
{
System.out.println("Particular line==========="+Ctr);
Node valueNode = valueList.item(cntr);
System.out.println("colName1=check==========="+colName1);
System.out.println("valueNode.getNodeName()=check==========="+valueNode.getNodeName());
if(colName1.equalsIgnoreCase(valueNode.getNodeName()))
{
System.out.println("colName1.equalsIgnoreCase(fldName");
//fldData=genericUtility.getColumnValue("remarks", data);
fldData = getValueFromDom1(data,fldName,objContext,Ctr);
System.out.println("FLD-DATA Is ================"+fldData);
//flag=true;
}
}
/*if(errMsg!=null && errMsg.trim().length()>0)
{
System.out.println("Error Message*********");
break;
}*/
if(errMsg!=null && errMsg.trim().length()>0 && flag==true) //condition added by sagar on 25/12/14
{
System.out.println(">>>>>>>>>>>Error Caught");
System.out.println(">>>>>>>>Before Adding to errorMap >fldName:"+fldName);
System.out.println(">>>>>>>>Before Adding to errorMap >errMsg:"+errMsg);
//errorMap.put(fldName.trim(), errMsg.trim());
errorMap.put(errMsg.trim(), fldName.trim());
errMsg="";
}
//ended by priyanka
if( flag == true )
{
if ( checkBlank( fldName, fldData, blankOpt) && valType.trim().equalsIgnoreCase( "M" ) )
......@@ -95,7 +206,7 @@ public class GenVal
{
//***errMsg = genVal( fldName, modName, data, objContext, fldMin, sqlInput, fldMax, errCD, conn );
errMsg = genVal( fldName, modName, data, objContext, fldMin, sqlInput, fldMax, errCD );
System.out.println(">>>>>>>errMsg from Q valType:"+errMsg);
System.out.println("Return error mesg if Found======="+errMsg);
}
//slab validation
else if( valType.equalsIgnoreCase( "S" ) )
......@@ -166,17 +277,119 @@ public class GenVal
//end commented by msalam on 22/11/07 as validation is required on fldData blank also
}
}
/*if(errMsg.trim().length()>0) //comment added by sagar on 24/12/14
}
}
else
{
break;
}*/
System.out.println("Not from Button");
fldData = getValueFromDom(data,fldName,objContext);
System.out.println("objContext********************["+objContext+"]");
//if( flag == true )
System.out.println("Fld Name :["+fldName+"] Value : "+fldData+"] Present["+flag+"]");
//System.out.println("validation Type********************["+valType+"]");
if( flag == true )
{
if ( checkBlank( fldName, fldData, blankOpt) && valType.trim().equalsIgnoreCase( "M" ) )
{
errMsg = errCD;//user enter blank but blank option is Y
}
else
{
System.out.println("NOt from button");
//next 2 line commented by msalam on 22/11/07 as validation is required on fldData blank also
// 06/10/08 manoharan uncommented and added condition that valtype "M"
//System.out.println("fldData********************["+fldData+"]");
if ( ( fldData != null && fldData.trim().length() > 0 && "M".equalsIgnoreCase(valType.trim())) || !"M".equalsIgnoreCase(valType.trim()) )
{
//end commented by msalam on 22/11/07 as validation is required on fldData blank also
if( valType == null ) valType= " ";
//cross query validation
if (valType.equalsIgnoreCase("Q"))
{
System.out.println("Not from isFromButton====================");
errMsg = genVal( fldName, modName, data, objContext, fldMin, sqlInput, fldMax, errCD );
}
//slab validation
else if( valType.equalsIgnoreCase( "S" ) )
{
//if field type is N
try
{
double fldValue = 0,fldMinValue = 0,fldMaxValue = 0;
fldValue = Double.parseDouble(fldData);
fldMinValue = Double.parseDouble(fldMin);
fldMaxValue = Double.parseDouble(fldMax);
if (fldValue < fldMinValue || fldValue > fldMaxValue)
{
errMsg = errCD;
}
}
catch(NumberFormatException noFormat)
{
errMsg = errCD;
}
}
//cruss slab validation
else if(valType.equalsIgnoreCase("X"))
{
double fldValue = 0,fldMinValue = 0,fldMaxValue = 0;
try
{
fldMinValue = Double.parseDouble(fldMin);
}
catch(NumberFormatException noFormat)
{
String fldMinValueStr= getValueFromDom(data,fldMin,objContext);
if(fldMinValueStr!=null || fldMinValueStr.trim().length()!=0)
fldMinValue = Double.parseDouble(fldMinValueStr);
}
try
{
fldMaxValue = Double.parseDouble(fldMax);
}
catch(NumberFormatException noFormat)
{
String fldMaxValueStr = getValueFromDom(data,fldMax,objContext);
if(fldMaxValueStr!=null || fldMaxValueStr.trim().length()!=0)
fldMaxValue = Double.parseDouble(fldMaxValueStr);
}
double dfldData = 0;
if(fldData!=null | fldData.trim().length()!=0)
{
dfldData = Double.parseDouble(fldData);
}
if (dfldData < fldMinValue || dfldData > fldMaxValue)
{
errMsg = errCD;
}
}
//master Validation
else if( valType.trim().equalsIgnoreCase("M") )
{
//System.out.println("Calling masterVal for module * * * * * [" + modName.trim() + "]");
//***errMsg = masterVal( fldName, modName, fldData, errCD, conn );
errMsg = masterVal( fldName, modName, fldData, errCD );
}
//next line commented by msalam on 22/11/07 as validation is required on fldData blank also
}//end of blank opt N
//end commented by msalam on 22/11/07 as validation is required on fldData blank also
}
}
}
System.out.println(">>>>>>>>>Get fldName:"+fldName);
System.out.println(">>>>>>>>>Get errMsg:"+errMsg);
if(errMsg.trim().length()>0 && flag==true) //condition added by sagar on 25/12/14
if(errMsg!=null && errMsg.trim().length()>0 && flag==true) //condition added by sagar on 25/12/14
{
System.out.println(">>>>>>>>Before Adding to errorMap >fldName:"+fldName);
System.out.println(">>>>>>>>Before Adding to errorMap >errMsg:"+errMsg);
errorMap.put(fldName.trim(), errMsg.trim());
//errorMap.put(fldName.trim(), errMsg.trim());
errorMap.put(errMsg.trim(), fldName.trim());
errMsg="";
}
}
......@@ -189,19 +402,18 @@ public class GenVal
conn.close();
conn = null;
}
if(errMsg.trim().length()==0 && xFlag == true)
{
System.out.println(">>>>>>>>>>>>>Check for ModeName:X");
xFlag = false;
//System.out.println("Calling genVal for module * * * * * [X]");
//***errMsg = genVal("X",objContext,data ,conn);
//errMsg = genVal("X",objContext,data );//comment added by sagar on 25/12/14
errorMap = genVal("X",objContext,data );//code added by sagar on 25/12/14
System.out.println(">>>>>>>>>>>>>errorMap from Mod Name=X :"+errorMap);
xFlag = true;
}
System.out.println(">>>>>>>>Final Return errorMap:"+errorMap);
} // end of try
catch (SQLException sx)
{
......@@ -243,14 +455,25 @@ public class GenVal
//return stkOpt;
}
//return errMsg;
return errorMap;//return type changed by sagar on 25/12/14
}
//changed by msalam on 26/09/07 start
//to overload the function
//public String genVal(String modName ,String objContext,Document data ,Connection conn)
//public String genVal(String modName ,String objContext,Document data, String focusedRow, Connection conn)
//added by priyanka 4
public HashMap genVal(String modName ,String objContext,Document data, String focusedRow,boolean isFromButton)
{
System.out.println("focusedRow==========="+focusedRow);
this.isFromButton=isFromButton;
return genVal(modName,objContext,data,focusedRow);
}
//public String genVal(String modName ,String objContext,Document data, String focusedRow)//comment added by sagar on 25/12/14
public HashMap genVal(String modName ,String objContext,Document data, String focusedRow)
{
......@@ -399,6 +622,7 @@ public class GenVal
String errCode =" ";
Connection conn = null;
String colType ="";
String colValue="";
try
{
writeLog( filePtr, "Mod Name :::" + modName, true );
......@@ -460,7 +684,16 @@ public class GenVal
//changed by msalam on 24/09/07
//for getting value of last row
String colValue = getValueFromDom( dom, colName1, objContext1 );
System.out.println("Ctr==========="+Ctr);
//added by priyanka
if(isFromButton)
{
colValue = getValueFromDom1( dom, colName1, objContext1,Ctr);
}
else
{
colValue = getValueFromDom( dom, colName1, objContext1);
}
writeLog( filePtr, "colValue form dom===[" + colValue + "]" + " Col Type [" + colType + "]", true );
......@@ -622,6 +855,7 @@ public class GenVal
break;
}
}
}
catch (SQLException sx)
{
......@@ -714,12 +948,15 @@ public class GenVal
String childNodeName ="";
try
{
System.out.println("Enter in getValueFromDom>>>>>>>>>>>>");
if(objContext != null && objContext.trim().length()>0)
{
currentFormNo = Integer.parseInt(objContext);
}
String tag = "Detail"+currentFormNo;
System.out.println("tag==========="+tag);
parentNodeList = dom.getElementsByTagName(tag);
System.out.println("parentNodeList==========="+parentNodeList);
//Changed By Pragyan 14-JUL-14 To support genvalidation for both MOBILEE12 and RCP.start
//changed by msalam on 26/09/07 start
//for getting value of focused Row rather than first row only
......@@ -731,6 +968,7 @@ public class GenVal
{
parentNode = parentNodeList.item( currentFormNo == 1 ? 0 : (parentNodeList.getLength() - 1) );
}
else
{
......@@ -739,11 +977,97 @@ public class GenVal
//Changed By Pragyan 14-JUL-14 support genvalidation for both MOBILEE12 and RCP.end
//changed by msalam on 26/09/07 end
System.out.println("parentNode========="+parentNode);
childNodeList = parentNode.getChildNodes();
System.out.println("childNodeList========="+childNodeList);
childNodeListLength = childNodeList.getLength();
System.out.println("childNodeListLength========="+childNodeListLength);
// 21-09-2007 manoharan
fldName = fldName.replaceAll(","," ");
fldName = fldName.trim();
System.out.println("fldName========="+fldName);
// end 21-09-2007 manoharan
for(int ctr = 1; ctr < childNodeListLength; ctr++)
{
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
if (childNodeName.equalsIgnoreCase(fldName))
{
flag = true;
if (childNode.getFirstChild() != null)
{
value = childNode.getFirstChild().getNodeValue();
break;
}
}
}
}//end try
catch(Exception e)
{
e.printStackTrace();
}
return value;
}
//added by priyanka
private String getValueFromDom1(Document dom, String fldName, String objContext,int cnt)
{
String value = "";
int currentFormNo= 0;
NodeList parentNodeList = null;
Node parentNode = null;
NodeList childNodeList = null;
int childNodeListLength = 0;
Node childNode = null;
String childNodeName ="";
try
{
System.out.println("Enter in getValueFromDom>>>>>>>>>>>>");
if(objContext != null && objContext.trim().length()>0)
{
currentFormNo = Integer.parseInt(objContext);
}
String tag = "Detail"+currentFormNo;
System.out.println("tag==========="+tag);
parentNodeList = dom.getElementsByTagName(tag);
System.out.println("parentNodeList==========="+parentNodeList);
//Changed By Pragyan 14-JUL-14 To support genvalidation for both MOBILEE12 and RCP.start
//changed by msalam on 26/09/07 start
//for getting value of focused Row rather than first row only
//commented next line and added lines
//parentNode = parentNodeList.item(0);
//added lines in place of previous line
//parentNode = parentNodeList.item( currentFormNo == 1 ? 0 : (this.formCtxFocusedRow - 1) );
/*if(parentNodeList != null && parentNodeList.getLength() < this.formCtxFocusedRow )
{
parentNode = parentNodeList.item( currentFormNo == 1 ? 0 : (parentNodeList.getLength() - 1) );
}
else
{
parentNode = parentNodeList.item( currentFormNo == 1 ? 0 : (this.formCtxFocusedRow - 1) );
}*/
//Changed By Pragyan 14-JUL-14 support genvalidation for both MOBILEE12 and RCP.end
//changed by msalam on 26/09/07 end
// System.out.println("parentNode========="+parentNode);
//childNodeList = parentNode.getChildNodes();
//System.out.println("childNodeList========="+childNodeList);
//childNodeListLength = childNodeList.getLength();
//System.out.println("childNodeListLength========="+childNodeListLength);
// 21-09-2007 manoharan
fldName = fldName.replaceAll(","," ");
fldName = fldName.trim();
System.out.println("fldName========="+fldName);
System.out.println("Count====="+cnt);
parentNode = parentNodeList.item(cnt);
childNodeList = parentNode.getChildNodes();
childNodeListLength = childNodeList.getLength();
// end 21-09-2007 manoharan
for(int ctr = 0; ctr < childNodeListLength; ctr++)
{
......@@ -765,7 +1089,44 @@ public class GenVal
{
e.printStackTrace();
}
System.out.println("Printing Dom======="+dom.toString());
return value;
}
private String getFormValue(Document dom, String fldName, String objContext,String formNo)
{
String value = "";
int currentFormNo= 0;
NodeList parentNodeList = null;
Node parentNode = null;
NodeList childNodeList = null;
int childNodeListLength = 0;
Node childNode = null;
String childNodeName ="";
try
{
if(objContext != null && objContext.trim().length()>0)
{
currentFormNo = Integer.parseInt(objContext);
}
String tag = "Detail"+currentFormNo;
parentNodeList = dom.getElementsByTagName(tag);
System.out.println("parentNodeList============="+parentNodeList);
}//end try
catch(Exception e)
{
e.printStackTrace();
}
return value;
}
//added by msalam on 22-10-2007 to get date in application format
private String getDateInAppFormat( String dateColValue )
......
......@@ -18,7 +18,6 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import javax.ejb.CreateException;
import javax.ejb.SessionBean;
import javax.ejb.SessionContext;
......@@ -32,7 +31,7 @@ import org.w3c.dom.Document;
* Window - Preferences - Java - Code Style - Code Templates
*/
import javax.ejb.Stateless; // added for ejb3
import javax.ejb.Stateless; // added for ejb3
@Stateless // added for ejb3
public class GenValidate extends ValidatorEJB implements GenValidateLocal , GenValidateRemote // SessionBean{
......@@ -81,7 +80,8 @@ public class GenValidate extends ValidatorEJB implements GenValidateLocal , Gen
//***ConnDriver connDriver = new ConnDriver();
//***conn = connDriver.getConnectDB("DriverITM");
//**connDriver = null;
//System.out.println("xmlString2 : " + xmlString2);
System.out.println("Calling wfValData**********************************");
System.out.println("xmlString2 : " + xmlString2);
dom = parseString(xmlString2);
userId = getValueFromXTRA_PARAMS(xtraParams, "loginCode");
//changed by msalam on 27/09/07 start
......@@ -99,7 +99,7 @@ public class GenValidate extends ValidatorEJB implements GenValidateLocal , Gen
errorMap = genVal.genVal(winName,objContext,dom, focusedRow);//code added by sagar on 25/12/14
genVal = null;
//changed by msalam on 27/09/07 end
/*if (errCode != null && errCode.trim().length() > 0) //comment added by sagar on 25/12/14
/*if (errCode != null && errCode.trim().length() > 0)
{
resultString = getErrorString("", errCode, userId);
}*/
......@@ -112,8 +112,10 @@ public class GenValidate extends ValidatorEJB implements GenValidateLocal , Gen
while (iterator.hasNext())
{
Map.Entry mapEntry = (Map.Entry) iterator.next();
errFldName= (String) mapEntry.getKey();
errCode= (String) mapEntry.getValue();
//errFldName= (String) mapEntry.getKey();
//errCode= (String) mapEntry.getValue();
errCode= (String) mapEntry.getKey();
errFldName= (String) mapEntry.getValue();
System.out.println(">>>>>>>>errFldName:"+errFldName);
System.out.println(">>>>>>>>errCode:"+errCode);
errString = getErrorString(errFldName, errCode, userId);
......@@ -133,7 +135,7 @@ public class GenValidate extends ValidatorEJB implements GenValidateLocal , Gen
errStringXml = new StringBuffer("");
}
//code added by sagar on 25/12/14 end.
}//end try
}
catch (RemoteException e1) {
e1.printStackTrace();
}
......@@ -162,6 +164,111 @@ public class GenValidate extends ValidatorEJB implements GenValidateLocal , Gen
errString = errStringXml.toString(); //code added by sagar on 25/12/14
return errString;
}
//added by priyanka on 31/12/14 to execute genValidation based o form no on accept button
public String wfValData1(String xmlString, String xmlString1, String xmlString2, String objContext, String winName, String xtraParams) throws RemoteException
{
String finalStr = "";
String errFldName="";
Document dom = null;
String userId="", errCode = "",resultString = "";
String errString = "",errorType="";
HashMap<String , String > errorMap= new HashMap<String, String>();
StringBuffer errStringXml = new StringBuffer("<?xml version = \"1.0\"?> \r\n <Root> <Errors>");
// finalStr = mergeXml(xmlString, xmlString1, xmlString2);
try
{
//***ConnDriver connDriver = new ConnDriver();
//***conn = connDriver.getConnectDB("DriverITM");
//**connDriver = null;
System.out.println("Calling wfValData**********************************");
System.out.println("xmlString2 : " + xmlString2);
dom = parseString(xmlString2);
userId = getValueFromXTRA_PARAMS(xtraParams, "loginCode");
//changed by msalam on 27/09/07 start
//for passing current focused Row from xtraParams
String focusedRow = null;
//focusedRow = getValueFromXTRA_PARAMS(xtraParams, "focusRow");
focusedRow=objContext;//added by priyanka
System.out.println( "winName :: " + winName );
System.out.println( "objContext :: " + objContext );
System.out.println( "focusedRow :: " + focusedRow );
//System.out.println( "xmlString2 :: " + xmlString2 ); comment by kunal on 17/07/13 ,for remove Out Of Memory Error
//errCode = genVal.genVal(winName,objContext,dom,conn);
//****errCode = genVal.genVal(winName,objContext,dom, focusedRow, conn);
GenVal genVal = new GenVal();
//errCode = genVal.genVal(winName,objContext,dom, focusedRow);//comment added by sagar on 25/12/14
errorMap = genVal.genVal(winName,objContext,dom, focusedRow,true);//code added by sagar on 25/12/14
genVal = null;
//changed by msalam on 27/09/07 end
/*if (errCode != null && errCode.trim().length() > 0)
{
resultString = getErrorString("", errCode, userId);
}*/
//code added by sagar on 25/12/14 Start....
System.out.println(">>>>>>>>Return errorMap in GenValidate:"+errorMap);
if(!errorMap.isEmpty())
{
System.out.println(">>>>>>>>Return Non empty errorMap in GenValidate:"+errorMap.size());
Iterator iterator = errorMap.entrySet().iterator();
while (iterator.hasNext())
{
Map.Entry mapEntry = (Map.Entry) iterator.next();
//errFldName= (String) mapEntry.getKey();
//errCode= (String) mapEntry.getValue();
errCode= (String) mapEntry.getKey();
errFldName= (String) mapEntry.getValue();
System.out.println(">>>>>>>>errFldName:"+errFldName);
System.out.println(">>>>>>>>errCode:"+errCode);
errString = getErrorString(errFldName, errCode, userId);
//errorType = errorType(conn, errCode);
if (errString.length() > 0)
{
String bifurErrString = errString.substring(errString.indexOf("<Errors>") + 8, errString.indexOf("<trace>"));
bifurErrString = bifurErrString + errString.substring(errString.indexOf("</trace>") + 8, errString.indexOf("</Errors>"));
errStringXml.append(bifurErrString);
errString = "";
}
}
errStringXml.append("</Errors> </Root> \r\n");
}
else
{
errStringXml = new StringBuffer("");
}
//code added by sagar on 25/12/14 end.
}
catch (RemoteException e1) {
e1.printStackTrace();
}
catch (ITMException e1) {
e1.printStackTrace();
}
catch(Exception e)
{
e.printStackTrace();
}
/*finally
{
try
{
if (conn != null)
{ conn.close();
conn = null;
}
}
catch(Exception ex)
{ex.printStackTrace();}
}*/
//return resultString;//comment added by sagar on 25/12/14
errString = errStringXml.toString(); //code added by sagar on 25/12/14
return errString;
}
private String mergeXml(String xmlString, String xmlString1, String xmlString2)
{
StringBuffer data = new StringBuffer();
......
......@@ -25,4 +25,7 @@ public interface GenValidateLocal extends ValidatorLocal //extends EJBObject
{
public String wfValData(String xmlString, String xmlString1, String xmlString2, String objContext, String winName, String xtraParams) throws RemoteException;
public String wfValData1(String xmlString, String xmlString1, String xmlString2, String objContext, String winName, String xtraParams) throws RemoteException;
}
......@@ -26,4 +26,7 @@ public interface GenValidateRemote extends ValidatorRemote //extends EJBObject {
{
public String wfValData(String xmlString, String xmlString1, String xmlString2, String objContext, String winName, String xtraParams) throws RemoteException;
public String wfValData1(String xmlString, String xmlString1, String xmlString2, String objContext, String winName, String xtraParams) throws RemoteException;
}
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