[DynamicRebuildWindow] Fixed issue when rebuilding Core or template (states were set in the wrong place). Fixed issue when a validation failed (the rest of the steps were set to 'green').
authorAntonio Moreno <antonio.moreno@openbravo.com>
Thu, 27 May 2010 12:11:46 +0200
changeset 7532 1537a5d4d386
parent 7531 46308041e1a1
child 7533 3227150d21cf
[DynamicRebuildWindow] Fixed issue when rebuilding Core or template (states were set in the wrong place). Fixed issue when a validation failed (the rest of the steps were set to 'green').
build.xml
src-core/src/org/openbravo/base/BuildTask.java
src/org/openbravo/erpCommon/ad_process/ApplyModules.html
--- a/build.xml	Wed May 26 15:43:51 2010 +0200
+++ b/build.xml	Thu May 27 12:11:46 2010 +0200
@@ -348,10 +348,12 @@
   </target>
 
   <target name="compile.complete.development" depends="init" unless="mode.war">
+    <updatesystemstatus v="RB22"/>
     <ant dir="${base.src}" target="compile.complete.development" inheritAll="true" inheritRefs="true" />
   </target>
 
   <target name="compile.complete.war" depends="init" if="mode.war">
+    <updatesystemstatus v="RB22"/>
     <antcall target="compile.complete" />
     <antcall target="war" />
   </target>
@@ -639,7 +641,6 @@
     <updatesystemstatus v="RB22"/>
     <antcall target="apply.modules.compile"/>
 
-    <updatesystemstatus v="RB23"/>
     <antcall inheritall="true" inheritrefs="true" target="apply.module" />
     <ant dir="${base.db}" target="setApplied" inheritAll="true" inheritRefs="true" />
 
@@ -659,6 +660,7 @@
   </target>
 
   <target name="apply.module">
+    <updatesystemstatus v="RB23"/>
     <java classname="org.openbravo.erpCommon.modules.ApplyModuleTask" fork="true" maxmemory="${build.maxmemory}" failonerror="true">
       <arg line="'${base.src}'" />
       <classpath refid="project.class.path" />
--- a/src-core/src/org/openbravo/base/BuildTask.java	Wed May 26 15:43:51 2010 +0200
+++ b/src-core/src/org/openbravo/base/BuildTask.java	Thu May 27 12:11:46 2010 +0200
@@ -89,7 +89,6 @@
       log.info(task);
     log.info("Modules to be applied: " + unnappliedModules);
     ant.runTask(tasks);
-    updateFinalState();
     ant.closeLogFile();
   }
 
@@ -135,13 +134,6 @@
     return rs.getInt(1) != 0;
   }
 
-  private static boolean updateFinalState() throws Exception {
-    String strSql = "UPDATE AD_SYSTEM_INFO SET SYSTEM_STATUS='RB60'";
-    ConnectionProvider cp = getConnectionProvider();
-    PreparedStatement ps = cp.getPreparedStatement(strSql);
-    return (ps.executeUpdate() != 0);
-  }
-
   private static ConnectionProvider getConnectionProvider() {
     ConnectionProvider cp = null;
     cp = new CPStandAlone(propertiesFile);
--- a/src/org/openbravo/erpCommon/ad_process/ApplyModules.html	Wed May 26 15:43:51 2010 +0200
+++ b/src/org/openbravo/erpCommon/ad_process/ApplyModules.html	Thu May 27 12:11:46 2010 +0200
@@ -260,8 +260,10 @@
     //calling the getError function to display a success/warning/error final message
     function endProcess(paramXMLParticular, XMLHttpRequestObj) {
       if (getReadyStateHandler(XMLHttpRequestObj)) { 
+          var frm = document.frmMain;
+          submitXmlHttpRequest(getError, frm, "GETERR", "ApplyModulesCallServlet.html", false, null, null);
+          return true;
       }
-      return true;
     }
 
     //This function starts the ApplyModules task, and is called when the user presses the "Yes" button
@@ -412,9 +414,6 @@
           if(contains(end_states,state) || errorStatus=="Error"){
             stopLocalTimer();
             processing = false;
-            top.opener.setProcessingMode('window', false);
-            var frm = document.frmMain;
-            submitXmlHttpRequest(getError, frm, "GETERR", "ApplyModulesCallServlet.html", false, null, null);
           }
           start=true;
           var stateindex=getStatusIndex(state);
@@ -443,6 +442,12 @@
               }
           }
           current_state=stateindex;
+
+          if(contains(end_states,state) || errorStatus=="Error"){
+            top.opener.setProcessingMode('window', false);
+            var frm = document.frmMain;
+            submitXmlHttpRequest(getError, frm, "GETERR", "ApplyModulesCallServlet.html", false, null, null);
+          }
         }
       }
       if(contains(end_states,state) || errorStatus=="Error"){