changeset 3093:b0f59d42ae4f

De-centralized database configuration. flys-artifacts/trunk@4692 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Mon, 18 Jun 2012 14:30:43 +0000
parents cc8e28f9ccdf
children 164c344ef743
files flys-artifacts/ChangeLog flys-artifacts/doc/conf/artifact-db.xml flys-artifacts/doc/conf/backend-db.xml flys-artifacts/doc/conf/conf.xml flys-artifacts/doc/conf/datacage-db.xml flys-artifacts/doc/conf/seddb-db.xml
diffstat 6 files changed, 62 insertions(+), 40 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Mon Jun 18 13:58:13 2012 +0000
+++ b/flys-artifacts/ChangeLog	Mon Jun 18 14:30:43 2012 +0000
@@ -1,7 +1,21 @@
+2012-06-18	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
+
+	* doc/conf/conf.xml: Using external system entities to configure databases.
+	  !!!
+	  !!! FROM NOW ON YOU CAN YOUR conf.xml FROM TRUNK. 
+	  !!! Adjust the database credentials via the *-db.xml files
+	  !!! which are included.
+	  !!!
+
+	* doc/conf/artifact-db.xml: New. Configuration for the artifact database.
+	* doc/conf/seddb-db.xml: New. Configuration for the SedDB
+	* doc/conf/backend-db.xml: New. Configuration for the FLYS3 database.
+	* doc/conf/datacage-db.xml: Configuration for the datacage datacage.
+
 2012-06-18  Raimund Renkert <raimund.renkert@intevation.de>
 
 	* src/main/java/de/intevation/flys/artifacts/model/fixings/AnalysisPeriod.java:
-	  Fixed contructor.
+	  Fixed constructor.
 
 2012-06-18	Christian Lins <christian.lins@intevation.de>
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flys-artifacts/doc/conf/artifact-db.xml	Mon Jun 18 14:30:43 2012 +0000
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<database>
+    <!-- This Section configures the Settings for connecting to the 
+         Artifact-Database instance. e.g. SQLite -->
+    <user>SA</user>
+    <password></password>
+    <!-- For use with a postgresql database use the appropriate driver-->
+    <!--driver>org.postgresql.Driver</driver-->
+    <url>jdbc:h2:${artifacts.config.dir}/../artifactdb/artifacts.db</url>
+</database>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flys-artifacts/doc/conf/backend-db.xml	Mon Jun 18 14:30:43 2012 +0000
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<backend-database>
+    <!-- This is the default backend db configuration. -->
+    <user>flys</user>
+    <password>flys</password>
+    <dialect>org.hibernate.dialect.PostgreSQLDialect</dialect>
+    <driver>org.postgresql.Driver</driver>
+    <url>jdbc:postgresql://localhost:5432/flys</url>
+</backend-database>
--- a/flys-artifacts/doc/conf/conf.xml	Mon Jun 18 13:58:13 2012 +0000
+++ b/flys-artifacts/doc/conf/conf.xml	Mon Jun 18 14:30:43 2012 +0000
@@ -1,3 +1,10 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE artifact-database [
+    <!ENTITY artifact-db SYSTEM "artifact-db.xml">
+    <!ENTITY datacage-db SYSTEM "datacage-db.xml">
+    <!ENTITY backend-db  SYSTEM "backend-db.xml">
+    <!ENTITY seddb-db    SYSTEM "seddb-db.xml">
+]>
 <artifact-database>
     <export-secret>YOUR_SECRET</export-secret>
     <factories>
@@ -321,45 +328,11 @@
         <config-file>${artifacts.config.dir}/cache.xml</config-file>
     </cache>
 
-    <!-- This is the default configuration of the datacage db:
-    <datacage>
-        <user/>
-        <password/>
-        <driver>org.h2.Driver</driver>
-        <url>jdbc:h2:mem:datacage;INIT=RUNSCRIPT FROM '${artifacts.config.dir}/datacage.sql'</url>
-    </datacage>
-    -->
-
-    <database>
-        <!-- This Section configures the Settings for connecting to the 
-             Artifact-Database instance. e.g. SQLite -->
-        <user>SA</user>
-        <password></password>
-        <!-- For use with a postgresql database use the appropriate driver-->
-        <!--driver>org.postgresql.Driver</driver-->
-        <url>jdbc:h2:${artifacts.config.dir}/../artifactdb/artifacts.db</url>
-    </database>
-    <!-- This is the default backend db configuration. -->
-    <!--
-    <backend-database>
-        <user>flys</user>
-        <password>flys</password>
-        <dialect>org.hibernate.dialect.PostgreSQLDialect</dialect>
-        <driver>org.postgresql.Driver</driver>
-        <url>jdbc:postgresql://localhost:5432/flys</url>
-    </backend-database>
-    -->
-
-    <!-- This is the default SedDB db configuration. -->
-    <!--
-    <seddb-database>
-        <user>sedb</user>
-        <password>sedb</password>
-        <dialect>org.hibernate.dialect.PostgreSQLDialect</dialect>
-        <driver>org.postgresql.Driver</driver>
-        <url>jdbc:postgresql://localhost:5432/seddb</url>
-    </seddb-database>
-    -->
+    <!-- Configuration of used databases. -->
+    &artifact-db;
+    &datacage-db;
+    &backend-db;
+    &seddb-db;
 
     <flys>
         <themes>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flys-artifacts/doc/conf/datacage-db.xml	Mon Jun 18 14:30:43 2012 +0000
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<datacage>
+    <user>SA</user>
+    <password/>
+    <driver>org.h2.Driver</driver>
+    <url>jdbc:h2:${artifacts.config.dir}/../h2/datacage</url>
+</datacage>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flys-artifacts/doc/conf/seddb-db.xml	Mon Jun 18 14:30:43 2012 +0000
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<seddb-database>
+    <!-- This is the default SedDB db configuration. -->
+    <user>sedb</user>
+    <password>sedb</password>
+    <dialect>org.hibernate.dialect.PostgreSQLDialect</dialect>
+    <driver>org.postgresql.Driver</driver>
+    <url>jdbc:postgresql://localhost:5432/seddb</url>
+</seddb-database>

http://dive4elements.wald.intevation.org