changeset 1654:33ade8153d74

Little modifications for making recommendations - will now work for states with background calculation. flys-artifacts/trunk@2846 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 27 Sep 2011 15:19:59 +0000
parents 73794985a899
children d251e5929860
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/CollectionMonitor.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/MainValuesArtifact.java
diffstat 4 files changed, 20 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Tue Sep 27 14:37:18 2011 +0000
+++ b/flys-artifacts/ChangeLog	Tue Sep 27 15:19:59 2011 +0000
@@ -1,3 +1,17 @@
+2011-09-27  Ingo Weinzierl <ingo@intevation.de>
+
+	* src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java,
+	  src/main/java/de/intevation/flys/artifacts/MainValuesArtifact.java:
+	  Changed access of getCurrentState() from protected to public.
+
+	* src/main/java/de/intevation/flys/artifacts/CollectionMonitor.java: We
+	  use the configured Outputs instead of the actuel Outputs of an Artifact
+	  to make recommendations, now. This has the bad side effect of giving
+	  recommendations for Outputs that we might _NOT_ be able to produce. But
+	  otherwise, we would not be able to give recommendations for states with
+	  long calculation times that start background threads for calculation (as
+	  WSPLGEN caluclations does).
+
 2011-09-27  Felix Wolfsteller <felix.wolfsteller@intevation.de>
 
 	Enable "auto-scaling" axis for waterlevels in WDifference-plots.
@@ -29,6 +43,7 @@
 
 	* src/main/java/de/intevation/flys/artifacts/geom/Lines.java:
 	  Moved some logic from the demo app to this model.
+
 2011-09-27  Ingo Weinzierl <ingo@intevation.de>
 
 	* src/main/java/de/intevation/flys/wsplgen/FacetCreator.java: New. Code
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/CollectionMonitor.java	Tue Sep 27 14:37:18 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/CollectionMonitor.java	Tue Sep 27 15:19:59 2011 +0000
@@ -20,6 +20,7 @@
 import de.intevation.artifacts.common.utils.XMLUtils;
 import de.intevation.artifacts.common.utils.XMLUtils.ElementCreator;
 
+import de.intevation.artifactdatabase.state.State;
 import de.intevation.artifactdatabase.state.Output;
 
 import de.intevation.flys.artifacts.datacage.Recommendations;
@@ -69,7 +70,8 @@
         FLYSArtifact flys,
         CallContext  context)
     {
-        List<Output> outs = flys.getCurrentOutputs(context);
+        State        state = flys.getCurrentState(context);
+        List<Output>  outs = state.getOutputs();
 
         int num = outs == null ? 0 : outs.size();
 
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java	Tue Sep 27 14:37:18 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java	Tue Sep 27 15:19:59 2011 +0000
@@ -436,7 +436,7 @@
      *
      * @return the current State of the artifact.
      */
-    protected State getCurrentState(Object context) {
+    public State getCurrentState(Object context) {
         return getState(context, getCurrentStateId());
     }
 
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/MainValuesArtifact.java	Tue Sep 27 14:37:18 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/MainValuesArtifact.java	Tue Sep 27 15:19:59 2011 +0000
@@ -130,7 +130,7 @@
      * @return the "current" state.
      */
     @Override
-    protected State getCurrentState(Object cc) {
+    public State getCurrentState(Object cc) {
         return getState();
     }
 

http://dive4elements.wald.intevation.org