changeset 6400:25230bc3137c

Datacage: Store the official lines of an artifact under the key 'official-lines'. Can be treated with <dc:container-context>.
author Sascha L. Teichmann <teichmann@intevation.de>
date Fri, 21 Jun 2013 23:35:01 +0200
parents 10fe6758dfb0
children f369d69e3488
files artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/Recommendations.java
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/Recommendations.java	Fri Jun 21 20:02:15 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/Recommendations.java	Fri Jun 21 23:35:01 2013 +0200
@@ -45,6 +45,7 @@
 
 import org.dive4elements.river.artifacts.datacage.templating.Builder;
 import org.dive4elements.river.artifacts.datacage.templating.BuilderPool;
+import org.dive4elements.river.artifacts.model.OfficialLineFinder;
 
 
 /**
@@ -136,7 +137,7 @@
     }
 
     protected static void artifactToParameters(
-        D4EArtifact        artifact,
+        D4EArtifact         artifact,
         Map<String, Object> parameters
     ) {
         parameters.put("CURRENT-STATE-ID", artifact.getCurrentStateId());
@@ -150,6 +151,10 @@
             String key = sd.getName().replace('.', '-').toUpperCase();
             parameters.put(key, value);
         }
+
+        // XXX: THIS IS THE HACK TO BRING THE OFFICIAL LINES INTO THE DATACAGE!
+        parameters.put(
+            "OFFICIAL-LINES", OfficialLineFinder.findOfficialLines(artifact));
     }
 
     /**
@@ -171,7 +176,7 @@
      * @param extraParameters parameters (typicall example: 'recommended')
      */
     public void  recommend(
-        D4EArtifact        artifact,
+        D4EArtifact         artifact,
         String              userId,
         String []           outs,
         Map<String, Object> extraParameters,

http://dive4elements.wald.intevation.org