1 package mircoders.storage;
8 import freemarker.template.*;
15 * <b>Diese Klasse implementiert die Datenbankverbindung zur MetaObjekt-Tabelle
20 public class DatabaseImages extends Database implements StorageObject{
22 private static DatabaseImages instance;
23 private static SimpleList publisherPopupData;
25 public static DatabaseImages getInstance() throws StorageObjectException
27 if (instance == null) {
28 instance = new DatabaseImages();
29 instance.myselfDatabase = instance;
34 private DatabaseImages() throws StorageObjectException
37 this.hasTimestamp = true;
38 this.theTable="images";
39 this.theCoreTable="media";
41 this.theEntityClass = Class.forName("mir.entity.EntityImage");
43 catch (Exception e) { throw new StorageObjectException(e.toString()); }
46 public SimpleList getPopupData() {
47 return getPopupData("title",true);
50 public void update(Entity theEntity) throws StorageObjectException
52 theEntity.setValueForProperty("to_media_type","1");
53 String date = theEntity.getValue("date");
55 date = StringUtil.date2webdbDate(new GregorianCalendar());
56 theEntity.setValueForProperty("date",date);
59 super.update(theEntity);
63 public String insert(Entity theEntity) throws StorageObjectException
65 theEntity.setValueForProperty("to_media_type","1");
66 String date = theEntity.getValue("date");
68 date = StringUtil.date2webdbDate(new GregorianCalendar());
69 theEntity.setValueForProperty("date",date);
71 return super.insert(theEntity);
74 // initialisierungen aus den statischen Tabellen