comparison flys-artifacts/src/main/java/de/intevation/flys/collections/AttributeWriter.java @ 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
parents 16161de47662
children 9c565eb46f06
comparison
equal deleted inserted replaced
352:ed3325a0232a 353:8378683fa07a
44 ElementCreator cr = new ElementCreator( 44 ElementCreator cr = new ElementCreator(
45 doc, 45 doc,
46 ArtifactNamespaceContext.NAMESPACE_URI, 46 ArtifactNamespaceContext.NAMESPACE_URI,
47 ArtifactNamespaceContext.NAMESPACE_PREFIX); 47 ArtifactNamespaceContext.NAMESPACE_PREFIX);
48 48
49 Element outs = cr.create("outputs");
50 doc.appendChild(outs);
51
49 Iterator<String> iter = newAttr.keySet().iterator(); 52 Iterator<String> iter = newAttr.keySet().iterator();
50 53
51 while (iter.hasNext()) { 54 while (iter.hasNext()) {
52 String outName = iter.next(); 55 String outName = iter.next();
53 56
54 Output a = newAttr.get(outName); 57 Output a = newAttr.get(outName);
55 Output b = oldAttr.get(outName); 58 Output b = oldAttr.get(outName);
56 59
57 writeOutput(doc, cr, a, b); 60 writeOutput(doc, outs, cr, a, b);
58 } 61 }
59 62
60 return doc; 63 return doc;
61 } 64 }
62 65
63 66
64 protected void writeOutput( 67 protected void writeOutput(
65 Document doc, 68 Document doc,
69 Node outs,
66 ElementCreator cr, 70 ElementCreator cr,
67 Output a, 71 Output a,
68 Output b) 72 Output b)
69 { 73 {
70 Element output = cr.create("output"); 74 Element output = cr.create("output");
71 cr.addAttr(output, "name", a.getName()); 75 cr.addAttr(output, "name", a.getName());
72 76
73 doc.appendChild(output); 77 outs.appendChild(output);
74 78
75 List<Facet> facetsA = a.getFacets(); 79 List<Facet> facetsA = a.getFacets();
76 List<Facet> facetsB = null; 80 List<Facet> facetsB = null;
77 81
78 if (b != null) { 82 if (b != null) {

http://dive4elements.wald.intevation.org