Mercurial > dive4elements > river
diff flys-artifacts/src/main/java/de/intevation/flys/artifacts/WMSFloodmapsArtifact.java @ 2683:f5af3adb3b95
Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
flys-artifacts/trunk@4383 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Thu, 10 May 2012 11:14:17 +0000 |
parents | b23c956c5aa2 |
children | 0ca00d547f35 |
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WMSFloodmapsArtifact.java Thu May 10 10:04:12 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WMSFloodmapsArtifact.java Thu May 10 11:14:17 2012 +0000 @@ -78,39 +78,10 @@ Logger.getLogger(FloodmapsState.class); protected int riverId; - protected String floodmapName; public FloodmapsState(WMSDBArtifact artifact) { super(artifact); riverId = 0; - floodmapName = null; - } - - public int getRiverId() { - if (riverId == 0) { - String ids = artifact.getDataAsString("ids"); - - try { - String[] parts = ids.split("_"); - riverId = Integer.valueOf(parts[0]); - } - catch (NumberFormatException nfe) { - logger.error("Cannot parse river id from '" + ids + "'"); - } - } - - return riverId; - } - - public String getFloodmapName() { - if (floodmapName == null) { - String ids = artifact.getDataAsString("ids"); - - String parts[] = ids.split("_"); - floodmapName = parts[1]; - } - - return floodmapName; } @Override @@ -119,14 +90,6 @@ } @Override - protected String getTitle(CallMeta meta) { - return Resources.getMsg( - meta, - FLOODMAP_FLOODMAPS, - FLOODMAP_FLOODMAPS); - } - - @Override protected String getUrl() { return FLYSUtils.getUserWMSUrl(artifact.identifier()); } @@ -140,7 +103,7 @@ @Override protected Envelope getExtent() { List<Floodmaps> floodmaps = - Floodmaps.getFloodmaps(getRiverId(), getFloodmapName()); + Floodmaps.getFloodmaps(getRiverId(), getName()); Envelope max = null; @@ -161,7 +124,7 @@ @Override protected String getFilter() { return "river_id=" + String.valueOf(getRiverId()) - + " AND name='" + getFloodmapName() + "'"; + + " AND name='" + getName() + "'"; } @Override