Modified config system:
[mir.git] / source / mircoders / servlet / ServletModuleOpenIndy.java
index 9a12406..be5d5a9 100755 (executable)
@@ -37,7 +37,7 @@ public class ServletModuleOpenIndy extends ServletModule
   private String          postingFormTemplate, postingFormDoneTemplate;
   private ModuleContent   contentModule;
   private ModuleImages    imageModule;
-  private boolean         directOp;
+  private String          directOp ="yes";
 
   // Singelton / Kontruktor
   private static ServletModuleOpenIndy instance = new ServletModuleOpenIndy();
@@ -45,12 +45,13 @@ public class ServletModuleOpenIndy extends ServletModule
 
   private ServletModuleOpenIndy() {
     try {
-      theLog = Logfile.getInstance(Configuration.getProperty("Home") + Configuration.getProperty("ServletModule.OpenIndy.Logfile"));
-      commentFormTemplate = Configuration.getProperty("ServletModule.OpenIndy.CommentTemplate");
-      commentFormDoneTemplate = Configuration.getProperty("ServletModule.OpenIndy.CommentDoneTemplate");
-      postingFormTemplate = Configuration.getProperty("ServletModule.OpenIndy.PostingTemplate");
-      postingFormDoneTemplate = Configuration.getProperty("ServletModule.OpenIndy.PostingDoneTemplate");
-      directOp = Configuration.directOp();
+      theLog = Logfile.getInstance(MirConfig.getProp("Home") + MirConfig.getProp("ServletModule.OpenIndy.Logfile"));
+      commentFormTemplate = MirConfig.getProp("ServletModule.OpenIndy.CommentTemplate");
+      commentFormDoneTemplate = MirConfig.getProp("ServletModule.OpenIndy.CommentDoneTemplate");
+      postingFormTemplate = MirConfig.getProp("ServletModule.OpenIndy.PostingTemplate");
+      postingFormDoneTemplate = MirConfig.getProp("ServletModule.OpenIndy.PostingDoneTemplate");
+      directOp = MirConfig.getProp("DirectOpenposting").toLowerCase();
+      //directOp="yes";
       mainModule = new ModuleComment(DatabaseComment.getInstance());
       contentModule = new ModuleContent(DatabaseContent.getInstance());
       imageModule = new ModuleImages(DatabaseImages.getInstance());
@@ -102,6 +103,7 @@ public class ServletModuleOpenIndy extends ServletModule
 
         // sync the server
         int exitValue = Helper.rsync();
+                               theLog.printDebugInfo("rsync:"+exitValue);
 
         // redirecting to url
         // should implement back to article
@@ -198,7 +200,7 @@ public class ServletModuleOpenIndy extends ServletModule
       // op-articles are immediatly published
       withValues.put("is_published","1");
       // if op direct article-type == newswire
-      if (directOp==true) withValues.put("to_article_type","1");
+      if (directOp.equals("yes")) withValues.put("to_article_type","1");
       theLog.printDebugInfo("direct op: "+directOp);
       
       // owner is openposting user
@@ -227,12 +229,13 @@ public class ServletModuleOpenIndy extends ServletModule
       // producing new page
       new ProducerContent().handle(null, null, false, false,id);
       //if direct op producing startpage
-      if (directOp==true) new ProducerStartPage().handle(null,null,false,false);
+      if (directOp.equals("yes")) new ProducerStartPage().handle(null,null);
       
 
       // sync the server
       //should be configureable
       int exitValue = Helper.rsync();
+                       theLog.printDebugInfo("rsync: "+exitValue);
 
     }
     catch (IOException e) { throw new ServletModuleException(e.toString());}