--- /dev/null
+package mircoders.storage;
+
+import java.lang.*;
+import java.sql.*;
+import java.io.*;
+import java.util.*;
+
+import freemarker.template.*;
+
+import webdb.storage.*;
+import webdb.entity.*;
+import webdb.misc.*;
+
+/**
+ * <b>Diese Klasse implementiert die Datenbankverbindung zur MetaObjekt-Tabelle
+ *
+ *
+ */
+
+public class DatabaseVideos extends Database implements StorageObject{
+
+ private static DatabaseVideos instance;
+ private static SimpleList publisherPopupData;
+
+ public static DatabaseVideos getInstance() throws StorageObjectException
+ {
+ if (instance == null) {
+ instance = new DatabaseVideos();
+ instance.myselfDatabase = instance;
+ }
+ return instance;
+ }
+
+ private DatabaseVideos() throws StorageObjectException
+ {
+ super();
+ this.hasTimestamp = true;
+ this.theTable="videos";
+ this.theCoreTable="media";
+ try {
+ this.theEntityClass = Class.forName("mir.entity.EntityVideo");
+ }
+ catch (Exception e) { throw new StorageObjectException(e.toString()); }
+ }
+
+ public SimpleList getPopupData() {
+ return getPopupData("title",true);
+ }
+
+ public void update(Entity theEntity) throws StorageObjectException
+ {
+ theEntity.setValueForProperty("to_media_type","3");
+ String date = theEntity.getValue("date");
+ if (date==null){
+ date = StringUtil.date2webdbDate(new GregorianCalendar());
+ theEntity.setValueForProperty("date",date);
+ }
+
+ super.update(theEntity);
+ }
+
+
+ public String insert(Entity theEntity) throws StorageObjectException
+ {
+ theEntity.setValueForProperty("to_media_type","3");
+ String date = theEntity.getValue("date");
+ if (date==null){
+ date = StringUtil.date2webdbDate(new GregorianCalendar());
+ theEntity.setValueForProperty("date",date);
+ }
+ return super.insert(theEntity);
+ }
+
+}