From: rk Date: Tue, 5 Feb 2002 02:13:38 +0000 (+0000) Subject: *** empty log message *** X-Git-Url: http://erislabs.net/gitweb/?a=commitdiff_plain;h=1794458f5d676e2087c2ee7f997c57069bfc67a0;hp=437f8798aa2476952d898dd133907390eb1396b4;p=mir.git *** empty log message *** --- diff --git a/source/Mir.java b/source/Mir.java index afa63cd3..3ba6738b 100755 --- a/source/Mir.java +++ b/source/Mir.java @@ -167,7 +167,7 @@ public class Mir extends AbstractServlet catch (ClassNotFoundException e) { handleError(res, res.getWriter(), "ServletModule" + moduleName + " not found."); } catch (IllegalArgumentException e) { handleError( res,res.getWriter(), "ServletModule" + moduleName + " not found."); } catch (ServletModuleUserException e) { - handleUserError(res,res.getWriter(), e.getMsg()); + handleUserError(res,res.getWriter(), e.getMsg()); } catch (ServletModuleException e){ handleError(res,res.getWriter(), "ServletException in Module ServletModule" + moduleName + " -- " + e.toString()); } catch (IllegalAccessException e){ @@ -243,7 +243,7 @@ public class Mir extends AbstractServlet // merge with logged in user and messages SimpleHash mergeData = new SimpleHash(); mergeData.put("session",sessionUrl); - mergeData.put("login_user", HTMLTemplateProcessor.makeSimpleHash(userEntity)); + mergeData.put("login_user", userEntity); if (messageModule == null) messageModule = new ModuleMessage(DatabaseMessages.getInstance()); mergeData.put("messages", HTMLTemplateProcessor.makeSimpleList(messageModule.getByWhereClause(null, "webdb_create desc",0,10))); HTMLTemplateProcessor.process(res,getLanguage(req,session)+"/"+startTemplate, mergeData,out); diff --git a/source/mir/storage/Database.java b/source/mir/storage/Database.java index f6de0973..5b379231 100755 --- a/source/mir/storage/Database.java +++ b/source/mir/storage/Database.java @@ -47,7 +47,7 @@ public class Database implements StorageObject { private int defaultLimit; protected DatabaseAdaptor theAdaptor; protected Logfile theLog; - protected Connection con; + //protected Connection con; /** * Kontruktor bekommt den Filenamen des Konfigurationsfiles übergeben. @@ -761,7 +761,7 @@ public class Database implements StorageObject { * @param hasNullValue Wenn true wird eine leerer Eintrag fuer die Popups erzeugt. * @return SimpleList Gibt freemarker.template.SimpleList zurueck. */ - public SimpleList getPopupData (String name, boolean hasNullValue) + public SimpleList getPopupData (String name, boolean hasNullValue) throws StorageObjectException { return getPopupData(name, hasNullValue, null); } @@ -1108,7 +1108,7 @@ public class Database implements StorageObject { theLog.printError(wo); throw new StorageObjectException(wo); } - + } /** diff --git a/source/mircoders/entity/EntityBreaking.java b/source/mircoders/entity/EntityBreaking.java index 86882a89..216d3e92 100755 --- a/source/mircoders/entity/EntityBreaking.java +++ b/source/mircoders/entity/EntityBreaking.java @@ -30,10 +30,4 @@ public class EntityBreaking extends Entity instances--; super.finalize(); } - - /* @deprecated */ - public HashMap getValues() { - return super.getValues(); - } - } diff --git a/source/mircoders/module/ModuleTopics.java b/source/mircoders/module/ModuleTopics.java index 546473f2..2cdf2e75 100755 --- a/source/mircoders/module/ModuleTopics.java +++ b/source/mircoders/module/ModuleTopics.java @@ -43,4 +43,24 @@ public class ModuleTopics extends AbstractModule } } + + /** + * Method getTopicList + * + * @return SimpleList of all Topics sorted by title + * + */ + public SimpleList getTopicsList() + { + SimpleList returnList=null; + try { + returnList=HTMLTemplateProcessor.makeSimpleList(getByWhereClause("","title",-1)); + } + catch (Exception e) + { + theLog.printWarning("--getTopicsList: topics could not be fetched"); + } + return returnList; + } + } diff --git a/source/mircoders/producer/ProducerContent.java b/source/mircoders/producer/ProducerContent.java index c7cf7bc4..2d4ca519 100755 --- a/source/mircoders/producer/ProducerContent.java +++ b/source/mircoders/producer/ProducerContent.java @@ -148,6 +148,7 @@ public class ProducerContent extends Producer { //create the freemarker-model SimpleHash mergeData = HTMLTemplateProcessor.makeSimpleHash(currentContentValues); + /** @todo all the following should take place in EntityContent */ // get the uploaded media EntityList currentMediaList = DatabaseContentToMedia.getInstance().getUploadedMedia(currentContent); if (currentMediaList!=null && currentMediaList.getCount()>=1) { @@ -177,6 +178,10 @@ public class ProducerContent extends Producer { // get the comments for the article // and html-ize them + + /** @todo currently this doesn't work + * all this should be moved to Entity, and the parsed description should + * be delivered via entity.get("description_parsed") */ SimpleList commentList = currentContent.getComments(); if(commentList.isEmpty()==false){ while(commentList.hasNext()){ @@ -199,8 +204,8 @@ public class ProducerContent extends Producer { logHTML(htmlout, "Producer.Content ERROR while producing content ID: " + currentContent.getId()+",skipping it :: "+e.toString()); theLog.printError("Producer.Content ERROR while producing content ID: " + currentContent.getId() +",skipping it :: "+e.toString()); } - - + + }//for if (batchEntityList.hasNextBatch()){ diff --git a/source/mircoders/producer/ProducerNavigation.java b/source/mircoders/producer/ProducerNavigation.java index aab7d08f..c612502c 100755 --- a/source/mircoders/producer/ProducerNavigation.java +++ b/source/mircoders/producer/ProducerNavigation.java @@ -42,10 +42,6 @@ public class ProducerNavigation extends Producer { EntityList entityList; SimpleHash naviPageModel; - // get the topiclist - entityList = topicsModule.getByWhereClause("","title",-1); - SimpleList topicList = HTMLTemplateProcessor.makeSimpleList(entityList); - // get the imclinks entityList = linksImcsModule.getByWhereClause("", "sortpriority, title", -1); SimpleList imcList = HTMLTemplateProcessor.makeSimpleList(entityList); @@ -55,7 +51,7 @@ public class ProducerNavigation extends Producer { // put the informations into the navipagemodel naviPageModel = new SimpleHash(); - naviPageModel.put("topics", topicList); + naviPageModel.put("topics", topicsModule.getTopicsList()); naviPageModel.put("imclist", imcList); naviPageModel.put("parentlist", parentList); diff --git a/source/mircoders/producer/ProducerOpenPosting.java b/source/mircoders/producer/ProducerOpenPosting.java index 62049169..0ea292ae 100755 --- a/source/mircoders/producer/ProducerOpenPosting.java +++ b/source/mircoders/producer/ProducerOpenPosting.java @@ -32,11 +32,9 @@ public class ProducerOpenPosting extends ProducerList { orderBy="date desc, webdb_create desc"; fileDesc="open"; - EntityList topicsEntityList = topicsModule.getByWhereClause("","title", -1); - SimpleList topicsList = HTMLTemplateProcessor.makeSimpleList(topicsEntityList); SimpleScalar title = new SimpleScalar(); title.setValue("Open-Posting"); - setAdditional("topicslist",topicsList); + setAdditional("topicslist",topicsModule.getTopicsList()); setAdditional("title",title); handleIt(htmlout,user,force); diff --git a/source/mircoders/producer/ProducerStartPage.java b/source/mircoders/producer/ProducerStartPage.java index c8d7ca12..ba10a4b9 100755 --- a/source/mircoders/producer/ProducerStartPage.java +++ b/source/mircoders/producer/ProducerStartPage.java @@ -82,12 +82,6 @@ public class ProducerStartPage extends Producer { SimpleList mediaList; SimpleHash contentHash; - // get the topiclist - /** @todo should be fetched via ModuleTopics in one rush / no sql! - * something like topicsModule.getTopicsList returning the SimpleList */ - entityList = topicsModule.getByWhereClause("","title",-1); - SimpleList topicList = HTMLTemplateProcessor.makeSimpleList(entityList); - // get the imclinks /** @todo don't we want to preproduce and include the imcs? */ entityList = linksImcsModule.getByWhereClause("", "sortpriority, title", -1); @@ -316,7 +310,7 @@ public class ProducerStartPage extends Producer { // Additional Information startPageModel = new SimpleHash(); startPageModel.put("breakingnews", breakingList); - startPageModel.put("topics", topicList); + startPageModel.put("topics", topicsModule.getTopicsList()); startPageModel.put("imclist", imcList); startPageModel.put("parentlist", parentList); startPageModel.put("newswire", newsWireList); diff --git a/source/mircoders/servlet/ServletModuleContent.java b/source/mircoders/servlet/ServletModuleContent.java index a438ad8a..ce22cc16 100755 --- a/source/mircoders/servlet/ServletModuleContent.java +++ b/source/mircoders/servlet/ServletModuleContent.java @@ -167,7 +167,7 @@ public class ServletModuleContent extends ServletModule throw new ServletModuleException("language/schwerpunkt list could not be fetched.: " +e.toString()); } - mergeData.put("login_user", HTMLTemplateProcessor.makeSimpleHash(user)); + mergeData.put("login_user", user); deliver(req, res, mergeData, templateObjektString); } @@ -359,7 +359,7 @@ public class ServletModuleContent extends ServletModule SimpleHash mergeData = HTMLTemplateProcessor.makeSimpleHash(entContent); EntityList topicToContent = DatabaseContentToTopics.getInstance().getTopics(entContent); if (topicToContent!=null && topicToContent.size()>0){ - theLog.printDebugInfo("topicanzahl: "+topicToContent.size()); + //theLog.printDebugInfo("topicanzahl: "+topicToContent.size()); Entity topics = null; SimpleList topicList = new SimpleList(); for(int i=0;i