From a6af9e3a6f219c5cd00b3d4e68d59f120826613b Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Wed, 9 Oct 2013 18:03:51 +0800 Subject: [PATCH] 1003322 2Pack enhancement for Extension Development. --- .../oracle/201310090926_1003322.sql | 41 +++++++++++++++++++ .../postgresql/201310090926_1003322.sql | 38 +++++++++++++++++ .../org/compiere/model/I_AD_Package_Exp.java | 9 ++++ .../org/compiere/model/X_AD_Package_Exp.java | 25 ++++++++++- .../pipo2/handler/AdElementHandler.java | 7 +--- .../handler/AttachmentElementHandler.java | 7 +--- .../pipo2/handler/ColumnElementHandler.java | 7 +--- .../handler/DynValRuleElementHandler.java | 7 +--- .../pipo2/handler/FieldElementHandler.java | 7 +--- .../handler/FieldGroupElementHandler.java | 7 +--- .../handler/FormAccessElementHandler.java | 7 +--- .../pipo2/handler/FormElementHandler.java | 7 +--- .../handler/GenericPOElementHandler.java | 14 +------ .../handler/ImpFormatElementHandler.java | 7 +--- .../handler/ImpFormatRowElementHandler.java | 7 +--- .../pipo2/handler/MessageElementHandler.java | 7 +--- .../handler/ModelValidatorElementHandler.java | 7 +--- .../handler/ModificationElementHandler.java | 7 +--- .../pipo2/handler/OrgRoleElementHandler.java | 7 +--- .../handler/PreferenceElementHandler.java | 7 +--- .../handler/PrintFormatElementHandler.java | 7 +--- .../PrintFormatItemElementHandler.java | 7 +--- .../handler/PrintPaperElementHandler.java | 7 +--- .../handler/ProcessAccessElementHandler.java | 7 +--- .../pipo2/handler/ProcessElementHandler.java | 8 +--- .../handler/ProcessParaElementHandler.java | 7 +--- .../handler/ReferenceElementHandler.java | 8 +--- .../handler/ReferenceListElementHandler.java | 7 +--- .../handler/ReferenceTableElementHandler.java | 7 +--- .../handler/ReportViewColElementHandler.java | 7 +--- .../handler/ReportViewElementHandler.java | 7 +--- .../pipo2/handler/RoleElementHandler.java | 7 +--- .../pipo2/handler/TabElementHandler.java | 7 +--- .../pipo2/handler/TableElementHandler.java | 7 +--- .../handler/TaskAccessElementHandler.java | 7 +--- .../pipo2/handler/TaskElementHandler.java | 7 +--- .../pipo2/handler/UserRoleElementHandler.java | 7 +--- .../handler/WindowAccessElementHandler.java | 7 +--- .../pipo2/handler/WindowElementHandler.java | 7 +--- .../handler/WorkflowAccessElementHandler.java | 7 +--- .../pipo2/handler/WorkflowElementHandler.java | 11 ++--- .../handler/WorkflowNodeElementHandler.java | 7 +--- ...rkflowNodeNextConditionElementHandler.java | 7 +--- .../WorkflowNodeNextElementHandler.java | 7 +--- .../pipo2/AbstractElementHandler.java | 18 +++++++- .../org/adempiere/pipo2/PackInHandler.java | 5 +++ .../src/org/adempiere/pipo2/PackOut.java | 9 ++++ .../org/adempiere/pipo2/PackOutProcess.java | 1 + 48 files changed, 218 insertions(+), 221 deletions(-) create mode 100644 migration/i1.0c-release/oracle/201310090926_1003322.sql create mode 100644 migration/i1.0c-release/postgresql/201310090926_1003322.sql diff --git a/migration/i1.0c-release/oracle/201310090926_1003322.sql b/migration/i1.0c-release/oracle/201310090926_1003322.sql new file mode 100644 index 0000000000..ca78340fc7 --- /dev/null +++ b/migration/i1.0c-release/oracle/201310090926_1003322.sql @@ -0,0 +1,41 @@ +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- Oct 9, 2013 4:44:19 PM MYT +-- 1003322 2Pack enhancement for Extension Development +INSERT INTO AD_Element (ColumnName,AD_Element_ID,Name,PrintName,AD_Element_UU,Created,Updated,CreatedBy,AD_Org_ID,UpdatedBy,IsActive,AD_Client_ID,EntityType) VALUES ('IsExportDictionaryEntity',202618,'Export Dictionary Entity','Export Dictionary Entity','3d4310f3-fec3-4e92-9c4b-c8febabce9e6',TO_DATE('2013-10-09 16:44:16','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2013-10-09 16:44:16','YYYY-MM-DD HH24:MI:SS'),100,0,100,'Y',0,'D') +; + +-- Oct 9, 2013 4:44:53 PM MYT +-- 1003322 2Pack enhancement for Extension Development +INSERT INTO AD_Column (SeqNoSelection,IsSyncDatabase,Version,AD_Table_ID,AD_Column_ID,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsKey,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsUpdateable,ColumnName,DefaultValue,Name,IsAllowCopy,Updated,CreatedBy,AD_Org_ID,IsActive,Created,UpdatedBy,IsToolbarButton,IsAlwaysUpdateable,AD_Client_ID,EntityType,IsEncrypted,AD_Element_ID,IsSecure) VALUES (0,'N',1,50005,210878,'Y','N','N',0,'N',1,'N',20,'N','N','Y','d4142a11-aa11-404f-864c-d6ec13f036c6','Y','IsExportDictionaryEntity','N','Export Dictionary Entity','Y',TO_DATE('2013-10-09 16:44:52','YYYY-MM-DD HH24:MI:SS'),100,0,'Y',TO_DATE('2013-10-09 16:44:52','YYYY-MM-DD HH24:MI:SS'),100,'N','N',0,'D','N',202618,'N') +; + +-- Oct 9, 2013 4:44:59 PM MYT +-- 1003322 2Pack enhancement for Extension Development +ALTER TABLE AD_Package_Exp ADD IsExportDictionaryEntity CHAR(1) DEFAULT 'N' CHECK (IsExportDictionaryEntity IN ('Y','N')) NOT NULL +; + +-- Oct 9, 2013 4:46:02 PM MYT +-- 1003322 2Pack enhancement for Extension Development +INSERT INTO AD_Field (SortNo,IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,AD_Field_UU,IsDisplayed,IsFieldOnly,UpdatedBy,AD_Org_ID,Created,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,IsQuickEntry,AD_Client_ID,ColumnSpan,NumLines,IsAdvancedField) VALUES (0,'N',50005,0,'N','N',210878,100,'Y',202525,'N','D','Export Dictionary Entity','1b303e2f-6aad-4a7e-a5e9-61430a74f821','Y','N',100,0,TO_DATE('2013-10-09 16:46:02','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2013-10-09 16:46:02','YYYY-MM-DD HH24:MI:SS'),'Y','Y',100,2,'N',0,2,1,'N') +; + +-- Oct 9, 2013 4:47:05 PM MYT +-- 1003322 2Pack enhancement for Extension Development +UPDATE AD_Field SET SeqNo=100, SeqNoGrid=100, XPosition=2,Updated=TO_DATE('2013-10-09 16:47:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50085 +; + +-- Oct 9, 2013 4:47:22 PM MYT +-- 1003322 2Pack enhancement for Extension Development +UPDATE AD_Field SET SeqNo=90, SeqNoGrid=90, XPosition=5,Updated=TO_DATE('2013-10-09 16:47:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202525 +; + +-- Oct 9, 2013 5:59:32 PM MYT +-- 1003322 2Pack enhancement for Extension Development +UPDATE AD_Field SET DisplayLogic='@AD_Client_ID@=0',Updated=TO_DATE('2013-10-09 17:59:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202525 +; + +SELECT register_migration_script('201310090926_1003322.sql') FROM dual +; + diff --git a/migration/i1.0c-release/postgresql/201310090926_1003322.sql b/migration/i1.0c-release/postgresql/201310090926_1003322.sql new file mode 100644 index 0000000000..8dbd9a3037 --- /dev/null +++ b/migration/i1.0c-release/postgresql/201310090926_1003322.sql @@ -0,0 +1,38 @@ +-- Oct 9, 2013 4:44:19 PM MYT +-- 1003322 2Pack enhancement for Extension Development +INSERT INTO AD_Element (ColumnName,AD_Element_ID,Name,PrintName,AD_Element_UU,Created,Updated,CreatedBy,AD_Org_ID,UpdatedBy,IsActive,AD_Client_ID,EntityType) VALUES ('IsExportDictionaryEntity',202618,'Export Dictionary Entity','Export Dictionary Entity','3d4310f3-fec3-4e92-9c4b-c8febabce9e6',TO_TIMESTAMP('2013-10-09 16:44:16','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2013-10-09 16:44:16','YYYY-MM-DD HH24:MI:SS'),100,0,100,'Y',0,'D') +; + +-- Oct 9, 2013 4:44:53 PM MYT +-- 1003322 2Pack enhancement for Extension Development +INSERT INTO AD_Column (SeqNoSelection,IsSyncDatabase,Version,AD_Table_ID,AD_Column_ID,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsKey,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsUpdateable,ColumnName,DefaultValue,Name,IsAllowCopy,Updated,CreatedBy,AD_Org_ID,IsActive,Created,UpdatedBy,IsToolbarButton,IsAlwaysUpdateable,AD_Client_ID,EntityType,IsEncrypted,AD_Element_ID,IsSecure) VALUES (0,'N',1,50005,210878,'Y','N','N',0,'N',1,'N',20,'N','N','Y','d4142a11-aa11-404f-864c-d6ec13f036c6','Y','IsExportDictionaryEntity','N','Export Dictionary Entity','Y',TO_TIMESTAMP('2013-10-09 16:44:52','YYYY-MM-DD HH24:MI:SS'),100,0,'Y',TO_TIMESTAMP('2013-10-09 16:44:52','YYYY-MM-DD HH24:MI:SS'),100,'N','N',0,'D','N',202618,'N') +; + +-- Oct 9, 2013 4:44:59 PM MYT +-- 1003322 2Pack enhancement for Extension Development +ALTER TABLE AD_Package_Exp ADD COLUMN IsExportDictionaryEntity CHAR(1) DEFAULT 'N' CHECK (IsExportDictionaryEntity IN ('Y','N')) NOT NULL +; + +-- Oct 9, 2013 4:46:02 PM MYT +-- 1003322 2Pack enhancement for Extension Development +INSERT INTO AD_Field (SortNo,IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,AD_Field_UU,IsDisplayed,IsFieldOnly,UpdatedBy,AD_Org_ID,Created,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,IsQuickEntry,AD_Client_ID,ColumnSpan,NumLines,IsAdvancedField) VALUES (0,'N',50005,0,'N','N',210878,100,'Y',202525,'N','D','Export Dictionary Entity','1b303e2f-6aad-4a7e-a5e9-61430a74f821','Y','N',100,0,TO_TIMESTAMP('2013-10-09 16:46:02','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2013-10-09 16:46:02','YYYY-MM-DD HH24:MI:SS'),'Y','Y',100,2,'N',0,2,1,'N') +; + +-- Oct 9, 2013 4:47:05 PM MYT +-- 1003322 2Pack enhancement for Extension Development +UPDATE AD_Field SET SeqNo=100, SeqNoGrid=100, XPosition=2,Updated=TO_TIMESTAMP('2013-10-09 16:47:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50085 +; + +-- Oct 9, 2013 4:47:22 PM MYT +-- 1003322 2Pack enhancement for Extension Development +UPDATE AD_Field SET SeqNo=90, SeqNoGrid=90, XPosition=5,Updated=TO_TIMESTAMP('2013-10-09 16:47:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202525 +; + +-- Oct 9, 2013 5:59:32 PM MYT +-- 1003322 2Pack enhancement for Extension Development +UPDATE AD_Field SET DisplayLogic='@AD_Client_ID@=0',Updated=TO_TIMESTAMP('2013-10-09 17:59:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202525 +; + +SELECT register_migration_script('201310090926_1003322.sql') FROM dual +; + diff --git a/org.adempiere.base/src/org/compiere/model/I_AD_Package_Exp.java b/org.adempiere.base/src/org/compiere/model/I_AD_Package_Exp.java index d1a1ec5f6c..fddf3b036a 100644 --- a/org.adempiere.base/src/org/compiere/model/I_AD_Package_Exp.java +++ b/org.adempiere.base/src/org/compiere/model/I_AD_Package_Exp.java @@ -175,6 +175,15 @@ public interface I_AD_Package_Exp */ public boolean isActive(); + /** Column name IsExportDictionaryEntity */ + public static final String COLUMNNAME_IsExportDictionaryEntity = "IsExportDictionaryEntity"; + + /** Set Export Dictionary Entity */ + public void setIsExportDictionaryEntity (boolean IsExportDictionaryEntity); + + /** Get Export Dictionary Entity */ + public boolean isExportDictionaryEntity(); + /** Column name Name */ public static final String COLUMNNAME_Name = "Name"; diff --git a/org.adempiere.base/src/org/compiere/model/X_AD_Package_Exp.java b/org.adempiere.base/src/org/compiere/model/X_AD_Package_Exp.java index ec94844ff2..3f8d50d1e1 100644 --- a/org.adempiere.base/src/org/compiere/model/X_AD_Package_Exp.java +++ b/org.adempiere.base/src/org/compiere/model/X_AD_Package_Exp.java @@ -31,7 +31,7 @@ public class X_AD_Package_Exp extends PO implements I_AD_Package_Exp, I_Persiste /** * */ - private static final long serialVersionUID = 20130626L; + private static final long serialVersionUID = 20131009L; /** Standard Constructor */ public X_AD_Package_Exp (Properties ctx, int AD_Package_Exp_ID, String trxName) @@ -40,6 +40,8 @@ public class X_AD_Package_Exp extends PO implements I_AD_Package_Exp, I_Persiste /** if (AD_Package_Exp_ID == 0) { setAD_Package_Exp_ID (0); + setIsExportDictionaryEntity (false); +// N setName (null); setPK_Version (null); setProcessing (false); @@ -210,6 +212,27 @@ public class X_AD_Package_Exp extends PO implements I_AD_Package_Exp, I_Persiste return (String)get_Value(COLUMNNAME_Instructions); } + /** Set Export Dictionary Entity. + @param IsExportDictionaryEntity Export Dictionary Entity */ + public void setIsExportDictionaryEntity (boolean IsExportDictionaryEntity) + { + set_Value (COLUMNNAME_IsExportDictionaryEntity, Boolean.valueOf(IsExportDictionaryEntity)); + } + + /** Get Export Dictionary Entity. + @return Export Dictionary Entity */ + public boolean isExportDictionaryEntity () + { + Object oo = get_Value(COLUMNNAME_IsExportDictionaryEntity); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + /** Set Name. @param Name Alphanumeric identifier of the entity diff --git a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/AdElementHandler.java b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/AdElementHandler.java index a929f6e80d..88bf8417d8 100644 --- a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/AdElementHandler.java +++ b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/AdElementHandler.java @@ -111,11 +111,8 @@ public class AdElementHandler extends AbstractElementHandler { return; X_AD_Element mAdElement = new X_AD_Element(ctx.ctx, adElement_id, null); - if (ctx.packOut.getFromDate() != null) { - if (mAdElement.getUpdated().compareTo(ctx.packOut.getFromDate()) < 0) { - return; - } - } + if (!isPackOutElement(ctx, mAdElement)) + return; verifyPackOutRequirement(mAdElement); diff --git a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/AttachmentElementHandler.java b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/AttachmentElementHandler.java index 9dd4e1b1a7..e9edd2ff8c 100644 --- a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/AttachmentElementHandler.java +++ b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/AttachmentElementHandler.java @@ -103,11 +103,8 @@ public class AttachmentElementHandler extends AbstractElementHandler { MAttachment mAttachment = new MAttachment(ctx.ctx, AD_Attachment_ID, getTrxName(ctx)); - if (ctx.packOut.getFromDate() != null) { - if (mAttachment.getUpdated().compareTo(ctx.packOut.getFromDate()) < 0) { - return; - } - } + if (!isPackOutElement(ctx, mAttachment)) + return; verifyPackOutRequirement(mAttachment); diff --git a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/ColumnElementHandler.java b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/ColumnElementHandler.java index 874ac7a591..c2b33416d4 100644 --- a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/ColumnElementHandler.java +++ b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/ColumnElementHandler.java @@ -301,11 +301,8 @@ public class ColumnElementHandler extends AbstractElementHandler { X_AD_Column m_Column = new X_AD_Column(ctx.ctx, AD_Column_ID, getTrxName(ctx)); - if (ctx.packOut.getFromDate() != null) { - if (m_Column.getUpdated().compareTo(ctx.packOut.getFromDate()) < 0) { - return; - } - } + if (!isPackOutElement(ctx, m_Column)) + return; verifyPackOutRequirement(m_Column); diff --git a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/DynValRuleElementHandler.java b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/DynValRuleElementHandler.java index e56742cd73..ca173d2cc8 100644 --- a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/DynValRuleElementHandler.java +++ b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/DynValRuleElementHandler.java @@ -92,11 +92,8 @@ public class DynValRuleElementHandler extends AbstractElementHandler { return; X_AD_Val_Rule m_ValRule = new X_AD_Val_Rule (ctx.ctx, AD_Val_Rule_ID, null); - if (ctx.packOut.getFromDate() != null) { - if (m_ValRule.getUpdated().compareTo(ctx.packOut.getFromDate()) < 0) { - return; - } - } + if (!isPackOutElement(ctx, m_ValRule)) + return; verifyPackOutRequirement(m_ValRule); diff --git a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/FieldElementHandler.java b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/FieldElementHandler.java index 9cad376864..5650fc14a0 100644 --- a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/FieldElementHandler.java +++ b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/FieldElementHandler.java @@ -126,11 +126,8 @@ public class FieldElementHandler extends AbstractElementHandler { throw new SAXException(e); } - if (ctx.packOut.getFromDate() != null) { - if (m_Field.getUpdated().compareTo(ctx.packOut.getFromDate()) < 0) { - return; - } - } + if (!isPackOutElement(ctx, m_Field)) + return; verifyPackOutRequirement(m_Field); diff --git a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/FieldGroupElementHandler.java b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/FieldGroupElementHandler.java index 99a28df07b..cffe0375a0 100644 --- a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/FieldGroupElementHandler.java +++ b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/FieldGroupElementHandler.java @@ -116,11 +116,8 @@ public class FieldGroupElementHandler extends AbstractElementHandler { X_AD_FieldGroup fieldGroup = new X_AD_FieldGroup(ctx.ctx, fieldGroup_id, null); - if (ctx.packOut.getFromDate() != null) { - if (fieldGroup.getUpdated().compareTo(ctx.packOut.getFromDate()) < 0) { - return; - } - } + if (!isPackOutElement(ctx, fieldGroup)) + return; verifyPackOutRequirement(fieldGroup); diff --git a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/FormAccessElementHandler.java b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/FormAccessElementHandler.java index 9e2a74e5a3..ffddf51a17 100644 --- a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/FormAccessElementHandler.java +++ b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/FormAccessElementHandler.java @@ -70,11 +70,8 @@ public class FormAccessElementHandler extends AbstractElementHandler { if (po != null) { - if (ctx.packOut.getFromDate() != null) { - if (po.getUpdated().compareTo(ctx.packOut.getFromDate()) < 0) { - return; - } - } + if (!isPackOutElement(ctx, po)) + return; verifyPackOutRequirement(po); diff --git a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/FormElementHandler.java b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/FormElementHandler.java index 8ed79316ca..7ce1e19c85 100644 --- a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/FormElementHandler.java +++ b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/FormElementHandler.java @@ -94,11 +94,8 @@ public class FormElementHandler extends AbstractElementHandler { X_AD_Form m_Form = new X_AD_Form (ctx.ctx, AD_Form_ID, null); - if (ctx.packOut.getFromDate() != null) { - if (m_Form.getUpdated().compareTo(ctx.packOut.getFromDate()) < 0) { - return; - } - } + if (!isPackOutElement(ctx, m_Form)) + return; verifyPackOutRequirement(m_Form); diff --git a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/GenericPOElementHandler.java b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/GenericPOElementHandler.java index 7fd30282c5..265ab607cb 100644 --- a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/GenericPOElementHandler.java +++ b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/GenericPOElementHandler.java @@ -120,12 +120,7 @@ public class GenericPOElementHandler extends AbstractElementHandler { if (AD_Client_ID != Env.getAD_Client_ID(ctx.ctx)) continue; - boolean createElement = true; - if (ctx.packOut.getFromDate() != null) { - if (po.getUpdated().compareTo(ctx.packOut.getFromDate()) < 0) { - createElement = false; - } - } + boolean createElement = isPackOutElement(ctx, po); if (createElement) { if (po.get_ID() > 0) { @@ -177,12 +172,7 @@ public class GenericPOElementHandler extends AbstractElementHandler { if (AD_Client_ID != Env.getAD_Client_ID(ctx.ctx)) continue; - boolean createElement = true; - if (ctx.packOut.getFromDate() != null) { - if (po.getUpdated().compareTo(ctx.packOut.getFromDate()) < 0) { - createElement = false; - } - } + boolean createElement = isPackOutElement(ctx, po); if (createElement) { if (po.get_ID() > 0) { ElementHandler handler = ctx.packOut.getHandler(po.get_TableName()); diff --git a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/ImpFormatElementHandler.java b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/ImpFormatElementHandler.java index a7157c64ee..9e884bbf79 100644 --- a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/ImpFormatElementHandler.java +++ b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/ImpFormatElementHandler.java @@ -97,11 +97,8 @@ public class ImpFormatElementHandler extends AbstractElementHandler { X_AD_ImpFormat m_ImpFormat = new X_AD_ImpFormat(ctx.ctx, import_id, null); boolean createElement = true; - if (ctx.packOut.getFromDate() != null) { - if (m_ImpFormat.getUpdated().compareTo(ctx.packOut.getFromDate()) < 0) { - createElement = false; - } - } + if (!isPackOutElement(ctx, m_ImpFormat)) + createElement = false; if (createElement) { verifyPackOutRequirement(m_ImpFormat); diff --git a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/ImpFormatRowElementHandler.java b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/ImpFormatRowElementHandler.java index e0caa44ae1..7236379da0 100644 --- a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/ImpFormatRowElementHandler.java +++ b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/ImpFormatRowElementHandler.java @@ -90,11 +90,8 @@ public class ImpFormatRowElementHandler extends AbstractElementHandler { X_AD_ImpFormat_Row m_ImpFormat_Row = new X_AD_ImpFormat_Row (ctx.ctx, AD_ImpFormat_Row_ID, getTrxName(ctx)); - if (ctx.packOut.getFromDate() != null) { - if (m_ImpFormat_Row.getUpdated().compareTo(ctx.packOut.getFromDate()) < 0) { - return; - } - } + if (!isPackOutElement(ctx, m_ImpFormat_Row)) + return; verifyPackOutRequirement(m_ImpFormat_Row); diff --git a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/MessageElementHandler.java b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/MessageElementHandler.java index 29843286b3..7cb90638f9 100644 --- a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/MessageElementHandler.java +++ b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/MessageElementHandler.java @@ -102,11 +102,8 @@ public class MessageElementHandler extends AbstractElementHandler { AttributesImpl atts = new AttributesImpl(); X_AD_Message m_Message = new X_AD_Message (ctx.ctx, AD_Message_ID, null); - if (ctx.packOut.getFromDate() != null) { - if (m_Message.getUpdated().compareTo(ctx.packOut.getFromDate()) < 0) { - return; - } - } + if (!isPackOutElement(ctx, m_Message)) + return; verifyPackOutRequirement(m_Message); diff --git a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/ModelValidatorElementHandler.java b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/ModelValidatorElementHandler.java index 057247438d..c1118eb271 100644 --- a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/ModelValidatorElementHandler.java +++ b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/ModelValidatorElementHandler.java @@ -94,11 +94,8 @@ public class ModelValidatorElementHandler extends AbstractElementHandler{ X_AD_ModelValidator validator = new X_AD_ModelValidator(ctx.ctx, ad_modelvalidator_id, null); - if (ctx.packOut.getFromDate() != null) { - if (validator.getUpdated().compareTo(ctx.packOut.getFromDate()) < 0) { - return; - } - } + if (!isPackOutElement(ctx, validator)) + return; verifyPackOutRequirement(validator); diff --git a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/ModificationElementHandler.java b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/ModificationElementHandler.java index 114d0620f6..4a0e3fa52e 100644 --- a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/ModificationElementHandler.java +++ b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/ModificationElementHandler.java @@ -109,11 +109,8 @@ public class ModificationElementHandler extends AbstractElementHandler{ X_AD_Modification modification = new X_AD_Modification(ctx.ctx, ad_modification_id, null); - if (ctx.packOut.getFromDate() != null) { - if (modification.getUpdated().compareTo(ctx.packOut.getFromDate()) < 0) { - return; - } - } + if (!isPackOutElement(ctx, modification)) + return; verifyPackOutRequirement(modification); diff --git a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/OrgRoleElementHandler.java b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/OrgRoleElementHandler.java index a7f6234ef1..81255b64c2 100644 --- a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/OrgRoleElementHandler.java +++ b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/OrgRoleElementHandler.java @@ -65,11 +65,8 @@ public class OrgRoleElementHandler extends AbstractElementHandler { Query query = new Query(ctx.ctx, "AD_Role_OrgAccess", "AD_Role_ID=? and AD_Org_ID=?", getTrxName(ctx)); X_AD_Role_OrgAccess po = query.setParameters(new Object[]{AD_Role_ID, AD_Org_ID}).first(); if (po != null) { - if (ctx.packOut.getFromDate() != null) { - if (po.getUpdated().compareTo(ctx.packOut.getFromDate()) < 0) { - return; - } - } + if (!isPackOutElement(ctx, po)) + return; verifyPackOutRequirement(po); diff --git a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/PreferenceElementHandler.java b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/PreferenceElementHandler.java index 0ad3d2c7ba..f0d1ca0240 100644 --- a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/PreferenceElementHandler.java +++ b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/PreferenceElementHandler.java @@ -112,11 +112,8 @@ public class PreferenceElementHandler extends AbstractElementHandler { X_AD_Preference m_Preference = new X_AD_Preference(ctx.ctx, AD_Preference_ID, getTrxName(ctx)); - if (ctx.packOut.getFromDate() != null) { - if (m_Preference.getUpdated().compareTo(ctx.packOut.getFromDate()) < 0) { - return; - } - } + if (!isPackOutElement(ctx, m_Preference)) + return; verifyPackOutRequirement(m_Preference); diff --git a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/PrintFormatElementHandler.java b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/PrintFormatElementHandler.java index 253caab6e6..3ab51e105a 100644 --- a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/PrintFormatElementHandler.java +++ b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/PrintFormatElementHandler.java @@ -114,12 +114,7 @@ public class PrintFormatElementHandler extends AbstractElementHandler { } } - boolean createElement = true; - if (ctx.packOut.getFromDate() != null) { - if (m_Printformat.getUpdated().compareTo(ctx.packOut.getFromDate()) < 0) { - createElement = false; - } - } + boolean createElement = isPackOutElement(ctx, m_Printformat); int size = m_Printformat.getItemCount(); for(int i = 0; i < size; i++) { diff --git a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/PrintFormatItemElementHandler.java b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/PrintFormatItemElementHandler.java index 7f2108e366..8455251468 100644 --- a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/PrintFormatItemElementHandler.java +++ b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/PrintFormatItemElementHandler.java @@ -96,11 +96,8 @@ public class PrintFormatItemElementHandler extends AbstractElementHandler { X_AD_PrintFormatItem m_PrintFormatItem = new X_AD_PrintFormatItem(ctx.ctx, AD_PrintFormatItem_ID, null); - if (ctx.packOut.getFromDate() != null) { - if (m_PrintFormatItem.getUpdated().compareTo(ctx.packOut.getFromDate()) < 0) { - return; - } - } + if (!isPackOutElement(ctx, m_PrintFormatItem)) + return; verifyPackOutRequirement(m_PrintFormatItem); diff --git a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/PrintPaperElementHandler.java b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/PrintPaperElementHandler.java index eba1879229..d09042bd59 100644 --- a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/PrintPaperElementHandler.java +++ b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/PrintPaperElementHandler.java @@ -88,11 +88,8 @@ public class PrintPaperElementHandler extends AbstractElementHandler { X_AD_PrintPaper printPaper = new X_AD_PrintPaper(ctx.ctx, AD_PrintPaper_ID, null); - if (ctx.packOut.getFromDate() != null) { - if (printPaper.getUpdated().compareTo(ctx.packOut.getFromDate()) < 0) { - return; - } - } + if (!isPackOutElement(ctx, printPaper)) + return; verifyPackOutRequirement(printPaper); diff --git a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/ProcessAccessElementHandler.java b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/ProcessAccessElementHandler.java index e2879ba1ec..6e62db75d9 100644 --- a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/ProcessAccessElementHandler.java +++ b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/ProcessAccessElementHandler.java @@ -68,11 +68,8 @@ public class ProcessAccessElementHandler extends AbstractElementHandler { if (po != null) { - if (ctx.packOut.getFromDate() != null) { - if (po.getUpdated().compareTo(ctx.packOut.getFromDate()) < 0) { - return; - } - } + if (!isPackOutElement(ctx, po)) + return; verifyPackOutRequirement(po); diff --git a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/ProcessElementHandler.java b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/ProcessElementHandler.java index ee0920c94a..6baf9d5a95 100644 --- a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/ProcessElementHandler.java +++ b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/ProcessElementHandler.java @@ -138,13 +138,7 @@ public class ProcessElementHandler extends AbstractElementHandler { handler.packOut(packOut,document,null,m_Process.getAD_Workflow_ID()); } - boolean createElement = true; - - if (ctx.packOut.getFromDate() != null) { - if (m_Process.getUpdated().compareTo(ctx.packOut.getFromDate()) < 0) { - createElement = false; - } - } + boolean createElement = isPackOutElement(ctx, m_Process); if (createElement) { verifyPackOutRequirement(m_Process); diff --git a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/ProcessParaElementHandler.java b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/ProcessParaElementHandler.java index 371df90d62..20f9a8ef8c 100644 --- a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/ProcessParaElementHandler.java +++ b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/ProcessParaElementHandler.java @@ -114,11 +114,8 @@ public class ProcessParaElementHandler extends AbstractElementHandler { } } - if (ctx.packOut.getFromDate() != null) { - if (m_Processpara.getUpdated().compareTo(ctx.packOut.getFromDate()) < 0) { - return; - } - } + if (!isPackOutElement(ctx, m_Processpara)) + return; verifyPackOutRequirement(m_Processpara); diff --git a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/ReferenceElementHandler.java b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/ReferenceElementHandler.java index 282268d116..4be2a8b67b 100644 --- a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/ReferenceElementHandler.java +++ b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/ReferenceElementHandler.java @@ -114,12 +114,8 @@ public class ReferenceElementHandler extends AbstractElementHandler { X_AD_Reference m_Reference = new X_AD_Reference(ctx.ctx, Reference_id, getTrxName(ctx)); - boolean createElement = true; - if (ctx.packOut.getFromDate() != null) { - if (m_Reference.getUpdated().compareTo(ctx.packOut.getFromDate()) < 0) { - createElement = false; - } - } + boolean createElement = isPackOutElement(ctx, m_Reference); + PackOut packOut = ctx.packOut; packOut.getCtx().ctx.put("Table_Name",X_AD_Reference.Table_Name); if (createElement) { diff --git a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/ReferenceListElementHandler.java b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/ReferenceListElementHandler.java index 3155e85439..71075c52bd 100644 --- a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/ReferenceListElementHandler.java +++ b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/ReferenceListElementHandler.java @@ -97,11 +97,8 @@ public class ReferenceListElementHandler extends AbstractElementHandler { return; X_AD_Ref_List m_Ref_List = new X_AD_Ref_List(ctx.ctx, AD_Ref_List_ID, getTrxName(ctx)); - if (ctx.packOut.getFromDate() != null) { - if (m_Ref_List.getUpdated().compareTo(ctx.packOut.getFromDate()) < 0) { - return; - } - } + if (!isPackOutElement(ctx, m_Ref_List)) + return; verifyPackOutRequirement(m_Ref_List); diff --git a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/ReferenceTableElementHandler.java b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/ReferenceTableElementHandler.java index fea8a1c4c3..65498fda72 100644 --- a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/ReferenceTableElementHandler.java +++ b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/ReferenceTableElementHandler.java @@ -112,11 +112,8 @@ public class ReferenceTableElementHandler extends AbstractElementHandler { rs = pstmt.executeQuery(); if (rs.next()) { X_AD_Ref_Table refTable = new X_AD_Ref_Table(ctx.ctx, rs, getTrxName(ctx)); - if (ctx.packOut.getFromDate() != null) { - if (refTable.getUpdated().compareTo(ctx.packOut.getFromDate()) < 0) { - return; - } - } + if (!isPackOutElement(ctx, refTable)) + return; verifyPackOutRequirement(refTable); diff --git a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/ReportViewColElementHandler.java b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/ReportViewColElementHandler.java index 55dbd344fa..28f5d4c623 100644 --- a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/ReportViewColElementHandler.java +++ b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/ReportViewColElementHandler.java @@ -94,11 +94,8 @@ public class ReportViewColElementHandler extends AbstractElementHandler { X_AD_ReportView_Col m_Reportview_Col = new X_AD_ReportView_Col(ctx.ctx, AD_ReportView_Col_ID, getTrxName(ctx)); - if (ctx.packOut.getFromDate() != null) { - if (m_Reportview_Col.getUpdated().compareTo(ctx.packOut.getFromDate()) < 0) { - return; - } - } + if (!isPackOutElement(ctx, m_Reportview_Col)) + return; verifyPackOutRequirement(m_Reportview_Col); diff --git a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/ReportViewElementHandler.java b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/ReportViewElementHandler.java index b993d522f0..e35852f168 100644 --- a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/ReportViewElementHandler.java +++ b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/ReportViewElementHandler.java @@ -107,12 +107,7 @@ public class ReportViewElementHandler extends AbstractElementHandler { throw new RuntimeException(e); } - boolean createElement = true; - if (ctx.packOut.getFromDate() != null) { - if (m_Reportview.getUpdated().compareTo(ctx.packOut.getFromDate()) < 0) { - createElement = false; - } - } + boolean createElement = isPackOutElement(ctx, m_Reportview); if (createElement) { verifyPackOutRequirement(m_Reportview); diff --git a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/RoleElementHandler.java b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/RoleElementHandler.java index 01928d5c32..8fde13353d 100644 --- a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/RoleElementHandler.java +++ b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/RoleElementHandler.java @@ -107,13 +107,8 @@ public class RoleElementHandler extends AbstractElementHandler { if (ctx.packOut.isExported(X_AD_Package_Exp_Detail.COLUMNNAME_AD_Role_ID+"|"+Role_id)) return; - boolean createElement = true; X_AD_Role m_Role = new X_AD_Role(ctx.ctx, Role_id, null); - if (ctx.packOut.getFromDate() != null) { - if (m_Role.getUpdated().compareTo(ctx.packOut.getFromDate()) < 0) { - createElement = false; - } - } + boolean createElement = isPackOutElement(ctx, m_Role); if (createElement) { verifyPackOutRequirement(m_Role); diff --git a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/TabElementHandler.java b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/TabElementHandler.java index 344f14e337..12904daccb 100644 --- a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/TabElementHandler.java +++ b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/TabElementHandler.java @@ -108,13 +108,8 @@ public class TabElementHandler extends AbstractElementHandler { if (ctx.packOut.isExported("AD_Tab_ID"+"|"+AD_Tab_ID)) return; - boolean createElement = true; X_AD_Tab m_Tab = new X_AD_Tab (ctx.ctx, AD_Tab_ID, getTrxName(ctx)); - if (ctx.packOut.getFromDate() != null) { - if (m_Tab.getUpdated().compareTo(ctx.packOut.getFromDate()) < 0) { - createElement = false; - } - } + boolean createElement = isPackOutElement(ctx, m_Tab); if (createElement) { verifyPackOutRequirement(m_Tab); AttributesImpl atts = new AttributesImpl(); diff --git a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/TableElementHandler.java b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/TableElementHandler.java index d40a278e17..d88205dd91 100644 --- a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/TableElementHandler.java +++ b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/TableElementHandler.java @@ -107,13 +107,8 @@ public class TableElementHandler extends AbstractElementHandler { return; PackOut packOut = ctx.packOut; AttributesImpl atts = new AttributesImpl(); - boolean createElement = true; X_AD_Table m_Table = new X_AD_Table (ctx.ctx, AD_Table_ID, null); - if (ctx.packOut.getFromDate() != null) { - if (m_Table.getUpdated().compareTo(ctx.packOut.getFromDate()) < 0) { - createElement = false; - } - } + boolean createElement = isPackOutElement(ctx, m_Table); if (createElement) { verifyPackOutRequirement(m_Table); addTypeName(atts, "table"); diff --git a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/TaskAccessElementHandler.java b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/TaskAccessElementHandler.java index 720ee261e8..0f0c9d05fd 100644 --- a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/TaskAccessElementHandler.java +++ b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/TaskAccessElementHandler.java @@ -64,11 +64,8 @@ public class TaskAccessElementHandler extends AbstractElementHandler { Query query = new Query(ctx.ctx, "AD_Task_Access", "AD_Role_ID=? and AD_Task_ID=?", getTrxName(ctx)); X_AD_Task_Access po = query.setParameters(new Object[]{AD_Role_ID, AD_Task_ID}).first(); if (po != null) { - if (ctx.packOut.getFromDate() != null) { - if (po.getUpdated().compareTo(ctx.packOut.getFromDate()) < 0) { - return; - } - } + if (!isPackOutElement(ctx, po)) + return; verifyPackOutRequirement(po); AttributesImpl atts = new AttributesImpl(); addTypeName(atts, "table"); diff --git a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/TaskElementHandler.java b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/TaskElementHandler.java index 88a42cd912..831928c1f4 100644 --- a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/TaskElementHandler.java +++ b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/TaskElementHandler.java @@ -95,11 +95,8 @@ public class TaskElementHandler extends AbstractElementHandler { return; X_AD_Task m_Task = new X_AD_Task(ctx.ctx, AD_Task_ID, null); - if (ctx.packOut.getFromDate() != null) { - if (m_Task.getUpdated().compareTo(ctx.packOut.getFromDate()) < 0) { - return; - } - } + if (!isPackOutElement(ctx, m_Task)) + return; verifyPackOutRequirement(m_Task); AttributesImpl atts = new AttributesImpl(); addTypeName(atts, "table"); diff --git a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/UserRoleElementHandler.java b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/UserRoleElementHandler.java index fa53a3c18e..2ed746c279 100644 --- a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/UserRoleElementHandler.java +++ b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/UserRoleElementHandler.java @@ -69,11 +69,8 @@ public class UserRoleElementHandler extends AbstractElementHandler { X_AD_User_Roles po = query.setParameters( new Object[] { AD_User_ID, AD_Role_ID, AD_Org_ID }).first(); if (po != null) { - if (ctx.packOut.getFromDate() != null) { - if (po.getUpdated().compareTo(ctx.packOut.getFromDate()) < 0) { - return; - } - } + if (!isPackOutElement(ctx, po)) + return; verifyPackOutRequirement(po); AttributesImpl atts = new AttributesImpl(); addTypeName(atts, "table"); diff --git a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/WindowAccessElementHandler.java b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/WindowAccessElementHandler.java index 9956084bd3..02ef45f276 100644 --- a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/WindowAccessElementHandler.java +++ b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/WindowAccessElementHandler.java @@ -64,11 +64,8 @@ public class WindowAccessElementHandler extends AbstractElementHandler { Query query = new Query(ctx.ctx, "AD_Window_Access", "AD_Role_ID=? and AD_Window_ID=?", getTrxName(ctx)); X_AD_Window_Access po = query.setParameters(new Object[]{AD_Role_ID, AD_Window_ID}).first(); if (po != null) { - if (ctx.packOut.getFromDate() != null) { - if (po.getUpdated().compareTo(ctx.packOut.getFromDate()) < 0) { - return; - } - } + if (!isPackOutElement(ctx, po)) + return; verifyPackOutRequirement(po); AttributesImpl atts = new AttributesImpl(); addTypeName(atts, "table"); diff --git a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/WindowElementHandler.java b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/WindowElementHandler.java index ecedb53f41..1085e8f46d 100644 --- a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/WindowElementHandler.java +++ b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/WindowElementHandler.java @@ -115,13 +115,8 @@ public class WindowElementHandler extends AbstractElementHandler { return; PackOut packOut = ctx.packOut; - boolean createElement = true; X_AD_Window m_Window = new X_AD_Window(ctx.ctx, AD_Window_ID, null); - if (ctx.packOut.getFromDate() != null) { - if (m_Window.getUpdated().compareTo(ctx.packOut.getFromDate()) < 0) { - createElement = false; - } - } + boolean createElement = isPackOutElement(ctx, m_Window); //export color if (m_Window.getAD_Color_ID() > 0) { diff --git a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/WorkflowAccessElementHandler.java b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/WorkflowAccessElementHandler.java index 10fb786bd6..3a5a9a2c69 100644 --- a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/WorkflowAccessElementHandler.java +++ b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/WorkflowAccessElementHandler.java @@ -67,11 +67,8 @@ public class WorkflowAccessElementHandler extends AbstractElementHandler { Query query = new Query(ctx.ctx, "AD_Workflow_Access", "AD_Role_ID=? and AD_Workflow_ID=?", getTrxName(ctx)); po = query.setParameters(new Object[]{AD_Role_ID, AD_Workflow_ID}).first(); if (po != null) { - if (ctx.packOut.getFromDate() != null) { - if (po.getUpdated().compareTo(ctx.packOut.getFromDate()) < 0) { - return; - } - } + if (!isPackOutElement(ctx, po)) + return; verifyPackOutRequirement(po); AttributesImpl atts = new AttributesImpl(); addTypeName(atts, "table"); diff --git a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/WorkflowElementHandler.java b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/WorkflowElementHandler.java index eb1f59c5b3..8f394348c6 100644 --- a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/WorkflowElementHandler.java +++ b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/WorkflowElementHandler.java @@ -152,15 +152,10 @@ public class WorkflowElementHandler extends AbstractElementHandler { int ad_wf_nodenextcondition_id = 0; AttributesImpl atts = new AttributesImpl(); - boolean creatElement = true; MWorkflow m_Workflow = new MWorkflow(ctx.ctx, AD_Workflow_ID, null); - if (ctx.packOut.getFromDate() != null) { - if (m_Workflow.getUpdated().compareTo(ctx.packOut.getFromDate()) < 0) { - creatElement = false; - } - } - if (creatElement) { + boolean createElement = isPackOutElement(ctx, m_Workflow); + if (createElement) { atts.addAttribute("", "", "type", "CDATA", "object"); atts.addAttribute("", "", "type-name", "CDATA", "ad.workflow"); document.startElement("", "", I_AD_Workflow.Table_Name, atts); @@ -213,7 +208,7 @@ public class WorkflowElementHandler extends AbstractElementHandler { DB.close(rs, pstmt); DB.close(nodeNextrs, psNodeNext); DB.close(nodeNConditionrs,psNCondition); - if (creatElement) { + if (createElement) { document.endElement("", "", MWorkflow.Table_Name); } } diff --git a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/WorkflowNodeElementHandler.java b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/WorkflowNodeElementHandler.java index c989d3096c..76c7d96d44 100644 --- a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/WorkflowNodeElementHandler.java +++ b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/WorkflowNodeElementHandler.java @@ -109,11 +109,8 @@ public class WorkflowNodeElementHandler extends AbstractElementHandler { AttributesImpl atts = new AttributesImpl(); MWFNode m_WF_Node = new MWFNode(ctx.ctx, AD_WF_Node_ID, getTrxName(ctx)); - if (ctx.packOut.getFromDate() != null) { - if (m_WF_Node.getUpdated().compareTo(ctx.packOut.getFromDate()) < 0) { - return; - } - } + if (!isPackOutElement(ctx, m_WF_Node)) + return; verifyPackOutRequirement(m_WF_Node); addTypeName(atts, "table"); document.startElement("", "", I_AD_WF_Node.Table_Name, atts); diff --git a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/WorkflowNodeNextConditionElementHandler.java b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/WorkflowNodeNextConditionElementHandler.java index 7a1d9a4890..f83c0b9929 100644 --- a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/WorkflowNodeNextConditionElementHandler.java +++ b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/WorkflowNodeNextConditionElementHandler.java @@ -110,11 +110,8 @@ public class WorkflowNodeNextConditionElementHandler extends MWFNextCondition m_WF_NodeNextCondition = new MWFNextCondition( ctx.ctx, ad_wf_nodenextcondition_id, null); - if (ctx.packOut.getFromDate() != null) { - if (m_WF_NodeNextCondition.getUpdated().compareTo(ctx.packOut.getFromDate()) < 0) { - return; - } - } + if (!isPackOutElement(ctx, m_WF_NodeNextCondition)) + return; verifyPackOutRequirement(m_WF_NodeNextCondition); AttributesImpl atts = new AttributesImpl(); addTypeName(atts, "table"); diff --git a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/WorkflowNodeNextElementHandler.java b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/WorkflowNodeNextElementHandler.java index 4685a3341b..584072e7a0 100644 --- a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/WorkflowNodeNextElementHandler.java +++ b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/WorkflowNodeNextElementHandler.java @@ -95,11 +95,8 @@ public class WorkflowNodeNextElementHandler extends AbstractElementHandler { MWFNodeNext m_WF_NodeNext = new MWFNodeNext( ctx.ctx, ad_wf_nodenext_id, null); - if (ctx.packOut.getFromDate() != null) { - if (m_WF_NodeNext.getUpdated().compareTo(ctx.packOut.getFromDate()) < 0) { - return; - } - } + if (!isPackOutElement(ctx, m_WF_NodeNext)) + return; verifyPackOutRequirement(m_WF_NodeNext); AttributesImpl atts = new AttributesImpl(); addTypeName(atts, "table"); diff --git a/org.adempiere.pipo/src/org/adempiere/pipo2/AbstractElementHandler.java b/org.adempiere.pipo/src/org/adempiere/pipo2/AbstractElementHandler.java index fc27a29811..4d8a4d9798 100644 --- a/org.adempiere.pipo/src/org/adempiere/pipo2/AbstractElementHandler.java +++ b/org.adempiere.pipo/src/org/adempiere/pipo2/AbstractElementHandler.java @@ -33,6 +33,7 @@ import org.compiere.model.MColumn; import org.compiere.model.MTable; import org.compiere.model.PO; import org.compiere.model.POInfo; +import org.compiere.model.X_AD_EntityType; import org.compiere.model.X_AD_Package_Imp_Backup; import org.compiere.model.X_AD_Package_Imp_Detail; import org.compiere.util.CLogger; @@ -509,5 +510,20 @@ public abstract class AbstractElementHandler implements ElementHandler { if (Util.isEmpty((String)po.get_Value(uidColumn)) && (keys == null || keys.length != 1 || po.get_ID() > MTable.MAX_OFFICIAL_ID)) { throw new IllegalStateException("2Pack doesn't work with record without official Id and UUID"); } - } + } + + protected boolean isPackOutElement(PIPOContext ctx, PO element) { + if (ctx.packOut.getFromDate() != null) { + if (element.getUpdated().compareTo(ctx.packOut.getFromDate()) < 0) { + return false; + } + } + if (!ctx.packOut.isExportDictionaryEntity() && element.get_ColumnIndex("EntityType") >= 0) { + Object entityType = element.get_Value("EntityType"); + if (X_AD_EntityType.ENTITYTYPE_Dictionary.equals(entityType)) { + return false; + } + } + return true; + } } diff --git a/org.adempiere.pipo/src/org/adempiere/pipo2/PackInHandler.java b/org.adempiere.pipo/src/org/adempiere/pipo2/PackInHandler.java index 500f64a986..a1e8f65ef7 100644 --- a/org.adempiere.pipo/src/org/adempiere/pipo2/PackInHandler.java +++ b/org.adempiere.pipo/src/org/adempiere/pipo2/PackInHandler.java @@ -109,6 +109,11 @@ public class PackInHandler extends DefaultHandler { // idempiere if (qName.equals("idempiere")) { + String updateDictionary = atts.getValue("UpdateDictionary"); + if (updateDictionary != null && updateDictionary.equalsIgnoreCase("true")) + { + m_updateDictionary = true; + } if (log.isLoggable(Level.INFO)) log.info("idempiere updateMode="+m_updateDictionary); //check client diff --git a/org.adempiere.pipo/src/org/adempiere/pipo2/PackOut.java b/org.adempiere.pipo/src/org/adempiere/pipo2/PackOut.java index 15805780a4..fba147e04e 100644 --- a/org.adempiere.pipo/src/org/adempiere/pipo2/PackOut.java +++ b/org.adempiere.pipo/src/org/adempiere/pipo2/PackOut.java @@ -81,6 +81,7 @@ public class PackOut private String packoutDirectory; private PIPOContext pipoContext = new PIPOContext(); private Timestamp fromDate; + private boolean isExportDictionaryEntity = false; public static final int MAX_OFFICIAL_ID = MTable.MAX_OFFICIAL_ID; @@ -218,6 +219,7 @@ public class PackOut atts.addAttribute("","","CreatedDate","CDATA",packoutDocument.getCreated().toString()); atts.addAttribute("","","UpdatedDate","CDATA",packoutDocument.getUpdated().toString()); atts.addAttribute("","","PackOutVersion","CDATA",PackOutVersion); + atts.addAttribute("","","UpdateDictionary","CDATA", isExportDictionaryEntity ? "true" : "false"); MClient client = MClient.get(pipoContext.ctx); StringBuffer sb = new StringBuffer () @@ -465,4 +467,11 @@ public class PackOut return false; } + public boolean isExportDictionaryEntity() { + return isExportDictionaryEntity; + } + + public void setExportDictionaryEntity(boolean isExportDictionaryEntity) { + this.isExportDictionaryEntity = isExportDictionaryEntity; + } } // PackOut diff --git a/org.adempiere.pipo/src/org/adempiere/pipo2/PackOutProcess.java b/org.adempiere.pipo/src/org/adempiere/pipo2/PackOutProcess.java index ea4a2bfd9d..a23afb0f57 100644 --- a/org.adempiere.pipo/src/org/adempiere/pipo2/PackOutProcess.java +++ b/org.adempiere.pipo/src/org/adempiere/pipo2/PackOutProcess.java @@ -136,6 +136,7 @@ public class PackOutProcess extends SvrProcess packOut.setFromDate((Timestamp) dateFromValue); } + packOut.setExportDictionaryEntity(packageExp.isExportDictionaryEntity()); packOut.export(packoutDirectory, null, packoutDocument, packoutItems, get_TrxName()); processedCount = packOut.getExportCount(); exportFile = packOut.getExportFile();