Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/datacage/templating/Builder.java @ 5525:fcf28185ca30
Datacage: Removed 'filter' attribute from <dc:for-each> because there is the <dc:filter> element now.
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Mon, 01 Apr 2013 13:50:56 +0200 |
parents | eeac800eb4cd |
children | ac48ab9e1715 |
comparison
equal
deleted
inserted
replaced
5524:3badc699af0e | 5525:fcf28185ca30 |
---|---|
327 throws SQLException | 327 throws SQLException |
328 { | 328 { |
329 log.debug("dc:for-each"); | 329 log.debug("dc:for-each"); |
330 | 330 |
331 if (connectionsStack.isEmpty()) { | 331 if (connectionsStack.isEmpty()) { |
332 log.warn("dc:for-each without having results"); | 332 log.debug("dc:for-each without having results"); |
333 return; | 333 return; |
334 } | |
335 | |
336 String filter = current.getAttribute("filter"); | |
337 | |
338 if ((filter = filter.trim()).length() == 0) { | |
339 filter = null; | |
340 } | 334 } |
341 | 335 |
342 NodeList subs = current.getChildNodes(); | 336 NodeList subs = current.getChildNodes(); |
343 int S = subs.getLength(); | 337 int S = subs.getLength(); |
344 | 338 |
349 | 343 |
350 Pair<Builder.NamedConnection, ResultData> pair = | 344 Pair<Builder.NamedConnection, ResultData> pair = |
351 connectionsStack.peek(); | 345 connectionsStack.peek(); |
352 | 346 |
353 ResultData rd = pair.getB(); | 347 ResultData rd = pair.getB(); |
354 ResultData orig = rd; | 348 |
355 | 349 String [] columns = rd.getColumnLabels(); |
356 if (filter != null) { | 350 |
357 ResultData rdCopy = createFilteredResultData(rd, filter); | 351 for (Object [] row: rd.getRows()) { |
358 pair.setB(rdCopy); | 352 frames.enter(); |
359 rd = rdCopy; | 353 try { |
360 } | 354 frames.put(columns, row); |
361 try { | 355 for (int i = 0; i < S; ++i) { |
362 String [] columns = rd.getColumnLabels(); | 356 build(parent, subs.item(i)); |
363 | 357 } |
364 for (Object [] row: rd.getRows()) { | 358 } |
365 frames.enter(); | 359 finally { |
366 try { | 360 frames.leave(); |
367 frames.put(columns, row); | 361 } |
368 for (int i = 0; i < S; ++i) { | |
369 build(parent, subs.item(i)); | |
370 } | |
371 } | |
372 finally { | |
373 frames.leave(); | |
374 } | |
375 } | |
376 } | |
377 finally { | |
378 if (filter != null) { | |
379 pair.setB(orig); | |
380 } | |
381 } | 362 } |
382 } | 363 } |
383 | 364 |
384 /** | 365 /** |
385 * Create element. | 366 * Create element. |