service layer which is used instead of the old module-layer
authoridfx <idfx>
Sun, 17 Aug 2003 19:11:49 +0000 (19:11 +0000)
committeridfx <idfx>
Sun, 17 Aug 2003 19:11:49 +0000 (19:11 +0000)
17 files changed:
source/mir/core/service/storage/ArticleTypeService.java [new file with mode: 0755]
source/mir/core/service/storage/AudioService.java [new file with mode: 0755]
source/mir/core/service/storage/BreakingService.java [new file with mode: 0755]
source/mir/core/service/storage/CommentService.java [new file with mode: 0755]
source/mir/core/service/storage/CommentStatusService.java [new file with mode: 0755]
source/mir/core/service/storage/ContentService.java [new file with mode: 0755]
source/mir/core/service/storage/ImageService.java [new file with mode: 0755]
source/mir/core/service/storage/LanguageService.java [new file with mode: 0755]
source/mir/core/service/storage/MediaFolderService.java [new file with mode: 0755]
source/mir/core/service/storage/MessageService.java [new file with mode: 0755]
source/mir/core/service/storage/OtherMediaService.java [new file with mode: 0755]
source/mir/core/service/storage/StorageService.java [new file with mode: 0755]
source/mir/core/service/storage/StorageServiceFailure.java [new file with mode: 0755]
source/mir/core/service/storage/TopicService.java [new file with mode: 0755]
source/mir/core/service/storage/UploadedMediaService.java [new file with mode: 0755]
source/mir/core/service/storage/UserService.java [new file with mode: 0755]
source/mir/core/service/storage/VideoService.java [new file with mode: 0755]

diff --git a/source/mir/core/service/storage/ArticleTypeService.java b/source/mir/core/service/storage/ArticleTypeService.java
new file mode 100755 (executable)
index 0000000..22fd9db
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * ArticleTypeService.java created on 17.08.2003
+ * 
+ * Copyright (C) 2001, 2002, 2003 The Mir-coders group
+ *
+ * This file is part of Mir.
+ *
+ * Mir is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Mir is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Mir; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * In addition, as a special exception, The Mir-coders gives permission to link
+ * the code of this program with  any library licensed under the Apache Software License,
+ * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library
+ * (or with modified versions of the above that use the same license as the above),
+ * and distribute linked combinations including the two.  You must obey the
+ * GNU General Public License in all respects for all of the code used other than
+ * the above mentioned libraries.  If you modify this file, you may extend this
+ * exception to your version of the file, but you are not obligated to do so.
+ * If you do not wish to do so, delete this exception statement from your version.
+ */
+package mir.core.service.storage;
+
+import mir.core.model.ArticleType;
+import net.sf.hibernate.SessionFactory;
+
+/**
+ * ArticleTypeService
+ * @author idefix
+ * @version $Id: ArticleTypeService.java,v 1.1 2003/08/17 19:11:49 idfx Exp $
+ */
+public class ArticleTypeService extends StorageService {
+
+       /**
+        * @param objectClass
+        * @param factory
+        */
+       public ArticleTypeService(SessionFactory factory) {
+               super(ArticleType.class, factory);
+       }
+
+}
diff --git a/source/mir/core/service/storage/AudioService.java b/source/mir/core/service/storage/AudioService.java
new file mode 100755 (executable)
index 0000000..5561b80
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * AudioService.java created on 17.08.2003
+ * 
+ * Copyright (C) 2001, 2002, 2003 The Mir-coders group
+ *
+ * This file is part of Mir.
+ *
+ * Mir is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Mir is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Mir; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * In addition, as a special exception, The Mir-coders gives permission to link
+ * the code of this program with  any library licensed under the Apache Software License,
+ * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library
+ * (or with modified versions of the above that use the same license as the above),
+ * and distribute linked combinations including the two.  You must obey the
+ * GNU General Public License in all respects for all of the code used other than
+ * the above mentioned libraries.  If you modify this file, you may extend this
+ * exception to your version of the file, but you are not obligated to do so.
+ * If you do not wish to do so, delete this exception statement from your version.
+ */
+package mir.core.service.storage;
+
+import mir.core.model.Audio;
+import net.sf.hibernate.SessionFactory;
+
+/**
+ * AudioService
+ * @author idefix
+ * @version $Id: AudioService.java,v 1.1 2003/08/17 19:11:49 idfx Exp $
+ */
+public class AudioService extends StorageService {
+
+       /**
+        * @param objectClass
+        * @param factory
+        */
+       public AudioService(SessionFactory factory) {
+               super(Audio.class, factory);
+       }
+
+}
diff --git a/source/mir/core/service/storage/BreakingService.java b/source/mir/core/service/storage/BreakingService.java
new file mode 100755 (executable)
index 0000000..ee83234
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * BreakingService.java created on 17.08.2003
+ * 
+ * Copyright (C) 2001, 2002, 2003 The Mir-coders group
+ *
+ * This file is part of Mir.
+ *
+ * Mir is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Mir is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Mir; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * In addition, as a special exception, The Mir-coders gives permission to link
+ * the code of this program with  any library licensed under the Apache Software License,
+ * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library
+ * (or with modified versions of the above that use the same license as the above),
+ * and distribute linked combinations including the two.  You must obey the
+ * GNU General Public License in all respects for all of the code used other than
+ * the above mentioned libraries.  If you modify this file, you may extend this
+ * exception to your version of the file, but you are not obligated to do so.
+ * If you do not wish to do so, delete this exception statement from your version.
+ */
+package mir.core.service.storage;
+
+import mir.core.model.BreakingNewsItem;
+import net.sf.hibernate.SessionFactory;
+
+/**
+ * BreakingService
+ * @author idefix
+ * @version $Id: BreakingService.java,v 1.1 2003/08/17 19:11:49 idfx Exp $
+ */
+public class BreakingService extends StorageService {
+
+       /**
+        * @param objectClass
+        * @param factory
+        */
+       public BreakingService(SessionFactory factory) {
+               super(BreakingNewsItem.class, factory);
+       }
+
+}
diff --git a/source/mir/core/service/storage/CommentService.java b/source/mir/core/service/storage/CommentService.java
new file mode 100755 (executable)
index 0000000..22344ad
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * CommentService.java created on 17.08.2003
+ * 
+ * Copyright (C) 2001, 2002, 2003 The Mir-coders group
+ *
+ * This file is part of Mir.
+ *
+ * Mir is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Mir is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Mir; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * In addition, as a special exception, The Mir-coders gives permission to link
+ * the code of this program with  any library licensed under the Apache Software License,
+ * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library
+ * (or with modified versions of the above that use the same license as the above),
+ * and distribute linked combinations including the two.  You must obey the
+ * GNU General Public License in all respects for all of the code used other than
+ * the above mentioned libraries.  If you modify this file, you may extend this
+ * exception to your version of the file, but you are not obligated to do so.
+ * If you do not wish to do so, delete this exception statement from your version.
+ */
+package mir.core.service.storage;
+
+import mir.core.model.Comment;
+import net.sf.hibernate.SessionFactory;
+
+/**
+ * CommentService
+ * @author idefix
+ * @version $Id: CommentService.java,v 1.1 2003/08/17 19:11:49 idfx Exp $
+ */
+public class CommentService extends StorageService {
+
+       /**
+        * @param objectClass
+        * @param factory
+        */
+       public CommentService(SessionFactory factory) {
+               super(Comment.class, factory);
+       }
+
+}
diff --git a/source/mir/core/service/storage/CommentStatusService.java b/source/mir/core/service/storage/CommentStatusService.java
new file mode 100755 (executable)
index 0000000..dbd5810
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * CommentStatusService.java created on 17.08.2003
+ * 
+ * Copyright (C) 2001, 2002, 2003 The Mir-coders group
+ *
+ * This file is part of Mir.
+ *
+ * Mir is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Mir is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Mir; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * In addition, as a special exception, The Mir-coders gives permission to link
+ * the code of this program with  any library licensed under the Apache Software License,
+ * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library
+ * (or with modified versions of the above that use the same license as the above),
+ * and distribute linked combinations including the two.  You must obey the
+ * GNU General Public License in all respects for all of the code used other than
+ * the above mentioned libraries.  If you modify this file, you may extend this
+ * exception to your version of the file, but you are not obligated to do so.
+ * If you do not wish to do so, delete this exception statement from your version.
+ */
+package mir.core.service.storage;
+
+import mir.core.model.CommentStatus;
+import net.sf.hibernate.SessionFactory;
+
+/**
+ * CommentStatusService
+ * @author idefix
+ * @version $Id: CommentStatusService.java,v 1.1 2003/08/17 19:11:49 idfx Exp $
+ */
+public class CommentStatusService extends StorageService {
+
+       /**
+        * @param objectClass
+        * @param factory
+        */
+       public CommentStatusService(SessionFactory factory) {
+               super(CommentStatus.class, factory);
+       }
+
+}
diff --git a/source/mir/core/service/storage/ContentService.java b/source/mir/core/service/storage/ContentService.java
new file mode 100755 (executable)
index 0000000..f199fba
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * ContentService.java
+ * 
+ * Copyright (C) 2001, 2002, 2003 The Mir-coders group
+ *
+ * This file is part of Mir.
+ *
+ * Mir is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Mir is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Mir; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * In addition, as a special exception, The Mir-coders gives permission to link
+ * the code of this program with  any library licensed under the Apache Software License,
+ * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library
+ * (or with modified versions of the above that use the same license as the above),
+ * and distribute linked combinations including the two.  You must obey the
+ * GNU General Public License in all respects for all of the code used other than
+ * the above mentioned libraries.  If you modify this file, you may extend this
+ * exception to your version of the file, but you are not obligated to do so.
+ * If you do not wish to do so, delete this exception statement from your version.
+ */
+package mir.core.service.storage;
+
+import mir.core.model.Content;
+import net.sf.hibernate.SessionFactory;
+
+/**
+ * ContentService
+ * @author idefix
+ * @version $Id: ContentService.java,v 1.1 2003/08/17 19:11:49 idfx Exp $
+ */
+public class ContentService extends StorageService {
+
+       /**
+        * @param objectClass
+        * @param factory
+        */
+       public ContentService(SessionFactory factory) {
+               super(Content.class, factory);
+       }
+
+}
diff --git a/source/mir/core/service/storage/ImageService.java b/source/mir/core/service/storage/ImageService.java
new file mode 100755 (executable)
index 0000000..c510508
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * ImageService.java created on 17.08.2003
+ * 
+ * Copyright (C) 2001, 2002, 2003 The Mir-coders group
+ *
+ * This file is part of Mir.
+ *
+ * Mir is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Mir is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Mir; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * In addition, as a special exception, The Mir-coders gives permission to link
+ * the code of this program with  any library licensed under the Apache Software License,
+ * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library
+ * (or with modified versions of the above that use the same license as the above),
+ * and distribute linked combinations including the two.  You must obey the
+ * GNU General Public License in all respects for all of the code used other than
+ * the above mentioned libraries.  If you modify this file, you may extend this
+ * exception to your version of the file, but you are not obligated to do so.
+ * If you do not wish to do so, delete this exception statement from your version.
+ */
+package mir.core.service.storage;
+
+import mir.core.model.Image;
+import net.sf.hibernate.SessionFactory;
+
+/**
+ * ImageService
+ * @author idefix
+ * @version $Id: ImageService.java,v 1.1 2003/08/17 19:11:49 idfx Exp $
+ */
+public class ImageService extends StorageService {
+
+       /**
+        * @param objectClass
+        * @param factory
+        */
+       public ImageService(SessionFactory factory) {
+               super(Image.class, factory);
+       }
+
+}
diff --git a/source/mir/core/service/storage/LanguageService.java b/source/mir/core/service/storage/LanguageService.java
new file mode 100755 (executable)
index 0000000..febf0fd
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * LanguageService.java created on 17.08.2003
+ * 
+ * Copyright (C) 2001, 2002, 2003 The Mir-coders group
+ *
+ * This file is part of Mir.
+ *
+ * Mir is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Mir is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Mir; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * In addition, as a special exception, The Mir-coders gives permission to link
+ * the code of this program with  any library licensed under the Apache Software License,
+ * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library
+ * (or with modified versions of the above that use the same license as the above),
+ * and distribute linked combinations including the two.  You must obey the
+ * GNU General Public License in all respects for all of the code used other than
+ * the above mentioned libraries.  If you modify this file, you may extend this
+ * exception to your version of the file, but you are not obligated to do so.
+ * If you do not wish to do so, delete this exception statement from your version.
+ */
+package mir.core.service.storage;
+
+import mir.core.model.Language;
+import net.sf.hibernate.SessionFactory;
+
+/**
+ * LanguageService
+ * @author idefix
+ * @version $Id: LanguageService.java,v 1.1 2003/08/17 19:11:49 idfx Exp $
+ */
+public class LanguageService extends StorageService {
+
+       /**
+        * @param objectClass
+        * @param factory
+        */
+       public LanguageService(SessionFactory factory) {
+               super(Language.class, factory);
+       }
+
+}
diff --git a/source/mir/core/service/storage/MediaFolderService.java b/source/mir/core/service/storage/MediaFolderService.java
new file mode 100755 (executable)
index 0000000..2a650c0
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * MediaFolderService.java created on 17.08.2003
+ * 
+ * Copyright (C) 2001, 2002, 2003 The Mir-coders group
+ *
+ * This file is part of Mir.
+ *
+ * Mir is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Mir is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Mir; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * In addition, as a special exception, The Mir-coders gives permission to link
+ * the code of this program with  any library licensed under the Apache Software License,
+ * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library
+ * (or with modified versions of the above that use the same license as the above),
+ * and distribute linked combinations including the two.  You must obey the
+ * GNU General Public License in all respects for all of the code used other than
+ * the above mentioned libraries.  If you modify this file, you may extend this
+ * exception to your version of the file, but you are not obligated to do so.
+ * If you do not wish to do so, delete this exception statement from your version.
+ */
+package mir.core.service.storage;
+
+import mir.core.model.MediaFolder;
+import net.sf.hibernate.SessionFactory;
+
+/**
+ * MediaFolderService
+ * @author idefix
+ * @version $Id: MediaFolderService.java,v 1.1 2003/08/17 19:11:49 idfx Exp $
+ */
+public class MediaFolderService extends StorageService {
+
+       /**
+        * @param objectClass
+        * @param factory
+        */
+       public MediaFolderService(SessionFactory factory) {
+               super(MediaFolder.class, factory);
+       }
+
+}
diff --git a/source/mir/core/service/storage/MessageService.java b/source/mir/core/service/storage/MessageService.java
new file mode 100755 (executable)
index 0000000..471fba8
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * MessageService.java created on 17.08.2003
+ * 
+ * Copyright (C) 2001, 2002, 2003 The Mir-coders group
+ *
+ * This file is part of Mir.
+ *
+ * Mir is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Mir is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Mir; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * In addition, as a special exception, The Mir-coders gives permission to link
+ * the code of this program with  any library licensed under the Apache Software License,
+ * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library
+ * (or with modified versions of the above that use the same license as the above),
+ * and distribute linked combinations including the two.  You must obey the
+ * GNU General Public License in all respects for all of the code used other than
+ * the above mentioned libraries.  If you modify this file, you may extend this
+ * exception to your version of the file, but you are not obligated to do so.
+ * If you do not wish to do so, delete this exception statement from your version.
+ */
+package mir.core.service.storage;
+
+import mir.core.model.Message;
+import net.sf.hibernate.SessionFactory;
+
+/**
+ * MessageService
+ * @author idefix
+ * @version $Id: MessageService.java,v 1.1 2003/08/17 19:11:49 idfx Exp $
+ */
+public class MessageService extends StorageService {
+
+       /**
+        * @param objectClass
+        * @param factory
+        */
+       public MessageService(SessionFactory factory) {
+               super(Message.class, factory);
+       }
+
+}
diff --git a/source/mir/core/service/storage/OtherMediaService.java b/source/mir/core/service/storage/OtherMediaService.java
new file mode 100755 (executable)
index 0000000..3660939
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * OtherMediaService.java created on 17.08.2003
+ * 
+ * Copyright (C) 2001, 2002, 2003 The Mir-coders group
+ *
+ * This file is part of Mir.
+ *
+ * Mir is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Mir is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Mir; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * In addition, as a special exception, The Mir-coders gives permission to link
+ * the code of this program with  any library licensed under the Apache Software License,
+ * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library
+ * (or with modified versions of the above that use the same license as the above),
+ * and distribute linked combinations including the two.  You must obey the
+ * GNU General Public License in all respects for all of the code used other than
+ * the above mentioned libraries.  If you modify this file, you may extend this
+ * exception to your version of the file, but you are not obligated to do so.
+ * If you do not wish to do so, delete this exception statement from your version.
+ */
+package mir.core.service.storage;
+
+import mir.core.model.OtherMedia;
+import net.sf.hibernate.SessionFactory;
+
+/**
+ * OtherMediaService
+ * @author idefix
+ * @version $Id: OtherMediaService.java,v 1.1 2003/08/17 19:11:49 idfx Exp $
+ */
+public class OtherMediaService extends StorageService {
+
+       /**
+        * @param objectClass
+        * @param factory
+        */
+       public OtherMediaService(SessionFactory factory) {
+               super(OtherMedia.class, factory);
+       }
+
+}
diff --git a/source/mir/core/service/storage/StorageService.java b/source/mir/core/service/storage/StorageService.java
new file mode 100755 (executable)
index 0000000..efa2e50
--- /dev/null
@@ -0,0 +1,130 @@
+/*
+ * StorageService.java
+ * 
+ * Copyright (C) 2001, 2002, 2003 The Mir-coders group
+ *
+ * This file is part of Mir.
+ *
+ * Mir is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Mir is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Mir; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * In addition, as a special exception, The Mir-coders gives permission to link
+ * the code of this program with  any library licensed under the Apache Software License,
+ * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library
+ * (or with modified versions of the above that use the same license as the above),
+ * and distribute linked combinations including the two.  You must obey the
+ * GNU General Public License in all respects for all of the code used other than
+ * the above mentioned libraries.  If you modify this file, you may extend this
+ * exception to your version of the file, but you are not obligated to do so.
+ * If you do not wish to do so, delete this exception statement from your version.
+ */
+package mir.core.service.storage;
+
+import java.util.List;
+
+import net.sf.hibernate.Criteria;
+import net.sf.hibernate.HibernateException;
+import net.sf.hibernate.Session;
+import net.sf.hibernate.SessionFactory;
+import net.sf.hibernate.Transaction;
+import net.sf.hibernate.expression.Expression;
+
+/**
+ * 
+ * StorageService
+ * @author idefix
+ * @version $Id: StorageService.java,v 1.1 2003/08/17 19:11:49 idfx Exp $
+ */
+public abstract class StorageService {
+       private Class objectClass;
+       private SessionFactory factory;
+       
+       public StorageService(Class objectClass, SessionFactory factory){
+               this.objectClass = objectClass;
+               this.factory = factory;
+       }
+
+       public List list(int offset, int limit){
+               return list(offset, limit, null);
+       }
+       
+       public List list(int offset, int limit, Expression expression){
+               try {
+                       Session session = factory.openSession();
+                       Transaction transaction = session.beginTransaction();
+                       Criteria criteria = session.createCriteria(objectClass);
+                       if(expression != null){
+                               System.out.println(expression.toString());
+                               criteria = criteria.add(expression);
+                       }       
+                       criteria.setFirstResult(offset)
+                               .setMaxResults(limit);
+                       List returnList = criteria.list();
+                       transaction.commit();
+                       session.close();
+                       return returnList;
+               } catch (HibernateException e) {
+                       throw new StorageServiceFailure(e);
+               }
+       }
+       
+       public Object load(Integer id){
+               try {
+                       Session session = factory.openSession();
+                       Transaction transaction = session.beginTransaction();
+                       Object returnObject = session.load(objectClass, id);
+                       transaction.commit();
+                       session.close();
+                       return returnObject;
+               } catch (HibernateException e) {
+                       throw new StorageServiceFailure(e);
+               }       
+       }
+       
+       public Integer add(Object newObject){
+               try {
+                       Session session = factory.openSession();
+                       Transaction transaction = session.beginTransaction();
+                       Integer newid = (Integer)session.save(newObject);
+                       session.close();
+                       return newid;
+               } catch (HibernateException e) {
+                       throw new StorageServiceFailure(e);
+               }                       
+       }
+       
+       public void update(Object toUpdate){
+               try {
+                       Session session = factory.openSession();
+                       Transaction transaction = session.beginTransaction();
+                       session.update(toUpdate);
+                       session.close();
+               } catch (HibernateException e) {
+                       throw new StorageServiceFailure(e);
+               }                       
+       }
+       
+       public void delete(Object toDelete){
+               try {
+                       Session session = factory.openSession();
+                       Transaction transaction = session.beginTransaction();
+                       session.delete(toDelete);
+                       session.close();
+               } catch (HibernateException e) {
+                       throw new StorageServiceFailure(e);
+               }                       
+       }
+       
+}
diff --git a/source/mir/core/service/storage/StorageServiceFailure.java b/source/mir/core/service/storage/StorageServiceFailure.java
new file mode 100755 (executable)
index 0000000..45d1c4c
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * StorageServiceFailure.java
+ * 
+ * Copyright (C) 2001, 2002, 2003 The Mir-coders group
+ *
+ * This file is part of Mir.
+ *
+ * Mir is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Mir is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Mir; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * In addition, as a special exception, The Mir-coders gives permission to link
+ * the code of this program with  any library licensed under the Apache Software License,
+ * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library
+ * (or with modified versions of the above that use the same license as the above),
+ * and distribute linked combinations including the two.  You must obey the
+ * GNU General Public License in all respects for all of the code used other than
+ * the above mentioned libraries.  If you modify this file, you may extend this
+ * exception to your version of the file, but you are not obligated to do so.
+ * If you do not wish to do so, delete this exception statement from your version.
+ */
+package mir.core.service.storage;
+
+import multex.Failure;
+
+/**
+ * 
+ * StorageServiceFailure
+ * @author idefix
+ * @version $Id: StorageServiceFailure.java,v 1.1 2003/08/17 19:11:49 idfx Exp $
+ */
+public class StorageServiceFailure extends Failure {
+
+       /**
+        * 
+        * @author idefix
+        *
+        * To change the template for this generated type comment go to
+        * Window - Preferences - Java - Code Generation - Code and Comments
+        */
+       public StorageServiceFailure(Throwable throwable) {
+               super("A StorageFailure occured", throwable);
+       }
+
+}
diff --git a/source/mir/core/service/storage/TopicService.java b/source/mir/core/service/storage/TopicService.java
new file mode 100755 (executable)
index 0000000..86df935
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * TopicService.java created on 17.08.2003
+ * 
+ * Copyright (C) 2001, 2002, 2003 The Mir-coders group
+ *
+ * This file is part of Mir.
+ *
+ * Mir is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Mir is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Mir; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * In addition, as a special exception, The Mir-coders gives permission to link
+ * the code of this program with  any library licensed under the Apache Software License,
+ * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library
+ * (or with modified versions of the above that use the same license as the above),
+ * and distribute linked combinations including the two.  You must obey the
+ * GNU General Public License in all respects for all of the code used other than
+ * the above mentioned libraries.  If you modify this file, you may extend this
+ * exception to your version of the file, but you are not obligated to do so.
+ * If you do not wish to do so, delete this exception statement from your version.
+ */
+package mir.core.service.storage;
+
+import mir.core.model.Topic;
+import net.sf.hibernate.SessionFactory;
+
+/**
+ * TopicService
+ * @author idefix
+ * @version $Id: TopicService.java,v 1.1 2003/08/17 19:11:49 idfx Exp $
+ */
+public class TopicService extends StorageService {
+
+       /**
+        * @param objectClass
+        * @param factory
+        */
+       public TopicService(SessionFactory factory) {
+               super(Topic.class, factory);
+       }
+
+}
diff --git a/source/mir/core/service/storage/UploadedMediaService.java b/source/mir/core/service/storage/UploadedMediaService.java
new file mode 100755 (executable)
index 0000000..18735f9
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * UploadedMediaService.java created on 17.08.2003
+ * 
+ * Copyright (C) 2001, 2002, 2003 The Mir-coders group
+ *
+ * This file is part of Mir.
+ *
+ * Mir is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Mir is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Mir; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * In addition, as a special exception, The Mir-coders gives permission to link
+ * the code of this program with  any library licensed under the Apache Software License,
+ * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library
+ * (or with modified versions of the above that use the same license as the above),
+ * and distribute linked combinations including the two.  You must obey the
+ * GNU General Public License in all respects for all of the code used other than
+ * the above mentioned libraries.  If you modify this file, you may extend this
+ * exception to your version of the file, but you are not obligated to do so.
+ * If you do not wish to do so, delete this exception statement from your version.
+ */
+package mir.core.service.storage;
+
+import mir.core.model.UploadedMedia;
+import net.sf.hibernate.SessionFactory;
+
+/**
+ * UploadedMediaService
+ * @author idefix
+ * @version $Id: UploadedMediaService.java,v 1.1 2003/08/17 19:11:49 idfx Exp $
+ */
+public class UploadedMediaService extends StorageService {
+
+       /**
+        * @param objectClass
+        * @param factory
+        */
+       public UploadedMediaService(SessionFactory factory) {
+               super(UploadedMedia.class, factory);
+       }
+
+}
diff --git a/source/mir/core/service/storage/UserService.java b/source/mir/core/service/storage/UserService.java
new file mode 100755 (executable)
index 0000000..08bcf53
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+ * UserService.java created on 17.08.2003
+ * 
+ * Copyright (C) 2001, 2002, 2003 The Mir-coders group
+ *
+ * This file is part of Mir.
+ *
+ * Mir is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Mir is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Mir; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * In addition, as a special exception, The Mir-coders gives permission to link
+ * the code of this program with  any library licensed under the Apache Software License,
+ * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library
+ * (or with modified versions of the above that use the same license as the above),
+ * and distribute linked combinations including the two.  You must obey the
+ * GNU General Public License in all respects for all of the code used other than
+ * the above mentioned libraries.  If you modify this file, you may extend this
+ * exception to your version of the file, but you are not obligated to do so.
+ * If you do not wish to do so, delete this exception statement from your version.
+ */
+package mir.core.service.storage;
+
+
+import java.util.List;
+
+import mir.core.model.MirUser;
+import net.sf.hibernate.SessionFactory;
+import net.sf.hibernate.expression.Expression;
+
+/**
+ * UserService
+ * @author idefix
+ * @version $Id: UserService.java,v 1.1 2003/08/17 19:11:49 idfx Exp $
+ */
+public class UserService extends StorageService {
+
+       /**
+        * @param objectClass
+        * @param factory
+        */
+       public UserService(SessionFactory factory) {
+               super(MirUser.class, factory);
+       }
+       
+       public MirUser loadUser(String user, String password){
+               List list = list(0, 1, 
+                       Expression.and(
+                               Expression.and(
+                                       Expression.eq("login", user),
+                                       Expression.eq("password", password)
+                               ),
+                               Expression.eq("isAdmin", new Boolean(true))
+                       )
+               );
+               return (MirUser)list.get(0);
+       }
+
+}
diff --git a/source/mir/core/service/storage/VideoService.java b/source/mir/core/service/storage/VideoService.java
new file mode 100755 (executable)
index 0000000..5feaa25
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * VideoService.java created on 17.08.2003
+ * 
+ * Copyright (C) 2001, 2002, 2003 The Mir-coders group
+ *
+ * This file is part of Mir.
+ *
+ * Mir is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Mir is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Mir; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * In addition, as a special exception, The Mir-coders gives permission to link
+ * the code of this program with  any library licensed under the Apache Software License,
+ * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library
+ * (or with modified versions of the above that use the same license as the above),
+ * and distribute linked combinations including the two.  You must obey the
+ * GNU General Public License in all respects for all of the code used other than
+ * the above mentioned libraries.  If you modify this file, you may extend this
+ * exception to your version of the file, but you are not obligated to do so.
+ * If you do not wish to do so, delete this exception statement from your version.
+ */
+package mir.core.service.storage;
+
+import mir.core.model.Video;
+import net.sf.hibernate.SessionFactory;
+
+/**
+ * VideoService
+ * @author idefix
+ * @version $Id: VideoService.java,v 1.1 2003/08/17 19:11:49 idfx Exp $
+ */
+public class VideoService extends StorageService {
+
+       /**
+        * @param objectClass
+        * @param factory
+        */
+       public VideoService(SessionFactory factory) {
+               super(Video.class, factory);
+       }
+
+}