Implement [2556068] - 2Pack Export Import Official Dictionary

https://sourceforge.net/tracker/index.php?func=detail&aid=2556068&group_id=176962&atid=879335
This commit is contained in:
Carlos Ruiz 2009-06-10 16:42:12 +00:00
parent 5956d91f98
commit e3d910e4a0
32 changed files with 147 additions and 3 deletions

View File

@ -82,9 +82,12 @@ public class AttributeFiller {
}else if(value instanceof Boolean) { }else if(value instanceof Boolean) {
atts.addAttribute("", "", columnName, "CDATA", (Boolean)value == true ? "true" : "false"); atts.addAttribute("", "", columnName, "CDATA", (Boolean)value == true ? "true" : "false");
}else if(value instanceof Integer) {
atts.addAttribute("", "", columnName, "CDATA", value.toString());
}else{ }else{
throw new IllegalArgumentException("Add you own type implemantation here."); throw new IllegalArgumentException("Add your own type implementation here.");
} }
} }

View File

@ -93,6 +93,8 @@ public class PackOut extends SvrProcess
private String packagename = null; private String packagename = null;
private String includesdir = null; private String includesdir = null;
public final static int MAX_OFFICIAL_ID = 999999;
private Properties localContext = null; private Properties localContext = null;
ProcessElementHandler processHandler = new ProcessElementHandler(); ProcessElementHandler processHandler = new ProcessElementHandler();

View File

@ -59,6 +59,8 @@ public class AdElementHandler extends AbstractElementHandler {
X_AD_Element m_AdElement = new X_AD_Element(ctx, id, X_AD_Element m_AdElement = new X_AD_Element(ctx, id,
getTrxName(ctx)); getTrxName(ctx));
if (id <= 0 && atts.getValue("AD_Element_ID") != null && Integer.parseInt(atts.getValue("AD_Element_ID")) <= PackOut.MAX_OFFICIAL_ID)
m_AdElement.setAD_Element_ID(Integer.parseInt(atts.getValue("AD_Element_ID")));
if (id > 0) { if (id > 0) {
AD_Backup_ID = copyRecord(ctx, AD_ELEMENT, m_AdElement); AD_Backup_ID = copyRecord(ctx, AD_ELEMENT, m_AdElement);
Object_Status = "Update"; Object_Status = "Update";
@ -145,6 +147,8 @@ public class AdElementHandler extends AbstractElementHandler {
X_AD_Element m_AdElement) { X_AD_Element m_AdElement) {
AttributeFiller filler = new AttributeFiller(atts, m_AdElement); AttributeFiller filler = new AttributeFiller(atts, m_AdElement);
if (m_AdElement.getAD_Element_ID() <= PackOut.MAX_OFFICIAL_ID)
filler.add(X_AD_Element.COLUMNNAME_AD_Element_ID);
filler.add("IsActive"); filler.add("IsActive");

View File

@ -29,6 +29,7 @@ import javax.xml.transform.sax.TransformerHandler;
import org.adempiere.pipo.AbstractElementHandler; import org.adempiere.pipo.AbstractElementHandler;
import org.adempiere.pipo.Element; import org.adempiere.pipo.Element;
import org.adempiere.pipo.PackIn; import org.adempiere.pipo.PackIn;
import org.adempiere.pipo.PackOut;
import org.adempiere.pipo.exception.DatabaseAccessException; import org.adempiere.pipo.exception.DatabaseAccessException;
import org.adempiere.pipo.exception.POSaveFailedException; import org.adempiere.pipo.exception.POSaveFailedException;
import org.compiere.model.MColumn; import org.compiere.model.MColumn;
@ -82,6 +83,8 @@ public class ColumnElementHandler extends AbstractElementHandler {
} }
} }
MColumn m_Column = new MColumn(ctx, id, getTrxName(ctx)); MColumn m_Column = new MColumn(ctx, id, getTrxName(ctx));
if (id <= 0 && atts.getValue("AD_Column_ID") != null && Integer.parseInt(atts.getValue("AD_Column_ID")) <= PackOut.MAX_OFFICIAL_ID)
m_Column.setAD_Column_ID(Integer.parseInt(atts.getValue("AD_Column_ID")));
int AD_Backup_ID = -1; int AD_Backup_ID = -1;
String Object_Status = null; String Object_Status = null;
if (id > 0) { if (id > 0) {
@ -397,6 +400,8 @@ public class ColumnElementHandler extends AbstractElementHandler {
String sql = null; String sql = null;
String name = null; String name = null;
atts.clear(); atts.clear();
if (m_Column.getAD_Column_ID() <= PackOut.MAX_OFFICIAL_ID)
atts.addAttribute("", "", "AD_Column_ID", "CDATA", Integer.toString(m_Column.getAD_Column_ID()));
if (m_Column.getAD_Column_ID() > 0) { if (m_Column.getAD_Column_ID() > 0) {
sql = "SELECT ColumnName FROM AD_Column WHERE AD_Column_ID=?"; sql = "SELECT ColumnName FROM AD_Column WHERE AD_Column_ID=?";
name = DB.getSQLValueString(null, sql, m_Column.getAD_Column_ID()); name = DB.getSQLValueString(null, sql, m_Column.getAD_Column_ID());

View File

@ -27,6 +27,7 @@ import javax.xml.transform.sax.TransformerHandler;
import org.adempiere.pipo.AbstractElementHandler; import org.adempiere.pipo.AbstractElementHandler;
import org.adempiere.pipo.Element; import org.adempiere.pipo.Element;
import org.adempiere.pipo.PackOut;
import org.adempiere.pipo.exception.POSaveFailedException; import org.adempiere.pipo.exception.POSaveFailedException;
import org.compiere.model.X_AD_Package_Exp_Detail; import org.compiere.model.X_AD_Package_Exp_Detail;
import org.compiere.model.X_AD_Val_Rule; import org.compiere.model.X_AD_Val_Rule;
@ -50,6 +51,8 @@ public class DynValRuleElementHandler extends AbstractElementHandler {
int id = get_IDWithColumn(ctx, "AD_Val_Rule", "name", name); int id = get_IDWithColumn(ctx, "AD_Val_Rule", "name", name);
X_AD_Val_Rule m_ValRule = new X_AD_Val_Rule(ctx, id, getTrxName(ctx)); X_AD_Val_Rule m_ValRule = new X_AD_Val_Rule(ctx, id, getTrxName(ctx));
if (id <= 0 && atts.getValue("AD_Val_Rule_ID") != null && Integer.parseInt(atts.getValue("AD_Val_Rule_ID")) <= PackOut.MAX_OFFICIAL_ID)
m_ValRule.setAD_Val_Rule_ID(Integer.parseInt(atts.getValue("AD_Val_Rule_ID")));
int AD_Backup_ID = -1; int AD_Backup_ID = -1;
String Object_Status = null; String Object_Status = null;
if (id > 0){ if (id > 0){
@ -121,6 +124,8 @@ public class DynValRuleElementHandler extends AbstractElementHandler {
private AttributesImpl createDynamicValidationRuleBinding( AttributesImpl atts, X_AD_Val_Rule m_ValRule) private AttributesImpl createDynamicValidationRuleBinding( AttributesImpl atts, X_AD_Val_Rule m_ValRule)
{ {
atts.clear(); atts.clear();
if (m_ValRule.getAD_Val_Rule_ID() <= PackOut.MAX_OFFICIAL_ID)
atts.addAttribute("","","AD_Val_Rule_ID","CDATA",Integer.toString(m_ValRule.getAD_Val_Rule_ID()));
atts.addAttribute("","","Name","CDATA",(m_ValRule.getName () != null ? m_ValRule.getName ():"")); atts.addAttribute("","","Name","CDATA",(m_ValRule.getName () != null ? m_ValRule.getName ():""));
//FIXME: may not need this I guess //FIXME: may not need this I guess
//atts.addAttribute("","","AccessLevel","CDATA",(m_ValRule.getAccessLevel () != null ? m_ValRule.getAccessLevel ():"")); //atts.addAttribute("","","AccessLevel","CDATA",(m_ValRule.getAccessLevel () != null ? m_ValRule.getAccessLevel ():""));

View File

@ -103,6 +103,8 @@ public class FieldElementHandler extends AbstractElementHandler {
int id = DB int id = DB
.getSQLValue(getTrxName(ctx), sqlB.toString(), tabid); .getSQLValue(getTrxName(ctx), sqlB.toString(), tabid);
MField m_Field = new MField(ctx, id, getTrxName(ctx)); MField m_Field = new MField(ctx, id, getTrxName(ctx));
if (id <= 0 && atts.getValue("AD_Field_ID") != null && Integer.parseInt(atts.getValue("AD_Field_ID")) <= PackOut.MAX_OFFICIAL_ID)
m_Field.setAD_Field_ID(Integer.parseInt(atts.getValue("AD_Field_ID")));
int AD_Backup_ID = -1; int AD_Backup_ID = -1;
String Object_Status = null; String Object_Status = null;
if (id > 0) { if (id > 0) {
@ -217,6 +219,8 @@ public class FieldElementHandler extends AbstractElementHandler {
String sql = null; String sql = null;
String name = null; String name = null;
atts.clear(); atts.clear();
if (m_Field.getAD_Field_ID() <= PackOut.MAX_OFFICIAL_ID)
atts.addAttribute("", "", "AD_Field_ID", "CDATA", Integer.toString(m_Field.getAD_Field_ID()));
if (m_Field.getAD_Column_ID() > 0) { if (m_Field.getAD_Column_ID() > 0) {
sql = "SELECT ColumnName FROM AD_Column WHERE AD_Column_ID=?"; sql = "SELECT ColumnName FROM AD_Column WHERE AD_Column_ID=?";
name = DB.getSQLValueString(null, sql, m_Field.getAD_Column_ID()); name = DB.getSQLValueString(null, sql, m_Field.getAD_Column_ID());

View File

@ -57,6 +57,8 @@ public class FieldGroupElementHandler extends AbstractElementHandler {
X_AD_FieldGroup fieldGroup = new X_AD_FieldGroup(ctx, id, X_AD_FieldGroup fieldGroup = new X_AD_FieldGroup(ctx, id,
getTrxName(ctx)); getTrxName(ctx));
if (id <= 0 && atts.getValue("AD_FieldGroup_ID") != null && Integer.parseInt(atts.getValue("AD_FieldGroup_ID")) <= PackOut.MAX_OFFICIAL_ID)
fieldGroup.setAD_FieldGroup_ID(Integer.parseInt(atts.getValue("AD_FieldGroup_ID")));
if (id > 0) { if (id > 0) {
AD_Backup_ID = copyRecord(ctx, X_AD_FieldGroup.Table_Name, fieldGroup); AD_Backup_ID = copyRecord(ctx, X_AD_FieldGroup.Table_Name, fieldGroup);
Object_Status = "Update"; Object_Status = "Update";
@ -134,6 +136,8 @@ public class FieldGroupElementHandler extends AbstractElementHandler {
X_AD_FieldGroup fieldGroup) { X_AD_FieldGroup fieldGroup) {
AttributeFiller filler = new AttributeFiller(atts, fieldGroup); AttributeFiller filler = new AttributeFiller(atts, fieldGroup);
if (fieldGroup.getAD_FieldGroup_ID() <= PackOut.MAX_OFFICIAL_ID)
filler.add(X_AD_FieldGroup.COLUMNNAME_AD_FieldGroup_ID);
filler.add("IsActive"); filler.add("IsActive");

View File

@ -24,6 +24,7 @@ import javax.xml.transform.sax.TransformerHandler;
import org.adempiere.pipo.AbstractElementHandler; import org.adempiere.pipo.AbstractElementHandler;
import org.adempiere.pipo.Element; import org.adempiere.pipo.Element;
import org.adempiere.pipo.PackOut;
import org.adempiere.pipo.exception.POSaveFailedException; import org.adempiere.pipo.exception.POSaveFailedException;
import org.compiere.model.MForm; import org.compiere.model.MForm;
import org.compiere.model.X_AD_Form; import org.compiere.model.X_AD_Form;
@ -49,6 +50,8 @@ public class FormElementHandler extends AbstractElementHandler {
MForm m_Form = new MForm(ctx, id, getTrxName(ctx)); MForm m_Form = new MForm(ctx, id, getTrxName(ctx));
int AD_Backup_ID = -1; int AD_Backup_ID = -1;
String Object_Status = null; String Object_Status = null;
if (id <= 0 && atts.getValue("AD_Form_ID") != null && Integer.parseInt(atts.getValue("AD_Form_ID")) <= PackOut.MAX_OFFICIAL_ID)
m_Form.setAD_Form_ID(Integer.parseInt(atts.getValue("AD_Form_ID")));
if (id > 0){ if (id > 0){
AD_Backup_ID = copyRecord(ctx, "AD_Form",m_Form); AD_Backup_ID = copyRecord(ctx, "AD_Form",m_Form);
Object_Status = "Update"; Object_Status = "Update";
@ -109,6 +112,8 @@ public class FormElementHandler extends AbstractElementHandler {
} else { } else {
atts.addAttribute("","","ADFormNameID","CDATA",""); atts.addAttribute("","","ADFormNameID","CDATA","");
} }
if (m_Form.getAD_Form_ID() <= PackOut.MAX_OFFICIAL_ID)
atts.addAttribute("","","AD_Form_ID","CDATA",Integer.toString(m_Form.getAD_Form_ID()));
atts.addAttribute("","","Classname","CDATA",(m_Form.getClassname () != null ? m_Form.getClassname ():"")); atts.addAttribute("","","Classname","CDATA",(m_Form.getClassname () != null ? m_Form.getClassname ():""));
atts.addAttribute("","","isBetaFunctionality","CDATA",(m_Form.isBetaFunctionality()== true ? "true":"false")); atts.addAttribute("","","isBetaFunctionality","CDATA",(m_Form.isBetaFunctionality()== true ? "true":"false"));

View File

@ -27,6 +27,7 @@ import javax.xml.transform.sax.TransformerHandler;
import org.adempiere.pipo.AbstractElementHandler; import org.adempiere.pipo.AbstractElementHandler;
import org.adempiere.pipo.Element; import org.adempiere.pipo.Element;
import org.adempiere.pipo.PackOut;
import org.adempiere.pipo.exception.DatabaseAccessException; import org.adempiere.pipo.exception.DatabaseAccessException;
import org.adempiere.pipo.exception.POSaveFailedException; import org.adempiere.pipo.exception.POSaveFailedException;
import org.compiere.model.X_AD_ImpFormat; import org.compiere.model.X_AD_ImpFormat;
@ -55,6 +56,8 @@ public class ImpFormatElementHandler extends AbstractElementHandler {
int id = get_ID(ctx, "AD_ImpFormat", atts.getValue("Name")); int id = get_ID(ctx, "AD_ImpFormat", atts.getValue("Name"));
X_AD_ImpFormat m_ImpFormat = new X_AD_ImpFormat(ctx, id, X_AD_ImpFormat m_ImpFormat = new X_AD_ImpFormat(ctx, id,
getTrxName(ctx)); getTrxName(ctx));
if (id <= 0 && atts.getValue("AD_ImpFormat_ID") != null && Integer.parseInt(atts.getValue("AD_ImpFormat_ID")) <= PackOut.MAX_OFFICIAL_ID)
m_ImpFormat.setAD_ImpFormat_ID(Integer.parseInt(atts.getValue("AD_ImpFormat_ID")));
if (id > 0) { if (id > 0) {
AD_Backup_ID = copyRecord(ctx, "AD_ImpFormat", m_ImpFormat); AD_Backup_ID = copyRecord(ctx, "AD_ImpFormat", m_ImpFormat);
Object_Status = "Update"; Object_Status = "Update";
@ -154,6 +157,8 @@ public class ImpFormatElementHandler extends AbstractElementHandler {
private AttributesImpl createImpFormatBinding(AttributesImpl atts, private AttributesImpl createImpFormatBinding(AttributesImpl atts,
X_AD_ImpFormat m_ImpFormat) { X_AD_ImpFormat m_ImpFormat) {
atts.clear(); atts.clear();
if (m_ImpFormat.getAD_ImpFormat_ID() <= PackOut.MAX_OFFICIAL_ID)
atts.addAttribute("","","AD_ImpFormat_ID","CDATA",Integer.toString(m_ImpFormat.getAD_ImpFormat_ID()));
if (m_ImpFormat.getAD_Table_ID() > 0) { if (m_ImpFormat.getAD_Table_ID() > 0) {
String sql = "SELECT TableName FROM AD_Table WHERE AD_Table_ID=?"; String sql = "SELECT TableName FROM AD_Table WHERE AD_Table_ID=?";
String name = DB.getSQLValueString(null, sql, m_ImpFormat String name = DB.getSQLValueString(null, sql, m_ImpFormat

View File

@ -22,6 +22,7 @@ import javax.xml.transform.sax.TransformerHandler;
import org.adempiere.pipo.AbstractElementHandler; import org.adempiere.pipo.AbstractElementHandler;
import org.adempiere.pipo.Element; import org.adempiere.pipo.Element;
import org.adempiere.pipo.PackOut;
import org.adempiere.pipo.exception.POSaveFailedException; import org.adempiere.pipo.exception.POSaveFailedException;
import org.compiere.model.X_AD_ImpFormat_Row; import org.compiere.model.X_AD_ImpFormat_Row;
import org.compiere.util.DB; import org.compiere.util.DB;
@ -69,6 +70,8 @@ public class ImpFormatRowElementHandler extends AbstractElementHandler {
StringBuffer sqlB = new StringBuffer ("SELECT AD_ImpFormat_Row_ID FROM AD_ImpFormat_Row WHERE AD_Column_ID=? and AD_ImpFormat_ID=?"); StringBuffer sqlB = new StringBuffer ("SELECT AD_ImpFormat_Row_ID FROM AD_ImpFormat_Row WHERE AD_Column_ID=? and AD_ImpFormat_ID=?");
int id = DB.getSQLValue(getTrxName(ctx),sqlB.toString(),columnid,impformid); int id = DB.getSQLValue(getTrxName(ctx),sqlB.toString(),columnid,impformid);
X_AD_ImpFormat_Row m_ImpFormat_row = new X_AD_ImpFormat_Row(ctx, id, getTrxName(ctx)); X_AD_ImpFormat_Row m_ImpFormat_row = new X_AD_ImpFormat_Row(ctx, id, getTrxName(ctx));
if (id <= 0 && atts.getValue("AD_ImpFormat_Row_ID") != null && Integer.parseInt(atts.getValue("AD_ImpFormat_Row_ID")) <= PackOut.MAX_OFFICIAL_ID)
m_ImpFormat_row.setAD_ImpFormat_Row_ID(Integer.parseInt(atts.getValue("AD_ImpFormat_Row_ID")));
if (id > 0){ if (id > 0){
AD_Backup_ID = copyRecord(ctx, "AD_ImpFormat",m_ImpFormat_row); AD_Backup_ID = copyRecord(ctx, "AD_ImpFormat",m_ImpFormat_row);
Object_Status = "Update"; Object_Status = "Update";
@ -144,6 +147,8 @@ public class ImpFormatRowElementHandler extends AbstractElementHandler {
} }
else else
atts.addAttribute("","","ADTableNameID","CDATA",""); atts.addAttribute("","","ADTableNameID","CDATA","");
if (m_ImpFormat_Row.getAD_ImpFormat_Row_ID() <= PackOut.MAX_OFFICIAL_ID)
atts.addAttribute("","","AD_ImpFormat_Row_ID","CDATA",Integer.toString(m_ImpFormat_Row.getAD_ImpFormat_Row_ID()));
atts.addAttribute("","","Name","CDATA",(m_ImpFormat_Row.getName () != null ? m_ImpFormat_Row.getName ():"")); atts.addAttribute("","","Name","CDATA",(m_ImpFormat_Row.getName () != null ? m_ImpFormat_Row.getName ():""));
atts.addAttribute("","","SeqNo","CDATA",""+m_ImpFormat_Row.getSeqNo()); atts.addAttribute("","","SeqNo","CDATA",""+m_ImpFormat_Row.getSeqNo());

View File

@ -54,6 +54,8 @@ public class MenuElementHandler extends AbstractElementHandler {
name = atts.getValue("ADMenuNameID"); name = atts.getValue("ADMenuNameID");
int menuid = get_IDWithColumn(ctx, "AD_Menu", "Name", name); int menuid = get_IDWithColumn(ctx, "AD_Menu", "Name", name);
X_AD_Menu m_Menu = new X_AD_Menu(ctx, menuid, getTrxName(ctx)); X_AD_Menu m_Menu = new X_AD_Menu(ctx, menuid, getTrxName(ctx));
if (menuid <= 0 && atts.getValue("AD_Menu_ID") != null && Integer.parseInt(atts.getValue("AD_Menu_ID")) <= PackOut.MAX_OFFICIAL_ID)
m_Menu.setAD_Menu_ID(Integer.parseInt(atts.getValue("AD_Menu_ID")));
if (menuid > 0) { if (menuid > 0) {
AD_Backup_ID = copyRecord(ctx, "AD_Menu", m_Menu); AD_Backup_ID = copyRecord(ctx, "AD_Menu", m_Menu);
Object_Status = "Update"; Object_Status = "Update";
@ -335,6 +337,8 @@ public class MenuElementHandler extends AbstractElementHandler {
} }
sql = "SELECT SeqNo FROM AD_TreeNoDemm WHERE AD_Tree_ID = 10 and Node_ID=?"; sql = "SELECT SeqNo FROM AD_TreeNoDemm WHERE AD_Tree_ID = 10 and Node_ID=?";
id = DB.getSQLValue(null, sql, m_Menu.getAD_Menu_ID()); id = DB.getSQLValue(null, sql, m_Menu.getAD_Menu_ID());
if (m_Menu.getAD_Menu_ID() <= PackOut.MAX_OFFICIAL_ID)
atts.addAttribute("","","AD_Menu_ID","CDATA",Integer.toString(m_Menu.getAD_Menu_ID()));
atts.addAttribute("", "", "ADParentSeqno", "CDATA", "" + id); atts.addAttribute("", "", "ADParentSeqno", "CDATA", "" + id);
atts.addAttribute("", "", "Action", "CDATA", atts.addAttribute("", "", "Action", "CDATA",
(m_Menu.getAction() != null ? m_Menu.getAction() : "")); (m_Menu.getAction() != null ? m_Menu.getAction() : ""));

View File

@ -27,6 +27,7 @@ import javax.xml.transform.sax.TransformerHandler;
import org.adempiere.pipo.AbstractElementHandler; import org.adempiere.pipo.AbstractElementHandler;
import org.adempiere.pipo.Element; import org.adempiere.pipo.Element;
import org.adempiere.pipo.PackOut;
import org.adempiere.pipo.exception.POSaveFailedException; import org.adempiere.pipo.exception.POSaveFailedException;
import org.compiere.model.MMessage; import org.compiere.model.MMessage;
import org.compiere.model.X_AD_Message; import org.compiere.model.X_AD_Message;
@ -53,6 +54,8 @@ public class MessageElementHandler extends AbstractElementHandler {
MMessage m_Message = new MMessage(ctx, id, getTrxName(ctx)); MMessage m_Message = new MMessage(ctx, id, getTrxName(ctx));
int AD_Backup_ID = -1; int AD_Backup_ID = -1;
String Object_Status = null; String Object_Status = null;
if (id <= 0 && atts.getValue("AD_Message_ID") != null && Integer.parseInt(atts.getValue("AD_Message_ID")) <= PackOut.MAX_OFFICIAL_ID)
m_Message.setAD_Message_ID(Integer.parseInt(atts.getValue("AD_Message_ID")));
if (id > 0){ if (id > 0){
AD_Backup_ID = copyRecord(ctx, "AD_Message",m_Message); AD_Backup_ID = copyRecord(ctx, "AD_Message",m_Message);
Object_Status = "Update"; Object_Status = "Update";
@ -121,6 +124,8 @@ public class MessageElementHandler extends AbstractElementHandler {
private AttributesImpl createMessageBinding( AttributesImpl atts, X_AD_Message m_Message) private AttributesImpl createMessageBinding( AttributesImpl atts, X_AD_Message m_Message)
{ {
atts.clear(); atts.clear();
if (m_Message.getAD_Message_ID() <= PackOut.MAX_OFFICIAL_ID)
atts.addAttribute("","","AD_Message_ID","CDATA",Integer.toString(m_Message.getAD_Message_ID()));
//FIXME: may not need this I guess //FIXME: may not need this I guess
//atts.addAttribute("","","AccessLevel","CDATA",(m_Message.getAccessLevel () != null ? m_Message.getAccessLevel ():"")); //atts.addAttribute("","","AccessLevel","CDATA",(m_Message.getAccessLevel () != null ? m_Message.getAccessLevel ():""));
atts.addAttribute("","","MsgText","CDATA",(m_Message.getMsgText() != null ? m_Message.getMsgText():"")); atts.addAttribute("","","MsgText","CDATA",(m_Message.getMsgText() != null ? m_Message.getMsgText():""));

View File

@ -22,6 +22,7 @@ import javax.xml.transform.sax.TransformerHandler;
import org.adempiere.pipo.AbstractElementHandler; import org.adempiere.pipo.AbstractElementHandler;
import org.adempiere.pipo.Element; import org.adempiere.pipo.Element;
import org.adempiere.pipo.PackOut;
import org.adempiere.pipo.exception.POSaveFailedException; import org.adempiere.pipo.exception.POSaveFailedException;
import org.compiere.model.MPreference; import org.compiere.model.MPreference;
import org.compiere.model.X_AD_Preference; import org.compiere.model.X_AD_Preference;
@ -54,6 +55,8 @@ public class PreferenceElementHandler extends AbstractElementHandler {
MPreference m_Preference = new MPreference(ctx, id, getTrxName(ctx)); MPreference m_Preference = new MPreference(ctx, id, getTrxName(ctx));
int AD_Backup_ID = -1; int AD_Backup_ID = -1;
String Object_Status = null; String Object_Status = null;
if (id <= 0 && atts.getValue("AD_Preference_ID") != null && Integer.parseInt(atts.getValue("AD_Preference_ID")) <= PackOut.MAX_OFFICIAL_ID)
m_Preference.setAD_Preference_ID(Integer.parseInt(atts.getValue("AD_Preference_ID")));
if (id > 0) { if (id > 0) {
AD_Backup_ID = copyRecord(ctx, "AD_Preference", m_Preference); AD_Backup_ID = copyRecord(ctx, "AD_Preference", m_Preference);
Object_Status = "Update"; Object_Status = "Update";
@ -99,6 +102,8 @@ public class PreferenceElementHandler extends AbstractElementHandler {
String sql = null; String sql = null;
String name = null; String name = null;
atts.clear(); atts.clear();
if (m_Preference.getAD_Preference_ID() <= PackOut.MAX_OFFICIAL_ID)
atts.addAttribute("","","AD_Preference_ID","CDATA",Integer.toString(m_Preference.getAD_Preference_ID()));
sql = "SELECT Name FROM AD_Window WHERE AD_Window_ID=?"; sql = "SELECT Name FROM AD_Window WHERE AD_Window_ID=?";
name = DB.getSQLValueString(null, sql, m_Preference.getAD_Window_ID()); name = DB.getSQLValueString(null, sql, m_Preference.getAD_Window_ID());
atts.addAttribute("", "", "ADWindowNameID", "CDATA", name); atts.addAttribute("", "", "ADWindowNameID", "CDATA", name);

View File

@ -29,6 +29,7 @@ import javax.xml.transform.sax.TransformerHandler;
import org.adempiere.pipo.AbstractElementHandler; import org.adempiere.pipo.AbstractElementHandler;
import org.adempiere.pipo.Element; import org.adempiere.pipo.Element;
import org.adempiere.pipo.PackOut;
import org.adempiere.pipo.exception.DatabaseAccessException; import org.adempiere.pipo.exception.DatabaseAccessException;
import org.adempiere.pipo.exception.POSaveFailedException; import org.adempiere.pipo.exception.POSaveFailedException;
import org.compiere.model.MTable; import org.compiere.model.MTable;
@ -59,6 +60,8 @@ public class PrintFormatElementHandler extends AbstractElementHandler {
int id = get_IDWithColumn(ctx, "AD_PrintFormat", "Name", name); int id = get_IDWithColumn(ctx, "AD_PrintFormat", "Name", name);
X_AD_PrintFormat m_PrintFormat = new X_AD_PrintFormat(ctx, id, X_AD_PrintFormat m_PrintFormat = new X_AD_PrintFormat(ctx, id,
getTrxName(ctx)); getTrxName(ctx));
if (id <= 0 && atts.getValue("AD_PrintFormat_ID") != null && Integer.parseInt(atts.getValue("AD_PrintFormat_ID")) <= PackOut.MAX_OFFICIAL_ID)
m_PrintFormat.setAD_PrintFormat_ID(Integer.parseInt(atts.getValue("AD_PrintFormat_ID")));
if (id > 0) { if (id > 0) {
AD_Backup_ID = copyRecord(ctx, "AD_PrintFormat", m_PrintFormat); AD_Backup_ID = copyRecord(ctx, "AD_PrintFormat", m_PrintFormat);
Object_Status = "Update"; Object_Status = "Update";
@ -268,6 +271,8 @@ public class PrintFormatElementHandler extends AbstractElementHandler {
String sql = null; String sql = null;
String name = null; String name = null;
atts.clear(); atts.clear();
if (m_Printformat.getAD_PrintFormat_ID() <= PackOut.MAX_OFFICIAL_ID)
atts.addAttribute("","","AD_PrintFormat_ID","CDATA",Integer.toString(m_Printformat.getAD_PrintFormat_ID()));
if (m_Printformat.getAD_ReportView_ID() > 0) { if (m_Printformat.getAD_ReportView_ID() > 0) {
sql = "SELECT Name FROM AD_ReportView WHERE AD_ReportView_ID=?"; sql = "SELECT Name FROM AD_ReportView WHERE AD_ReportView_ID=?";
name = DB.getSQLValueString(null, sql, m_Printformat name = DB.getSQLValueString(null, sql, m_Printformat

View File

@ -23,6 +23,7 @@ import javax.xml.transform.sax.TransformerHandler;
import org.adempiere.pipo.AbstractElementHandler; import org.adempiere.pipo.AbstractElementHandler;
import org.adempiere.pipo.Element; import org.adempiere.pipo.Element;
import org.adempiere.pipo.PackOut;
import org.adempiere.pipo.exception.POSaveFailedException; import org.adempiere.pipo.exception.POSaveFailedException;
import org.compiere.model.X_AD_PrintFormatItem; import org.compiere.model.X_AD_PrintFormatItem;
import org.compiere.util.DB; import org.compiere.util.DB;
@ -52,6 +53,8 @@ public class PrintFormatItemElementHandler extends AbstractElementHandler {
X_AD_PrintFormatItem m_PrintFormatItem = new X_AD_PrintFormatItem(ctx, X_AD_PrintFormatItem m_PrintFormatItem = new X_AD_PrintFormatItem(ctx,
id, getTrxName(ctx)); id, getTrxName(ctx));
if (id <= 0 && atts.getValue("AD_PrintFormatItem_ID") != null && Integer.parseInt(atts.getValue("AD_PrintFormatItem_ID")) <= PackOut.MAX_OFFICIAL_ID)
m_PrintFormatItem.setAD_PrintFormatItem_ID(Integer.parseInt(atts.getValue("AD_PrintFormatItem_ID")));
if (id > 0) { if (id > 0) {
AD_Backup_ID = copyRecord(ctx, "AD_PrintFormatItem", AD_Backup_ID = copyRecord(ctx, "AD_PrintFormatItem",
m_PrintFormatItem); m_PrintFormatItem);
@ -261,6 +264,8 @@ public class PrintFormatItemElementHandler extends AbstractElementHandler {
String sql = null; String sql = null;
String name = null; String name = null;
atts.clear(); atts.clear();
if (m_PrintformatItem.getAD_PrintFormatItem_ID() <= PackOut.MAX_OFFICIAL_ID)
atts.addAttribute("","","AD_PrintFormatItem_ID","CDATA",Integer.toString(m_PrintformatItem.getAD_PrintFormatItem_ID()));
if (m_PrintformatItem.getAD_PrintFormat_ID() > 0) { if (m_PrintformatItem.getAD_PrintFormat_ID() > 0) {
sql = "SELECT Name FROM AD_PrintFormat WHERE AD_PrintFormat_ID=?"; sql = "SELECT Name FROM AD_PrintFormat WHERE AD_PrintFormat_ID=?";
name = DB.getSQLValueString(null, sql, m_PrintformatItem name = DB.getSQLValueString(null, sql, m_PrintformatItem

View File

@ -73,6 +73,8 @@ public class ProcessElementHandler extends AbstractElementHandler {
Object_Status = "New"; Object_Status = "New";
AD_Backup_ID = 0; AD_Backup_ID = 0;
} }
if (id <= 0 && atts.getValue("AD_Process_ID") != null && Integer.parseInt(atts.getValue("AD_Process_ID")) <= PackOut.MAX_OFFICIAL_ID)
m_Process.setAD_Process_ID(Integer.parseInt(atts.getValue("AD_Process_ID")));
m_Process.setName(name); m_Process.setName(name);
name = atts.getValue("ADWorkflowNameID"); name = atts.getValue("ADWorkflowNameID");
@ -272,6 +274,9 @@ public class ProcessElementHandler extends AbstractElementHandler {
String name = null; String name = null;
atts.clear(); atts.clear();
if (m_Process.getAD_Process_ID() <= PackOut.MAX_OFFICIAL_ID)
atts.addAttribute("","","AD_Process_ID","CDATA",Integer.toString(m_Process.getAD_Process_ID()));
atts.addAttribute("", "", "Name", "CDATA", atts.addAttribute("", "", "Name", "CDATA",
(m_Process.getName() != null ? m_Process.getName() : "")); (m_Process.getName() != null ? m_Process.getName() : ""));

View File

@ -22,6 +22,7 @@ import javax.xml.transform.sax.TransformerHandler;
import org.adempiere.pipo.AbstractElementHandler; import org.adempiere.pipo.AbstractElementHandler;
import org.adempiere.pipo.Element; import org.adempiere.pipo.Element;
import org.adempiere.pipo.PackOut;
import org.adempiere.pipo.exception.POSaveFailedException; import org.adempiere.pipo.exception.POSaveFailedException;
import org.compiere.model.X_AD_Element; import org.compiere.model.X_AD_Element;
import org.compiere.model.X_AD_Process_Para; import org.compiere.model.X_AD_Process_Para;
@ -77,6 +78,8 @@ public class ProcessParaElementHandler extends AbstractElementHandler {
getTrxName(ctx)); getTrxName(ctx));
int AD_Backup_ID = -1; int AD_Backup_ID = -1;
String Object_Status = null; String Object_Status = null;
if (id <= 0 && atts.getValue("AD_Process_Para_ID") != null && Integer.parseInt(atts.getValue("AD_Process_Para_ID")) <= PackOut.MAX_OFFICIAL_ID)
m_Process_para.setAD_Process_Para_ID(Integer.parseInt(atts.getValue("AD_Process_Para_ID")));
if (id > 0) { if (id > 0) {
AD_Backup_ID = copyRecord(ctx, "AD_Process_Para", AD_Backup_ID = copyRecord(ctx, "AD_Process_Para",
m_Process_para); m_Process_para);
@ -217,6 +220,8 @@ public class ProcessParaElementHandler extends AbstractElementHandler {
String sql = null; String sql = null;
String name = null; String name = null;
atts.clear(); atts.clear();
if (m_Processpara.getAD_Process_Para_ID() <= PackOut.MAX_OFFICIAL_ID)
atts.addAttribute("","","AD_Process_Para_ID","CDATA",Integer.toString(m_Processpara.getAD_Process_Para_ID()));
atts atts
.addAttribute("", "", "Name", "CDATA", .addAttribute("", "", "Name", "CDATA",
(m_Processpara.getName() != null ? m_Processpara (m_Processpara.getName() != null ? m_Processpara

View File

@ -28,6 +28,7 @@ import javax.xml.transform.sax.TransformerHandler;
import org.adempiere.pipo.AbstractElementHandler; import org.adempiere.pipo.AbstractElementHandler;
import org.adempiere.pipo.Element; import org.adempiere.pipo.Element;
import org.adempiere.pipo.PackOut;
import org.adempiere.pipo.exception.DatabaseAccessException; import org.adempiere.pipo.exception.DatabaseAccessException;
import org.adempiere.pipo.exception.POSaveFailedException; import org.adempiere.pipo.exception.POSaveFailedException;
import org.compiere.model.X_AD_Ref_List; import org.compiere.model.X_AD_Ref_List;
@ -63,6 +64,8 @@ public class ReferenceElementHandler extends AbstractElementHandler {
X_AD_Reference m_Reference = new X_AD_Reference(ctx, id, X_AD_Reference m_Reference = new X_AD_Reference(ctx, id,
getTrxName(ctx)); getTrxName(ctx));
if (id <= 0 && atts.getValue("AD_Reference_ID") != null && Integer.parseInt(atts.getValue("AD_Reference_ID")) <= PackOut.MAX_OFFICIAL_ID)
m_Reference.setAD_Reference_ID(Integer.parseInt(atts.getValue("AD_Reference_ID")));
if (id > 0) { if (id > 0) {
AD_Backup_ID = copyRecord(ctx, "AD_Reference", m_Reference); AD_Backup_ID = copyRecord(ctx, "AD_Reference", m_Reference);
Object_Status = "Update"; Object_Status = "Update";
@ -246,6 +249,8 @@ public class ReferenceElementHandler extends AbstractElementHandler {
String sql = null; String sql = null;
String name = null; String name = null;
atts.clear(); atts.clear();
if (m_Reference.getAD_Reference_ID() <= PackOut.MAX_OFFICIAL_ID)
atts.addAttribute("", "", "AD_Reference_ID", "CDATA", Integer.toString(m_Reference.getAD_Reference_ID()));
if (m_Reference.getAD_Reference_ID() > 0) { if (m_Reference.getAD_Reference_ID() > 0) {
sql = "SELECT Name FROM AD_Reference WHERE AD_Reference_ID=?"; sql = "SELECT Name FROM AD_Reference WHERE AD_Reference_ID=?";
name = DB.getSQLValueString(null, sql, m_Reference name = DB.getSQLValueString(null, sql, m_Reference

View File

@ -22,6 +22,7 @@ import javax.xml.transform.sax.TransformerHandler;
import org.adempiere.pipo.AbstractElementHandler; import org.adempiere.pipo.AbstractElementHandler;
import org.adempiere.pipo.Element; import org.adempiere.pipo.Element;
import org.adempiere.pipo.PackOut;
import org.adempiere.pipo.exception.POSaveFailedException; import org.adempiere.pipo.exception.POSaveFailedException;
import org.compiere.model.X_AD_Ref_List; import org.compiere.model.X_AD_Ref_List;
import org.compiere.util.DB; import org.compiere.util.DB;
@ -60,6 +61,8 @@ public class ReferenceListElementHandler extends AbstractElementHandler {
int AD_Ref_List_ID = get_IDWithMasterAndColumn(ctx, "AD_Ref_List", "Value", value, "AD_Reference", AD_Reference_ID); int AD_Ref_List_ID = get_IDWithMasterAndColumn(ctx, "AD_Ref_List", "Value", value, "AD_Reference", AD_Reference_ID);
X_AD_Ref_List m_Ref_List = new X_AD_Ref_List(ctx, AD_Ref_List_ID, X_AD_Ref_List m_Ref_List = new X_AD_Ref_List(ctx, AD_Ref_List_ID,
getTrxName(ctx)); getTrxName(ctx));
if (AD_Ref_List_ID <= 0 && atts.getValue("AD_Ref_List_ID") != null && Integer.parseInt(atts.getValue("AD_Ref_List_ID")) <= PackOut.MAX_OFFICIAL_ID)
m_Ref_List.setAD_Ref_List_ID(Integer.parseInt(atts.getValue("AD_Ref_List_ID")));
if (AD_Ref_List_ID > 0) { if (AD_Ref_List_ID > 0) {
AD_Backup_ID = copyRecord(ctx, "AD_Ref_List", m_Ref_List); AD_Backup_ID = copyRecord(ctx, "AD_Ref_List", m_Ref_List);
Object_Status = "Update"; Object_Status = "Update";
@ -113,6 +116,8 @@ public class ReferenceListElementHandler extends AbstractElementHandler {
String sql = null; String sql = null;
String name = null; String name = null;
atts.clear(); atts.clear();
if (m_Ref_List.getAD_Ref_List_ID() <= PackOut.MAX_OFFICIAL_ID)
atts.addAttribute("", "", "AD_Ref_List_ID", "CDATA", Integer.toString(m_Ref_List.getAD_Ref_List_ID()));
if (m_Ref_List.getAD_Ref_List_ID() > 0) { if (m_Ref_List.getAD_Ref_List_ID() > 0) {
sql = "SELECT Name FROM AD_Ref_List WHERE AD_Ref_List_ID=?"; sql = "SELECT Name FROM AD_Ref_List WHERE AD_Ref_List_ID=?";
name = DB.getSQLValueString(null, sql, m_Ref_List name = DB.getSQLValueString(null, sql, m_Ref_List

View File

@ -25,6 +25,7 @@ import javax.xml.transform.sax.TransformerHandler;
import org.adempiere.pipo.AbstractElementHandler; import org.adempiere.pipo.AbstractElementHandler;
import org.adempiere.pipo.Element; import org.adempiere.pipo.Element;
import org.adempiere.pipo.PackOut;
import org.adempiere.pipo.exception.DatabaseAccessException; import org.adempiere.pipo.exception.DatabaseAccessException;
import org.adempiere.pipo.exception.POSaveFailedException; import org.adempiere.pipo.exception.POSaveFailedException;
import org.compiere.model.MColumn; import org.compiere.model.MColumn;
@ -63,6 +64,8 @@ public class ReferenceTableElementHandler extends AbstractElementHandler {
"SELECT AD_Reference_ID FROM AD_Reference WHERE Name= ?"); "SELECT AD_Reference_ID FROM AD_Reference WHERE Name= ?");
AD_Reference_ID = DB.getSQLValue(getTrxName(ctx), sqlB.toString(), name); AD_Reference_ID = DB.getSQLValue(getTrxName(ctx), sqlB.toString(), name);
} }
if (AD_Reference_ID <= 0 && atts.getValue("AD_Reference_ID") != null && Integer.parseInt(atts.getValue("AD_Reference_ID")) <= PackOut.MAX_OFFICIAL_ID)
AD_Reference_ID = Integer.parseInt(atts.getValue("AD_Reference_ID"));
StringBuffer sqlB = new StringBuffer( StringBuffer sqlB = new StringBuffer(
"SELECT Count(*) FROM AD_Ref_Table WHERE AD_Reference_ID= ?"); "SELECT Count(*) FROM AD_Ref_Table WHERE AD_Reference_ID= ?");
@ -214,6 +217,8 @@ public class ReferenceTableElementHandler extends AbstractElementHandler {
private AttributesImpl createReferenceTableBinding(Properties ctx, private AttributesImpl createReferenceTableBinding(Properties ctx,
AttributesImpl atts, int reference_ID) { AttributesImpl atts, int reference_ID) {
atts.clear(); atts.clear();
if (reference_ID <= PackOut.MAX_OFFICIAL_ID)
atts.addAttribute("", "", "AD_Reference_ID", "CDATA", Integer.toString(reference_ID));
String name = null; String name = null;
String sql = null; String sql = null;
String sql1 = "SELECT * FROM AD_Ref_Table WHERE AD_Reference_ID= " String sql1 = "SELECT * FROM AD_Ref_Table WHERE AD_Reference_ID= "

View File

@ -22,6 +22,7 @@ import javax.xml.transform.sax.TransformerHandler;
import org.adempiere.pipo.AbstractElementHandler; import org.adempiere.pipo.AbstractElementHandler;
import org.adempiere.pipo.Element; import org.adempiere.pipo.Element;
import org.adempiere.pipo.PackOut;
import org.adempiere.pipo.exception.POSaveFailedException; import org.adempiere.pipo.exception.POSaveFailedException;
import org.compiere.model.X_AD_ReportView_Col; import org.compiere.model.X_AD_ReportView_Col;
import org.compiere.util.DB; import org.compiere.util.DB;
@ -80,6 +81,8 @@ public class ReportViewColElementHandler extends AbstractElementHandler {
if (id < 0) id = 0; if (id < 0) id = 0;
X_AD_ReportView_Col m_Reportview_Col = new X_AD_ReportView_Col(ctx, X_AD_ReportView_Col m_Reportview_Col = new X_AD_ReportView_Col(ctx,
id, getTrxName(ctx)); id, getTrxName(ctx));
if (id <= 0 && atts.getValue("AD_ReportView_Col_ID") != null && Integer.parseInt(atts.getValue("AD_ReportView_Col_ID")) <= PackOut.MAX_OFFICIAL_ID)
m_Reportview_Col.setAD_ReportView_Col_ID(Integer.parseInt(atts.getValue("AD_ReportView_Col_ID")));
if (id > 0) { if (id > 0) {
AD_Backup_ID = copyRecord(ctx, "AD_Reportview_Col", AD_Backup_ID = copyRecord(ctx, "AD_Reportview_Col",
m_Reportview_Col); m_Reportview_Col);
@ -143,6 +146,8 @@ public class ReportViewColElementHandler extends AbstractElementHandler {
String sql = null; String sql = null;
String name = null; String name = null;
atts.clear(); atts.clear();
if (m_Reportview_Col.getAD_ReportView_Col_ID() <= PackOut.MAX_OFFICIAL_ID)
atts.addAttribute("","","AD_ReportView_Col_ID","CDATA",Integer.toString(m_Reportview_Col.getAD_ReportView_Col_ID()));
if (m_Reportview_Col.getAD_Column_ID() > 0) { if (m_Reportview_Col.getAD_Column_ID() > 0) {
sql = "SELECT ColumnName FROM AD_Column WHERE AD_Column_ID=?"; sql = "SELECT ColumnName FROM AD_Column WHERE AD_Column_ID=?";
name = DB.getSQLValueString(null, sql, m_Reportview_Col name = DB.getSQLValueString(null, sql, m_Reportview_Col

View File

@ -59,6 +59,8 @@ public class ReportViewElementHandler extends AbstractElementHandler {
int id = get_ID(ctx, "AD_ReportView", name); int id = get_ID(ctx, "AD_ReportView", name);
X_AD_ReportView m_Reportview = new X_AD_ReportView(ctx, id, X_AD_ReportView m_Reportview = new X_AD_ReportView(ctx, id,
getTrxName(ctx)); getTrxName(ctx));
if (id <= 0 && atts.getValue("AD_ReportView_ID") != null && Integer.parseInt(atts.getValue("AD_ReportView_ID")) <= PackOut.MAX_OFFICIAL_ID)
m_Reportview.setAD_ReportView_ID(Integer.parseInt(atts.getValue("AD_ReportView_ID")));
if (id > 0) { if (id > 0) {
AD_Backup_ID = copyRecord(ctx, "AD_Reportview", m_Reportview); AD_Backup_ID = copyRecord(ctx, "AD_Reportview", m_Reportview);
Object_Status = "Update"; Object_Status = "Update";
@ -224,6 +226,8 @@ public class ReportViewElementHandler extends AbstractElementHandler {
String sql = null; String sql = null;
String name = null; String name = null;
atts.clear(); atts.clear();
if (m_Reportview.getAD_ReportView_ID() <= PackOut.MAX_OFFICIAL_ID)
atts.addAttribute("","","AD_ReportView_ID","CDATA",Integer.toString(m_Reportview.getAD_ReportView_ID()));
if (m_Reportview.getAD_ReportView_ID() > 0) { if (m_Reportview.getAD_ReportView_ID() > 0) {
sql = "SELECT Name FROM AD_ReportView WHERE AD_ReportView_ID=?"; sql = "SELECT Name FROM AD_ReportView WHERE AD_ReportView_ID=?";

View File

@ -28,6 +28,7 @@ import javax.xml.transform.sax.TransformerHandler;
import org.adempiere.pipo.AbstractElementHandler; import org.adempiere.pipo.AbstractElementHandler;
import org.adempiere.pipo.Element; import org.adempiere.pipo.Element;
import org.adempiere.pipo.PackOut;
import org.adempiere.pipo.exception.DatabaseAccessException; import org.adempiere.pipo.exception.DatabaseAccessException;
import org.adempiere.pipo.exception.POSaveFailedException; import org.adempiere.pipo.exception.POSaveFailedException;
import org.compiere.model.MRole; import org.compiere.model.MRole;
@ -70,6 +71,8 @@ public class RoleElementHandler extends AbstractElementHandler {
int AD_Backup_ID = -1; int AD_Backup_ID = -1;
String Object_Status = null; String Object_Status = null;
if (id <= 0 && atts.getValue("AD_Role_ID") != null && Integer.parseInt(atts.getValue("AD_Role_ID")) <= PackOut.MAX_OFFICIAL_ID)
m_Role.setAD_Role_ID(Integer.parseInt(atts.getValue("AD_Role_ID")));
if (id > 0) { if (id > 0) {
AD_Backup_ID = copyRecord(ctx, "AD_Role", m_Role); AD_Backup_ID = copyRecord(ctx, "AD_Role", m_Role);
Object_Status = "Update"; Object_Status = "Update";
@ -430,6 +433,8 @@ public class RoleElementHandler extends AbstractElementHandler {
String sql = null; String sql = null;
String name = null; String name = null;
atts.clear(); atts.clear();
if (m_Role.getAD_Role_ID() <= PackOut.MAX_OFFICIAL_ID)
atts.addAttribute("","","AD_Role_ID","CDATA",Integer.toString(m_Role.getAD_Role_ID()));
if (m_Role.getAD_Tree_Menu_ID() > 0) { if (m_Role.getAD_Tree_Menu_ID() > 0) {
sql = "SELECT Name FROM AD_Tree WHERE AD_Tree_ID=? AND AD_Tree.TreeType='MM'"; sql = "SELECT Name FROM AD_Tree WHERE AD_Tree_ID=? AND AD_Tree.TreeType='MM'";

View File

@ -79,6 +79,8 @@ public class TabElementHandler extends AbstractElementHandler {
int id = DB.getSQLValue(getTrxName(ctx), sqlB.toString (), tableid); int id = DB.getSQLValue(getTrxName(ctx), sqlB.toString (), tableid);
MTab m_Tab = new MTab(ctx, id, getTrxName(ctx)); MTab m_Tab = new MTab(ctx, id, getTrxName(ctx));
if (id <= 0 && atts.getValue("AD_Tab_ID") != null && Integer.parseInt(atts.getValue("AD_Tab_ID")) <= PackOut.MAX_OFFICIAL_ID)
m_Tab.setAD_Tab_ID(Integer.parseInt(atts.getValue("AD_Tab_ID")));
int AD_Backup_ID = -1; int AD_Backup_ID = -1;
String Object_Status = null; String Object_Status = null;
if (id > 0){ if (id > 0){
@ -243,6 +245,8 @@ public class TabElementHandler extends AbstractElementHandler {
String sql = null; String sql = null;
String name = null; String name = null;
atts.clear(); atts.clear();
if (m_Tab.getAD_Tab_ID() <= PackOut.MAX_OFFICIAL_ID)
atts.addAttribute("", "", "AD_Tab_ID", "CDATA", Integer.toString(m_Tab.getAD_Tab_ID()));
atts.addAttribute("","","Name","CDATA",(m_Tab.getName () != null ? m_Tab.getName ():"")); atts.addAttribute("","","Name","CDATA",(m_Tab.getName () != null ? m_Tab.getName ():""));
if (m_Tab.getAD_ColumnSortOrder_ID()>0){ if (m_Tab.getAD_ColumnSortOrder_ID()>0){
sql = "SELECT Name FROM AD_Column WHERE AD_Column_ID=?"; sql = "SELECT Name FROM AD_Column WHERE AD_Column_ID=?";

View File

@ -66,6 +66,8 @@ public class TableElementHandler extends AbstractElementHandler {
} }
MTable m_Table = new MTable(ctx, id, getTrxName(ctx)); MTable m_Table = new MTable(ctx, id, getTrxName(ctx));
if (id <= 0 && atts.getValue("AD_Table_ID") != null && Integer.parseInt(atts.getValue("AD_Table_ID")) <= PackOut.MAX_OFFICIAL_ID)
m_Table.setAD_Table_ID(Integer.parseInt(atts.getValue("AD_Table_ID")));
int AD_Backup_ID = -1; int AD_Backup_ID = -1;
String Object_Status = null; String Object_Status = null;
if (id > 0){ if (id > 0){
@ -235,6 +237,8 @@ public class TableElementHandler extends AbstractElementHandler {
String sql = null; String sql = null;
String name = null; String name = null;
atts.clear(); atts.clear();
if (m_Table.getAD_Table_ID() <= PackOut.MAX_OFFICIAL_ID)
atts.addAttribute("", "", "AD_Table_ID", "CDATA", Integer.toString(m_Table.getAD_Table_ID()));
atts.addAttribute("","","Name","CDATA",(m_Table.getName () != null ? m_Table.getName ():"")); atts.addAttribute("","","Name","CDATA",(m_Table.getName () != null ? m_Table.getName ():""));
if (m_Table.getAD_Table_ID()> 0 ){ if (m_Table.getAD_Table_ID()> 0 ){
sql = "SELECT TableName FROM AD_Table WHERE AD_Table_ID=?"; sql = "SELECT TableName FROM AD_Table WHERE AD_Table_ID=?";

View File

@ -24,6 +24,7 @@ import javax.xml.transform.sax.TransformerHandler;
import org.adempiere.pipo.AbstractElementHandler; import org.adempiere.pipo.AbstractElementHandler;
import org.adempiere.pipo.Element; import org.adempiere.pipo.Element;
import org.adempiere.pipo.PackOut;
import org.adempiere.pipo.exception.POSaveFailedException; import org.adempiere.pipo.exception.POSaveFailedException;
import org.compiere.model.MTask; import org.compiere.model.MTask;
import org.compiere.model.X_AD_Task; import org.compiere.model.X_AD_Task;
@ -49,6 +50,8 @@ public class TaskElementHandler extends AbstractElementHandler {
MTask m_Task = new MTask(ctx, id, getTrxName(ctx)); MTask m_Task = new MTask(ctx, id, getTrxName(ctx));
int AD_Backup_ID = -1; int AD_Backup_ID = -1;
String Object_Status = null; String Object_Status = null;
if (id <= 0 && atts.getValue("AD_Task_ID") != null && Integer.parseInt(atts.getValue("AD_Task_ID")) <= PackOut.MAX_OFFICIAL_ID)
m_Task.setAD_Task_ID(Integer.parseInt(atts.getValue("AD_Task_ID")));
if (id > 0) { if (id > 0) {
AD_Backup_ID = copyRecord(ctx, "AD_Task", m_Task); AD_Backup_ID = copyRecord(ctx, "AD_Task", m_Task);
Object_Status = "Update"; Object_Status = "Update";
@ -103,6 +106,8 @@ public class TaskElementHandler extends AbstractElementHandler {
String sql = null; String sql = null;
String name = null; String name = null;
atts.clear(); atts.clear();
if (m_Task.getAD_Task_ID() <= PackOut.MAX_OFFICIAL_ID)
atts.addAttribute("","","AD_Task_ID","CDATA",Integer.toString(m_Task.getAD_Task_ID()));
if (m_Task.getAD_Task_ID() > 0) { if (m_Task.getAD_Task_ID() > 0) {
sql = "SELECT Name FROM AD_Task WHERE AD_Task_ID=?"; sql = "SELECT Name FROM AD_Task WHERE AD_Task_ID=?";
name = DB.getSQLValueString(null, sql, m_Task.getAD_Task_ID()); name = DB.getSQLValueString(null, sql, m_Task.getAD_Task_ID());

View File

@ -62,6 +62,8 @@ public class WindowElementHandler extends AbstractElementHandler {
return; return;
} }
MWindow m_Window = new MWindow(ctx, id, getTrxName(ctx)); MWindow m_Window = new MWindow(ctx, id, getTrxName(ctx));
if (id <= 0 && atts.getValue("AD_Window_ID") != null && Integer.parseInt(atts.getValue("AD_Window_ID")) <= PackOut.MAX_OFFICIAL_ID)
m_Window.setAD_Window_ID(Integer.parseInt(atts.getValue("AD_Window_ID")));
String Object_Status = null; String Object_Status = null;
int AD_Backup_ID = -1; int AD_Backup_ID = -1;
if (id > 0) { if (id > 0) {
@ -241,6 +243,8 @@ public class WindowElementHandler extends AbstractElementHandler {
private AttributesImpl createWindowBinding(AttributesImpl atts, private AttributesImpl createWindowBinding(AttributesImpl atts,
X_AD_Window m_Window) { X_AD_Window m_Window) {
atts.clear(); atts.clear();
if (m_Window.getAD_Window_ID() <= PackOut.MAX_OFFICIAL_ID)
atts.addAttribute("", "", "AD_Window_ID", "CDATA", Integer.toString(m_Window.getAD_Window_ID()));
String sql = "SELECT Name FROM AD_Window WHERE AD_Window_ID=?"; String sql = "SELECT Name FROM AD_Window WHERE AD_Window_ID=?";
String name = DB.getSQLValueString(null, sql, m_Window String name = DB.getSQLValueString(null, sql, m_Window
.getAD_Window_ID()); .getAD_Window_ID());

View File

@ -29,6 +29,7 @@ import javax.xml.transform.sax.TransformerHandler;
import org.adempiere.pipo.AbstractElementHandler; import org.adempiere.pipo.AbstractElementHandler;
import org.adempiere.pipo.Element; import org.adempiere.pipo.Element;
import org.adempiere.pipo.PackOut;
import org.adempiere.pipo.exception.DatabaseAccessException; import org.adempiere.pipo.exception.DatabaseAccessException;
import org.adempiere.pipo.exception.POSaveFailedException; import org.adempiere.pipo.exception.POSaveFailedException;
import org.compiere.model.X_AD_Package_Exp_Detail; import org.compiere.model.X_AD_Package_Exp_Detail;
@ -72,6 +73,8 @@ public class WorkflowElementHandler extends AbstractElementHandler {
MWorkflow m_Workflow = new MWorkflow(ctx, id, getTrxName(ctx)); MWorkflow m_Workflow = new MWorkflow(ctx, id, getTrxName(ctx));
int AD_Backup_ID = -1; int AD_Backup_ID = -1;
String Object_Status = null; String Object_Status = null;
if (id <= 0 && atts.getValue("AD_Workflow_ID") != null && Integer.parseInt(atts.getValue("AD_Workflow_ID")) <= PackOut.MAX_OFFICIAL_ID)
m_Workflow.setAD_Workflow_ID(Integer.parseInt(atts.getValue("AD_Workflow_ID")));
if (id > 0) { if (id > 0) {
AD_Backup_ID = copyRecord(ctx, "AD_Workflow", m_Workflow); AD_Backup_ID = copyRecord(ctx, "AD_Workflow", m_Workflow);
Object_Status = "Update"; Object_Status = "Update";
@ -367,6 +370,8 @@ public class WorkflowElementHandler extends AbstractElementHandler {
String sql = null; String sql = null;
String name = null; String name = null;
atts.clear(); atts.clear();
if (m_Workflow.getAD_Workflow_ID() <= PackOut.MAX_OFFICIAL_ID)
atts.addAttribute("","","AD_Workflow_ID","CDATA",Integer.toString(m_Workflow.getAD_Workflow_ID()));
atts.addAttribute("", "", "Value", "CDATA", (m_Workflow.getValue() != null ? m_Workflow.getValue() : "")); atts.addAttribute("", "", "Value", "CDATA", (m_Workflow.getValue() != null ? m_Workflow.getValue() : ""));
atts.addAttribute("", "", "Name", "CDATA", atts.addAttribute("", "", "Name", "CDATA",
(m_Workflow.getName() != null ? m_Workflow.getName() : "")); (m_Workflow.getName() != null ? m_Workflow.getName() : ""));

View File

@ -24,6 +24,7 @@ import javax.xml.transform.sax.TransformerHandler;
import org.adempiere.pipo.AbstractElementHandler; import org.adempiere.pipo.AbstractElementHandler;
import org.adempiere.pipo.Element; import org.adempiere.pipo.Element;
import org.adempiere.pipo.PackOut;
import org.adempiere.pipo.exception.POSaveFailedException; import org.adempiere.pipo.exception.POSaveFailedException;
import org.compiere.model.X_AD_WF_Node; import org.compiere.model.X_AD_WF_Node;
import org.compiere.util.DB; import org.compiere.util.DB;
@ -82,6 +83,8 @@ public class WorkflowNodeElementHandler extends AbstractElementHandler {
X_AD_WF_Node m_WFNode = new X_AD_WF_Node(ctx, id, getTrxName(ctx)); X_AD_WF_Node m_WFNode = new X_AD_WF_Node(ctx, id, getTrxName(ctx));
int AD_Backup_ID = -1; int AD_Backup_ID = -1;
String Object_Status = null; String Object_Status = null;
if (id <= 0 && atts.getValue("AD_WF_Node_ID") != null && Integer.parseInt(atts.getValue("AD_WF_Node_ID")) <= PackOut.MAX_OFFICIAL_ID)
m_WFNode.setAD_WF_Node_ID(Integer.parseInt(atts.getValue("AD_WF_Node_ID")));
if (id > 0) { if (id > 0) {
AD_Backup_ID = copyRecord(ctx, "AD_WF_Node", m_WFNode); AD_Backup_ID = copyRecord(ctx, "AD_WF_Node", m_WFNode);
Object_Status = "Update"; Object_Status = "Update";
@ -264,6 +267,8 @@ public class WorkflowNodeElementHandler extends AbstractElementHandler {
String sql = null; String sql = null;
String name = null; String name = null;
atts.clear(); atts.clear();
if (m_WF_Node.getAD_WF_Node_ID() <= PackOut.MAX_OFFICIAL_ID)
atts.addAttribute("","","AD_WF_Node_ID","CDATA",Integer.toString(m_WF_Node.getAD_WF_Node_ID()));
atts.addAttribute("", "", "Value", "CDATA", (m_WF_Node.getValue() != null ? m_WF_Node.getValue() : "")); atts.addAttribute("", "", "Value", "CDATA", (m_WF_Node.getValue() != null ? m_WF_Node.getValue() : ""));
atts.addAttribute("", "", "Name", "CDATA", atts.addAttribute("", "", "Name", "CDATA",
(m_WF_Node.getName() != null ? m_WF_Node.getName() : "")); (m_WF_Node.getName() != null ? m_WF_Node.getName() : ""));

View File

@ -22,6 +22,7 @@ import javax.xml.transform.sax.TransformerHandler;
import org.adempiere.pipo.AbstractElementHandler; import org.adempiere.pipo.AbstractElementHandler;
import org.adempiere.pipo.Element; import org.adempiere.pipo.Element;
import org.adempiere.pipo.PackOut;
import org.adempiere.pipo.exception.POSaveFailedException; import org.adempiere.pipo.exception.POSaveFailedException;
import org.compiere.model.X_AD_WF_NextCondition; import org.compiere.model.X_AD_WF_NextCondition;
import org.compiere.util.DB; import org.compiere.util.DB;
@ -93,6 +94,8 @@ public class WorkflowNodeNextConditionElementHandler extends
id, getTrxName(ctx)); id, getTrxName(ctx));
int AD_Backup_ID = -1; int AD_Backup_ID = -1;
String Object_Status = null; String Object_Status = null;
if (id <= 0 && atts.getValue("AD_WF_NextCondition_ID") != null && Integer.parseInt(atts.getValue("AD_WF_NextCondition_ID")) <= PackOut.MAX_OFFICIAL_ID)
m_WFNodeNextCondition.setAD_WF_NextCondition_ID(Integer.parseInt(atts.getValue("AD_WF_NextCondition_ID")));
if (id > 0) { if (id > 0) {
AD_Backup_ID = copyRecord(ctx, "AD_WF_NextCondition", AD_Backup_ID = copyRecord(ctx, "AD_WF_NextCondition",
m_WFNodeNextCondition); m_WFNodeNextCondition);
@ -181,6 +184,8 @@ public class WorkflowNodeNextConditionElementHandler extends
String sql = null; String sql = null;
String name = null; String name = null;
atts.clear(); atts.clear();
if (m_WF_NodeNextCondition.getAD_WF_NextCondition_ID() <= PackOut.MAX_OFFICIAL_ID)
atts.addAttribute("","","AD_WF_NextCondition_ID","CDATA",Integer.toString(m_WF_NodeNextCondition.getAD_WF_NextCondition_ID()));
if (m_WF_NodeNextCondition.getAD_WF_NodeNext_ID() > 0) { if (m_WF_NodeNextCondition.getAD_WF_NodeNext_ID() > 0) {
// FIXME: it appears nodes point back to themselves // FIXME: it appears nodes point back to themselves

View File

@ -22,6 +22,7 @@ import javax.xml.transform.sax.TransformerHandler;
import org.adempiere.pipo.AbstractElementHandler; import org.adempiere.pipo.AbstractElementHandler;
import org.adempiere.pipo.Element; import org.adempiere.pipo.Element;
import org.adempiere.pipo.PackOut;
import org.adempiere.pipo.exception.POSaveFailedException; import org.adempiere.pipo.exception.POSaveFailedException;
import org.compiere.model.X_AD_WF_NextCondition; import org.compiere.model.X_AD_WF_NextCondition;
import org.compiere.model.X_AD_WF_NodeNext; import org.compiere.model.X_AD_WF_NodeNext;
@ -79,6 +80,8 @@ public class WorkflowNodeNextElementHandler extends AbstractElementHandler {
MWFNodeNext m_WFNodeNext = new MWFNodeNext(ctx, id, getTrxName(ctx)); MWFNodeNext m_WFNodeNext = new MWFNodeNext(ctx, id, getTrxName(ctx));
int AD_Backup_ID = -1; int AD_Backup_ID = -1;
String Object_Status = null; String Object_Status = null;
if (id <= 0 && atts.getValue("AD_WF_NodeNext_ID") != null && Integer.parseInt(atts.getValue("AD_WF_NodeNext_ID")) <= PackOut.MAX_OFFICIAL_ID)
m_WFNodeNext.setAD_WF_NodeNext_ID(Integer.parseInt(atts.getValue("AD_WF_NodeNext_ID")));
if (id > 0){ if (id > 0){
AD_Backup_ID = copyRecord(ctx, "AD_WF_NodeNext",m_WFNodeNext); AD_Backup_ID = copyRecord(ctx, "AD_WF_NodeNext",m_WFNodeNext);
Object_Status = "Update"; Object_Status = "Update";
@ -134,6 +137,8 @@ public class WorkflowNodeNextElementHandler extends AbstractElementHandler {
String sql = null; String sql = null;
String name = null; String name = null;
atts.clear(); atts.clear();
if (m_WF_NodeNext.getAD_WF_NodeNext_ID() <= PackOut.MAX_OFFICIAL_ID)
atts.addAttribute("","","AD_WF_NodeNext_ID","CDATA",Integer.toString(m_WF_NodeNext.getAD_WF_NodeNext_ID()));
// log.log(Level.INFO,"m_WF_NodeNext.getAD_WF_Node_ID: ", // log.log(Level.INFO,"m_WF_NodeNext.getAD_WF_Node_ID: ",
// m_WF_NodeNext.getAD_WF_Node_ID()); // m_WF_NodeNext.getAD_WF_Node_ID());
// log.log(Level.INFO,"m_WF_NodeNext.getAD_WF_Next_ID: ", // log.log(Level.INFO,"m_WF_NodeNext.getAD_WF_Next_ID: ",

View File

@ -2627,6 +2627,8 @@ public abstract class PO
*/ */
protected int saveNew_getID() protected int saveNew_getID()
{ {
if (get_ID() < 999999) // 2Pack assigns official ID's when importing
return get_ID();
return 0; return 0;
} // saveNew_getID } // saveNew_getID