View source | Discuss this page | Page history | Printable version   

QA Sampledata Export

Warning.png   WARNING: The current article refers to a module which is currently under development, for now it does not exist in production.

HOW TO OBTAIN POS2.SAMPLEDATA

First step to obtain POS2 Sampledata is to download & copy the following 2 files to your desktop:

diff --git a/build.xml b/build.xml
index 3d88a14951..9c2d9d5260 100644
--- a/build.xml
+++ b/build.xml
@@ -646,7 +646,16 @@ export.database: exports database structure and data to xml files.
   <target name="export.sample.data" depends="init, core.lib">
     <ant dir="${base.db}" target="export.sample.data" inheritAll="true" inheritRefs="true" />
   </target>
+	
+  <target name="export.sample.data.extension" depends="init, core.lib">
+    <ant dir="${base.db}" target="export.sample.data.extension" inheritAll="true" inheritRefs="true" />
+  </target>
+	

+  <target name="export.reference.data" depends="init, core.lib">
+    <ant dir="${base.db}" target="export.reference.data" inheritAll="true" inheritRefs="true" />
+  </target>
+  
   <target name="import.sample.data" depends="init, core.lib">
     <ant dir="${base.db}" target="import.sample.data" inheritAll="true" inheritRefs="true" />
   </target>
diff --git a/src-db/database/build.xml b/src-db/database/build.xml
index 8ecb3c8ae1..0a535e9d30 100644
--- a/src-db/database/build.xml
+++ b/src-db/database/build.xml
@@ -160,6 +160,28 @@ export.database.structure: Exports the database structure in the xml's files.
       <sysproperty key="javax.xml.parsers.SAXParserFactory" value="com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl" />
     </java>
   </target>
+	
+  <target name="export.sample.data.extension">
+  <java classname="org.openbravo.ddlutils.task.ExportSampledataExtension" failonerror="true" fork="true" maxmemory="${build.maxmemory}">
+      <arg value="${bbdd.driver}"/>
+      <arg value="${bbdd.owner.url}"/>
+      <arg value="${bbdd.user}"/>
+      <arg value="${bbdd.password}"/>
+      <arg value="${bbdd.rdbms}"/>
+      <arg value="${basedir}/../../"/>
+      <arg value="${client}"/>
+      <arg value="${module}"/>
+      <arg value="${exportFormat}"/>
+      <arg value="${max.threads}"/>
+      <arg value="${dataSetName}"/>
+      <classpath refid="runtime-classpath"/>
+      <syspropertyset>
+         <propertyref name="java.security.egd" />
+      </syspropertyset>
+      <sysproperty key="javax.xml.parsers.SAXParserFactory" value="com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl" />
+    </java>
+  </target> 
+	

   <target name="import.sample.data">
     <taskdef name="importsampledata" classname="org.openbravo.ddlutils.task.ImportSampledata">


Bulbgraph.png   This file version may be updated in core module in the future. For now, is not available as standard

And create a new POS2 environment in order to avoid unnecessary data previously created.

Once we have a clean environment, execute the following command in “openbravo” folder:

cp /home/openbravo/Desktop/dbsourcemanager.jar src-db/database/lib/dbsourcemanager.jar && patch -p1 < /home/openbravo/Desktop/sampleDataExtension.diff

The command will create the following files in your environment, that are strictly necessary to export the required sampledata:

Wiki NecessaryFilesToExport.png


OPTIONAL: In order to ease which sampledata (XML Table) is the one we need, it is recommended to make an export with the clean environment first and commit the new files created.

To do it, first create a branch for openbravo/modules/pos2.sampledata and switch to it, then return to openbravo folder and execute the following command:

 ant export.sample.data.extension -DdataSetName="POS2 SampleData" -Dclient="The White Valley Group" -Dmodule=org.openbravo.pos2.sampledata

XML tables will be updated in “org,openbravo.pos2.sampledata” folder, add all changes and create a commit (DO NOT PUSH IT).


Now, it’s all ready to export sampledata BUT take in account that it can be 2 possible scenarios:

Table EXISTS in pos2.sampledata Dataset

The easier scenario, in this case sampledata can be easily obtained following the next steps:

ant export.sample.data.extension -DdataSetName="POS2 SampleData" -Dclient="The White Valley Group" -Dmodule=org.openbravo.pos2.sampledata

XML tables will be updated in “org,openbravo.pos2.sampledata” folder, commit and push the required tables.

Table DOES NOT exist in pos2.sampledata Dataset

In this case, it will be necessary to create them following this steps:

Wiki DatasetTableInfo.png

Wiki ModuleDevelop.png

Wiki DatasetTable.png

Wiki DataAccessLevel.png

Now, the required tables will be exported in pos2.sampledata, but first it is necessary to go to the terminal, and in openbravo folder execute the following command:

ant export.database

Go to http://localhost:8080/openbravo/ , apply the necessary changes and verify in POS2 if changes are the desired ones.

Finally, execute the command to obtain the sampledata:

ant export.sample.data.extension -DdataSetName="POS2 SampleData" -Dclient="The White Valley Group" -Dmodule=org.openbravo.pos2.sampledata

XML tables will be updated in “org,openbravo.pos2.sampledata” folder, commit and push the required tables.

Retrieved from "http://wiki.openbravo.com/wiki/QA_Sampledata_Export"

This page has been accessed 572 times. This page was last modified on 1 August 2023, at 07:02. Content is available under Creative Commons Attribution-ShareAlike 2.5 Spain License.