changeset 353:8378683fa07a

Bugfix: The outputs of a Collection's attribute document are stored in an outputs node now instead of being stored toplevel in the document. flys-artifacts/trunk@1760 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Thu, 28 Apr 2011 11:13:06 +0000 (2011-04-28)
parents ed3325a0232a
children 542f280d72c3
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/collections/AttributeWriter.java flys-artifacts/src/main/java/de/intevation/flys/collections/FLYSArtifactCollection.java
diffstat 3 files changed, 18 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Thu Apr 28 11:08:34 2011 +0000
+++ b/flys-artifacts/ChangeLog	Thu Apr 28 11:13:06 2011 +0000
@@ -1,3 +1,14 @@
+2011-04-28  Ingo Weinzierl <ingo@intevation.de>
+
+	* src/main/java/de/intevation/flys/collections/AttributeWriter.java:
+	  Bugfix: Introduced a <art:outputs> node in the attribute document of a
+	  Collection that contains further <art:output> nodes - instead of having
+	  multiple <art:output> nodes at toplevel of the document.
+
+	* src/main/java/de/intevation/flys/collections/FLYSArtifactCollection.java:
+	  Adapted the XPath to retrieve the outputs in the attribute document of a
+	  Collection.
+
 2011-04-28	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
 
 	* contrib/visualize-transitions.xsl: Added to create a 
--- a/flys-artifacts/src/main/java/de/intevation/flys/collections/AttributeWriter.java	Thu Apr 28 11:08:34 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/collections/AttributeWriter.java	Thu Apr 28 11:13:06 2011 +0000
@@ -46,6 +46,9 @@
             ArtifactNamespaceContext.NAMESPACE_URI,
             ArtifactNamespaceContext.NAMESPACE_PREFIX);
 
+        Element outs = cr.create("outputs");
+        doc.appendChild(outs);
+
         Iterator<String> iter = newAttr.keySet().iterator();
 
         while (iter.hasNext()) {
@@ -54,7 +57,7 @@
             Output a = newAttr.get(outName);
             Output b = oldAttr.get(outName);
 
-            writeOutput(doc, cr, a, b);
+            writeOutput(doc, outs, cr, a, b);
         }
 
         return doc;
@@ -63,6 +66,7 @@
 
     protected void writeOutput(
         Document       doc,
+        Node           outs,
         ElementCreator cr,
         Output         a,
         Output         b)
@@ -70,7 +74,7 @@
         Element output = cr.create("output");
         cr.addAttr(output, "name", a.getName());
 
-        doc.appendChild(output);
+        outs.appendChild(output);
 
         List<Facet> facetsA = a.getFacets();
         List<Facet> facetsB = null;
--- a/flys-artifacts/src/main/java/de/intevation/flys/collections/FLYSArtifactCollection.java	Thu Apr 28 11:08:34 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/collections/FLYSArtifactCollection.java	Thu Apr 28 11:13:06 2011 +0000
@@ -258,7 +258,7 @@
 
         Node out = (Node) XMLUtils.xpath(
             attr,
-            "art:output[@name='" + output + "']",
+            "art:outputs/art:output[@name='" + output + "']",
             XPathConstants.NODE,
             ArtifactNamespaceContext.INSTANCE);
 

http://dive4elements.wald.intevation.org