feature request: [1826658] Removed XmlPool.xml and dbCon5.cml files and included all configuration options in Openbravo.properties.
authorAsier Lostalé <asier.lostale@openbravo.com>
Mon, 12 Nov 2007 09:44:15 +0000
changeset 41 5e565c858353
parent 40 4bf0d5f056b8
child 42 80e9e37cd02d
feature request: [1826658] Removed XmlPool.xml and dbCon5.cml files and included all configuration options in Openbravo.properties.
config/Openbravo.properties.template
config/XmlPool.xml.template
config/XmlPool_PostgreSQL.xml
config/dbCon5.xml.template
config/dbCon5_PostgreSQL.xml
config/userconfig.xml.template
setup/ant.install.log
setup/build.xml
setup/setup.jar
setup/setup/Setup.class
setup/setup/Setup.java
setup/setup/antinstall-config.xml
setup/setup/build.xml
src-core/src/org/openbravo/data/Sqlc.java
src-core/src/org/openbravo/database/ConnectionProviderImpl.java
src-core/src/org/openbravo/database/StandAloneConnection.java
src-trl/build.xml
src-wad/build.xml
src-wad/src/org/openbravo/wad/Wad.java
src-wad/src/org/openbravo/wad/WadConnection.java
src-wad/src/org/openbravo/wad/web.xml
--- a/config/Openbravo.properties.template	Fri Nov 09 16:13:34 2007 +0000
+++ b/config/Openbravo.properties.template	Mon Nov 12 09:44:15 2007 +0000
@@ -10,7 +10,7 @@
 # * under the License. 
 # * The Original Code is Openbravo ERP. 
 # * The Initial Developer of the Original Code is Openbravo SL 
-# * All portions are Copyright (C) 2001-2006 Openbravo SL 
+# * All portions are Copyright (C) 2007 Openbravo SL 
 # * All Rights Reserved. 
 # * Contributor(s):  ______________________________________.
 # ************************************************************************
@@ -19,6 +19,14 @@
 dateFormat.sql = DD-MM-YYYY
 dateFormat.java = dd-MM-yyyy
 dateTimeFormat.java = dd-MM-yyyy HH:mm:ss
+
+
+bbdd.outputscript=~/databasescript.sql
+bbdd.verbosity=INFO
+application.version=2.34
+developer.id=1
+
+#DB properties
 bbdd.sid=xe
 bbdd.systemUser=SYSTEM
 bbdd.systemPassword=SYSTEM
@@ -27,7 +35,11 @@
 bbdd.driver=oracle.jdbc.driver.OracleDriver
 bbdd.url=jdbc:oracle:thin:@localhost:1521:xe
 bbdd.rdbms=ORACLE
-bbdd.outputscript=~/databasescript.sql
-bbdd.verbosity=INFO
-application.version=2.34
-developer.id=1
+
+# build.xml properties
+base.app=AppsOpenbravo
+base.source=/opt/openbravo
+attach.path=/opt/openbravo/attachment
+web.url=http://localhost:8880/openbravo/web
+context.url=http://localhost:8880/openbravo
+base.temp=/opt/tmp
--- a/config/XmlPool.xml.template	Fri Nov 09 16:13:34 2007 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
- *************************************************************************
- * 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 SL 
- * All portions are Copyright (C) 2001-2006 Openbravo SL 
- * All Rights Reserved. 
- * Contributor(s):  ______________________________________.
- ************************************************************************
--->
-
-
-<!DOCTYPE aplication SYSTEM "pool.dtd">
-<aplication>
-  <pool name="myPool">
-    <dbDriver>oracle.jdbc.OracleDriver</dbDriver>
-    <dbServer>jdbc:oracle:thin:@localhost:1521:sid</dbServer>
-    <dbLogin>TAD</dbLogin>
-    <dbPassword>TAD</dbPassword>
-    <minConns>1</minConns>
-    <maxConns>10</maxConns>
-    <maxConnTime>0.5</maxConnTime>
-    <dbSessionConfig>ALTER SESSION SET NLS_LANGUAGE='SPANISH' NLS_DATE_FORMAT='DD-MM-YYYY' NLS_NUMERIC_CHARACTERS='.,'</dbSessionConfig>
-    <rdbms>ORACLE</rdbms>
-  </pool>
-</aplication>
--- a/config/XmlPool_PostgreSQL.xml	Fri Nov 09 16:13:34 2007 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
- *************************************************************************
- * 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 SL 
- * All portions are Copyright (C) 2001-2006 Openbravo SL 
- * All Rights Reserved. 
- * Contributor(s):  ______________________________________.
- ************************************************************************
--->
-
-
-<!DOCTYPE aplication SYSTEM "pool.dtd">
-<aplication>
-  <pool name="myPool">
-    <dbDriver>org.postgresql.Driver</dbDriver>
-    <dbServer>jdbc:postgresql://localhost:5432/openbravo</dbServer>
-    <dbLogin>tad</dbLogin>
-    <dbPassword>tad</dbPassword>
-    <minConns>1</minConns>
-    <maxConns>10</maxConns>
-    <maxConnTime>0.5</maxConnTime>
-    <dbSessionConfig>SELECT 'X'</dbSessionConfig>
-    <rdbms>POSTGRE</rdbms>
-  </pool>
-</aplication>
--- a/config/dbCon5.xml.template	Fri Nov 09 16:13:34 2007 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
- *************************************************************************
- * 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 SL 
- * All portions are Copyright (C) 2001-2006 Openbravo SL 
- * All Rights Reserved. 
- * Contributor(s):  ______________________________________.
- ************************************************************************
--->
-
-
-<data-base>
-  <connection name="myPool" type="pool" driver = "oracle.jdbc.OracleDriver" URL = "jdbc:oracle:thin:TAD/TAD@localhost:1521:sid">
-  </connection>
-</data-base>
--- a/config/dbCon5_PostgreSQL.xml	Fri Nov 09 16:13:34 2007 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
- *************************************************************************
- * 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 SL 
- * All portions are Copyright (C) 2001-2006 Openbravo SL 
- * All Rights Reserved. 
- * Contributor(s):  ______________________________________.
- ************************************************************************
--->
-
-
-<data-base>
-  <connection name="myPool" type="pool" driver = "org.postgresql.Driver" URL = "jdbc:postgresql://localhost:5432/openbravo" DBUser="tad" DBPassword="tad">
-  </connection>
-</data-base>
--- a/config/userconfig.xml.template	Fri Nov 09 16:13:34 2007 +0000
+++ b/config/userconfig.xml.template	Mon Nov 12 09:44:15 2007 +0000
@@ -13,7 +13,7 @@
  * and  limitations under the License. 
  * The Original Code is OpenBravo ERP. 
  * The Initial Developer of the Original Code is [Autores] and OpenBravo SL 
- * All portions are Copyright (C) 2005-2006 OpenBravo SL 
+ * All portions are Copyright (C) 2005-2007 OpenBravo SL 
  * All Rights Reserved. 
  * Contributor(s): Openbravo S.L.
  ************************************************************************
@@ -46,7 +46,13 @@
 
 <!--  
 fontBaseDir: Similar to baseDir, except that this value is used for fonts. If
-<value>C:\fop-0.20.5</value>
+         it isn't specified, the value from baseDir is used.
+-->
+<!--
+  <entry>     
+    <key>fontBaseDir</key>      
+    <value>/tmp</value>    
+  </entry>
 -->
 
 </configuration>
--- a/setup/ant.install.log	Fri Nov 09 16:13:34 2007 +0000
+++ b/setup/ant.install.log	Mon Nov 12 09:44:15 2007 +0000
@@ -574,3 +574,251 @@
 Install screens rendered
 Ant finished
 Finalizing
+Logger initialized
+Ant basedir:/tmp/antinstall
+Config loaded
+Created UI classes
+Install screens rendered
+Ant finished
+Finalizing
+Logger initialized
+Ant basedir:/tmp/antinstall
+Config loaded
+Created UI classes
+Install screens rendered
+Ant finished
+Finalizing
+Logger initialized
+Ant basedir:/tmp/antinstall
+Config loaded
+Created UI classes
+Install screens rendered
+Ant finished
+Finalizing
+Logger initialized
+Ant basedir:/tmp/antinstall
+Config loaded
+Created UI classes
+Install screens rendered
+Ant finished
+Finalizing
+Logger initialized
+Ant basedir:/tmp/antinstall
+Config loaded
+Created UI classes
+Install screens rendered
+Ant finished
+Finalizing
+Logger initialized
+Ant basedir:/tmp/antinstall
+Config loaded
+Created UI classes
+Install screens rendered
+Ant finished
+Finalizing
+Logger initialized
+Ant basedir:/tmp/antinstall
+Config loaded
+Created UI classes
+Aborted
+Finalizing
+Logger initialized
+Ant basedir:/tmp/antinstall
+Config loaded
+Created UI classes
+Install screens rendered
+Ant finished
+Finalizing
+Logger initialized
+Ant basedir:/tmp/antinstall
+Config loaded
+Created UI classes
+Install screens rendered
+Ant finished
+Finalizing
+Logger initialized
+Ant basedir:/tmp/antinstall
+Config loaded
+Created UI classes
+Install screens rendered
+Ant finished
+Finalizing
+Logger initialized
+Ant basedir:/tmp/antinstall
+Config loaded
+Created UI classes
+Install screens rendered
+Ant finished
+Finalizing
+Logger initialized
+Ant basedir:/tmp/antinstall
+Config loaded
+Created UI classes
+Logger initialized
+Ant basedir:/tmp/antinstall
+Config loaded
+Created UI classes
+Aborted
+Finalizing
+Logger initialized
+Ant basedir:/tmp/antinstall
+Config loaded
+Created UI classes
+Aborted
+Finalizing
+Logger initialized
+Ant basedir:/tmp/antinstall
+Config loaded
+Created UI classes
+Install screens rendered
+Ant finished
+Finalizing
+Logger initialized
+Ant basedir:/tmp/antinstall
+Config loaded
+Created UI classes
+Install screens rendered
+Ant finished
+Finalizing
+Logger initialized
+Ant basedir:/tmp/antinstall
+Config loaded
+Created UI classes
+Aborted
+Finalizing
+Logger initialized
+Ant basedir:/tmp/antinstall
+Config loaded
+Created UI classes
+Install screens rendered
+Ant finished
+Finalizing
+Logger initialized
+Ant basedir:/tmp/antinstall
+Config loaded
+Created UI classes
+Install screens rendered
+Ant finished
+Finalizing
+Logger initialized
+Ant basedir:/tmp/antinstall
+Config loaded
+Created UI classes
+Logger initialized
+Ant basedir:/tmp/antinstall
+Config loaded
+Created UI classes
+Logger initialized
+Ant basedir:/tmp/antinstall
+Config loaded
+Created UI classes
+Logger initialized
+Ant basedir:/tmp/antinstall
+Config loaded
+Created UI classes
+Install screens rendered
+Installation error:Error running the install:class org.tp23.antinstaller.InstallException
+Logger initialized
+Ant basedir:/tmp/antinstall
+Config loaded
+Created UI classes
+Install screens rendered
+Installation error:Error running the install:class org.tp23.antinstaller.InstallException
+Logger initialized
+Ant basedir:/tmp/antinstall
+Config loaded
+Created UI classes
+Install screens rendered
+Ant finished
+Finalizing
+Logger initialized
+Ant basedir:/tmp/antinstall
+Config loaded
+Created UI classes
+Install screens rendered
+Ant finished
+Finalizing
+Logger initialized
+Ant basedir:/tmp/antinstall
+Config loaded
+Created UI classes
+Install screens rendered
+Ant finished
+Finalizing
+Logger initialized
+Ant basedir:/tmp/antinstall
+Config loaded
+Created UI classes
+Install screens rendered
+Ant finished
+Finalizing
+Logger initialized
+Ant basedir:/tmp/antinstall
+Config loaded
+Created UI classes
+Install screens rendered
+Ant finished
+Finalizing
+Logger initialized
+Ant basedir:/tmp/antinstall
+Config loaded
+Created UI classes
+Install screens rendered
+Ant finished
+Finalizing
+Logger initialized
+Ant basedir:/tmp/antinstall
+Config loaded
+Created UI classes
+Install screens rendered
+Ant finished
+Finalizing
+Logger initialized
+Ant basedir:/tmp/antinstall
+Config loaded
+Created UI classes
+Install screens rendered
+Ant finished
+Finalizing
+Logger initialized
+Ant basedir:/tmp/antinstall
+Config loaded
+Created UI classes
+Install screens rendered
+Ant finished
+Finalizing
+Logger initialized
+Ant basedir:/tmp/antinstall
+Config loaded
+Created UI classes
+Install screens rendered
+Ant finished
+Finalizing
+Logger initialized
+Ant basedir:/tmp/antinstall
+Config loaded
+Created UI classes
+Install screens rendered
+Ant finished
+Finalizing
+Logger initialized
+Ant basedir:/tmp/antinstall
+Config loaded
+Created UI classes
+Install screens rendered
+Ant finished
+Finalizing
+Logger initialized
+Ant basedir:/tmp/antinstall
+Config loaded
+Created UI classes
+Install screens rendered
+Ant finished
+Finalizing
+Logger initialized
+Ant basedir:/tmp/antinstall
+Config loaded
+Created UI classes
+Install screens rendered
+Ant finished
+Finalizing
--- a/setup/build.xml	Fri Nov 09 16:13:34 2007 +0000
+++ b/setup/build.xml	Mon Nov 12 09:44:15 2007 +0000
@@ -26,6 +26,8 @@
   <property name="bbdd.sid" value="orcl"/>
   <property name="bbdd.port" value="1521"/>
   <property name="font.base" value="fonts"/>
+	<property name="bbdd.rdbms" value="ORACLE"/>
+	<property name="systemUser" value="SYSTEM"/>
 
   <target name="compile">
     <javac srcdir="./setup" destdir="./setup" deprecation="on" encoding="UTF-8"/>
@@ -47,7 +49,7 @@
 
   <target name="directSetup">
     <java dir="./setup" classname="Setup" jvm="${env.JAVA_HOME}/bin/java" fork="yes" maxmemory="200M">
-      <arg line="'${base.app}' '${base.source}' '${base.temp}' '${attach.path}' '${font.base}' '${web.url}' '${bbdd.host}' '${bbdd.user}' '${bbdd.password}' '${bbdd.sid}' '${bbdd.port}' '${jakarta.context.name}' '${systemPassword}' '${bbdd.Tns}' '${temp_folder}'"/>
+      <arg line="'${base.app}' '${base.source}' '${base.temp}' '${attach.path}' '${font.base}' '${web.url}' '${bbdd.host}' '${bbdd.user}' '${bbdd.password}' '${bbdd.sid}' '${bbdd.port}' '${jakarta.context.name}' '${systemPassword}' '${bbdd.Tns}' '${temp.folder}' '${bbdd.rdbms}' '${systemUser}'"/>
       <classpath>
         <pathelement location="./setup/"/>
       </classpath>
@@ -55,35 +57,22 @@
   </target>
 
   <target name="setup" depends="compile, jar">
-    <copy file="..${separator}build.xml.template" tofile="${temp.folder}${separator}build.xml" overwrite="yes"/>
-    <copy file="..${separator}config${separator}dbCon5.xml.template" tofile="${temp.folder}${separator}config${separator}dbCon5.xml" overwrite="yes"/>
-    <copy file="..${separator}config${separator}XmlPool.xml.template" tofile="${temp.folder}${separator}config${separator}XmlPool.xml" overwrite="yes"/>
     <copy file="..${separator}config${separator}log4j.lcf.template" tofile="${temp.folder}${separator}config${separator}log4j.lcf" overwrite="yes"/>
     <copy file="..${separator}config${separator}userconfig.xml.template" tofile="${temp.folder}${separator}config${separator}userconfig.xml" overwrite="yes"/>
     <copy file="..${separator}src${separator}deploy.wsdd.template" tofile="${temp.folder}${separator}src${separator}deploy.wsdd" overwrite="yes"/>
     <copy file="..${separator}config${separator}Openbravo.properties.template" tofile="${temp.folder}${separator}config${separator}Openbravo.properties" overwrite="yes"/>
-    <copy file="..${separator}database${separator}build.xml" tofile="${temp.folder}${separator}database${separator}build.xml" overwrite="yes"/>
     <java jar="./${jar.name}.jar" jvm="${env.JAVA_HOME}/bin/java" fork="yes" maxmemory="${build.maxmemory}"/>
-    <copy file="${temp.folder}${separator}build.xml" tofile="..${separator}build.xml" overwrite="yes"/>
-    <copy file="${temp.folder}${separator}config${separator}dbCon5.xml" tofile="..${separator}config${separator}dbCon5.xml" overwrite="yes"/>
-    <copy file="${temp.folder}${separator}config${separator}XmlPool.xml" tofile="..${separator}config${separator}XmlPool.xml" overwrite="yes"/>
     <copy file="${temp.folder}${separator}config${separator}log4j.lcf" tofile="..${separator}config${separator}log4j.lcf" overwrite="yes"/>
     <copy file="${temp.folder}${separator}config${separator}Openbravo.properties" tofile="..${separator}config${separator}Openbravo.properties" overwrite="yes"/>
     <copy file="${temp.folder}${separator}config${separator}userconfig.xml" tofile="..${separator}config${separator}userconfig.xml" overwrite="yes"/>
     <copy file="${temp.folder}${separator}src${separator}deploy.wsdd" tofile="..${separator}src${separator}deploy.wsdd" overwrite="yes"/>
-    <copy file="${temp.folder}${separator}database${separator}build.xml" tofile="..${separator}database${separator}build.xml" overwrite="yes"/>
-    <delete file="${temp.folder}${separator}build.xml"/>
-    <delete file="${temp.folder}${separator}config${separator}dbCon5.xml"/>
-    <delete file="${temp.folder}${separator}config${separator}XmlPool.xml"/>
     <delete file="${temp.folder}${separator}config${separator}log4j.lcf"/>
     <delete file="${temp.folder}${separator}config${separator}Openbravo.properties"/>
     <delete file="${temp.folder}${separator}config${separator}userconfig.xml"/>
     <delete file="${temp.folder}${separator}src${separator}deploy.wsdd"/>
-    <delete file="${temp.folder}${separator}database${separator}build.xml"/>
     <delete includeEmptyDirs="true" >
           <fileset dir="${temp.folder}${separator}config" />
           <fileset dir="${temp.folder}${separator}src" />
-	  <fileset dir="${temp.folder}${separator}database"/>
     </delete>
   </target>
 </project>
Binary file setup/setup.jar has changed
Binary file setup/setup/Setup.class has changed
--- a/setup/setup/Setup.java	Fri Nov 09 16:13:34 2007 +0000
+++ b/setup/setup/Setup.java	Mon Nov 12 09:44:15 2007 +0000
@@ -17,6 +17,7 @@
  ************************************************************************
 */
 import java.io.*;
+import java.util.Properties;
 
 public class Setup {
   static String baseApp;
@@ -34,9 +35,11 @@
   static String jakartaContextName;
   static String subversionBase;
   static String systemPassword = "";
+  static String systemUser = "";
   static String bbddTns = "";
   static String actualPath = ".";
-
+  static String rdbms = "";
+  
   public static void main(String[] args) throws Exception {
     if (args.length<12) throw new Exception("Incorrect number of arguments");
     baseApp = args[0];
@@ -54,220 +57,82 @@
     if (args.length>12) systemPassword = args[12];
     if (args.length>13) bbddTns = args[13];
     if (args.length>14) actualPath = args[14];
+    if (args.length>15) rdbms = args[15];
+    if (args.length>16) systemUser = args[16];
+    
     File fileSource = new File(actualPath);
     if (!fileSource.exists()) throw new Exception("Unknown directory: " + actualPath);
     
-    replaceBuildFile(fileSource);
-    if (systemPassword!=null && !systemPassword.equals("")) replaceBuildDatabaseFile(fileSource);
-    replaceDBCon5File(fileSource);
-    replaceXMLPoolFile(fileSource);
+    replacePropertiesFile(fileSource);
     replaceUserConfigFile(fileSource);
-    replaceDeployWsddFile(fileSource);
   }
-
-  public static void replaceBuildFile(File path) {
+  public static void replacePropertiesFile(File path) {
     try {
-      File file = new File(path, "build.xml");
+      File file = new File(path, "config/Openbravo.properties");
       if (!file.exists()) {
-        System.out.println("Unknown file: " + path + "/build.xml");
+        System.out.println("Unknown file: " + path + "/Openbravo.properties");
         return;
       }
-      BufferedReader fileBuffer = new BufferedReader(new FileReader(file));
-      StringBuffer total = new StringBuffer();
-
-      String nextLine = fileBuffer.readLine();
-      while (nextLine != null) {
-        int aux = -1;
-        if ((aux=nextLine.indexOf("<property name=\"base.app\""))!=-1) {
-          nextLine = replacePropertyValue(nextLine, baseApp, aux);
-        } else if ((aux=nextLine.indexOf("<property name=\"base.source\""))!=-1) {
-          nextLine = replacePropertyValue(nextLine, baseSource, aux);
-        } else if ((aux=nextLine.indexOf("<property name=\"base.temp\""))!=-1) {
-          nextLine = replacePropertyValue(nextLine, baseTemp, aux);
-        } else if ((aux=nextLine.indexOf("<property name=\"attach.path\""))!=-1) {
-          nextLine = replacePropertyValue(nextLine, attachPath, aux);
-        } else if ((aux=nextLine.indexOf("<property name=\"web.url\""))!=-1) {
-          nextLine = replacePropertyValue(nextLine, webUrl, aux);
-        } else if ((aux=nextLine.indexOf("<property name=\"context.url\""))!=-1) {
-          nextLine = replacePropertyValue(nextLine, webUrl.replace("/web",""), aux);
-        } else if ((aux=nextLine.indexOf("<property name=\"context.name\""))!=-1) {
-          nextLine = replacePropertyValue(nextLine, jakartaContextName, aux);
-        } else if ((aux=nextLine.indexOf("<property name=\"jakarta.context\""))!=-1) {
-          nextLine = replacePropertyValue(nextLine, "${jakarta.home}${separator}webapps${separator}" + jakartaContextName, aux);
-	} 
- 
-        total.append(nextLine).append("\n");
-        nextLine = fileBuffer.readLine();
+      
+      /*
+       * DB properties
+       */
+      Properties properties = new Properties();
+      properties.load(new FileInputStream(file));
+      properties.setProperty("bbdd.sid", bbddSid);
+      properties.setProperty("bbdd.user", bbddUser);
+      properties.setProperty("bbdd.password", bbddPassword);
+      properties.setProperty("bbdd.rdbms",rdbms);
+      
+      if (systemPassword!=null && !systemPassword.equals("")) {
+        properties.setProperty("bbdd.systemUser", systemUser);
+        properties.setProperty("bbdd.systemPassword", systemPassword);
       }
-      fileBuffer.close();
-
-
-      FileWriter fileWriter = new FileWriter(file);
-      PrintWriter printWriter = new PrintWriter(fileWriter);
-      printWriter.print(total.toString());
-      printWriter.close();
-    } catch (IOException e) {
+        
+      if (rdbms.equals("ORACLE")) { 
+        properties.setProperty("bbdd.driver", "oracle.jdbc.OracleDriver");
+        properties.setProperty("bbdd.url", "jdbc:oracle:thin:"+bbddUser+"/"+bbddPassword+"@"+bbddHost+":"+bbddPort+":"+bbddSid);
+        properties.setProperty("bbdd.sessionConfig","ALTER SESSION SET NLS_LANGUAGE='SPANISH' NLS_DATE_FORMAT='DD-MM-YYYY' NLS_NUMERIC_CHARACTERS='.,'");
+      } else { //postgres
+        properties.setProperty("bbdd.driver", "org.postgresql.Driver");
+        properties.setProperty("bbdd.url","jdbc:postgresql://"+bbddHost+":"+bbddPort);
+      }
+      
+      /*
+       * build.xml properties
+       */
+      properties.setProperty("base.app", baseApp);
+      properties.setProperty("base.source", baseSource);
+      properties.setProperty("base.temp", baseTemp);
+      properties.setProperty("attach.path", attachPath);
+      properties.setProperty("web.url", webUrl);
+      properties.setProperty("context.url", webUrl.replace("/web",""));
+      properties.setProperty("context.name", jakartaContextName);
+      
+      String strHeader = 
+         "# *************************************************************************\n"
+        +"# * The contents of this file are subject to the Openbravo  Public  License\n"
+        +"# * Version  1.0  (the  \"License\"),  being   the  Mozilla   Public  License\n"
+        +"# * Version 1.1  with a permitted attribution clause; you may not  use this\n"
+        +"# * file except in compliance with the License. You  may  obtain  a copy of\n"
+        +"# * the License at http://www.openbravo.com/legal/license.html \n"
+        +"# * Software distributed under the License  is  distributed  on  an \"AS IS\"\n"
+        +"# * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the\n"
+        +"# * License for the specific  language  governing  rights  and  limitations\n"
+        +"# * under the License. \n"
+        +"# * The Original Code is Openbravo ERP. \n"
+        +"# * The Initial Developer of the Original Code is Openbravo SL\n" 
+        +"# * All portions are Copyright (C) 2007 Openbravo SL\n" 
+        +"# * All Rights Reserved. \n"
+        +"# * Contributor(s):  ______________________________________.\n"
+        +"# ************************************************************************\n";
+        
+      properties.store(new FileOutputStream(file), strHeader);
+    } catch (Exception e) {
       e.printStackTrace();
     }
   }
-
-  public static void replaceDBCon5File(File path) {
-    try {
-      File file = new File(path, "config/dbCon5.xml");
-      if (!file.exists()) {
-        System.out.println("Unknown file: " + path + "/config/dbCon5.xml");
-        return;
-      }
-      StringBuffer strBuf = new StringBuffer();
-      strBuf.append("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n");
-      strBuf.append("<!--\n");
-      strBuf.append(" *************************************************************************\n");
-      strBuf.append(" * The contents of this file are subject to the Openbravo  Public  License\n");
-      strBuf.append(" * Version  1.0  (the  \"License\"),  being   the  Mozilla   Public  License\n");
-      strBuf.append(" * Version 1.1  with a permitted attribution clause; you may not  use this\n");
-      strBuf.append(" * file except in compliance with the License. You  may  obtain  a copy of\n");
-      strBuf.append(" * the License at http://www.openbravo.com/legal/license.html \n");
-      strBuf.append(" * Software distributed under the License  is  distributed  on  an \"AS IS\"\n");
-      strBuf.append(" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the\n");
-      strBuf.append(" * License for the specific  language  governing  rights  and  limitations\n");
-      strBuf.append(" * under the License. \n");
-      strBuf.append(" * The Original Code is Openbravo ERP. \n");
-      strBuf.append(" * The Initial Developer of the Original Code is Openbravo SL \n");
-      strBuf.append(" * All portions are Copyright (C) 2001-2006 Openbravo SL \n");
-      strBuf.append(" * All Rights Reserved. \n");
-      strBuf.append(" * Contributor(s):  ______________________________________.\n");
-      strBuf.append(" ************************************************************************\n");
-      strBuf.append("-->\n");
-      strBuf.append("\n");
-      strBuf.append("\n");
-      strBuf.append("<data-base>\n");
-      strBuf.append("  <connection name=\"myPool\" type=\"pool\" driver = \"oracle.jdbc.OracleDriver\" URL = \"jdbc:oracle:thin:").append(bbddUser).append("/").append(bbddPassword).append("@").append(bbddHost).append(":").append(bbddPort).append(":").append(bbddSid).append("\">\n");
-      strBuf.append("  </connection>\n");
-      strBuf.append("</data-base>\n");
-
-
-      FileWriter fileWriter = new FileWriter(file);
-      PrintWriter printWriter = new PrintWriter(fileWriter);
-      printWriter.print(strBuf.toString());
-      printWriter.close();
-    } catch (IOException e) {
-      e.printStackTrace();
-    }
-  }
-
-  public static void replaceBuildDatabaseFile(File path) {
-    try {
-      File file = new File(path, "/database/build.xml");
-      if (!file.exists()) {
-        System.out.println("Unknown file: " + path + "/database/build.xml");
-        return;
-      }
-      BufferedReader fileBuffer = new BufferedReader(new FileReader(file));
-      StringBuffer total = new StringBuffer();
-
-      String nextLine = fileBuffer.readLine();
-      while (nextLine != null) {
-        int aux = -1;
-        if ((aux=nextLine.indexOf("<property name=\"bbdd.host\""))!=-1) {
-          nextLine = replacePropertyValue(nextLine, bbddHost, aux);
-        } else if ((aux=nextLine.indexOf("<property name=\"bbdd.port\""))!=-1) {
-          nextLine = replacePropertyValue(nextLine, bbddPort, aux);
-        } else if ((aux=nextLine.indexOf("<property name=\"bbdd.sid\""))!=-1) {
-          nextLine = replacePropertyValue(nextLine, bbddSid, aux);
-        } else if ((aux=nextLine.indexOf("<property name=\"systemPassword\""))!=-1) {
-          nextLine = replacePropertyValue(nextLine, systemPassword, aux);
-        } else if ((aux=nextLine.indexOf("<property name=\"bbdd.tns\""))!=-1) {
-          nextLine = replacePropertyValue(nextLine, bbddTns, aux);
-        } else if ((aux=nextLine.indexOf("<property name=\"bbdd.user\""))!=-1) {
-          nextLine = replacePropertyValue(nextLine, bbddUser, aux);
-        } else if ((aux=nextLine.indexOf("<property name=\"bbdd.password\""))!=-1) {
-          nextLine = replacePropertyValue(nextLine, bbddPassword, aux);
-        }
-
-        total.append(nextLine).append("\n");
-        nextLine = fileBuffer.readLine();
-      }
-      fileBuffer.close();
-
-
-      FileWriter fileWriter = new FileWriter(file);
-      PrintWriter printWriter = new PrintWriter(fileWriter);
-      printWriter.print(total.toString());
-      printWriter.close();
-      } catch (IOException e) {
-      e.printStackTrace();
-    }
-  }
-
-
-  public static void replaceXMLPoolFile(File path) {
-    try {
-      File file = new File(path, "config/XmlPool.xml");
-      if (!file.exists()) {
-        System.out.println("Unknown file: " + path + "/config/XmlPool.xml");
-        return;
-      }
-      StringBuffer strBuf = new StringBuffer();
-      strBuf.append("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n");
-      strBuf.append("<!--\n");
-      strBuf.append(" *************************************************************************\n");
-      strBuf.append(" * The contents of this file are subject to the Openbravo  Public  License\n");
-      strBuf.append(" * Version  1.0  (the  \"License\"),  being   the  Mozilla   Public  License\n");
-      strBuf.append(" * Version 1.1  with a permitted attribution clause; you may not  use this\n");
-      strBuf.append(" * file except in compliance with the License. You  may  obtain  a copy of\n");
-      strBuf.append(" * the License at http://www.openbravo.com/legal/license.html \n");
-      strBuf.append(" * Software distributed under the License  is  distributed  on  an \"AS IS\"\n");
-      strBuf.append(" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the\n");
-      strBuf.append(" * License for the specific  language  governing  rights  and  limitations\n");
-      strBuf.append(" * under the License. \n");
-      strBuf.append(" * The Original Code is Openbravo ERP. \n");
-      strBuf.append(" * The Initial Developer of the Original Code is Openbravo SL \n");
-      strBuf.append(" * All portions are Copyright (C) 2001-2006 Openbravo SL \n");
-      strBuf.append(" * All Rights Reserved. \n");
-      strBuf.append(" * Contributor(s):  ______________________________________.\n");
-      strBuf.append(" ************************************************************************\n");
-      strBuf.append("-->\n");
-      strBuf.append("\n");
-      strBuf.append("\n");
-      strBuf.append("<!DOCTYPE aplication SYSTEM \"pool.dtd\">\n");
-      strBuf.append("<aplication>\n");
-      strBuf.append("  <pool name=\"myPool\">\n");
-      strBuf.append("    <dbDriver>oracle.jdbc.OracleDriver</dbDriver>\n");
-      strBuf.append("    <dbServer>jdbc:oracle:thin:@").append(bbddHost).append(":").append(bbddPort).append(":").append(bbddSid).append("</dbServer>\n");
-      strBuf.append("    <dbLogin>").append(bbddUser).append("</dbLogin>\n");
-      strBuf.append("    <dbPassword>").append(bbddPassword).append("</dbPassword>\n");
-      strBuf.append("    <minConns>1</minConns>\n");
-      strBuf.append("    <maxConns>10</maxConns>\n");
-      strBuf.append("    <maxConnTime>0.5</maxConnTime>\n");
-      strBuf.append("    <dbSessionConfig>ALTER SESSION SET NLS_LANGUAGE='SPANISH' NLS_DATE_FORMAT='DD-MM-YYYY' NLS_NUMERIC_CHARACTERS='.,'</dbSessionConfig>\n");
-      strBuf.append("    <rdbms>ORACLE</rdbms>\n");
-      strBuf.append("  </pool>\n");
-      strBuf.append("</aplication>\n");
-
-
-      FileWriter fileWriter = new FileWriter(file);
-      PrintWriter printWriter = new PrintWriter(fileWriter);
-      printWriter.print(strBuf.toString());
-      printWriter.close();
-    } catch (IOException e) {
-      e.printStackTrace();
-    }
-  }
-
-  public static String replacePropertyValue(String line, String value, int pos) {
-    String result = line;
-    pos = line.indexOf("value=\"", pos+1);
-    if (pos==-1) return line;
-    pos=line.indexOf("\"", pos+1);
-    if (pos!=-1) {
-      result = line.substring(0, pos+1);
-      result += value;
-      pos=line.indexOf("\"", pos+1);
-      if (pos==-1) return line;
-      result += line.substring(pos);
-    }
-    return result;
-  }
+  
 
   public static void replaceUserConfigFile(File path) {
     try {
@@ -281,12 +146,19 @@
 
       String nextLine = fileBuffer.readLine();
       boolean found = false;
+      boolean replaced = false;
       while (nextLine != null) {
-        if (!found && (nextLine.indexOf("fontBaseDir"))!=-1) {
-          found=true;
-        } else if (found) {
+        if (!found && (nextLine.indexOf("fontBaseDir")!=-1)) found=true;
+        if (found) System.out.println("found:"+nextLine);
+        if (found && (nextLine.indexOf("<!--")!=-1)) 
+          nextLine = "";
+        if (found && (nextLine.indexOf("<value>")!=-1)) { 
           nextLine = "<value>" + fontBase + "</value>";
+          replaced = true;
         }
+        if (replaced && (nextLine.indexOf("-->")!=-1))
+          nextLine = "";
+        
         total.append(nextLine).append("\n");
         nextLine = fileBuffer.readLine();
       }
@@ -302,33 +174,4 @@
     }
   }
 
-  public static void replaceDeployWsddFile(File path) {
-    try {
-      File file = new File(path, "src/deploy.wsdd");
-      if (!file.exists()) {
-        System.out.println("Unknown file: " + path + "/src/deploy.wsdd");
-        return;
-      }
-      BufferedReader fileBuffer = new BufferedReader(new FileReader(file));
-      StringBuffer total = new StringBuffer();
-
-      String nextLine = fileBuffer.readLine();
-      while (nextLine != null) {
-        if ((nextLine.indexOf("xmlns:myNS="))!=-1) {
-          total.append(nextLine.replace(nextLine.substring(nextLine.indexOf("http://"), nextLine.indexOf("/services/")), webUrl.replace("/web",""))).append("\n");
-        }
-        else
-        total.append(nextLine).append("\n");
-        nextLine = fileBuffer.readLine();
-      }
-      fileBuffer.close();
-
-      FileWriter fileWriter = new FileWriter(file);
-      PrintWriter printWriter = new PrintWriter(fileWriter);
-      printWriter.print(total.toString());
-      printWriter.close();
-    } catch (IOException e) {
-      e.printStackTrace();
-    }
-  }
 }
--- a/setup/setup/antinstall-config.xml	Fri Nov 09 16:13:34 2007 +0000
+++ b/setup/setup/antinstall-config.xml	Mon Nov 12 09:44:15 2007 +0000
@@ -73,13 +73,18 @@
 			type="input"
 			name="propertiesBBDD"
 			displayText="Required database configure options">
-     <password property="systemPassword" displayText="System password" defaultValue="" regex=".+" testMask="true"/>
+    <text property="systemUser" displayText="System User" defaultValue="SYSTEM"/>
+    <password property="systemPassword" displayText="System password" defaultValue="" regex=".+" testMask="true"/>
     <text property="bbdd.host" displayText="Database server" defaultValue="localhost"/>
     <text property="bbdd.user" displayText="Database user" defaultValue="TAD"/>
     <password property="bbdd.password" displayText="Database user password" defaultValue="TAD" regex=".+" testMask="true"/>
     <text property="bbdd.sid" displayText="SID" defaultValue="orcl"/>
     <text property="bbdd.port" displayText="Port" defaultValue="1521"/>
     <text property="bbdd.tns" displayText="TNS" defaultValue="orcl"/>
+    <select property="bbdd.rdbms" displayText="DB" defaultValue="ORACLE">
+      <option value="ORACLE" text="Oracle"/>
+      <option value="POSTGRE" text="PostgreSQL"/>
+    </select>
 	</page>
   <page
 			type="progress"
--- a/setup/setup/build.xml	Fri Nov 09 16:13:34 2007 +0000
+++ b/setup/setup/build.xml	Mon Nov 12 09:44:15 2007 +0000
@@ -28,6 +28,8 @@
   <property name="bbdd.password" value="TAD"></property>
   <property name="bbdd.sid" value="orcl"></property>
   <property name="bbdd.port" value="1521"></property>
+	<property name="bbdd.rdbms" value="ORACLE"/>
+	<property name="systemUser" value="SYSTEM"/>
   <property name="font.base" value="C:/AppsOpenBravo/lib/fop"></property>
 
   <condition property="temp.folder" value="C:\Temp" else="/tmp">
@@ -47,7 +49,7 @@
 
   <target name="setup" depends="default">
     <java classname="Setup" jvm="${env.JAVA_HOME}/bin/java" fork="yes" maxmemory="200M">
-      <arg line="'${base.app}' '${base.source}' '${base.temp}' '${attach.path}' '${font.base}' '${web.url}' '${bbdd.host}' '${bbdd.user}' '${bbdd.password}' '${bbdd.sid}' '${bbdd.port}' '${jakarta.context.name}' '${systemPassword}' '${bbdd.tns}' '${temp.folder}'"/>
+      <arg line="'${base.app}' '${base.source}' '${base.temp}' '${attach.path}' '${font.base}' '${web.url}' '${bbdd.host}' '${bbdd.user}' '${bbdd.password}' '${bbdd.sid}' '${bbdd.port}' '${jakarta.context.name}' '${systemPassword}' '${bbdd.tns}' '${temp.folder}' '${bbdd.rdbms}' '${systemUser}'"/>
     </java>
   </target>
 </project>
--- a/src-core/src/org/openbravo/data/Sqlc.java	Fri Nov 09 16:13:34 2007 +0000
+++ b/src-core/src/org/openbravo/data/Sqlc.java	Mon Nov 12 09:44:15 2007 +0000
@@ -27,6 +27,7 @@
 import java.io.OutputStreamWriter;
 import java.io.FileOutputStream;
 
+import org.openbravo.database.CPStandAlone;
 import org.xml.sax.Attributes;
 import org.xml.sax.helpers.DefaultHandler;
 import org.xml.sax.InputSource;
@@ -106,7 +107,7 @@
     else sqlc.writeTxtFiles = argv[4].equalsIgnoreCase("true");
     parser.setContentHandler(sqlc);
     String strFileConnection = argv[0];
-    sqlc.readProperties(strFileConnection.replace("dbCon5.xml","Openbravo.properties"));
+    sqlc.readProperties(strFileConnection);
 
     // the first parameter is the directory where the search is done
     if(argv.length <= 2)
@@ -132,27 +133,9 @@
     log4j.info("file termination: " + strFilter);
     log4j.info("file connection: " + strFileConnection);
     log4j.info("Write TXT Files: " + sqlc.writeTxtFiles);
-    try {
-      //      parser.parse(strFileConnection);
-      parser.parse(new InputSource(new FileReader(new File(strFileConnection))));
-      try {
-        sqlc.connect();
-      } catch(ClassNotFoundException e){
-        log4j.error("Class " + sqlc.strDriver + " not found: " + e);
-        return;
-      } catch(SQLException e){
-        log4j.error("Error in URL: "+ sqlc.strURL + " of connection: " + e);
-        return;
-      }
-
-    } catch (IOException e) {
-      e.printStackTrace();
-    } catch (SAXException e) {
-      e.printStackTrace();
-    } catch (Exception e) {
-      e.printStackTrace();
-    }
-
+    
+    sqlc.connect(strFileConnection);
+    
     File path = new File(dirIni);
     if (!path.exists()) {
       log4j.error("Directory does not exist: " + dirIni);
@@ -297,20 +280,7 @@
     pushElement(qName);
     if (log4j.isDebugEnabled()) log4j.debug("Configuration: startElement is called: element  name=" + name);
     if (log4j.isDebugEnabled()) log4j.debug("Configuration: startElement is called: element qName=" + qName);
-    if (name.trim().equalsIgnoreCase("CONNECTION")) {
-      int size = amap.getLength();
-      for (int i = 0; i < size; i++) {     
-        if (amap.getQName(i).equals("driver")) {
-          strDriver = amap.getValue(i);
-        } else if (amap.getQName(i).equals("URL")) {
-          strURL = amap.getValue(i);
-        } else if (amap.getQName(i).equals("DBUser")) {
-          strDBUser = amap.getValue(i);
-        } else if (amap.getQName(i).equals("DBPassword")) {
-          strDBPassword = amap.getValue(i);
-        }
-      }
-    } else if (name.equals("SqlMethod")) {
+    if (name.equals("SqlMethod")) {
       sql.sqlStatic = "true";
       sql.sqlConnection = "false";
       String sqlPackage = null;
@@ -464,7 +434,22 @@
     }
   }
 
-  public void connect() throws ClassNotFoundException, SQLException {
+  public void connect(String file) throws ClassNotFoundException, SQLException {
+    Properties properties = new Properties();
+    try {
+      properties.load(new FileInputStream(file));
+      strDriver = properties.getProperty("bbdd.driver");
+      strURL = properties.getProperty("bbdd.url");
+      strDBUser = properties.getProperty("bbdd.user");
+      strDBPassword = properties.getProperty("bbdd.password");
+      if (properties.getProperty("bbdd.rdbms").equalsIgnoreCase("POSTGRE")) 
+          strURL += "/"+properties.getProperty("bbdd.sid");
+    } catch (IOException e) { 
+     System.out.println("Uh oh, got an IOException error!");
+     e.printStackTrace();
+    }
+    
+    
     log4j.info("Loading driver: " + strDriver);
     Class.forName(strDriver);
     log4j.info("Driver loaded");
--- a/src-core/src/org/openbravo/database/ConnectionProviderImpl.java	Fri Nov 09 16:13:34 2007 +0000
+++ b/src-core/src/org/openbravo/database/ConnectionProviderImpl.java	Mon Nov 12 09:44:15 2007 +0000
@@ -25,6 +25,7 @@
 import org.openbravo.exception.*;
 
 import java.sql.*;
+import java.util.Properties;
 import java.io.*;
 
 
@@ -47,79 +48,113 @@
   public ConnectionProviderImpl (String file, boolean isRelative, String _context) throws PoolNotFoundException {
     if (log4j.isDebugEnabled()) log4j.debug("Creating ConnectionProviderImpl");
     if (_context!=null && !_context.equals("")) contextName = _context;
+    
+    String poolName = null;
+    String dbDriver = null;
+    String dbServer = null;
+    String dbLogin = null;
+    String dbPassword = null;
+    int minConns = 1;
+    int maxConns = 10;
+    double maxConnTime = 0.5;
+    String dbSessionConfig = null;
+    String rdbms = null;
+    
+    if (file.endsWith(".properties")) {
+      Properties properties = new Properties();
+      try {
+        properties.load(new FileInputStream(file));
+        poolName = properties.getProperty("bbdd.poolName","myPool");
+        dbDriver = properties.getProperty("bbdd.driver");
+        dbServer = properties.getProperty("bbdd.url");
+        dbLogin = properties.getProperty("bbdd.user");
+        dbPassword = properties.getProperty("bbdd.password");
+        minConns = new Integer(properties.getProperty("bbdd.minConns","1"));
+        maxConns = new Integer(properties.getProperty("bbdd.maxConns","10"));
+        maxConnTime = new Double(properties.getProperty("maxConnTime","0.5"));
+        dbSessionConfig = properties.getProperty("bbdd.sessionConfig");
+        rdbms = properties.getProperty("bbdd.rdbms");
+        if (rdbms.equalsIgnoreCase("POSTGRE")) 
+          dbServer += "/"+properties.getProperty("bbdd.sid");
+      } catch (IOException e) { 
+       System.out.println("Uh oh, got an IOException error!");
+       e.printStackTrace();
+      }
+    } else { //XML file
+      try {
+        DOMParser parser = new DOMParser();
+        try {
+          parser.parse((!isRelative?(file.toUpperCase().startsWith("FILE:///")?"":"file:///"):"") + file);
+        } catch (SAXException se) {
+          log4j.error(se);
+          throw new PoolNotFoundException("Couldn't load parse for pool file " + file);
+        } catch (IOException ioe) {
+          log4j.error(ioe);
+          throw new PoolNotFoundException("Couldn't load pool file " + file + " for input/output operations");
+        }
+        Document xmlPool = parser.getDocument();
+        NodeList nodeList = xmlPool.getElementsByTagName("pool");
+        log4j.debug("Pool's elements: " + nodeList.getLength());
+        Node child = null;
+        for (int i=0;i<nodeList.getLength();i++) {
+          Node pool = nodeList.item(i);
+          NamedNodeMap atributos = pool.getAttributes();
+          poolName = atributos.item(0).getNodeValue();
+          child = pool.getFirstChild();
+          child = child.getNextSibling();
+          dbDriver = ((Text)child.getFirstChild()).getData();
+          child = child.getNextSibling();
+          child = child.getNextSibling();
+          dbServer = ((Text)child.getFirstChild()).getData();
+          child = child.getNextSibling();
+          child = child.getNextSibling();
+          Text textDbLogin = (Text)child.getFirstChild();
+          if (textDbLogin != null) {
+            dbLogin  = textDbLogin.getData();
+          } else
+            dbLogin = null;
+          child = child.getNextSibling();
+          child = child.getNextSibling();
+          Text textDbPassword = (Text)child.getFirstChild();
+          if (textDbPassword != null) {
+            dbPassword = textDbPassword.getData();
+          } else
+            dbPassword = null;
+          child = child.getNextSibling();
+          child = child.getNextSibling();
+          minConns   = Integer.valueOf(((Text)child.getFirstChild()).getData()).intValue();
+          child = child.getNextSibling();
+          child = child.getNextSibling();
+          maxConns   = Integer.valueOf(((Text)child.getFirstChild()).getData()).intValue();
+          child = child.getNextSibling();
+          child = child.getNextSibling();
+          maxConnTime   = Double.valueOf(((Text)child.getFirstChild()).getData()).doubleValue();
+          child = child.getNextSibling();
+          child = child.getNextSibling();
+          dbSessionConfig  = ((Text)child.getFirstChild()).getData();
+          child = child.getNextSibling();
+          child = child.getNextSibling();
+          rdbms  = ((Text)child.getFirstChild()).getData();
+        }
+      } catch (Exception e) {}
+    }
+    
+    if (log4j.isDebugEnabled()) { 
+      log4j.debug("poolName: " + poolName);
+      log4j.debug("dbDriver: " + dbDriver);
+      log4j.debug("dbServer: " + dbServer);
+      log4j.debug("dbLogin: " + dbLogin);
+      log4j.debug("dbPassword: " + dbPassword);
+      log4j.debug("minConns: " + minConns);
+      log4j.debug("maxConns: " + maxConns);
+      log4j.debug("maxConnTime: " + Double.toString(maxConnTime));
+      log4j.debug("dbSessionConfig: " + dbSessionConfig);
+      log4j.debug("rdbms: " + rdbms);
+    }
+    
     try {
-      DOMParser parser = new DOMParser();
-      try {
-        parser.parse((!isRelative?(file.toUpperCase().startsWith("FILE:///")?"":"file:///"):"") + file);
-      } catch (SAXException se) {
-        log4j.error(se);
-        throw new PoolNotFoundException("Couldn't load parse for pool file " + file);
-      } catch (IOException ioe) {
-        log4j.error(ioe);
-        throw new PoolNotFoundException("Couldn't load pool file " + file + " for input/output operations");
-      }
-      Document xmlPool = parser.getDocument();
-      NodeList nodeList = xmlPool.getElementsByTagName("pool");
-      log4j.debug("Pool's elements: " + nodeList.getLength());
-      Node child = null;
-      for (int i=0;i<nodeList.getLength();i++) {
-        Node pool = nodeList.item(i);
-        NamedNodeMap atributos = pool.getAttributes();
-        String poolName = atributos.item(0).getNodeValue();
-        if (log4j.isDebugEnabled()) log4j.debug("poolName: " + poolName);
-
-        child = pool.getFirstChild();
-        child = child.getNextSibling();
-        String dbDriver = ((Text)child.getFirstChild()).getData();
-        if (log4j.isDebugEnabled()) log4j.debug("dbDriver: " + dbDriver);
-        child = child.getNextSibling();
-        child = child.getNextSibling();
-        String dbServer = ((Text)child.getFirstChild()).getData();
-        if (log4j.isDebugEnabled()) log4j.debug("dbServer: " + dbServer);
-        child = child.getNextSibling();
-        child = child.getNextSibling();
-        Text textDbLogin = (Text)child.getFirstChild();
-        String dbLogin;
-        if (textDbLogin != null) {
-          dbLogin  = textDbLogin.getData();
-          if (log4j.isDebugEnabled()) log4j.debug("dbLogin: " + dbLogin);
-        } else
-          dbLogin = null;
-        child = child.getNextSibling();
-        child = child.getNextSibling();
-        Text textDbPassword = (Text)child.getFirstChild();
-        String dbPassword;
-        if (textDbPassword != null) {
-          dbPassword = textDbPassword.getData();
-          if (log4j.isDebugEnabled()) log4j.debug("dbPassword: " + dbPassword);
-        } else
-          dbPassword = null;
-        child = child.getNextSibling();
-        child = child.getNextSibling();
-        int minConns   = Integer.valueOf(((Text)child.getFirstChild()).getData()).intValue();
-        if (log4j.isDebugEnabled()) log4j.debug("minConns: " + minConns);
-        child = child.getNextSibling();
-        child = child.getNextSibling();
-        int maxConns   = Integer.valueOf(((Text)child.getFirstChild()).getData()).intValue();
-        if (log4j.isDebugEnabled()) log4j.debug("maxConns: " + maxConns);
-        child = child.getNextSibling();
-        child = child.getNextSibling();
-        double maxConnTime   = Double.valueOf(((Text)child.getFirstChild()).getData()).doubleValue();
-        if (log4j.isDebugEnabled()) log4j.debug("maxConnTime: " + Double.toString(maxConnTime));
-        child = child.getNextSibling();
-        child = child.getNextSibling();
-        String dbSessionConfig  = ((Text)child.getFirstChild()).getData();
-        if (log4j.isDebugEnabled()) log4j.debug("dbSessionConfig: " + dbSessionConfig);
-        child = child.getNextSibling();
-        child = child.getNextSibling();
-        String rdbms  = ((Text)child.getFirstChild()).getData();
-        if (log4j.isDebugEnabled()) log4j.debug("rdbms: " + rdbms);
-
-
         addNewPool(dbDriver,dbServer,dbLogin,dbPassword, minConns,maxConns,maxConnTime,dbSessionConfig, rdbms, poolName);
-      }
-    }
-    catch (Exception e) {
+    }catch (Exception e) {
       log4j.error(e);
       throw new PoolNotFoundException("Failed when creating database connections pool");
     }
--- a/src-core/src/org/openbravo/database/StandAloneConnection.java	Fri Nov 09 16:13:34 2007 +0000
+++ b/src-core/src/org/openbravo/database/StandAloneConnection.java	Mon Nov 12 09:44:15 2007 +0000
@@ -13,10 +13,6 @@
 
 import javax.servlet.ServletException;
 
-import org.apache.xerces.parsers.DOMParser;
-import org.xml.sax.*;
-import org.w3c.dom.*;
-
 import java.io.*;
 import java.sql.*;
 import org.openbravo.exception.*;
@@ -35,86 +31,28 @@
   static String sqlDateFormat;
 
   public void createPool(String poolDir) {
+    
+    Properties properties = new Properties();
     try {
+      properties.load(new FileInputStream(poolDir + "/Openbravo.properties"));
+      String poolName = properties.getProperty("bbdd.poolName","myPool");
+      String dbDriver = properties.getProperty("bbdd.driver");
+      String dbServer = properties.getProperty("bbdd.url");
+      String dbLogin = properties.getProperty("bbdd.user");
+      String dbPassword = properties.getProperty("bbdd.password");
+      int minConns = new Integer(properties.getProperty("bbdd.minConns","1"));
+      int maxConns = new Integer(properties.getProperty("bbdd.maxConns","10"));
+      double maxConnTime = new Double(properties.getProperty("maxConnTime","0.5"));
+      String dbSessionConfig = properties.getProperty("bbdd.sessionConfig");
+      String rdbms = properties.getProperty("bbdd.rdbms");
+      sqlDateFormat = properties.getProperty("dateFormat.sql");
 
-      DOMParser parser = new DOMParser();
-      try {
-        parser.parse(poolDir + "/XmlPool.xml");
-      } catch (SAXException se) {
-        se.printStackTrace();
-      } catch (IOException ioe) {
-        ioe.printStackTrace();
-      }
-      Document xmlPool = parser.getDocument();
-      NodeList nodeList = xmlPool.getElementsByTagName("pool");
-      log4j.info("pool elements: " + nodeList.getLength());
-      Node child = null;
-      for (int i=0;i<nodeList.getLength();i++) {
-        Node pool = nodeList.item(i); // We obtain the pool
-        NamedNodeMap atributos = pool.getAttributes(); // We get its attributes to obtain its name
-        String poolName = atributos.item(0).getNodeValue(); // We get the name of the pool, which is the first and unique attribute of the pool
-        log4j.info("Pool name: " + poolName);
+      ConnectionPool myLocalPool = new ConnectionPool(dbDriver,dbServer,dbLogin,dbPassword, minConns,maxConns, maxConnTime,dbSessionConfig, rdbms);
 
-        /* We obtain the different nodes of the correspondant pool, which are the pool's configuration parameters, each one separated by two nodes
-        */
-        child = pool.getFirstChild();
-        child = child.getNextSibling();
-        String dbDriver = ((Text)child.getFirstChild()).getData();
-        log4j.info("Driver: " + dbDriver);
-        child = child.getNextSibling();
-        child = child.getNextSibling();
-        String dbServer = ((Text)child.getFirstChild()).getData();
-        log4j.info("Server: " + dbServer);
-        child = child.getNextSibling();
-        child = child.getNextSibling();
-        Text textDbLogin = (Text)child.getFirstChild();
-        String dbLogin;
-        if (textDbLogin != null) {
-          dbLogin  = textDbLogin.getData();
-          log4j.info("Login: " + dbLogin);
-        } else
-          dbLogin = null;
-        child = child.getNextSibling();
-        child = child.getNextSibling();
-        Text textDbPassword = (Text)child.getFirstChild();
-        String dbPassword;
-        if (textDbPassword != null) {
-          dbPassword = textDbPassword.getData();
-          log4j.info("Password: " + dbPassword);
-        } else
-          dbPassword = null;
-        child = child.getNextSibling();
-        child = child.getNextSibling();
-        int minConns   = Integer.valueOf(((Text)child.getFirstChild()).getData()).intValue();
-        log4j.info("Min conns: " + minConns);
-        child = child.getNextSibling();
-        child = child.getNextSibling();
-        int maxConns   = Integer.valueOf(((Text)child.getFirstChild()).getData()).intValue();
-        log4j.info("Max conns: " + maxConns);
-        child = child.getNextSibling();
-        child = child.getNextSibling();
-        double maxConnTime   = Double.valueOf(((Text)child.getFirstChild()).getData()).doubleValue();
-        log4j.info("maxConnTime: " + Double.toString(maxConnTime));
-        child = child.getNextSibling();
-        child = child.getNextSibling();
-        String dbSessionConfig  = ((Text)child.getFirstChild()).getData();
-        log4j.info("dbSessionConfig: " + dbSessionConfig);
-        child = child.getNextSibling();
-        child = child.getNextSibling();
-        String rdbms  = ((Text)child.getFirstChild()).getData();
-        log4j.info("rdbms: " + rdbms);
-
-        readProperties(poolDir+"/Openbravo.properties");
-
-        ConnectionPool myLocalPool = new ConnectionPool(dbDriver,dbServer,dbLogin,dbPassword, minConns,maxConns, maxConnTime,dbSessionConfig, rdbms);
-
-        if (myLocalPool==null)
-          log4j.error("Initialization failed on pool: " + i);
-        pools.put(poolName, myLocalPool);
-        if (i==0) {
-          myPool = myLocalPool;
-        }
-      }
+      if (myLocalPool==null)
+        log4j.error("Initialization failed on pool: " );
+      pools.put(poolName, myLocalPool);
+      myPool = myLocalPool;
     }
     catch (Exception e) {
       e.printStackTrace();
--- a/src-trl/build.xml	Fri Nov 09 16:13:34 2007 +0000
+++ b/src-trl/build.xml	Mon Nov 12 09:44:15 2007 +0000
@@ -45,7 +45,7 @@
 
   <target name="sqlc" depends="init">
     <java classname="org.openbravo.data.Sqlc" jvm="${env.JAVA_HOME}/bin/java" fork="yes" maxmemory="${build.maxmemory}">
-      <arg line="${base.config}/dbCon5.xml .xsql ./src ${build.trl.sqlc}"/>
+      <arg line="${base.config}/Openbravo.properties .xsql ./src ${build.trl.sqlc}"/>
       <classpath refid="trl.class.path"/>
     </java>
   </target>
--- a/src-wad/build.xml	Fri Nov 09 16:13:34 2007 +0000
+++ b/src-wad/build.xml	Mon Nov 12 09:44:15 2007 +0000
@@ -47,7 +47,7 @@
 
   <target name="sqlc" depends="init">
     <java classname="org.openbravo.data.Sqlc" jvm="${env.JAVA_HOME}/bin/java" fork="yes" maxmemory="${build.maxmemory}">
-      <arg line="${base.config}/dbCon5.xml .xsql ./src/org ${build.wad.sqlc}"/>
+      <arg line="${base.config}/Openbravo.properties .xsql ./src/org ${build.wad.sqlc}"/>
       <classpath refid="wad.class.path"/>
     </java>
   </target>
--- a/src-wad/src/org/openbravo/wad/Wad.java	Fri Nov 09 16:13:34 2007 +0000
+++ b/src-wad/src/org/openbravo/wad/Wad.java	Mon Nov 12 09:44:15 2007 +0000
@@ -135,7 +135,7 @@
     Wad wad = new Wad();
     wad.strSystemSeparator = System.getProperty("file.separator");
     wad.createXmlEngine(strFileConnection);
-    wad.createPool(strFileConnection + "/XmlPool.xml");
+    wad.createPool(strFileConnection + "/Openbravo.properties");
     wad.readProperties(strFileConnection + "/Openbravo.properties");
     try {
       // the second parameter is the tab to be generated
--- a/src-wad/src/org/openbravo/wad/WadConnection.java	Fri Nov 09 16:13:34 2007 +0000
+++ b/src-wad/src/org/openbravo/wad/WadConnection.java	Mon Nov 12 09:44:15 2007 +0000
@@ -20,7 +20,9 @@
 
 
 import java.sql.*;
+import java.util.Properties;
 import java.io.*;
+
 import org.apache.xerces.parsers.DOMParser;
 import org.xml.sax.*;
 import org.w3c.dom.*;
@@ -48,83 +50,127 @@
 
   public void connect(String file) throws ClassNotFoundException, SQLException {
     if (log4j.isDebugEnabled()) log4j.debug("Creating Connection");
+    
+    String dbDriver = null;
+    String dbLogin = null;
+    String dbPassword = null;
+    int minConns = 1;
+    int maxConns = 10;
+    double maxConnTime = 0.5;
+    String dbSessionConfig = null;
+    
+    if (file.endsWith(".properties")) {
+      Properties properties = new Properties();
+      try {
+        properties.load(new FileInputStream(file));
+        this.defaultPoolName = properties.getProperty("bbdd.poolName","myPool");
+        dbDriver = properties.getProperty("bbdd.driver");
+        this.bbdd = properties.getProperty("bbdd.url");
+        dbLogin = properties.getProperty("bbdd.user");
+        dbPassword = properties.getProperty("bbdd.password");
+        minConns = new Integer(properties.getProperty("bbdd.minConns","1"));
+        maxConns = new Integer(properties.getProperty("bbdd.maxConns","10"));
+        maxConnTime = new Double(properties.getProperty("maxConnTime","0.5"));
+        dbSessionConfig = properties.getProperty("bbdd.sessionConfig");
+        this.rdbms = properties.getProperty("bbdd.rdbms");
+        if (this.rdbms.equalsIgnoreCase("POSTGRE")) 
+          this.bbdd += "/"+properties.getProperty("bbdd.sid");
+      } catch (IOException e) { 
+       System.out.println("Uh oh, got an IOException error!");
+       e.printStackTrace();
+      }
+    } else { //xml file
+      try {
+        DOMParser parser = new DOMParser();
+        try {
+            parser.parse((file.toUpperCase().startsWith("FILE:///")?"":"file:///") + file);
+        } catch (SAXException se) {
+          log4j.error(se);
+          throw new SQLException("Couldn't load parse for pool file " + file);
+        } catch (IOException ioe) {
+          log4j.error(ioe);
+          throw new SQLException("Couldn't load pool file " + file + " for input/output operations");
+        }
+        Document xmlPool = parser.getDocument();
+        NodeList nodeList = xmlPool.getElementsByTagName("pool");
+        log4j.debug("Pool's elements: " + nodeList.getLength());
+        Node child = null;
+        for (int i=0;i<nodeList.getLength();i++) {
+          Node pool = nodeList.item(i);
+          NamedNodeMap atributos = pool.getAttributes();
+          this.defaultPoolName = atributos.item(0).getNodeValue();
+          
+  
+          child = pool.getFirstChild();
+          child = child.getNextSibling();
+          dbDriver = ((Text)child.getFirstChild()).getData();
+          
+          
+          child = child.getNextSibling();
+          child = child.getNextSibling();
+          this.bbdd = ((Text)child.getFirstChild()).getData();
+         
+          child = child.getNextSibling();
+          child = child.getNextSibling();
+          Text textDbLogin = (Text)child.getFirstChild();
+          if (textDbLogin != null) {
+            dbLogin  = textDbLogin.getData();
+            
+          } else dbLogin = null;
+          child = child.getNextSibling();
+          child = child.getNextSibling();
+          Text textDbPassword = (Text)child.getFirstChild();
+          if (textDbPassword != null) {
+            dbPassword = textDbPassword.getData();
+            
+          } else dbPassword = null;
+          
+          child = child.getNextSibling();
+          child = child.getNextSibling();
+          minConns   = Integer.valueOf(((Text)child.getFirstChild()).getData()).intValue();
+          
+          child = child.getNextSibling();
+          child = child.getNextSibling();
+          maxConns   = Integer.valueOf(((Text)child.getFirstChild()).getData()).intValue();
+          
+          child = child.getNextSibling();
+          child = child.getNextSibling();
+          maxConnTime   = Double.valueOf(((Text)child.getFirstChild()).getData()).doubleValue();
+          
+          child = child.getNextSibling();
+          child = child.getNextSibling();
+          dbSessionConfig  = ((Text)child.getFirstChild()).getData();
+          
+          child = child.getNextSibling();
+          child = child.getNextSibling();
+          this.rdbms  = ((Text)child.getFirstChild()).getData();
+          
+        }
+      }
+      catch (Exception e) {
+        log4j.error(e);
+        throw new SQLException("Failed when creating database connections pool");
+      }
+    } //end if
+    if (log4j.isDebugEnabled()) log4j.debug("poolName: " + this.defaultPoolName); {
+       log4j.debug("dbDriver: " + dbDriver);
+       log4j.debug("dbServer: " + this.bbdd);
+       log4j.debug("dbLogin: " + dbLogin);
+       log4j.debug("dbPassword: " + dbPassword);
+       log4j.debug("minConns: " + minConns);
+       log4j.debug("maxConns: " + maxConns);
+       log4j.debug("maxConnTime: " + Double.toString(maxConnTime));
+       log4j.debug("dbSessionConfig: " + dbSessionConfig);
+       log4j.debug("rdbms: " + this.rdbms);
+    }
+    
     try {
-      DOMParser parser = new DOMParser();
-      try {
-          parser.parse((file.toUpperCase().startsWith("FILE:///")?"":"file:///") + file);
-      } catch (SAXException se) {
-        log4j.error(se);
-        throw new SQLException("Couldn't load parse for pool file " + file);
-      } catch (IOException ioe) {
-        log4j.error(ioe);
-        throw new SQLException("Couldn't load pool file " + file + " for input/output operations");
-      }
-      Document xmlPool = parser.getDocument();
-      NodeList nodeList = xmlPool.getElementsByTagName("pool");
-      log4j.debug("Pool's elements: " + nodeList.getLength());
-      Node child = null;
-      for (int i=0;i<nodeList.getLength();i++) {
-        Node pool = nodeList.item(i);
-        NamedNodeMap atributos = pool.getAttributes();
-        String poolName = atributos.item(0).getNodeValue();
-        if (log4j.isDebugEnabled()) log4j.debug("poolName: " + poolName);
-        this.defaultPoolName = poolName;
-
-        child = pool.getFirstChild();
-        child = child.getNextSibling();
-        String dbDriver = ((Text)child.getFirstChild()).getData();
-        if (log4j.isDebugEnabled()) log4j.debug("dbDriver: " + dbDriver);
-        Class.forName(dbDriver);
-        child = child.getNextSibling();
-        child = child.getNextSibling();
-        String dbServer = ((Text)child.getFirstChild()).getData();
-        if (log4j.isDebugEnabled()) log4j.debug("dbServer: " + dbServer);
-        this.bbdd = dbServer;
-        child = child.getNextSibling();
-        child = child.getNextSibling();
-        Text textDbLogin = (Text)child.getFirstChild();
-        String dbLogin;
-        if (textDbLogin != null) {
-          dbLogin  = textDbLogin.getData();
-          if (log4j.isDebugEnabled()) log4j.debug("dbLogin: " + dbLogin);
-        } else dbLogin = null;
-        child = child.getNextSibling();
-        child = child.getNextSibling();
-        Text textDbPassword = (Text)child.getFirstChild();
-        String dbPassword;
-        if (textDbPassword != null) {
-          dbPassword = textDbPassword.getData();
-          if (log4j.isDebugEnabled()) log4j.debug("dbPassword: " + dbPassword);
-        } else dbPassword = null;
-        this.myPool=DriverManager.getConnection(dbServer, dbLogin, dbPassword);
-        this.myPool.setAutoCommit(true);
-        
-        child = child.getNextSibling();
-        child = child.getNextSibling();
-        int minConns   = Integer.valueOf(((Text)child.getFirstChild()).getData()).intValue();
-        if (log4j.isDebugEnabled()) log4j.debug("minConns: " + minConns);
-        child = child.getNextSibling();
-        child = child.getNextSibling();
-        int maxConns   = Integer.valueOf(((Text)child.getFirstChild()).getData()).intValue();
-        if (log4j.isDebugEnabled()) log4j.debug("maxConns: " + maxConns);
-        child = child.getNextSibling();
-        child = child.getNextSibling();
-        double maxConnTime   = Double.valueOf(((Text)child.getFirstChild()).getData()).doubleValue();
-        if (log4j.isDebugEnabled()) log4j.debug("maxConnTime: " + Double.toString(maxConnTime));
-        child = child.getNextSibling();
-        child = child.getNextSibling();
-        String dbSessionConfig  = ((Text)child.getFirstChild()).getData();
-        if (log4j.isDebugEnabled()) log4j.debug("dbSessionConfig: " + dbSessionConfig);
-        child = child.getNextSibling();
-        child = child.getNextSibling();
-        String myrdbms  = ((Text)child.getFirstChild()).getData();
-        if (log4j.isDebugEnabled()) log4j.debug("rdbms: " + myrdbms);
-
-
-        this.rdbms = myrdbms;
-      }
-    }
-    catch (Exception e) {
+      log4j.info("Loading driver: " + dbDriver);
+      Class.forName(dbDriver);
+      log4j.info("Getting Connection: "+this.bbdd+","+ dbLogin);
+      this.myPool=DriverManager.getConnection(this.bbdd, dbLogin, dbPassword);
+      this.myPool.setAutoCommit(true);
+    } catch (Exception e) {
       log4j.error(e);
       throw new SQLException("Failed when creating database connections pool");
     }
--- a/src-wad/src/org/openbravo/wad/web.xml	Fri Nov 09 16:13:34 2007 +0000
+++ b/src-wad/src/org/openbravo/wad/web.xml	Mon Nov 12 09:44:15 2007 +0000
@@ -87,7 +87,7 @@
   </context-param>
   <context-param>
     <param-name>PoolFile</param-name>
-    <param-value>XmlPool.xml</param-value>
+    <param-value>Openbravo.properties</param-value>
   </context-param>
   <context-param>
     <param-name>FormatFile</param-name>