*** empty log message ***
authorrk <rk>
Tue, 5 Feb 2002 02:13:38 +0000 (02:13 +0000)
committerrk <rk>
Tue, 5 Feb 2002 02:13:38 +0000 (02:13 +0000)
source/Mir.java
source/mir/storage/Database.java
source/mircoders/entity/EntityBreaking.java
source/mircoders/module/ModuleTopics.java
source/mircoders/producer/ProducerContent.java
source/mircoders/producer/ProducerNavigation.java
source/mircoders/producer/ProducerOpenPosting.java
source/mircoders/producer/ProducerStartPage.java
source/mircoders/servlet/ServletModuleContent.java
source/mircoders/servlet/ServletModuleLinksImcs.java
source/mircoders/servlet/ServletModuleUsers.java

index afa63cd..3ba6738 100755 (executable)
@@ -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);
index f6de097..5b37923 100755 (executable)
@@ -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);
     }
-        
+
   }
 
   /**
index 86882a8..216d3e9 100755 (executable)
@@ -30,10 +30,4 @@ public class EntityBreaking extends Entity
     instances--;
     super.finalize();
   }
-
-  /* @deprecated */
-  public HashMap getValues() {
-    return super.getValues();
-  }
-
 }
index 546473f..2cdf2e7 100755 (executable)
@@ -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;
+    }
+
 }
index c7cf7bc..2d4ca51 100755 (executable)
@@ -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()){
index aab7d08..c612502 100755 (executable)
@@ -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);
 
index 6204916..0ea292a 100755 (executable)
@@ -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);
index c8d7ca1..ba10a4b 100755 (executable)
@@ -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);
index a438ad8..ce22cc1 100755 (executable)
@@ -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<topicToContent.size();i++){
@@ -395,7 +395,7 @@ public class ServletModuleContent extends ServletModule
       if ((offsetParam = req.getParameter("offset"))!=null) mergeData.put("offset", offsetParam);
       if ((whereParam = req.getParameter("where"))!=null) mergeData.put("where", whereParam);
       if ((orderParam = req.getParameter("order"))!=null) mergeData.put("order", orderParam);
-      mergeData.put("login_user", HTMLTemplateProcessor.makeSimpleHash(_getUser(req)));
+      mergeData.put("login_user", _getUser(req));
       deliver(req, res, mergeData, templateObjektString);
     } catch (Exception e) {
       throw new ServletModuleException(e.toString());
index 90bc5ce..2a5b051 100755 (executable)
@@ -37,7 +37,7 @@ public class ServletModuleLinksImcs extends ServletModule
 
 
   private ServletModuleLinksImcs() {
-    theLog = Logfile.getInstance(this.getClass().getName());
+    theLog = Logfile.getInstance(MirConfig.getProp("Home") + MirConfig.getProp("ServletModule.LinksImcs.Logfile"));
     templateListString = MirConfig.getProp("ServletModule.LinksImcs.ListTemplate");
     templateObjektString = MirConfig.getProp("ServletModule.LinksImcs.ObjektTemplate");
     templateConfirmString = MirConfig.getProp("ServletModule.LinksImcs.ConfirmTemplate");
@@ -174,7 +174,7 @@ public class ServletModuleLinksImcs extends ServletModule
 
       modelRoot.put("parentlist",HTMLTemplateProcessor.makeSimpleList(parentList));
       modelRoot.put("languagelist",HTMLTemplateProcessor.makeSimpleList(theLanguageList));
-      modelRoot.put("entity", HTMLTemplateProcessor.makeSimpleHash(mainModule.getById(idParam)));
+      modelRoot.put("entity", mainModule.getById(idParam));
       deliver(req, res, modelRoot, templateObjektString);
 
     } catch(ModuleException e) {
index 35fcbb9..f0ede6f 100755 (executable)
@@ -33,7 +33,7 @@ public class ServletModuleUsers extends mir.servlet.ServletModule
        public static ServletModule getInstance() { return instance; }
 
        private ServletModuleUsers() {
-       theLog = Logfile.getInstance(this.getClass().getName());
+       theLog = Logfile.getInstance(MirConfig.getProp("Home") + MirConfig.getProp("ServletModule.Users.Logfile"));
        templateListString = MirConfig.getProp("ServletModule.Users.ListTemplate");
        templateObjektString = MirConfig.getProp("ServletModule.Users.ObjektTemplate");
        templateConfirmString = MirConfig.getProp("ServletModule.Users.ConfirmTemplate");
@@ -51,8 +51,7 @@ public class ServletModuleUsers extends mir.servlet.ServletModule
                if (idParam == null) throw new ServletModuleException("Falscher Aufruf: (id) nicht angegeben");
                 try {
                        //theLog.printInfo("Showing User with id: " + idParam);
-                       SimpleHash mergeData =  HTMLTemplateProcessor.makeSimpleHash(mainModule.getById(idParam));
-                       deliver(req, res, mergeData, templateObjektString);
+                       deliver(req, res, mainModule.getById(idParam), templateObjektString);
                }
                catch (ModuleException e) { throw new ServletModuleException(e.toString());}
        }
@@ -74,8 +73,7 @@ public class ServletModuleUsers extends mir.servlet.ServletModule
                try {
                        HashMap withValues = getIntersectingValues(req, mainModule.getStorageObject());
                        String id = mainModule.add(withValues);
-                       SimpleHash mergeData = HTMLTemplateProcessor.makeSimpleHash(mainModule.getById(id));
-                       deliver(req, res, mergeData, templateObjektString);
+                       deliver(req, res, mainModule.getById(id), templateObjektString);
                }
                catch (Exception e) { throw new ServletModuleException(e.toString());}
        }