small fixes here and there
authorzapata <zapata>
Sun, 8 Feb 2004 21:05:00 +0000 (21:05 +0000)
committerzapata <zapata>
Sun, 8 Feb 2004 21:05:00 +0000 (21:05 +0000)
20 files changed:
source/mir/entity/AbstractEntity.java
source/mir/entity/Entity.java
source/mir/generator/tal/MirExpressionParser.java
source/mir/module/AbstractModule.java
source/mir/storage/Database.java
source/mir/util/GeneratorListFunctions.java
source/mir/util/ParameterExpander.java
source/mir/util/PropertiesManipulator.java
source/mircoders/entity/EntityAudio.java
source/mircoders/entity/EntityComment.java
source/mircoders/entity/EntityContent.java
source/mircoders/entity/EntityOther.java
source/mircoders/entity/EntityUploadedMedia.java
source/mircoders/entity/EntityVideo.java
source/mircoders/localizer/basic/MirBasicArticlePostingHandler.java
source/mircoders/localizer/basic/MirBasicCommentPostingHandler.java
source/mircoders/media/MediaUploadProcessor.java
source/mircoders/module/ModuleComment.java
source/mircoders/module/ModuleTopics.java
source/mircoders/servlet/ServletModuleOpenIndy.java

index 925ff8d..dcd493b 100755 (executable)
@@ -45,7 +45,7 @@ import mir.storage.StorageObjectFailure;
  * Base class the entities are derived from. Provides base functionality of
  * an entity.
  *
- * @version $Id: AbstractEntity.java,v 1.8.2.1 2004/01/18 17:30:56 zapata Exp $
+ * @version $Id: AbstractEntity.java,v 1.8.2.2 2004/02/08 21:05:00 zapata Exp $
  */
 
 public class AbstractEntity implements Entity {
@@ -86,7 +86,7 @@ public class AbstractEntity implements Entity {
   }
 
   /** {@inheritDoc} */
-  public void setValues(Map aMap) {
+  public void setFieldValues(Map aMap) {
     if (aMap!=null) {
       Iterator i = aMap.entrySet().iterator();
       synchronized(this) {
index adfe2d0..a0e6e7a 100755 (executable)
@@ -45,7 +45,7 @@ import mir.storage.StorageObjectFailure;
  * An <code>Entity</code> represents a persistent data object, typically
  *   stored in a database.<p>
  *
- * @version $Id: Entity.java,v 1.21.2.7 2004/01/18 17:30:56 zapata Exp $
+ * @version $Id: Entity.java,v 1.21.2.8 2004/02/08 21:05:01 zapata Exp $
  */
 
 public interface Entity
@@ -58,7 +58,7 @@ public interface Entity
    * @param aMap Map containing the new values of the Entity
    */
 
-  public void setValues(Map aMap);
+  public void setFieldValues(Map aMap);
 
   /**
    * Returns the primary key of the Entity.
index 5aaa797..3d10c60 100755 (executable)
@@ -77,7 +77,7 @@ public class MirExpressionParser implements TALExpressionParser {
 
   public String evaluateStringExpression(Object aContext, Object aPreparsedExpression) {
     try {
-      return ParameterExpander.evaluateStringExpression(aContext, (String) aPreparsedExpression);
+      return ParameterExpander.expandExpression(aContext, (String) aPreparsedExpression);
     }
     catch (Throwable t) {
       throw new TALFailure(t);
index f1bba19..173f6ad 100755 (executable)
@@ -103,7 +103,7 @@ public class AbstractModule {
     try {
       Entity theEntity = (Entity)storage.getEntityClass().newInstance();
       theEntity.setStorage(storage);
-      theEntity.setValues(theValues);
+      theEntity.setFieldValues(theValues);
       return theEntity.insert();
     }
     catch (Throwable e) {
@@ -138,7 +138,7 @@ public class AbstractModule {
       Entity theEntity = storage.selectById((String)theValues.get("id"));
       if (theEntity == null)
         throw new ModuleExc("No object found with id " + theValues.get("id"));
-      theEntity.setValues(theValues);
+      theEntity.setFieldValues(theValues);
       theEntity.update();
       return theEntity.getId();
     }
index 38e7583..a236a48 100755 (executable)
@@ -75,7 +75,7 @@ import com.codestudio.util.SQLManager;
  * Treiber, Host, User und Passwort, ueber den der Zugriff auf die
  * Datenbank erfolgt.
  *
- * @version $Id: Database.java,v 1.44.2.21 2004/01/18 17:30:57 zapata Exp $
+ * @version $Id: Database.java,v 1.44.2.22 2004/02/08 21:05:01 zapata Exp $
  * @author rk
  *
  */
@@ -770,7 +770,7 @@ public class Database implements StorageObject {
       if (theEntityClass != null) {
         returnEntity = (Entity) theEntityClass.newInstance();
         returnEntity.setStorage(this);
-        returnEntity.setValues(theResultHash);
+        returnEntity.setFieldValues(theResultHash);
 
         if (returnEntity instanceof StorableObject) {
           logger.debug("CACHE: ( in) " + returnEntity.getId() + " :" + mainTable);
index 039d202..dcb8614 100755 (executable)
  * 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  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.  
+ * 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 mir.util;
@@ -84,4 +84,44 @@ public class GeneratorListFunctions {
       }
     };
   }
+
+  public static class listSizeFunction implements Generator.GeneratorFunction {
+    public Object perform(List aParameters) throws GeneratorExc, GeneratorFailure {
+      try {
+        if (aParameters.size()!=1)
+          throw new GeneratorExc("listSizeFunction: 1 parameter expected");
+        if (aParameters.get(0)==null)
+          return "";
+
+        if (!(aParameters.get(0) instanceof RewindableIterator) && !(aParameters.get(0) instanceof List))
+          throw new GeneratorExc("listSizeFunction: first parameter must be a RewindableIterator (not a "+aParameters.get(0).getClass().getName()+")");
+
+        if ((aParameters.get(0) instanceof RewindableIterator)) {
+          RewindableIterator iterator = (RewindableIterator) aParameters.get(0);
+          iterator.rewind();
+          int result=0;
+          while (iterator.hasNext()) {
+            result++;
+            iterator.next();
+          }
+
+          iterator.rewind();
+          return new Integer(result);
+        }
+        else {
+          List list = (List) aParameters.get(0);
+          return new Integer(list.size());
+        }
+      }
+      catch (GeneratorExc e) {
+        throw e;
+      }
+      catch (GeneratorFailure e) {
+        throw e;
+      }
+      catch (Throwable e) {
+        throw new GeneratorFailure(e);
+      }
+    };
+  }
 }
index 75f92a7..769f6fb 100755 (executable)
@@ -115,7 +115,7 @@ public class ParameterExpander {
       throw new ParameterExpanderExc( "Can't set key {1}: not inside a Map", new Object[]{aKey} );
   }
 
-  public static String expandExpression(Map aMap, String anExpression) throws Exception {
+  public static String expandExpression(Object aContext, String anExpression) throws Exception {
     int previousPosition = 0;
     int position;
     int endOfExpressionPosition;
@@ -149,7 +149,7 @@ public class ParameterExpander {
             endOfExpressionPosition++;
           }
           if (endOfExpressionPosition<anExpression.length()) {
-            result.append(evaluateStringExpression(aMap, anExpression.substring(position+2, endOfExpressionPosition)));
+            result.append(evaluateStringExpression(aContext, anExpression.substring(position+2, endOfExpressionPosition)));
             previousPosition=endOfExpressionPosition+1;
           }
           else {
@@ -805,7 +805,7 @@ public class ParameterExpander {
       if (aValue instanceof String)
         return (String) aValue;
       if (aValue instanceof Integer)
-        return ((Integer) aValue).toString();
+        return aValue.toString();
 
       throw new RuntimeException("Not a string");
     }
index c76cbbd..25d3e55 100755 (executable)
@@ -117,7 +117,6 @@ public class PropertiesManipulator {
   private final static String ESCAPE= "\\\\[ tn]";
   private final static String UNICODE= "\\\\u[a-fA-F0-9][a-fA-F0-9][a-fA-F0-9][a-fA-F0-9]";
 
-
   private static String decode(String aValue) {
     try {
       SimpleParser parser = new SimpleParser(aValue);
index ac431b7..8ec7dc2 100755 (executable)
  * 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  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.  
+ * 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.
  */
 
@@ -38,7 +38,7 @@ import mir.storage.StorageObject;
  * This class handles storage of audio data and meta data
  *
  * @author mh
- * @version $Id: EntityAudio.java,v 1.11 2003/04/21 12:42:53 idfx Exp $
+ * @version $Id: EntityAudio.java,v 1.11.2.1 2004/02/08 21:05:02 zapata Exp $
  */
 
 
@@ -53,12 +53,12 @@ public class EntityAudio extends EntityUploadedMedia
     setStorage(theStorage);
   }
 
-  public void setValues(Map theStringValues) {
+  public void setFieldValues(Map theStringValues) {
     if (theStringValues != null) {
       if (!theStringValues.containsKey("is_published"))
         theStringValues.put("is_published", "0");
     }
-    super.setValues(theStringValues);
+    super.setFieldValues(theStringValues);
   }
 
 }
index b8baf80..a40c0e0 100755 (executable)
@@ -42,7 +42,7 @@ import mircoders.storage.DatabaseContent;
  * This class maps one line of the comment-table to a java-object.
  *
  * @author $Author: zapata $
- * @version $Revision: 1.16.2.2 $ $Date: 2004/01/18 17:30:58 $
+ * @version $Revision: 1.16.2.3 $ $Date: 2004/02/08 21:05:02 $
  */
 
 
@@ -60,9 +60,9 @@ public class EntityComment extends AbstractEntity {
 
 
   /**
-   * overridden method setValues to patch creator_main_url
+   * overridden method setFieldValues to patch creator_main_url
    */
-  public void setValues(Map theStringValues)
+  public void setFieldValues(Map theStringValues)
   {
     if (theStringValues != null) {
       if (theStringValues.containsKey("main_url")){
@@ -76,7 +76,7 @@ public class EntityComment extends AbstractEntity {
       }
 
     }
-    super.setValues(theStringValues);
+    super.setFieldValues(theStringValues);
   }
 
   /**
index f9c5fdf..b87ae15 100755 (executable)
@@ -45,7 +45,7 @@ import mircoders.storage.DatabaseContentToMedia;
  * this class implements mapping of one line of the database table content
  * to a java object
  *
- * @version $Id: EntityContent.java,v 1.19.2.5 2004/01/18 17:30:58 zapata Exp $
+ * @version $Id: EntityContent.java,v 1.19.2.6 2004/02/08 21:05:02 zapata Exp $
  * @author mir-coders group
  *
  */
@@ -126,9 +126,9 @@ public class EntityContent extends AbstractEntity {
   }
 
   /**
-   * overridden method setValues to patch creator_main_url
+   * overridden method setFieldValues to patch creator_main_url
    */
-  public void setValues(Map theStringValues) {
+  public void setFieldValues(Map theStringValues) {
     if (theStringValues != null) {
       if (theStringValues.containsKey("creator_main_url")){
         if (((String)theStringValues.get("creator_main_url")).equalsIgnoreCase("http://")){
@@ -139,6 +139,6 @@ public class EntityContent extends AbstractEntity {
         }
       }
     }
-    super.setValues(theStringValues);
+    super.setFieldValues(theStringValues);
   }
 }
index 0fa0ad8..d05c5fd 100755 (executable)
  * 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  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.  
+ * 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.
  */
 
@@ -53,12 +53,12 @@ public class EntityOther extends EntityUploadedMedia
     setStorage(theStorage);
   }
 
-  public void setValues(Map theStringValues) {
+  public void setFieldValues(Map theStringValues) {
     if (theStringValues != null) {
       if (!theStringValues.containsKey("is_published"))
         theStringValues.put("is_published", "0");
     }
-    super.setValues(theStringValues);
+    super.setFieldValues(theStringValues);
   }
 
 }
index 436cdb0..8d7c9f7 100755 (executable)
@@ -42,7 +42,7 @@ import mircoders.storage.DatabaseUploadedMedia;
 /**
  *
  * @author mh, mir-coders group
- * @version $Id: EntityUploadedMedia.java,v 1.26.2.6 2004/01/18 17:30:58 zapata Exp $
+ * @version $Id: EntityUploadedMedia.java,v 1.26.2.7 2004/02/08 21:05:02 zapata Exp $
  */
 
 public class EntityUploadedMedia extends AbstractEntity {
@@ -70,12 +70,12 @@ public class EntityUploadedMedia extends AbstractEntity {
     }
   }
 
-  public void setValues(Map theStringValues) {
+  public void setFieldValues(Map theStringValues) {
     if (theStringValues != null) {
       if (!theStringValues.containsKey("is_published"))
         theStringValues.put("is_published", "0");
     }
-    super.setValues(theStringValues);
+    super.setFieldValues(theStringValues);
   }
 
 
index 879fc2c..ed4aaee 100755 (executable)
@@ -55,12 +55,12 @@ public class EntityVideo extends EntityUploadedMedia
     setStorage(theStorage);
   }
 
-  public void setValues(Map theStringValues) {
+  public void setFieldValues(Map theStringValues) {
     if (theStringValues != null) {
       if (!theStringValues.containsKey("is_published"))
         theStringValues.put("is_published", "0");
     }
-    super.setValues(theStringValues);
+    super.setFieldValues(theStringValues);
   }
 
 }
\ No newline at end of file
index 26a5b65..dac7f83 100755 (executable)
@@ -139,7 +139,7 @@ public class MirBasicArticlePostingHandler extends MirBasicPostingSessionHandler
       Map values = getIntersectingValues(aRequest, DatabaseContent.getInstance());
 
       EntityContent article = (EntityContent) contentModule.createNew();
-      article.setValues(values);
+      article.setFieldValues(values);
 
       finalizeArticle(aRequest, aSession, article);
       id = article.insert();
index fe8a692..3e6e6a3 100755 (executable)
@@ -126,7 +126,7 @@ public class MirBasicCommentPostingHandler extends MirBasicPostingSessionHandler
       Map values = getIntersectingValues(aRequest, DatabaseComment.getInstance());
 
       EntityComment comment = (EntityComment) commentModule.createNew();
-      comment.setValues(values);
+      comment.setFieldValues(values);
       finalizeComment(aRequest, aSession, comment);
       id = comment.insert();
       if (id == null) {
index e7d2eb7..f423ddf 100755 (executable)
@@ -89,7 +89,7 @@ public class MediaUploadProcessor {
         throw new MediaFailure(e);
       }
 
-      mediaEntity.setValues(values);
+      mediaEntity.setFieldValues(values);
       mediaId = mediaEntity.insert();
 
       try {
index efef4cc..853eb25 100755 (executable)
@@ -83,7 +83,7 @@ public class ModuleComment extends AbstractModule
       if (theEntity == null)
          throw new ModuleExc("No Object in the database with id " + theValues.get("id"));
       DatabaseContent.getInstance().setUnproduced("id=" + theEntity.getFieldValue("to_media"));
-      theEntity.setValues(theValues);
+      theEntity.setFieldValues(theValues);
       theEntity.update();
       return theEntity.getId();
     }
index 85d9990..f235134 100755 (executable)
@@ -59,7 +59,7 @@ public class ModuleTopics extends AbstractModule {
       if (theEntity == null) {
         throw new ModuleExc("No topic with id  " + theValues.get("id") + " found");
       }
-      theEntity.setValues(theValues);
+      theEntity.setFieldValues(theValues);
       theEntity.update();
 
       return theEntity.getId();
index 0293605..63cebcf 100755 (executable)
@@ -30,9 +30,6 @@
 
 package mircoders.servlet;
 
-import gnu.regexp.RE;
-import gnu.regexp.REMatch;
-
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.PrintWriter;
@@ -50,11 +47,12 @@ import java.util.Map;
 import java.util.Random;
 import java.util.Set;
 import java.util.Vector;
-
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpSession;
 
+import gnu.regexp.RE;
+import gnu.regexp.REMatch;
 import mir.entity.Entity;
 import mir.generator.Generator;
 import mir.log.LoggerWrapper;
@@ -81,9 +79,7 @@ import mircoders.global.MirGlobal;
 import mircoders.media.MediaUploadProcessor;
 import mircoders.module.ModuleComment;
 import mircoders.module.ModuleContent;
-import mircoders.module.ModuleImages;
 import mircoders.module.ModuleMediaType;
-import mircoders.module.ModuleTopics;
 import mircoders.pdf.PDFGenerator;
 import mircoders.search.AudioSearchTerm;
 import mircoders.search.ContentSearchTerm;
@@ -98,10 +94,8 @@ import mircoders.storage.DatabaseComment;
 import mircoders.storage.DatabaseContent;
 import mircoders.storage.DatabaseContentToMedia;
 import mircoders.storage.DatabaseContentToTopics;
-import mircoders.storage.DatabaseImages;
 import mircoders.storage.DatabaseLanguage;
 import mircoders.storage.DatabaseTopics;
-
 import org.apache.commons.fileupload.FileItem;
 import org.apache.commons.net.smtp.SMTPClient;
 import org.apache.commons.net.smtp.SMTPReply;
@@ -121,7 +115,7 @@ import org.apache.struts.util.MessageResources;
  *    open-postings to the newswire
  *
  * @author mir-coders group
- * @version $Id: ServletModuleOpenIndy.java,v 1.89.2.10 2004/01/11 20:35:53 zapata Exp $
+ * @version $Id: ServletModuleOpenIndy.java,v 1.89.2.11 2004/02/08 21:05:03 zapata Exp $
  *
  */
 
@@ -134,8 +128,6 @@ public class ServletModuleOpenIndy extends ServletModule
   private String        prepareMailTemplate,sentMailTemplate,emailAnArticleTemplate;
   private ModuleContent contentModule;
   private ModuleComment commentModule;
-  private ModuleImages  imageModule;
-  private ModuleTopics  topicsModule;
   private String        directOp ="yes";
   // Singelton / Kontruktor
   private static ServletModuleOpenIndy instance = new ServletModuleOpenIndy();
@@ -162,9 +154,7 @@ public class ServletModuleOpenIndy extends ServletModule
       commentModule = new ModuleComment(DatabaseComment.getInstance());
       mainModule = commentModule;
       contentModule = new ModuleContent(DatabaseContent.getInstance());
-      topicsModule = new ModuleTopics(DatabaseTopics.getInstance());
-      imageModule = new ModuleImages(DatabaseImages.getInstance());
-      defaultAction="addposting";
+      defaultAction = "defaultAction";
     }
     catch (StorageObjectFailure e) {
       logger.error("servletmoduleopenindy could not be initialized: " + e.getMessage());
@@ -172,7 +162,14 @@ public class ServletModuleOpenIndy extends ServletModule
   }
 
   /**
-   * Method to return an "apology" when open postings are disabled
+   * Perform the default open posting action
+   */
+  public void defaultAction(HttpServletRequest aRequest, HttpServletResponse aResponse) throws ServletModuleExc, ServletModuleUserExc, ServletModuleFailure {
+    opensession(aRequest, aResponse);
+  }
+
+  /**
+   * Method to return an out of service notice when open postings are disabled
    *
    * @param aRequest
    * @param aResponse
@@ -181,14 +178,12 @@ public class ServletModuleOpenIndy extends ServletModule
    * @throws ServletModuleFailure
    */
   public void openPostingDisabled(HttpServletRequest aRequest, HttpServletResponse aResponse) throws ServletModuleExc, ServletModuleUserExc, ServletModuleFailure {
-    deliver(aRequest, aResponse, (Map) null, null,
-       configuration.getString("ServletModule.OpenIndy.PostingDisabledTemplate"));
+    deliver(aRequest, aResponse, null, null, configuration.getString("ServletModule.OpenIndy.PostingDisabledTemplate"));
   }
 
   /**
    *  Method for making a comment
    */
-
   public void addcomment(HttpServletRequest req, HttpServletResponse res) throws ServletModuleExc, ServletModuleUserExc, ServletModuleFailure {
     if (MirGlobal.abuse().getOpenPostingDisabled()) {
       openPostingDisabled(req, res);
@@ -204,13 +199,13 @@ public class ServletModuleOpenIndy extends ServletModule
 
         // onetimepasswd
         if (MirGlobal.abuse().getOpenPostingPassword()) {
-          String passwd = this.createOneTimePasswd();
+          String passwd = generateOnetimePassword();
           HttpSession session = req.getSession(false);
           session.setAttribute("passwd", passwd);
           mergeData.put("passwd", passwd);
         }
         else {
-          mergeData.put("passwd", (String)null);
+          mergeData.put("passwd", null);
         }
         mergeData.put("aid", aid);
 
@@ -276,7 +271,7 @@ public class ServletModuleOpenIndy extends ServletModule
         response.setResponseGenerator(commentFormDoneTemplate);
 
         if (id == null) {
-          deliver(req, res, (Map)null, null, commentFormDupeTemplate);
+          deliver(req, res, null, null, commentFormDupeTemplate);
         }
         else {
           DatabaseContent.getInstance().setUnproduced("id=" + aid);
@@ -328,7 +323,7 @@ public class ServletModuleOpenIndy extends ServletModule
         mergeData.put("passwd", passwd);
       }
       else {
-        mergeData.put("passwd", (String)null);
+        mergeData.put("passwd", null);
       }
 
       String maxMedia = configuration.getString("ServletModule.OpenIndy.MaxMediaUploadItems");
@@ -388,7 +383,7 @@ public class ServletModuleOpenIndy extends ServletModule
       HttpSession session = aRequest.getSession(false);
       String sessionPasswd = (String) session.getAttribute("passwd");
       if (sessionPasswd != null) {
-        String passwd = (String) parsedRequest.getParameter("passwd");
+        String passwd = parsedRequest.getParameter("passwd");
 
         if (passwd == null || passwd.length() == 0) {
           throw new ServletModuleUserExc("posting.error.missingpassword", new String[] {});
@@ -399,9 +394,9 @@ public class ServletModuleOpenIndy extends ServletModule
         session.invalidate();
       }
 
-      if ((((String) parsedRequest.getParameter("title")).length() == 0) ||
-          (((String) parsedRequest.getParameter("description")).length() == 0) ||
-          (((String) parsedRequest.getParameter("content_data")).length() == 0))
+      if (((parsedRequest.getParameter("title")).length() == 0) ||
+          ((parsedRequest.getParameter("description")).length() == 0) ||
+          ((parsedRequest.getParameter("content_data")).length() == 0))
         throw new ServletModuleUserExc("posting.error.missingfield", new String[] {});
 
       List mediaList = new Vector();
@@ -523,12 +518,8 @@ public class ServletModuleOpenIndy extends ServletModule
   private static final String SESSION_REQUEST_KEY="sessionid";
 
   /**
-   * Selects the language for the response.
-   *
-   * @param session
-   * @param aRequest
+   * Determines the Locale to be used for the current session
    */
-
   protected Locale getResponseLocale(HttpSession aSession, HttpServletRequest aRequest) {
     String requestLanguage = aRequest.getParameter("language");
     String sessionLanguage = (String) aSession.getAttribute("language");
@@ -561,7 +552,6 @@ public class ServletModuleOpenIndy extends ServletModule
    * @throws ServletModuleUserExc
    * @throws ServletModuleFailure
    */
-
   public void opensession(HttpServletRequest aRequest, HttpServletResponse aResponse)
       throws ServletModuleExc, ServletModuleUserExc, ServletModuleFailure {
 
@@ -600,7 +590,6 @@ public class ServletModuleOpenIndy extends ServletModule
   /**
    * Method for preparing and sending a content as an email message
    */
-
   public void mail(HttpServletRequest req, HttpServletResponse res)
       throws ServletModuleExc, ServletModuleUserExc, ServletModuleFailure
   {
@@ -957,7 +946,7 @@ public class ServletModuleOpenIndy extends ServletModule
         ArrayList theDocs = (ArrayList) session.getAttribute("theDocumentsSorted");
         if (theDocs != null) {
 
-          mergeData.put("numberOfHits", ( (Integer) session.getAttribute("numberOfHits")).toString());
+          mergeData.put("numberOfHits", (session.getAttribute("numberOfHits")).toString());
           List theHits = new Vector();
           int pIR = ( (Integer) session.getAttribute("positionInResults")).intValue();
           int terminus;
@@ -1191,8 +1180,4 @@ public class ServletModuleOpenIndy extends ServletModule
       throw new ServletModuleFailure(e);
     }
   }
-
-  private String createOneTimePasswd() {
-    return "";
-  }
 }