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
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();
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());
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(""))
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