changeset 838:e91ebe3696ec

Iterate through former states as well when searching for an input collection (issue226). gnv-artifacts/trunk@945 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Mon, 19 Apr 2010 12:31:02 +0000
parents 43f3c0cd60f2
children ac5988f27714
files gnv-artifacts/ChangeLog gnv-artifacts/src/main/java/de/intevation/gnv/state/timeseries/TimeSeriesOutputState.java
diffstat 2 files changed, 22 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/gnv-artifacts/ChangeLog	Mon Apr 19 10:55:25 2010 +0000
+++ b/gnv-artifacts/ChangeLog	Mon Apr 19 12:31:02 2010 +0000
@@ -1,3 +1,12 @@
+2010-04-19	Ingo Weinzierl <ingo.weinzierl@intevation.de>
+
+	  Issue226
+
+	* src/main/java/de/intevation/gnv/state/timeseries/TimeSeriesOutputState.java:
+	  Iterate through former states when searching for an input collections -
+	  searching in the current state is not enough because it stores the current
+	  input values only.
+
 2010-04-19	Ingo Weinzierl <ingo.weinzierl@intevation.de>
 
 	  Issue217
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/timeseries/TimeSeriesOutputState.java	Mon Apr 19 10:55:25 2010 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/timeseries/TimeSeriesOutputState.java	Mon Apr 19 12:31:02 2010 +0000
@@ -45,6 +45,7 @@
 import de.intevation.gnv.histogram.HistogramHelper;
 import de.intevation.gnv.state.InputData;
 import de.intevation.gnv.state.OutputStateBase;
+import de.intevation.gnv.state.State;
 import de.intevation.gnv.state.describedata.DefaultKeyValueDescribeData;
 import de.intevation.gnv.state.describedata.KeyValueDescibeData;
 import de.intevation.gnv.state.describedata.MinMaxDescribeData;
@@ -1230,9 +1231,20 @@
         String collectionName,
         String uuid)
     {
+        log.debug("Search for input data: " + collectionName);
         NamedCollection<KeyValueDescibeData> c = new NamedArrayList<KeyValueDescibeData>(collectionName);
 
-        InputData data = inputData.get(collectionName);
+        InputData data = null;
+        State parent   = this;
+        do {
+            data = parent.inputData().get(collectionName);
+
+            if (data != null) {
+                break;
+            }
+        }
+        while ((parent = parent.getParent()) != null);
+
         if (data == null) {
             log.warn("No collection found with name: " + collectionName);
             return c;

http://dive4elements.wald.intevation.org