- 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 (Exception e) {
+
+ if (offset==null || offset.equals("")) offset="0";
+ modelRoot.put("offset",(new Integer(offset)).toString());
+
+ theParentList = mainModule.getByWhereClause("to_parent_id=NULL", "title", 0, 1000);
+ theImcsList = mainModule.getByWhereClause(whereClause, "title", (new Integer(offset)).intValue());
+ theLanguageList = languageModule.getByWhereClause(null, "name", 0);
+
+ modelRoot.put("parentlist",HTMLTemplateProcessor.makeSimpleList(theParentList));
+ modelRoot.put("imcslist",HTMLTemplateProcessor.makeSimpleList(theImcsList));
+ modelRoot.put("languagelist",HTMLTemplateProcessor.makeSimpleList(theLanguageList));
+ modelRoot.put("count", (new Integer(theImcsList.getCount())).toString());
+ modelRoot.put("from", (new Integer(theImcsList.getFrom())).toString());
+ modelRoot.put("to", (new Integer(theImcsList.getTo())).toString());
+ if (theImcsList.hasNextBatch())
+ modelRoot.put("next", (new Integer(theImcsList.getNextBatch())).toString());
+ if (theImcsList.hasPrevBatch())
+ modelRoot.put("prev", (new Integer(theImcsList.getPrevBatch())).toString());
+
+ HTMLTemplateProcessor.process(res,getLanguage(req)+"/"+templateListString, modelRoot, res.getWriter());
+
+ } catch (Exception e) {
+ throw new ServletModuleException(e.toString());
+ }
+ }
+
+ public void edit(HttpServletRequest req, HttpServletResponse res)
+ throws ServletModuleException {
+ try {
+
+ SimpleHash modelRoot = new SimpleHash();
+ EntityList parentList;
+ EntityList theLanguageList;
+ int offset = 0;
+ String idParam = req.getParameter("id");
+ String where = "";
+
+ parentList = mainModule.getByWhereClause("to_parent_id=NULL", "title", offset, 1000);
+ theLanguageList = languageModule.getByWhereClause(null, "name", 0);
+
+ modelRoot.put("parentlist",HTMLTemplateProcessor.makeSimpleList(parentList));
+ modelRoot.put("languagelist",HTMLTemplateProcessor.makeSimpleList(theLanguageList));
+ modelRoot.put("entity", mainModule.getById(idParam));
+ deliver(req, res, modelRoot, templateObjektString);
+
+ } catch(ModuleException e) {
+ throw new ServletModuleException(e.toString());
+ } catch(StorageObjectException e) {