diff gnv-artifacts/src/main/java/de/intevation/gnv/state/timeseries/TimeSeriesOutputState.java @ 467:b2d2b36b20a0

Use XMLUtils to evaluate xpath expressions instead of using Config class. Adapted xpath (namespace and prefix). gnv-artifacts/trunk@530 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 12 Jan 2010 08:49:51 +0000
parents 04cfb4e3da4f
children 211cad2fb5ba
line wrap: on
line diff
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/timeseries/TimeSeriesOutputState.java	Mon Jan 11 15:26:24 2010 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/timeseries/TimeSeriesOutputState.java	Tue Jan 12 08:49:51 2010 +0000
@@ -34,6 +34,7 @@
 import au.com.bytecode.opencsv.CSVWriter;
 import de.intevation.artifactdatabase.Config;
 import de.intevation.artifactdatabase.XMLUtils;
+import de.intevation.artifacts.ArtifactNamespaceContext;
 import de.intevation.artifacts.CallMeta;
 import de.intevation.artifacts.CallContext;
 import de.intevation.artifacts.PreferredLocale;
@@ -72,6 +73,12 @@
  */
 public class TimeSeriesOutputState extends OutputStateBase {
 
+    public static final String XPATH_OUTPUT_MODE =
+        "/art:action/art:out/@name";
+
+    public static final String XPATH_MIME_TYPE   =
+        "/art:action/art:out/art:mime-type/@value";
+
     protected static final boolean CACHE_CHART =
         Boolean.parseBoolean(System.getProperty("cache.chart", "false"));
 
@@ -188,14 +195,11 @@
     {
         log.debug("TimeSeriesOutputTransition.out");
 
-        String outputMode = Config.getStringXPath(
-            format,
-            "action/out/@name"
-        );
-        String mimeType   = Config.getStringXPath(
-            format,
-            "action/out/mime-type/@value"
-        );
+        String outputMode = XMLUtils.xpathString(
+            format, XPATH_OUTPUT_MODE, ArtifactNamespaceContext.INSTANCE);
+
+        String mimeType = XMLUtils.xpathString(
+            format, XPATH_MIME_TYPE, ArtifactNamespaceContext.INSTANCE);
 
         CallMeta callMeta         = callContext.getMeta();
 

http://dive4elements.wald.intevation.org