changeset 280:7fbe674d758a

Facets got a method that return its required data from the owner artifact. artifacts/trunk@2139 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Fri, 17 Jun 2011 07:40:20 +0000
parents 5ed1afd81569
children 942a54670a72
files ChangeLog artifact-database/src/main/java/de/intevation/artifactdatabase/state/DefaultFacet.java artifact-database/src/main/java/de/intevation/artifactdatabase/state/Facet.java
diffstat 3 files changed, 29 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Jun 16 13:28:58 2011 +0000
+++ b/ChangeLog	Fri Jun 17 07:40:20 2011 +0000
@@ -1,3 +1,10 @@
+2011-06-17  Ingo Weinzierl <ingo@intevation.de>
+
+	* artifact-database/src/main/java/de/intevation/artifactdatabase/state/Facet.java,
+	  artifact-database/src/main/java/de/intevation/artifactdatabase/state/DefaultFacet.java:
+	  Facets are able to fetch their necessary data from artifact now using a
+	  getData(Artifact, CallContext) method.
+
 2011-06-16  Ingo Weinzierl <ingo@intevation.de>
 
 	* artifact-database/src/main/java/de/intevation/artifactdatabase/ProtocolUtils.java:
--- a/artifact-database/src/main/java/de/intevation/artifactdatabase/state/DefaultFacet.java	Thu Jun 16 13:28:58 2011 +0000
+++ b/artifact-database/src/main/java/de/intevation/artifactdatabase/state/DefaultFacet.java	Fri Jun 17 07:40:20 2011 +0000
@@ -1,5 +1,8 @@
 package de.intevation.artifactdatabase.state;
 
+import de.intevation.artifacts.Artifact;
+import de.intevation.artifacts.CallContext;
+
 
 /**
  * The default implementation of a Facet.
@@ -56,5 +59,10 @@
     public String getDescription() {
         return description;
     }
+
+
+    public Object getData(Artifact artifact, CallContext context) {
+        return null;
+    }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :
--- a/artifact-database/src/main/java/de/intevation/artifactdatabase/state/Facet.java	Thu Jun 16 13:28:58 2011 +0000
+++ b/artifact-database/src/main/java/de/intevation/artifactdatabase/state/Facet.java	Fri Jun 17 07:40:20 2011 +0000
@@ -2,6 +2,9 @@
 
 import java.io.Serializable;
 
+import de.intevation.artifacts.Artifact;
+import de.intevation.artifacts.CallContext;
+
 
 /**
  * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
@@ -29,5 +32,16 @@
      * @return the description of this facet.
      */
     String getDescription();
+
+
+    /**
+     * Returns the data this facet requires.
+     *
+     * @param artifact The owner artifact.
+     * @param context The CallContext.
+     *
+     * @return the data.
+     */
+    Object getData(Artifact artifact, CallContext context);
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :

http://dive4elements.wald.intevation.org