changeset 1917:71139016cd0f

Avoid WMS layer names that begin with digits to ensure valid WMS GetFeatureInfo responses. flys-artifacts/trunk@3277 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Wed, 16 Nov 2011 15:55:24 +0000 (2011-11-16)
parents efff4305dc05
children 5afdf7ed0937
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/WMSDBArtifact.java flys-artifacts/src/main/java/de/intevation/flys/utils/MapfileGenerator.java flys-artifacts/src/main/java/de/intevation/flys/wsplgen/FacetCreator.java
diffstat 4 files changed, 16 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Wed Nov 16 15:53:52 2011 +0000
+++ b/flys-artifacts/ChangeLog	Wed Nov 16 15:55:24 2011 +0000
@@ -1,3 +1,12 @@
+2011-11-16  Ingo Weinzierl <ingo@intevation.de>
+
+	* src/main/java/de/intevation/flys/wsplgen/FacetCreator.java,
+	  src/main/java/de/intevation/flys/artifacts/WMSDBArtifact.java,
+	  src/main/java/de/intevation/flys/utils/MapfileGenerator.java: Avoid
+	  WMS layer names that begin with digits. This would lead to invalid
+	  WMSGetFeatureInfo responses, where the name of a layer is the name of a
+	  XML node.
+
 2011-11-16  Felix Wolfsteller <felix.wolfsteller@intevation.de>
 
 	* doc/conf/meta-data.xml: Added and use *_wq macros for interpolated
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WMSDBArtifact.java	Wed Nov 16 15:53:52 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WMSDBArtifact.java	Wed Nov 16 15:55:24 2011 +0000
@@ -129,7 +129,7 @@
                 getID(), hash,
                 getUrl());
 
-            String name = artifact.identifier() + "-" + type;
+            String name = type + "-" + artifact.identifier();
 
             facet.addLayer(name);
             facet.setExtent(getExtent());
--- a/flys-artifacts/src/main/java/de/intevation/flys/utils/MapfileGenerator.java	Wed Nov 16 15:53:52 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/utils/MapfileGenerator.java	Wed Nov 16 15:55:24 2011 +0000
@@ -370,7 +370,7 @@
         logger.debug("createUeskLayer");
 
         LayerInfo layerinfo = new LayerInfo();
-        layerinfo.setName(flys.identifier() + MS_WSPLGEN_POSTFIX);
+        layerinfo.setName(MS_WSPLGEN_POSTFIX + flys.identifier());
         layerinfo.setType("POLYGON");
         layerinfo.setDirectory(flys.identifier());
         layerinfo.setData(WSPLGEN_RESULT_SHAPE);
@@ -434,7 +434,7 @@
         }
 
         LayerInfo lineInfo = new LayerInfo();
-        lineInfo.setName(uuid + MS_LINE_POSTFIX);
+        lineInfo.setName(MS_LINE_POSTFIX + uuid);
         lineInfo.setType("LINE");
         lineInfo.setDirectory(uuid);
         lineInfo.setData(WSPLGEN_LINES_SHAPE);
@@ -479,7 +479,7 @@
         }
 
         LayerInfo polygonInfo = new LayerInfo();
-        polygonInfo.setName(uuid + MS_POLYGONS_POSTFIX);
+        polygonInfo.setName(MS_POLYGONS_POSTFIX + uuid);
         polygonInfo.setType("POLYGON");
         polygonInfo.setDirectory(uuid);
         polygonInfo.setData(WSPLGEN_POLYGONS_SHAPE);
@@ -522,7 +522,7 @@
         logger.debug("createDatabaseLayer");
 
         LayerInfo layerinfo = new LayerInfo();
-        layerinfo.setName(flys.identifier() + "-" + wms.getName());
+        layerinfo.setName(wms.getName() + "-" + flys.identifier());
         layerinfo.setType(wms.getGeometryType());
         layerinfo.setFilter(wms.getFilter());
         layerinfo.setData(wms.getData());
--- a/flys-artifacts/src/main/java/de/intevation/flys/wsplgen/FacetCreator.java	Wed Nov 16 15:53:52 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/wsplgen/FacetCreator.java	Wed Nov 16 15:55:24 2011 +0000
@@ -116,7 +116,7 @@
         }
 
         wsplgen.addLayer(
-            artifact.identifier() + MapfileGenerator.MS_WSPLGEN_POSTFIX);
+            MapfileGenerator.MS_WSPLGEN_POSTFIX + artifact.identifier());
         wsplgen.setSrid(getSrid());
         wsplgen.setExtent(bounds);
 
@@ -137,7 +137,7 @@
             getUrl());
 
         barriers.addLayer(
-            artifact.identifier() + MapfileGenerator.MS_BARRIERS_POSTFIX);
+            MapfileGenerator.MS_BARRIERS_POSTFIX + artifact.identifier());
         barriers.setSrid(getSrid());
         barriers.setExtent(getBounds());
 

http://dive4elements.wald.intevation.org