changeset 7178:12248d9eb326 3.0.16

Only filter the facets for unbound outs
author Andre Heinecke <aheinecke@intevation.de>
date Thu, 26 Sep 2013 19:15:17 +0200
parents 336d7690b38c
children 6d4578fe4696
files artifacts/src/main/java/org/dive4elements/river/artifacts/D4EArtifact.java artifacts/src/main/java/org/dive4elements/river/collections/AttributeWriter.java
diffstat 2 files changed, 15 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/D4EArtifact.java	Thu Sep 26 19:14:37 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/D4EArtifact.java	Thu Sep 26 19:15:17 2013 +0200
@@ -1305,8 +1305,9 @@
 
         for (Output out: list) {
             log.debug("check facets for output: " + out.getName());
+            String outName = out.getName();
             Output o = new DefaultOutput(
-                out.getName(),
+                outName,
                 out.getDescription(),
                 out.getMimeType(),
                 out.getType());
@@ -1323,7 +1324,14 @@
             for (Facet f: fs) {
                 String type = f.getName();
 
-                if (outTypes.contains(type)) {
+                /* Match the facets to the output configuration.
+                 * This is only done when we are not already bound to an out.
+                 * If we are bound we come from the datacage so the user has
+                 * explicitly requested our nice and shiny facets. And who
+                 * are we to deny them to him. */
+                if (outTypes.contains(type) ||
+                        (boundToOut != null &&
+                         boundToOut.equals(outName))) {
                     if (debug) {
                         log.debug("Add facet " + f);
                     }
--- a/artifacts/src/main/java/org/dive4elements/river/collections/AttributeWriter.java	Thu Sep 26 19:14:37 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/collections/AttributeWriter.java	Thu Sep 26 19:15:17 2013 +0200
@@ -195,7 +195,11 @@
                 logger.debug("Try to add Facet: " + facet.getName());
             }
 
-            if (!compatibleFacets.contains(facet.getName())) {
+            String bondage = facet.getBoundToOut();
+            if (bondage != null && bondage.equals(outputName)) {
+                logger.debug("Adding bound facet regardless of compatibility: " +
+                    facet.getName());
+            } else if (!compatibleFacets.contains(facet.getName())) {
                 logger.debug("Have incompatible facet, skip: " + facet.getName());
                 continue;
             } else if (facet.getBoundToOut() != null &&

http://dive4elements.wald.intevation.org