Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/collections/AttributeWriter.java @ 1993:85132c9edd64
Make reuse of the old CollectionAttribute during the describe() operation of FLYSArtifactCollection - remove the old facets only.
flys-artifacts/trunk@3430 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Fri, 16 Dec 2011 09:19:11 +0000 |
parents | 9c0acaa369ea |
children | f114c0d55d19 |
comparison
equal
deleted
inserted
replaced
1992:e1c9f28e2675 | 1993:85132c9edd64 |
---|---|
59 * @param newAttr "New" (eventually re-read in its original, unchanged | 59 * @param newAttr "New" (eventually re-read in its original, unchanged |
60 * form) outputs. | 60 * form) outputs. |
61 */ | 61 */ |
62 public AttributeWriter( | 62 public AttributeWriter( |
63 ArtifactDatabase db, | 63 ArtifactDatabase db, |
64 CollectionAttribute attribute, | |
64 Map<String, Output> oldAttr, | 65 Map<String, Output> oldAttr, |
65 List<Facet> oldFacets, | 66 List<Facet> oldFacets, |
66 Map<String, Output> newAttr, | 67 Map<String, Output> newAttr, |
67 List<Facet> newFacets, | 68 List<Facet> newFacets, |
68 Map<String, List<String>> matrix) | 69 Map<String, List<String>> matrix) |
69 { | 70 { |
70 this.db = db; | 71 this.db = db; |
72 this.attribute = attribute; | |
71 this.oldAttr = oldAttr; | 73 this.oldAttr = oldAttr; |
72 this.newAttr = newAttr; | 74 this.newAttr = newAttr; |
73 this.oldFacets = oldFacets; | 75 this.oldFacets = oldFacets; |
74 this.newFacets = newFacets; | 76 this.newFacets = newFacets; |
75 this.compatibilities = matrix; | 77 this.compatibilities = matrix; |
86 * are recorded here and not in the new set). | 88 * are recorded here and not in the new set). |
87 * | 89 * |
88 * @return document with merged outputs as described. | 90 * @return document with merged outputs as described. |
89 */ | 91 */ |
90 protected CollectionAttribute write() { | 92 protected CollectionAttribute write() { |
91 attribute = new CollectionAttribute(); | |
92 | |
93 for (String outName: newAttr.keySet()) { | 93 for (String outName: newAttr.keySet()) { |
94 Output a = newAttr.get(outName); | 94 Output a = newAttr.get(outName); |
95 | 95 attribute.clearFacets(outName); |
96 attribute.addOutput(a.getName(), a); | |
97 | 96 |
98 writeOutput(a.getName(), newFacets, oldFacets); | 97 writeOutput(a.getName(), newFacets, oldFacets); |
99 } | 98 } |
100 | 99 |
101 return attribute; | 100 return attribute; |