At last the EntityBatchingProducerNode is working. This will replace the old
[mir.git] / source / mir / generator / FreemarkerGenerator.java
index d4778ff..4329ee0 100755 (executable)
@@ -48,6 +48,8 @@ public class FreemarkerGenerator implements Generator {
            return makeMapAdapter((Map) anObject);
          else if (anObject instanceof Iterator)
            return makeIteratorAdapter((Iterator) anObject);
+         else if (anObject instanceof List)
+           return makeIteratorAdapter(((List) anObject).iterator());
          else
            throw new TemplateModelException("Unadaptable class: " + anObject.getClass().getName());
        }
@@ -77,8 +79,10 @@ public class FreemarkerGenerator implements Generator {
            if (!valuesCache.containsKey(aKey)) {
              Object value = map.get(aKey);
 
-             if (value == null)
-               throw new TemplateModelException("MapAdapter: no key "+aKey+" available");
+//    ML: this unfortunately doesn't work, because the entity doesn't seem to store
+//        fields with null values
+//    if (value == null && !map.containsKey(aKey))
+//          throw new TemplateModelException("MapAdapter: no key "+aKey+" available");
 
              valuesCache.put(aKey, makeAdapter(value));
            }