comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/AnnotationArtifact.java @ 1765:5d8b3880a553

Do not store association of states to facets, let artifacts keep facets in a pure list. flys-artifacts/trunk@3083 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Wed, 26 Oct 2011 12:23:47 +0000
parents 19d0eb41e923
children c62ff9e72cea
comparison
equal deleted inserted replaced
1764:87c82499b98f 1765:5d8b3880a553
61 DefaultState state = (DefaultState) getCurrentState(context); 61 DefaultState state = (DefaultState) getCurrentState(context);
62 state.computeInit(this, hash(), context, meta, fs); 62 state.computeInit(this, hash(), context, meta, fs);
63 63
64 if (!fs.isEmpty()) { 64 if (!fs.isEmpty()) {
65 logger.debug("Facets to add in AnnotationsArtifact.initialize ."); 65 logger.debug("Facets to add in AnnotationsArtifact.initialize .");
66 facets.put(getCurrentStateId(), fs); 66 facets.addAll(fs);
67 } 67 }
68 else { 68 else {
69 logger.debug("No facets to add in AnnotationsArtifact.initialize ."); 69 logger.debug("No facets to add in AnnotationsArtifact.initialize .");
70 } 70 }
71 } 71 }
171 if (list == null || list.size() == 0) { 171 if (list == null || list.size() == 0) {
172 logger.debug("-> No output modes for this state."); 172 logger.debug("-> No output modes for this state.");
173 continue; 173 continue;
174 } 174 }
175 175
176 List<Facet> fs = facets.get(stateId); 176 if (facets == null || facets.size() == 0) {
177 if (fs == null || fs.size() == 0) {
178 logger.debug("No facets found."); 177 logger.debug("No facets found.");
179 continue; 178 continue;
180 } 179 }
181 180
182 logger.debug("Found " + fs.size() + " facets in previous states."); 181 logger.debug("Found " + facets.size() + " facets in previous states.");
183 182
184 List<Output> generated = generateOutputs(list, fs); 183 List<Output> generated = generateOutputs(list, facets);
185 184
186 ProtocolUtils.appendOutputModes(doc, outs, generated); 185 ProtocolUtils.appendOutputModes(doc, outs, generated);
187 } 186 }
188 187
189 try { 188 try {
192 List<Output> list = cur.getOutputs(); 191 List<Output> list = cur.getOutputs();
193 if (list != null && list.size() > 0) { 192 if (list != null && list.size() > 0) {
194 logger.debug( 193 logger.debug(
195 "Append output modes for state: " + cur.getID()); 194 "Append output modes for state: " + cur.getID());
196 195
197 List<Facet> fs = facets.get(cur.getID()); 196 if (facets != null && facets.size() > 0) {
198 if (fs != null && fs.size() > 0) { 197 List<Output> generated = generateOutputs(list, facets);
199 List<Output> generated = generateOutputs(list, fs); 198
200 199 logger.debug("Found " + facets.size() + " current facets.");
201 logger.debug("Found " + fs.size() + " current facets.");
202 if (!generated.isEmpty()) { 200 if (!generated.isEmpty()) {
203 ProtocolUtils.appendOutputModes( 201 ProtocolUtils.appendOutputModes(
204 doc, outs, generated); 202 doc, outs, generated);
205 } 203 }
206 else{ 204 else{

http://dive4elements.wald.intevation.org