Ok, big merge. here's the new xml-config stuff in action. There's a few
authormh <mh>
Sun, 2 Dec 2001 19:30:02 +0000 (19:30 +0000)
committermh <mh>
Sun, 2 Dec 2001 19:30:02 +0000 (19:30 +0000)
things that need further fine tuning. Like finding a nice way to have common
config items like home be shared.

definitely still at a beta stage. I figure commiting now will get the ball rolling again.

Please not that right now the config is only initialized in OpenMir.. so
OpenMir must be run first!! Also MirConfig is still used!! Most config items
have not been converted yet! only the stuff under mir/storage is 100% converted!

The rest is just tedious stuff mainly...

comments questions, flames..

48 files changed:
build.xml
doc/INSTALL.mir
etc/web.xml
source/OpenMir.java
source/mir/entity/AbstractEntity.java
source/mir/entity/EntityList.java
source/mir/misc/FileUtil.java
source/mir/misc/HTMLTemplateProcessor.java
source/mir/misc/Logfile.java
source/mir/misc/StringUtil.java
source/mir/servlet/AbstractServlet.java
source/mir/servlet/ServletModuleDispatch.java
source/mir/storage/Database.java
source/mir/storage/DatabaseAdaptorPostgresql.java
source/mir/storage/DatabaseConfig.java [new file with mode: 0755]
source/mir/xml/XmlConfigurator.java
source/mir/xml/XmlMatch.java
source/mircoders/input/XmlInputParser.java
source/mircoders/module/ModuleBreaking.java
source/mircoders/module/ModuleComment.java
source/mircoders/module/ModuleContent.java
source/mircoders/module/ModuleFeature.java
source/mircoders/module/ModuleImages.java
source/mircoders/module/ModuleLanguage.java
source/mircoders/module/ModuleLinksImcs.java
source/mircoders/module/ModuleMediafolder.java
source/mircoders/module/ModuleMessage.java
source/mircoders/module/ModuleSchwerpunkt.java
source/mircoders/module/ModuleTopics.java
source/mircoders/module/ModuleUploadedMedia.java
source/mircoders/module/ModuleUsers.java
source/mircoders/producer/Producer.java
source/mircoders/producer/ProducerAll.java
source/mircoders/producer/ProducerContent.java
source/mircoders/producer/ProducerStartPage.java
source/mircoders/servlet/ServletModuleBreaking.java
source/mircoders/servlet/ServletModuleComment.java
source/mircoders/servlet/ServletModuleContent.java
source/mircoders/servlet/ServletModuleImages.java
source/mircoders/servlet/ServletModuleLanguage.java
source/mircoders/servlet/ServletModuleLinksImcs.java
source/mircoders/servlet/ServletModuleMediafolder.java
source/mircoders/servlet/ServletModuleMessage.java
source/mircoders/servlet/ServletModuleOpenIndy.java
source/mircoders/servlet/ServletModuleProducer.java
source/mircoders/servlet/ServletModuleSchwerpunkt.java
source/mircoders/servlet/ServletModuleTopics.java
source/mircoders/servlet/ServletModuleUsers.java

index 6f7e15d..83bbe4c 100755 (executable)
--- a/build.xml
+++ b/build.xml
@@ -38,6 +38,7 @@
   <property name="dist.src"       value="${app.name}.jar"/>
   <property name="dist.war"       value="${app.name}.war"/>
   <property name="javadoc.home"   value="${deploy.home}/javadoc"/>
+  <property name="build.compiler"   value="jikes"/>
 
 
 <!-- The "prepare" target is used to construct the deployment home
     </copy>
     <copy   todir="${deploy.home}">
       <fileset dir="source" includes="**/content-types.properties"/>
+      <fileset dir="source" includes="**/server.xml"/>
     </copy>
   </target>
 
index e2174ca..4e255ad 100755 (executable)
@@ -28,6 +28,10 @@ CVS CHECKOUT:
 
 now customize config.properties for your needs.
 
+    modify etc/web.xml to change the xml-config
+    parameter to point to where your server.xml file is
+    (in ../Mir i.e /path/to/Mir/server.xml)
+
 
 3. configure the build.sh file with java_home
         cp build.sh-dist build.sh 
@@ -139,6 +143,21 @@ If you can't access PostgreSQL after this for any reason, try to change
 "password" in /etc/postgresql/pg_hba.conf into "trust". This should disable
 any authentication method and make the database accessible again.
 
+15. configure apache's mod_mime to recognize .m3u and .pls files:
+
+The web server (of the media host) must recognize the .m3u and .pls file
+extensions and send the proper "audio/x-mpegurl" and "audio/x-scpls" mime-types
+respectively.  If the web server is apache, it's easy, just add:
+           *
+audio/x-mpegurl                 m3u
+audio/x-scpl                    pls
+              *
+to the file pointed to by the "TypesConfig" command in your apache config file.
+Or add and equivalent AddType command to your httpd.conf.  Of course this
+assumes that the mod_mime is loaded.
+                   *
+If the web server is not apache, then your on your own.
+
 that's it :)
 
 now the admin-application is accesable via:  
index 2e6565d..f5f55a2 100755 (executable)
             <param-name>Config</param-name>
             <param-value>config</param-value>
         </init-param>
+        <init-param>
+            <param-name>xml-config</param-name>
+            <param-value>/home/heckmann/mir/Mir/server.xml</param-value>
+        </init-param>
 
     </servlet>
 
             <param-name>Config</param-name>
             <param-value>config</param-value>
         </init-param>
+        <init-param>
+            <param-name>xml-config</param-name>
+            <param-value>/home/heckmann/mir/Mir/server.xml</param-value>
+        </init-param>
 
     </servlet>
 
index 37b4d8a..7ade219 100755 (executable)
@@ -9,6 +9,7 @@ import java.sql.*;
 import freemarker.template.*;
 
 import mir.misc.*;
+import mir.xml.XmlConfigurator;
 import mir.servlet.*;
 
 import mircoders.servlet.*;
@@ -35,6 +36,32 @@ public class OpenMir extends AbstractServlet {
     doPost(req,res);
   }
 
+  public void init() throws ServletException {
+    try {
+      XmlConfigurator xmlXonfigurator = XmlConfigurator.getInstance();
+      xmlXonfigurator.addRequiredTag("/mir/class:mir.storage.DatabaseConfig/property:username");
+      xmlXonfigurator.addRequiredTag("/mir/class:mir.storage.DatabaseConfig/property:password");
+      xmlXonfigurator.addComesFirstTag("/mir/class:mir.storage.DatabaseConfig/property:password");
+      xmlXonfigurator.addComesFirstTag("/mir/class:mir.storage.DatabaseConfig/property:username");
+      xmlXonfigurator.addComesFirstTag("/mir/class:mir.storage.DatabaseConfig/property:host");
+      xmlXonfigurator.addComesFirstTag("/mir/class:mir.storage.DatabaseConfig/property:adaptor");
+      xmlXonfigurator.addComesFirstTag("/mir/class:mir.storage.DatabaseConfig/property:limit");
+      xmlXonfigurator.addComesFirstTag("/mir/class:mir.storage.DatabaseConfig/property:poolMax");
+      xmlXonfigurator.addComesFirstTag("/mir/class:mir.storage.DatabaseConfig/property:poolMin");
+      xmlXonfigurator.addComesFirstTag("/mir/class:mir.storage.DatabaseConfig/property:poolResetTime");
+      xmlXonfigurator.addComesFirstTag("/mir/class:mir.storage.DatabaseConfig/property:poolLog");
+      xmlXonfigurator.configure(new File(getInitParameter("xml-config")));
+      System.err.println("INIT");
+      /*try {
+        MirXmlParser xmlParser = new MirXmlParser();
+        xmlParser.parse("/home/heckmann/server.xml");*/
+    } catch (Exception e) {
+      e.printStackTrace();
+      throw new UnavailableException ("Error loading Config file: "+e.toString(), 0);
+    } 
+    System.err.println("DONE INIT");
+  }
+
   public void doPost(HttpServletRequest req, HttpServletResponse res)
     throws ServletException, IOException {
 
index aed7e85..632fc39 100755 (executable)
@@ -29,13 +29,13 @@ public class AbstractEntity implements Entity
   protected static Logfile    theLog;
   protected ArrayList         streamedInput=null;
   private static int instances = 0;
-    static {
-      theLog = Logfile.getInstance(MirConfig.getProp("Home") + MirConfig.getProp("Entity.Logfile"));
-    }
 
     public AbstractEntity() {
+      theLog = Logfile.getInstance(this.getClass().getName());
       this.changed = false;
       instances++;
+      Integer i = new Integer(instances);
+      System.err.println("New abstract entity instance: "+i.toString());
     }
 
   /**
index 64fcac4..303917d 100755 (executable)
@@ -33,7 +33,7 @@ public class EntityList {
                public EntityList(){
                        this.theEntityArrayList = new ArrayList();
                        if (theLog == null)
-                        this.theLog = Logfile.getInstance(MirConfig.getProp("Home") + MirConfig.getProp("Entity.Logfile"));
+                        this.theLog = Logfile.getInstance(this.getClass().getName());
                }
 
        /**
index 199935c..5a68e31 100755 (executable)
@@ -30,6 +30,7 @@ public final class FileUtil {
 
     static {
       System.setProperty("content.types.user.table", MirConfig.getProp("Home")+"content-types.properties");
+      System.err.println("DDD: "+MirConfig.getProp("Home")+"content-types.properties");                             
       fileNameMap = sun.net.www.MimeTable.loadTable();
       producerStorageRoot = MirConfig.getProp("Producer.StorageRoot");
     }
@@ -116,8 +117,9 @@ public final class FileUtil {
     public static String guessContentTypeFromName(String fname) {
         String contentType = null;
                     
+        System.err.println("NAME: "+fname);                             
         contentType = getFileNameMap().getContentTypeFor(fname);
-                                    
+        System.err.println("TYPE: "+contentType);                             
         return contentType;
     }
 
index bbbe722..ef15a58 100755 (executable)
@@ -43,8 +43,8 @@ public final class HTMLTemplateProcessor {
     templateCache = new FileTemplateCache(templateDir);
     templateCache.setLoadingPolicy(templateCache.LOAD_ON_DEMAND);
     templateCache.startAutoUpdate();
-    theLog = Logfile.getInstance(MirConfig.getPropWithHome("HTMLTemplateProcessor.Logfile"));
     docRoot = MirConfig.getProp("RootUri");
+    theLog=Logfile.getInstance("HTMLTemplateProcessor");
     //the quick hack is back in effect as it was more broken than ever before
     // -mh
     // sorry: nadir back in town, i have to debug the mirbase.jar in the
@@ -67,7 +67,7 @@ public final class HTMLTemplateProcessor {
   /**
    * empty private constructor, to avoid instantiation
    */
-  private HTMLTemplateProcessor () }
+  private HTMLTemplateProcessor ()  {}
 
 
   // process-methods to merge different datastructures
index 2589e98..1775ab4 100755 (executable)
@@ -23,6 +23,11 @@ public final class Logfile {
                private RandomAccessFile raf;
                private String fileName;
 
+        //config var, required since it's "null"
+        //TODO: should have a defaul value once I figure out 
+        //how to disperse home dir. -mh
+        private static String logDir="/tmp/";
+
        /**
         * lineSeparator ermitteln und Repository anlegen
         */
@@ -41,6 +46,7 @@ public final class Logfile {
         * @return Logfile
         */
                public static Logfile getInstance(String fileName) {
+            //TODO: tokenize the CallerClass name (fileName)
                        Logfile returnLogfile = null;
                        System.err.println(fileName);
                        if (fileName != null) {
@@ -49,6 +55,8 @@ public final class Logfile {
                                } else {
                                        returnLogfile = new Logfile(fileName);
                                        instanceRepository.put(fileName, returnLogfile);
+                    Integer i = new Integer(instanceRepository.size());
+                    System.err.println("SIZZE: "+i.toString());
                                }
                        } else {
                                System.err.println("Fehler bei Instantiierung von Logfile");
@@ -60,10 +68,11 @@ public final class Logfile {
         * Privater Konstruktor
         * @param   String fileName
         */
-               private Logfile(String fileName){
-                       this.fileName = fileName;
+               private Logfile(String file){
+                       this.fileName = logDir+file;
+                       System.err.println("FILENAME "+fileName+"DD");
                        try {
-                               File f = new File(fileName);
+                               File f = new File(this.fileName);
                                File dir = new File(f.getParent());
                                dir.mkdirs();
                                raf = new RandomAccessFile(fileName, "rw");
@@ -72,6 +81,13 @@ public final class Logfile {
                        }
                }
 
+        //TODO: should have a defaul value once I figure out 
+        //how to disperse home dir. -mh
+        public static void setLogDir(String dir) {
+            logDir=StringUtil.addSeparator(dir);
+                       System.err.println("set logDir "+logDir);
+        }
+
        /**
         * Private Methode, um eine Zeile auszugeben
         *
index 49004c1..e226c06 100755 (executable)
@@ -225,6 +225,24 @@ public final class StringUtil {
     return buf.toString();
   }
 
+  /**
+   * Ersetzt in String <code>s</code> das Regexp <code>pattern</code> durch <code>substitute</code>
+   * @param s
+   * @param pattern
+   * @param substitute
+   * @return String mit den Ersetzungen
+   */
+  public static String regexpReplace(String haystack, String pattern, String substitute) {
+    try {
+      RE regex = new RE(pattern);
+      return regex.substituteAll(haystack,substitute);
+    } catch(REException ex){
+      return null;
+    }
+  }
+
+
 
   /**
    * Fügt einen Separator an den Pfad an
index 2761055..53e75c6 100755 (executable)
@@ -38,7 +38,7 @@ public abstract class AbstractServlet extends HttpServlet {
     // init config
     MirConfig.initConfig(RealPath, RootUri, Name, getInitParameter("Config"));
 
-    theLog = Logfile.getInstance(MirConfig.getPropWithHome(Name+".Logfile"));
+    theLog = Logfile.getInstance(this.getClass().getName());
     theLog.printInfo(Name + " started.");
     theLog.printInfo("Path is: " + MirConfig.getProp("Home"));
     theLog.printInfo("Root URI is: " + MirConfig.getProp("RootUri"));
index a8efff3..de5d86d 100755 (executable)
@@ -19,7 +19,7 @@ public final class ServletModuleDispatch {
   static Logfile theLog;
 
   static {
-    theLog = Logfile.getInstance("/tmp/smod.dispatch");
+    theLog = Logfile.getInstance("ServletModuleDispatch");
   }
 
   /**
index ce5f4c5..3c75365 100755 (executable)
@@ -60,20 +60,21 @@ public class Database implements StorageObject {
    * @param   String confFilename Dateiname der Konfigurationsdatei
    */
   public Database() {
-    theLog = Logfile.getInstance(MirConfig.getProp("Home") + MirConfig.getProp("Database.Logfile"));
-    String database_username=MirConfig.getProp("Database.Username");
-    String database_password=MirConfig.getProp("Database.Password");
-    String database_host=MirConfig.getProp("Database.Host");
-    String theAdaptorName=MirConfig.getProp("Database.Adaptor");
+    //theLog = Logfile.getInstance(MirConfig.getProp("Home") + MirConfig.getProp("Database.Logfile"));
+    theLog = Logfile.getInstance(this.getClass().getName());
+    String database_username=DatabaseConfig.getProp("Database.Username");
+    String database_password=DatabaseConfig.getProp("Database.Password");
+    String database_host=DatabaseConfig.getProp("Database.Host");
+    String theAdaptorName=DatabaseConfig.getProp("Database.Adaptor");
     try {
       theEntityClass = Class.forName("mir.entity.GenericEntity");
       theAdaptor = (DatabaseAdaptor)Class.forName(theAdaptorName).newInstance();
-      defaultLimit = Integer.parseInt(MirConfig.getProp("Database.Limit"));
+      defaultLimit = Integer.parseInt(DatabaseConfig.getProp("Database.Limit"));
       database_driver=theAdaptor.getDriver();
       database_url=theAdaptor.getURL(database_username,database_password,database_host);
       theLog.printDebugInfo("adding Broker with: " +database_driver+":"+database_url  );
-      MirConfig.addBroker(database_driver,database_url);
-      myBroker=MirConfig.getBroker();
+      DatabaseConfig.addBroker(database_driver,database_url);
+      myBroker=DatabaseConfig.getBroker();
     }
     catch (Exception e){
       theLog.printError("Bei Konstruktion von Database() with " + theAdaptorName + " -- " +e.toString());
index 9954a4b..39b2a57 100755 (executable)
@@ -12,12 +12,25 @@ import mir.misc.*;
 
 public final class DatabaseAdaptorPostgresql implements DatabaseAdaptor{
 
+    private static String url = "jdbc:postgresql://localhost:5432/mir";
+    private static String driver = "org.postgresql.Driver";
+
     public String getDriver() {
-       return MirConfig.getProp("Adaptor.PostgreSQL.Driver");
+       return driver;
     }
 
     public String getURL(String user, String pass, String host) {
-           return MirConfig.getProp("Adaptor.PostgreSQL.URL");
+           return url;
+    }
+
+    public static void setUrl(String u) throws Exception {
+        if (!url.startsWith("jdbc:"))
+            throw new Exception("Database Adaptor URL must begin with: \"jdbc:\"");
+        url = u;
+    }
+
+    public static void setDriver(String d) {
+        driver = d;
     }
 
     public  boolean hasLimit() {
diff --git a/source/mir/storage/DatabaseConfig.java b/source/mir/storage/DatabaseConfig.java
new file mode 100755 (executable)
index 0000000..46f043f
--- /dev/null
@@ -0,0 +1,149 @@
+
+package  mir.storage;
+
+import java.util.*;
+import java.lang.*;
+import  com.javaexchange.dbConnectionBroker.*;
+
+/**
+ * Title:        Mir
+ * Description:  Class that allows access to all Database Config values
+ * Copyright:    Copyright (c) 2001
+ * Company:      Indymedia
+ * @author       mh <heckmann@hbe.ca>
+ * @version 0.1
+ */
+
+
+public class DatabaseConfig {
+
+  private static HashMap configHash;
+  private static HashMap brokerHash;
+  private static int      instances=0;
+
+  static {
+    configHash = new HashMap();
+    brokerHash = new HashMap();
+    configHash.put("Database.Host", "localhost");
+    configHash.put("Database.Adaptor", "mir.storage.DatabaseAdaptorPostgresql");
+    configHash.put("Database.Limit", "20");
+    configHash.put("Database.poolMin", "1");
+    configHash.put("Database.poolMax", "10");
+    configHash.put("Database.poolLog", "/tmp/pool.log");
+    configHash.put("Database.poolResetTime", "1.0");
+  }
+
+  public static void setUsername(String user) {
+    configHash.put("Database.Username", user);
+  }
+
+  public static void setPassword(String pass) {
+    configHash.put("Database.Password", pass);
+  }
+
+  public static void setHost(String host) {
+    configHash.put("Database.Host", host);
+  }
+
+  public static void setAdaptor(String adaptor) {
+    configHash.put("Database.Adaptor", adaptor);
+  }
+
+  public static void setDefaultLimit(int limit) {
+    configHash.put("Database.Limit", Integer.toString(limit));
+  }
+  
+  public static void setPoolMin(int min) {
+    configHash.put("Database.poolMin", Integer.toString(min));
+  }
+
+  public static void setPoolMax(int max) {
+    configHash.put("Database.poolMax", Integer.toString(max));
+  }
+
+  public static void setPoolResetTime(float t) {
+    configHash.put("Database.poolResetTime", Float.toString(t));
+  }
+
+  public static void setPoolLog(String l) {
+    configHash.put("Database.poolLog", l);
+  }
+
+  /**
+   * Returns the property asked for by pulling it out a HashMap
+   * @param a String containing the property name (key)
+   * @return a String containing the prop. value
+   */
+  public static String getProp(String propName) {
+    return (String)configHash.get(propName);
+  }
+
+  public static void addBroker(String driver, String URL){
+
+    String username,passwd,min,max,log,reset;
+
+    if(!brokerHash.containsKey("Pool.broker")){
+      username=getProp("Database.Username");
+      passwd=getProp("Database.Password");
+      min=getProp("Database.poolMin");
+      max=getProp("Database.poolMax");
+      log= getProp("Database.poolLog");
+      reset=getProp("Database.poolResetTime");
+
+      try{
+        System.err.println("-- making Broker for -"
+                            +driver+" - " +URL
+                            + " log " + log + " user "
+                            + username + " pass: " + passwd);
+
+        DbConnectionBroker br = new DbConnectionBroker(driver,URL,username,passwd,(new Integer(min)).intValue(),
+                                                      (new Integer(max)).intValue(),log,(new Float(reset)).floatValue());
+        if (br!=null){
+          instances++;
+          brokerHash.put("Pool.broker",br);
+        } else {
+            throw new Exception();
+        }
+      } catch(Exception e){
+        System.err.println("Der ConnectionBroker konnte nicht initializiert werden"+ e.toString());e.printStackTrace();
+      }
+    } // end if
+  }
+
+  /**
+   * Liefert DBConnectionBroker einer Configuration zurueck
+   * @param confFilename
+   * @return DBConnectionBroker
+   */
+  public static DbConnectionBroker getBroker() {
+    DbConnectionBroker broker=null;
+    broker=(DbConnectionBroker)brokerHash.get("Pool.broker");
+    if (broker==null) {
+      System.err.println("Konnte kein ConnectionPoolBroker initialisiert werden");
+    }
+    return broker;
+  }
+
+  /**
+   * Liefert Anzahl der Instantiierten DBConnectionBroker zurueck
+   * @return
+   */
+  public static int getBrokerInstances() {
+    return instances;
+  }
+
+  public static DbConnectionBroker getBrokerInfo(){
+    return (DbConnectionBroker)brokerHash.get("Pool.broker");
+  }
+
+  /**
+   * Finalize method
+   */
+  public void finalize(){
+    instances --;
+    try {
+      super.finalize();
+    } catch (Throwable t) {}
+  }
+
+}
index 4b08487..101d659 100755 (executable)
@@ -23,6 +23,9 @@ import mir.misc.Location;
  * classes as well as the inclusion of a method to
  * add parameters (nested tags) that are required.
  * (the addRequired method) in the config file.
+ * that part is from tomcat.
+ *
+ * much code is stolen from ant ProjectHelper.java.
  *
  * @author -mh <heckmann@hbe.ca>
  * @version 2001.10.21
@@ -45,6 +48,15 @@ public class XmlConfigurator {
     boolean matched[] = new boolean[256];
     int matchedCount=0;
 
+    XmlMatch mustComeFirstMatch[]=new XmlMatch[256]; //maximum amount of rules
+    int comeFirstMatchCount=0;
+
+    Property comesFirstArr[]=new Property[128];
+    int comesFirstCount=0;
+
+    Property propertyArr[]=new Property[128];
+    int propertyCount=0;
+
     private static XmlConfigurator instance = new XmlConfigurator();
     public static XmlConfigurator getInstance() { return instance; }
 
@@ -97,7 +109,18 @@ public class XmlConfigurator {
                         throw new ConfigException("Error parsing config file, missing required element: "+requiredXmlMatch[i].toString());
                 }
             }
-        }
+            try {
+                for(int i=0; i<comesFirstCount;i++) {
+                    comesFirstArr[i].set();
+                }
+                for(int i=0; i<propertyCount;i++) {
+                    propertyArr[i].set();
+                    System.out.println("about to set: "+i);
+                }
+            } catch (Exception e) {
+                throw new SAXParseException(e.toString(), locator);
+            }
+}
         catch(ParserConfigurationException exc) {
             throw new ConfigException("Parser has not been configured correctly", exc);
         }
@@ -339,7 +362,7 @@ public class XmlConfigurator {
             saxContext.push(tag+":"+name);
             matchedCount += checkRequiredTag(saxContext);
             try {
-                classN=Class.forName(name);
+                classN=Class.forName(name, false, this.getClass().getClassLoader());
             } catch (ClassNotFoundException e) {
                 throw new ConfigException("Error invoking class: \""+name+
                     "\"",e);
@@ -405,11 +428,14 @@ public class XmlConfigurator {
             saxContext.push(tag+":"+name);
             matchedCount += checkRequiredTag(saxContext);
 
-            //finally try to set the property
-            try {
-                setProperty(classN, name, value);
-            } catch (Exception e) {
-                throw new SAXParseException(e.toString(), locator);
+            //finally add it to the lists
+            //to be processed later
+            if (checkComesFirstTag(saxContext)) {
+                comesFirstArr[comesFirstCount]=new Property(classN, name, value);
+                comesFirstCount++;
+            } else {
+                propertyArr[propertyCount]=new Property(classN, name, value);
+                propertyCount++;
             }
         }
 
@@ -421,6 +447,20 @@ public class XmlConfigurator {
 
     }
 
+    public void addComesFirstTag(String xmlPath) {
+        mustComeFirstMatch[comeFirstMatchCount]=new XmlMatch(xmlPath);
+        comeFirstMatchCount++;
+    }
+
+    private boolean checkComesFirstTag(SaxContext ctx) {
+        for( int i=0; i<comeFirstMatchCount; i++ ) {
+            if( mustComeFirstMatch[i].match(ctx) ) {
+                return true;
+            }
+        }
+        return false;
+    }
+
     public void addRequiredTag(String xmlPath) {
         requiredXmlMatch[requiredXmlMatchCount]=new XmlMatch(xmlPath);
         matched[requiredXmlMatchCount]=false;
@@ -448,73 +488,89 @@ public class XmlConfigurator {
         return new String(chars);
     }
 
-    /** Find a method with the right name
-     * If found, call the method ( if param is int or boolean we'll convert 
-     * value to the right type before) - that means you can have setDebug(1).
-     */
-    static void setProperty( Class classN, String name, String value )
-        throws Exception {
-        
-        String setter= "set" +capitalize(name);
+    private class Property {
+        Class classN;
+        String name;
+        String value;
 
-        try {
-            Method methods[]=classN.getMethods();
-            Method setPropertyMethod=null;
-
-            // First, the ideal case - a setFoo( String ) method
-            for( int i=0; i< methods.length; i++ ) {
-                Class paramT[]=methods[i].getParameterTypes();
-                if( setter.equals( methods[i].getName() ) &&
-                    paramT.length == 1 &&
-                    "java.lang.String".equals( paramT[0].getName())) {
-
-                    methods[i].invoke( null, new Object[] { value } );
-                    return;
-                }
-            } //end for
-
-            // Try a setFoo ( int ) or ( boolean )
-            for( int i=0; i< methods.length; i++ ) {
-                boolean ok=true;
-                if( setter.equals( methods[i].getName() ) &&
-                    methods[i].getParameterTypes().length == 1) {
-
-                    // match - find the type and invoke it
-                    Class paramType=methods[i].getParameterTypes()[0];
-                    Object params[]=new Object[1];
-                    if ("java.lang.Integer".equals( paramType.getName()) ||
-                        "int".equals( paramType.getName())) {
-                        try {
-                            params[0]=new Integer(value);
-                        } catch( NumberFormatException ex ) {ok=false;}
-                    } else if ("java.lang.Boolean".equals( paramType.getName()) ||
-                        "boolean".equals( paramType.getName())) {
-                        params[0]=new Boolean(value);
-                    } else {
-                        throw new Exception("Unknown type " + paramType.getName() + "for property \""+name+"\"with value \""+value+"\"");
-                    }
+        public Property( Class classN, String name, String value) {
+            this.classN=classN;
+            this.name=name;
+            this.value=value;
+        }
+            
+        /** Find a method with the right name
+         * If found, call the method ( if param is int or boolean we'll convert 
+         * value to the right type before) - that means you can have setDebug(1).
+         */
+        public void set() throws Exception {
+            
+            String setter= "set" +capitalize(name);
 
-                    if( ok ) {
-                        System.out.println("XXX: " + methods[i] + " " + classN + " " + params[0] );
-                        methods[i].invoke( null, params );
-                        return; 
-                    } //end if
-                } //end if setter
-            } //end for
-
-            //if we got this far it means we were not successful in setting the
-            //property
-            throw new Exception("Count not find method \""+setter+"\" in Class \""+classN.getName()+"\" in order to set property \""+name+"\"");
-
-        } catch( SecurityException ex1 ) {
-            throw new Exception("SecurityException for " + classN.getName() + " " +  name + "="  + value  +")" );
-            //if( ctx.getDebug() > 1 ) ex1.printStackTrace();
-        } catch (IllegalAccessException iae) {
-            throw new Exception("IllegalAccessException for " + classN.getName() + " " +  name + "="  + value  +")" );
-            //if( ctx.getDebug() > 1 ) iae.printStackTrace();
-        } catch (InvocationTargetException ie) {
-            throw new Exception("InvocationTargetException for " + classN.getName() + " " +  name + "="  + value  +")" );
-            //if( ctx.getDebug() > 1 ) ie.printStackTrace();
+            try {
+                Method methods[]=classN.getMethods();
+                Method setPropertyMethod=null;
+
+                // First, the ideal case - a setFoo( String ) method
+                for( int i=0; i< methods.length; i++ ) {
+                    Class paramT[]=methods[i].getParameterTypes();
+                    if( setter.equals( methods[i].getName() ) &&
+                        paramT.length == 1 &&
+                        "java.lang.String".equals( paramT[0].getName())) {
+
+                        methods[i].invoke( null, new Object[] { value } );
+                        return;
+                    }
+                } //end for
+
+                // Try a setFoo ( int ), (float) or ( boolean )
+                for( int i=0; i< methods.length; i++ ) {
+                    boolean ok=true;
+                    if( setter.equals( methods[i].getName() ) &&
+                        methods[i].getParameterTypes().length == 1) {
+
+                        // match - find the type and invoke it
+                        Class paramType=methods[i].getParameterTypes()[0];
+                        Object params[]=new Object[1];
+                        if ("java.lang.Integer".equals( paramType.getName()) ||
+                            "int".equals( paramType.getName())) {
+                            try {
+                                params[0]=new Integer(value);
+                            } catch( NumberFormatException ex ) {ok=false;}
+                        } else if ("java.lang.Float".equals( paramType.getName()) ||
+                            "float".equals( paramType.getName())) {
+                            try {
+                                params[0]=new Float(value);
+                            } catch( NumberFormatException ex ) {ok=false;}
+                        } else if ("java.lang.Boolean".equals( paramType.getName()) ||
+                            "boolean".equals( paramType.getName())) {
+                            params[0]=new Boolean(value);
+                        } else {
+                            throw new Exception("Unknown type " + paramType.getName() + "for property \""+name+"\"with value \""+value+"\"");
+                        }
+
+                        if( ok ) {
+                            System.out.println("XXX: " + methods[i] + " " + classN + " " + params[0] );
+                            methods[i].invoke( null, params );
+                            return; 
+                        } //end if
+                    } //end if setter
+                } //end for
+
+                //if we got this far it means we were not successful in setting the
+                //property
+                throw new Exception("Count not find method \""+setter+"\" in Class \""+classN.getName()+"\" in order to set property \""+name+"\"");
+
+            } catch( SecurityException ex1 ) {
+                throw new Exception("SecurityException for " + classN.getName() + " " +  name + "="  + value  +")" );
+                //if( ctx.getDebug() > 1 ) ex1.printStackTrace();
+            } catch (IllegalAccessException iae) {
+                throw new Exception("IllegalAccessException for " + classN.getName() + " " +  name + "="  + value  +")" );
+                //if( ctx.getDebug() > 1 ) iae.printStackTrace();
+            } catch (InvocationTargetException ie) {
+                throw new Exception("InvocationTargetException for " + classN.getName() + " " +  name + "="  + value  +")" );
+                //if( ctx.getDebug() > 1 ) ie.printStackTrace();
+            }
         }
     }
 
index 8a133ea..1a73023 100755 (executable)
@@ -38,7 +38,13 @@ class XmlMatch {
     }
 
     public String toString() {
-        return "Tag("+names+")";
+        String tag="/";
+        int i=0;
+        while ( names[i] != null) {
+           tag=tag+names[i]+"/";
+           i++;
+        }
+        return tag;
     }
 
 }
index 696c667..14cc087 100755 (executable)
@@ -41,7 +41,7 @@ public class XmlInputParser {
     if (!logDir.exists()) {
       logDir.mkdir();
     }
-    logger = Logfile.getInstance(args[0] + "LOG/xml.log");
+    logger = Logfile.getInstance("Inputlog");
     XmlInputParser xmlInputParser = new XmlInputParser();
     //get the config-file
     /* Commented out for now since it seems unused and need more
index a33b383..e00d295 100755 (executable)
@@ -34,7 +34,7 @@ public class ModuleBreaking extends AbstractModule
 
        public ModuleBreaking (StorageObject theStorage)
        {
-               if (theLog == null) theLog = Logfile.getInstance(MirConfig.getProp("Home") + MirConfig.getProp("Module.Breaking.Logfile"));
+               if (theLog == null) theLog = Logfile.getInstance(this.getClass().getName());
                if (theStorage == null) theLog.printWarning("ModuleBreaking -- StorageObject was null!");
                this.theStorage = theStorage;
        }
index f809b0f..1903721 100755 (executable)
@@ -31,8 +31,8 @@ public class ModuleComment extends AbstractModule
   // Contructor
   public ModuleComment(StorageObject theStorage)
   {
-    if (theLog == null) theLog = Logfile.getInstance(MirConfig.getProp("Home") + MirConfig.getProp("Module.Comment.Logfile"));
-    if (theStorage == null) theLog.printWarning("StorageObject was null!");
+    //if (theLog == null) theLog = Logfile.getInstance(MirConfig.getProp("Home") + MirConfig.getProp("Module.Comment.Logfile"));
+    //if (theStorage == null) theLog.printWarning("StorageObject was null!");
     this.theStorage = theStorage;
   }
 
index 79b84fc..e78502d 100755 (executable)
@@ -28,12 +28,12 @@ public class ModuleContent extends AbstractModule
 
        public ModuleContent() {
                super();
-               if (theLog == null) theLog = Logfile.getInstance(MirConfig.getProp("Home") + MirConfig.getProp("Module.Content.Logfile"));
+               if (theLog == null) theLog = Logfile.getInstance(this.getClass().getName());
        }
 
        public ModuleContent(StorageObject theStorage) {
                this.theStorage = theStorage;
-               if (theLog == null) theLog = Logfile.getInstance(MirConfig.getProp("Home") + MirConfig.getProp("Module.Content.Logfile"));
+               if (theLog == null) theLog = Logfile.getInstance(this.getClass().getName());
        }
 
        //
index 3b6023a..9639ed1 100755 (executable)
@@ -32,7 +32,7 @@ public class ModuleFeature extends AbstractModule
                        this.theStorage = theStorage;
 
        if (theLog == null)
-       theLog = Logfile.getInstance(MirConfig.getProp("Home") + MirConfig.getProp("Module.Feature.Logfile"));
+       theLog = Logfile.getInstance(this.getClass().getName());
 
                }
 
index 6b86c62..e5c37a5 100755 (executable)
@@ -24,7 +24,7 @@ public class ModuleImages extends AbstractModule {
 
        public ModuleImages(StorageObject theStorage) {
 
-               if (theLog == null) theLog = Logfile.getInstance(MirConfig.getProp("Home")+MirConfig.getProp("Module.Bilder.Logfile"));
+               if (theLog == null) theLog = Logfile.getInstance(this.getClass().getName());
                if (theStorage == null) theLog.printWarning("StorageObject was null!");
                this.theStorage = theStorage;
 
index d3e5e37..d236364 100755 (executable)
@@ -34,7 +34,7 @@ public class ModuleLanguage extends AbstractModule {
        // Kontruktor
        public ModuleLanguage (StorageObject theStorage)        {
 
-               if (theLog == null) theLog = Logfile.getInstance(MirConfig.getProp("Home") + MirConfig.getProp("Module.Language.Logfile"));
+               if (theLog == null) theLog = Logfile.getInstance(this.getClass().getName());
                if (theStorage == null) theLog.printWarning("ModuleLanguage -- StorageObject was null!");
 
                this.theStorage = theStorage;
index b0d732a..e5e01c6 100755 (executable)
@@ -32,7 +32,7 @@ public class ModuleLinksImcs extends AbstractModule
     public ModuleLinksImcs(StorageObject theStorage) {
            this.theStorage = theStorage;
            if (theLog == null)
-             theLog = Logfile.getInstance(MirConfig.getProp("Home") + MirConfig.getProp("Module.LinksImcs.Logfile"));
+             theLog = Logfile.getInstance(this.getClass().getName());
     }
 
     public SimpleHash getLinksImcsAsSimpleHash() {
index 14dbcdd..eb82576 100755 (executable)
@@ -35,7 +35,7 @@ public class ModuleMediafolder extends AbstractModule
 
        public ModuleMediafolder(StorageObject theStorage)
        {
-               if (theLog == null) theLog = Logfile.getInstance(MirConfig.getProp("Home") + MirConfig.getProp("Module.Mediafolder.Logfile"));
+               if (theLog == null) theLog = Logfile.getInstance(this.getClass().getName());
                if (theStorage == null) theLog.printWarning("StorageObject was null!");
                this.theStorage = theStorage;
        }
index e8f00e0..0394a01 100755 (executable)
@@ -37,7 +37,7 @@ public class ModuleMessage extends AbstractModule
        public ModuleMessage (StorageObject theStorage)
        {
 
-               if (theLog == null) theLog = Logfile.getInstance(MirConfig.getProp("Home") + MirConfig.getProp("Module.Messages.Logfile"));
+               if (theLog == null) theLog = Logfile.getInstance(this.getClass().getName());
                if (theStorage == null) theLog.printWarning("ModuleMessage -- StorageObject was null!");
 
                this.theStorage = theStorage;
index e867cd1..a0c1cd2 100755 (executable)
@@ -33,7 +33,7 @@ public class ModuleSchwerpunkt extends AbstractModule
                        this.theStorage = theStorage;
 
        if (theLog == null)
-       theLog = Logfile.getInstance(MirConfig.getProp("Home") + MirConfig.getProp("Module.Schwerpunkt.Logfile"));
+       theLog = Logfile.getInstance(this.getClass().getName());
 
                }
 
index ac951cc..4a132e3 100755 (executable)
@@ -32,7 +32,7 @@ public class ModuleTopics extends AbstractModule
     public ModuleTopics(StorageObject theStorage) {
            this.theStorage = theStorage;
            if (theLog == null)
-             theLog = Logfile.getInstance(MirConfig.getProp("Home") + MirConfig.getProp("Module.Themen.Logfile"));
+             theLog = Logfile.getInstance(this.getClass().getName());
     }
 
     public SimpleList getTopicsAsSimpleList() {
index 2d9e718..76a1cec 100755 (executable)
@@ -32,7 +32,7 @@ public class ModuleUploadedMedia extends AbstractModule
     public ModuleUploadedMedia(StorageObject theStorage) {
            this.theStorage = theStorage;
            if (theLog == null)
-             theLog = Logfile.getInstance(MirConfig.getProp("Home") + MirConfig.getProp("Module.Themen.Logfile"));
+             theLog = Logfile.getInstance(this.getClass().getName());
     }
 
     public SimpleList getUploadedMediaAsSimpleList() {
index 0d166d7..779dc2c 100755 (executable)
@@ -35,7 +35,7 @@ public class ModuleUsers extends AbstractModule
        public ModuleUsers(StorageObject theStorage)
        {
 
-               if (theLog == null) theLog = Logfile.getInstance(MirConfig.getProp("Home") + MirConfig.getProp("Module.Users.Logfile"));
+               if (theLog == null) theLog = Logfile.getInstance(this.getClass().getName());
                if (theStorage == null) theLog.printWarning("StorageObject was null!");
                this.theStorage = theStorage;
 
index bb71894..d3e0553 100755 (executable)
@@ -18,7 +18,7 @@ abstract public class Producer {
   protected static String producerStorageRoot = MirConfig.getProp("Producer.StorageRoot");
        protected static String producerProductionHost = MirConfig.getProp("Producer.ProductionHost");
        protected static String producerOpenAction = MirConfig.getProp("Producer.OpenAction");;
-       protected static Logfile theLog = Logfile.getInstance(MirConfig.getProp("Home") + MirConfig.getProp("Producer.Logfile"));
+       protected static Logfile theLog = Logfile.getInstance("Producer");
        protected static ModuleTopics         topicsModule;
   protected static ModuleLinksImcs      linksImcsModule;
        protected static ModuleSchwerpunkt    schwerpunktModule;
index d45feb9..b437b27 100755 (executable)
@@ -38,7 +38,7 @@ public class ProducerAll extends Producer{
                new ProducerContent().handle(htmlout, user, force,sync);
                new ProducerOpenPosting().handle(htmlout, user, force,sync);
                new ProducerTopics().handle(htmlout, user, force,sync);
-    new ProducerNavigation().handle(htmlout, user, force,sync);
+        new ProducerNavigation().handle(htmlout, user, force,sync);
 
                // Finish
                sessionConnectTime = new java.util.Date().getTime() - startTime;
index ae7b36a..c198f82 100755 (executable)
@@ -155,7 +155,7 @@ public class ProducerContent extends Producer {
             upMedia = currentMediaList.elementAt(n);
             upMediaSimpleHash = HTMLTemplateProcessor.makeSimpleHash(upMedia);
             mediaType = ((EntityMedia)upMedia).getMediaType();
-            //must be a non-existant to_media_type entry..
+            //in case it's a non-existant to_media_type entry..
             if (mediaType != null) {
               try {
                 mediaHandlerName = mediaType.getValue("classname");
index af3f9b5..22939fb 100755 (executable)
@@ -77,7 +77,7 @@ public class ProducerStartPage extends Producer {
     Database            mediaStorage=null;
     String              tinyIcon;
     String              iconAlt;
-    Logfile theLog = Logfile.getInstance(MirConfig.getProp("Home") + MirConfig.getProp("Producer.Logfile"));
+    Logfile theLog = Logfile.getInstance(this.getClass().getName());
 
     SimpleList mediaList;
     SimpleHash contentHash;
index 289afb9..745ad65 100755 (executable)
@@ -30,7 +30,7 @@ public class ServletModuleBreaking extends ServletModule
 
        private ServletModuleBreaking() {
 
-               theLog = Logfile.getInstance(MirConfig.getProp("Home") + MirConfig.getProp("ServletModule.Breaking.Logfile"));
+               theLog = Logfile.getInstance(this.getClass().getName());
                templateListString = MirConfig.getProp("ServletModule.Breaking.ListTemplate");
                templateObjektString = MirConfig.getProp("ServletModule.Breaking.ObjektTemplate");
                templateConfirmString = MirConfig.getProp("ServletModule.Breaking.ConfirmTemplate");
index 77f7fef..22ca7d6 100755 (executable)
@@ -36,7 +36,7 @@ public class ServletModuleComment extends ServletModule
        public static ServletModule getInstance() { return instance; }
 
        private ServletModuleComment() {
-               theLog = Logfile.getInstance(MirConfig.getProp("Home") + MirConfig.getProp("ServletModule.Comment.Logfile"));
+               theLog = Logfile.getInstance(this.getClass().getName());
                templateListString = MirConfig.getProp("ServletModule.Comment.ListTemplate");
                templateObjektString = MirConfig.getProp("ServletModule.Comment.ObjektTemplate");
                templateConfirmString = MirConfig.getProp("ServletModule.Comment.ConfirmTemplate");
index a29c854..e26ef65 100755 (executable)
@@ -45,7 +45,7 @@ public class ServletModuleContent extends ServletModule
 
   private ServletModuleContent() {
     try {
-      theLog = Logfile.getInstance(MirConfig.getProp("Home") + MirConfig.getProp("ServletModule.Content.Logfile"));
+      theLog = Logfile.getInstance(this.getClass().getName());
       templateListString = MirConfig.getProp("ServletModule.Content.ListTemplate");
       templateOpString = MirConfig.getProp("ServletModule.Content.OpTemplate");
       templateObjektString = MirConfig.getProp("ServletModule.Content.ObjektTemplate");
index 843079e..e8702f5 100755 (executable)
@@ -49,7 +49,7 @@ public class ServletModuleImages extends mir.servlet.ServletModule
 
 
   private ServletModuleImages() {
-    theLog = Logfile.getInstance(MirConfig.getProp("Home") + MirConfig.getProp("ServletModule.Bilder.Logfile"));
+    theLog = Logfile.getInstance(this.getClass().getName());
     templateListString = MirConfig.getProp("ServletModule.Bilder.ListTemplate");
     templateObjektString = MirConfig.getProp("ServletModule.Bilder.ObjektTemplate");
     templateConfirmString = MirConfig.getProp("ServletModule.Bilder.ConfirmTemplate");
index baee6a5..0eeb699 100755 (executable)
@@ -32,7 +32,7 @@ public class ServletModuleLanguage extends ServletModule
   public static ServletModule getInstance() { return instance; }
 
   private ServletModuleLanguage() {
-         theLog = Logfile.getInstance(MirConfig.getProp("Home") + MirConfig.getProp("ServletModule.Language.Logfile"));
+         theLog = Logfile.getInstance(this.getClass().getName());
     templateListString = MirConfig.getProp("ServletModule.Language.ListTemplate");
          templateObjektString = MirConfig.getProp("ServletModule.Language.ObjektTemplate");
          templateConfirmString = MirConfig.getProp("ServletModule.Language.ConfirmTemplate");
index e86d8d6..90bc5ce 100755 (executable)
@@ -37,7 +37,7 @@ public class ServletModuleLinksImcs extends ServletModule
 
 
   private ServletModuleLinksImcs() {
-    theLog = Logfile.getInstance(MirConfig.getProp("Home") + MirConfig.getProp("ServletModule.LinksImcs.Logfile"));
+    theLog = Logfile.getInstance(this.getClass().getName());
     templateListString = MirConfig.getProp("ServletModule.LinksImcs.ListTemplate");
     templateObjektString = MirConfig.getProp("ServletModule.LinksImcs.ObjektTemplate");
     templateConfirmString = MirConfig.getProp("ServletModule.LinksImcs.ConfirmTemplate");
index bed01b8..de3c4ee 100755 (executable)
@@ -26,7 +26,7 @@ public class ServletModuleMediafolder extends ServletModule
        private static ServletModuleMediafolder instance = new ServletModuleMediafolder();
 
        private ServletModuleMediafolder() {
-               theLog = Logfile.getInstance(MirConfig.getProp("Home") + MirConfig.getProp("ServletModule.Mediafolder.Logfile"));
+               theLog = Logfile.getInstance(this.getClass().getName());
                templateListString = MirConfig.getProp("ServletModule.Mediafolder.ListTemplate");
                templateObjektString = MirConfig.getProp("ServletModule.Mediafolder.ObjektTemplate");
                templateConfirmString = MirConfig.getProp("ServletModule.Mediafolder.ConfirmTemplate");
index ec11703..2325408 100755 (executable)
@@ -32,7 +32,7 @@ public class ServletModuleMessage extends ServletModule
        public static ServletModule getInstance() { return instance; }
 
        private ServletModuleMessage() {
-               theLog = Logfile.getInstance(MirConfig.getProp("Home") + MirConfig.getProp("ServletModule.Messages.Logfile"));
+               theLog = Logfile.getInstance(this.getClass().getName());
                templateListString = MirConfig.getProp("ServletModule.Messages.ListTemplate");
                templateObjektString = MirConfig.getProp("ServletModule.Messages.ObjektTemplate");
                templateConfirmString = MirConfig.getProp("ServletModule.Messages.ConfirmTemplate");
index 8efa6d1..ff29354 100755 (executable)
@@ -36,28 +36,40 @@ import mircoders.producer.*;
 
 public class ServletModuleOpenIndy extends ServletModule
 {
-
-  private String          commentFormTemplate, commentFormDoneTemplate, commentFormDupeTemplate;
-  private String          postingFormTemplate, postingFormDoneTemplate, postingFormDupeTemplate;
   private ModuleContent   contentModule;
   private ModuleImages    imageModule;
   private ModuleTopics    themenModule;
-  private String          directOp ="yes";
+
+  //config values
+  private static String commentFormTemplate = "open/comment.template";
+  private static String commentFormDoneTemplate = "open/comment_done.template";
+  private static String commentFormDupeTemplate = "open/comment_dupe.template";
+  private static String postingFormTemplate = "open/posting.template";
+  private static String postingFormDoneTemplate = "open/posting_done.template";
+  private static String postingFormDupeTemplate = "open/posting_dupe.template";
+  private static boolean  directOp = true;
 
   // Singelton / Kontruktor
   private static ServletModuleOpenIndy instance = new ServletModuleOpenIndy();
   public static ServletModule getInstance() { return instance; }
 
+  public static void setDirectOp(boolean v) {
+    directOp=v;
+  }
+
+//  public static setCommentFormTemplate(String template) throws  {
+   // if
+
   private ServletModuleOpenIndy() {
     try {
-      theLog = Logfile.getInstance(MirConfig.getProp("Home") + MirConfig.getProp("ServletModule.OpenIndy.Logfile"));
-      commentFormTemplate = MirConfig.getProp("ServletModule.OpenIndy.CommentTemplate");
-      commentFormDoneTemplate = MirConfig.getProp("ServletModule.OpenIndy.CommentDoneTemplate");
-      commentFormDupeTemplate = MirConfig.getProp("ServletModule.OpenIndy.CommentDupeTemplate");
-      postingFormTemplate = MirConfig.getProp("ServletModule.OpenIndy.PostingTemplate");
-      postingFormDoneTemplate = MirConfig.getProp("ServletModule.OpenIndy.PostingDoneTemplate");
-      postingFormDupeTemplate = MirConfig.getProp("ServletModule.OpenIndy.PostingDupeTemplate");
-      directOp = MirConfig.getProp("DirectOpenposting").toLowerCase();
+      theLog = Logfile.getInstance(this.getClass().getName());
+      //commentFormTemplate = MirConfig.getProp("ServletModule.OpenIndy.CommentTemplate");
+      //commentFormDoneTemplate = MirConfig.getProp("ServletModule.OpenIndy.CommentDoneTemplate");
+      //commentFormDupeTemplate = MirConfig.getProp("ServletModule.OpenIndy.CommentDupeTemplate");
+      //postingFormTemplate = MirConfig.getProp("ServletModule.OpenIndy.PostingTemplate");
+      //postingFormDoneTemplate = MirConfig.getProp("ServletModule.OpenIndy.PostingDoneTemplate");
+      //postingFormDupeTemplate = MirConfig.getProp("ServletModule.OpenIndy.PostingDupeTemplate");
+      //directOp = MirConfig.getProp("DirectOpenposting").toLowerCase();
       mainModule = new ModuleComment(DatabaseComment.getInstance());
       contentModule = new ModuleContent(DatabaseContent.getInstance());
       themenModule = new ModuleTopics(DatabaseTopics.getInstance());
@@ -208,7 +220,7 @@ public class ServletModuleOpenIndy extends ServletModule
       // op-articles are immediatly published
       withValues.put("is_published","1");
       // if op direct article-type == newswire
-      if (directOp.equals("yes")) withValues.put("to_article_type","1");
+      if (directOp) withValues.put("to_article_type","1");
       
       // owner is openposting user
       withValues.put("to_publisher","1");
@@ -272,6 +284,7 @@ public class ServletModuleOpenIndy extends ServletModule
              * sure that it is in this file -mh
              */
             contentType = FileUtil.guessContentTypeFromName(fileName);
+            theLog.printError("tYPE: "+contentType);
             if (contentType==null)
                 contentType = "text/plain"; // rfc1867 says this is the default
         }
@@ -368,7 +381,7 @@ public class ServletModuleOpenIndy extends ServletModule
       // producing new page
       new ProducerContent().handle(null, null, false, false,cid);
       //if direct op producing startpage
-      if (directOp.equals("yes")) new ProducerStartPage().handle(null,null);
+      if (directOp) new ProducerStartPage().handle(null,null);
       
       // sync the server
       //should be configureable
index 1e4e0d2..6eccb89 100755 (executable)
@@ -27,7 +27,7 @@ public class ServletModuleProducer extends ServletModule
        public static ServletModule getInstance() { return instance; }
 
        private ServletModuleProducer() {
-               theLog = Logfile.getInstance(MirConfig.getProp("Home") + MirConfig.getProp("ServletModule.Producer.Logfile"));
+               theLog = Logfile.getInstance(this.getClass().getName());
                defaultAction="produce";
        }
 
index de31ae9..39953fe 100755 (executable)
@@ -33,7 +33,7 @@ public class ServletModuleSchwerpunkt extends ServletModule
   public static ServletModule getInstance() { return instance; }
 
   private ServletModuleSchwerpunkt() {
-       theLog = Logfile.getInstance(MirConfig.getProp("Home") + MirConfig.getProp("ServletModule.Schwerpunkt.Logfile"));
+       theLog = Logfile.getInstance(this.getClass().getName());
        templateListString = MirConfig.getProp("ServletModule.Schwerpunkt.ListTemplate");
        templateObjektString = MirConfig.getProp("ServletModule.Schwerpunkt.ObjektTemplate");
        templateConfirmString = MirConfig.getProp("ServletModule.Schwerpunkt.ConfirmTemplate");
index da0ff04..01adaed 100755 (executable)
@@ -32,7 +32,7 @@ public class ServletModuleTopics extends ServletModule
   public static ServletModule getInstance() { return instance; }
 
   private ServletModuleTopics() {
-         theLog = Logfile.getInstance(MirConfig.getProp("Home") + MirConfig.getProp("ServletModule.Themen.Logfile"));
+         theLog = Logfile.getInstance(this.getClass().getName());
           templateListString = MirConfig.getProp("ServletModule.Themen.ListTemplate");
          templateObjektString = MirConfig.getProp("ServletModule.Themen.ObjektTemplate");
          templateConfirmString = MirConfig.getProp("ServletModule.Themen.ConfirmTemplate");
index eaaa962..35fcbb9 100755 (executable)
@@ -33,7 +33,7 @@ public class ServletModuleUsers extends mir.servlet.ServletModule
        public static ServletModule getInstance() { return instance; }
 
        private ServletModuleUsers() {
-       theLog = Logfile.getInstance(MirConfig.getProp("Home") + MirConfig.getProp("ServletModule.Users.Logfile"));
+       theLog = Logfile.getInstance(this.getClass().getName());
        templateListString = MirConfig.getProp("ServletModule.Users.ListTemplate");
        templateObjektString = MirConfig.getProp("ServletModule.Users.ObjektTemplate");
        templateConfirmString = MirConfig.getProp("ServletModule.Users.ConfirmTemplate");