Mercurial > dive4elements > river
comparison 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 |
comparison
equal
deleted
inserted
replaced
1978:4c10a4cb978f | 1979:a7c437c9547e |
---|---|
18 import de.intevation.artifacts.common.utils.XMLUtils.ElementCreator; | 18 import de.intevation.artifacts.common.utils.XMLUtils.ElementCreator; |
19 | 19 |
20 import de.intevation.artifactdatabase.state.DefaultOutput; | 20 import de.intevation.artifactdatabase.state.DefaultOutput; |
21 import de.intevation.artifactdatabase.state.Facet; | 21 import de.intevation.artifactdatabase.state.Facet; |
22 import de.intevation.artifactdatabase.state.Output; | 22 import de.intevation.artifactdatabase.state.Output; |
23 import de.intevation.artifactdatabase.state.Settings; | |
23 | 24 |
24 | 25 |
25 public class CollectionAttribute { | 26 public class CollectionAttribute { |
26 | 27 |
27 private static final Logger logger = | 28 private static final Logger logger = |
194 logger.debug("Append Output Element for '" + name + "'"); | 195 logger.debug("Append Output Element for '" + name + "'"); |
195 | 196 |
196 Element outputEl = ec.create("output"); | 197 Element outputEl = ec.create("output"); |
197 ec.addAttr(outputEl, "name", name); | 198 ec.addAttr(outputEl, "name", name); |
198 | 199 |
200 appendSettings(outputEl, output.getSettings()); | |
199 appendFacets(outputEl, output.getFacets()); | 201 appendFacets(outputEl, output.getFacets()); |
200 | 202 |
201 root.appendChild(outputEl); | 203 root.appendChild(outputEl); |
204 } | |
205 | |
206 | |
207 protected void appendSettings(Element root, Settings settings) { | |
208 if (settings == null) { | |
209 logger.warn("Tried to append Settings, but Settings is empty!"); | |
210 return; | |
211 } | |
212 | |
213 settings.toXML(root); | |
202 } | 214 } |
203 | 215 |
204 | 216 |
205 protected void appendFacets(Element root, List<Facet> facets) { | 217 protected void appendFacets(Element root, List<Facet> facets) { |
206 if (facets == null || facets.size() == 0) { | 218 if (facets == null || facets.size() == 0) { |