From b79597305a21381a00c3140a7255dac044c37a2d Mon Sep 17 00:00:00 2001 From: teo_sarca Date: Thu, 7 May 2009 09:05:34 +0000 Subject: [PATCH] FR [ 2788074 ] ImportBPartner: add IsValidateOnly option https://sourceforge.net/tracker/?func=detail&aid=2788074&group_id=176962&atid=879335 --- base/src/org/compiere/process/ImportBPartner.java | 12 ++++++++++++ migration/353a-trunk/oracle/462_FR2788074.sql | 10 ++++++++++ migration/353a-trunk/postgresql/462_FR2788074.sql | 10 ++++++++++ 3 files changed, 32 insertions(+) create mode 100644 migration/353a-trunk/oracle/462_FR2788074.sql create mode 100644 migration/353a-trunk/postgresql/462_FR2788074.sql diff --git a/base/src/org/compiere/process/ImportBPartner.java b/base/src/org/compiere/process/ImportBPartner.java index 47ca09ab8a..78c29fec29 100644 --- a/base/src/org/compiere/process/ImportBPartner.java +++ b/base/src/org/compiere/process/ImportBPartner.java @@ -37,6 +37,10 @@ import org.compiere.util.DB; * * @author Jorg Janke * @version $Id: ImportBPartner.java,v 1.2 2006/07/30 00:51:02 jjanke Exp $ + * + * @author Teo Sarca, www.arhipac.ro + *
  • FR [ 2788074 ] ImportBPartner: add IsValidateOnly option + * https://sourceforge.net/tracker/?func=detail&aid=2788074&group_id=176962&atid=879335 */ public class ImportBPartner extends SvrProcess { @@ -44,6 +48,8 @@ public class ImportBPartner extends SvrProcess private int m_AD_Client_ID = 0; /** Delete old Imported */ private boolean m_deleteOldImported = false; + /** Only validate, don't import */ + private boolean p_IsValidateOnly = false; /** Effective */ private Timestamp m_DateValue = null; @@ -61,6 +67,8 @@ public class ImportBPartner extends SvrProcess m_AD_Client_ID = ((BigDecimal)para[i].getParameter()).intValue(); else if (name.equals("DeleteOldImported")) m_deleteOldImported = "Y".equals(para[i].getParameter()); + else if (name.equals("IsValidateOnly")) + p_IsValidateOnly = para[i].getParameterAsBoolean(); else log.log(Level.SEVERE, "Unknown Parameter: " + name); } @@ -258,6 +266,10 @@ public class ImportBPartner extends SvrProcess log.config("Value is mandatory=" + no); commit(); + if (p_IsValidateOnly) + { + return "Validated"; + } // ------------------------------------------------------------------- int noInsert = 0; int noUpdate = 0; diff --git a/migration/353a-trunk/oracle/462_FR2788074.sql b/migration/353a-trunk/oracle/462_FR2788074.sql new file mode 100644 index 0000000000..120e54b5af --- /dev/null +++ b/migration/353a-trunk/oracle/462_FR2788074.sql @@ -0,0 +1,10 @@ +-- 06.05.2009 23:57:08 EEST +-- - +INSERT INTO AD_Process_Para (AD_Process_Para_ID,AD_Client_ID,Updated,IsActive,Created,UpdatedBy,AD_Org_ID,CreatedBy,FieldLength,Name,IsCentrallyMaintained,IsRange,Description,AD_Process_ID,EntityType,ColumnName,IsMandatory,SeqNo,AD_Reference_ID,AD_Element_ID,DefaultValue) VALUES (53312,0,TO_DATE('2009-05-06 23:57:07','YYYY-MM-DD HH24:MI:SS'),'Y',TO_DATE('2009-05-06 23:57:07','YYYY-MM-DD HH24:MI:SS'),0,0,0,1,'Only Validate Data','Y','N','Validate the date and do not process',194,'D','IsValidateOnly','Y',30,20,2168,'N') +; + +-- 06.05.2009 23:57:08 EEST +-- - +INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Name,Description,Help, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_Para_ID, t.Name,t.Description,t.Help, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_Para_ID=53312 AND EXISTS (SELECT * FROM AD_Process_Para_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Process_Para_ID!=t.AD_Process_Para_ID) +; + diff --git a/migration/353a-trunk/postgresql/462_FR2788074.sql b/migration/353a-trunk/postgresql/462_FR2788074.sql new file mode 100644 index 0000000000..3feb11745e --- /dev/null +++ b/migration/353a-trunk/postgresql/462_FR2788074.sql @@ -0,0 +1,10 @@ +-- 06.05.2009 23:57:08 EEST +-- - +INSERT INTO AD_Process_Para (AD_Process_Para_ID,AD_Client_ID,Updated,IsActive,Created,UpdatedBy,AD_Org_ID,CreatedBy,FieldLength,Name,IsCentrallyMaintained,IsRange,Description,AD_Process_ID,EntityType,ColumnName,IsMandatory,SeqNo,AD_Reference_ID,AD_Element_ID,DefaultValue) VALUES (53312,0,TO_TIMESTAMP('2009-05-06 23:57:07','YYYY-MM-DD HH24:MI:SS'),'Y',TO_TIMESTAMP('2009-05-06 23:57:07','YYYY-MM-DD HH24:MI:SS'),0,0,0,1,'Only Validate Data','Y','N','Validate the date and do not process',194,'D','IsValidateOnly','Y',30,20,2168,'N') +; + +-- 06.05.2009 23:57:08 EEST +-- - +INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Name,Description,Help, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_Para_ID, t.Name,t.Description,t.Help, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_Para_ID=53312 AND EXISTS (SELECT * FROM AD_Process_Para_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Process_Para_ID!=t.AD_Process_Para_ID) +; +