private String postingFormTemplate, postingFormDoneTemplate;
private ModuleContent contentModule;
private ModuleImages imageModule;
+ private ModuleTopics themenModule;
private String directOp ="yes";
// Singelton / Kontruktor
directOp = MirConfig.getProp("DirectOpenposting").toLowerCase();
mainModule = new ModuleComment(DatabaseComment.getInstance());
contentModule = new ModuleContent(DatabaseContent.getInstance());
+ themenModule = new ModuleTopics(DatabaseTopics.getInstance());
imageModule = new ModuleImages(DatabaseImages.getInstance());
defaultAction="addposting";
}
}
mergeData.put("medianum",numOfMedia);
mergeData.put("mediafields",mediaFields);
+ mergeData.put("themenPopupData", themenModule.getTopicsAsSimpleList());
/** @todo popups missing */
// inserting content into database
String cid = contentModule.add(withValues);
-
+
+ String[] to_topicsArr = mp.getParameterValues("to_topic");
+ if (to_topicsArr != null && to_topicsArr.length > 0) {
+ try{
+ DatabaseContentToTopics.getInstance().setTopics(cid,to_topicsArr);
+ theLog.printError("setting content_x_topic success");
+ } catch (Exception e) {
+ theLog.printError("setting content_x_topic failed");
+ } //end try
+ } //end if
+
// if op contains uploaddata
String mediaId=null;
int i=1;
// inserting content and media id in table content_x_media
try{
DatabaseContentToMedia.getInstance().addMedia(cid,mediaId);
- theLog.printError("setting content_x_topic success");
+ theLog.printError("setting content_x_media success");
} catch (Exception e) {
- theLog.printError("setting content_x_topic failed");
+ theLog.printError("setting content_x_media failed");
}
// producing new page
}
catch (IOException e) { throw new ServletModuleException("IOException: "+ e.toString());}
catch (StorageObjectException e) { throw new ServletModuleException("StorageObjectException" + e.toString());}
- catch (ModuleException e) { throw new ServletModuleException("ModuleException"+e.toString());}
+ //catch (ModuleException e) { throw new ServletModuleException("ModuleException"+e.toString());}
+ catch (ModuleException e) { throw new ServletModuleException("ModuleException");}
deliver(req, res, mergeData, postingFormDoneTemplate);
}