projects
/
mir.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
no message
[mir.git]
/
source
/
mircoders
/
servlet
/
ServletModuleLinksImcs.java
diff --git
a/source/mircoders/servlet/ServletModuleLinksImcs.java
b/source/mircoders/servlet/ServletModuleLinksImcs.java
index
7e9efae
..
2e5d022
100755
(executable)
--- a/
source/mircoders/servlet/ServletModuleLinksImcs.java
+++ b/
source/mircoders/servlet/ServletModuleLinksImcs.java
@@
-33,6
+33,7
@@
public class ServletModuleLinksImcs extends ServletModule
private static ServletModuleLinksImcs instance = new ServletModuleLinksImcs();
public static ServletModule getInstance() { return instance; }
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");
private ServletModuleLinksImcs() {
theLog = Logfile.getInstance(Configuration.getProperty("Home") + Configuration.getProperty("ServletModule.LinksImcs.Logfile"));
templateListString = Configuration.getProperty("ServletModule.LinksImcs.ListTemplate");
@@
-49,15
+50,22
@@
public class ServletModuleLinksImcs extends ServletModule
public void add(HttpServletRequest req, HttpServletResponse res)
throws ServletModuleException {
try {
public void add(HttpServletRequest req, HttpServletResponse res)
throws ServletModuleException {
try {
+ SimpleHash modelRoot = new SimpleHash();
EntityList theList;
EntityList theList;
- PrintWriter out = res.getWriter();
int offset = 0;
int offset = 0;
- theList = mainModule.getByWhereClause(null, offset);
+ theList = mainModule.getByWhereClause("to_parent_id=0", offset);
+ modelRoot.put("new", "1");
+ modelRoot.put("contentlist",HTMLTemplateProcessor.makeSimpleList(theList));
+ PrintWriter out = res.getWriter();
+
if (theList == null || theList.getCount() == 0 || theList.getCount()>1){
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, modelRoot, out);
+
} else {
} else {
- deliver(req, res, theList.elementAt(0), templateObjektString);
+ //deliver(req, res, theList.elementAt(0), templateObjektString);
+ deliver(req, res, modelRoot, templateObjektString);
}
} catch(ModuleException e) {
}
} catch(ModuleException e) {
@@
-66,8
+74,11
@@
public class ServletModuleLinksImcs extends ServletModule
throw new ServletModuleException(e.toString());
} catch (IOException e) {
throw new ServletModuleException(e.toString());
throw new ServletModuleException(e.toString());
} catch (IOException e) {
throw new ServletModuleException(e.toString());
+ } catch(StorageObjectException e) {
+ throw new ServletModuleException(e.toString());
}
}
+
}
}
}
}