fixed bug 9403, fixed bug 9390: Execute compile.complte when applying modules depending on the case.
authorAsier Lostalé <asier.lostale@openbravo.com>
Thu, 11 Jun 2009 15:02:20 +0200
changeset 3995 88e93b5b7c41
parent 3994 b0d067451972
child 3996 ab553f6100c1
fixed bug 9403, fixed bug 9390: Execute compile.complte when applying modules depending on the case.

It is executed when:
-There's at least one module to uninstall
-There's at least one template to install
build.xml
src/org/openbravo/erpCommon/ad_process/ApplyModules.java
src/org/openbravo/erpCommon/ad_process/ApplyModules_data.xsql
--- a/build.xml	Thu Jun 11 12:17:59 2009 +0200
+++ b/build.xml	Thu Jun 11 15:02:20 2009 +0200
@@ -102,7 +102,10 @@
   <property name="chekPerms" value="false" />
   <property name="force" value="false" />
   <property name="local" value="true" />
+  <property name="apply.modules.complete.compilation" value="false" />
 
+
+  
   <available file=".hg" property="is.hg" />
 
 
@@ -627,8 +630,30 @@
     but then no output is visible for the user.
     -->
     <applyModule userId="0" propertiesFile="${base.config}/Openbravo.properties" reinitializemodel="false"/>
+    
+    <condition property="apply.modules.complete.compilation.var">
+      <istrue value="${apply.modules.complete.compilation}"  />
+    </condition>
+    
+    <condition property="apply.modules.simple.compilation.var">
+      <isfalse value="${apply.modules.complete.compilation.var}" />
+    </condition>
+    
+    <antcall target="apply.modules.compile"/>
+  </target>
+  
+  
+  <target name="apply.modules.compile">
+    <antcall target="apply.modules.compile.simple"/>
+    <antcall target="apply.modules.compile.complete"/>
+  </target>
+  
+  <target name="apply.modules.compile.simple" if="apply.modules.simple.compilation.var">
     <antcall target="compile.deploy" />
-    <!--antcall target="deploy.context"/-->
+  </target>
+  
+  <target name="apply.modules.compile.complete" if="apply.modules.complete.compilation.var">
+     <antcall target="compile.complete.deploy" />
   </target>
   
   <!-- 
--- a/src/org/openbravo/erpCommon/ad_process/ApplyModules.java	Thu Jun 11 12:17:59 2009 +0200
+++ b/src/org/openbravo/erpCommon/ad_process/ApplyModules.java	Thu Jun 11 15:02:20 2009 +0200
@@ -216,6 +216,12 @@
         tasks.add("compile.complete.deploy");
         ant.setProperty("apply.on.create", "true");
       } else {
+        if (ApplyModulesData.compileCompleteNeeded(this)) {
+          // compile complete is needed for templates because in this case it is not needed which
+          // elements belong to the template and for uninistalling modules in order to remove old
+          // files and references
+          ant.setProperty("apply.modules.complete.compilation", "true");
+        }
         ant.setProperty("force", "true");
         tasks.add("apply.modules");
         ant.setProperty("module", unnappliedModules);
--- a/src/org/openbravo/erpCommon/ad_process/ApplyModules_data.xsql	Thu Jun 11 12:17:59 2009 +0200
+++ b/src/org/openbravo/erpCommon/ad_process/ApplyModules_data.xsql	Thu Jun 11 15:02:20 2009 +0200
@@ -45,6 +45,18 @@
       </Sql>
   </SqlMethod>
   
+  <SqlMethod name="compileCompleteNeeded" type="preparedStatement" return="boolean">
+      <SqlMethodComment></SqlMethodComment>
+      <Sql><![CDATA[
+         SELECT count(*) as NAME
+           FROM AD_MODULE
+          WHERE (STATUS='I'      
+                 AND TYPE = 'T')
+             OR (STATUS='U')
+          ]]>
+      </Sql>
+  </SqlMethod>
+  
   <SqlMethod name="selectUninstalledModules" type="preparedStatement" return="boolean">
       <SqlMethodComment></SqlMethodComment>
       <Sql><![CDATA[