diff flys-artifacts/src/main/java/de/intevation/flys/collections/CollectionAttribute.java @ 1979:a7c437c9547e

Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing. flys-artifacts/trunk@3409 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Wed, 14 Dec 2011 10:20:56 +0000
parents 0b466bd4ab24
children 85132c9edd64
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/collections/CollectionAttribute.java	Tue Dec 13 13:37:18 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/collections/CollectionAttribute.java	Wed Dec 14 10:20:56 2011 +0000
@@ -20,6 +20,7 @@
 import de.intevation.artifactdatabase.state.DefaultOutput;
 import de.intevation.artifactdatabase.state.Facet;
 import de.intevation.artifactdatabase.state.Output;
+import de.intevation.artifactdatabase.state.Settings;
 
 
 public class CollectionAttribute {
@@ -196,12 +197,23 @@
         Element outputEl = ec.create("output");
         ec.addAttr(outputEl, "name", name);
 
+        appendSettings(outputEl, output.getSettings());
         appendFacets(outputEl, output.getFacets());
 
         root.appendChild(outputEl);
     }
 
 
+    protected void appendSettings(Element root, Settings settings) {
+        if (settings == null) {
+            logger.warn("Tried to append Settings, but Settings is empty!");
+            return;
+        }
+
+        settings.toXML(root);
+    }
+
+
     protected void appendFacets(Element root, List<Facet> facets) {
         if (facets == null || facets.size() == 0) {
             logger.warn("Tried to append 0 Facets.");

http://dive4elements.wald.intevation.org