changeset 1171:a3108f0a2fe7

Bugfix: merge facets for the Collection's attribute only if the new and old facet's name and owner artifact are equal. flys-artifacts/trunk@2736 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Wed, 14 Sep 2011 10:04:19 +0000
parents 1e1ef8b750db
children 23eb122c8ec1
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/collections/AttributeWriter.java
diffstat 2 files changed, 17 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Wed Sep 14 09:36:28 2011 +0000
+++ b/flys-artifacts/ChangeLog	Wed Sep 14 10:04:19 2011 +0000
@@ -1,3 +1,8 @@
+2011-09-14  Ingo Weinzierl <ingo@intevation.de>
+
+	* src/main/java/de/intevation/flys/collections/AttributeWriter.java: Merge
+	  facets only if their name AND their owner artifact are equal.
+
 2011-09-14  Felix Wolfsteller <felix.wolfsteller@intevation.de>
 
  Partial Fix flys/issue304 (3) (Baseline).
--- a/flys-artifacts/src/main/java/de/intevation/flys/collections/AttributeWriter.java	Wed Sep 14 09:36:28 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/collections/AttributeWriter.java	Wed Sep 14 10:04:19 2011 +0000
@@ -67,8 +67,8 @@
         Document       doc,
         Node           outs,
         ElementCreator cr,
-        Output         a,
-        Output         b)
+        Output         a, /* new output */
+        Output         b) /* old output */
     {
         Element output = cr.create("output");
         cr.addAttr(output, "name", a.getName());
@@ -90,8 +90,8 @@
         Document       doc,
         ElementCreator cr,
         Element        output,
-        List<Facet>    a,
-        List<Facet>    b)
+        List<Facet>    a, /* new facets */
+        List<Facet>    b) /* old facets */
     {
         int num = a.size();
 
@@ -113,8 +113,8 @@
         Document       doc,
         ElementCreator cr,
         Element        output,
-        ManagedFacet   a,
-        List<Facet>    list)
+        ManagedFacet   a,    /* new facets */
+        List<Facet>    list) /* old facets */
     {
         String nameA = a.getName() + a.getIndex();
 
@@ -127,6 +127,12 @@
             String nameB = facet.getName() + facet.getIndex();
 
             if (nameA.equals(nameB)) {
+                ManagedFacet b = (ManagedFacet) facet;
+
+                if (!b.getArtifact().equals(a.getArtifact())) {
+                    continue;
+                }
+
                 Node n = facet.toXML(doc);
 
                 if (n != null) {

http://dive4elements.wald.intevation.org