changeset 363:4d3298295a64

Enhanced the State interface with a new method initialize() which might be used to initialize the State based on a model Artifact. artifacts/trunk@3623 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Mon, 09 Jan 2012 08:15:35 +0000
parents 5b6ba54d488a
children 0723859f776f
files ChangeLog artifact-database/src/main/java/de/intevation/artifactdatabase/state/AbstractState.java artifact-database/src/main/java/de/intevation/artifactdatabase/state/State.java
diffstat 3 files changed, 27 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Dec 16 14:05:52 2011 +0000
+++ b/ChangeLog	Mon Jan 09 08:15:35 2012 +0000
@@ -1,3 +1,10 @@
+2012-01-09  Ingo Weinzierl <ingo@intevation.de>
+
+	* artifact-database/src/main/java/de/intevation/artifactdatabase/state/State.java,
+	  artifact-database/src/main/java/de/intevation/artifactdatabase/state/AbstractState.java:
+	  Added an initialize() method which might be used to initialize the State
+	  based on model Artifact.
+
 2011-12-16	Felix Wolfsteller	<felix.wolfsteller@intevation.de>
 
 	* artifact-database/src/main/java/de/intevation/artifactdatabase/AbstractCallContext.java:
--- a/artifact-database/src/main/java/de/intevation/artifactdatabase/state/AbstractState.java	Fri Dec 16 14:05:52 2011 +0000
+++ b/artifact-database/src/main/java/de/intevation/artifactdatabase/state/AbstractState.java	Mon Jan 09 08:15:35 2012 +0000
@@ -24,6 +24,7 @@
 import de.intevation.artifacts.Artifact;
 import de.intevation.artifacts.ArtifactNamespaceContext;
 import de.intevation.artifacts.CallContext;
+import de.intevation.artifacts.CallMeta;
 
 import de.intevation.artifacts.common.utils.XMLUtils;
 
@@ -198,6 +199,14 @@
 
 
     /**
+     * This default implementation does nothing at all.
+     */
+    public void initialize(Artifact orig, Object context, CallMeta callMeta) {
+        // do nothing.
+    }
+
+
+    /**
      * This method tries reading the available output nodes configured in the
      * state configuration and adds possible Outputs to the outputs list.
      *
--- a/artifact-database/src/main/java/de/intevation/artifactdatabase/state/State.java	Fri Dec 16 14:05:52 2011 +0000
+++ b/artifact-database/src/main/java/de/intevation/artifactdatabase/state/State.java	Mon Jan 09 08:15:35 2012 +0000
@@ -17,6 +17,7 @@
 
 import de.intevation.artifacts.Artifact;
 import de.intevation.artifacts.CallContext;
+import de.intevation.artifacts.CallMeta;
 
 import de.intevation.artifactdatabase.data.StateData;
 
@@ -91,6 +92,16 @@
 
 
     /**
+     * Initializes the internal state of this State based on an other State.
+     *
+     * @param orig The owner Artifact or the original State.
+     * @param context The context object.
+     * @param callMeta The CallMeta of the current call.
+     */
+    public void initialize(Artifact orig, Object context, CallMeta callMeta);
+
+
+    /**
      * This method is called when an artifacts retrieves a describe request. It
      * creates the user interface description of the current state.
      *

http://dive4elements.wald.intevation.org