no message
[mir.git] / source / mircoders / servlet / ServletModuleLinksImcs.java
index 32d91b6..ad18048 100755 (executable)
@@ -13,6 +13,7 @@ import mir.module.*;
 import mir.misc.*;
 import mir.entity.*;
 import mir.storage.*;
+import  mir.servlet.ServletModuleException;
 
 import mircoders.entity.*;
 import mircoders.storage.*;
@@ -44,5 +45,29 @@ public class ServletModuleLinksImcs extends ServletModule
       theLog.printDebugInfo("ServletModuleLinksImcs konnte nicht initialisiert werden");
     }
   }
+
+  public void add(HttpServletRequest req, HttpServletResponse res)
+    throws ServletModuleException {
+    try {
+      EntityList   theList;
+      PrintWriter out = res.getWriter();
+      int offset = 0;
+
+      theList = mainModule.getByWhereClause(null, offset);
+      if (theList == null || theList.getCount() == 0 || theList.getCount()>1){
+        HTMLTemplateProcessor.process(getLanguage(req)+"/"+templateListString, theList, out);
+      } else {
+        deliver(req, res, theList.elementAt(0), templateObjektString);
+      }
+
+    } catch(ModuleException e) {
+      throw new ServletModuleException(e.toString());
+    } catch (HTMLParseException e) {
+      throw new ServletModuleException(e.toString());
+    } catch (IOException e) {
+      throw new ServletModuleException(e.toString());
+    }
+
+  }
 }