related to issue 39229: removed unneded source.path params
authorAsier Lostalé <asier.lostale@openbravo.com>
Fri, 07 Sep 2018 11:51:03 +0200
changeset 34764 9a51de54cd96
parent 34763 701d003b887b
child 34765 3e0f540c5540
related to issue 39229: removed unneded source.path params
src-test/src/org/openbravo/test/db/model/functions/ADOrgTreeTest.java
src-test/src/org/openbravo/test/generalsetup/enterprise/organization/ADOrgPersistInfoUtility.java
src/org/openbravo/erpCommon/ad_forms/InitialOrgSetup.java
src/org/openbravo/erpCommon/businessUtility/InitialOrgSetup.java
--- a/src-test/src/org/openbravo/test/db/model/functions/ADOrgTreeTest.java	Fri Sep 07 11:46:19 2018 +0200
+++ b/src-test/src/org/openbravo/test/db/model/functions/ADOrgTreeTest.java	Fri Sep 07 11:51:03 2018 +0200
@@ -27,7 +27,6 @@
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.Properties;
 
 import org.apache.commons.lang.StringUtils;
 import org.apache.log4j.Logger;
@@ -35,7 +34,6 @@
 import org.hibernate.query.Query;
 import org.junit.Ignore;
 import org.junit.Test;
-import org.openbravo.base.session.OBPropertiesProvider;
 import org.openbravo.dal.core.OBContext;
 import org.openbravo.dal.service.OBDal;
 import org.openbravo.dal.service.OBQuery;
@@ -413,11 +411,9 @@
   }
 
   private String createOrganization(String newOrgName, String newOrgType, String strParentOrg) {
-    Properties properties = OBPropertiesProvider.getInstance().getOpenbravoProperties();
-    String strSourcePath = properties.getProperty("source.path");
     InitialOrgSetup initialOrg = new InitialOrgSetup(OBContext.getOBContext().getCurrentClient());
     initialOrg.createOrganization(newOrgName, "", newOrgType, strParentOrg, "", "", "", false,
-        null, "", false, false, false, false, false, strSourcePath);
+        null, "", false, false, false, false, false);
     OBDal.getInstance().get(Organization.class, initialOrg.getOrgId()).setSummaryLevel(true);
     return initialOrg.getOrgId();
   }
--- a/src-test/src/org/openbravo/test/generalsetup/enterprise/organization/ADOrgPersistInfoUtility.java	Fri Sep 07 11:46:19 2018 +0200
+++ b/src-test/src/org/openbravo/test/generalsetup/enterprise/organization/ADOrgPersistInfoUtility.java	Fri Sep 07 11:51:03 2018 +0200
@@ -23,12 +23,10 @@
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Map;
-import java.util.Properties;
 
 import org.apache.commons.lang.StringUtils;
 import org.hibernate.criterion.Restrictions;
 import org.openbravo.base.provider.OBProvider;
-import org.openbravo.base.session.OBPropertiesProvider;
 import org.openbravo.dal.core.OBContext;
 import org.openbravo.dal.security.OrganizationStructureProvider;
 import org.openbravo.dal.service.OBCriteria;
@@ -65,11 +63,9 @@
   static String createOrganization(String newOrgType, String strParentOrg, boolean summary,
       String currencyId) {
     long number = System.currentTimeMillis();
-    Properties properties = OBPropertiesProvider.getInstance().getOpenbravoProperties();
-    String strSourcePath = properties.getProperty("source.path");
     InitialOrgSetup initialOrg = new InitialOrgSetup(OBContext.getOBContext().getCurrentClient());
     initialOrg.createOrganization("Test_" + number, "", newOrgType, strParentOrg, "", "", "",
-        false, null, "", false, false, false, false, false, strSourcePath);
+        false, null, "", false, false, false, false, false);
     Organization org = OBDal.getInstance().get(Organization.class, initialOrg.getOrgId());
     org.setSummaryLevel(summary);
     if (StringUtils.equals(newOrgType, ADOrgPersistInfoConstants.ORGTYPE_LEGALWITHACCOUNTING)) {
--- a/src/org/openbravo/erpCommon/ad_forms/InitialOrgSetup.java	Fri Sep 07 11:46:19 2018 +0200
+++ b/src/org/openbravo/erpCommon/ad_forms/InitialOrgSetup.java	Fri Sep 07 11:51:03 2018 +0200
@@ -74,8 +74,7 @@
 
       OBError obeResult = ios.createOrganization(strOrganization, strOrgUser, strOrgType,
           strParentOrg, strcLocationId, strPassword, strModules, isTrue(strCreateAccounting),
-          fileCoAFilePath, strCurrency, bBPartner, bProduct, bProject, bCampaign, bSalesRegion,
-          vars.getSessionValue("#SOURCEPATH"));
+          fileCoAFilePath, strCurrency, bBPartner, bProduct, bProject, bCampaign, bSalesRegion);
       if (!obeResult.getType().equals(OKTYPE)) {
         OBContext.getOBContext().removeWritableOrganization(ios.getOrgId());
         OBContext.getOBContext().removeFromWritableOrganization(ios.getOrgId());
--- a/src/org/openbravo/erpCommon/businessUtility/InitialOrgSetup.java	Fri Sep 07 11:46:19 2018 +0200
+++ b/src/org/openbravo/erpCommon/businessUtility/InitialOrgSetup.java	Fri Sep 07 11:51:03 2018 +0200
@@ -126,8 +126,7 @@
   public OBError createOrganization(String strOrgName, String strOrgUser, String strOrgType,
       String strParentOrg, String strcLocationId, String strPassword, String strModules,
       boolean boCreateAccounting, FileItem fileCoAFilePath, String strCurrency, boolean bBPartner,
-      boolean bProduct, boolean bProject, boolean bCampaign, boolean bSalesRegion,
-      String strSourcePath) {
+      boolean bProduct, boolean bProject, boolean bCampaign, boolean bSalesRegion) {
     OBError obResult = new OBError();
     obResult.setType(ERRORTYPE);
     strHeaderLog.append("@ReportSummary@").append(NEW_LINE).append(NEW_LINE);
@@ -233,8 +232,8 @@
     } else {
       logEvent(NEW_LINE + "@StartingReferenceData@");
       log4j.debug("process() - Starting creation of reference data");
-      obResult = createReferenceData(strSourcePath, strModules, bProduct, bBPartner, bProject,
-          bCampaign, bSalesRegion, (bAccountingCreated) ? false : boCreateAccounting, strCurrency);
+      obResult = createReferenceData(strModules, bProduct, bBPartner, bProject, bCampaign,
+          bSalesRegion, (bAccountingCreated) ? false : boCreateAccounting, strCurrency);
       if (!obResult.getType().equals(OKTYPE))
         return obResult;
       logEvent(NEW_LINE + "@CreateReferenceDataSuccess@");
@@ -259,9 +258,9 @@
 
   }
 
-  private OBError createReferenceData(String strSourcePath, String strModulesProvided,
-      boolean product, boolean partner, boolean project, boolean campaign, boolean salesRegion,
-      boolean boCreateAccounting, String strCurrency) {
+  private OBError createReferenceData(String strModulesProvided, boolean product, boolean partner,
+      boolean project, boolean campaign, boolean salesRegion, boolean boCreateAccounting,
+      String strCurrency) {
     log4j.debug("createReferenceData() - Starting the process to create"
         + " reference data for modules: " + strModulesProvided);
     OBError obeResult = new OBError();
@@ -274,9 +273,8 @@
       if (boCreateAccounting) {
         try {
           log4j.debug("createReferenceData() - There exists accounting modules to process");
-          obeResult = insertAccountingModule(strSourcePath, strModules, partner, product, project,
-              campaign, salesRegion,
-              InitialSetupUtility.getTranslatedColumnName(language, "Account_ID"),
+          obeResult = insertAccountingModule(strModules, partner, product, project, campaign,
+              salesRegion, InitialSetupUtility.getTranslatedColumnName(language, "Account_ID"),
               InitialSetupUtility.getTranslatedColumnName(language, "C_Calendar_ID"), strCurrency);
           if (!obeResult.getType().equals(OKTYPE))
             return obeResult;
@@ -397,9 +395,9 @@
     return obeResult;
   }
 
-  private OBError insertAccountingModule(String strSourcePath, String strModules,
-      boolean bBPartner, boolean bProduct, boolean bProject, boolean bCampaign,
-      boolean bSalesRegion, String strAccountText, String strCalendarText, String strCurrency) {
+  private OBError insertAccountingModule(String strModules, boolean bBPartner, boolean bProduct,
+      boolean bProject, boolean bCampaign, boolean bSalesRegion, String strAccountText,
+      String strCalendarText, String strCurrency) {
     log4j.debug("insertAccountingModule() - Starting client creation.");
     if (client == null)
       return logErrorAndRollback(