/**
* logging
*/
+
+ public void logHTMLFinish(PrintWriter htmlout,String moduleName, int pageCount, long startTime, long endTime) {
+ // timing and message to browser
+ long overall = endTime - startTime;
+ long pagesPerMinute=0; float perMinute = overall/60000;
+ if (perMinute >0) pagesPerMinute = (long) (pageCount / perMinute);
+
+ logHTML(htmlout, "Producer."+moduleName+" finished producing: " +
+ overall + " ms for "+ pageCount+" Pages = " +pagesPerMinute + " pages/min");
+ logHTML(htmlout, "Back to <a href=\""+actionRoot+"\">Admin-Startage</a>");
+ }
+
public void logHTML(PrintWriter out, String s) {
_print(out, s, true);
}
pageCount++;
}//for
}
- // timing and message to browser
- long overall = System.currentTimeMillis() - startTime;
- 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");
- logHTML(htmlout, "Back to <a href=\""+actionRoot+"\">Admin-Startage</a>");
+
+
+
+ logHTMLFinish(htmlout, "Content", pageCount, startTime, System.currentTimeMillis());
/** @todo why no syncing here? */
}
public void handle(PrintWriter htmlout, EntityUsers user, boolean force, boolean sync)
- throws StorageObjectException, ModuleException {
+ throws StorageObjectException, ModuleException
+ {
+ long startTime = System.currentTimeMillis();
+ int pageCount =0;
+ logHTML(htmlout, "Producer.List: started");
- orderBy="date desc, webdb_create desc";
+ /** @todo should be done in static */
listTemplate = MirConfig.getProp("Producer.TopicList.Template");
+ orderBy="date desc, webdb_create desc";
EntityList topicsEntityList;
if(where==null){
topicsEntityList = topicsModule.getByWhereClause("","title", -1);
setAdditional("topicslist",topicsEntityList);
handleIt(htmlout,user,force);
+ pageCount++;
}
} catch (Exception e) {
theLog.printError("ProducerTopics: problem with start special media: "
+currentTopic.getId()+ "<font color=\"red\">skipping</font>");
}
}
+ logHTMLFinish(htmlout, "Topics", pageCount, startTime, System.currentTimeMillis());
}
public static void main(String argv[]){