X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=source%2Fmircoders%2Fservlet%2FServletModuleOpenIndy.java;h=be5d5a93ce6a0f9f5743c73ae49617f2e31472e3;hb=86b6f499b413c722acc895346ac5186405b0c44c;hp=6e8877f5a9ae0f51bc70d0c8761515203e5d8eed;hpb=35404b2e50dc83add87eeed6aafe2d858447a7b0;p=mir.git diff --git a/source/mircoders/servlet/ServletModuleOpenIndy.java b/source/mircoders/servlet/ServletModuleOpenIndy.java index 6e8877f5..be5d5a93 100755 --- a/source/mircoders/servlet/ServletModuleOpenIndy.java +++ b/source/mircoders/servlet/ServletModuleOpenIndy.java @@ -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 String directOp ="yes"; // Singelton / Kontruktor private static ServletModuleOpenIndy instance = new ServletModuleOpenIndy(); @@ -44,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"); - + 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()); @@ -101,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 @@ -184,7 +187,6 @@ public class ServletModuleOpenIndy extends ServletModule if (fileName.toLowerCase().endsWith(".gif")) fileType=1; if (fileType>=0) { entImage.setImage(mediaData, fileType); - withValues.put("to_media",mediaId); setMedia=true; } else @@ -197,6 +199,10 @@ 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.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("")) @@ -208,6 +214,7 @@ public class ServletModuleOpenIndy extends ServletModule // inserting content and media id in table content_x_media try{ DatabaseContentToMedia.getInstance().setMedia(id,mediaId); + theLog.printError("setting content_x_topic success"); } catch (Exception e) { theLog.printError("setting content_x_topic failed"); } @@ -221,10 +228,14 @@ 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.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());}