diff flys-artifacts/src/main/java/de/intevation/flys/collections/FLYSArtifactCollection.java @ 388:cc6840cbe503

Introduced an export output target on collection level that enables collections to be exported. flys-artifacts/trunk@1809 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 03 May 2011 16:26:35 +0000
parents fc3cf0ef777e
children a67748ad4d61
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/collections/FLYSArtifactCollection.java	Tue May 03 13:23:00 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/collections/FLYSArtifactCollection.java	Tue May 03 16:26:35 2011 +0000
@@ -134,6 +134,9 @@
         String type = XMLUtils.xpathString(
             format, XPATH_OUT_TYPE, ArtifactNamespaceContext.INSTANCE);
 
+        log.debug("Output name = " + name);
+        log.debug("Output type = " + type);
+
         OutGenerator generator = getOutGenerator(context, name, type);
         if (generator == null) {
             log.error("There is no generator specified for output: " + type);
@@ -145,7 +148,7 @@
         generator.init(format, out, context);
 
         try {
-            doOut(generator, name, getAttribute(context, name), context);
+            doOut(generator, name, type, getAttribute(context, name), context);
         }
         catch (ArtifactDatabaseException adbe) {
             log.error(adbe, adbe);
@@ -165,6 +168,7 @@
     protected void doOut(
         OutGenerator generator,
         String       outName,
+        String       facet,
         Document     attributes,
         CallContext  context)
     throws IOException
@@ -195,6 +199,10 @@
 
                 String facetName = theme.getName();
 
+                if (outName.equals("export") && !facetName.equals(facet)) {
+                    continue;
+                }
+
                 generator.doOut(
                     getArtifact(art, context),
                     facetName,
@@ -604,7 +612,7 @@
             return null;
         }
 
-        Class clazz = generators.get(type);
+        Class clazz = generators.get(name);
 
         try {
             return clazz != null ? (OutGenerator) clazz.newInstance() : null;

http://dive4elements.wald.intevation.org