# HG changeset patch # User Felix Wolfsteller # Date 1323446599 0 # Node ID 1d11a053124232844422bfeb8988fe511e4928a1 # Parent 079ab7c971a40ddea3030730d916ab4c0fbd4919 Added artifact parameter to facets getDataProviderKeys. artifacts/trunk@3380 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 079ab7c971a4 -r 1d11a0531242 ChangeLog --- a/ChangeLog Wed Nov 30 11:49:51 2011 +0000 +++ b/ChangeLog Fri Dec 09 16:03:19 2011 +0000 @@ -1,3 +1,15 @@ +2011-12-09 Felix Wolfsteller + + * artifact-database/src/main/java/de/intevation/artifactdatabase/state/Facet.java, + artifact-database/src/main/java/de/intevation/artifactdatabase/state/DefaultFacet.java: + (getDataProviderKeys): Added parameter artifact. + + * artifact-database/src/main/java/de/intevation/artifactdatabase/state/ArtifactAndFacet.java: + Pass artifact to changed getDataProviderKeys of Facet. + + * artifact-database/src/main/java/de/intevation/artifactdatabase/AbstractCallContext.java: + (getDataProvider): Never return null, empty list instead. + 2011-11-30 Felix Wolfsteller * artifact-database/src/main/java/de/intevation/artifactdatabase/state/ArtifactAndFacet.java diff -r 079ab7c971a4 -r 1d11a0531242 artifact-database/src/main/java/de/intevation/artifactdatabase/AbstractCallContext.java --- a/artifact-database/src/main/java/de/intevation/artifactdatabase/AbstractCallContext.java Wed Nov 30 11:49:51 2011 +0000 +++ b/artifact-database/src/main/java/de/intevation/artifactdatabase/AbstractCallContext.java Fri Dec 09 16:03:19 2011 +0000 @@ -117,7 +117,7 @@ public List getDataProvider(Object key) { return dataProviders != null ? dataProviders.get(key) - : null;//java.util.Collections.emptyList(); + : java.util.Collections.emptyList(); } /** diff -r 079ab7c971a4 -r 1d11a0531242 artifact-database/src/main/java/de/intevation/artifactdatabase/state/ArtifactAndFacet.java --- a/artifact-database/src/main/java/de/intevation/artifactdatabase/state/ArtifactAndFacet.java Wed Nov 30 11:49:51 2011 +0000 +++ b/artifact-database/src/main/java/de/intevation/artifactdatabase/state/ArtifactAndFacet.java Fri Dec 09 16:03:19 2011 +0000 @@ -13,6 +13,7 @@ public class ArtifactAndFacet implements DataProvider { /** The Artifact. */ protected Artifact artifact; + /** The (native) facet. */ protected Facet facet; @@ -41,7 +42,7 @@ /** (Maybe) Register on blackboard (depending on facet). */ public void register(CallContext context) { - List keys = facet.getDataProviderKeys(); + List keys = facet.getDataProviderKeys(this.artifact); if (keys == null) { return; } diff -r 079ab7c971a4 -r 1d11a0531242 artifact-database/src/main/java/de/intevation/artifactdatabase/state/DefaultFacet.java --- a/artifact-database/src/main/java/de/intevation/artifactdatabase/state/DefaultFacet.java Wed Nov 30 11:49:51 2011 +0000 +++ b/artifact-database/src/main/java/de/intevation/artifactdatabase/state/DefaultFacet.java Fri Dec 09 16:03:19 2011 +0000 @@ -118,8 +118,9 @@ /** * 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() { + public List getDataProviderKeys(Artifact artifact) { return null; } diff -r 079ab7c971a4 -r 1d11a0531242 artifact-database/src/main/java/de/intevation/artifactdatabase/state/Facet.java --- a/artifact-database/src/main/java/de/intevation/artifactdatabase/state/Facet.java Wed Nov 30 11:49:51 2011 +0000 +++ b/artifact-database/src/main/java/de/intevation/artifactdatabase/state/Facet.java Fri Dec 09 16:03:19 2011 +0000 @@ -53,10 +53,10 @@ /** * Get keys for which this Facet can provide data (for other facets, not * for plot). - * + * @param artifact Artifact that this facet belongs to. * @return list of keys */ - List getDataProviderKeys(); + List getDataProviderKeys(Artifact artifact); /**