package mircoders.module;
+import java.util.HashMap;
+
import freemarker.template.SimpleList;
+
import mir.entity.Entity;
import mir.entity.EntityList;
-import mir.misc.Logfile;
-import mir.misc.MirConfig;
import mir.module.AbstractModule;
import mir.module.ModuleException;
import mir.storage.StorageObject;
-import mir.storage.StorageObjectException;
+import mir.storage.StorageObjectExc;
+import mir.storage.StorageObjectFailure;
+import mir.log.*;
+
import mircoders.entity.EntityContent;
import mircoders.entity.EntityTopics;
import mircoders.storage.DatabaseContent;
import mircoders.storage.DatabaseContentToTopics;
import mircoders.storage.DatabaseTopics;
-import java.util.HashMap;
-
/*
* ThemenModule -
*
public class ModuleTopics extends AbstractModule {
- static Logfile theLog;
+ static LoggerWrapper logger = new LoggerWrapper("Module.Topics");
public ModuleTopics(StorageObject theStorage) {
this.theStorage = theStorage;
- if (theLog == null)
- theLog = Logfile.getInstance(MirConfig.getProp("Home") + MirConfig.getProp("Module.Themen.Logfile"));
}
public SimpleList getTopicsAsSimpleList() throws ModuleException {
try {
return ((DatabaseTopics) theStorage).getPopupData();
}
- catch (StorageObjectException e) {
+ catch (StorageObjectFailure e) {
throw new ModuleException(e.toString());
}
}
-
/**
* Method getTopicList
*
returnList = getByWhereClause("", "title", -1);
}
catch (Exception e) {
- theLog.printWarning("--getTopicsList: topics could not be fetched");
+ logger.warn("--getTopicsList: topics could not be fetched: " + e.getMessage());
}
return returnList;
}
* Overrides the AbstractModule.set(),
* All dependent ContentEntities are set unproduced.
* @param theValues Hash mit Spalte/Wert-Paaren
- * @return Id des eingefΓΌgten Objekts
+ * @return Id des eingef?gten Objekts
* @exception ModuleException
*/
public String set(HashMap theValues) throws ModuleException {
theEntity.update();
return theEntity.getId();
}
- catch (StorageObjectException e) {
+ catch (StorageObjectFailure e) {
+ e.printStackTrace(System.err);
+ throw new ModuleException(e.toString());
+ } catch (StorageObjectExc e) {
e.printStackTrace(System.err);
throw new ModuleException(e.toString());
}