changeset 1843:a7e030efd50e

Fix flys/issue405 (Datacage: Recommendations get loaded twice). flys-artifacts/trunk@3180 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Tue, 08 Nov 2011 12:02:10 +0000
parents da286eb91c9b
children 06cf1009301d
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/StaticWKmsArtifact.java
diffstat 2 files changed, 32 insertions(+), 35 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Tue Nov 08 11:51:06 2011 +0000
+++ b/flys-artifacts/ChangeLog	Tue Nov 08 12:02:10 2011 +0000
@@ -1,3 +1,11 @@
+2011-11-08  Felix Wolfsteller <felix.wolfsteller@intevation.de>
+
+	Fix flys/issue405 (Datacage: Recommendations get loaded twice).
+
+	* src/main/java/de/intevation/flys/artifacts/StaticWKmsArtifact.java
+	  (setup): Do not try/catch exception.
+	  (spawn_state): Generate just one "general" output.
+
 2011-11-08  Ingo Weinzierl <ingo@intevation.de>
 
 	* src/main/java/de/intevation/flys/artifacts/StaticWKmsArtifact.java:
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/StaticWKmsArtifact.java	Tue Nov 08 11:51:06 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/StaticWKmsArtifact.java	Tue Nov 08 12:02:10 2011 +0000
@@ -86,35 +86,30 @@
             String [] parts = code.split("-");
 
             if (parts.length >= 4) {
-                try {
-                    int col = Integer.valueOf(parts[2]);
-                    int wst = Integer.valueOf(parts[3]);
-
-                    addStringData("col_pos", parts[2]);
-                    addStringData("wst_id",  parts[3]);
-
-                    String wkmsName = WKmsFactory.getWKmsName(col, wst);
+                int col = Integer.valueOf(parts[2]);
+                int wst = Integer.valueOf(parts[3]);
 
-                    String name;
-                    if (parts[0].equals(HEIGHTMARKS_POINTS)) {
-                        name = HEIGHTMARKS_POINTS;
-                    }
-                    else {
-                        name = STATIC_WKMS;
-                    }
+                addStringData("col_pos", parts[2]);
+                addStringData("wst_id",  parts[3]);
 
-                    Facet facet = new WKmsFacet(
-                        name,
-                        Resources.getMsg(
-                            callMeta,
-                            wkmsName,
-                            wkmsName));
-                    fs.add(facet);
-                    facets.put(state.getID(), fs);
+                String wkmsName = WKmsFactory.getWKmsName(col, wst);
+
+                String name;
+                if (parts[0].equals(HEIGHTMARKS_POINTS)) {
+                    name = HEIGHTMARKS_POINTS;
                 }
-                catch (Exception e) {
-                    logger.warn(e, e);
+                else {
+                    name = STATIC_WKMS;
                 }
+
+                Facet facet = new WKmsFacet(
+                    name,
+                    Resources.getMsg(
+                        callMeta,
+                        wkmsName,
+                        wkmsName));
+                fs.add(facet);
+                facets.put(state.getID(), fs);
             }
         }
 
@@ -130,19 +125,13 @@
     protected State spawnState() {
         state = new StaticState(STATIC_STATE_NAME);
         List<Facet> fs = facets.get(STATIC_STATE_NAME);
-        DefaultOutput output1 = new DefaultOutput(
-            "w_differences",
-            "w_differences.longitudinal_section", "image/png",
-            fs,
-            "chart");
-        DefaultOutput output2 = new DefaultOutput(
-            "longitudinal_section",
-            "longitudinal_section.longitudinal_section", "image/png",
+        DefaultOutput output = new DefaultOutput(
+            "general",
+            "general", "image/png",
             fs,
             "chart");
 
-        state.getOutputs().add(output1);
-        state.getOutputs().add(output2);
+        state.getOutputs().add(output);
         return state;
     }
 

http://dive4elements.wald.intevation.org