proxy interfaces for lazy loading
authoridfx <idfx>
Tue, 19 Aug 2003 00:41:54 +0000 (00:41 +0000)
committeridfx <idfx>
Tue, 19 Aug 2003 00:41:54 +0000 (00:41 +0000)
source/mir/core/model/Content.hbm.xml
source/mir/core/model/Content.java
source/mir/core/model/IContent.java [new file with mode: 0755]
source/mir/core/model/IImage.java [new file with mode: 0755]
source/mir/core/model/IMedia.java [new file with mode: 0755]
source/mir/core/model/IUploadedMedia.java [new file with mode: 0755]
source/mir/core/model/Image.hbm.xml
source/mir/core/model/Image.java
source/mir/core/model/Media.hbm.xml
source/mir/core/model/Media.java
source/mir/core/model/UploadedMedia.java

index 97a25e8..5dbe211 100755 (executable)
         column="to_rights"
     /> 
     <set 
-       name="childContent" 
+       name="childContent"
+       lazy="true" 
        inverse="true" 
        cascade="all">
        <key 
index 00e67b6..2ddd69c 100755 (executable)
@@ -40,9 +40,9 @@ import org.apache.commons.lang.builder.ToStringBuilder;
  * 
  * Content
  * @author idefix
- * @version $Id: Content.java,v 1.2 2003/08/17 19:13:19 idfx Exp $
+ * @version $Id: Content.java,v 1.3 2003/08/19 00:41:54 idfx Exp $
  */
-public class Content extends Media implements Serializable {
+public class Content extends Media implements Serializable, IContent {
 
     /** persistent field */
     private boolean isHtml;
diff --git a/source/mir/core/model/IContent.java b/source/mir/core/model/IContent.java
new file mode 100755 (executable)
index 0000000..76eef82
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+ * IContent.java created on 18.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.model;
+
+import java.util.Set;
+
+/**
+ * IContent
+ * @author idefix
+ * @version $Id: IContent.java,v 1.1 2003/08/19 00:41:54 idfx Exp $
+ */
+public interface IContent extends IMedia {
+       public abstract boolean isIsHtml();
+       public abstract void setIsHtml(boolean isHtml);
+       public abstract java.lang.String getContentData();
+       public abstract void setContentData(java.lang.String contentData);
+       public abstract ArticleType getArticleType();
+       public abstract void setArticleType(ArticleType articleType);
+       public abstract mir.core.model.Content getParentContent();
+       public abstract void setParentContent(mir.core.model.Content parentContent);
+       public abstract Set getChildContent();
+       public abstract void setChildContent(Set childContent);
+       public abstract Set getTopics();
+       public abstract void setTopics(Set topics);
+       public abstract Set getAttachedMedias();
+       public abstract void setAttachedMedias(Set attachedMedias);
+}
\ No newline at end of file
diff --git a/source/mir/core/model/IImage.java b/source/mir/core/model/IImage.java
new file mode 100755 (executable)
index 0000000..fcb955b
--- /dev/null
@@ -0,0 +1,62 @@
+/*
+ * IImage.java created on 18.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.model;
+
+/**
+ * IImage
+ * @author idefix
+ * @version $Id: IImage.java,v 1.1 2003/08/19 00:41:54 idfx Exp $
+ */
+public interface IImage extends IUploadedMedia {
+       public abstract int getImageData();
+       public abstract void setImageData(int imageData);
+       public abstract int getIconData();
+       public abstract void setIconData(int iconData);
+       public abstract java.lang.String getYear();
+       public abstract void setYear(java.lang.String year);
+       public abstract short getImgWidth();
+       public abstract void setImgWidth(short imgWidth);
+       public abstract short getImgHeight();
+       public abstract void setImgHeight(short imgHeight);
+       public abstract short getImgFormat();
+       public abstract void setImgFormat(short imgFormat);
+       public abstract short getImgLayout();
+       public abstract void setImgLayout(short imgLayout);
+       public abstract short getImgType();
+       public abstract void setImgType(short imgType);
+       public abstract short getImgColor();
+       public abstract void setImgColor(short imgColor);
+       public abstract short getIconWidth();
+       public abstract void setIconWidth(short iconWidth);
+       public abstract short getIconHeight();
+       public abstract void setIconHeight(short iconHeight);
+}
\ No newline at end of file
diff --git a/source/mir/core/model/IMedia.java b/source/mir/core/model/IMedia.java
new file mode 100755 (executable)
index 0000000..e3bbb30
--- /dev/null
@@ -0,0 +1,117 @@
+/*
+ * IMedia.java created on 18.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.model;
+
+import java.util.Date;
+import java.util.Set;
+
+/**
+ * IMedia
+ * @author idefix
+ * @version $Id: IMedia.java,v 1.1 2003/08/19 00:41:54 idfx Exp $
+ */
+public interface IMedia {
+       public abstract java.lang.Integer getId();
+       public abstract void setId(java.lang.Integer id);
+       public abstract java.lang.String getTitle();
+       public abstract void setTitle(java.lang.String title);
+       public abstract java.lang.String getSubtitle();
+       public abstract void setSubtitle(java.lang.String subtitle);
+       public abstract java.lang.String getEdittitle();
+       public abstract void setEdittitle(java.lang.String edittitle);
+       public abstract java.lang.String getDate();
+       public abstract void setDate(java.lang.String date);
+       public abstract java.lang.String getCreator();
+       public abstract void setCreator(java.lang.String creator);
+       public abstract java.lang.String getCreatorMainUrl();
+       public abstract void setCreatorMainUrl(java.lang.String creatorMainUrl);
+       public abstract java.lang.String getCreatorEmail();
+       public abstract void setCreatorEmail(java.lang.String creatorEmail);
+       public abstract java.lang.String getCreatorAddress();
+       public abstract void setCreatorAddress(java.lang.String creatorAddress);
+       public abstract java.lang.String getCreatorPhone();
+       public abstract void setCreatorPhone(java.lang.String creatorPhone);
+       public abstract java.lang.String getDescription();
+       public abstract void setDescription(java.lang.String description);
+       public abstract java.lang.String getKeywords();
+       public abstract void setKeywords(java.lang.String keywords);
+       public abstract java.lang.String getComment();
+       public abstract void setComment(java.lang.String comment);
+       public abstract java.lang.String getSource();
+       public abstract void setSource(java.lang.String source);
+       public abstract java.util.Date getPublishDate();
+       public abstract void setPublishDate(java.util.Date publishDate);
+       public abstract java.lang.String getPublishServer();
+       public abstract void setPublishServer(java.lang.String publishServer);
+       public abstract java.lang.String getPublishPath();
+       public abstract void setPublishPath(java.lang.String publishPath);
+       public abstract boolean isIsPublished();
+       public abstract void setIsPublished(boolean isPublished);
+       public abstract boolean isIsProduced();
+       public abstract void setIsProduced(boolean isProduced);
+       public abstract java.util.Date getWebdbCreate();
+       public abstract void setWebdbCreate(java.util.Date webdbCreate);
+       public abstract java.util.Date getWebdbLastchange();
+       public abstract void setWebdbLastchange(java.util.Date webdbLastchange);
+       public abstract mir.core.model.Feature getFeature();
+       public abstract void setFeature(mir.core.model.Feature feature);
+       public abstract mir.core.model.MirUser getPublisher();
+       public abstract void setPublisher(mir.core.model.MirUser publisher);
+       public abstract mir.core.model.Language getLanguage();
+       public abstract void setLanguage(mir.core.model.Language language);
+       public abstract mir.core.model.Rights getRights();
+       public abstract void setRights(mir.core.model.Rights rights);
+       /**
+        * @return
+        */
+       public abstract Set getContent();
+       /**
+        * @param content
+        */
+       public abstract void setContent(Set content);
+       /**
+        * @return
+        */
+       public abstract boolean isProduced();
+       /**
+        * @param isProduced
+        */
+       public abstract void setProduced(boolean isProduced);
+       /**
+        * @return
+        */
+       public abstract boolean isPublished();
+       /**
+        * @param isPublished
+        */
+       public abstract void setPublished(boolean isPublished);
+}
\ No newline at end of file
diff --git a/source/mir/core/model/IUploadedMedia.java b/source/mir/core/model/IUploadedMedia.java
new file mode 100755 (executable)
index 0000000..757622e
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * IUploadedMedia.java created on 18.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.model;
+
+/**
+ * IUploadedMedia
+ * @author idefix
+ * @version $Id: IUploadedMedia.java,v 1.1 2003/08/19 00:41:54 idfx Exp $
+ */
+public interface IUploadedMedia extends IMedia {
+       public abstract boolean isIconIsProduced();
+       public abstract void setIconIsProduced(boolean iconIsProduced);
+       public abstract java.lang.String getIconPath();
+       public abstract void setIconPath(java.lang.String iconPath);
+       public abstract mir.core.model.MediaFolder getMediaFolder();
+       public abstract void setMediaFolder(mir.core.model.MediaFolder mediaFolder);
+       public abstract mir.core.model.MediaType getMediaType();
+       public abstract void setMediaType(mir.core.model.MediaType mediaType);
+}
\ No newline at end of file
index 559d563..50d1567 100755 (executable)
@@ -15,6 +15,7 @@
 <class 
     name="mir.core.model.Image" 
     table="images"
+    proxy="mir.core.model.IImage"
 >
     <id
         name="id"
index 37a5621..d7ddbb6 100755 (executable)
@@ -49,10 +49,10 @@ import org.postgresql.largeobject.LargeObjectManager;
  * 
  * Image
  * @author idefix
- * @version $Id: Image.java,v 1.3 2003/08/17 19:13:19 idfx Exp $
+ * @version $Id: Image.java,v 1.4 2003/08/19 00:41:54 idfx Exp $
  */
 public class Image extends UploadedMedia 
-       implements Serializable, Lifecycle {
+       implements Serializable, Lifecycle, IImage {
 
     /** nullable persistent field */
     private int imageData;
index 53d9688..4795b17 100755 (executable)
@@ -15,6 +15,7 @@
 <class 
     name="mir.core.model.Media" 
     table="media"
+    proxy="mir.core.model.IMedia"
 >
     <id
         name="id"
index 3d7a76c..54d1a80 100755 (executable)
@@ -44,9 +44,9 @@ import org.apache.commons.lang.builder.ToStringBuilder;
  * 
  * Media
  * @author idefix
- * @version $Id: Media.java,v 1.3 2003/08/17 19:13:19 idfx Exp $
+ * @version $Id: Media.java,v 1.4 2003/08/19 00:41:54 idfx Exp $
  */
-public class Media implements Serializable {
+public class Media implements Serializable, IMedia {
 
     /** identifier field */
     private Integer id;
index 2e33ac6..25fa004 100755 (executable)
@@ -39,9 +39,9 @@ import org.apache.commons.lang.builder.ToStringBuilder;
  * 
  * UploadedMedia
  * @author idefix
- * @version $Id: UploadedMedia.java,v 1.3 2003/08/17 19:13:19 idfx Exp $
+ * @version $Id: UploadedMedia.java,v 1.4 2003/08/19 00:41:54 idfx Exp $
  */
-public class UploadedMedia extends Media implements Serializable {
+public class UploadedMedia extends Media implements Serializable, IUploadedMedia {
 
     /** persistent field */
     private boolean iconIsProduced;