producer topic debug
authorrk <rk>
Mon, 18 Feb 2002 11:15:19 +0000 (11:15 +0000)
committerrk <rk>
Mon, 18 Feb 2002 11:15:19 +0000 (11:15 +0000)
source/mircoders/producer/Producer.java
source/mircoders/producer/ProducerContent.java
source/mircoders/producer/ProducerTopics.java

index 50fc258..ad27fee 100755 (executable)
@@ -18,7 +18,9 @@ abstract public class Producer {
   protected static String   producerStorageRoot = MirConfig.getProp("Producer.StorageRoot");
   protected static String   producerProductionHost = MirConfig.getProp("Producer.ProductionHost");
   protected static String   producerOpenAction = MirConfig.getProp("Producer.OpenAction");;
-  protected static String   actionRoot = null;
+
+  /** @todo same as in HTMLTemplateProcessor, this should be dynamically set */
+  protected static String   actionRoot = MirConfig.getProp("RootUri") + "/servlet/Mir";
 
   protected static Logfile theLog = Logfile.getInstance(MirConfig.getProp("Home") + "/" + MirConfig.getProp("Producer.Logfile"));
   protected static ModuleTopics         topicsModule;
@@ -32,6 +34,7 @@ abstract public class Producer {
   static {
                // init
     try {
+
       contentModule = new ModuleContent(DatabaseContent.getInstance());
       topicsModule = new ModuleTopics(DatabaseTopics.getInstance());
       linksImcsModule = new ModuleLinksImcs(DatabaseLinksImcs.getInstance());
@@ -39,8 +42,7 @@ abstract public class Producer {
       featureModule = new ModuleFeature(DatabaseFeature.getInstance());
       imageModule = new ModuleImages(DatabaseImages.getInstance());
       uploadedMediaModule = new ModuleUploadedMedia(DatabaseImages.getInstance());
-      /** @todo same as in HTMLTemplateProcessor, this should be dynamically set */
-      actionRoot = producerDocRoot + "/servlet/Mir";
+
     }
     catch(StorageObjectException e)
     {
index 56766c1..0e3953f 100755 (executable)
@@ -119,8 +119,8 @@ public class ProducerContent extends Producer {
     }
     // timing and message to browser
     long overall = System.currentTimeMillis() - startTime;
-    long pagesPerMinute=0, perMinute = overall/60000;
-    if (perMinute >0) pagesPerMinute = pageCount / perMinute;
+    long pagesPerMinute=0; float perMinute = overall/60000;
+    if (perMinute >0) pagesPerMinute = (long) (pageCount / perMinute);
 
     logHTML(htmlout, "Producer.Content finished producing: " +
             overall + " ms for "+ pageCount+" Pages = " +pagesPerMinute + " pages/min");
index fbf85a3..6133a17 100755 (executable)
@@ -57,7 +57,6 @@ public class ProducerTopics extends ProducerList {
     } else {
       topicsEntityList = topicsModule.getByWhereClause(where,"title", -1);
     }
-    SimpleList topicsList = HTMLTemplateProcessor.makeSimpleList(topicsEntityList);
 
     for(int i=0; i < topicsEntityList.size(); i++){
 
@@ -81,7 +80,7 @@ public class ProducerTopics extends ProducerList {
             whereClause += currentContent.getId();
             whereClauseSpecial += currentContent.getId();
 
-            setAdditional("topic",HTMLTemplateProcessor.makeSimpleHash(currentTopic));
+            setAdditional("topic",currentTopic);
 
             first = false;
           }
@@ -104,8 +103,7 @@ public class ProducerTopics extends ProducerList {
         if(entityList != null && entityList.size()==1){
           currentContent = (EntityContent)entityList.elementAt(0);
           try {
-              SimpleHash specialHash = HTMLTemplateProcessor.makeSimpleHash(currentContent);
-              setAdditional("special",specialHash);
+              setAdditional("special",currentContent);
           } catch (Exception e) {
             theLog.printError("ProducerTopics: problem with start special media: "+currentContent.getId()+" "+e.toString()+" <font color=\"red\">skipping</font>");
             logHTML(htmlout,"ProducerTopics: problem with start special media: "+currentContent.getId()+" "+e.toString());
@@ -113,7 +111,7 @@ public class ProducerTopics extends ProducerList {
         }
 
         //set the list of topics
-        setAdditional("topicslist",topicsList);
+        setAdditional("topicslist",topicsEntityList);
 
         handleIt(htmlout,user,force);
       }