direct/indirect open posting configureable
authoridfx <idfx>
Fri, 14 Sep 2001 10:08:44 +0000 (10:08 +0000)
committeridfx <idfx>
Fri, 14 Sep 2001 10:08:44 +0000 (10:08 +0000)
source/config.properties-dist
source/mir/misc/Configuration.java
source/mircoders/servlet/ServletModuleOpenIndy.java

index 5a1c378..f9f752d 100755 (executable)
@@ -6,7 +6,7 @@ HTMLTemplateProcessor.ActionRoot=/idfx/servlet/Mir
 HTMLTemplateProcessor.DocRoot=/idfx
 
 ClearXslCache=no
-
+DirectOpenposting=yes
 StandardLanguage=de
 
 # the directory where the html-files will be saved
index f899e0f..a31e93d 100755 (executable)
@@ -80,6 +80,18 @@ public class Configuration {
   public static String getProperty(String propName) {  // default
     return conf.getString(propName);
   }
+  
+   /**
+   * Checks if open posting should be direct or indirect
+   * @return true if open posting should be direct
+   */
+  public static boolean directOp() {  // default
+    String op = conf.getString("DirectOpenposting");
+    if(op.equals("yes") || op.equals("Yes") || op.equals("y") || op.equals("Y")){
+      return true;
+    }
+    return false;
+  }
 
   /**
    * Liest eine Property eines Modules aus der Konfiguration
index a2ccc2e..8a2c90b 100755 (executable)
@@ -36,7 +36,8 @@ public class ServletModuleOpenIndy extends ServletModule
   private String          commentFormTemplate, commentFormDoneTemplate;
   private String          postingFormTemplate, postingFormDoneTemplate;
   private ModuleContent   contentModule;
-  private ModuleImages     imageModule;
+  private ModuleImages    imageModule;
+  private boolean         directOp;
 
   // Singelton / Kontruktor
   private static ServletModuleOpenIndy instance = new ServletModuleOpenIndy();
@@ -49,7 +50,7 @@ public class ServletModuleOpenIndy extends ServletModule
       commentFormDoneTemplate = Configuration.getProperty("ServletModule.OpenIndy.CommentDoneTemplate");
       postingFormTemplate = Configuration.getProperty("ServletModule.OpenIndy.PostingTemplate");
       postingFormDoneTemplate = Configuration.getProperty("ServletModule.OpenIndy.PostingDoneTemplate");
-
+      directOp = Configuration.directOp();
       mainModule = new ModuleComment(DatabaseComment.getInstance());
       contentModule = new ModuleContent(DatabaseContent.getInstance());
       imageModule = new ModuleImages(DatabaseImages.getInstance());
@@ -196,6 +197,8 @@ public class ServletModuleOpenIndy extends ServletModule
       withValues.put("is_produced", "0");
       // 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");
       // owner is openposting user
       withValues.put("to_publisher","1");
       if (withValues.get("creator").toString().equals(""))
@@ -221,6 +224,9 @@ public class ServletModuleOpenIndy extends ServletModule
       new ProducerOpenPosting().handle(null,null,false,false);
       // 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);
+      
 
       // sync the server
       //should be configureable