Commit 98f01022 authored by manohar's avatar manohar

This commit was generated by cvs2svn to compensate for changes in r38, which

included commits to RCS files with non-trunk default branches.

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@91103 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 5c0996cb
package ibase.webitm.ejb.fin;
import java.rmi.RemoteException;
import java.text.*;
import java.util.Date;
import java.sql.*;
import java.text.SimpleDateFormat;
import org.w3c.dom.*;
import javax.ejb.*;
import ibase.webitm.utility.ITMException;
import ibase.webitm.utility.*;
import ibase.system.config.*;
import ibase.webitm.ejb.*;
@Stateless // added for ejb3
public class AssetRegisterIC extends ValidatorEJB implements AssetRegisterICRemote,AssetRegisterICLocal
{
GenericUtility genericUtility = GenericUtility.getInstance();
/* public void ejbCreate() throws RemoteException, CreateException
{
System.out.println("AssetRegisterICEJB is in Process..........");
}
public void ejbRemove()
{
}
public void ejbActivate()
{
}
public void ejbPassivate()
{
} */
public String wfValData() throws RemoteException,ITMException
{
return "";
}
public String itemChanged() throws RemoteException,ITMException
{
return "";
}
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;
System.out.println("Validation Start..........");
try
{
dom = parseString(xmlString);
dom1 = parseString(xmlString1);
if (xmlString2.trim().length() > 0 )
{
dom2 = parseString(xmlString2);
}
errString = wfValData(dom,dom1,dom2,objContext,editFlag,xtraParams);
}
catch(Exception e)
{
System.out.println("Exception : AssetRegisterICEJB : wfValData(String xmlString) : ==>\n"+e.getMessage());
}
return (errString);
}
public String wfValData(Document dom, Document dom1,Document dom2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException
{
String errString = " ";
NodeList parentNodeList = null;
NodeList childNodeList = null;
Node parentNode = null;
Node childNode = null;
String columnValue = null;
String childNodeName = null;
ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB();
String errCode = null;
String userId = null,loginSite = null;
int cnt = 0;
int ctr = 0;
int currentFormNo = 0;
int childNodeListLength;
Connection conn = null;
PreparedStatement pstmt=null;
ResultSet rs = null;
String sql = null;
ConnDriver connDriver = new ConnDriver();
String lineNoDet = null;
String updateFlag = null;
try
{
System.out.println( "wfValData called" );
conn = connDriver.getConnectDB("DriverITM");
userId = getValueFromXTRA_PARAMS(xtraParams,"loginCode");
loginSite = getValueFromXTRA_PARAMS(xtraParams, "loginSiteCode");
if(objContext != null && objContext.trim().length()>0)
{
currentFormNo = Integer.parseInt(objContext);
}
switch(currentFormNo)
{
case 1 :
System.out.println("VALIDATION FOR DETAIL [ 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 ( childNodeName.equalsIgnoreCase( "site_code" ) )
{
if ( childNode.getFirstChild() == null )
{
errString =itmDBAccessEJB.getErrorString("SITE_CODE","VMINVSITE",userId);
break ;
}
else
{
String siteCode = null;
siteCode = genericUtility.getColumnValue( "site_code", dom, "1" );
sql = " SELECT COUNT(*) FROM site WHERE site_code ='" + siteCode.trim() + "'";
pstmt = conn.prepareStatement( sql );
//pstmt.setString(1,siteCode.trim());
rs = pstmt.executeQuery();
if( rs.next() )
{
cnt = rs.getInt( 1 );
}
if( cnt == 0 )
{
errCode = "VMINVSITE";
errString = getErrorString( "SITE_CODE", errCode, userId );
break ;
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
}
if ( childNodeName.equalsIgnoreCase( "item_grp" ) )
{
if ( childNode.getFirstChild() == null )
{
errString =itmDBAccessEJB.getErrorString("item_grp","INVITMGRP",userId);
break ;
}
else
{
String itemGrp = genericUtility.getColumnValue( "item_grp", dom).trim();
sql = "SELECT count(1) from gencodes"
+" where fld_name = 'GRP_CODE'"
+" AND trim(fld_value) = ? ";
pstmt = conn.prepareStatement( sql );
pstmt.setString(1,itemGrp);
rs = pstmt.executeQuery();
if( rs.next() )
{
cnt = rs.getInt( 1 );
}
System.out.println(" COUNT =====> [" + cnt + "]");
if( cnt == 0 )
{
errString = getErrorString( "item_grp","VMINVITMGP",userId );
break ;
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
}
}
//END OF CASE1
break;
case 2 :
System.out.println("VALIDATION FOR DETAIL [ 2 ]..........");
//String update_flag = null;
parentNodeList = dom.getElementsByTagName("Detail2");
parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes();
childNodeListLength = childNodeList.getLength();
for(ctr = 0; ctr < childNodeListLength; ctr++)
{
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
if ( childNodeName.equalsIgnoreCase( "eff_from" ) )
{
if ( childNode.getFirstChild() == null )
{
errString =itmDBAccessEJB.getErrorString("eff_from","VEFDTNNUL",userId);
break ;
}
else
{
String assetCode = genericUtility.getColumnValue( "asset_code", dom ) != null ?genericUtility.getColumnValue( "asset_code", dom ).trim() : null;
String effdatestr = genericUtility.getColumnValue( "eff_from", dom );
java.sql.Timestamp effDateDom = null;
sql = "SELECT count(*) from asset_register"
+" where trim(asset_code) = ? ";
pstmt = conn.prepareStatement( sql );
pstmt.setString(1,assetCode);
rs = pstmt.executeQuery();
if( rs.next() )
{
cnt = rs.getInt( 1 );
}
System.out.println(" COUNT =====> [" + cnt + "]");
if( cnt == 0 )
{
errString =itmDBAccessEJB.getErrorString("eff_from","VTINVASET",userId);
break ;
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if(assetCode != null)
{
effDateDom = Timestamp.valueOf(genericUtility.getValidDateString(effdatestr, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
java.sql.Timestamp procdate = null;
sql = "Select PROC_DATE_2 from ASSET_REGISTER"
+" where trim(ASSET_CODE) = ? ";
pstmt = conn.prepareStatement( sql );
pstmt.setString(1,assetCode);
rs = pstmt.executeQuery();
if( rs.next() )
{
procdate = rs.getTimestamp( 1 );
}
if( effDateDom.compareTo ( procdate ) < 0 )
{
errString =itmDBAccessEJB.getErrorString("eff_from","VTPROCDT",userId);
break ;
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
}
}
if ( childNodeName.equalsIgnoreCase( "valid_upto" ) )
{
if ( childNode.getFirstChild() == null )
{
errString =itmDBAccessEJB.getErrorString("valid_upto","VDUPTONNUL",userId);
break ;
}
else
{
String effdatestr = genericUtility.getColumnValue( "eff_from", dom ) != null ? genericUtility.getColumnValue( "eff_from", dom ) : null;
String vuptodatestr = genericUtility.getColumnValue( "valid_upto", dom ) != null ? genericUtility.getColumnValue( "valid_upto", dom ): null;
java.sql.Timestamp effDate = null;
java.sql.Timestamp vuptodate = null;
if( vuptodatestr != null && vuptodatestr.trim().length() > 0 && effdatestr != null && effdatestr.trim().length() > 0)
{
vuptodate = Timestamp.valueOf(genericUtility.getValidDateString(vuptodatestr, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
effDate = Timestamp.valueOf(genericUtility.getValidDateString(effdatestr, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
int effcDtMon = effDate.getMonth();
int vldUtDtMon = vuptodate.getMonth();
int effcDtYr = effDate.getYear();
int vldUtDtYr = vuptodate.getYear();
if( effDate.compareTo ( vuptodate ) > 0 )
{
errString = itmDBAccessEJB.getErrorString("valid_upto","VMVALIDDT",userId);
break ;
}
if(!((effcDtMon == vldUtDtMon) && (effcDtYr == vldUtDtYr)))
{
errString = itmDBAccessEJB.getErrorString("valid_upto","VTLVEPRD1",userId);
break ;
}
}
}
}
if ( childNodeName.equalsIgnoreCase( "depr_type" ) )
{
if ( childNode.getFirstChild() == null )
{
errString =itmDBAccessEJB.getErrorString("depr_type","DPTYPNNUL",userId);
break ;
}
else
{
String assetCode = genericUtility.getColumnValue( "asset_code", dom ) != null ? genericUtility.getColumnValue( "asset_code", dom ).trim() : null;
String effdatestr = genericUtility.getColumnValue( "eff_from", dom ) != null ? genericUtility.getColumnValue( "eff_from", dom ) : null;
String vuptodatestr = genericUtility.getColumnValue( "valid_upto", dom ) != null ? genericUtility.getColumnValue( "valid_upto", dom ) : null;
String deprtype = genericUtility.getColumnValue( "depr_type", dom ) != null ? genericUtility.getColumnValue( "depr_type", dom ) : null;
String itemgrp = genericUtility.getColumnValue( "item_grp", dom1 );
String lineNo = genericUtility.getColumnValue( "line_no", dom );
String assetDet = null;
String effdateDet = null;
String valuptoDet = null;
String deprDet = null;
java.sql.Timestamp efDtDomTimeStp = null;
java.sql.Timestamp vuptodtDomTimeStp = null;
java.sql.Timestamp efDtDetTimeStp = null;
java.sql.Timestamp vuptodtDetTimeStp = null;
if(assetCode != null && effdatestr != null && vuptodatestr != null && deprtype != null)
{
NodeList detail2List = dom2.getElementsByTagName("Detail2");
int detail2ListLen = detail2List.getLength();
for(int detail2Idx = 0; detail2Idx < detail2ListLen ; detail2Idx++ )
{
Node currDetail = detail2List.item( detail2Idx );
NodeList currDetNodes = currDetail.getChildNodes();
updateFlag = getNodeValue( currDetail, "updateFlag", true );
assetDet = getNodeValue( currDetail, "asset_code", false );
effdateDet = getNodeValue( currDetail, "eff_from", false );
valuptoDet = getNodeValue( currDetail, "valid_upto", false );
deprDet = getNodeValue( currDetail, "depr_type", false );
lineNoDet = getNodeValue( currDetail, "line_no", false );
if( (!lineNoDet.equals(lineNo)) && (!updateFlag.equals("D") ) )
{
if( (assetDet != null) && (assetDet.equals(assetCode)) && (effdateDet != null) && (valuptoDet != null) && (deprDet != null))
{
System.out.println("Inside first if condition.......");
efDtDomTimeStp = Timestamp.valueOf(genericUtility.getValidDateString(effdatestr, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
vuptodtDomTimeStp = Timestamp.valueOf(genericUtility.getValidDateString(vuptodatestr, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
efDtDetTimeStp = Timestamp.valueOf(genericUtility.getValidDateString(effdateDet, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
vuptodtDetTimeStp = Timestamp.valueOf(genericUtility.getValidDateString(valuptoDet, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
if( efDtDomTimeStp.compareTo ( efDtDetTimeStp ) >= 0 && efDtDomTimeStp.compareTo ( vuptodtDetTimeStp ) <= 0)
{
errString = itmDBAccessEJB.getErrorString("depr_type","VTDUPREC",userId);
break ;
}
if( efDtDomTimeStp.compareTo ( efDtDetTimeStp ) <= 0 && vuptodtDomTimeStp.compareTo ( vuptodtDetTimeStp ) >= 0)
{
errString = itmDBAccessEJB.getErrorString("depr_type","VTDUPREC",userId);
break ;
}
if( vuptodtDomTimeStp.compareTo ( efDtDetTimeStp ) >= 0 && vuptodtDomTimeStp.compareTo ( vuptodtDetTimeStp ) < 0)
{
errString = itmDBAccessEJB.getErrorString("depr_type","VTDUPREC",userId);
break ;
}
if( efDtDomTimeStp.compareTo ( efDtDetTimeStp ) == 0 || vuptodtDomTimeStp.compareTo ( vuptodtDetTimeStp ) == 0)
{
errString = itmDBAccessEJB.getErrorString("depr_type","VTDUPREC",userId);
break ;
}
/* if( deprDet.equals(deprtype) && assetCode.equalsIgnoreCase( assetDet ) )
{
errString = itmDBAccessEJB.getErrorString("depr_type","VTDEPRDUP",userId);
break ;
} */
}
}
}
}
}
}
if ( childNodeName.equalsIgnoreCase( "asset_code" ) )
{
if ( childNode.getFirstChild() == null )
{
errString =itmDBAccessEJB.getErrorString("asset_code","ASSETNNUL",userId);
break ;
}
else
{
String assetCode = genericUtility.getColumnValue( "asset_code", dom );
String deprType = genericUtility.getColumnValue( "depr_type", dom ) != null ? genericUtility.getColumnValue( "depr_type", dom ) : null;
String effFromStr = genericUtility.getColumnValue( "eff_from", dom ) != null ? genericUtility.getColumnValue( "eff_from", dom ) : null;
String validUptoStr = genericUtility.getColumnValue( "valid_upto", dom ) != null ? genericUtility.getColumnValue( "valid_upto", dom ) : null;
String lineNo = genericUtility.getColumnValue( "line_no", dom );
String tranId = genericUtility.getColumnValue( "tran_id", dom );
String itemSer = genericUtility.getColumnValue( "item_grp", dom1 );
String siteCode = genericUtility.getColumnValue( "site_code", dom1 );
if((deprType != null) && (effFromStr != null) && (validUptoStr != null))
{
sql = "Select count(*) from asset_shiftdet"
+" where TRAN_ID <> ? "
+" AND asset_code = ? "
+" AND (eff_from BETWEEN ? AND ?"
+" OR valid_upto BETWEEN ? AND ?)";
/* +" OR depr_type = ? )"; */
pstmt = conn.prepareStatement( sql );
pstmt.setString(1,tranId);
pstmt.setString(2,assetCode);
pstmt.setTimestamp(3,java.sql.Timestamp.valueOf(genericUtility.getValidDateTimeString(effFromStr,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())));
pstmt.setTimestamp(4,java.sql.Timestamp.valueOf(genericUtility.getValidDateTimeString(validUptoStr,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())));
pstmt.setTimestamp(5,java.sql.Timestamp.valueOf(genericUtility.getValidDateTimeString(effFromStr,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())));
pstmt.setTimestamp(6,java.sql.Timestamp.valueOf(genericUtility.getValidDateTimeString(validUptoStr,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())));
/* pstmt.setString(7,deprType); */
rs = pstmt.executeQuery();
if( rs.next() )
{
cnt = rs.getInt( 1 );
}
if( cnt > 0 )
{
errString =itmDBAccessEJB.getErrorString("asset_code","VTDUPREC",userId);
break ;
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
if(assetCode != null && effFromStr != null)
{
String grpCode = null;
sql = "SELECT grp_code from asset_register"
+" where asset_code = ? ";
pstmt = conn.prepareStatement( sql );
pstmt.setString(1,assetCode);
rs = pstmt.executeQuery();
if( rs.next() )
{
grpCode = rs.getString( "grp_code" ) != null ? rs.getString( "grp_code" ) : null;
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if(grpCode != null)
{
sql = "select count( 1 ) from"
+" (select prd_code__upto"
+" from asset_depr ad,"
+" ( select code from acctprd"
+" where ? between"
+" fr_date and to_date ) acP"
+" where ad.asset_code = ? "
+" and ad.acct_prd = acp.code"
+" and ad.item_ser = ? "
+" and ad.grp_code = ? "
+" and ad.site_code = ? )"
+" a, ( select code from period"
+" where ? > = fr_date"
+" and ? <= to_date) b"
+" where a.prd_code__upto >= b.code";
pstmt = conn.prepareStatement( sql );
pstmt.setTimestamp(1,java.sql.Timestamp.valueOf(genericUtility.getValidDateTimeString(effFromStr,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())));
pstmt.setString(2,assetCode);
pstmt.setString(3,itemSer);
pstmt.setString(4,grpCode);
pstmt.setString(5,siteCode);
pstmt.setTimestamp(6,java.sql.Timestamp.valueOf(genericUtility.getValidDateTimeString(effFromStr,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())));
pstmt.setTimestamp(7,java.sql.Timestamp.valueOf(genericUtility.getValidDateTimeString(effFromStr,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())));
rs = pstmt.executeQuery();
if( rs.next() )
{
cnt = rs.getInt( 1 );
}
if( cnt > 0 )
{
errString =itmDBAccessEJB.getErrorString("asset_code","VTDEPALC",userId);
break ;
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
sql = "select count(1) from depr_itemgrp"
+" where Item_grp = ? "
+" and ? between eff_from and valid_upto"
+" and ? between eff_from and valid_upto"
+" and depr_type = ? " ;
pstmt = conn.prepareStatement( sql );
pstmt.setString(1,grpCode);
pstmt.setTimestamp(2,java.sql.Timestamp.valueOf(genericUtility.getValidDateTimeString(effFromStr,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())));
pstmt.setTimestamp(3,java.sql.Timestamp.valueOf(genericUtility.getValidDateTimeString(validUptoStr,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())));
pstmt.setString(4,deprType);
rs = pstmt.executeQuery();
if( rs.next() )
{
cnt = rs.getInt( 1 );
}
if( cnt == 0 )
{
errString =itmDBAccessEJB.getErrorString("asset_code","VTDEPTYPE",userId);
break ;
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
else
{
errString =itmDBAccessEJB.getErrorString("asset_code","VTGRPCDNUL",userId);
break ;
}
}
}
}
}//END FOR OF CASE2
break;
}//END SWITCH
}//END TRY
catch(Exception e)
{
System.out.println("Exception ::" +e);
e.printStackTrace();
errCode = "VALEXCEP";
errString = getErrorString( "", errCode, userId );
}
finally
{
try
{
if(conn != null)
{
if( pstmt != null )
{
pstmt.close();
pstmt = null;
}
if( rs != null )
{
rs.close();
rs = null;
}
conn.close();
}
conn = null;
}
catch(Exception d)
{
d.printStackTrace();
}
System.out.println(" < AssetRegisterIcEJB > CONNECTION IS CLOSED");
}
System.out.println("ErrString ::" + errString);
return errString;
}//END OF VALIDATION
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 = null;
try
{
System.out.println("xmlString" + xmlString);
dom = parseString(xmlString);
System.out.println("xmlString1" + xmlString1);
dom1 = parseString(xmlString1);
if (xmlString2.trim().length() > 0 )
{
System.out.println("xmlString2" + xmlString2);
dom2 = parseString("<Root>" + xmlString2 + "</Root>");
}
valueXmlString = itemChanged(dom,dom1,dom2,objContext,currentColumn,editFlag,xtraParams);
}
catch(Exception e)
{
System.out.println("Exception : [AssetRegisterICEJB][itemChanged] :==>\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
{
Connection conn = null;
ConnDriver connDriver = new ConnDriver();
PreparedStatement pStmt = null;
ResultSet rs = null;
String sql = null;
int currentFormNo = 0;
StringBuffer valueXmlString = new StringBuffer();
String columnValue = null;
NodeList parentNodeList = null;
Node parentNode = null;
Node childNode = null;
NodeList childNodeList = null;
String childNodeName = null;
int childNodeListLength = 0;
int ctr = 0;
int cnt = 0;
String loginSite = null;
String chguserhdr = null;
String chgtermhdr = null;
SimpleDateFormat sdf = null;
ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB();
try
{
sdf = new SimpleDateFormat(genericUtility.getApplDateFormat());
conn = connDriver.getConnectDB("DriverITM");
connDriver = null;
if(objContext != null && objContext.trim().length()>0)
{
currentFormNo = Integer.parseInt(objContext);
}
loginSite = getValueFromXTRA_PARAMS(xtraParams, "loginSiteCode");
chguserhdr = getValueFromXTRA_PARAMS(xtraParams, "loginCode");
chgtermhdr = getValueFromXTRA_PARAMS(xtraParams, "chgTerm");
valueXmlString = new StringBuffer("<?xml version=\"1.0\"?><Root><header><editFlag>");
valueXmlString.append(editFlag).append("</editFlag></header>");
System.out.println("Current Form No ["+currentFormNo+"]");
switch (currentFormNo)
{
case 1:
valueXmlString.append("<Detail1>");
//SEARCHING THE DOM FOR THE INCOMING COLUMN VALUE START
parentNodeList = dom.getElementsByTagName("Detail1");
parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes();
ctr = 0;
childNodeListLength = childNodeList.getLength();
do
{
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
if(childNodeName.equals(currentColumn))
{
if (childNode.getFirstChild() != null)
{
columnValue=childNode.getFirstChild().getNodeValue().trim();
}
}
ctr++;
}while(ctr < childNodeListLength && !childNodeName.equals(currentColumn));
System.out.println("[" + currentColumn + "] ==> '" + columnValue + "'");
if (currentColumn.trim().equals( "itm_default" ))
{
String loginSiteCode = null;
String siteDescr = null;
loginSiteCode = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginSiteCode");
if( loginSiteCode != null || loginSiteCode.trim().length()==0 )
{
sql = "select s.descr site_descr from site s "
+" where s.site_code = ? ";
pStmt = conn.prepareStatement( sql );
pStmt.setString(1,loginSiteCode);
rs = pStmt.executeQuery();
if( rs.next() )
{
siteDescr = rs.getString( "site_descr" );
}
rs.close();
rs = null;
pStmt.close();
pStmt = null;
valueXmlString.append("<tran_date>").append("<![CDATA[" + getCurrdateAppFormat() + "]]>").append("</tran_date>");
valueXmlString.append("<site_code>").append("<![CDATA[" + ( loginSiteCode != null ? loginSiteCode.trim() : "" )+ "]]>").append("</site_code>");
valueXmlString.append("<site_descr>").append("<![CDATA[" + ( siteDescr != null ? siteDescr.trim() : "" )+ "]]>").append("</site_descr>");
valueXmlString.append("<chg_user>").append("<![CDATA["+ chguserhdr + "]]>").append("</chg_user>");
valueXmlString.append("<chg_term>").append("<![CDATA["+ chgtermhdr + "]]>").append("</chg_term>");
}
}
if(currentColumn.trim().equalsIgnoreCase("itm_defaultedit"))
{
String siteCodeEdit = getColumnValue("site_code",dom);
String itemGrpEdit = getColumnValue("item_grp",dom);
String tranId = genericUtility.getColumnValue( "tran_id", dom );
sql = "SELECT count(1) from ASSET_SHIFTDET"
+" where tran_id = ? ";
pStmt = conn.prepareStatement( sql );
pStmt.setString(1,tranId);
rs = pStmt.executeQuery();
if( rs.next() )
{
cnt = rs.getInt( 1 );
}
rs.close();
rs = null;
pStmt.close();
pStmt = null;
String grpDescr = null;
sql = "select fn_get_gen_descr('GRP_CODE','W_ITEM', ? ,'D') descr"
+" from dual";
pStmt = conn.prepareStatement( sql );
pStmt.setString(1, itemGrpEdit != null ? itemGrpEdit.trim() : "" );
rs = pStmt.executeQuery();
if( rs.next() )
{
grpDescr = rs.getString( 1 );
}
if( cnt == 0 )
{
valueXmlString.append("<site_code>").append("<![CDATA[" + ( siteCodeEdit != null ? siteCodeEdit.trim() : "" )+ "]]>").append("</site_code>");
valueXmlString.append("<item_grp>").append("<![CDATA[" + ( itemGrpEdit != null ? itemGrpEdit.trim() : "" )+ "]]>").append("</item_grp>");
valueXmlString.append("<grp_descr>").append("<![CDATA[" + ( grpDescr != null ? grpDescr.trim() : "" )+ "]]>").append("</grp_descr>");
}
else
{
valueXmlString.append("<site_code protect=\"1\" >").append("<![CDATA["+siteCodeEdit+"]]>").append("</site_code>");
valueXmlString.append("<item_grp protect=\"1\" >").append("<![CDATA["+itemGrpEdit+"]]>").append("</item_grp>");
valueXmlString.append("<grp_descr>").append("<![CDATA[" + ( grpDescr != null ? grpDescr.trim() : "" )+ "]]>").append("</grp_descr>");
}
}
if (currentColumn.trim().equals( "site_code" ))
{
String siteDescr = null;
String sitecode = genericUtility.getColumnValue( "site_code", dom );
sql = "select s.descr site_descr from site s "
+" where s.site_code = ? ";
pStmt = conn.prepareStatement( sql );
pStmt.setString(1,sitecode);
rs = pStmt.executeQuery();
if( rs.next() )
{
siteDescr = rs.getString( "site_descr" );
}
rs.close();
rs = null;
pStmt.close();
pStmt = null;
valueXmlString.append("<site_descr>").append("<![CDATA[" + ( siteDescr != null ? siteDescr.trim() : "" )+ "]]>").append("</site_descr>");
}
if (currentColumn.trim().equals( "item_grp" ))
{
String itemgrphdr = genericUtility.getColumnValue( "item_grp", dom ).trim();
String itemgrp_descr = null;
sql = "select fn_get_gen_descr('GRP_CODE','W_ITEM','"+itemgrphdr+"','D') descr"
+" from dual";
pStmt = conn.prepareStatement( sql );
rs = pStmt.executeQuery();
if( rs.next() )
{
itemgrp_descr = rs.getString(1);
}
rs.close();
rs = null;
pStmt.close();
pStmt = null;
valueXmlString.append("<grp_descr>").append("<![CDATA[" + ( itemgrp_descr != null ? itemgrp_descr.trim() : "" )+ "]]>").append("</grp_descr>");
}
valueXmlString.append("</Detail1>");
valueXmlString.append("</Root>");
break;
///////////////
case 2:
valueXmlString.append("<Detail2>");
//SEARCHING THE DOM FOR THE INCOMING COLUMN VALUE START
parentNodeList = dom.getElementsByTagName("Detail2");
parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes();
ctr = 0;
childNodeListLength = childNodeList.getLength();
do
{
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
if(childNodeName.equals(currentColumn))
{
if (childNode.getFirstChild() != null)
{
columnValue=childNode.getFirstChild().getNodeValue().trim();
}
}
ctr++;
}while(ctr < childNodeListLength && !childNodeName.equals(currentColumn));
System.out.println("[" + currentColumn + "] ==> '" + columnValue + "'");
if (currentColumn.trim().equals("asset_code"))
{
String assetDescr = null;
String assetcode = genericUtility.getColumnValue( "asset_code", dom ).trim();
sql = "select DESCR from asset_register "
+"where trim(asset_code) = ? ";
pStmt = conn.prepareStatement( sql );
pStmt.setString(1,assetcode);
rs = pStmt.executeQuery();
if( rs.next() )
{
assetDescr = rs.getString( "DESCR" );
}
rs.close();
rs = null;
pStmt.close();
pStmt = null;
valueXmlString.append("<descr>").append("<![CDATA[" + ( assetDescr != null ? assetDescr.trim() : "" )+ "]]>").append("</descr>");
}
valueXmlString.append("</Detail2>");
valueXmlString.append("</Root>");
////////////////
}//END OF TRY
}
catch(Exception e)
{
System.out.println("Exception ::"+ e.getMessage());
e.printStackTrace();
}
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 e)
{
System.out.println("Exception ::" + e);
e.printStackTrace();
}
}
return valueXmlString.toString();
}//END OF ITEMCHANGE
private String getCurrdateAppFormat()
{
String s = "";
GenericUtility genericUtility = GenericUtility.getInstance();
try
{
java.util.Date date = null;
Timestamp timestamp = new Timestamp(System.currentTimeMillis());
SimpleDateFormat simpledateformat = new SimpleDateFormat(genericUtility.getDBDateFormat());
date = simpledateformat.parse(timestamp.toString());
timestamp = Timestamp.valueOf(simpledateformat.format(date).toString() + " 00:00:00.0");
s = (new SimpleDateFormat(genericUtility.getApplDateFormat())).format(timestamp).toString();
}
catch(Exception exception)
{
System.out.println("Exception in getCurrdateAppFormat " + exception.getMessage());
}
return s;
}
private String getNodeValue( Node currDet, String fldName, boolean isAttribute )
{
String fldValue = null;
boolean isFound = false;
NodeList currNodes = currDet.getChildNodes();
int currDetLen = currNodes.getLength();
for(int detIdx = 0; detIdx < currDetLen && !isFound ; detIdx++ )
{
Node currNode = currNodes.item( detIdx );
String nodeName = currNode.getNodeName();
if( isAttribute == true )
{
if ( nodeName.equalsIgnoreCase( "attribute" ) )
{
fldValue = currNode.getAttributes().getNamedItem( fldName ).getNodeValue();
isFound = true;
}
}
else if ( currNode.getNodeType() == Node.ELEMENT_NODE && nodeName.equalsIgnoreCase( fldName ) )
{
fldValue = currNode.getFirstChild() != null ? currNode.getFirstChild().getNodeValue().trim() : null;
isFound = true;
}
}
return fldValue;
}
}
package ibase.webitm.ejb.fin;
import java.rmi.RemoteException;
import org.w3c.dom.*;
//import javax.ejb.EJBObject;
import ibase.webitm.utility.ITMException;
import ibase.webitm.ejb.*;
import javax.ejb.Local; // added for ejb3
import ibase.webitm.ejb.ValidatorLocal;// added for ejb3
@Local // added for ejb3
public interface AssetRegisterICLocal extends ValidatorLocal
{
public String wfValData() throws RemoteException,ITMException;
public String wfValData(String xmlString, String xmlString1,String xmlString2, String objContext, String editFlag, String xtraParams) throws RemoteException, ITMException;
public String wfValData(Document dom, Document dom1,Document dom2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String itemChanged() 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;
}
\ No newline at end of file
package ibase.webitm.ejb.fin;
import java.rmi.RemoteException;
import org.w3c.dom.*;
//import javax.ejb.EJBObject;
import ibase.webitm.utility.ITMException;
import ibase.webitm.ejb.*;
import javax.ejb.Remote; // added for ejb3
import ibase.webitm.ejb.ValidatorRemote;// added for ejb3
@Remote // added for ejb3
public interface AssetRegisterICRemote extends ValidatorRemote
{
public String wfValData() throws RemoteException,ITMException;
public String wfValData(String xmlString, String xmlString1,String xmlString2, String objContext, String editFlag, String xtraParams) throws RemoteException, ITMException;
public String wfValData(Document dom, Document dom1,Document dom2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String itemChanged() 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;
}
\ No newline at end of file
package ibase.webitm.ejb.fin;
import ibase.webitm.utility.*;
import ibase.utility.CommonConstants;
import ibase.webitm.ejb.*;
import ibase.system.config.*;
import java.rmi.RemoteException;
import java.util.*;
import java.text.*;
import java.sql.*;
import javax.ejb.*;
import java.util.Calendar;
import java.util.Date;
import javax.naming.InitialContext;
import ibase.system.config.AppConnectParm;
//import ibase.webitm.ejb.MasterStatefulEJB;
//import ibase.webitm.ejb.MasterStatefulLocal;
@Stateless // added for ejb3
public class ConfirmAssetRegisterIC extends ActionHandlerEJB implements ConfirmAssetRegisterICRemote,ConfirmAssetRegisterICLocal
{
GenericUtility genericUtility = GenericUtility.getInstance();
String errorString = null;
/* public void ejbCreate() throws RemoteException, CreateException
{
System.out.println("Create Method Called....");
}
public void ejbRemove()
{
}
public void ejbActivate()
{
}
public void ejbPassivate()
{
} */
public String actionHandler() throws RemoteException,ITMException
{
System.out.println("actionHandler() Method Called....");
return "";
}
public String actionHandler(String xmlString, String xtraParams, String objContext) throws RemoteException,ITMException
{
String retString = null;
System.out.println("Xtra Params : " + xtraParams);
//genericUtility = GenericUtility.getInstance();
try
{
retString = actionConfirm(xmlString, xtraParams);
}
catch(Exception e)
{
System.out.println("Exception :actionHandler(String xmlString):" + e.getMessage() + ":");
e.printStackTrace();
throw new ITMException(e);
}
System.out.println("returning from actionHandler"+retString);
return (retString);
}
private String actionConfirm(String tranID, String xtraParams) throws RemoteException,ITMException, Exception
{
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
int cnt = 0;
ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB();
ConnDriver connDriver = new ConnDriver();
String sql = "";
String userId ="";
userId = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"loginCode");
java.sql.Timestamp currDate = null;
String returnString = null;
try
{
conn = connDriver.getConnectDB("DriverITM");
conn.setAutoCommit(false);
connDriver = null;
sql = "SELECT count(1) from ASSET_SHIFTDET"
+" where tran_id = ? ";
pstmt = conn.prepareStatement( sql );
pstmt.setString(1,tranID);
rs = pstmt.executeQuery();
if( rs.next() )
{
cnt = rs.getInt( 1 );
}
System.out.println(" COUNT =====> [" + cnt + "]");
if( cnt == 0 )
{
returnString = itmDBAccessEJB.getErrorString("","ASTNOTCONF",userId);
}
else
{
sql = " Update asset_shift set "
+ " confirmed = 'Y',"
+ " conf_date = ?"
+ " where tran_id = ? " ;
System.out.println("sql....."+sql);
pstmt = conn.prepareStatement(sql);
pstmt.setTimestamp(1,getCurrdateAppFormat() );
pstmt.setString(2,tranID);
pstmt.executeUpdate();
conn.commit();
returnString = itmDBAccessEJB.getErrorString("","CONFSUCC",userId);
}
}
catch(Exception e)
{
System.out.println("ConfirmAssetRegisterICEJB..."+e.getMessage());
e.printStackTrace();
try
{
conn.rollback();
}
catch(Exception e1)
{
System.out.println("ConfirmAssetRegisterICEJB..."+e1.getMessage());
e1.printStackTrace();
}
}
finally
{
try
{
conn.commit();
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(conn != null)
{
conn.close();
conn = null;
}
}
catch(Exception e)
{
System.out.println("Exception ConfirmAssetRegisterICEJB....... :\n"+e.getMessage());
}
}
System.out.println("retString ::"+returnString);
return returnString;
}
private Timestamp getCurrdateAppFormat()
{
String s = "";
Timestamp timestamp = null;
GenericUtility genericUtility = GenericUtility.getInstance();
try
{
java.util.Date date = null;
timestamp = new Timestamp(System.currentTimeMillis());
SimpleDateFormat simpledateformat = new SimpleDateFormat(genericUtility.getDBDateFormat());
date = simpledateformat.parse(timestamp.toString());
timestamp = Timestamp.valueOf(simpledateformat.format(date).toString() + " 00:00:00.0");
}
catch(Exception exception)
{
System.out.println("Exception in getCurrdateAppFormat " + exception.getMessage());
}
return timestamp;
}
}
package ibase.webitm.ejb.fin;
import java.rmi.RemoteException;
//import javax.ejb.EJBObject;
import ibase.webitm.utility.ITMException;
//import ibase.webitm.ejb.ActionHandler;
import javax.ejb.Local; // added for ejb3
import ibase.webitm.ejb.ActionHandlerLocal;// added for ejb3
@Local // added for ejb3
public interface ConfirmAssetRegisterICLocal extends ActionHandlerLocal
{
public String actionHandler() throws RemoteException,ITMException;
public String actionHandler(String xmlString, String xtraParams, String objContext) throws RemoteException,ITMException;
}
\ No newline at end of file
package ibase.webitm.ejb.fin;
import java.rmi.RemoteException;
//import javax.ejb.EJBObject;
import ibase.webitm.utility.ITMException;
//import ibase.webitm.ejb.ActionHandler;
import javax.ejb.Remote; // added for ejb3
import ibase.webitm.ejb.ActionHandlerRemote;// added for ejb3
@Remote // added for ejb3
public interface ConfirmAssetRegisterICRemote extends ActionHandlerRemote
{
public String actionHandler() throws RemoteException,ITMException;
public String actionHandler(String xmlString, String xtraParams, String objContext) throws RemoteException,ITMException;
}
\ No newline at end of file
package ibase.webitm.ejb.fin;
import java.rmi.RemoteException;
import java.util.*;
import java.sql.*;
import java.text.SimpleDateFormat;
import org.w3c.dom.*;
import javax.ejb.*;
import javax.naming.InitialContext;
import ibase.system.config.*;
import ibase.webitm.utility.ITMException;
import ibase.webitm.ejb.*;
import ibase.webitm.utility.GenericUtility;
import javax.ejb.Stateless;
@Stateless // added for ejb3
public class DefaultAssetRegisterIC extends ActionHandlerEJB implements DefaultAssetRegisterICRemote,DefaultAssetRegisterICLocal
{
/* public void ejbCreate() throws RemoteException, CreateException {}
public void ejbRemove(){}
public void ejbActivate(){}
public void ejbPassivate(){} */
public String actionHandler() throws RemoteException,ITMException{return "";}
public String actionHandler(String actionType, String xmlString, String objContext, String xtraParams) throws RemoteException,ITMException
{
String retString = "";
Document dom = null;
try
{
GenericUtility genericUtility = GenericUtility.getInstance();
if(xmlString != null && xmlString.trim().length()!=0)
{
System.out.println("XML String :"+xmlString);
dom = genericUtility.parseString(xmlString);
}
}
catch(Exception e)
{
System.out.println("Exception :DefaultAssetRegisterICEJB :actionHandler(String xmlString):" + e.getMessage() + ":");
throw new ITMException(e);
}
return retString;
}
public String actionHandler(String actionType, String xmlString, String xmlString1, String objContext, String xtraParams) throws RemoteException,ITMException
{
Connection conn=null;
GenericUtility genericUtility = GenericUtility.getInstance();
Document dom = null;
Document dom1 = null;
String retString = null;
try
{
if(xmlString != null && xmlString.trim().length()!=0)
{
System.out.println("XML String:::"+xmlString);
dom = GenericUtility.getInstance().parseString(xmlString);
}
if(xmlString1 != null && xmlString1.trim().length()!=0)
{
System.out.println("XML String1:::"+xmlString1);
dom1 = GenericUtility.getInstance().parseString(xmlString1);
}
if (actionType.equalsIgnoreCase("Default"))
{
try
{
if(conn==null)
{
ConnDriver connDriver = new ConnDriver();
conn = connDriver.getConnectDB("DriverITM");
conn.setAutoCommit(false);
DatabaseMetaData dbmd = conn.getMetaData();
System.out.println("DriverName["+dbmd.getDriverName() );
System.out.println("DriverURI["+dbmd.getURL() );
System.out.println("DriverUSER["+dbmd.getUserName());
//System.out.println("ApplDateFormat["+genericUtility. ());
System.out.println("DBDateFormat["+genericUtility.getDBDateFormat() );
connDriver = null;
}
}
catch (Exception e)
{
e.printStackTrace();
}
retString = actionDefault(dom, dom1, objContext, xtraParams);
}
}
catch(Exception e)
{
System.out.println("Exception :Dispatch :actionHandler(String xmlString):" + e.getMessage() + ":");
e.printStackTrace();
throw new ITMException(e);
}
System.out.println("returning String from DefaultAssetRegisterICEJB : actionHandler"+retString);
return retString;
}
private String actionDefault(Document dom, Document dom1, String objContext, String xtraParams) throws RemoteException, ITMException
{
GenericUtility genericUtility = GenericUtility.getInstance();
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
StringBuffer valueXmlString = null;
valueXmlString = new StringBuffer("<?xml version=\"1.0\"?>\r\n<Root>\r\n");
int currentFormNo = 0;
String sql1 = "";
String itemserhdr = null;
String sitecodehdr = null;
String assetcode = null;
String assetdescr = null;
String itemcode = null;
String itemdescr = null;
try
{
if(conn==null)
{
ConnDriver connDriver = new ConnDriver();
conn = connDriver.getConnectDB("DriverITM");
connDriver=null;
}
if(objContext != null && objContext.trim().length()>0)
{
currentFormNo = Integer.parseInt(objContext);
}
itemserhdr = genericUtility.getColumnValue( "item_grp", dom1 );
sitecodehdr = genericUtility.getColumnValue( "site_code", dom1 );
sql1 = "select ar.asset_code, ar.descr , ar.item_code, m.descr "
+" from asset_register ar, item m"
+" where ar.item_code = m.item_code"
+" and ar.item_ser = '"+itemserhdr+"'"
+" and ar.site_code = '"+sitecodehdr+"'";
System.out.println("sql1 is :"+sql1);
pstmt = conn.prepareStatement(sql1);
rs = pstmt.executeQuery();
while (rs.next())
{
assetcode = rs.getString(1) == null ? "" :rs.getString(1);
assetdescr = rs.getString(2) == null ? "" :rs.getString(2);
itemcode = rs.getString(3) == null ? "" :rs.getString(3);
itemdescr = rs.getString(4) == null ? "" :rs.getString(4);
valueXmlString.append("<Detail>\r\n");
valueXmlString.append("<asset_code>").append("<![CDATA[").append(assetcode).append("]]>").append("</asset_code>\r\n");
valueXmlString.append("<descr>").append("<![CDATA[").append(assetdescr).append("]]>").append("</descr>\r\n");
valueXmlString.append("<item_code>").append("<![CDATA[").append(itemcode).append("]]>").append("</item_code>\r\n");
valueXmlString.append("<descr_item>").append("<![CDATA[").append(itemdescr).append("]]>").append("</descr_item>\r\n");
valueXmlString.append("</Detail>\r\n");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
valueXmlString.append("</Root>\r\n");
}
catch(SQLException sqx)
{
System.out.println("The Exception caught from DefaultAssetRegisterICEJB :"+sqx);
throw new ITMException(sqx);
}
catch(Exception e)
{
System.out.println("The Exception caught from DefaultAssetRegisterICEJB :"+e);
throw new ITMException(e);
}
finally
{
try
{
conn.close();
conn = null;
}catch(Exception e){}
}
System.out.println("valueXmlString.toString() :"+valueXmlString.toString());
return valueXmlString.toString();
}
public String actionHandlerTransform(String actionType, String xmlString,
String xmlString1, String objContext, String xtraParams,
String selDataStr) throws RemoteException, ITMException
{
Document dom = null;
Document dom1 = null;
Document selDataDom = null;
String retString = null;
try
{
if (xmlString != null && xmlString.trim().length() != 0) {
dom = GenericUtility.getInstance().parseString(xmlString);
}
if (xmlString1 != null && xmlString1.trim().length() != 0)
{
dom1 = GenericUtility.getInstance().parseString(xmlString1);
}
if(selDataStr != null && selDataStr.length() > 0)
{
selDataDom = GenericUtility.getInstance().parseString(selDataStr);
}
if (actionType.equalsIgnoreCase("Default"))
{
retString = makeTransform(dom, dom1, objContext, xtraParams,selDataDom);
}
}
catch (Exception e)
{
System.out.println("Exception :DefaultAssetRegisterICEJB :actionHandlerTransform(String xmlString):"
+ e.getMessage() + ":");
e.printStackTrace();
throw new ITMException(e);
}
System.out.println("returning String from DefaultAssetRegisterICEJB : actionHandlerTransform"
+ retString);
return retString;
}
private String makeTransform(Document dom, Document dom1, String objContext, String xtraParams, Document selDataDom)throws ITMException
{
StringBuffer valueXmlString = new StringBuffer("<?xml version=\"1.0\"?>\r\n<Root>\r\n");
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
Node currDetail = null, currDetail1 = null;
ConnDriver connDriver = new ConnDriver();
ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB();
GenericUtility genericUtility = GenericUtility.getInstance();
String astcode_trans = null;
String astdescr_trans = null;
String itmcode_trans = null;
String itmdescr_trans = null;
try
{
conn = connDriver.getConnectDB("DriverITM");
connDriver = null;
NodeList detailList = selDataDom.getElementsByTagName("Detail");
int noOfDetails = detailList.getLength();
for (int ctr = 0; ctr < noOfDetails; ctr++)
{
valueXmlString.append("<Detail>\r\n");
currDetail1 = detailList.item(ctr);
astcode_trans = genericUtility.getColumnValueFromNode("asset_code", currDetail1);
astdescr_trans = genericUtility.getColumnValueFromNode("descr", currDetail1);
itmcode_trans = genericUtility.getColumnValueFromNode("item_code", currDetail1);
itmdescr_trans = genericUtility.getColumnValueFromNode("descr_item", currDetail1);
valueXmlString.append("<asset_code>").append("<![CDATA[").append(astcode_trans).append("]]>").append("</asset_code>\r\n");
valueXmlString.append("<descr>").append("<![CDATA[").append(astdescr_trans).append("]]>").append("</descr>\r\n");
valueXmlString.append("</Detail>");
//valueXmlString.append("<item_code>").append("<![CDATA[").append(itmcode_trans).append("]]>").append("</item_code>\r\n");
//valueXmlString.append("<descr>").append("<![CDATA[").append(itmdescr_trans).append("]]>").append("</descr>\r\n");
}// for end
valueXmlString.append("</Root>");
}// end try
catch (ITMException itme) {
itme.printStackTrace();
throw itme;
} catch (Exception e) {
e.printStackTrace();
throw new ITMException(e);
} finally {
try {
conn.close();
conn = null;
} catch (Exception e) {
}
}
System.out.println("valueXmlString from :" + valueXmlString.toString());
return valueXmlString.toString();
}
}//end of Ejb
\ No newline at end of file
package ibase.webitm.ejb.fin;
import java.rmi.RemoteException;
//import javax.ejb.EJBObject;
import ibase.webitm.utility.ITMException;
//import ibase.webitm.ejb.ActionHandler;
import ibase.webitm.ejb.ActionHandlerLocal;// added for ejb3
import javax.ejb.Local; // added for ejb3
@Local // added for ejb3
public interface DefaultAssetRegisterICLocal extends ActionHandlerLocal
{
public String actionHandler() throws RemoteException,ITMException;
public String actionHandler(String actionType, String xmlString, String objContext, String xtraParams) throws RemoteException,ITMException;
public String actionHandler(String actionType, String xmlString, String xmlString1, String objContext, String xtraParams) throws RemoteException,ITMException;
}
\ No newline at end of file
package ibase.webitm.ejb.fin;
import java.rmi.RemoteException;
//import javax.ejb.EJBObject;
import ibase.webitm.utility.ITMException;
//import ibase.webitm.ejb.ActionHandler;
import javax.ejb.Remote; // added for ejb3
import ibase.webitm.ejb.ActionHandlerRemote;// added for ejb3
@Remote // added for ejb3
public interface DefaultAssetRegisterICRemote extends ActionHandlerRemote
{
public String actionHandler() throws RemoteException,ITMException;
public String actionHandler(String actionType, String xmlString, String objContext, String xtraParams) throws RemoteException,ITMException;
public String actionHandler(String actionType, String xmlString, String xmlString1, String objContext, String xtraParams) throws RemoteException,ITMException;
}
\ 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