Removed insertDummyHBLog method on InstancePurpose use instead the same method of InstanceManagement.
authorGorka Ion Damián <gorkaion.damian@openbravo.com>
Mon, 25 Oct 2010 13:37:15 +0200
changeset 8767 d9851f0e28db
parent 8766 8fc8d404f947
child 8768 72aeef622d26
child 8769 05b8e6fe855d
Removed insertDummyHBLog method on InstancePurpose use instead the same method of InstanceManagement.
src/org/openbravo/erpCommon/ad_forms/InstanceManagement.java
src/org/openbravo/erpCommon/ad_forms/InstancePurpose.java
--- a/src/org/openbravo/erpCommon/ad_forms/InstanceManagement.java	Mon Oct 25 13:29:54 2010 +0200
+++ b/src/org/openbravo/erpCommon/ad_forms/InstanceManagement.java	Mon Oct 25 13:37:15 2010 +0200
@@ -510,7 +510,7 @@
 
   }
 
-  private void insertDummyHBLog() throws ServletException {
+  static void insertDummyHBLog() throws ServletException {
     HeartbeatLog hbLog = OBProvider.getInstance().get(HeartbeatLog.class);
     hbLog.setClient(OBDal.getInstance().get(Client.class, "0"));
     hbLog.setOrganization(OBDal.getInstance().get(Organization.class, "0"));
--- a/src/org/openbravo/erpCommon/ad_forms/InstancePurpose.java	Mon Oct 25 13:29:54 2010 +0200
+++ b/src/org/openbravo/erpCommon/ad_forms/InstancePurpose.java	Mon Oct 25 13:37:15 2010 +0200
@@ -29,19 +29,14 @@
 
 import org.openbravo.base.filter.IsIDFilter;
 import org.openbravo.base.filter.ValueListFilter;
-import org.openbravo.base.provider.OBProvider;
 import org.openbravo.base.secureApp.HttpSecureAppServlet;
 import org.openbravo.base.secureApp.VariablesSecureApp;
 import org.openbravo.dal.service.OBDal;
 import org.openbravo.erpCommon.ad_process.HeartbeatProcess;
 import org.openbravo.erpCommon.obps.ActivationKey;
 import org.openbravo.erpCommon.utility.ComboTableData;
-import org.openbravo.erpCommon.utility.SystemInfo;
 import org.openbravo.erpCommon.utility.Utility;
-import org.openbravo.model.ad.system.Client;
-import org.openbravo.model.ad.system.HeartbeatLog;
 import org.openbravo.model.ad.system.SystemInformation;
-import org.openbravo.model.common.enterprise.Organization;
 import org.openbravo.xmlEngine.XmlDocument;
 
 public class InstancePurpose extends HttpSecureAppServlet {
@@ -141,20 +136,10 @@
     systemInfo.setInstancePurpose(strPurpose);
     OBDal.getInstance().save(systemInfo);
     if (HeartbeatProcess.isClonedInstance()) {
-      insertDummyHBLog();
+      InstanceManagement.insertDummyHBLog();
     }
   }
 
-  private void insertDummyHBLog() throws ServletException {
-    HeartbeatLog hbLog = OBProvider.getInstance().get(HeartbeatLog.class);
-    hbLog.setClient(OBDal.getInstance().get(Client.class, "0"));
-    hbLog.setOrganization(OBDal.getInstance().get(Organization.class, "0"));
-    hbLog.setSystemIdentifier(SystemInfo.getSystemIdentifier());
-    hbLog.setDatabaseIdentifier(SystemInfo.getDBIdentifier());
-    hbLog.setMacIdentifier(SystemInfo.getMacAddress());
-    OBDal.getInstance().save(hbLog);
-  }
-
   @Override
   public String getServletInfo() {
     return "InstancePurpose pop-up form servlet.";