diff gnv-artifacts/src/main/java/de/intevation/gnv/state/timeseries/TimeSeriesOutputState.java @ 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 2423cefe7d39
children ac5988f27714
line wrap: on
line diff
--- 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