public ModuleBreaking (StorageObject theStorage)
{
- if (theLog == null) theLog = Logfile.getInstance(this.getClass().getName());
+ if (theLog == null) theLog = Logfile.getInstance(MirConfig.getProp("Home") + MirConfig.getProp("Module.Breaking.Logfile"));
if (theStorage == null) theLog.printWarning("ModuleBreaking -- StorageObject was null!");
this.theStorage = theStorage;
}
// Methoden
-
+ public SimpleList getBreakingNews() {
+ SimpleList returnList = null;
+ try {
+ EntityList entityList = getByWhereClause(null,"webdb_create desc",0,5);
+ returnList = HTMLTemplateProcessor.makeSimpleList(entityList);
+ }
+ catch (Exception ex) {
+ theLog.printWarning("--getBreakingNews(): could not fetch Breaking News" + ex.toString());
+ }
+ return returnList;
+ }
}
SimpleList mediaList;
SimpleHash contentHash;
- // get the imclinks
- /** @todo don't we want to preproduce and include the imcs? */
- entityList = linksImcsModule.getByWhereClause("", "sortpriority, title", -1);
- SimpleList imcList = HTMLTemplateProcessor.makeSimpleList(entityList);
- EntityList theParentList = linksImcsModule.getByWhereClause("to_parent_id=NULL", "sortpriority, title", -1);
- SimpleList parentList = HTMLTemplateProcessor.makeSimpleList(theParentList);
-
// get the newswire
/** @todo same with newswire, should be fetched via moduleContent.getNewswire() */
whereClause="is_published=true AND to_article_type = 1";
theLog.printDebugInfo("############### got startitems");
- // get the breaking news
- // only the first 5
- // todo: the number of breaking_news items have to be configurable
- ModuleBreaking breakingModule = new ModuleBreaking(DatabaseBreaking.getInstance());
- entityList = breakingModule.getByWhereClause(null,"webdb_create desc",0,5);
- SimpleList breakingList = HTMLTemplateProcessor.makeSimpleList(entityList);
- theLog.printDebugInfo("############### got breaking");
+
// get the articles
/** @todo moduleContent.getArticles() */
// Additional Information
startPageModel = new SimpleHash();
- startPageModel.put("breakingnews", breakingList);
+
+ // breaking news
+ ModuleBreaking breakingModule = new ModuleBreaking(DatabaseBreaking.getInstance());
+ startPageModel.put("breakingnews", breakingModule.getBreakingNews());
+
startPageModel.put("topics", topicsModule.getTopicsList());
- startPageModel.put("imclist", imcList);
- startPageModel.put("parentlist", parentList);
startPageModel.put("newswire", newsWireList);
startPageModel.put("startspecial", startItemList);
startPageModel.put("features", featureList);