private static ServletModuleLinksImcs instance = new ServletModuleLinksImcs();
public static ServletModule getInstance() { return instance; }
+
private ServletModuleLinksImcs() {
theLog = Logfile.getInstance(Configuration.getProperty("Home") + Configuration.getProperty("ServletModule.LinksImcs.Logfile"));
templateListString = Configuration.getProperty("ServletModule.LinksImcs.ListTemplate");
public void add(HttpServletRequest req, HttpServletResponse res)
throws ServletModuleException {
try {
+ SimpleHash mergeData = new SimpleHash();
EntityList theList;
+ mergeData.put("new", "1");
+
PrintWriter out = res.getWriter();
int offset = 0;
- theList = mainModule.getByWhereClause(null, offset);
+ theList = mainModule.getByWhereClause("to_parent_id=0", offset);
+ mergeData.put("contentlist",((ModuleLinksImcs)mainModule).getLinksImcsAsSimpleHash());
+
if (theList == null || theList.getCount() == 0 || theList.getCount()>1){
- HTMLTemplateProcessor.process(getLanguage(req)+"/"+templateObjektString, theList, out);
+ //HTMLTemplateProcessor.process(getLanguage(req)+"/"+templateObjektString, theList, out);
+ HTMLTemplateProcessor.process(getLanguage(req)+"/"+templateObjektString, mergeData, out);
+
} else {
- deliver(req, res, theList.elementAt(0), templateObjektString);
+ //deliver(req, res, theList.elementAt(0), templateObjektString);
+ deliver(req, res, mergeData, templateObjektString);
}
} catch(ModuleException e) {