diff --git a/base/src/org/adempiere/pipo/AttributeFiller.java b/base/src/org/adempiere/pipo/AttributeFiller.java index d63bec9246..04d28e8c77 100644 --- a/base/src/org/adempiere/pipo/AttributeFiller.java +++ b/base/src/org/adempiere/pipo/AttributeFiller.java @@ -82,9 +82,12 @@ public class AttributeFiller { }else if(value instanceof Boolean) { atts.addAttribute("", "", columnName, "CDATA", (Boolean)value == true ? "true" : "false"); + }else if(value instanceof Integer) { + atts.addAttribute("", "", columnName, "CDATA", value.toString()); + }else{ - throw new IllegalArgumentException("Add you own type implemantation here."); + throw new IllegalArgumentException("Add your own type implementation here."); } } @@ -106,4 +109,4 @@ public class AttributeFiller { return atts; } -} \ No newline at end of file +} diff --git a/base/src/org/adempiere/pipo/PackOut.java b/base/src/org/adempiere/pipo/PackOut.java index f50c9423f6..f6fbcada95 100644 --- a/base/src/org/adempiere/pipo/PackOut.java +++ b/base/src/org/adempiere/pipo/PackOut.java @@ -92,7 +92,9 @@ public class PackOut extends SvrProcess private String packagedir = null; private String packagename = null; private String includesdir = null; - + + public final static int MAX_OFFICIAL_ID = 999999; + private Properties localContext = null; ProcessElementHandler processHandler = new ProcessElementHandler(); diff --git a/base/src/org/adempiere/pipo/handler/AdElementHandler.java b/base/src/org/adempiere/pipo/handler/AdElementHandler.java index f7543a5995..60a0e161db 100644 --- a/base/src/org/adempiere/pipo/handler/AdElementHandler.java +++ b/base/src/org/adempiere/pipo/handler/AdElementHandler.java @@ -59,6 +59,8 @@ public class AdElementHandler extends AbstractElementHandler { X_AD_Element m_AdElement = new X_AD_Element(ctx, id, 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) { AD_Backup_ID = copyRecord(ctx, AD_ELEMENT, m_AdElement); Object_Status = "Update"; @@ -145,6 +147,8 @@ public class AdElementHandler extends AbstractElementHandler { X_AD_Element 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"); diff --git a/base/src/org/adempiere/pipo/handler/ColumnElementHandler.java b/base/src/org/adempiere/pipo/handler/ColumnElementHandler.java index ea2ca2d335..ce3c53a19f 100644 --- a/base/src/org/adempiere/pipo/handler/ColumnElementHandler.java +++ b/base/src/org/adempiere/pipo/handler/ColumnElementHandler.java @@ -29,6 +29,7 @@ import javax.xml.transform.sax.TransformerHandler; import org.adempiere.pipo.AbstractElementHandler; import org.adempiere.pipo.Element; import org.adempiere.pipo.PackIn; +import org.adempiere.pipo.PackOut; import org.adempiere.pipo.exception.DatabaseAccessException; import org.adempiere.pipo.exception.POSaveFailedException; import org.compiere.model.MColumn; @@ -82,6 +83,8 @@ public class ColumnElementHandler extends AbstractElementHandler { } } 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; String Object_Status = null; if (id > 0) { @@ -397,6 +400,8 @@ public class ColumnElementHandler extends AbstractElementHandler { String sql = null; String name = null; 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) { sql = "SELECT ColumnName FROM AD_Column WHERE AD_Column_ID=?"; name = DB.getSQLValueString(null, sql, m_Column.getAD_Column_ID()); diff --git a/base/src/org/adempiere/pipo/handler/DynValRuleElementHandler.java b/base/src/org/adempiere/pipo/handler/DynValRuleElementHandler.java index 4cf742b7de..dc34bfedef 100644 --- a/base/src/org/adempiere/pipo/handler/DynValRuleElementHandler.java +++ b/base/src/org/adempiere/pipo/handler/DynValRuleElementHandler.java @@ -27,6 +27,7 @@ import javax.xml.transform.sax.TransformerHandler; import org.adempiere.pipo.AbstractElementHandler; import org.adempiere.pipo.Element; +import org.adempiere.pipo.PackOut; import org.adempiere.pipo.exception.POSaveFailedException; import org.compiere.model.X_AD_Package_Exp_Detail; 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); 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; String Object_Status = null; if (id > 0){ @@ -121,6 +124,8 @@ public class DynValRuleElementHandler extends AbstractElementHandler { private AttributesImpl createDynamicValidationRuleBinding( AttributesImpl atts, X_AD_Val_Rule m_ValRule) { 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 ():"")); //FIXME: may not need this I guess //atts.addAttribute("","","AccessLevel","CDATA",(m_ValRule.getAccessLevel () != null ? m_ValRule.getAccessLevel ():"")); diff --git a/base/src/org/adempiere/pipo/handler/FieldElementHandler.java b/base/src/org/adempiere/pipo/handler/FieldElementHandler.java index 4fde3de301..7f11fd431d 100644 --- a/base/src/org/adempiere/pipo/handler/FieldElementHandler.java +++ b/base/src/org/adempiere/pipo/handler/FieldElementHandler.java @@ -103,6 +103,8 @@ public class FieldElementHandler extends AbstractElementHandler { int id = DB .getSQLValue(getTrxName(ctx), sqlB.toString(), tabid); 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; String Object_Status = null; if (id > 0) { @@ -217,6 +219,8 @@ public class FieldElementHandler extends AbstractElementHandler { String sql = null; String name = null; 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) { sql = "SELECT ColumnName FROM AD_Column WHERE AD_Column_ID=?"; name = DB.getSQLValueString(null, sql, m_Field.getAD_Column_ID()); diff --git a/base/src/org/adempiere/pipo/handler/FieldGroupElementHandler.java b/base/src/org/adempiere/pipo/handler/FieldGroupElementHandler.java index a9bb308be5..fa5383ab8c 100644 --- a/base/src/org/adempiere/pipo/handler/FieldGroupElementHandler.java +++ b/base/src/org/adempiere/pipo/handler/FieldGroupElementHandler.java @@ -57,6 +57,8 @@ public class FieldGroupElementHandler extends AbstractElementHandler { X_AD_FieldGroup fieldGroup = new X_AD_FieldGroup(ctx, id, 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) { AD_Backup_ID = copyRecord(ctx, X_AD_FieldGroup.Table_Name, fieldGroup); Object_Status = "Update"; @@ -134,6 +136,8 @@ public class FieldGroupElementHandler extends AbstractElementHandler { X_AD_FieldGroup 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"); diff --git a/base/src/org/adempiere/pipo/handler/FormElementHandler.java b/base/src/org/adempiere/pipo/handler/FormElementHandler.java index fbd4d53ccf..666e66bd9e 100644 --- a/base/src/org/adempiere/pipo/handler/FormElementHandler.java +++ b/base/src/org/adempiere/pipo/handler/FormElementHandler.java @@ -24,6 +24,7 @@ import javax.xml.transform.sax.TransformerHandler; import org.adempiere.pipo.AbstractElementHandler; import org.adempiere.pipo.Element; +import org.adempiere.pipo.PackOut; import org.adempiere.pipo.exception.POSaveFailedException; import org.compiere.model.MForm; 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)); int AD_Backup_ID = -1; 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){ AD_Backup_ID = copyRecord(ctx, "AD_Form",m_Form); Object_Status = "Update"; @@ -109,6 +112,8 @@ public class FormElementHandler extends AbstractElementHandler { } else { 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("","","isBetaFunctionality","CDATA",(m_Form.isBetaFunctionality()== true ? "true":"false")); diff --git a/base/src/org/adempiere/pipo/handler/ImpFormatElementHandler.java b/base/src/org/adempiere/pipo/handler/ImpFormatElementHandler.java index 99fe97bff2..f55a73cf56 100644 --- a/base/src/org/adempiere/pipo/handler/ImpFormatElementHandler.java +++ b/base/src/org/adempiere/pipo/handler/ImpFormatElementHandler.java @@ -27,6 +27,7 @@ import javax.xml.transform.sax.TransformerHandler; import org.adempiere.pipo.AbstractElementHandler; import org.adempiere.pipo.Element; +import org.adempiere.pipo.PackOut; import org.adempiere.pipo.exception.DatabaseAccessException; import org.adempiere.pipo.exception.POSaveFailedException; 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")); X_AD_ImpFormat m_ImpFormat = new X_AD_ImpFormat(ctx, id, 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) { AD_Backup_ID = copyRecord(ctx, "AD_ImpFormat", m_ImpFormat); Object_Status = "Update"; @@ -154,6 +157,8 @@ public class ImpFormatElementHandler extends AbstractElementHandler { private AttributesImpl createImpFormatBinding(AttributesImpl atts, X_AD_ImpFormat m_ImpFormat) { 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) { String sql = "SELECT TableName FROM AD_Table WHERE AD_Table_ID=?"; String name = DB.getSQLValueString(null, sql, m_ImpFormat diff --git a/base/src/org/adempiere/pipo/handler/ImpFormatRowElementHandler.java b/base/src/org/adempiere/pipo/handler/ImpFormatRowElementHandler.java index 1f749225f7..7a56e51250 100644 --- a/base/src/org/adempiere/pipo/handler/ImpFormatRowElementHandler.java +++ b/base/src/org/adempiere/pipo/handler/ImpFormatRowElementHandler.java @@ -22,6 +22,7 @@ import javax.xml.transform.sax.TransformerHandler; import org.adempiere.pipo.AbstractElementHandler; import org.adempiere.pipo.Element; +import org.adempiere.pipo.PackOut; import org.adempiere.pipo.exception.POSaveFailedException; import org.compiere.model.X_AD_ImpFormat_Row; 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=?"); 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)); + 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){ AD_Backup_ID = copyRecord(ctx, "AD_ImpFormat",m_ImpFormat_row); Object_Status = "Update"; @@ -144,6 +147,8 @@ public class ImpFormatRowElementHandler extends AbstractElementHandler { } else 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("","","SeqNo","CDATA",""+m_ImpFormat_Row.getSeqNo()); diff --git a/base/src/org/adempiere/pipo/handler/MenuElementHandler.java b/base/src/org/adempiere/pipo/handler/MenuElementHandler.java index b3c1a9ef33..4c837b6426 100644 --- a/base/src/org/adempiere/pipo/handler/MenuElementHandler.java +++ b/base/src/org/adempiere/pipo/handler/MenuElementHandler.java @@ -54,6 +54,8 @@ public class MenuElementHandler extends AbstractElementHandler { name = atts.getValue("ADMenuNameID"); int menuid = get_IDWithColumn(ctx, "AD_Menu", "Name", name); 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) { AD_Backup_ID = copyRecord(ctx, "AD_Menu", m_Menu); 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=?"; 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("", "", "Action", "CDATA", (m_Menu.getAction() != null ? m_Menu.getAction() : "")); diff --git a/base/src/org/adempiere/pipo/handler/MessageElementHandler.java b/base/src/org/adempiere/pipo/handler/MessageElementHandler.java index 90501293b2..8a2b353807 100644 --- a/base/src/org/adempiere/pipo/handler/MessageElementHandler.java +++ b/base/src/org/adempiere/pipo/handler/MessageElementHandler.java @@ -27,6 +27,7 @@ import javax.xml.transform.sax.TransformerHandler; import org.adempiere.pipo.AbstractElementHandler; import org.adempiere.pipo.Element; +import org.adempiere.pipo.PackOut; import org.adempiere.pipo.exception.POSaveFailedException; import org.compiere.model.MMessage; 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)); int AD_Backup_ID = -1; 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){ AD_Backup_ID = copyRecord(ctx, "AD_Message",m_Message); Object_Status = "Update"; @@ -121,6 +124,8 @@ public class MessageElementHandler extends AbstractElementHandler { private AttributesImpl createMessageBinding( AttributesImpl atts, X_AD_Message m_Message) { 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 //atts.addAttribute("","","AccessLevel","CDATA",(m_Message.getAccessLevel () != null ? m_Message.getAccessLevel ():"")); atts.addAttribute("","","MsgText","CDATA",(m_Message.getMsgText() != null ? m_Message.getMsgText():"")); diff --git a/base/src/org/adempiere/pipo/handler/PreferenceElementHandler.java b/base/src/org/adempiere/pipo/handler/PreferenceElementHandler.java index d3f0c5dca1..63e54dcba2 100644 --- a/base/src/org/adempiere/pipo/handler/PreferenceElementHandler.java +++ b/base/src/org/adempiere/pipo/handler/PreferenceElementHandler.java @@ -22,6 +22,7 @@ import javax.xml.transform.sax.TransformerHandler; import org.adempiere.pipo.AbstractElementHandler; import org.adempiere.pipo.Element; +import org.adempiere.pipo.PackOut; import org.adempiere.pipo.exception.POSaveFailedException; import org.compiere.model.MPreference; 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)); int AD_Backup_ID = -1; 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) { AD_Backup_ID = copyRecord(ctx, "AD_Preference", m_Preference); Object_Status = "Update"; @@ -99,6 +102,8 @@ public class PreferenceElementHandler extends AbstractElementHandler { String sql = null; String name = null; 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=?"; name = DB.getSQLValueString(null, sql, m_Preference.getAD_Window_ID()); atts.addAttribute("", "", "ADWindowNameID", "CDATA", name); diff --git a/base/src/org/adempiere/pipo/handler/PrintFormatElementHandler.java b/base/src/org/adempiere/pipo/handler/PrintFormatElementHandler.java index fb1e74c32a..1394da0f9f 100644 --- a/base/src/org/adempiere/pipo/handler/PrintFormatElementHandler.java +++ b/base/src/org/adempiere/pipo/handler/PrintFormatElementHandler.java @@ -29,6 +29,7 @@ import javax.xml.transform.sax.TransformerHandler; import org.adempiere.pipo.AbstractElementHandler; import org.adempiere.pipo.Element; +import org.adempiere.pipo.PackOut; import org.adempiere.pipo.exception.DatabaseAccessException; import org.adempiere.pipo.exception.POSaveFailedException; import org.compiere.model.MTable; @@ -59,6 +60,8 @@ public class PrintFormatElementHandler extends AbstractElementHandler { int id = get_IDWithColumn(ctx, "AD_PrintFormat", "Name", name); X_AD_PrintFormat m_PrintFormat = new X_AD_PrintFormat(ctx, id, 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) { AD_Backup_ID = copyRecord(ctx, "AD_PrintFormat", m_PrintFormat); Object_Status = "Update"; @@ -268,6 +271,8 @@ public class PrintFormatElementHandler extends AbstractElementHandler { String sql = null; String name = null; 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) { sql = "SELECT Name FROM AD_ReportView WHERE AD_ReportView_ID=?"; name = DB.getSQLValueString(null, sql, m_Printformat diff --git a/base/src/org/adempiere/pipo/handler/PrintFormatItemElementHandler.java b/base/src/org/adempiere/pipo/handler/PrintFormatItemElementHandler.java index 3d1338e93d..2a46dd91b3 100644 --- a/base/src/org/adempiere/pipo/handler/PrintFormatItemElementHandler.java +++ b/base/src/org/adempiere/pipo/handler/PrintFormatItemElementHandler.java @@ -23,6 +23,7 @@ import javax.xml.transform.sax.TransformerHandler; import org.adempiere.pipo.AbstractElementHandler; import org.adempiere.pipo.Element; +import org.adempiere.pipo.PackOut; import org.adempiere.pipo.exception.POSaveFailedException; import org.compiere.model.X_AD_PrintFormatItem; import org.compiere.util.DB; @@ -52,6 +53,8 @@ public class PrintFormatItemElementHandler extends AbstractElementHandler { X_AD_PrintFormatItem m_PrintFormatItem = new X_AD_PrintFormatItem(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) { AD_Backup_ID = copyRecord(ctx, "AD_PrintFormatItem", m_PrintFormatItem); @@ -261,6 +264,8 @@ public class PrintFormatItemElementHandler extends AbstractElementHandler { String sql = null; String name = null; 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) { sql = "SELECT Name FROM AD_PrintFormat WHERE AD_PrintFormat_ID=?"; name = DB.getSQLValueString(null, sql, m_PrintformatItem diff --git a/base/src/org/adempiere/pipo/handler/ProcessElementHandler.java b/base/src/org/adempiere/pipo/handler/ProcessElementHandler.java index 153cf4d198..87a7e3104b 100644 --- a/base/src/org/adempiere/pipo/handler/ProcessElementHandler.java +++ b/base/src/org/adempiere/pipo/handler/ProcessElementHandler.java @@ -73,6 +73,8 @@ public class ProcessElementHandler extends AbstractElementHandler { Object_Status = "New"; 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); name = atts.getValue("ADWorkflowNameID"); @@ -272,6 +274,9 @@ public class ProcessElementHandler extends AbstractElementHandler { String name = null; 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", (m_Process.getName() != null ? m_Process.getName() : "")); diff --git a/base/src/org/adempiere/pipo/handler/ProcessParaElementHandler.java b/base/src/org/adempiere/pipo/handler/ProcessParaElementHandler.java index 9b29e9fe75..ffb1c15972 100644 --- a/base/src/org/adempiere/pipo/handler/ProcessParaElementHandler.java +++ b/base/src/org/adempiere/pipo/handler/ProcessParaElementHandler.java @@ -22,6 +22,7 @@ import javax.xml.transform.sax.TransformerHandler; import org.adempiere.pipo.AbstractElementHandler; import org.adempiere.pipo.Element; +import org.adempiere.pipo.PackOut; import org.adempiere.pipo.exception.POSaveFailedException; import org.compiere.model.X_AD_Element; import org.compiere.model.X_AD_Process_Para; @@ -77,6 +78,8 @@ public class ProcessParaElementHandler extends AbstractElementHandler { getTrxName(ctx)); int AD_Backup_ID = -1; 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) { AD_Backup_ID = copyRecord(ctx, "AD_Process_Para", m_Process_para); @@ -217,6 +220,8 @@ public class ProcessParaElementHandler extends AbstractElementHandler { String sql = null; String name = null; 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 .addAttribute("", "", "Name", "CDATA", (m_Processpara.getName() != null ? m_Processpara diff --git a/base/src/org/adempiere/pipo/handler/ReferenceElementHandler.java b/base/src/org/adempiere/pipo/handler/ReferenceElementHandler.java index 0f3afccb5f..9673e4f53a 100644 --- a/base/src/org/adempiere/pipo/handler/ReferenceElementHandler.java +++ b/base/src/org/adempiere/pipo/handler/ReferenceElementHandler.java @@ -28,6 +28,7 @@ import javax.xml.transform.sax.TransformerHandler; import org.adempiere.pipo.AbstractElementHandler; import org.adempiere.pipo.Element; +import org.adempiere.pipo.PackOut; import org.adempiere.pipo.exception.DatabaseAccessException; import org.adempiere.pipo.exception.POSaveFailedException; 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, 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) { AD_Backup_ID = copyRecord(ctx, "AD_Reference", m_Reference); Object_Status = "Update"; @@ -246,6 +249,8 @@ public class ReferenceElementHandler extends AbstractElementHandler { String sql = null; String name = null; 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) { sql = "SELECT Name FROM AD_Reference WHERE AD_Reference_ID=?"; name = DB.getSQLValueString(null, sql, m_Reference diff --git a/base/src/org/adempiere/pipo/handler/ReferenceListElementHandler.java b/base/src/org/adempiere/pipo/handler/ReferenceListElementHandler.java index 61fdec5a1a..0f6bd4a490 100644 --- a/base/src/org/adempiere/pipo/handler/ReferenceListElementHandler.java +++ b/base/src/org/adempiere/pipo/handler/ReferenceListElementHandler.java @@ -22,6 +22,7 @@ import javax.xml.transform.sax.TransformerHandler; import org.adempiere.pipo.AbstractElementHandler; import org.adempiere.pipo.Element; +import org.adempiere.pipo.PackOut; import org.adempiere.pipo.exception.POSaveFailedException; import org.compiere.model.X_AD_Ref_List; 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); X_AD_Ref_List m_Ref_List = new X_AD_Ref_List(ctx, AD_Ref_List_ID, 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) { AD_Backup_ID = copyRecord(ctx, "AD_Ref_List", m_Ref_List); Object_Status = "Update"; @@ -113,6 +116,8 @@ public class ReferenceListElementHandler extends AbstractElementHandler { String sql = null; String name = null; 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) { sql = "SELECT Name FROM AD_Ref_List WHERE AD_Ref_List_ID=?"; name = DB.getSQLValueString(null, sql, m_Ref_List diff --git a/base/src/org/adempiere/pipo/handler/ReferenceTableElementHandler.java b/base/src/org/adempiere/pipo/handler/ReferenceTableElementHandler.java index ced1a61105..e1fe52279e 100644 --- a/base/src/org/adempiere/pipo/handler/ReferenceTableElementHandler.java +++ b/base/src/org/adempiere/pipo/handler/ReferenceTableElementHandler.java @@ -25,6 +25,7 @@ import javax.xml.transform.sax.TransformerHandler; import org.adempiere.pipo.AbstractElementHandler; import org.adempiere.pipo.Element; +import org.adempiere.pipo.PackOut; import org.adempiere.pipo.exception.DatabaseAccessException; import org.adempiere.pipo.exception.POSaveFailedException; import org.compiere.model.MColumn; @@ -63,6 +64,8 @@ public class ReferenceTableElementHandler extends AbstractElementHandler { "SELECT AD_Reference_ID FROM AD_Reference WHERE 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( "SELECT Count(*) FROM AD_Ref_Table WHERE AD_Reference_ID= ?"); @@ -214,6 +217,8 @@ public class ReferenceTableElementHandler extends AbstractElementHandler { private AttributesImpl createReferenceTableBinding(Properties ctx, AttributesImpl atts, int reference_ID) { atts.clear(); + if (reference_ID <= PackOut.MAX_OFFICIAL_ID) + atts.addAttribute("", "", "AD_Reference_ID", "CDATA", Integer.toString(reference_ID)); String name = null; String sql = null; String sql1 = "SELECT * FROM AD_Ref_Table WHERE AD_Reference_ID= " diff --git a/base/src/org/adempiere/pipo/handler/ReportViewColElementHandler.java b/base/src/org/adempiere/pipo/handler/ReportViewColElementHandler.java index 4fc9c980a6..b9d31dbddc 100644 --- a/base/src/org/adempiere/pipo/handler/ReportViewColElementHandler.java +++ b/base/src/org/adempiere/pipo/handler/ReportViewColElementHandler.java @@ -22,6 +22,7 @@ import javax.xml.transform.sax.TransformerHandler; import org.adempiere.pipo.AbstractElementHandler; import org.adempiere.pipo.Element; +import org.adempiere.pipo.PackOut; import org.adempiere.pipo.exception.POSaveFailedException; import org.compiere.model.X_AD_ReportView_Col; import org.compiere.util.DB; @@ -80,6 +81,8 @@ public class ReportViewColElementHandler extends AbstractElementHandler { if (id < 0) id = 0; X_AD_ReportView_Col m_Reportview_Col = new X_AD_ReportView_Col(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) { AD_Backup_ID = copyRecord(ctx, "AD_Reportview_Col", m_Reportview_Col); @@ -143,6 +146,8 @@ public class ReportViewColElementHandler extends AbstractElementHandler { String sql = null; String name = null; 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) { sql = "SELECT ColumnName FROM AD_Column WHERE AD_Column_ID=?"; name = DB.getSQLValueString(null, sql, m_Reportview_Col diff --git a/base/src/org/adempiere/pipo/handler/ReportViewElementHandler.java b/base/src/org/adempiere/pipo/handler/ReportViewElementHandler.java index 98b21cc10b..63f24c6467 100644 --- a/base/src/org/adempiere/pipo/handler/ReportViewElementHandler.java +++ b/base/src/org/adempiere/pipo/handler/ReportViewElementHandler.java @@ -59,6 +59,8 @@ public class ReportViewElementHandler extends AbstractElementHandler { int id = get_ID(ctx, "AD_ReportView", name); X_AD_ReportView m_Reportview = new X_AD_ReportView(ctx, id, 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) { AD_Backup_ID = copyRecord(ctx, "AD_Reportview", m_Reportview); Object_Status = "Update"; @@ -224,6 +226,8 @@ public class ReportViewElementHandler extends AbstractElementHandler { String sql = null; String name = null; 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) { sql = "SELECT Name FROM AD_ReportView WHERE AD_ReportView_ID=?"; diff --git a/base/src/org/adempiere/pipo/handler/RoleElementHandler.java b/base/src/org/adempiere/pipo/handler/RoleElementHandler.java index 06609a3658..319856ce80 100644 --- a/base/src/org/adempiere/pipo/handler/RoleElementHandler.java +++ b/base/src/org/adempiere/pipo/handler/RoleElementHandler.java @@ -28,6 +28,7 @@ import javax.xml.transform.sax.TransformerHandler; import org.adempiere.pipo.AbstractElementHandler; import org.adempiere.pipo.Element; +import org.adempiere.pipo.PackOut; import org.adempiere.pipo.exception.DatabaseAccessException; import org.adempiere.pipo.exception.POSaveFailedException; import org.compiere.model.MRole; @@ -70,6 +71,8 @@ public class RoleElementHandler extends AbstractElementHandler { int AD_Backup_ID = -1; 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) { AD_Backup_ID = copyRecord(ctx, "AD_Role", m_Role); Object_Status = "Update"; @@ -430,6 +433,8 @@ public class RoleElementHandler extends AbstractElementHandler { String sql = null; String name = null; 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) { sql = "SELECT Name FROM AD_Tree WHERE AD_Tree_ID=? AND AD_Tree.TreeType='MM'"; diff --git a/base/src/org/adempiere/pipo/handler/TabElementHandler.java b/base/src/org/adempiere/pipo/handler/TabElementHandler.java index b2102d52d1..47f5a6c496 100644 --- a/base/src/org/adempiere/pipo/handler/TabElementHandler.java +++ b/base/src/org/adempiere/pipo/handler/TabElementHandler.java @@ -79,6 +79,8 @@ public class TabElementHandler extends AbstractElementHandler { int id = DB.getSQLValue(getTrxName(ctx), sqlB.toString (), tableid); 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; String Object_Status = null; if (id > 0){ @@ -243,6 +245,8 @@ public class TabElementHandler extends AbstractElementHandler { String sql = null; String name = null; 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 ():"")); if (m_Tab.getAD_ColumnSortOrder_ID()>0){ sql = "SELECT Name FROM AD_Column WHERE AD_Column_ID=?"; diff --git a/base/src/org/adempiere/pipo/handler/TableElementHandler.java b/base/src/org/adempiere/pipo/handler/TableElementHandler.java index 7d29094bce..cdaf850df4 100644 --- a/base/src/org/adempiere/pipo/handler/TableElementHandler.java +++ b/base/src/org/adempiere/pipo/handler/TableElementHandler.java @@ -66,6 +66,8 @@ public class TableElementHandler extends AbstractElementHandler { } 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; String Object_Status = null; if (id > 0){ @@ -235,6 +237,8 @@ public class TableElementHandler extends AbstractElementHandler { String sql = null; String name = null; 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 ():"")); if (m_Table.getAD_Table_ID()> 0 ){ sql = "SELECT TableName FROM AD_Table WHERE AD_Table_ID=?"; diff --git a/base/src/org/adempiere/pipo/handler/TaskElementHandler.java b/base/src/org/adempiere/pipo/handler/TaskElementHandler.java index c6fff5df96..44373e00c0 100644 --- a/base/src/org/adempiere/pipo/handler/TaskElementHandler.java +++ b/base/src/org/adempiere/pipo/handler/TaskElementHandler.java @@ -24,6 +24,7 @@ import javax.xml.transform.sax.TransformerHandler; import org.adempiere.pipo.AbstractElementHandler; import org.adempiere.pipo.Element; +import org.adempiere.pipo.PackOut; import org.adempiere.pipo.exception.POSaveFailedException; import org.compiere.model.MTask; 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)); int AD_Backup_ID = -1; 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) { AD_Backup_ID = copyRecord(ctx, "AD_Task", m_Task); Object_Status = "Update"; @@ -103,6 +106,8 @@ public class TaskElementHandler extends AbstractElementHandler { String sql = null; String name = null; 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) { sql = "SELECT Name FROM AD_Task WHERE AD_Task_ID=?"; name = DB.getSQLValueString(null, sql, m_Task.getAD_Task_ID()); diff --git a/base/src/org/adempiere/pipo/handler/WindowElementHandler.java b/base/src/org/adempiere/pipo/handler/WindowElementHandler.java index 97e2b5a5b8..499cc2d930 100644 --- a/base/src/org/adempiere/pipo/handler/WindowElementHandler.java +++ b/base/src/org/adempiere/pipo/handler/WindowElementHandler.java @@ -62,6 +62,8 @@ public class WindowElementHandler extends AbstractElementHandler { return; } 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; int AD_Backup_ID = -1; if (id > 0) { @@ -241,6 +243,8 @@ public class WindowElementHandler extends AbstractElementHandler { private AttributesImpl createWindowBinding(AttributesImpl atts, X_AD_Window m_Window) { 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 name = DB.getSQLValueString(null, sql, m_Window .getAD_Window_ID()); diff --git a/base/src/org/adempiere/pipo/handler/WorkflowElementHandler.java b/base/src/org/adempiere/pipo/handler/WorkflowElementHandler.java index 550fc6aaf9..e075e8c188 100644 --- a/base/src/org/adempiere/pipo/handler/WorkflowElementHandler.java +++ b/base/src/org/adempiere/pipo/handler/WorkflowElementHandler.java @@ -29,6 +29,7 @@ import javax.xml.transform.sax.TransformerHandler; import org.adempiere.pipo.AbstractElementHandler; import org.adempiere.pipo.Element; +import org.adempiere.pipo.PackOut; import org.adempiere.pipo.exception.DatabaseAccessException; import org.adempiere.pipo.exception.POSaveFailedException; 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)); int AD_Backup_ID = -1; 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) { AD_Backup_ID = copyRecord(ctx, "AD_Workflow", m_Workflow); Object_Status = "Update"; @@ -367,6 +370,8 @@ public class WorkflowElementHandler extends AbstractElementHandler { String sql = null; String name = null; 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("", "", "Name", "CDATA", (m_Workflow.getName() != null ? m_Workflow.getName() : "")); diff --git a/base/src/org/adempiere/pipo/handler/WorkflowNodeElementHandler.java b/base/src/org/adempiere/pipo/handler/WorkflowNodeElementHandler.java index 5c5957906d..5d596d5a06 100644 --- a/base/src/org/adempiere/pipo/handler/WorkflowNodeElementHandler.java +++ b/base/src/org/adempiere/pipo/handler/WorkflowNodeElementHandler.java @@ -24,6 +24,7 @@ import javax.xml.transform.sax.TransformerHandler; import org.adempiere.pipo.AbstractElementHandler; import org.adempiere.pipo.Element; +import org.adempiere.pipo.PackOut; import org.adempiere.pipo.exception.POSaveFailedException; import org.compiere.model.X_AD_WF_Node; 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)); int AD_Backup_ID = -1; 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) { AD_Backup_ID = copyRecord(ctx, "AD_WF_Node", m_WFNode); Object_Status = "Update"; @@ -264,6 +267,8 @@ public class WorkflowNodeElementHandler extends AbstractElementHandler { String sql = null; String name = null; 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("", "", "Name", "CDATA", (m_WF_Node.getName() != null ? m_WF_Node.getName() : "")); diff --git a/base/src/org/adempiere/pipo/handler/WorkflowNodeNextConditionElementHandler.java b/base/src/org/adempiere/pipo/handler/WorkflowNodeNextConditionElementHandler.java index 35e9ed4c9f..31804ba0fa 100644 --- a/base/src/org/adempiere/pipo/handler/WorkflowNodeNextConditionElementHandler.java +++ b/base/src/org/adempiere/pipo/handler/WorkflowNodeNextConditionElementHandler.java @@ -22,6 +22,7 @@ import javax.xml.transform.sax.TransformerHandler; import org.adempiere.pipo.AbstractElementHandler; import org.adempiere.pipo.Element; +import org.adempiere.pipo.PackOut; import org.adempiere.pipo.exception.POSaveFailedException; import org.compiere.model.X_AD_WF_NextCondition; import org.compiere.util.DB; @@ -93,6 +94,8 @@ public class WorkflowNodeNextConditionElementHandler extends id, getTrxName(ctx)); int AD_Backup_ID = -1; 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) { AD_Backup_ID = copyRecord(ctx, "AD_WF_NextCondition", m_WFNodeNextCondition); @@ -181,6 +184,8 @@ public class WorkflowNodeNextConditionElementHandler extends String sql = null; String name = null; 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) { // FIXME: it appears nodes point back to themselves diff --git a/base/src/org/adempiere/pipo/handler/WorkflowNodeNextElementHandler.java b/base/src/org/adempiere/pipo/handler/WorkflowNodeNextElementHandler.java index 74196d36e1..892b4b15c0 100644 --- a/base/src/org/adempiere/pipo/handler/WorkflowNodeNextElementHandler.java +++ b/base/src/org/adempiere/pipo/handler/WorkflowNodeNextElementHandler.java @@ -22,6 +22,7 @@ import javax.xml.transform.sax.TransformerHandler; import org.adempiere.pipo.AbstractElementHandler; import org.adempiere.pipo.Element; +import org.adempiere.pipo.PackOut; import org.adempiere.pipo.exception.POSaveFailedException; import org.compiere.model.X_AD_WF_NextCondition; 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)); int AD_Backup_ID = -1; 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){ AD_Backup_ID = copyRecord(ctx, "AD_WF_NodeNext",m_WFNodeNext); Object_Status = "Update"; @@ -134,6 +137,8 @@ public class WorkflowNodeNextElementHandler extends AbstractElementHandler { String sql = null; String name = null; 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: ", // m_WF_NodeNext.getAD_WF_Node_ID()); // log.log(Level.INFO,"m_WF_NodeNext.getAD_WF_Next_ID: ", diff --git a/base/src/org/compiere/model/PO.java b/base/src/org/compiere/model/PO.java index 4033a75ff2..c21cb86928 100644 --- a/base/src/org/compiere/model/PO.java +++ b/base/src/org/compiere/model/PO.java @@ -2627,6 +2627,8 @@ public abstract class PO */ protected int saveNew_getID() { + if (get_ID() < 999999) // 2Pack assigns official ID's when importing + return get_ID(); return 0; } // saveNew_getID