details:   /erp/devel/pi/rev/9353f9f896b0
changeset: 7571:9353f9f896b0
user:      Adrián Romero <adrianromero <at> openbravo.com>
date:      Tue Jun 08 18:03:21 2010 +0200
summary:   Fixes issue 0013580: Not able to use multireports with an especific 
document type
It has been added a new replacement to the calculation of the filename to avoid 
the characters slash '/' and back slash '\'

details:   /erp/devel/pi/rev/8ab0feb4908c
changeset: 7572:8ab0feb4908c
user:      Adrián Romero <adrianromero <at> openbravo.com>
date:      Tue Jun 08 18:05:02 2010 +0200
summary:   Fixing issue 13587: Merging branch

diffstat:

 build.xml                                                                      
     |  124 +-
 src-core/.classpath                                                            
     |    1 +
 src-core/build.xml                                                             
     |    2 +-
 src-core/src/org/openbravo/base/AntExecutor.java                               
     |  165 ++
 src-core/src/org/openbravo/base/BuildTask.java                                 
     |  149 ++
 src-core/src/org/openbravo/buildvalidation/BuildValidationHandler.java         
     |    3 +-
 src-core/src/org/openbravo/data/Sqlc.java                                      
     |   11 +-
 src-core/src/org/openbravo/utils/DirFilter.java                                
     |   26 +-
 src-db/build.xml                                                               
     |    2 +-
 src-db/database/lib/dbsourcemanager.jar                                        
     |    0 
 src-db/database/model/functions/C_DEBT_PAYMENT_CREATE.xml                      
     |   16 +-
 src-db/database/model/triggers/C_INVOICELINE_TRG2.xml                          
     |   11 +-
 src-db/database/sourcedata/AD_TEXTINTERFACES.xml                               
     |  269 ++--
 src-test/org/openbravo/test/ant/BaseAntTest.java                               
     |    2 +-
 src-test/org/openbravo/test/dal/IssuesTest.java                                
     |   17 +
 src-test/org/openbravo/test/dal/OBContextTest.java                             
     |   16 +
 src-trl/build.xml                                                              
     |    4 +-
 src-util/buildvalidation/build.xml                                             
     |    8 +-
 src-util/modulescript/build.xml                                                
     |    8 +-
 src-wad/build.xml                                                              
     |    4 +-
 src-wad/src/org/openbravo/wad/ActionButton_Responser.javaxml                   
     |    2 +-
 src-wad/src/org/openbravo/wad/javasource.javaxml                               
     |    2 +-
 src/build.xml                                                                  
     |   23 +-
 src/org/openbravo/base/model/ModelProvider.java                                
     |   12 +-
 src/org/openbravo/base/session/OBPropertiesProvider.java                       
     |    4 +-
 src/org/openbravo/dal/core/OBContext.java                                      
     |   61 +-
 src/org/openbravo/dal/service/OBCriteria.java                                  
     |    4 +-
 src/org/openbravo/erpCommon/ad_actionButton/CreateFrom.java                    
     |    3 +
 src/org/openbravo/erpCommon/ad_actionButton/CreateFrom_Invoice_data.xsql       
     |    6 +-
 src/org/openbravo/erpCommon/ad_forms/DocMatchInv.java                          
     |  100 +-
 src/org/openbravo/erpCommon/ad_forms/DocMatchInv_data.xsql                     
     |   61 +-
 src/org/openbravo/erpCommon/ad_forms/InitialClientSetup.html                   
     |   23 +-
 src/org/openbravo/erpCommon/ad_forms/Translation.java                          
     |   51 +
 src/org/openbravo/erpCommon/ad_process/ApplyModules.html                       
     |  567 +++------
 src/org/openbravo/erpCommon/ad_process/ApplyModules.java                       
     |  305 +++-
 src/org/openbravo/erpCommon/ad_process/ApplyModules.xml                        
     |   15 +
 src/org/openbravo/erpCommon/ad_process/ApplyModulesCallServlet.java            
     |  145 ++-
 src/org/openbravo/erpCommon/ad_process/buildStructure/Build.java               
     |  106 +
 src/org/openbravo/erpCommon/ad_process/buildStructure/BuildMainStep.java       
     |  131 ++
 
src/org/openbravo/erpCommon/ad_process/buildStructure/BuildMainStepTranslation.java
 |  133 ++
 src/org/openbravo/erpCommon/ad_process/buildStructure/BuildStep.java           
     |   55 +
 
src/org/openbravo/erpCommon/ad_process/buildStructure/BuildStepTranslation.java 
    |   48 +
 src/org/openbravo/erpCommon/ad_process/buildStructure/BuildStepWrapper.java    
     |  104 +
 src/org/openbravo/erpCommon/ad_process/buildStructure/BuildTranslation.java    
     |  145 ++
 src/org/openbravo/erpCommon/ad_process/buildStructure/buildStructure.xml       
     |   23 +
 src/org/openbravo/erpCommon/ad_process/buildStructure/mapping.xml              
     |   55 +
 src/org/openbravo/erpCommon/ad_reports/ReportAssetDepreciationSchedule.java    
     |    2 +-
 src/org/openbravo/erpCommon/modules/ApplyModule.java                           
     |    3 +-
 src/org/openbravo/erpCommon/modules/ApplyModuleTask.java                       
     |    2 +-
 src/org/openbravo/erpCommon/modules/ApplyModule_data.xsql                      
     |   12 +-
 src/org/openbravo/erpCommon/modules/ModuleUtiltiy.java                         
     |    1 -
 src/org/openbravo/erpCommon/utility/AntExecutor.java                           
     |    2 +
 src/org/openbravo/erpCommon/utility/reporting/Report.java                      
     |    2 +
 src/org/openbravo/service/system/ReloadContext.java                            
     |    8 +-
 src/org/openbravo/service/system/RestartTomcat.java                            
     |    8 +-
 55 files changed, 2329 insertions(+), 733 deletions(-)

diffs (truncated from 4359 to 300 lines):

diff -r 596e719c242e -r 8ab0feb4908c build.xml
--- a/build.xml Fri Jun 04 13:29:54 2010 +0200
+++ b/build.xml Tue Jun 08 18:05:02 2010 +0200
@@ -76,6 +76,7 @@
   <property name="base.lib" location="lib" />
   <property name="base.modules" location="modules" />
   <property name="build" location="build/classes" />
+  <property name="build.apply.module" location="build.apply/classes" />
   <property name="build.AD" location="srcAD" />
   <property name="build.sqlc" location="build/javasqlc" />
   <property name="build.core.lib" location="src-core/lib" />
@@ -216,6 +217,69 @@
     </dirset>
     <pathelement path="${basedir}/../../src-util/modulescript/build/classes/" 
/>
   </path>
+
+  <!-- This classpath is needed only for the compile.apply.module task-->
+  <path id="apply.module.compile.classpath">
+    <pathelement path="${build.apply.module}" />
+    <pathelement path="${base.src}" />
+    <fileset dir="${base.lib}">
+      <include name="**/*.jar" />
+    </fileset>
+    <fileset dir="${build.core.lib}">
+      <include name="openbravo-core.jar" />
+    </fileset>
+    <fileset dir="${build.trl.lib}">
+      <include name="openbravo-trl.jar" />
+    </fileset>
+    <fileset dir="${build.wad.lib}">
+      <include name="openbravo-wad.jar" />
+    </fileset>
+    <fileset dir="${base.lib}">
+      <include name="**/*.jar" />
+    </fileset>
+    <fileset dir="${base.db}/lib/">
+      <include name="**/*.jar" />
+    </fileset>
+    <fileset dir="${base.modules}">
+      <include name="*/lib/**" />
+    </fileset>
+    <dirset dir="${base.modules}">
+      <include name="*/build/classes/" />
+    </dirset>
+    <pathelement path="${basedir}/../../src-util/modulescript/build/classes/" 
/>
+  </path>
+  
+  <!-- This classpath is needed only for the apply.module task-->
+  <path id="apply.module.runtime.classpath">
+    <pathelement path="${build.apply.module}" />
+    <pathelement path="${build}" />
+    <pathelement path="${base.src}" />
+    <fileset dir="${base.lib}">
+      <include name="**/*.jar" />
+    </fileset>
+    <fileset dir="${build.core.lib}">
+      <include name="openbravo-core.jar" />
+    </fileset>
+    <fileset dir="${build.trl.lib}">
+      <include name="openbravo-trl.jar" />
+    </fileset>
+    <fileset dir="${build.wad.lib}">
+      <include name="openbravo-wad.jar" />
+    </fileset>
+    <fileset dir="${base.lib}">
+      <include name="**/*.jar" />
+    </fileset>
+    <fileset dir="${base.db}/lib/">
+      <include name="**/*.jar" />
+    </fileset>
+    <fileset dir="${base.modules}">
+      <include name="*/lib/**" />
+    </fileset>
+    <dirset dir="${base.modules}">
+      <include name="*/build/classes/" />
+    </dirset>
+    <pathelement path="${basedir}/../../src-util/modulescript/build/classes/" 
/>
+  </path>
   
   <macrodef name="updatesystemstatus">
      <attribute name="v" default="NOT SET"/>
@@ -284,6 +348,7 @@
 
     <ant dir="${base.src}" target="smartbuild" inheritAll="true" 
inheritRefs="true" />
 
+    <antcall inheritall="true" inheritrefs="true" target="apply.module" />
     <ant dir="${base.db}" target="setApplied" inheritAll="true" 
inheritRefs="true" />
     <antcall target="build.deploy" />
     <updatesystemstatus v="RB51"/>
@@ -322,6 +387,7 @@
   </target>
 
   <target name="buildvalidation" depends="init, core.lib">
+    <updatesystemstatus v="RB11"/> 
     <ant dir="src-util/buildvalidation" target="buildvalidation" 
inheritAll="true" inheritRefs="true" />
   </target>
   
@@ -334,7 +400,7 @@
   </target>
 
   <target name="compile.complete.deploy" 
depends="compile.complete.development, compile.complete.war">
-    
+
     <!-- Calculate wad checksum to enable smartbuild-->
     <taskdef name="CheckSumCondition" 
classname="org.openbravo.utils.CheckSumCondition">
       <classpath refid="project.class.path" />
@@ -346,10 +412,12 @@
   </target>
 
   <target name="compile.complete.development" depends="init" unless="mode.war">
+    <updatesystemstatus v="RB43"/>
     <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="RB43"/>
     <antcall target="compile.complete" />
     <antcall target="war" />
   </target>
@@ -554,7 +622,6 @@
   </target>
 
   <target name="install.source" depends="init, create.database, wad.lib, 
trl.lib, compile.complete.deploy">
-
     <echo message="applying modules" />    
     <antcall inheritall="true" inheritrefs="true" target="apply.module" />
 
@@ -589,14 +656,17 @@
   </target>
 
   <target name="update.database" depends="init, core.lib, database.lib, 
buildvalidation">
+    <updatesystemstatus v="RB12"/>
     <ant dir="${base.db}" target="update.database.java" inheritAll="true" 
inheritRefs="true" />
-    <updatesystemstatus v="RB21"/>
     <antcall target="generate.entities.quick" />
-    <antcall target="db.apply.modules" />
+    <antcall target="apply.module" />
   </target>
 
   <target name="update.database.mod" depends="init, core.lib, database.lib, 
buildvalidation">
+    <updatesystemstatus v="RB12"/>
     <ant dir="${base.db}" target="update.database.mod.java" inheritAll="true" 
inheritRefs="true" />
+    <antcall target="generate.entities.quick" />
+    <antcall target="apply.module" />
   </target>
 
   <target name="create.database.script" depends="init, core.lib">
@@ -628,9 +698,6 @@
 
 
   <target name="apply.modules" depends="update.database.mod">
-    <updatesystemstatus v="RB21"/>
-
-    <antcall inheritall="true" inheritrefs="true" target="apply.module" />
 
     <condition property="apply.modules.complete.compilation.var">
       <istrue value="${apply.modules.complete.compilation}"  />
@@ -639,10 +706,12 @@
     <condition property="apply.modules.simple.compilation.var">
       <isfalse value="${apply.modules.complete.compilation.var}" />
     </condition>
-    
+
+    <updatesystemstatus v="RB43"/>
     <antcall target="apply.modules.compile"/>
+
     <ant dir="${base.db}" target="setApplied" inheritAll="true" 
inheritRefs="true" />
-     
+
   </target>
   
   <target name="apply.module.forked">
@@ -657,13 +726,25 @@
     </taskdef>
     <applyModule userId="0" adminMode="true" 
propertiesFile="${base.config}/Openbravo.properties"/>
   </target>
-
-  <target name="apply.module">
+  
+  <target name="compile.apply.module" depends="init">
     <updatesystemstatus v="RB31"/>
+    <ant dir="${base.src}" target="compile.apply.module" inheritAll="true" 
inheritRefs="true" />
+  </target>
+  
+  <!--
+  This task uses a special classpath.
+  This classpath is equivalent to the normal project.class.path, except for 
the fact that that the normal build folder
+  is replaced by the apply.module.build folder, in which the ApplyModule task 
related classes will be compiled.
+  This is done to workaround the fact that the javac task needs to compile all 
the related classes when upgrading openbravo
+  and if the normal build folder is included, none of them are recompiled by 
default unless the whole build directory is specified.
+  -->
+  <target name="apply.module" depends="compile.apply.module">
     <java classname="org.openbravo.erpCommon.modules.ApplyModuleTask" 
fork="true" maxmemory="${build.maxmemory}" failonerror="true">
       <arg line="'${base.src}'" />
-      <classpath refid="project.class.path" />
+      <classpath refid="apply.module.runtime.classpath" />
     </java>
+   <delete includeEmptyDirs="true"  dir="${build.apply.module}" />
   </target>
   
   <target name="apply.modules.compile" depends="wad.lib">
@@ -936,4 +1017,23 @@
   <target name="validate.wad">
     <ant dir="${base.src}" target="wadvalidation" inheritAll="true" 
inheritRefs="true" />
   </target>
+  
+  <target name="UIrebuild" depends="core.lib">
+    <java classname="org.openbravo.base.BuildTask" 
jvm="${env.JAVA_HOME}/bin/java" fork="yes" maxmemory="${build.maxmemory}">
+      <arg line="'${base.config}/Openbravo.properties' ${logFileName}" />
+      <classpath>
+        <pathelement path="${build.core.lib}/openbravo-core.jar" />
+        <pathelement path="${base.lib}/runtime/log4j-1.2.8.jar" />
+        <pathelement path="${base.lib}/runtime/commons-pool.jar" />
+        <pathelement path="${base.lib}/runtime/commons-dbcp.jar" />
+        <pathelement path="${base.lib}/runtime/postgresql-jdbc3-8.2.jar" />
+        <pathelement path="${base.lib}/runtime/ojdbc6.jar" />
+        <pathelement path="${base.lib}/runtime/commons-collections.jar" />
+        <pathelement path="${base.lib}/runtime/ant-1.7.1.jar" />
+        <pathelement path="${base.lib}/runtime/ant-launcher.jar" />
+        <pathelement path="${base.lib}/runtime/ant-apache-log4j.jar" />
+        <pathelement path="${base.lib}/runtime/ant-nodeps.jar" />
+      </classpath>
+    </java>
+  </target>
 </project>
diff -r 596e719c242e -r 8ab0feb4908c src-core/.classpath
--- a/src-core/.classpath       Fri Jun 04 13:29:54 2010 +0200
+++ b/src-core/.classpath       Tue Jun 08 18:05:02 2010 +0200
@@ -15,5 +15,6 @@
        <classpathentry kind="lib" 
path="/openbravo/lib/runtime/log4j-1.2.8.jar"/>
        <classpathentry kind="lib" 
path="/openbravo/lib/runtime/commons-io-1.4.jar"/>
        <classpathentry kind="lib" path="/openbravo/lib/runtime/ant-1.7.1.jar"/>
+       <classpathentry kind="lib" 
path="/openbravo/lib/runtime/ant-apache-log4j.jar"/>
        <classpathentry kind="output" path="build/classes"/>
 </classpath>
diff -r 596e719c242e -r 8ab0feb4908c src-core/build.xml
--- a/src-core/build.xml        Fri Jun 04 13:29:54 2010 +0200
+++ b/src-core/build.xml        Tue Jun 08 18:05:02 2010 +0200
@@ -44,7 +44,7 @@
   </target>
 
   <target name="compile" depends="init">
-    <javac srcdir="${build.core.src}" destdir="${build.core}" deprecation="on" 
encoding="UTF-8" debug="true" debuglevel="lines,vars,source">
+    <javac srcdir="${build.core.src}" destdir="${build.core}" fork="true" 
deprecation="on" encoding="UTF-8" debug="true" debuglevel="lines,vars,source">
       <classpath refid="core.class.path"/>  
     </javac>
   </target>
diff -r 596e719c242e -r 8ab0feb4908c 
src-core/src/org/openbravo/base/AntExecutor.java
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/src-core/src/org/openbravo/base/AntExecutor.java  Tue Jun 08 18:05:02 
2010 +0200
@@ -0,0 +1,165 @@
+/*
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo  Public  License
+ * Version  1.0  (the  "License"),  being   the  Mozilla   Public  License
+ * Version 1.1  with a permitted attribution clause; you may not  use this
+ * file except in compliance with the License. You  may  obtain  a copy of
+ * the License at http://www.openbravo.com/legal/license.html 
+ * Software distributed under the License  is  distributed  on  an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ * License for the specific  language  governing  rights  and  limitations
+ * under the License. 
+ * The Original Code is Openbravo ERP. 
+ * The Initial Developer of the Original Code is Openbravo SLU 
+ * All portions are Copyright (C) 2008-2009 Openbravo SLU 
+ * All Rights Reserved. 
+ * Contributor(s):  ______________________________________.
+ ************************************************************************
+ */
+package org.openbravo.base;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.util.Vector;
+
+import org.apache.log4j.Logger;
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.DefaultLogger;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.ProjectHelper;
+import org.apache.tools.ant.listener.Log4jListener;
+
+/**
+ * The AntExecutor class allows to execute ant tasks in a given build.xml file.
+ * 
+ * 
+ */
+public class AntExecutor {
+  private static final Logger logger = Logger.getLogger(AntExecutor.class);
+
+  private Project project;
+  private String baseDir;
+  private FileOutputStream logFile;
+  private PrintStream ps;
+
+  /**
+   * Initializes a newly created AntExecutor object assigning it the build.xml 
file to execute tasks

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to