Added security mechanism. Now you will not be able to export if you haven't previously done a create.database or an update.database of your current version of the database xml files.
authorAntonio Moreno <antonio.moreno@openbravo.com>
Wed, 14 May 2008 14:14:38 +0000
changeset 903 0ce6e1b8e53f
parent 902 303bf32bbcf2
child 904 a0c4016407c0
Added security mechanism. Now you will not be able to export if you haven't previously done a create.database or an update.database of your current version of the database xml files.
build.xml
src-db/database/build.xml
src-db/database/lib/dbsourcemanager.jar
--- a/build.xml	Wed May 14 13:43:16 2008 +0000
+++ b/build.xml	Wed May 14 14:14:38 2008 +0000
@@ -136,8 +136,15 @@
         <param name="lines" value="1"/>
       </filterreader>
     </filterchain>
+  	<filterchain>
+      <filterreader classname="org.apache.tools.ant.filters.StripLineBreaks" />
+    </filterchain>
   </loadfile>
-  <property name="code.revision" value="${svn.entries}" />
+  <condition property="code.revision" value="${svn.entries}" else ="0">
+  	<and>
+      <isset property="svn.entries" />
+  	</and>
+  </condition>    
  </target>
 
 
@@ -287,16 +294,16 @@
     <ant dir="${base.db}" target="update.database.script" inheritAll="true" inheritRefs="true"/>
   </target>
 
-  <target name="export.database" depends="init">
+  <target name="export.database" depends="init,code.rev">
     <ant dir="${base.db}" target="export.database.structure" inheritAll="true" inheritRefs="true"/>
     <ant dir="${base.db}" target="export.database.data" inheritAll="true" inheritRefs="true"/>
   </target>
 
-  <target name="export.database.structure" depends="init">
+  <target name="export.database.structure" depends="init,code.rev">
     <ant dir="${base.db}" target="export.database.structure" inheritAll="true" inheritRefs="true"/>
   </target>
 
-  <target name="export.database.data" depends="init">
+  <target name="export.database.data" depends="init,code.rev">
     <ant dir="${base.db}" target="export.database.data" inheritAll="true" inheritRefs="true"/>
   </target>
 
@@ -304,7 +311,7 @@
     <ant dir="${base.db}" target="import.database.data" inheritAll="true" inheritRefs="true"/>
   </target>
 
-  <target name="export.database.sampledata" depends="init">
+  <target name="export.database.sampledata" depends="init,code.rev">
     <ant dir="${base.db}" target="export.database.sampledata" inheritAll="true" inheritRefs="true"/>
   </target>
 
@@ -312,7 +319,7 @@
     <ant dir="${base.db}" target="import.database.sampledata" inheritAll="true" inheritRefs="true"/>
   </target>
 
-  <target name="export.database.masterdata" depends="init">
+  <target name="export.database.masterdata" depends="init,code.rev">
     <ant dir="${base.db}" target="export.database.masterdata" inheritAll="true" inheritRefs="true"/>
   </target>
 
--- a/src-db/database/build.xml	Wed May 14 13:43:16 2008 +0000
+++ b/src-db/database/build.xml	Wed May 14 14:14:38 2008 +0000
@@ -345,7 +345,8 @@
                         password="${bbdd.password}"
                         excludeobjects="com.openbravo.db.OpenbravoExcludeFilter"
                         model="model"
-                        verbosity="${bbdd.verbosity}" />
+                        verbosity="${bbdd.verbosity}" 
+			  			codeRevision="${code.revision}"/>
     </target>
 
   <target name="import.database.data">
@@ -375,7 +376,8 @@
                   excludeobjects="com.openbravo.db.OpenbravoExcludeFilter"
                   filter="com.openbravo.db.OpenbravoMetadataFilter"   
                   output="sourcedata"
-                  verbosity="${bbdd.verbosity}" />
+                  verbosity="${bbdd.verbosity}" 
+      			  codeRevision="${code.revision}"/>
   </target> 
 
 	  <target name="import.database.sampledata">
@@ -403,7 +405,8 @@
 	                  excludeobjects="com.openbravo.db.OpenbravoExcludeFilter"
 	                  filter="com.openbravo.db.OpenbravoDataFilter"   
 	                  output="sampledata"
-	                  verbosity="${bbdd.verbosity}" />
+	                  verbosity="${bbdd.verbosity}" 
+			  		  codeRevision="${code.revision}"/>
 	  </target> 
 
 	  <target name="import.database.masterdata">
@@ -431,7 +434,8 @@
 	                  excludeobjects="com.openbravo.db.OpenbravoExcludeFilter"
 	                  filter="com.openbravo.db.OpenbravoMasterdataFilter"   
 	                  output="masterdata"
-	                  verbosity="${bbdd.verbosity}" />
+	                  verbosity="${bbdd.verbosity}" 
+			  		  codeRevision="${code.revision}"/>
 	  </target> 
 
   <target name="save.database.model">
Binary file src-db/database/lib/dbsourcemanager.jar has changed