At last the EntityBatchingProducerNode is working. This will replace the old
[mir.git] / source / mircoders / producer / ProducerList.java
index 37968f2..5533a37 100755 (executable)
@@ -2,12 +2,14 @@ package mircoders.producer;
 
 import java.io.*;
 import java.lang.*;
+import java.lang.reflect.*;
 import java.util.*;
 import java.sql.*;
 
 import freemarker.template.*;
 
 import mir.misc.*;
+import mir.media.*;
 import mir.storage.*;
 import mir.module.*;
 import mir.entity.*;
@@ -26,11 +28,14 @@ abstract public class ProducerList extends Producer {
   public String fileDesc;
   protected HashMap additional = new HashMap();
 
+
+
   public void handle(PrintWriter htmlout, EntityUsers user, boolean sync, boolean force)
     throws StorageObjectException, ModuleException {
     handleIt(htmlout,user,force);
   }
 
+  /** @todo this should return the number of pages produced! */
   public void handleIt(PrintWriter htmlout, EntityUsers user, boolean force)
     throws StorageObjectException, ModuleException {
 
@@ -42,7 +47,7 @@ abstract public class ProducerList extends Producer {
     String              currentMediaId;
     EntityContent       currentContent;
     EntityList          list;
-    EntityGruppen       userEntity=null;
+    EntityUsers         userEntity=null;
     SimpleHash          imageHash = new SimpleHash();
     int size = 0;
     int listSize = 0;
@@ -83,35 +88,6 @@ abstract public class ProducerList extends Producer {
       //now produce the pages
       if (list!=null || force==true) {
         SimpleHash mergeData = HTMLTemplateProcessor.makeSimpleHashWithEntitylistInfos(list);
-        //first we try to get the images
-        
-        if(list!=null){
-          for (int k=0; k < list.size();k++) {
-            currentContent = (EntityContent)list.elementAt(k);
-            //images to content
-            EntityList currentMedia = DatabaseContentToMedia.getInstance().getImages(currentContent);
-            if (currentMedia!=null && currentMedia.getCount()>=1) {
-              SimpleList mediaList = HTMLTemplateProcessor.makeSimpleList(currentMedia);
-              mergeData.put("to_media", mediaList);
-            }
-            //content to html
-            if(currentContent.getValue("is_html").equals("0")){
-              String temp = (String)currentContent.getValue("description");
-              if(temp!=null && temp.length()>0){
-                temp = StringUtil.createHTML(temp);
-                temp = StringUtil.decodeHTMLinTags(temp);
-                currentContent.setValueForProperty("description",temp);
-              }
-            } else {
-              String temp = (String)currentContent.getValue("description");
-              if(temp!=null && temp.length()>0){
-                temp = StringUtil.decodeHTMLinTags(temp);
-                currentContent.setValueForProperty("description",temp);
-              }
-            }
-          }
-        }
-        SimpleList itemList = HTMLTemplateProcessor.makeSimpleList(list);
         //process hashmap additional and add to mergedata
         if (additional != null) {
           Set set = additional.keySet();
@@ -156,5 +132,8 @@ abstract public class ProducerList extends Producer {
     logHTML(htmlout, "Producer.List finished: " + sessionConnectTime + " ms.");
   } //end handle
 
-  abstract public void setAdditional(String key, TemplateModel value);
+  public void setAdditional(String key, TemplateModel value) {
+    additional.put(key,value);
+  }
+
 }