comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/WINFOArtifact.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 c85a84d60f68
children c62ff9e72cea
comparison
equal deleted inserted replaced
1764:87c82499b98f 1765:5d8b3880a553
224 224
225 inBackground.setTextContent(message.getMessage()); 225 inBackground.setTextContent(message.getMessage());
226 } 226 }
227 227
228 228
229 /**
230 * Append output mode nodes to a document.
231 */
229 protected void appendOutputModes( 232 protected void appendOutputModes(
230 Document doc, 233 Document doc,
231 Element outs, 234 Element outs,
232 CallContext context, 235 CallContext context,
233 String uuid) 236 String uuid)
251 if (list == null || list.size() == 0) { 254 if (list == null || list.size() == 0) {
252 logger.debug("-> No output modes for this state."); 255 logger.debug("-> No output modes for this state.");
253 continue; 256 continue;
254 } 257 }
255 258
256 List<Facet> fs = facets.get(stateId); 259 if (facets == null || facets.size() == 0) {
257 if (fs == null || fs.size() == 0) {
258 logger.debug("No facets for previous state found."); 260 logger.debug("No facets for previous state found.");
259 continue; 261 continue;
260 } 262 }
261 263
262 logger.debug("Found " + fs.size() + " facets in previous states."); 264 logger.debug("Found " + facets.size() + " facets in previous states.");
263 265
264 List<Output> generated = generateOutputs(list, fs); 266 List<Output> generated = generateOutputs(list, facets);
265 267
266 ProtocolUtils.appendOutputModes(doc, outs, generated); 268 ProtocolUtils.appendOutputModes(doc, outs, generated);
267 } 269 }
268 270
269 try { 271 try {
272 List<Output> list = cur.getOutputs(); 274 List<Output> list = cur.getOutputs();
273 if (list != null && list.size() > 0) { 275 if (list != null && list.size() > 0) {
274 logger.debug( 276 logger.debug(
275 "Append output modes for current state: " + cur.getID()); 277 "Append output modes for current state: " + cur.getID());
276 278
277 List<Facet> fs = facets.get(cur.getID()); 279 if (facets != null && facets.size() > 0) {
278 if (fs != null && fs.size() > 0) { 280 List<Output> generated = generateOutputs(list, facets);
279 List<Output> generated = generateOutputs(list, fs); 281
280 282 logger.debug("Found " + facets.size() + " current facets.");
281 logger.debug("Found " + fs.size() + " current facets.");
282 if (!generated.isEmpty()) { 283 if (!generated.isEmpty()) {
283 ProtocolUtils.appendOutputModes( 284 ProtocolUtils.appendOutputModes(
284 doc, outs, generated); 285 doc, outs, generated);
285 } 286 }
286 } 287 }
287 else { 288 else {
288 logger.debug("No facets found for the current state."); 289 logger.debug("No facets found for the current state.");
289 } 290 }
290
291 } 291 }
292 } 292 }
293 } 293 }
294 catch (IllegalArgumentException iae) { 294 catch (IllegalArgumentException iae) {
295 // state is not valid, so we do not append its outputs. 295 // state is not valid, so we do not append its outputs.

http://dive4elements.wald.intevation.org