changeset 421:24b53f9aa9dc

MetaDataService: Make incoming XML symmetric to DistanceInfoService. flys-artifacts/trunk@1896 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Wed, 11 May 2011 09:51:54 +0000 (2011-05-11)
parents a0afdda4d4b9
children 3b83341e0cf4
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/services/MetaDataService.java
diffstat 2 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Tue May 10 17:57:56 2011 +0000
+++ b/flys-artifacts/ChangeLog	Wed May 11 09:51:54 2011 +0000
@@ -1,3 +1,8 @@
+2011-05-10	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
+
+	* src/main/java/de/intevation/flys/artifacts/services/MetaDataService.java:
+	  Make incoming XML symmetric to DistanceInfoService.
+
 2011-05-10  Ingo Weinzierl <ingo@intevation.de>
 
 	  ISSUE-47
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/services/MetaDataService.java	Tue May 10 17:57:56 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/services/MetaDataService.java	Wed May 11 09:51:54 2011 +0000
@@ -20,6 +20,8 @@
 
 import de.intevation.artifacts.common.utils.XMLUtils;
 
+import de.intevation.artifacts.common.ArtifactNamespaceContext;
+
 import de.intevation.flys.artifacts.services.meta.Builder;
 
 import de.intevation.flys.backend.SessionHolder;
@@ -33,7 +35,7 @@
 {
     private static Logger log = Logger.getLogger(MetaDataService.class);
 
-    public static final String XPATH_RIVER = "//river/@name";
+    public static final String XPATH_RIVER = "/art:river/text()";
 
     public static final String META_DATA_TEMPLATE = "/metadata/template.xml";
 
@@ -45,7 +47,8 @@
     protected static Map<String, Object> extractParameters(Document data) {
         HashMap<String, Object> parameters = new HashMap<String, Object>();
 
-        String river = XMLUtils.xpathString(data, XPATH_RIVER, null);
+        String river = XMLUtils.xpathString(
+            data, XPATH_RIVER, ArtifactNamespaceContext.INSTANCE);
 
         if (river == null || (river = river.trim()).length() == 0) {
             river = "%"; // matches all rivers

http://dive4elements.wald.intevation.org