Mercurial > dive4elements > gnv-client
changeset 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 | 147d1e46b239 |
children | 7ba4c7222265 |
files | gnv-artifacts/ChangeLog gnv-artifacts/src/main/java/de/intevation/gnv/state/timeseries/TimeSeriesOutputState.java |
diffstat | 2 files changed, 18 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/gnv-artifacts/ChangeLog Mon Jan 11 15:26:24 2010 +0000 +++ b/gnv-artifacts/ChangeLog Tue Jan 12 08:49:51 2010 +0000 @@ -1,3 +1,9 @@ +2010-01-12 Ingo Weinzierl <ingo.weinzierl@intevation.de> + + * src/main/java/de/intevation/gnv/state/timeseries/TimeSeriesOutputState.java: + Use XMLUtils to read evaluate xpath expressions. Adapted xpath + expressions regarding namespace and prefix. + 2010-01-11 Tim Englich <tim.englich@intevation.de> * src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCaseBase.java (readDocument):
--- 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();