changeset 378:71ff234713a6 2.6.1 pre2.7-2012-03-16

Pass context when asking facets for keys to write on blackboard. artifacts/trunk@4032 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Fri, 10 Feb 2012 12:33:57 +0000
parents 1ffc09fec1c8
children 95ff5a25a339
files ChangeLog artifact-database/src/main/java/de/intevation/artifactdatabase/state/ArtifactAndFacet.java artifact-database/src/main/java/de/intevation/artifactdatabase/state/DefaultFacet.java artifact-database/src/main/java/de/intevation/artifactdatabase/state/Facet.java
diffstat 4 files changed, 22 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Feb 09 15:53:03 2012 +0000
+++ b/ChangeLog	Fri Feb 10 12:33:57 2012 +0000
@@ -1,3 +1,10 @@
+2012-02-10	Felix Wolfsteller	<felix.wolfsteller@intevation.de>
+
+	* artifact-database/src/main/java/de/intevation/artifactdatabase/state/Facet.java,
+	  artifact-database/src/main/java/de/intevation/artifactdatabase/state/ArtifactAndFacet.java,
+	  artifact-database/src/main/java/de/intevation/artifactdatabase/state/DefaultFacet.java:
+	  Pass context when asking facet for keys to write on 'blackboard'.
+
 2012-02-09  Ingo Weinzierl <ingo@intevation.de>
 
 	* artifact-database/src/main/java/de/intevation/artifactdatabase/state/ArtifactAndFacet.java:
--- a/artifact-database/src/main/java/de/intevation/artifactdatabase/state/ArtifactAndFacet.java	Thu Feb 09 15:53:03 2012 +0000
+++ b/artifact-database/src/main/java/de/intevation/artifactdatabase/state/ArtifactAndFacet.java	Fri Feb 10 12:33:57 2012 +0000
@@ -47,7 +47,7 @@
     /** (Maybe) Register on blackboard (depending on facet). */
     @Override
     public void register(CallContext context) {
-        List keys = facet.getDataProviderKeys(this.artifact);
+        List keys = facet.getDataProviderKeys(this.artifact, context);
         if (keys == null) {
             return;
         }
--- a/artifact-database/src/main/java/de/intevation/artifactdatabase/state/DefaultFacet.java	Thu Feb 09 15:53:03 2012 +0000
+++ b/artifact-database/src/main/java/de/intevation/artifactdatabase/state/DefaultFacet.java	Fri Feb 10 12:33:57 2012 +0000
@@ -101,13 +101,24 @@
     }
 
 
+    /*
+     * Return list of keys (objects) for which this facet can provide data
+     * ("external parameterization"), for other facets, via blackboard.
+     * These are the keys that are independent from the current call (thus
+     * 'static').
+     * @param artifact that this facet belongs to.
+     */
+    public List getStaticDataProviderKeys(Artifact artifact) {
+        return null;
+    }
+
     /**
      * Return list of keys (objects) for which this facet can provide data
      * ("external parameterization"), for other facets, via blackboard.
      * @param artifact that this facet belongs to.
      */
-    public List getDataProviderKeys(Artifact artifact) {
-        return null;
+    public List getDataProviderKeys(Artifact artifact, CallContext context) {
+        return getStaticDataProviderKeys(artifact);
     }
 
 
--- a/artifact-database/src/main/java/de/intevation/artifactdatabase/state/Facet.java	Thu Feb 09 15:53:03 2012 +0000
+++ b/artifact-database/src/main/java/de/intevation/artifactdatabase/state/Facet.java	Fri Feb 10 12:33:57 2012 +0000
@@ -56,7 +56,7 @@
      * @param artifact Artifact that this facet belongs to.
      * @return list of keys
      */
-    List getDataProviderKeys(Artifact artifact);
+    List getDataProviderKeys(Artifact artifact, CallContext context);
 
 
     /**

http://dive4elements.wald.intevation.org