String tinyIcon;
String iconAlt;
+ /** @todo couldn't this be in Producer.java and should be named addAdditional,
+ * and should be thrown away afterwards? */
public void setAdditional(String key, TemplateModel value) {
additional.put(key,value);
}
}
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.Topics: 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);
} else {
topicsEntityList = topicsModule.getByWhereClause(where,"title", -1);
}
- SimpleList topicsList = HTMLTemplateProcessor.makeSimpleList(topicsEntityList);
for(int i=0; i < topicsEntityList.size(); i++){
whereClause += currentContent.getId();
whereClauseSpecial += currentContent.getId();
- setAdditional("topic",HTMLTemplateProcessor.makeSimpleHash(currentTopic));
+ setAdditional("topic",currentTopic);
first = false;
}
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());
}
//set the list of topics
- setAdditional("topicslist",topicsList);
+ setAdditional("topicslist",topicsEntityList);
handleIt(htmlout,user,force);
+ pageCount++;
}
} catch (Exception e) {
+ theLog.printError("ProducerTopics: problem with start special media: "
+ +e.toString()+" <font color=\"red\">skipping</font>");
logHTML(htmlout,"ProducerTopics: problem with topic id: "
+currentTopic.getId()+ "<font color=\"red\">skipping</font>");
}
}
+ logHTMLFinish(htmlout, "Topics", pageCount, startTime, System.currentTimeMillis());
}
public static void main(String argv[]){