diff artifacts/src/main/java/org/dive4elements/river/exports/OutputHelper.java @ 8392:994995baa32b

Only the master-artifact should decide about injected CURRENT_KM et al. (and removed dependend obsolete class).
author Sascha L. Teichmann <teichmann@intevation.de>
date Wed, 08 Oct 2014 11:49:07 +0200
parents 4d99606a844e
children 5e38e2924c07
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/exports/OutputHelper.java	Wed Oct 08 11:02:16 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/OutputHelper.java	Wed Oct 08 11:49:07 2014 +0200
@@ -50,9 +50,11 @@
     private static Logger log = Logger.getLogger(OutputHelper.class);
 
     protected String identifier;
+    private  D4EArtifact masterArtifact;
 
-    public OutputHelper(String identifier) {
+    public OutputHelper(String identifier, D4EArtifact masterArtifact) {
         this.identifier = identifier;
+        this.masterArtifact = masterArtifact;
     }
 
     private static List<ContextInjector> getContextInjectors(CallContext context, String out) {
@@ -104,6 +106,12 @@
 
         List<ContextInjector> cis = getContextInjectors(context, outName);
 
+        if (cis != null) {
+            for (ContextInjector ci: cis) {
+                ci.injectContext(context, masterArtifact, request);
+            }
+        }
+
         try {
             for (int i = 0, T = themeList.size(); i < T; i++) {
                 ManagedFacet theme = themeList.get(i);
@@ -131,23 +139,16 @@
                     continue;
                 }
 
-                if (cis != null) {
-                    for (ContextInjector ci: cis) {
-                        ci.injectContext(
-                            context, dataProviders.get(i).getArtifact(), request);
-                    }
-                }
-
                 generator.doOut(
-                        dataProviders.get(i),
-                        getFacetThemeFromAttribute(
-                            art,
-                            outName,
-                            facetName,
-                            theme.getDescription(),
-                            theme.getIndex(),
-                            context),
-                        theme.getActive() == 1);
+                    dataProviders.get(i),
+                    getFacetThemeFromAttribute(
+                        art,
+                        outName,
+                        facetName,
+                        theme.getDescription(),
+                        theme.getIndex(),
+                        context),
+                    theme.getActive() == 1);
             }
         }
         catch (ArtifactDatabaseException ade) {

http://dive4elements.wald.intevation.org