better error handling
authormh <mh>
Sat, 9 Feb 2002 16:54:04 +0000 (16:54 +0000)
committermh <mh>
Sat, 9 Feb 2002 16:54:04 +0000 (16:54 +0000)
source/mircoders/servlet/ServletModuleOpenIndy.java
source/mircoders/storage/DatabaseLanguage.java

index 31b99bf..ae502b5 100755 (executable)
@@ -37,12 +37,14 @@ import mircoders.producer.*;
 public class ServletModuleOpenIndy extends ServletModule
 {
 
-  private String          commentFormTemplate, commentFormDoneTemplate, commentFormDupeTemplate;
-  private String          postingFormTemplate, postingFormDoneTemplate, postingFormDupeTemplate;
-  private ModuleContent   contentModule;
-  private ModuleImages    imageModule;
-  private ModuleTopics    themenModule;
-  private String          directOp ="yes";
+  private String        commentFormTemplate, commentFormDoneTemplate,
+                        commentFormDupeTemplate;
+  private String        postingFormTemplate, postingFormDoneTemplate,
+                        postingFormDupeTemplate;
+  private ModuleContent contentModule;
+  private ModuleImages  imageModule;
+  private ModuleTopics  themenModule;
+  private String        directOp ="yes";
 
   // Singelton / Kontruktor
   private static ServletModuleOpenIndy instance = new ServletModuleOpenIndy();
@@ -142,8 +144,8 @@ public class ServletModuleOpenIndy extends ServletModule
    *  Method for delivering the form-Page for open posting
    */
 
-  public void addposting(HttpServletRequest req, HttpServletResponse res) throws ServletModuleException
-  {
+  public void addposting(HttpServletRequest req, HttpServletResponse res)
+    throws ServletModuleException {
     SimpleHash mergeData = new SimpleHash();
     String numOfMedia = req.getParameter("medianum");
     if(numOfMedia==null||numOfMedia.equals("")){
@@ -162,12 +164,15 @@ public class ServletModuleOpenIndy extends ServletModule
     
     /** @todo popups missing */
     try{
-      mergeData.put("languagePopUpData",DatabaseLanguage.getInstance().getPopupData());
+      SimpleList popUpData = DatabaseLanguage.getInstance().getPopupData();
+      mergeData.put("languagePopUpData", popUpData );
       mergeData.put("themenPopupData", themenModule.getTopicsAsSimpleList());
     } catch (Exception e) {
-      theLog.printError("languagePopUpData or getTopicslist failed");
-      throw new ServletModuleException("smod -- openindy -- getting language or topics failed: "+e.toString());
-    }
+      theLog.printError("languagePopUpData or getTopicslist failed "
+                        +e.toString());
+      throw new ServletModuleException("OpenIndy -- failed getting language or topics: "+e.toString());
+    } 
+      
     deliver(req, res, mergeData, postingFormTemplate);
   }
 
@@ -342,7 +347,7 @@ public class ServletModuleOpenIndy extends ServletModule
           }
 
           mediaValues.put("to_media_type",mediaTypeId);
-         
+
           //load the classes via reflection
           String MediaId;
           Entity mediaEnt = null;
@@ -385,6 +390,7 @@ public class ServletModuleOpenIndy extends ServletModule
       contentEnt.setValueForProperty("is_published","1");
       contentEnt.update();
 
+
       //dereference mp. -mh
       mp=null;
 
index 6db1af0..502f326 100755 (executable)
@@ -42,7 +42,13 @@ public class DatabaseLanguage extends Database implements StorageObject{
                this.theTable="language";
        }
 
-       public SimpleList getPopupData() throws StorageObjectException { return getPopupData("name",false); }
+       public SimpleList getPopupData() throws StorageObjectException { 
+      SimpleList pData = null;
+      try {
+      pData = getPopupData("name",false);
+      } catch (StorageObjectException e) {System.err.println("FF");}
+      return pData;
+    }
 
 
 }