various fixes/cleanup: old producers are now completely gone, old logfile class too
[mir.git] / source / mircoders / servlet / ServletModuleOpenIndy.java
index 44de811..b992769 100755 (executable)
@@ -120,7 +120,7 @@ import freemarker.template.TemplateModelRoot;
  *    open-postings to the newswire\r
  *\r
  * @author mir-coders group\r
- * @version $Id: ServletModuleOpenIndy.java,v 1.58 2003/01/25 17:50:36 idfx Exp $\r
+ * @version $Id: ServletModuleOpenIndy.java,v 1.59 2003/02/23 05:00:15 zapata Exp $\r
  *\r
  */\r
 \r
@@ -188,7 +188,6 @@ public class ServletModuleOpenIndy extends ServletModule
         // onetimepasswd\r
         if (passwdProtection.equals("yes")) {\r
           String passwd = this.createOneTimePasswd();\r
-          System.out.println(passwd);\r
           HttpSession session = req.getSession(false);\r
           session.setAttribute("passwd", passwd);\r
           mergeData.put("passwd", passwd);\r
@@ -295,7 +294,6 @@ public class ServletModuleOpenIndy extends ServletModule
     // onetimepasswd\r
     if(passwdProtection.equals("yes")){\r
       String passwd = this.createOneTimePasswd();\r
-      System.out.println(passwd);\r
       HttpSession session = req.getSession(false);\r
       session.setAttribute("passwd",passwd);\r
       mergeData.put("passwd", passwd);\r
@@ -358,7 +356,7 @@ public class ServletModuleOpenIndy extends ServletModule
       EntityList mediaList = null;\r
       try {\r
         // new MediaRequest, "1" is the id for the openPosting user\r
-        MediaRequest mediaReq = new MediaRequest("1", true, true);\r
+        MediaRequest mediaReq = new MediaRequest("1", true);\r
         mp = new WebdbMultipartRequest(req, (FileHandler)mediaReq);\r
         mediaList = mediaReq.getEntityList();\r
       }\r
@@ -467,7 +465,7 @@ public class ServletModuleOpenIndy extends ServletModule
       }\r
     }\r
     catch (FileHandlerException e) {\r
-      e.printStackTrace(System.out);\r
+      e.printStackTrace(logger.asPrintWriter(logger.DEBUG_MESSAGE));\r
       throw new ServletModuleException("MediaException: "+ e.getMessage());\r
     }\r
     catch (IOException e) { throw new ServletModuleException("IOException: "+ e.getMessage());}\r
@@ -529,9 +527,9 @@ public class ServletModuleOpenIndy extends ServletModule
       String producerStorageRoot=configuration.getString("Producer.StorageRoot");\r
       String producerDocRoot=configuration.getString("Producer.DocRoot");\r
       String publishPath = contentEnt.getValue("publish_path");\r
-      String txtFilePath = producerStorageRoot + producerDocRoot + "/" + mail_language + \r
-                                                                                                        publishPath + "/" + aid + ".txt";\r
-
+      String txtFilePath = producerStorageRoot + producerDocRoot + "/" + mail_language +\r
+                                                                                                         publishPath + "/" + aid + ".txt";\r
+\r
 \r
       File inputFile = new File(txtFilePath);\r
       String content;\r
@@ -573,24 +571,24 @@ public class ServletModuleOpenIndy extends ServletModule
       }\r
 \r
       SMTPClient client=new SMTPClient();\r
-      try {
-                               int reply;\r
-                               client.connect(configuration.getString("ServletModule.OpenIndy.SMTPServer"));\r
-                               System.out.print(client.getReplyString());\r
-                               \r
-                               reply = client.getReplyCode();\r
-                               \r
-                               if(!SMTPReply.isPositiveCompletion(reply)) {\r
-                                 client.disconnect();\r
-                                 throw new ServletModuleUserException("SMTP server refused connection.");\r
-                               }\r
-                               \r
-                               client.sendSimpleMessage(configuration.getString("ServletModule.OpenIndy.EmailIsFrom"),to,content);\r
-                               \r
-                               client.disconnect();\r
-                               //mission accomplished\r
-                               deliver(req,res,mergeData,sentMailTemplate); \r
-      catch(IOException e) {\r
+      try {\r
+        int reply;\r
+        client.connect(configuration.getString("ServletModule.OpenIndy.SMTPServer"));\r
+\r
+        reply = client.getReplyCode();\r
+\r
+        if (!SMTPReply.isPositiveCompletion(reply)) {\r
+          client.disconnect();\r
+          throw new ServletModuleUserException("SMTP server refused connection.");\r
+        }\r
+\r
+        client.sendSimpleMessage(configuration.getString("ServletModule.OpenIndy.EmailIsFrom"), to, content);\r
+\r
+        client.disconnect();\r
+        //mission accomplished\r
+        deliver(req, res, mergeData, sentMailTemplate);\r
+      }\r
+      catch(IOException e) {\r
         if(client.isConnected()) {\r
           try {\r
             client.disconnect();\r
@@ -879,7 +877,7 @@ public class ServletModuleOpenIndy extends ServletModule
     String language = req.getParameter("language");\r
     String generateFO=configuration.getString("GenerateFO");\r
     String generatePDF=configuration.getString("GeneratePDF");\r
-
+\r
 \r
     //don't do anything if we are not making FO files, or if we are\r
     //pregenerating PDF's\r