private String commentFormTemplate, commentFormDoneTemplate;
private String postingFormTemplate, postingFormDoneTemplate;
private ModuleContent contentModule;
- private ModuleImages imageModule;
+ private ModuleImages imageModule;
+ private String directOp ="yes";
// Singelton / Kontruktor
private static ServletModuleOpenIndy instance = new ServletModuleOpenIndy();
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");
-
+ 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());
// sync the server
int exitValue = Helper.rsync();
+ theLog.printDebugInfo("rsync:"+exitValue);
// redirecting to url
// should implement back to article
withValues.put("is_produced", "0");
// 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");
+ theLog.printDebugInfo("direct op: "+directOp);
+
// 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.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());}