update of the open session system: articles can now also be posted
[mir.git] / source / mircoders / servlet / ServletModuleOpenIndy.java
index e68f9fd..a7c9fd5 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001, 2002  The Mir-coders group
+ * Copyright (C) 2001, 2002 The Mir-coders group
  *
  * This file is part of Mir.
  *
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
  * In addition, as a special exception, The Mir-coders gives permission to link
- * the code of this program with the com.oreilly.servlet library, any library
- * licensed under the Apache Software License, The Sun (tm) Java Advanced
- * Imaging library (JAI), The Sun JIMI library (or with modified versions of
- * the above that use the same license as the above), and distribute linked
- * combinations including the two.  You must obey the GNU General Public
- * License in all respects for all of the code used other than the above
- * mentioned libraries.  If you modify this file, you may extend this exception
- * to your version of the file, but you are not obligated to do so.  If you do
- * not wish to do so, delete this exception statement from your version.
+ * the code of this program with  any library licensed under the Apache Software License,
+ * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library
+ * (or with modified versions of the above that use the same license as the above),
+ * and distribute linked combinations including the two.  You must obey the
+ * GNU General Public License in all respects for all of the code used other than
+ * the above mentioned libraries.  If you modify this file, you may extend this
+ * exception to your version of the file, but you are not obligated to do so.
+ * If you do not wish to do so, delete this exception statement from your version.
  */
 
 package mircoders.servlet;
@@ -94,8 +93,7 @@ import mircoders.entity.EntityComment;
 import mircoders.entity.EntityContent;
 import mircoders.global.MirGlobal;
 import mircoders.media.MediaUploadProcessor;
-import mircoders.media.UnsupportedMediaFormatExc;
-import mircoders.module.ModuleComment;
+import mircoders.module.*;
 import mircoders.module.ModuleContent;
 import mircoders.module.ModuleImages;
 import mircoders.module.ModuleTopics;
@@ -123,7 +121,7 @@ import mircoders.storage.DatabaseTopics;
  *    open-postings to the newswire
  *
  * @author mir-coders group
- * @version $Id: ServletModuleOpenIndy.java,v 1.79 2003/04/21 02:58:30 zapata Exp $
+ * @version $Id: ServletModuleOpenIndy.java,v 1.81 2003/04/26 00:42:22 zapata Exp $
  *
  */
 
@@ -496,7 +494,8 @@ public class ServletModuleOpenIndy extends ServletModule
 
       EntityContent article = (EntityContent) contentModule.getById(cid);
       try {
-        MirGlobal.abuse().checkArticle(article, aRequest, aResponse);
+        MirGlobal.abuse().checkArticle(
+            article, new HTTPAdapters.HTTPRequestAdapter(aRequest), aResponse);
         MirGlobal.localizer().openPostings().afterContentPosting(article);
       }
       catch (Throwable t) {
@@ -505,10 +504,10 @@ public class ServletModuleOpenIndy extends ServletModule
       deliver(aRequest, aResponse, mergeData, null, postingFormDoneTemplate);
     }
     catch (Throwable e) {
-      e.printStackTrace(logger.asPrintWriter(logger.DEBUG_MESSAGE));
+      e.printStackTrace(logger.asPrintWriter(LoggerWrapper.DEBUG_MESSAGE));
       Throwable cause = ExceptionFunctions.traceCauseException(e);
 
-      if (cause instanceof UnsupportedMediaFormatExc) {
+      if (cause instanceof ModuleMediaType.UnsupportedMimeTypeExc) {
         throw new ServletModuleUserExc("media.unsupportedformat", new String[] {});
       }
       throw new ServletModuleFailure(e);
@@ -560,7 +559,7 @@ public class ServletModuleOpenIndy extends ServletModule
     }
     catch (Throwable t) {
       logger.error(t.toString());
-      t.printStackTrace(logger.asPrintWriter(logger.DEBUG_MESSAGE));
+      t.printStackTrace(logger.asPrintWriter(LoggerWrapper.DEBUG_MESSAGE));
 
       throw new ServletModuleFailure(t);
     }
@@ -1109,9 +1108,7 @@ public class ServletModuleOpenIndy extends ServletModule
       Map data = new HashMap();
 
       MessageResources messages = MessageResources.getMessageResources("bundles.open");
-      data.put("errorstring",
-              messages.getMessage(getLocale(aRequest), anException.getMessage(), anException.getParameters())
-          );
+      data.put("errorstring", messages.getMessage(getLocale(aRequest), anException.getMessage(), anException.getParameters()));
       data.put("date", StringUtil.date2readableDateTime(new GregorianCalendar()));
 
       deliver(out, aRequest, aResponse, data, null, configuration.getString("ServletModule.OpenIndy.UserErrorTemplate"));