changeset 6050:06450ef553cc

DC: fixed dc:group
author Sascha L. Teichmann <teichmann@intevation.de>
date Tue, 21 May 2013 16:30:14 +0200 (2013-05-21)
parents 2f50591aacc7
children e56f0d618f96
files artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/templating/Builder.java
diffstat 1 files changed, 9 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/templating/Builder.java	Fri May 17 18:21:53 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/templating/Builder.java	Tue May 21 16:30:14 2013 +0200
@@ -349,7 +349,6 @@
             String     expr,
             String     type
         ) {
-
             List<Object []> rows = rd.getRows();
             String [] columns = rd.getColumnLabels();
 
@@ -422,25 +421,20 @@
             Map<Object, ResultData> groups =
                 createGroupedResultData(orig, expr, type);
 
-            String [] columns = orig.getColumnLabels();
+            boolean debug = log.isDebugEnabled();
 
             try {
                 for (Map.Entry<Object, ResultData> entry: groups.entrySet()) {
-                    ResultData rd = entry.getValue();
+                    Object     key = entry.getKey();
+                    ResultData rd  = entry.getValue();
                     pair.setB(rd);
-                    groupExprStack.push(entry.getKey());
+                    groupExprStack.push(key);
+                    if (debug) {
+                        log.debug("group key: " + key);
+                    }
                     try {
-                        for (Object [] row: rd.getRows()) {
-                            frames.enter();
-                            try {
-                                frames.put(columns, row);
-                                for (int i = 0; i < S; ++i) {
-                                    build(parent, subs.item(i));
-                                }
-                            }
-                            finally {
-                                frames.leave();
-                            }
+                        for (int i = 0; i < S; ++i) {
+                            build(parent, subs.item(i));
                         }
                     }
                     finally {
@@ -478,8 +472,6 @@
 
             Object [] result = new Object[1];
 
-            log.debug("Foo");
-
             if (frames.getStore(container, result)) {
                 Object c = result[0];
                 if (c instanceof Object []) {

http://dive4elements.wald.intevation.org