Stabilizing 2Pack - small enhancements and bug fixing

This commit is contained in:
Carlos Ruiz 2006-12-19 05:12:35 +00:00
parent 3decb26d2d
commit b502de9fa5
1 changed files with 141 additions and 136 deletions

View File

@ -356,6 +356,7 @@ public class IntPackInHandler extends DefaultHandler {
if (atts.getValue("clientname") != null) { if (atts.getValue("clientname") != null) {
m_AD_Client_ID = get_ID("AD_Client", atts.getValue("clientname")); m_AD_Client_ID = get_ID("AD_Client", atts.getValue("clientname"));
Env.setContext(Env.getCtx(), "AD_Client_ID", m_AD_Client_ID); Env.setContext(Env.getCtx(), "AD_Client_ID", m_AD_Client_ID);
log.info("adempieredata: client set to "+m_AD_Client_ID+" "+atts.getValue("clientname"));
} }
} }
else if (elementValue.equals("menu")) { else if (elementValue.equals("menu")) {
@ -2099,11 +2100,11 @@ log.info("After Column Name ->"+colname); }
try { try {
if(DBType.equals("ALL")){ if(DBType.equals("ALL")){
int n = pstmt.executeUpdate(); int n = pstmt.executeUpdate();
log.info("Exceuted SQL Statement"); log.info("Executed SQL Statement: "+ atts.getValue("statement"));
} }
else if(DB.isOracle() == true & DBType.equals("Oracle")){ else if(DB.isOracle() == true & DBType.equals("Oracle")){
pstmt.executeUpdate(); pstmt.executeUpdate();
log.info("Exceuted SQL Statement for Oracle"); log.info("Executed SQL Statement for Oracle: "+ atts.getValue("statement"));
} }
/* else if(DB.isSybase() == true & DBType.equals("Sybase")){ /* else if(DB.isSybase() == true & DBType.equals("Sybase")){
pstmt.executeUpdate(); pstmt.executeUpdate();
@ -2385,9 +2386,12 @@ log.info("After Column Name ->"+colname); }
log.info(d_tablename+" column: "+poInfo.getColumnName(i)); log.info(d_tablename+" column: "+poInfo.getColumnName(i));
} }
} }
// globalqss: set AD_Client_ID to the client setted in adempieredata
if (m_AD_Client_ID > 0)
genericPO.setValue("AD_Client_ID", m_AD_Client_ID);
// if new. TODO: no defaults for keyXname. // if new. TODO: no defaults for keyXname.
if (!d_rowname.equals("") && ((Integer)(genericPO.get_Value(d_tablename+"_ID"))).intValue() == 0) { if (!d_rowname.equals("") && ((Integer)(genericPO.get_Value(d_tablename+"_ID"))).intValue() == 0) {
log.info("new genericPO, name:"+d_rowname); log.info("new genericPO, table: "+d_tablename+" name:"+d_rowname);
genericPO.setValue("Name", d_rowname); genericPO.setValue("Name", d_rowname);
// Set defaults. // Set defaults.
HashMap thisDefault = (HashMap)defaults.get(d_tablename); HashMap thisDefault = (HashMap)defaults.get(d_tablename);
@ -2454,6 +2458,7 @@ log.info("After Column Name ->"+colname); }
} }
} }
} // startElement } // startElement
/** /**
* Get ID from Name for a table. * Get ID from Name for a table.
* TODO: substitute with PO.getAllIDs * TODO: substitute with PO.getAllIDs