From b010c03d412a2f4cfe6d211b7af3b1695f094c8b Mon Sep 17 00:00:00 2001 From: rk Date: Tue, 5 Feb 2002 13:17:11 +0000 Subject: [PATCH] moving breaking / imclist to modules --- source/mircoders/module/ModuleBreaking.java | 14 ++++++++++++-- source/mircoders/producer/ProducerStartPage.java | 23 ++++++----------------- 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/source/mircoders/module/ModuleBreaking.java b/source/mircoders/module/ModuleBreaking.java index e00d295c..edb8abae 100755 --- a/source/mircoders/module/ModuleBreaking.java +++ b/source/mircoders/module/ModuleBreaking.java @@ -34,11 +34,21 @@ public class ModuleBreaking extends AbstractModule 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; + } } diff --git a/source/mircoders/producer/ProducerStartPage.java b/source/mircoders/producer/ProducerStartPage.java index 3ea6e418..e9423e47 100755 --- a/source/mircoders/producer/ProducerStartPage.java +++ b/source/mircoders/producer/ProducerStartPage.java @@ -82,13 +82,6 @@ public class ProducerStartPage extends Producer { 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"; @@ -226,13 +219,7 @@ public class ProducerStartPage extends Producer { 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() */ @@ -309,10 +296,12 @@ public class ProducerStartPage extends Producer { // 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); -- 2.11.0