Commit 4f34ddb7 authored by arawankar's avatar arawankar

Master component of appraisal specification and appraisal specification tbl

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@172070 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 86513108
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>webitm-appraisal</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8
/**
*
*/
package ibase.webitm.bean.appraisal;
import java.util.ArrayList;
import java.util.Properties;
import javax.naming.InitialContext;
import org.w3c.dom.Document;
import ibase.system.config.AppConnectParm;
import ibase.utility.E12GenericUtility;
import ibase.utility.UserInfoBean;
import ibase.webitm.ejb.PopUpDataAccessLocal;
import ibase.webitm.utility.PopUpProperties;
/**
* @author base
*
*/
public class AppraisalSpecBean
{
private String apprSpec, apprSpecDetails, apprSpecDescr, autoCalc, calcMethod, methodType, methodInput, sql, sqlInput,
formula, calcPattern, specCategory, specType, denominator, valueType, apprSpecParent, ratingType, ratingValues, trackingType, detailXml;
private UserInfoBean userInfoBean;
private E12GenericUtility genericUtility = new E12GenericUtility();
/**
*
*/
public AppraisalSpecBean()
{
}
/**
* @return the apprSpec
*/
public String getApprSpec() {
return apprSpec;
}
/**
* @param apprSpec the apprSpec to set
*/
public void setApprSpec(String apprSpec) {
this.apprSpec = apprSpec;
}
/**
* @return the apprSpecDetails
*/
public String getApprSpecDetails() {
return apprSpecDetails;
}
/**
* @param apprSpecDetails the apprSpecDetails to set
*/
public void setApprSpecDetails(String apprSpecDetails) {
this.apprSpecDetails = apprSpecDetails;
}
/**
* @return the apprSpecDescr
*/
public String getApprSpecDescr() {
return apprSpecDescr;
}
/**
* @param apprSpecDescr the apprSpecDescr to set
*/
public void setApprSpecDescr(String apprSpecDescr) {
this.apprSpecDescr = apprSpecDescr;
}
/**
* @return the autoCalc
*/
public String getAutoCalc() {
return autoCalc;
}
/**
* @param autoCalc the autoCalc to set
*/
public void setAutoCalc(String autoCalc) {
this.autoCalc = autoCalc;
}
/**
* @return the calcMethod
*/
public String getCalcMethod() {
return calcMethod;
}
/**
* @param calcMethod the calcMethod to set
*/
public void setCalcMethod(String calcMethod) {
this.calcMethod = calcMethod;
}
/**
* @return the methodType
*/
public String getMethodType() {
return methodType;
}
/**
* @param methodType the methodType to set
*/
public void setMethodType(String methodType) {
this.methodType = methodType;
}
/**
* @return the methodInput
*/
public String getMethodInput() {
return methodInput;
}
/**
* @param methodInput the methodInput to set
*/
public void setMethodInput(String methodInput) {
this.methodInput = methodInput;
}
/**
* @return the sql
*/
public String getSql() {
return sql;
}
/**
* @param sql the sql to set
*/
public void setSql(String sql) {
this.sql = sql;
}
/**
* @return the sqlInput
*/
public String getSqlInput() {
return sqlInput;
}
/**
* @param sqlInput the sqlInput to set
*/
public void setSqlInput(String sqlInput) {
this.sqlInput = sqlInput;
}
/**
* @return the formula
*/
public String getFormula() {
return formula;
}
/**
* @param formula the formula to set
*/
public void setFormula(String formula) {
this.formula = formula;
}
/**
* @return the calcPattern
*/
public String getCalcPattern() {
return calcPattern;
}
/**
* @param calcPattern the calcPattern to set
*/
public void setCalcPattern(String calcPattern) {
this.calcPattern = calcPattern;
}
/**
* @return the specCategory
*/
public String getSpecCategory() {
return specCategory;
}
/**
* @param specCategory the specCategory to set
*/
public void setSpecCategory(String specCategory) {
this.specCategory = specCategory;
}
/**
* @return the specType
*/
public String getSpecType() {
return specType;
}
/**
* @param specType the specType to set
*/
public void setSpecType(String specType) {
this.specType = specType;
}
/**
* @return the denominator
*/
public String getDenominator() {
return denominator;
}
/**
* @param denominator the denominator to set
*/
public void setDenominator(String denominator) {
this.denominator = denominator;
}
/**
* @return the valueType
*/
public String getValueType() {
return valueType;
}
/**
* @param valueType the valueType to set
*/
public void setValueType(String valueType) {
this.valueType = valueType;
}
/**
* @return the apprSpecParent
*/
public String getApprSpecParent() {
return apprSpecParent;
}
/**
* @param apprSpecParent the apprSpecParent to set
*/
public void setApprSpecParent(String apprSpecParent) {
this.apprSpecParent = apprSpecParent;
}
/**
* @return the ratingType
*/
public String getRatingType() {
return ratingType;
}
/**
* @param ratingType the ratingType to set
*/
public void setRatingType(String ratingType) {
this.ratingType = ratingType;
}
/**
* @return the ratingValues
*/
public String getRatingValues() {
return ratingValues;
}
/**
* @param ratingValues the ratingValues to set
*/
public void setRatingValues(String ratingValues) {
this.ratingValues = ratingValues;
}
/**
* @return the trackingType
*/
public String getTrackingType() {
return trackingType;
}
/**
* @param trackingType the trackingType to set
*/
public void setTrackingType(String trackingType) {
this.trackingType = trackingType;
}
/**
* @return the detailXml
*/
public String getDetailXml() {
return detailXml;
}
/**
* @param detailXml the detailXml to set
*/
public void setDetailXml(String detailXml) {
this.detailXml = detailXml;
}
/**
* @return the userInfoBean
*/
public UserInfoBean getUserInfoBean() {
return userInfoBean;
}
/**
* @param userInfoBean the userInfoBean to set
*/
public void setUserInfoBean(UserInfoBean userInfoBean) {
this.userInfoBean = userInfoBean;
}
public String toString()
{
String result = "";
if ( getSql().length() > 0 && getMethodType().equals("S"))
{
System.out.println("Inside ( getSql().length() > 0 && getMethodType().equals(S))");
result = getSQLData();
}
return result;
}
private String getSQLData()
{
String[] parameters = null;
String pophelpData = "";
try
{
PopUpProperties popUpProperties = new PopUpProperties();
String userinfoStr = getUserInfoBean().toString();
ArrayList<String> inputList = genericUtility.getTokenList( sqlInput, "," );
Document detailDom = null;
detailXml = genericUtility.checkNull( detailXml );
if ( detailXml.length() > 0 )
{
System.out.println( "detailXml - ["+ detailXml +"]" );
detailDom = genericUtility.parseString( detailXml );
}
int paramSize = inputList.size();
parameters = new String[ paramSize ];
for ( int i = 0; i < inputList.size(); i++ )
{
System.out.println( "inputList.get("+ i +") - ["+ inputList.get( i ) +"]" );
String inputName = inputList.get( i );
String objContext = "0";
if ( inputName.indexOf( "." ) != -1 )
{
objContext = genericUtility.checkNull( inputName.substring( inputName.indexOf(":") + 1, inputName.indexOf(".") ) );
}
if( objContext.equals("0") )
{
objContext = "1";
}
System.out.println("objContext - ["+objContext+"]");
inputName = ( inputName.indexOf( "." ) != -1 ) ? inputName.substring( inputName.indexOf( "." ) + 1 ) : inputName;
inputName = ( inputName.indexOf( ":" ) != -1 ) ? inputName.substring( inputName.indexOf( ":" ) + 1 ) : inputName;
System.out.println("inputName ["+inputName+"]");
String inputValue = genericUtility.getColumnValue( inputName, detailDom, objContext, "" );
inputValue = genericUtility.checkNull( inputValue );
System.out.println( "inputName - ["+ inputName +"], inputValue - ["+ inputValue +"]" );
if ( inputName.indexOf( "date" ) != -1 )
{
try
{
inputValue = genericUtility.getValidDateTimeString( inputValue, genericUtility.getApplDateFormat(), genericUtility.getDBDateTimeFormat() );
}
catch( Exception e )
{
inputValue = inputValue;
}
System.out.println( "For Date - inputName - ["+ inputName +"], inputValue - ["+ inputValue +"]" );
}
parameters[ i ] = inputValue;
}
AppConnectParm appConnect = new AppConnectParm();
Properties props = appConnect.getProperty();
InitialContext ctx = new InitialContext(props);
PopUpDataAccessLocal popUpDataAccess = (PopUpDataAccessLocal)ctx.lookup("ibase/PopUpDataAccessEJB/local");
popUpProperties.setDEFAULT_COL("1");
popUpProperties.setTHUMB_ALT_COL("");
popUpProperties.setTHUMB_IMAGE_COL("");
popUpProperties.setTHUMB_OBJ("");
pophelpData = popUpDataAccess.getPopUpData( sql, parameters, popUpProperties, userinfoStr );
pophelpData = genericUtility.checkNull( pophelpData );
System.out.println( "executeSQL :==>" + pophelpData +"]" );
}
catch(Exception e)
{
e.printStackTrace();
System.out.println( "Exception in getPophelpData()"+ e.getMessage() );
pophelpData = null;
}
return pophelpData;
}
}
\ No newline at end of file
package ibase.webitm.ejb.appraisal;
import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
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;
@javax.ejb.Stateless
public class ApprSpecTbl extends ValidatorEJB implements ApprSpecTblRemote,ApprSpecTblLocal
{
public String wfValData(String xmlString, String xmlString1, String xmlString2, String objContext, String editFlag, String xtraParams) throws RemoteException, ITMException
{
Document dom = null;
Document dom1 = null;
Document dom2 = null;
String errString = null;
E12GenericUtility genericUtility = new E12GenericUtility();
try
{
if(xmlString != null && xmlString.trim().length()!=0)
{
dom = genericUtility.parseString(xmlString);
}
if(xmlString1 != null && xmlString1.trim().length()!=0)
{
dom1 = genericUtility.parseString(xmlString1);
}
if(xmlString2 != null && xmlString2.trim().length()!=0)
{
dom2 = genericUtility.parseString(xmlString2);
}
errString = wfValData( dom, dom1, dom2, objContext, editFlag, xtraParams );
System.out.println("[WsfaEffCovgEJB][wfValData][ErrString:] " + errString);
}
catch(Exception e)
{
System.out.println("Exception: WsfaEffCovgEJB: wfValData(String xmlString): " + e.getMessage() + ":");
errString = genericUtility.createErrorString(e);
e.printStackTrace();
}
System.out.println("Returning from WsfaEffCovgEJB wfValData");
return errString;
}
public String wfValData(Document dom, Document dom1,Document dom2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException
{
NodeList parentNodeList = null;
NodeList childNodeList = null;
Node parentNode = null;
Node childNode = null;
int ctr = 0, currentFormNo = 0, childNodeListLength = 0, cnt = 0;
String loginSite = "", userId = "";
String childNodeName = null, childNodeValue = null;
String errString = "";
String errCode = "";
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
String sql = "";
try
{
conn = getConnection();
userId = getValueFromXTRA_PARAMS( xtraParams, "loginCode" );
loginSite = getValueFromXTRA_PARAMS(xtraParams, "loginSiteCode");
E12GenericUtility genericUtility = new E12GenericUtility();
if(objContext != null && objContext.trim().length()>0)
{
currentFormNo = Integer.parseInt(objContext);
}
switch(currentFormNo)
{
case 1 :
parentNodeList = dom.getElementsByTagName("Detail1");
parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes();
childNodeListLength = childNodeList.getLength();
for(ctr = 0; ctr < childNodeListLength; ctr++)
{
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
if(childNode.getFirstChild() != null)
{
childNodeValue = childNode.getFirstChild().getNodeValue();
}
if( "appr_tblno".equalsIgnoreCase( childNodeName ) )
{
if( childNode.getFirstChild() == null )
{
errString = getErrorString( "appr_tblno", "NLAPRTBLNO", userId );
break ;
}
}
else if( "appr_spec".equalsIgnoreCase( childNodeName ) )
{
if( childNode.getFirstChild() == null )
{
errString = getErrorString( "appr_spec", "NULAPPRSPC", userId );
break ;
}
else
{
String apprSpec = checkNull(genericUtility.getColumnValue("appr_spec", dom));
sql = " SELECT APPR_SPEC FROM APPRAISAL_SPEC WHERE APPR_SPEC = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, apprSpec);
rs = pstmt.executeQuery();
if( ! rs.next() )
{
errString = getErrorString("appr_spec","NTFMLSTAPS",userId);
break ;
}
if(editFlag != null && editFlag.equalsIgnoreCase("A"))
{
String apprTblNo = checkNull(genericUtility.getColumnValue("appr_tblno", dom));
sql = " SELECT APPR_SPEC FROM APPRAISAL_SPEC_TABLE WHERE APPR_SPEC = ? AND APPR_TBLNO = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, apprSpec);
pstmt.setString(2, apprTblNo);
rs = pstmt.executeQuery();
if( rs.next() )
{
errString = getErrorString("appr_tblno","APRTBLNONL",userId);
break ;
}
}
}
}
}
break;
}
}
catch(Exception e)
{
System.out.println("Exception : ApprSpecTbl : wfValData :");
e.printStackTrace();
errString=e.getMessage();
}
finally
{
try
{
if(conn!=null)
{
conn.close();
}
conn = null;
}
catch(Exception d)
{
d.printStackTrace();
}
}
System.out.println("ErrString ::"+errString);
return errString;
}
public String itemChanged(String xmlString, String xmlString1,String xmlString2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException
{
Document dom = null;
Document dom1 = null;
Document dom2 = null;
String valueXmlString = "";
try
{
dom = parseString(xmlString);
System.out.println("xmlString" + xmlString);
dom1 = parseString(xmlString1);
if(xmlString2.trim().length() > 0 )
{
dom2 = parseString(xmlString2);
}
valueXmlString = itemChanged(dom,dom1,dom2,objContext,currentColumn,editFlag,xtraParams);
}
catch(Exception e)
{
System.out.println("Exception : [ApprSpecTbl][itemChanged(String,String)] :==>\n"+e.getMessage());
}
return valueXmlString;
}
public String itemChanged(Document dom, Document dom1,Document dom2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException
{
StringBuffer valueXmlString = new StringBuffer();
NodeList parentNodeList = null;
NodeList childNodeList = null;
Node parentNode = null;
Node childNode = null;
int ctr=0,k=0,childNodeListLength=0;
String columnValue = null;
String childNodeName = null;
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
String sql = "";
String loginSite="", query ="";
E12GenericUtility genericUtility = new ibase.utility.E12GenericUtility();
try
{
conn = getConnection();
System.out.println("conn connection-'-["+conn+"]");
loginSite = getValueFromXTRA_PARAMS(xtraParams, "loginSiteCode");
if(objContext != null && objContext.trim().length() > 0)
k = Integer.parseInt(objContext);
System.out.println("[ApprSpecTbl][itemChanged][FORM NO][" + k+"]");
valueXmlString = new StringBuffer("<?xml version=\"1.0\"?><Root><header><editFlag>");
valueXmlString.append(editFlag).append("</editFlag></header>");
switch(k)
{
case 1 :
parentNodeList = dom.getElementsByTagName("Detail1");
parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes();
ctr = 0;
valueXmlString.append("<Detail1>");
childNodeListLength = childNodeList.getLength();
do
{
childNode = childNodeList.item(ctr);
System.out.println("child node in apprtbl-["+childNode+"]");
childNodeName = childNode.getNodeName();
if(childNodeName.equals(currentColumn))
{
if (childNode.getFirstChild() != null)
{
columnValue=childNode.getFirstChild().getNodeValue().trim();
}
}
ctr++;
}
while(ctr < childNodeListLength && !childNodeName.equals(currentColumn));
if(currentColumn.trim().equalsIgnoreCase("appr_spec"))
{
String apprSpec = checkNull(genericUtility.getColumnValue("appr_spec", dom));
if(apprSpec != null)
{
query = " SELECT SPEC_DETAILS FROM APPRAISAL_SPEC WHERE APPR_SPEC = ? " ;
if (conn != null)
{
pstmt = conn.prepareStatement(query);
}
pstmt.setString(1, apprSpec);
rs = pstmt.executeQuery();
if(rs.next())
{
String recCnt = rs.getString("SPEC_DETAILS");
System.out.println("reccnt ="+recCnt+" for["+query+"]");
valueXmlString.append("<spec_details>").append("<![CDATA[" + rs.getString("SPEC_DETAILS") + "]]>").append("</spec_details>");
}
else
{
valueXmlString.append("<spec_details>").append("<![CDATA[]]>").append("</spec_details>");
}
}
}
valueXmlString.append("</Detail1 >");
System.out.println("itemchange string :::" +valueXmlString);
break;
}
valueXmlString.append("</Root>");
}
catch(Exception e)
{
e.printStackTrace();
System.out.println("Exception ::" + e.getMessage());
throw new ITMException(e);
}
finally
{
try
{
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(conn != null)
conn.close();
conn = null;
}
catch(Exception e1)
{
e1.printStackTrace();
}
}
System.out.println("[ApprSpecTbl] Connection is Closed");
System.out.println("valueXmlString:::::" + valueXmlString.toString());
return valueXmlString.toString();
}
private String checkNull( String input )
{
if(input == null)
{
input = "";
}
return input;
}
}
package ibase.webitm.ejb.appraisal;
import java.rmi.RemoteException;
import org.w3c.dom.Document;
import ibase.webitm.ejb.ValidatorLocal;
import ibase.webitm.utility.ITMException;
@javax.ejb.Local
public interface ApprSpecTblLocal extends ValidatorLocal
{
public String wfValData(Document dom, Document dom1,Document dom2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String wfValData(String xmlString, String xmlString1,String xmlString2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String itemChanged(String xmlString, String xmlString1,String xmlString2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String itemChanged(Document dom, Document dom1,Document dom2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException;
}
package ibase.webitm.ejb.appraisal;
import java.rmi.RemoteException;
import org.w3c.dom.Document;
import ibase.webitm.ejb.ValidatorRemote;
import ibase.webitm.utility.ITMException;
@javax.ejb.Remote
public interface ApprSpecTblRemote extends ValidatorRemote
{
public String wfValData(Document dom, Document dom1,Document dom2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String wfValData(String xmlString, String xmlString1,String xmlString2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String itemChanged(String xmlString, String xmlString1,String xmlString2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String itemChanged(Document dom, Document dom1,Document dom2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException;
}
package ibase.webitm.ejb.appraisal;
import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import javax.ejb.Stateless;
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;
/**
* Session Bean implementation class AppraisalSpecEJB
* [Master component of Appraisal Specification]
*/
@Stateless
public class AppraisalSpecEJB extends ValidatorEJB implements AppraisalSpecRemote, AppraisalSpecLocal
{
public String wfValData(String xmlString, String xmlString1, String xmlString2, String objContext, String editFlag, String xtraParams) throws RemoteException, ITMException
{
System.out.println("Came Inside wfValData:::");
Document dom = null;
Document dom1 = null;
Document dom2 = null;
String errString = "";
System.out.println("xmlString ["+xmlString+"]");
System.out.println("xmlString1["+xmlString1+"]");
System.out.println("xmlString2["+xmlString2+"]");
try
{
if(xmlString != null && xmlString.trim().length()!=0)
{
dom = parseString(xmlString);
}
if(xmlString1 != null && xmlString1.trim().length()!=0)
{
dom1 = parseString(xmlString1);
}
if(xmlString2 != null && xmlString2.trim().length()!=0)
{
dom2 = parseString(xmlString2);
}
errString = wfValData(dom,dom1,dom2,objContext,editFlag,xtraParams);
}
catch(Exception e)
{
System.out.println("Exception : [AppraisalSpecEJB][wfValData(String xmlString)] : ==>\n"+e.getMessage());
e.printStackTrace();
}
return (errString);
}
public String wfValData(Document dom, Document dom1, Document dom2, String objContext, String editFlag, String xtraParams) throws ITMException
{
String userId = "";
String errString = "";
NodeList parentList = null;
NodeList childList = null;
Node parentNode = null;
Node childNode = null;
String childNodeName = null;
int counter;
Connection conn = null;
int noOfChilds = 0;
int currentFormNo = 0;
StringBuffer errStringXml = null;
int cnt = 0;
String sql = "";
PreparedStatement pstmt = null;
ResultSet rs = null;
String sqlString = "";
String sqlInput = "";
String apprSpec = "";
String specDetails = "";
String apprSpecParent = "";
E12GenericUtility genericUtility = new E12GenericUtility();
System.out.println("editFlag...wfValdata ["+editFlag+"]");
try
{
conn = getConnection();
conn.setAutoCommit(false);
userId = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"loginCode");
errStringXml = new StringBuffer("<?xml version=\"1.0\"?>\r\n<Root><Errors>");
if(objContext != null && objContext.trim().length()>0)
{
currentFormNo = Integer.parseInt(objContext);
}
parentList = dom.getElementsByTagName("Detail" + currentFormNo);
parentNode = parentList.item(0);
childList = parentNode.getChildNodes();
noOfChilds = childList.getLength();
for(counter = 0; counter < noOfChilds; counter++)
{
childNode = childList.item(counter);
childNodeName = childNode.getNodeName();
switch(currentFormNo)
{
case 1:
if(childNodeName.equalsIgnoreCase("APPR_SPEC"))
{
apprSpec = genericUtility.getColumnValue("appr_spec", dom);
System.out.println("apprSpec::"+apprSpec);
if(apprSpec == null || apprSpec.trim().length() == 0)
{
errString = getErrorString("APPR_SPEC", "VTAPPRSPEC", userId);
}
else if(apprSpec != null && apprSpec.trim().length()> 0 && editFlag.equalsIgnoreCase("A"))
{
cnt = 0;
sql = "Select count(*) as cnt from appraisal_spec where appr_spec = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, apprSpec);
rs = pstmt.executeQuery();
while(rs.next())
{
cnt = rs.getInt("cnt");
}
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(cnt > 0)
{
errString = getErrorString("APPR_SPEC", "VTINVLSPEC", userId);
}
}
}
else if(childNodeName.equalsIgnoreCase("SPEC_DETAILS"))
{
specDetails = genericUtility.getColumnValue("spec_details", dom);
System.out.println("specDetails:["+specDetails+"]");
if(specDetails == null || specDetails.trim().length() == 0)
{
errString = getErrorString("SPEC_DETAILS", "VTSPECDETS", userId);
}
}
else if(childNodeName.equalsIgnoreCase("APPR_SPEC__PARENT"))
{
apprSpecParent = genericUtility.getColumnValue("appr_spec__parent", dom);
System.out.println("apprSpecParent::["+apprSpecParent+"]");
if(apprSpecParent != null && apprSpecParent.trim().length() > 0)
{
sql = "Select count(*) as cnt from appraisal_spec where appr_spec = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, apprSpecParent);
rs = pstmt.executeQuery();
while(rs.next())
{
cnt = rs.getInt("cnt");
}
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(cnt == 0)
{
errString = getErrorString("APPR_SPEC__PARENT", "VTSPECPARE", userId);
}
}
}
else if(childNodeName.equalsIgnoreCase("sql_input"))
{
sqlInput = genericUtility.getColumnValue("sql_input", dom);
if(sqlInput != null && sqlInput.trim().length() > 0)
{
sqlString = genericUtility.getColumnValue("sql", dom);
if(sqlString == null || sqlString.trim().length() == 0)
{
errString = getErrorString("sql", "VTNULLSQL", userId);
}
}
}
break;
}
if(errString != null && errString.trim().length()> 0)
{
break;
}
}
errStringXml.append("</Errors></Root> \r\n");
}
catch(Exception e)
{
System.out.println( "Exception : [AppraisalSpecEJB][wfValData(String xmlString)] : ==>\n"+e.getMessage());
e.printStackTrace();
throw new ITMException(e);
}
finally
{
try
{
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(conn != null)
{
conn.close();
conn = null;
}
}
catch(Exception e1)
{
System.out.println( "Exception : [AppraisalSpecEJB][wfValData] : ==>\n"+e1.getMessage());
throw new ITMException(e1);
}
}
return errString;
}
}
package ibase.webitm.ejb.appraisal;
import java.rmi.RemoteException;
import javax.ejb.Local;
import org.w3c.dom.Document;
import ibase.webitm.ejb.ValidatorLocal;
import ibase.webitm.utility.ITMException;
@Local
public interface AppraisalSpecLocal extends ValidatorLocal
{
public String wfValData(Document dom, Document dom1, Document dom2, String objContext, String editFlag, String xtraParams)throws RemoteException,ITMException;
public String wfValData(String xmlString, String xmlString1, String xmlString2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException;
}
package ibase.webitm.ejb.appraisal;
import java.rmi.RemoteException;
import javax.ejb.Remote;
import org.w3c.dom.Document;
import ibase.webitm.ejb.ValidatorRemote;
import ibase.webitm.utility.ITMException;
@Remote
public interface AppraisalSpecRemote extends ValidatorRemote
{
public String wfValData() throws RemoteException,ITMException;
public String wfValData(Document dom, Document dom1, Document dom2, String objContext, String editFlag,
String xtraParams)throws RemoteException,ITMException;
public String wfValData(String xmlString, String xmlString1, String xmlString2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException;
}
SET DEFINE OFF;
----------------------------------[APPRAISAL_SPEC][SYSTABLE][START][17/10/2017]---------------------------------------------
Insert into ITM2MENU (APPLICATION,LEVEL_1,LEVEL_2,LEVEL_3,LEVEL_4,LEVEL_5,WIN_NAME,DESCR,COMMENTS,MENU_PATH,ICON_PATH,OBJ_TYPE,MOB_DEPLOY,CHG_USER,CHG_TERM,OPEN_ICON,CLOSE_ICON,CHG_DATE,DEFAULT_STATE,DEF_ACTION) values ('SFA',1,2,22,0,0,'w_appraisal_spec','Appraisal Specification','Appraisal Specification','SFA.1.2.22.0.0','strategicmaster.png','T',null,null,null,null,null,null,null,null);
Insert into TRANSETUP (TRAN_WINDOW,SAVE_FLAG,VAL_FLAG,KEY_FLAG,KEY_STRING,UDF_1,UDF_2,UDF_3,UDF_4,UDF_5,REPEATE_ADD,CHG_DATE,CHG_USER,CHG_TERM,EDI_OPTION,SITE_ACC_COL,CONFIRM_COL,CONFIRM_VAL,REPEAT_ADD_DET,LOAD_MODE,AUTO_CONFIRM,LEDG_POST_CONF,CHG_DATE_ON_CONF,TRAN_ID_COL,MAIL_OPTION,CONFIRM_MODE,GARBAGE_OPT,VAL_FLAG_EDI,VERIFY_PASSWORD,TABLE_NAME,APPLICATION,TABLE_DESC,TRAN_DATE_COL,SALES_PERS_ACC_COL,CUST_ACC_COL,SUPP_ACC_COL,ITEM_SER_ACC_COL,EMP_ACC_COL,WORKFLOW_OPT,TRAN_ID__FROM,TRAN_ID__TO,MULTITIRE_OPT,REF_SER,VIEW_MODE,TABLE_NAME_DET1,TABLE_NAME_DET2,TABLE_NAME_DET3,TAX_FORMS,SIGN_STATUS,USER_TRAN_WINDOW,CUSTOM_PREVIEW_OBJ,CHILDDATA_ARGOPT,IGNOREERRLIST_ONLOAD,EDIT_TMPLT,WRKFLW_INIT,FORMAL_ARGS,EDIT_OPT,AUDIT_TRAIL_OPT,CACHE_OPT,EDIT_EXPR,EDIT_EXPR_INP,RATE_COL,QTY_COL,TRAN_COMPL_MSG,EXEC_TYPE,PERIOD_OPTION,WRKFLW_PRIORITY,DISP_META_DATA,START_FORM,ISATTACHMENT,ALLOW_ATTACH,HEADER_FORM_NO,MSG_ONSAVE,WF_STATUS,CONFIRM_DATE_COL,CONFIRM_BY_COL,PROFILE_ID__RES,TRANSFER_MODE,PRINT_CONTROL,RCP_CACHE_STATUS,OPTIMIZE_MODE,EDITTAX,ITEM_SER_ACC_CODE,REPEATADDDET,ISGWTINITIATED,RESTART_FORM,BROW_DATA_DEF,VIEW_OPTS,DEF_VIEW,FUNCTION_TYPE,COMPL_ACTION,CANCEL_COL,CANCEL_VAL,IN_WF_COL,IN_WF_VAL,THUMB_OBJ,THUMB_IMAGE_COL,THUMB_ALT_COL,CMS_PATH,DEFAULT_DATA_ROW,DEFAULT_EDITOR,OFFLINE_OPT,MSG_NO,ATTACH_COUNT_MIN,ENABLE_EDITOR) values ('w_appraisal_spec ','2','2','M',null,null,null,null,null,null,'N',SYSDATE,'BASE','BASE','0',null,null,null,'N',null,null,'N',null,'APPR_SPEC',null,'0',null,null,null,'appraisal_spec','SFA',null,null,null,null,null,null,null,'0',null,null,null,'APPRSP','F',null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null);
Insert into OBJ_FORMS (WIN_NAME,TITLE,OBJ_BROW_NAME,OBJ_EDIT_NAME,CROSS_UPDATE_EXPR,EXPR_FLD_INFO,TARGET_FLD_INFO,EXPR_COMMENT,FORM_NO,SCR_FLAG,SCAN_FLAG,SCAN_METADATA,AUTO_ACCEPT_SCAN,PROPERTY_INFO,SCAN_DELIMITER,EXT_METADATA,EXT_SETUP,AFTER_SAVE,COLUMN_ON_SAVE,AUTO_ACCEPT_WEIGHDATA,PARENT_KEY_COL,DISP_METADATA,FORM_TYPE,ASSISTED_MODE,RATE_COL,QTY_COL,STORAGE_KEY_METADATA,DEFAULT_VIEW,SELECTION_MODE,EXT_COM,AUTO_ADDON_ENTRY,FREEZE_COL_POS,DEFAULT_ROW_CNT,IS_MANDATORY,TRAN_ID_COL,KEY_INFO,THUMB_OBJ,THUMB_IMAGE_COL,THUMB_ALT_COL,FORM_NAME,FORM_ICON,SELECTION_OPT,FORM_VIEW_OPTS) values ('w_appraisal_spec','Appraisal Spec',null,null,null,null,null,null,'1','F',null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null);
Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,RIGHTS_CHAR,INTERACTIVE,SERVICE_CODE,DESCRIPTION,TITLE,IMAGE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_USER,CHG_TERM,IS_CONFIRMATION_REQ,SEP_DUTY_OPT,RE_AUTH_OPT,SHOW_IN_PANEL,PAGE_CONTEXT,TYPE,MULTI_ROW_OPT,ACTION_ID,SWIPE_POSITION,ACTION_GROUP,ACTION_ARG,DEF_NODATA) values ('appraisal_spec',1,'A','a','a','Adding New','Add','add~normal.gif','1',null,null,'S',null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null);
Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,RIGHTS_CHAR,INTERACTIVE,SERVICE_CODE,DESCRIPTION,TITLE,IMAGE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_USER,CHG_TERM,IS_CONFIRMATION_REQ,SEP_DUTY_OPT,RE_AUTH_OPT,SHOW_IN_PANEL,PAGE_CONTEXT,TYPE,MULTI_ROW_OPT,ACTION_ID,SWIPE_POSITION,ACTION_GROUP,ACTION_ARG,DEF_NODATA) values ('appraisal_spec',2,'E','a','a','Editing Existing Record','Edit','edit~normal.gif','1',null,null,'S',null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null);
Insert into SYSTEM_EVENTS (OBJ_NAME,EVENT_CODE,EVENT_CONTEXT,SERVICE_CODE,METHOD_RULE,CHG_DATE,CHG_USER,CHG_TERM,RESULT_HANDLE,OVERWRITE_CORE,COMP_TYPE,COMP_NAME,COMM_FORMAT) values ('appraisal_spec','pre_validate','1','prv_appraisal_spec',null,to_date('05-02-08','DD-MM-RR'),'BASE','BASE','2','0','EJB','AppraisalSpecEJB',null);
Insert into SYSTEM_EVENT_SERVICES (SERVICE_CODE,SERVICE_DESCR,SERVICE_URI,SERVICE_PROVIDER,METHOD_NAME,RETURN_VALUE,RETURN_TYPE,RETURN_DESCR,CHG_DATE,CHG_USER,CHG_TERM,RETURN_XFRM,RETURN_XFRM_XSL,ARG_XFRM_XSL) values ('prv_appraisal_spec','pre validate appraisal_spec','http://localhost:9090/axis/services/ValidatorService',null,'wfValData','String','S',null,to_date('03-04-04','DD-MM-RR'),'BASE','BASE',null, EMPTY_BLOB(), EMPTY_BLOB());
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE,ARG_XFRM_XSL) values ('prv_appraisal_spec',1,'COMPONENT_TYPE','l',null,'S',null,SYSDATE,'BASE','BASE','EJB', EMPTY_BLOB());
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE,ARG_XFRM_XSL) values ('prv_appraisal_spec',2,'COMPONENT_NAME','l',null,'S',null,SYSDATE,'BASE','BASE','prv_appraisal_spec', EMPTY_BLOB());
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE,ARG_XFRM_XSL) values ('prv_appraisal_spec',3,'XML_DATA','l',null,'S',null,SYSDATE,'BASE','BASE',null, EMPTY_BLOB());
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE,ARG_XFRM_XSL) values ('prv_appraisal_spec',4,'XML_DATA_1','l',null,'S',null,SYSDATE,'BASE','BASE',null, EMPTY_BLOB());
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE,ARG_XFRM_XSL) values ('prv_appraisal_spec',5,'XML_DATA_ALL','l',null,'S',null,SYSDATE,'BASE','BASE',null, EMPTY_BLOB());
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE,ARG_XFRM_XSL) values ('prv_appraisal_spec',6,'OBJ_CONTEXT','l',null,'S',null,SYSDATE,'BASE','BASE',null, EMPTY_BLOB());
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE,ARG_XFRM_XSL) values ('prv_appraisal_spec',7,'EDIT_FLAG','l',null,'S',null,SYSDATE,'BASE','BASE',null, EMPTY_BLOB());
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE,ARG_XFRM_XSL) values ('prv_appraisal_spec',8,'XTRA_PARAMS','l',null,'S',null,SYSDATE,'BASE','BASE',null, EMPTY_BLOB());
----------------------------------[APPRAISAL_SPEC][SYSTABLE][END][17/10/2017]---------------------------------------------
----------------------------------[APPRAISAL_SPEC][MESSAGES][START][17/10/2017]---------------------------------------------
Insert into MESSAGES (MSG_NO,MSG_STR,MSG_DESCR,MSG_TYPE,MSG_OPT,MSG_TIME,ALARM,ERR_SOURCE,CHG_DATE,CHG_USER,CHG_TERM,OVERRIDE_INPUT,MAIL_OPTION,SOLUTION) values ('VTAPPRSPEC','NULL APPRAISAL SPEC','APPRAISAL SPECIFICATION CAN NOT BE NULL','E',null,1,null,null,SYSDATE,'BASE','BASE',null,null,null);
Insert into MESSAGES (MSG_NO,MSG_STR,MSG_DESCR,MSG_TYPE,MSG_OPT,MSG_TIME,ALARM,ERR_SOURCE,CHG_DATE,CHG_USER,CHG_TERM,OVERRIDE_INPUT,MAIL_OPTION,SOLUTION) values ('VTSPECDETS','NULL SPECIFICATION DETAILS','SPECIFICATION DETAILS CAN NOT BE NULL','E',null,1,null,null,SYSDATE,'BASE','BASE',null,null,null);
Insert into MESSAGES (MSG_NO,MSG_STR,MSG_DESCR,MSG_TYPE,MSG_OPT,MSG_TIME,ALARM,ERR_SOURCE,CHG_DATE,CHG_USER,CHG_TERM,OVERRIDE_INPUT,MAIL_OPTION,SOLUTION) values ('VTSPECPARE','INVALID SPECIFICATION PARENT','PLEASE ENTER EXISTING APPRAISAL SPECIFICATION PARENT','E',null,1,null,null,SYSDATE,'BASE','BASE',null,null,null);
Insert into MESSAGES (MSG_NO,MSG_STR,MSG_DESCR,MSG_TYPE,MSG_OPT,MSG_TIME,ALARM,ERR_SOURCE,CHG_DATE,CHG_USER,CHG_TERM,OVERRIDE_INPUT,MAIL_OPTION,SOLUTION) values ('VTINVLSPEC','INVALID APPR SPECIFICATION','PLEASE ENTER APPRAISAL SPECIFICATION WHICH DOES NOT EXIT IN MASTER','E',null,1,null,null,SYSDATE,'BASE','BASE',null,null,null);
Insert into MESSAGES (MSG_NO,MSG_STR,MSG_DESCR,MSG_TYPE,MSG_OPT,MSG_TIME,ALARM,ERR_SOURCE,CHG_DATE,CHG_USER,CHG_TERM,OVERRIDE_INPUT,MAIL_OPTION,SOLUTION) values ('VTNULLSQL','NULL SQL FIELD','PLEASE ENTER SQL VALUE.','E',null,1,null,null,SYSDATE,'BASE','BASE',null,null,null);
----------------------------------[APPRAISAL_SPEC][MESSAGES][END][17/10/2017]---------------------------------------------
----------------------------------[APPRAISAL_SPEC][POPHELP][START][17/10/2017]---------------------------------------------
Insert into POPHELP (FIELD_NAME,MOD_NAME,SQL_STR,DW_OBJECT,MSG_TITLE,WIDTH,HEIGHT,CHG_DATE,CHG_USER,CHG_TERM,DIST_OPT,FILTER_STRING,SQL_INPUT,DEFAULT_COL,POP_ALIGN,QUERY_MODE,PAGE_CONTEXT,POPHELP_COLS,POPHELP_SOURCE,MULTI_OPT,POPUP_XSL_NAME,HELP_OPTION,THUMB_OBJ,THUMB_IMAGE_COL,THUMB_ALT_COL,AUTO_FILL_LEN) values ('APPR_SPEC__PARENT','W_APPRAISAL_SPEC','SELECT appr_spec, SPEC_DETAILS,DESCR FROM appraisal_spec WHERE APPR_SPEC like UPPER(''?%'')',null,'APPRAISAL SPEC',0,0,to_date('16-10-17','DD-MM-RR'),'BASE ','BASE ',null,null,':appr_spec__parent',1,null,null,null,null,null,null,null,'1',null,null,null,'2');
----------------------------------[APPRAISAL_SPEC][POPHELP][END][17/10/2017]---------------------------------------------
\ No newline at end of file
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