changeset 2093:ebc2aa64c1be

Call State.initialize() for each State of an Artifact in FLYSArtifact. flys-artifacts/trunk@3624 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Mon, 09 Jan 2012 08:27:15 +0000
parents 0ccabd82ec76
children 22732713c54d
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/FloodMapState.java
diffstat 3 files changed, 27 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Sat Jan 07 08:02:56 2012 +0000
+++ b/flys-artifacts/ChangeLog	Mon Jan 09 08:27:15 2012 +0000
@@ -1,3 +1,12 @@
+2012-01-09  Ingo Weinzierl <ingo@intevation.de>
+
+	* src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java:
+	  Initialize() now also calls State.initialize() for each State.
+
+	* src/main/java/de/intevation/flys/artifacts/states/FloodMapState.java:
+	  Override initialize() which is defined in AbstractState. NOTE: Currently,
+	  this method has no code.
+
 2012-01-07	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
 
 	* src/main/java/de/intevation/flys/artifacts/services/CacheInvalidationService.java:
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java	Sat Jan 07 08:02:56 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java	Mon Jan 09 08:27:15 2012 +0000
@@ -254,6 +254,17 @@
         data             = flys.cloneData();
         facets           = flys.cloneFacets();
         // Do not clone filter facets!
+
+        List<String> stateIds = getPreviousStateIds();
+        stateIds.add(getCurrentStateId());
+
+        for (String stateId: stateIds) {
+            State state = getState(context, stateId);
+
+            if (state != null) {
+                state.initialize(artifact, context, callMeta);
+            }
+        }
     }
 
 
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/FloodMapState.java	Sat Jan 07 08:02:56 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/FloodMapState.java	Mon Jan 09 08:27:15 2012 +0000
@@ -23,6 +23,7 @@
 
 import de.intevation.artifacts.Artifact;
 import de.intevation.artifacts.CallContext;
+import de.intevation.artifacts.CallMeta;
 import de.intevation.artifacts.GlobalContext;
 
 import de.intevation.artifacts.common.utils.FileTools;
@@ -82,6 +83,12 @@
     public static final int WSPLGEN_DEFAULT_OUTPUT = 0;
 
 
+    @Override
+    public void initialize(Artifact orig, Object context, CallMeta callMeta) {
+        logger.info("Initialize State with Artifact: " + orig.identifier());
+    }
+
+
 
     @Override
     public Object computeAdvance(

http://dive4elements.wald.intevation.org