changeset 59:8cd770330f1b

Added path to chart template and added a method to retrieve its configuration. artifacts/trunk@361 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Mon, 23 Nov 2009 16:56:47 +0000
parents 39fec7d714dc
children 85d996328c8a
files ChangeLog artifact-database/src/main/java/de/intevation/artifactdatabase/Config.java
diffstat 2 files changed, 15 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Nov 23 11:15:44 2009 +0000
+++ b/ChangeLog	Mon Nov 23 16:56:47 2009 +0000
@@ -1,3 +1,9 @@
+2009-11-23  Ingo Weinzierl <ingo.weinzierl@intevation.de>
+
+	* artifact-database/src/main/java/de/intevation/artifactdatabase/Config.java:
+	  Added path to chart template file and a new method to retrieve the
+	  configuration.
+
 2009-11-23	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
 
 	* artifacts/src/main/java/de/intevation/artifacts/CallContext.java:
--- a/artifact-database/src/main/java/de/intevation/artifactdatabase/Config.java	Mon Nov 23 11:15:44 2009 +0000
+++ b/artifact-database/src/main/java/de/intevation/artifactdatabase/Config.java	Mon Nov 23 16:56:47 2009 +0000
@@ -33,6 +33,8 @@
 
     public static final String CONFIG_FILE  = "conf.xml";
 
+    public static final String CHART_TEMPLATE = "charttemplate.xml";
+
     public static final String CONFIG_DIR_PLACEHOLDER = "${artifacts.config.dir}";
 
     private static Document config;
@@ -42,11 +44,15 @@
 
     public static synchronized final Document getConfig() {
         if (config == null) {
-            config = loadConfig();
+            config = loadConfig(CONFIG_FILE);
         }
         return config;
     }
 
+    public static Document getChartTemplate() {
+        return loadConfig(CHART_TEMPLATE);
+    }
+
     public static File getConfigDirectory() {
         String configDirString = System.getProperty(CONFIG_DIR);
 
@@ -67,11 +73,11 @@
         return path.replace(CONFIG_DIR_PLACEHOLDER, configDir);
     }
 
-    private static Document loadConfig() {
+    private static Document loadConfig(String config) {
 
         File configDir = getConfigDirectory();
 
-        File file = new File(configDir, CONFIG_FILE);
+        File file = new File(configDir, config);
 
         if (!file.canRead() && !file.isFile()) {
             logger.error("Cannot read config file '"

http://dive4elements.wald.intevation.org