catch (ClassNotFoundException e) { handleError(res, res.getWriter(), "ServletModule" + moduleName + " not found."); }
catch (IllegalArgumentException e) { handleError( res,res.getWriter(), "ServletModule" + moduleName + " not found."); }
catch (ServletModuleUserException e) {
- handleUserError(res,res.getWriter(), e.getMsg());
+ handleUserError(res,res.getWriter(), e.getMsg());
}
catch (ServletModuleException e){ handleError(res,res.getWriter(), "ServletException in Module ServletModule" + moduleName + " -- " + e.toString()); }
catch (IllegalAccessException e){
// merge with logged in user and messages
SimpleHash mergeData = new SimpleHash();
mergeData.put("session",sessionUrl);
- mergeData.put("login_user", HTMLTemplateProcessor.makeSimpleHash(userEntity));
+ mergeData.put("login_user", userEntity);
if (messageModule == null) messageModule = new ModuleMessage(DatabaseMessages.getInstance());
mergeData.put("messages", HTMLTemplateProcessor.makeSimpleList(messageModule.getByWhereClause(null, "webdb_create desc",0,10)));
HTMLTemplateProcessor.process(res,getLanguage(req,session)+"/"+startTemplate, mergeData,out);
private int defaultLimit;
protected DatabaseAdaptor theAdaptor;
protected Logfile theLog;
- protected Connection con;
+ //protected Connection con;
/**
* Kontruktor bekommt den Filenamen des Konfigurationsfiles übergeben.
* @param hasNullValue Wenn true wird eine leerer Eintrag fuer die Popups erzeugt.
* @return SimpleList Gibt freemarker.template.SimpleList zurueck.
*/
- public SimpleList getPopupData (String name, boolean hasNullValue)
+ public SimpleList getPopupData (String name, boolean hasNullValue)
throws StorageObjectException {
return getPopupData(name, hasNullValue, null);
}
theLog.printError(wo);
throw new StorageObjectException(wo);
}
-
+
}
/**
instances--;
super.finalize();
}
-
- /* @deprecated */
- public HashMap getValues() {
- return super.getValues();
- }
-
}
}
}
+
+ /**
+ * Method getTopicList
+ *
+ * @return SimpleList of all Topics sorted by title
+ *
+ */
+ public SimpleList getTopicsList()
+ {
+ SimpleList returnList=null;
+ try {
+ returnList=HTMLTemplateProcessor.makeSimpleList(getByWhereClause("","title",-1));
+ }
+ catch (Exception e)
+ {
+ theLog.printWarning("--getTopicsList: topics could not be fetched");
+ }
+ return returnList;
+ }
+
}
//create the freemarker-model
SimpleHash mergeData = HTMLTemplateProcessor.makeSimpleHash(currentContentValues);
+ /** @todo all the following should take place in EntityContent */
// get the uploaded media
EntityList currentMediaList = DatabaseContentToMedia.getInstance().getUploadedMedia(currentContent);
if (currentMediaList!=null && currentMediaList.getCount()>=1) {
// get the comments for the article
// and html-ize them
+
+ /** @todo currently this doesn't work
+ * all this should be moved to Entity, and the parsed description should
+ * be delivered via entity.get("description_parsed") */
SimpleList commentList = currentContent.getComments();
if(commentList.isEmpty()==false){
while(commentList.hasNext()){
logHTML(htmlout, "Producer.Content ERROR while producing content ID: " + currentContent.getId()+",skipping it :: "+e.toString());
theLog.printError("Producer.Content ERROR while producing content ID: " + currentContent.getId() +",skipping it :: "+e.toString());
}
-
-
+
+
}//for
if (batchEntityList.hasNextBatch()){
EntityList entityList;
SimpleHash naviPageModel;
- // get the topiclist
- entityList = topicsModule.getByWhereClause("","title",-1);
- SimpleList topicList = HTMLTemplateProcessor.makeSimpleList(entityList);
-
// get the imclinks
entityList = linksImcsModule.getByWhereClause("", "sortpriority, title", -1);
SimpleList imcList = HTMLTemplateProcessor.makeSimpleList(entityList);
// put the informations into the navipagemodel
naviPageModel = new SimpleHash();
- naviPageModel.put("topics", topicList);
+ naviPageModel.put("topics", topicsModule.getTopicsList());
naviPageModel.put("imclist", imcList);
naviPageModel.put("parentlist", parentList);
orderBy="date desc, webdb_create desc";
fileDesc="open";
- EntityList topicsEntityList = topicsModule.getByWhereClause("","title", -1);
- SimpleList topicsList = HTMLTemplateProcessor.makeSimpleList(topicsEntityList);
SimpleScalar title = new SimpleScalar();
title.setValue("Open-Posting");
- setAdditional("topicslist",topicsList);
+ setAdditional("topicslist",topicsModule.getTopicsList());
setAdditional("title",title);
handleIt(htmlout,user,force);
SimpleList mediaList;
SimpleHash contentHash;
- // get the topiclist
- /** @todo should be fetched via ModuleTopics in one rush / no sql!
- * something like topicsModule.getTopicsList returning the SimpleList */
- entityList = topicsModule.getByWhereClause("","title",-1);
- SimpleList topicList = HTMLTemplateProcessor.makeSimpleList(entityList);
-
// get the imclinks
/** @todo don't we want to preproduce and include the imcs? */
entityList = linksImcsModule.getByWhereClause("", "sortpriority, title", -1);
// Additional Information
startPageModel = new SimpleHash();
startPageModel.put("breakingnews", breakingList);
- startPageModel.put("topics", topicList);
+ startPageModel.put("topics", topicsModule.getTopicsList());
startPageModel.put("imclist", imcList);
startPageModel.put("parentlist", parentList);
startPageModel.put("newswire", newsWireList);
throw new ServletModuleException("language/schwerpunkt list could not be fetched.: "
+e.toString());
}
- mergeData.put("login_user", HTMLTemplateProcessor.makeSimpleHash(user));
+ mergeData.put("login_user", user);
deliver(req, res, mergeData, templateObjektString);
}
SimpleHash mergeData = HTMLTemplateProcessor.makeSimpleHash(entContent);
EntityList topicToContent = DatabaseContentToTopics.getInstance().getTopics(entContent);
if (topicToContent!=null && topicToContent.size()>0){
- theLog.printDebugInfo("topicanzahl: "+topicToContent.size());
+ //theLog.printDebugInfo("topicanzahl: "+topicToContent.size());
Entity topics = null;
SimpleList topicList = new SimpleList();
for(int i=0;i<topicToContent.size();i++){
if ((offsetParam = req.getParameter("offset"))!=null) mergeData.put("offset", offsetParam);
if ((whereParam = req.getParameter("where"))!=null) mergeData.put("where", whereParam);
if ((orderParam = req.getParameter("order"))!=null) mergeData.put("order", orderParam);
- mergeData.put("login_user", HTMLTemplateProcessor.makeSimpleHash(_getUser(req)));
+ mergeData.put("login_user", _getUser(req));
deliver(req, res, mergeData, templateObjektString);
} catch (Exception e) {
throw new ServletModuleException(e.toString());
private ServletModuleLinksImcs() {
- theLog = Logfile.getInstance(this.getClass().getName());
+ theLog = Logfile.getInstance(MirConfig.getProp("Home") + MirConfig.getProp("ServletModule.LinksImcs.Logfile"));
templateListString = MirConfig.getProp("ServletModule.LinksImcs.ListTemplate");
templateObjektString = MirConfig.getProp("ServletModule.LinksImcs.ObjektTemplate");
templateConfirmString = MirConfig.getProp("ServletModule.LinksImcs.ConfirmTemplate");
modelRoot.put("parentlist",HTMLTemplateProcessor.makeSimpleList(parentList));
modelRoot.put("languagelist",HTMLTemplateProcessor.makeSimpleList(theLanguageList));
- modelRoot.put("entity", HTMLTemplateProcessor.makeSimpleHash(mainModule.getById(idParam)));
+ modelRoot.put("entity", mainModule.getById(idParam));
deliver(req, res, modelRoot, templateObjektString);
} catch(ModuleException e) {
public static ServletModule getInstance() { return instance; }
private ServletModuleUsers() {
- theLog = Logfile.getInstance(this.getClass().getName());
+ theLog = Logfile.getInstance(MirConfig.getProp("Home") + MirConfig.getProp("ServletModule.Users.Logfile"));
templateListString = MirConfig.getProp("ServletModule.Users.ListTemplate");
templateObjektString = MirConfig.getProp("ServletModule.Users.ObjektTemplate");
templateConfirmString = MirConfig.getProp("ServletModule.Users.ConfirmTemplate");
if (idParam == null) throw new ServletModuleException("Falscher Aufruf: (id) nicht angegeben");
try {
//theLog.printInfo("Showing User with id: " + idParam);
- SimpleHash mergeData = HTMLTemplateProcessor.makeSimpleHash(mainModule.getById(idParam));
- deliver(req, res, mergeData, templateObjektString);
+ deliver(req, res, mainModule.getById(idParam), templateObjektString);
}
catch (ModuleException e) { throw new ServletModuleException(e.toString());}
}
try {
HashMap withValues = getIntersectingValues(req, mainModule.getStorageObject());
String id = mainModule.add(withValues);
- SimpleHash mergeData = HTMLTemplateProcessor.makeSimpleHash(mainModule.getById(id));
- deliver(req, res, mergeData, templateObjektString);
+ deliver(req, res, mainModule.getById(id), templateObjektString);
}
catch (Exception e) { throw new ServletModuleException(e.toString());}
}