diff artifacts/src/main/java/org/dive4elements/river/artifacts/states/GaugeDischargeState.java @ 6693:88bb0c794833

issue1391: Enable GaugeDischarge artifact to directly load a table by its ID This allows us to use the GaugeDischargeArtifact for any discharge tables that we have in our database. The name of the created facet is taken from the ids string as is also usual in the WMS artifacts.
author Andre Heinecke <aheinecke@intevation.de>
date Mon, 29 Jul 2013 12:19:57 +0200
parents af13ceeba52a
children 4937dab5ff7a
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/GaugeDischargeState.java	Mon Jul 29 12:17:11 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/GaugeDischargeState.java	Mon Jul 29 12:19:57 2013 +0200
@@ -57,6 +57,12 @@
     protected String createFacetName(GaugeDischargeArtifact artifact,
         CallMeta meta) {
 
+        if (artifact.getFacetWishName() != null) {
+            /* We let the Artifact overwrite our name as this allows
+             * injecting the facet name from the Datacage */
+            return artifact.getFacetWishName();
+        }
+
         Gauge gauge = artifact.getGauge();
         Object[] args = new Object[] {
             gauge.getName(),

http://dive4elements.wald.intevation.org