working on struts/hibernate for content-admin
authoridfx <idfx>
Sat, 20 Dec 2003 20:27:09 +0000 (20:27 +0000)
committeridfx <idfx>
Sat, 20 Dec 2003 20:27:09 +0000 (20:27 +0000)
25 files changed:
dbscripts/updates/update20031005.sql [new file with mode: 0755]
etc/hibernate.cfg.xml [new file with mode: 0755]
source/mir/core/model/Comment.hbm.xml
source/mir/core/model/Comment.java
source/mir/core/model/Content.hbm.xml
source/mir/core/model/Content.java
source/mir/core/model/IComment.java [new file with mode: 0755]
source/mir/core/model/IContent.java
source/mir/core/model/ITopic.java [new file with mode: 0755]
source/mir/core/model/Language.java
source/mir/core/model/Media.hbm.xml
source/mir/core/model/Media.java
source/mir/core/model/Topic.java
source/mir/core/service/storage/ContentService.java
source/mir/core/service/storage/StorageService.java
source/mir/core/test/Test.java
source/mir/core/ui/action/admin/ContentAction.java [new file with mode: 0755]
source/mir/core/ui/action/admin/StartpageAction.java
source/mir/core/ui/plugin/HibernatePlugin.java
source/mir/core/ui/servlet/ServletConstants.java
source/mir/core/ui/servlet/TemplateServlet.java
templates/admin/FUNCTIONS.tmpl
templates/admin/content.tmpl [new file with mode: 0755]
templates/admin/contentlist.tmpl [new file with mode: 0755]
templates/admin/index.tmpl

diff --git a/dbscripts/updates/update20031005.sql b/dbscripts/updates/update20031005.sql
new file mode 100755 (executable)
index 0000000..16b3cfc
--- /dev/null
@@ -0,0 +1,20 @@
+
+ALTER TABLE media* ALTER to_feature DROP NOT NULL;
+ALTER TABLE media* ALTER to_feature DROP DEFAULT;
+
+ALTER TABLE media* ALTER to_media_folder DROP NOT NULL; 
+ALTER TABLE media* ALTER to_media_folder DROP DEFAULT; 
+
+ALTER TABLE media* ALTER to_media_type DROP NOT NULL; 
+ALTER TABLE media* ALTER to_media_type DROP DEFAULT; 
+
+ALTER TABLE media* ALTER to_creator DROP NOT NULL; 
+ALTER TABLE media* ALTER to_creator DROP DEFAULT; 
+
+ALTER TABLE media* ALTER to_language DROP DEFAULT;
+ALTER TABLE media* ALTER to_rights DROP DEFAULT;
+
+UPDATE media* SET to_feature=null WHERE to_feature=0;
+UPDATE media* SET to_media_folder=null WHERE to_media_folder=0;
+UPDATE media* SET to_media_type=null WHERE to_media_type=0;
+UPDATE media* SET to_creator=null WHERE to_creator=0;
diff --git a/etc/hibernate.cfg.xml b/etc/hibernate.cfg.xml
new file mode 100755 (executable)
index 0000000..9f2a995
--- /dev/null
@@ -0,0 +1,44 @@
+<?xml version='1.0' encoding='utf-8'?>
+<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN"
+                                         "http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">
+
+<hibernate-configuration>
+
+    <session-factory>
+
+        <property name="connection.url">jdbc:postgresql://localhost:5432/mir</property>
+        <property name="connection.driver_class">org.postgresql.Driver</property>
+        <property name="connection.username">eppc</property>
+        <property name="connection.password"></property>
+        <property name="connection.pool_size">10</property>
+        <property name="statement_cache.size">100</property>
+        <property name="show_sql">false</property>
+        <property name="use_outer_join">true</property>
+        <property name="dialect">net.sf.hibernate.dialect.PostgreSQLDialect</property>
+        
+        <!-- Mapping files -->
+        <mapping resource="mir/core/model/ArticleType.hbm.xml"/>
+        <!--
+        <mapping resource="mir/core/model/TopicRich.hbm.xml"/>
+        <mapping resource="mir/core/model/TopicChild.hbm.xml"/>
+        -->
+        <mapping resource="mir/core/model/Breaking.hbm.xml"/>
+        <mapping resource="mir/core/model/Comment.hbm.xml"/>
+        <mapping resource="mir/core/model/Content.hbm.xml"/>
+        <mapping resource="mir/core/model/CommentStatus.hbm.xml"/>
+        <mapping resource="mir/core/model/Feature.hbm.xml"/>
+        <mapping resource="mir/core/model/Language.hbm.xml"/>
+        <mapping resource="mir/core/model/Media.hbm.xml"/>
+        <mapping resource="mir/core/model/MediaFolder.hbm.xml"/>
+        <mapping resource="mir/core/model/MediaType.hbm.xml"/>
+        <mapping resource="mir/core/model/Message.hbm.xml"/>
+        <mapping resource="mir/core/model/Rights.hbm.xml"/>
+        <mapping resource="mir/core/model/Topic.hbm.xml"/>
+        <mapping resource="mir/core/model/WebdbUser.hbm.xml"/>
+        <mapping resource="mir/core/model/UploadedMedia.hbm.xml"/>
+        <mapping resource="mir/core/model/Image.hbm.xml"/>
+        <mapping resource="mir/core/model/Audio.hbm.xml"/>
+        <mapping resource="mir/core/model/Video.hbm.xml"/>
+    </session-factory>
+
+</hibernate-configuration>
index 69126ff..b834a02 100755 (executable)
 <class 
     name="mir.core.model.Comment" 
     table="comment"
+    proxy="mir.core.model.IComment"
 >
     <id
         name="id"
         type="int"
         column="id"
+        unsaved-value="0"
     >
         <generator class="sequence">
                <param name="sequence">comment_id_seq</param> 
         </generator>
     </id>
+
     <property
         name="title"
         type="java.lang.String"
@@ -46,6 +49,7 @@
         not-null="true"
         sql-type="text" 
     />
+
     <property
         name="mainUrl"
         type="java.lang.String"
@@ -70,6 +74,7 @@
         column="phone"
         length="20"
     />
+
     <property
         name="webdbCreate"
         type="java.sql.Timestamp"
@@ -77,6 +82,7 @@
         not-null="true"
         length="8"
     />
+
     <property
         name="published"
         type="boolean"
         not-null="true"
         length="1"
     />
-    <property
-        name="toLanguage"
-        type="int"
-        column="to_language"
-        not-null="true"
-        length="4"
-    />
-    <property
-        name="toMedia"
-        type="int"
-        column="to_media"
-        not-null="true"
-        length="4"
-    />
-    <property
-        name="toCommentStatus"
-        type="short"
-        column="to_comment_status"
-        length="2"
-    />
+
     <property
         name="checksum"
         type="int"
         column="checksum"
         length="4"
     />
+
     <property
         name="html"
         type="boolean"
     />
 
     <!-- associations -->
+   
+    <many-to-one
+        name="language"
+        class="mir.core.model.Language"
+        column="to_language"
+    />
+
+    <!-- dont know why but with Media it does not work -->
+    <many-to-one
+        name="media"
+        class="mir.core.model.Content"
+        column="to_media"
+    />
+
+    <many-to-one
+        name="commentStatus"
+        class="mir.core.model.CommentStatus"
+        column="to_comment_status"
+    />    
 
 </class>
 </hibernate-mapping>
index 9b186e7..3b2a263 100755 (executable)
@@ -32,6 +32,7 @@
 package mir.core.model;
 
 import java.io.Serializable;
+import java.util.Date;
 
 import org.apache.commons.lang.builder.EqualsBuilder;
 import org.apache.commons.lang.builder.HashCodeBuilder;
@@ -41,229 +42,211 @@ import org.apache.commons.lang.builder.ToStringBuilder;
  * 
  * Comment
  * @author idefix
- * @version $Id: Comment.java,v 1.3 2003/09/05 20:23:59 idfx Exp $
+ * @version $Id: Comment.java,v 1.4 2003/12/20 20:27:09 idfx Exp $
  */
-public class Comment implements Serializable {
-
-    /** identifier field */
-    private Integer id;
-
-    /** persistent field */
-    private String title;
-
-    /** persistent field */
-    private String creator;
-
-    /** persistent field */
-    private String description;
-
-    /** nullable persistent field */
-    private String mainUrl;
-
-    /** nullable persistent field */
-    private String email;
-
-    /** nullable persistent field */
-    private String address;
-
-    /** nullable persistent field */
-    private String phone;
-
-    /** persistent field */
-    private java.util.Date webdbCreate;
-
-    /** persistent field */
-    private boolean isPublished;
-
-    /** persistent field */
-    private int toLanguage;
-
-    /** persistent field */
-    private int toMedia;
-
-    /** nullable persistent field */
-    private short toCommentStatus;
-
-    /** nullable persistent field */
-    private int checksum;
-
-    /** persistent field */
-    private boolean isHtml;
-
-    /** full constructor */
-    public Comment(java.lang.Integer id, java.lang.String title, java.lang.String creator, java.lang.String description, java.lang.String mainUrl, java.lang.String email, java.lang.String address, java.lang.String phone, java.util.Date webdbCreate, boolean isPublished, int toLanguage, int toMedia, short toCommentStatus, int checksum, boolean isHtml) {
-        this.id = id;
-        this.title = title;
-        this.creator = creator;
-        this.description = description;
-        this.mainUrl = mainUrl;
-        this.email = email;
-        this.address = address;
-        this.phone = phone;
-        this.webdbCreate = webdbCreate;
-        this.isPublished = isPublished;
-        this.toLanguage = toLanguage;
-        this.toMedia = toMedia;
-        this.toCommentStatus = toCommentStatus;
-        this.checksum = checksum;
-        this.isHtml = isHtml;
-    }
-
-    /** default constructor */
-    public Comment() {
-    }
-
-    /** minimal constructor */
-    public Comment(java.lang.Integer id, java.lang.String title, java.lang.String creator, java.lang.String description, java.util.Date webdbCreate, boolean isPublished, int toLanguage, int toMedia, boolean isHtml) {
-        this.id = id;
-        this.title = title;
-        this.creator = creator;
-        this.description = description;
-        this.webdbCreate = webdbCreate;
-        this.isPublished = isPublished;
-        this.toLanguage = toLanguage;
-        this.toMedia = toMedia;
-        this.isHtml = isHtml;
-    }
-
-    public java.lang.Integer getId() {
-        return this.id;
-    }
-
-    public void setId(java.lang.Integer id) {
-        this.id = id;
-    }
-
-    public java.lang.String getTitle() {
-        return this.title;
-    }
-
-    public void setTitle(java.lang.String title) {
-        this.title = title;
-    }
-
-    public java.lang.String getCreator() {
-        return this.creator;
-    }
-
-    public void setCreator(java.lang.String creator) {
-        this.creator = creator;
-    }
-
-    public java.lang.String getDescription() {
-        return this.description;
-    }
-
-    public void setDescription(java.lang.String description) {
-        this.description = description;
-    }
-
-    public java.lang.String getMainUrl() {
-        return this.mainUrl;
-    }
-
-    public void setMainUrl(java.lang.String mainUrl) {
-        this.mainUrl = mainUrl;
-    }
-
-    public java.lang.String getEmail() {
-        return this.email;
-    }
-
-    public void setEmail(java.lang.String email) {
-        this.email = email;
-    }
-
-    public java.lang.String getAddress() {
-        return this.address;
-    }
-
-    public void setAddress(java.lang.String address) {
-        this.address = address;
-    }
-
-    public java.lang.String getPhone() {
-        return this.phone;
-    }
-
-    public void setPhone(java.lang.String phone) {
-        this.phone = phone;
-    }
-
-    public java.util.Date getWebdbCreate() {
-        return this.webdbCreate;
-    }
-
-    public void setWebdbCreate(java.util.Date webdbCreate) {
-        this.webdbCreate = webdbCreate;
-    }
-
-    public boolean isPublished() {
-        return this.isPublished;
-    }
-
-    public void setPublished(boolean isPublished) {
-        this.isPublished = isPublished;
-    }
-
-    public int getToLanguage() {
-        return this.toLanguage;
-    }
-
-    public void setToLanguage(int toLanguage) {
-        this.toLanguage = toLanguage;
-    }
-
-    public int getToMedia() {
-        return this.toMedia;
-    }
-
-    public void setToMedia(int toMedia) {
-        this.toMedia = toMedia;
-    }
-
-    public short getToCommentStatus() {
-        return this.toCommentStatus;
-    }
-
-    public void setToCommentStatus(short toCommentStatus) {
-        this.toCommentStatus = toCommentStatus;
-    }
-
-    public int getChecksum() {
-        return this.checksum;
-    }
-
-    public void setChecksum(int checksum) {
-        this.checksum = checksum;
-    }
-
-    public boolean isHtml() {
-        return this.isHtml;
-    }
-
-    public void setHtml(boolean isHtml) {
-        this.isHtml = isHtml;
-    }
-
-    public String toString() {
-        return new ToStringBuilder(this)
-            .append("id", getId())
-            .toString();
-    }
-
-    public boolean equals(Object other) {
-        if ( !(other instanceof Comment) ) return false;
-        Comment castOther = (Comment) other;
-        return new EqualsBuilder()
-            .append(this.getId(), castOther.getId())
-            .isEquals();
-    }
-
-    public int hashCode() {
-        return new HashCodeBuilder()
-            .append(getId())
-            .toHashCode();
-    }
+public class Comment implements Serializable, IComment {
+
+       /** identifier field */
+       private Integer id;
+
+       /** persistent field */
+       private String title;
+
+       /** persistent field */
+       private String creator;
+
+       /** persistent field */
+       private String description;
+
+       /** nullable persistent field */
+       private String mainUrl;
+
+       /** nullable persistent field */
+       private String email;
+
+       /** nullable persistent field */
+       private String address;
+
+       /** nullable persistent field */
+       private String phone;
+
+       /** persistent field */
+       private Date webdbCreate;
+
+       /** persistent field */
+       private boolean isPublished;
+
+       /** persistent field */
+       private Language language;
+
+       /** persistent field */
+       private Media media;
+
+       /** nullable persistent field */
+       private CommentStatus commentStatus;
+
+       /** nullable persistent field */
+       private int checksum;
+
+       /** persistent field */
+       private boolean isHtml;
+
+       /** default constructor */
+       public Comment() {
+       }
+
+       public java.lang.Integer getId() {
+               return this.id;
+       }
+
+       public void setId(java.lang.Integer id) {
+               this.id = id;
+       }
+
+       public java.lang.String getTitle() {
+               return this.title;
+       }
+
+       public void setTitle(java.lang.String title) {
+               this.title = title;
+       }
+
+       public java.lang.String getCreator() {
+               return this.creator;
+       }
+
+       public void setCreator(java.lang.String creator) {
+               this.creator = creator;
+       }
+
+       public java.lang.String getDescription() {
+               return this.description;
+       }
+
+       public void setDescription(java.lang.String description) {
+               this.description = description;
+       }
+
+       public java.lang.String getMainUrl() {
+               return this.mainUrl;
+       }
+
+       public void setMainUrl(java.lang.String mainUrl) {
+               this.mainUrl = mainUrl;
+       }
+
+       public java.lang.String getEmail() {
+               return this.email;
+       }
+
+       public void setEmail(java.lang.String email) {
+               this.email = email;
+       }
+
+       public java.lang.String getAddress() {
+               return this.address;
+       }
+
+       public void setAddress(java.lang.String address) {
+               this.address = address;
+       }
+
+       public java.lang.String getPhone() {
+               return this.phone;
+       }
+
+       public void setPhone(java.lang.String phone) {
+               this.phone = phone;
+       }
+
+       public java.util.Date getWebdbCreate() {
+               return this.webdbCreate;
+       }
+
+       public void setWebdbCreate(java.util.Date webdbCreate) {
+               this.webdbCreate = webdbCreate;
+       }
+
+       public boolean isPublished() {
+               return this.isPublished;
+       }
+
+       public void setPublished(boolean isPublished) {
+               this.isPublished = isPublished;
+       }
+
+       public int getChecksum() {
+               return this.checksum;
+       }
+
+       public void setChecksum(int checksum) {
+               this.checksum = checksum;
+       }
+
+       public boolean isHtml() {
+               return this.isHtml;
+       }
+
+       public void setHtml(boolean isHtml) {
+               this.isHtml = isHtml;
+       }
+       /**
+        * @return
+        */
+       public CommentStatus getCommentStatus() {
+               return commentStatus;
+       }
+
+       /**
+        * @return
+        */
+       public Language getLanguage() {
+               return language;
+       }
+
+       /**
+        * @return
+        */
+       public Media getMedia() {
+               return media;
+       }
+
+       /**
+        * @param status
+        */
+       public void setCommentStatus(CommentStatus status) {
+               commentStatus = status;
+       }
+
+       /**
+        * @param language
+        */
+       public void setLanguage(Language language) {
+               this.language = language;
+       }
+
+       /**
+        * @param media
+        */
+       public void setMedia(Media media) {
+               this.media = media;
+       }
+       
+       public String toString() {
+               return new ToStringBuilder(this).append("id", getId()).toString();
+       }
+
+       public boolean equals(Object other) {
+               if (!(other instanceof Comment))
+                       return false;
+               Comment castOther = (Comment) other;
+               return new EqualsBuilder()
+                       .append(this.getId(), castOther.getId())
+                       .isEquals();
+       }
+
+       public int hashCode() {
+               return new HashCodeBuilder().append(getId()).toHashCode();
+       }
 
 }
index fc98f55..f80f916 100755 (executable)
 <class 
     name="mir.core.model.Content" 
     table="content"
+    proxy="mir.core.model.IContent"
 >
     <id
         name="id"
         type="int"
         column="id"
+        unsaved-value="0"
     >
         <generator class="sequence">
                <param name="sequence">media_id_seq</param> 
         class="mir.core.model.ArticleType"
         column="to_article_type"
     />
+    
     <many-to-one
         name="publisher"
         class="mir.core.model.MirUser"
         column="to_publisher"
     />
+
     <many-to-one
         name="language"
         class="mir.core.model.Language"
         column="to_language"
     />
+
     <many-to-one
         name="rights"
         class="mir.core.model.Rights"
         column="to_rights"
     /> 
+
+    <many-to-one name="parentContent"
+       class="mir.core.model.Content"
+       column="to_content"
+       cascade="none"
+       not-null="false"/>      
+          
     <set 
        name="childContent"
-       lazy="true" 
-       inverse="true" 
-       cascade="all">
+       table="content"
+       cascade="all"
+       inverse="true"
+       > 
        <key 
                column="to_content"
        />
                class="mir.core.model.Content"
         />
     </set>
-    <many-to-one
-        name="parentContent"
-        class="mir.core.model.Content"
-        column="to_content"
-    />
-    <set name="topics" table="content_x_topic">
+
+    <set name="comments" table="comment" lazy="true">
+           <key column="to_media"/>
+           <one-to-many class="mir.core.model.Comment"/>
+       </set> 
+    <set name="topics" table="content_x_topic" lazy="true">
            <key column="content_id"/>
            <many-to-many column="topic_id" class="mir.core.model.Topic"/>
        </set> 
+       
     <set name="attachedMedias" table="content_x_media" lazy="true">
            <key column="content_id"/>
            <many-to-many column="media_id" class="mir.core.model.Media"/>
index a9330df..397cb1c 100755 (executable)
@@ -32,6 +32,9 @@
 package mir.core.model;
 
 import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.GregorianCalendar;
+import java.util.List;
 import java.util.Set;
 
 import org.apache.commons.lang.builder.ToStringBuilder;
@@ -40,95 +43,133 @@ import org.apache.commons.lang.builder.ToStringBuilder;
  * 
  * Content
  * @author idefix
- * @version $Id: Content.java,v 1.4 2003/09/05 20:23:59 idfx Exp $
+ * @version $Id: Content.java,v 1.5 2003/12/20 20:27:09 idfx Exp $
  */
 public class Content extends Media implements Serializable, IContent {
 
-    /** persistent field */
-    private boolean isHtml;
-
-    /** nullable persistent field */
-    private String contentData;
-
-    /** persistent field */
-    private ArticleType articleType;
-
-    /** nullable persistent field */
-    private mir.core.model.Content parentContent;
-
-    /** persistent field */
-    private Set childContent;
-
-    /** persistent field */
-    private Set topics;
-
-    /** persistent field */
-    private Set attachedMedias;
-
-    /** default constructor */
-    public Content() {
-    }
-
-    public boolean isHtml() {
-        return this.isHtml;
-    }
-
-    public void setHtml(boolean isHtml) {
-        this.isHtml = isHtml;
-    }
-
-    public java.lang.String getContentData() {
-        return this.contentData;
-    }
-
-    public void setContentData(java.lang.String contentData) {
-        this.contentData = contentData;
-    }
-
-    public ArticleType getArticleType() {
-        return this.articleType;
-    }
-
-    public void setArticleType(ArticleType articleType) {
-        this.articleType = articleType;
-    }
-
-    public mir.core.model.Content getParentContent() {
-        return this.parentContent;
-    }
-
-    public void setParentContent(mir.core.model.Content parentContent) {
-        this.parentContent = parentContent;
-    }
-
-    public Set getChildContent() {
-        return this.childContent;
-    }
-
-    public void setChildContent(Set childContent) {
-        this.childContent = childContent;
-    }
-
-    public Set getTopics() {
-        return this.topics;
-    }
-
-    public void setTopics(Set topics) {
-        this.topics = topics;
-    }
-
-    public Set getAttachedMedias() {
-        return this.attachedMedias;
-    }
-
-    public void setAttachedMedias(Set attachedMedias) {
-        this.attachedMedias = attachedMedias;
-    }
-
-    public String toString() {
-        return new ToStringBuilder(this)
-            .append("id", getId())
-            .toString();
-    }
-
+       /** persistent field */
+       private boolean isHtml;
+
+       /** nullable persistent field */
+       private String contentData;
+
+       /** persistent field */
+       private ArticleType articleType;
+
+       /** nullable persistent field */
+       private Content parentContent;
+
+       /** persistent field */
+       private Set childContent;
+
+       /** persistent field */
+       private Set topics;
+
+       /** persistent field */
+       private Set attachedMedias;
+       
+       private Set comments;
+
+       /** default constructor */
+       public Content() {
+       }
+
+       public boolean isHtml() {
+               return this.isHtml;
+       }
+
+       public boolean getHtml() {
+               return isHtml();
+       }
+
+       public void setHtml(boolean isHtml) {
+               this.isHtml = isHtml;
+       }
+
+       public java.lang.String getContentData() {
+               return this.contentData;
+       }
+
+       public void setContentData(java.lang.String contentData) {
+               this.contentData = contentData;
+       }
+
+       public ArticleType getArticleType() {
+               return this.articleType;
+       }
+
+       public void setArticleType(ArticleType articleType) {
+               this.articleType = articleType;
+       }
+
+       public mir.core.model.Content getParentContent() {
+               return this.parentContent;
+       }
+
+       public void setParentContent(mir.core.model.Content parentContent) {
+               this.parentContent = parentContent;
+       }
+
+       public Set getChildContent() {
+               return this.childContent;
+       }
+
+       public void setChildContent(Set childContent) {
+               this.childContent = childContent;
+       }
+
+       public Set getTopics() {
+               return this.topics;
+       }
+
+       public void setTopics(Set topics) {
+               this.topics = topics;
+       }
+
+       public Set getAttachedMedias() {
+               return this.attachedMedias;
+       }
+
+       public void setAttachedMedias(Set attachedMedias) {
+               this.attachedMedias = attachedMedias;
+       }
+       
+       /**
+        * @return
+        */
+       public Set getComments() {
+               return comments;
+       }
+
+       /**
+        * @param set
+        */
+       public void setComments(Set set) {
+               comments = set;
+       }
+       
+       public List getOperations(){
+               return new ArrayList();
+       }
+       
+       public List getTopicsAsList(){
+               return new ArrayList(getTopics());
+       }
+       
+       public String getPublicurl(){
+               GregorianCalendar calendar = new GregorianCalendar();
+               calendar.setTime(getWebdbCreate());
+               calendar.get(GregorianCalendar.YEAR);
+               return "" + calendar.get(GregorianCalendar.YEAR) + "/"
+                       + calendar.get(GregorianCalendar.MONTH) + "/"
+                       + this.getId() + ".shtml";
+       }
+       
+       public int getCommentsSize(){
+               return comments.size();
+       }
+       
+       public String toString() {
+               return new ToStringBuilder(this).append("id", getId()).toString();
+       }
 }
diff --git a/source/mir/core/model/IComment.java b/source/mir/core/model/IComment.java
new file mode 100755 (executable)
index 0000000..02cbf3d
--- /dev/null
@@ -0,0 +1,88 @@
+/*
+ * IComment.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.model;
+
+/**
+ * IComment
+ * @version $Id: IComment.java,v 1.1 2003/12/20 20:27:09 idfx Exp $
+ * @author idefix
+ */
+public interface IComment {
+       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 getCreator();
+       public abstract void setCreator(java.lang.String creator);
+       public abstract java.lang.String getDescription();
+       public abstract void setDescription(java.lang.String description);
+       public abstract java.lang.String getMainUrl();
+       public abstract void setMainUrl(java.lang.String mainUrl);
+       public abstract java.lang.String getEmail();
+       public abstract void setEmail(java.lang.String email);
+       public abstract java.lang.String getAddress();
+       public abstract void setAddress(java.lang.String address);
+       public abstract java.lang.String getPhone();
+       public abstract void setPhone(java.lang.String phone);
+       public abstract java.util.Date getWebdbCreate();
+       public abstract void setWebdbCreate(java.util.Date webdbCreate);
+       public abstract boolean isPublished();
+       public abstract void setPublished(boolean isPublished);
+       public abstract int getChecksum();
+       public abstract void setChecksum(int checksum);
+       public abstract boolean isHtml();
+       public abstract void setHtml(boolean isHtml);
+       /**
+        * @return
+        */
+       public abstract CommentStatus getCommentStatus();
+       /**
+        * @return
+        */
+       public abstract Language getLanguage();
+       /**
+        * @return
+        */
+       public abstract Media getMedia();
+       /**
+        * @param status
+        */
+       public abstract void setCommentStatus(CommentStatus status);
+       /**
+        * @param language
+        */
+       public abstract void setLanguage(Language language);
+       /**
+        * @param media
+        */
+       public abstract void setMedia(Media media);
+}
\ No newline at end of file
index f56b38d..245e5a6 100755 (executable)
@@ -36,7 +36,7 @@ import java.util.Set;
 /**
  * IContent
  * @author idefix
- * @version $Id: IContent.java,v 1.2 2003/09/05 20:23:59 idfx Exp $
+ * @version $Id: IContent.java,v 1.3 2003/12/20 20:27:09 idfx Exp $
  */
 public interface IContent extends IMedia {
        public abstract boolean isHtml();
@@ -53,4 +53,6 @@ public interface IContent extends IMedia {
        public abstract void setTopics(Set topics);
        public abstract Set getAttachedMedias();
        public abstract void setAttachedMedias(Set attachedMedias);
+       public abstract Set getComments();
+       public abstract void setComments(Set comments); 
 }
\ No newline at end of file
diff --git a/source/mir/core/model/ITopic.java b/source/mir/core/model/ITopic.java
new file mode 100755 (executable)
index 0000000..9c37ff4
--- /dev/null
@@ -0,0 +1,106 @@
+/*
+ * ITopic.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.model;
+
+import java.util.Set;
+
+/**
+ * ITopic
+ * @version $Id: ITopic.java,v 1.1 2003/12/20 20:27:09 idfx Exp $
+ * @author idefix
+ */
+public interface ITopic {
+       /**
+        * @return
+        */
+       public abstract String getArchivUrl();
+       /**
+        * @return
+        */
+       public abstract String getDescription();
+       /**
+        * @return
+        */
+       public abstract String getFilename();
+       /**
+        * @return
+        */
+       public abstract Integer getId();
+       /**
+        * @return
+        */
+       public abstract String getMainUrl();
+       /**
+        * @return
+        */
+       public abstract String getTitle();
+       /**
+        * @param string
+        */
+       public abstract void setArchivUrl(String string);
+       /**
+        * @param string
+        */
+       public abstract void setDescription(String string);
+       /**
+        * @param string
+        */
+       public abstract void setFilename(String string);
+       /**
+        * @param integer
+        */
+       public abstract void setId(Integer integer);
+       /**
+        * @param string
+        */
+       public abstract void setMainUrl(String string);
+       /**
+        * @param string
+        */
+       public abstract void setTitle(String string);
+       /**
+        * @return
+        */
+       public abstract Set getChildTopics();
+       /**
+        * @param set
+        */
+       public abstract void setChildTopics(Set set);
+       /**
+        * @return
+        */
+       public abstract Topic getParentTopic();
+       /**
+        * @param topic
+        */
+       public abstract void setParentTopic(Topic topic);
+}
\ No newline at end of file
index 8b959c6..8e1a82b 100755 (executable)
@@ -41,7 +41,7 @@ import org.apache.commons.lang.builder.ToStringBuilder;
  * 
  * Language
  * @author idefix
- * @version $Id: Language.java,v 1.2 2003/08/17 19:13:19 idfx Exp $
+ * @version $Id: Language.java,v 1.3 2003/12/20 20:27:09 idfx Exp $
  */
 public class Language implements Serializable {
 
@@ -64,11 +64,11 @@ public class Language implements Serializable {
     public Language() {
     }
 
-    public java.lang.Integer getId() {
+    public Integer getId() {
         return this.id;
     }
 
-    public void setId(java.lang.Integer id) {
+    public void setId(Integer id) {
         this.id = id;
     }
 
index 510ecb4..78cafb2 100755 (executable)
         name="id"
         type="int"
         column="id"
+        unsaved-value="0"
     >
         <generator class="sequence">
                <param name="sequence">media_id_seq</param> 
         </generator> 
     </id>
+
     <property
         name="title"
         type="java.lang.String"
         column="webdb_lastchange"
         length="8"
     />
+    
     <!-- associations -->
+    
     <many-to-one
         name="publisher"
         class="mir.core.model.MirUser"
         column="to_publisher"
     />
+
     <many-to-one
         name="language"
         class="mir.core.model.Language"
         column="to_language"
     />
+
     <many-to-one
         name="rights"
         class="mir.core.model.Rights"
         column="to_rights"
     /> 
-    
+   
     <set name="content" table="content_x_media" lazy="true">
            <key column="media_id"/>
            <many-to-many column="content_id" class="mir.core.model.Content"/>
        </set>
-    
+   
 </class>
 </hibernate-mapping>
index ddcfc89..3771126 100755 (executable)
@@ -44,7 +44,7 @@ import org.apache.commons.lang.builder.ToStringBuilder;
  * 
  * Media
  * @author idefix
- * @version $Id: Media.java,v 1.6 2003/09/30 19:26:02 idfx Exp $
+ * @version $Id: Media.java,v 1.7 2003/12/20 20:27:09 idfx Exp $
  */
 public class Media implements Serializable, IMedia {
 
@@ -280,7 +280,7 @@ public class Media implements Serializable, IMedia {
         return this.language;
     }
 
-    public void setLanguage(mir.core.model.Language language) {
+    public void setLanguage(Language language) {
         this.language = language;
     }
 
@@ -314,6 +314,13 @@ public class Media implements Serializable, IMedia {
                }
 
                /**
+                * @return
+                */
+               public boolean getProduced() {
+                       return isProduced();
+               }
+               
+               /**
                 * @param isProduced
                 */
                public void setProduced(boolean isProduced) {
index 872bae8..3086787 100755 (executable)
@@ -41,9 +41,9 @@ import org.apache.commons.lang.builder.ToStringBuilder;
 /**
  * TopicStub
  * @author idefix
- * @version $Id: Topic.java,v 1.5 2003/09/30 19:52:03 idfx Exp $
+ * @version $Id: Topic.java,v 1.6 2003/12/20 20:27:09 idfx Exp $
  */
-public class Topic implements Serializable {
+public class Topic implements Serializable, ITopic {
        /** identifier field */
        private Integer id;
        /** persistent field */
index cff8e7a..ec04456 100755 (executable)
@@ -41,7 +41,7 @@ import net.sf.hibernate.SessionFactory;
 /**
  * ContentService
  * @author idefix
- * @version $Id: ContentService.java,v 1.2 2003/09/05 20:23:59 idfx Exp $
+ * @version $Id: ContentService.java,v 1.3 2003/12/20 20:27:09 idfx Exp $
  */
 public class ContentService extends StorageService {
 
@@ -61,8 +61,8 @@ public class ContentService extends StorageService {
                        IContent content = (IContent)returnObject;
                        Hibernate.initialize(content.getAttachedMedias());
                        Hibernate.initialize(content.getChildContent());
-                       Hibernate.initialize(content.getContent());
                        Hibernate.initialize(content.getTopics());
+                       Hibernate.initialize(content.getComments());
                }
        }
 
index 03b9ad4..d81e07f 100755 (executable)
@@ -32,6 +32,7 @@
  
 package mir.core.service.storage;
 
+import java.util.Iterator;
 import java.util.List;
 
 import mir.config.MirPropertiesConfiguration;
@@ -48,7 +49,7 @@ import net.sf.hibernate.expression.Order;
  * 
  * StorageService
  * @author idefix
- * @version $Id: StorageService.java,v 1.7 2003/09/30 19:27:10 idfx Exp $
+ * @version $Id: StorageService.java,v 1.8 2003/12/20 20:27:09 idfx Exp $
  */
 public abstract class StorageService {
        private final int defaultLimit;
@@ -86,6 +87,11 @@ public abstract class StorageService {
        public List list(final int offset, final Expression expression){
                return list(offset, defaultLimit, expression);
        }       
+  
+  public List list(final int offset, final Expression expression,
+    final Order order){
+    return list(offset, defaultLimit, expression, order);
+  }
        
        public List list(final int offset, final int limit, 
                final Expression expression) {
@@ -122,6 +128,9 @@ public abstract class StorageService {
                                criteria.setFirstResult(offset)
                                        .setMaxResults(limit);
                                List returnList = criteria.list();
+                               for(Iterator iterator = returnList.iterator(); iterator.hasNext();){
+                                       initializeLazyCollections(iterator.next());
+                               }
                                transaction.commit();
                                return returnList;
                        } catch (HibernateException e) {
@@ -152,6 +161,9 @@ public abstract class StorageService {
                                transaction = session.beginTransaction();
                                Criteria criteria = session.createCriteria(objectClass);
                                List returnList = criteria.list();
+                               for(Iterator iterator = returnList.iterator(); iterator.hasNext();){
+                                       initializeLazyCollections(iterator.next());
+                               }
                                transaction.commit();
                                return returnList;
                        } catch (HibernateException e) {
@@ -212,9 +224,9 @@ public abstract class StorageService {
                        Transaction transaction = null;
                        try {
                                session = sessionHolder.currentSession();
-                               //transaction = session.beginTransaction();
+                               transaction = session.beginTransaction();
                                Integer newid = (Integer)session.save(newObject);
-                               //transaction.commit();
+                               transaction.commit();
                                return newid;
                        } catch (HibernateException e) {
                                if(transaction != null){
index 0ddcd67..7f3d92e 100755 (executable)
@@ -35,11 +35,13 @@ import java.util.Iterator;
 import java.util.List;
 
 import mir.core.model.Audio;
+import mir.core.model.Comment;
 import mir.core.model.Content;
 import mir.core.model.IImage;
 import mir.core.model.Image;
 import mir.core.model.Media;
 import mir.core.model.Topic;
+import mir.core.model.TopicRich;
 import mir.core.model.UploadedMedia;
 import mir.core.model.Video;
 import mir.core.service.storage.ContentService;
@@ -50,10 +52,12 @@ import net.sf.hibernate.Session;
 import net.sf.hibernate.SessionFactory;
 import net.sf.hibernate.Transaction;
 import net.sf.hibernate.cfg.Configuration;
+import net.sf.hibernate.expression.Order;
+import net.sf.hibernate.tool.hbm2ddl.SchemaExport;
 
 /**
  * Test
- * @version $Id: Test.java,v 1.8 2003/09/10 20:59:01 idfx Exp $
+ * @version $Id: Test.java,v 1.9 2003/12/20 20:27:09 idfx Exp $
  * @author idefix
  */
 public class Test {
@@ -61,8 +65,12 @@ public class Test {
        public static void main(String[] args) {
                //BasicConfigurator.configure();
                try {
-                       SessionFactory factory = new Configuration().configure().buildSessionFactory();
+                       Configuration configuration = new Configuration().configure();
+                       SessionFactory factory = configuration.buildSessionFactory();
                        Session session = factory.openSession();
+//                     SchemaExport export = new SchemaExport(configuration);
+//                     export.setOutputFile("/tmp/test.sql");
+//                     export.create(true, false);
                        Transaction transaction = session.beginTransaction();
                        Criteria criteria = session.createCriteria(Topic.class);
                        List list = criteria.setMaxResults(10).list();
@@ -71,11 +79,32 @@ public class Test {
                                System.out.println(media.toString());
                        }
                        criteria = session.createCriteria(Media.class);
-                       list = criteria.setMaxResults(10).list();
+                       criteria.addOrder(Order.asc("id"));
+                       list = criteria.list();
                        for(Iterator iterator = list.iterator(); iterator.hasNext();){
                                Media media = (Media)iterator.next();
                                System.out.println(media.toString());
                        }
+                       System.out.println("media size " + list.size());
+                       
+                       criteria = session.createCriteria(Comment.class);
+                       criteria.addOrder(Order.asc("id"));
+                       list = criteria.list();
+                       for(Iterator iterator = list.iterator(); iterator.hasNext();){
+                               Comment media = (Comment)iterator.next();
+                               System.out.println(media.toString());
+                       }
+                       System.out.println("comment size " + list.size());
+
+                       criteria = session.createCriteria(Content.class);
+                       criteria.addOrder(Order.asc("id"));
+                       list = criteria.list();
+                       for(Iterator iterator = list.iterator(); iterator.hasNext();){
+                               Content media = (Content)iterator.next();
+                               System.out.println(media.toString());
+                       }
+                       System.out.println("content size " + list.size());
+
                        transaction.commit();
                        session.close();
 
diff --git a/source/mir/core/ui/action/admin/ContentAction.java b/source/mir/core/ui/action/admin/ContentAction.java
new file mode 100755 (executable)
index 0000000..2f8a0ca
--- /dev/null
@@ -0,0 +1,319 @@
+/*
+ * ContentAction.java created on 05.09.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.ui.action.admin;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.List;
+
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+
+import mir.config.MirPropertiesConfiguration;
+import mir.config.MirPropertiesConfiguration.PropertiesConfigExc;
+import mir.core.model.ArticleType;
+import mir.core.model.Content;
+import mir.core.model.IContent;
+import mir.core.model.Language;
+import mir.core.model.MirUser;
+import mir.core.service.storage.ArticleTypeService;
+import mir.core.service.storage.ContentService;
+import mir.core.service.storage.LanguageService;
+import mir.core.ui.action.DispatchAction;
+import mir.core.ui.servlet.ServletConstants;
+import multex.Failure;
+import net.sf.hibernate.SessionFactory;
+import net.sf.hibernate.expression.Expression;
+import net.sf.hibernate.expression.Order;
+
+import org.apache.struts.action.ActionForm;
+import org.apache.struts.action.ActionForward;
+import org.apache.struts.action.ActionMapping;
+import org.apache.struts.action.DynaActionForm;
+
+/**
+ * TopicAction
+ * @author idefix
+ * @version $Id: ContentAction.java,v 1.1 2003/12/20 20:27:09 idfx Exp $
+ */
+public class ContentAction extends DispatchAction {
+       private MirPropertiesConfiguration _configuration;
+
+       public ContentAction(){
+               super();
+               try {
+                       _configuration = MirPropertiesConfiguration.instance();
+               } catch (PropertiesConfigExc e) {
+                       throw new Failure("could not load config", e);
+               }               
+       }
+
+       private ActionForward add(ActionMapping actionMapping, ActionForm actionForm, 
+               HttpServletRequest request, HttpServletResponse response)
+               throws Exception {
+               //access to persistence
+               ServletContext context = getServlet().getServletContext();
+               ContentService contentService = 
+                       new ContentService((SessionFactory)context
+                               .getAttribute(ServletConstants.SESSION_FACTORY));
+                                                       
+               request.setAttribute(ServletConstants.NEW, new Boolean(true));
+               request.setAttribute(ServletConstants.ID, "");
+               request.setAttribute(ServletConstants.OFFSET, "");
+               
+               //setting standard-values
+               Content content = new Content();
+               request.setAttribute("article", content);
+               
+               //              show the view
+               return actionMapping.findForward("success");
+       }
+       
+       private ActionForward save(ActionMapping actionMapping, ActionForm actionForm, 
+               HttpServletRequest request, HttpServletResponse response)
+               throws Exception {
+               //access to persistence
+               ServletContext context = getServlet().getServletContext();
+    HttpSession httpSession = request.getSession();
+               ContentService contentService = 
+                       new ContentService((SessionFactory)context
+                               .getAttribute(ServletConstants.SESSION_FACTORY));
+    ArticleTypeService articleTypeService = 
+      new ArticleTypeService((SessionFactory)context
+        .getAttribute(ServletConstants.SESSION_FACTORY));
+    LanguageService languageService = 
+      new LanguageService((SessionFactory)context
+        .getAttribute(ServletConstants.SESSION_FACTORY));
+               
+    //retrieve the form
+               DynaActionForm form = (DynaActionForm) actionForm;
+               if(form == null){
+                       return actionMapping.findForward("failed");     
+               }
+    
+               //check if new
+               Boolean isnew = (Boolean) form.get("new");
+               
+               //retrieve id
+               IContent content = null;
+               if(isnew.booleanValue()){
+                       content = new Content();
+      //set change and create date
+      content.setWebdbCreate(new Date());
+      content.setWebdbLastchange(new Date());
+               } else {
+                       Integer id = new Integer(request.getParameter(ServletConstants.ID));
+                       content = (IContent) contentService.load(id);
+      //set last edit date
+      content.setWebdbLastchange(new Date());
+               }
+               
+               if(content == null){
+                       return actionMapping.findForward("failed");     
+               }
+
+               String webDbCreate = (String) form.get("date");
+    if(webDbCreate == null || webDbCreate.length() == 0){
+      Date date = new Date();
+      SimpleDateFormat dateFormat = new SimpleDateFormat();
+      dateFormat.applyPattern("yyyyMMdd");
+      webDbCreate = dateFormat.format(date);
+    }
+    content.setDate(webDbCreate);
+    
+    //set articletype
+    Integer articleTypeId = (Integer) form.get("to_article_type");
+    content.setArticleType(
+      (ArticleType) articleTypeService.load(articleTypeId));
+    
+    //set language
+    Integer languageTypeId = (Integer) form.get("to_language");
+    content.setLanguage(
+      (Language) languageService.load(languageTypeId)); 
+    
+    //set form data
+    content.setPublisher(
+      (MirUser) httpSession.getAttribute(ServletConstants.USER));
+    content.setTitle((String) form.get("title"));
+    content.setSubtitle((String) form.get("subtitle"));
+               content.setComment((String) form.get("comment"));
+               content.setContentData((String) form.get("content_data"));
+               content.setCreator((String) form.get("creator"));
+               content.setCreatorAddress((String)form.get("creator_address"));
+               content.setCreatorEmail((String)form.get("creator_email"));
+               content.setCreatorPhone((String)form.get("creator_phone"));
+               content.setCreatorMainUrl((String)form.get("creator_main_url"));
+               content.setDescription((String)form.get("description"));
+               content.setEdittitle((String)form.get("edittitle"));
+               if(form.get("is_html") != null){
+                       content.setHtml(true);
+               } else {
+                       content.setHtml(false);
+               }
+               if(form.get("is_published") != null){
+                       content.setPublished(true);
+               } else {
+                       content.setPublished(false);
+               }
+                               
+//             Integer parentId = (Integer)form.get("parentContent");
+//             if(parentId != null && parentId.intValue() > -1){
+//                     Topic parentTopic = (Topic) topicService.load(parentId);
+//                     topic.setParentTopic(parentTopic);
+//             } 
+    
+    //save the article
+               if(isnew.booleanValue()){
+                       Integer id = contentService.save(content);
+                       request.setAttribute(ServletConstants.OFFSET, "0");
+               } else {
+                       contentService.update(content);
+               }
+               
+               //              show the view
+               return actionMapping.findForward("success");
+       }
+               
+       private ActionForward delete(ActionMapping actionMapping, ActionForm actionForm, 
+               HttpServletRequest request, HttpServletResponse response)
+               throws Exception {
+               //access to persistence
+               ServletContext context = getServlet().getServletContext();
+               ContentService contentService = 
+                       new ContentService((SessionFactory)context
+                               .getAttribute(ServletConstants.SESSION_FACTORY));
+               
+               //retrieve id
+               Integer id = new Integer(request.getParameter(ServletConstants.ID));
+               
+               //confirm the request
+               System.out.println(request.getAttribute(ServletConstants.DELETE));
+               if(request.getAttribute(ServletConstants.DELETE) == null){
+                       return actionMapping.findForward("confirm");
+               }
+               //load object
+               Content content = (Content) contentService.load(id);
+               
+               if(content == null){
+                       return actionMapping.findForward("failed");     
+               }
+                                       
+               contentService.delete(content);
+               
+               //              show the view
+               return actionMapping.findForward("success");
+       }
+
+       private ActionForward list(ActionMapping actionMapping, ActionForm actionForm, 
+               HttpServletRequest request, HttpServletResponse response)
+               throws Exception {
+               //retrieve parameters
+               String offsetString = request.getParameter(ServletConstants.OFFSET);
+               int offset = 0;
+               if(offsetString != null && !offsetString.equals("")){
+                       offset = new Integer(offsetString).intValue();
+               }
+    String articleTypeString = request.getParameter("articletype");
+    Integer articleTypeId = new Integer(-1);
+    if(articleTypeString != null && !articleTypeString.equals("")){
+      articleTypeId = new Integer(articleTypeString);
+    }  
+       
+               //access to persistence
+               ServletContext context = getServlet().getServletContext();
+               ContentService contentService = 
+                       new ContentService((SessionFactory)context
+                               .getAttribute(ServletConstants.SESSION_FACTORY));
+
+               
+               //retrieve entities
+               Order order = Order.desc("id");
+    List contents;
+    if(articleTypeId.intValue() >= 0){
+      ArticleTypeService articleTypeService = 
+        new ArticleTypeService((SessionFactory)context
+          .getAttribute(ServletConstants.SESSION_FACTORY));
+      Expression expression = 
+        Expression.eq("articleType", 
+          articleTypeService.load(articleTypeId));
+      contents = contentService.list(offset, expression, order);
+    } else {
+      contents = contentService.list(offset, order);
+    }
+                
+               
+               //configure the data to send to view
+               int listSize = _configuration.getInt("ServletModule.Default.ListSize");
+               Integer lastOffset;
+               if(offset-listSize < 0){
+                       lastOffset = new Integer(0);
+               } else {
+                       lastOffset = new Integer(offset-listSize);
+               }
+               request.setAttribute(ServletConstants.LAST_OFFSET, lastOffset);
+               request.setAttribute(ServletConstants.NEXT_OFFSET, 
+                       new Integer(offset + listSize));
+               request.setAttribute(ServletConstants.OFFSET, 
+                       new Integer(offset));
+               request.setAttribute("articles", contents);
+               
+               //show the view
+               return actionMapping.findForward("success");    
+       }
+       
+       private ActionForward edit(ActionMapping actionMapping, ActionForm actionForm, 
+               HttpServletRequest request, HttpServletResponse response)
+               throws Exception {
+               //retrieve parameters
+               Integer id = new Integer(request.getParameter(ServletConstants.ID));
+               String offset = request.getParameter(ServletConstants.OFFSET);
+
+               //access to persistence
+               ServletContext context = getServlet().getServletContext();
+               ContentService contentService = 
+                       new ContentService((SessionFactory)context
+                               .getAttribute(ServletConstants.SESSION_FACTORY));
+               
+               //retrieve entities
+    IContent content = (IContent) contentService.load(id);
+               
+               //configure the data to send to view
+               request.setAttribute(ServletConstants.OFFSET, offset);
+               request.setAttribute(ServletConstants.NEW,"0");
+               request.setAttribute("article", content);
+                                               
+               //show the view
+               return actionMapping.findForward("success");    
+       }
+}
index b4b4e45..ff73e18 100755 (executable)
@@ -37,6 +37,7 @@ import javax.servlet.ServletContext;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import mir.core.service.storage.ArticleTypeService;
 import mir.core.service.storage.MessageService;
 import mir.core.ui.servlet.ServletConstants;
 import net.sf.hibernate.SessionFactory;
@@ -50,7 +51,7 @@ import org.apache.struts.action.ActionMapping;
 /**
  * AuthenticationAction
  * @author idefix
- * @version $Id: StartpageAction.java,v 1.2 2003/09/18 21:42:16 idfx Exp $
+ * @version $Id: StartpageAction.java,v 1.3 2003/12/20 20:27:09 idfx Exp $
  */
 public class StartpageAction extends Action {
        
@@ -76,10 +77,17 @@ public class StartpageAction extends Action {
                MessageService messageService = 
                        new MessageService((SessionFactory)context
                                .getAttribute(ServletConstants.SESSION_FACTORY));
+    ArticleTypeService articleTypeService = 
+      new ArticleTypeService((SessionFactory)context
+        .getAttribute(ServletConstants.SESSION_FACTORY));
+        
                Order order = Order.desc("webdbCreate");
                List messages = messageService.list(0, order);
-               
-               request.setAttribute("messages", messages);
+    request.setAttribute("messages", messages);
+    
+    List articleTypes = articleTypeService.list();
+    request.setAttribute("articletypes", articleTypes);
+    
                return actionMapping.findForward("success");    
        }
 }
index d636598..664c5e9 100755 (executable)
@@ -44,7 +44,7 @@ import org.apache.struts.config.ModuleConfig;
 
 /**
  * HibernatePlugin
- * @version $Id: HibernatePlugin.java,v 1.3 2003/09/30 19:28:42 idfx Exp $
+ * @version $Id: HibernatePlugin.java,v 1.4 2003/12/20 20:27:09 idfx Exp $
  * @author idefix
  */
 public class HibernatePlugin implements PlugIn {
@@ -68,7 +68,8 @@ public class HibernatePlugin implements PlugIn {
         */
        public void init(ActionServlet actionServlet, ModuleConfig config)
                throws ServletException {
-               try {
+    //BasicConfigurator.configure();
+    try {
                        SessionFactory factory = 
                                new Configuration().configure().buildSessionFactory();
                        actionServlet.getServletContext()
index 9f8701c..2f22b7c 100755 (executable)
@@ -35,9 +35,15 @@ package mir.core.ui.servlet;
  * ServletConstants<br>
  * Some constant string values needed as keys to store values in the servlet context.
  * @author idefix
- * @version $Id: ServletConstants.java,v 1.3 2003/09/18 21:42:17 idfx Exp $
+ * @version $Id: ServletConstants.java,v 1.4 2003/12/20 20:27:10 idfx Exp $
  */
 public interface ServletConstants {
+       public static final String TOPICS = "topics";
+
+       public static final String LANGUAGES = "languages";
+       
+       public static final String ARTICLE_TYPES = "articletypes";
+
        public static final String DELETE = "delete";
 
        public static final String NEW = "new";
index 78e4008..5ec2abd 100755 (executable)
@@ -53,6 +53,9 @@ import javax.servlet.http.HttpSession;
 
 import mir.config.MirPropertiesConfiguration;
 import mir.config.MirPropertiesConfiguration.PropertiesConfigExc;
+import mir.core.service.storage.ArticleTypeService;
+import mir.core.service.storage.LanguageService;
+import mir.core.service.storage.TopicService;
 import mir.servlet.ServletModuleExc;
 import mir.util.GeneratorDateTimeFunctions;
 import mir.util.GeneratorExpressionFunctions;
@@ -66,13 +69,14 @@ import mir.util.StringRoutines;
 import mircoders.global.MirGlobal;
 import mircoders.servlet.ServletHelper;
 import multex.Failure;
+import net.sf.hibernate.SessionFactory;
 
 import org.apache.struts.util.MessageResources;
 
 /**
  * TemplateServlet
  * @author idefix
- * @version $Id: TemplateServlet.java,v 1.3 2003/09/18 21:42:17 idfx Exp $
+ * @version $Id: TemplateServlet.java,v 1.4 2003/12/20 20:27:10 idfx Exp $
  */
 public class TemplateServlet extends HttpServlet {
        private MirPropertiesConfiguration _configuration;
@@ -115,7 +119,23 @@ public class TemplateServlet extends HttpServlet {
        protected void process(HttpServletRequest request, HttpServletResponse response) 
                throws IOException, ServletException {
                try {
-                       setLoginLanguages(this.getServletContext());
+                       //setting some data which are needed often
+                       //should be done a bit smarter
+                       setLoginLanguages(getServletContext());
+                       ServletContext context = getServletContext();
+                       TopicService topicService = 
+                               new TopicService((SessionFactory)context
+                                       .getAttribute(ServletConstants.SESSION_FACTORY));
+                       LanguageService languageService = 
+                               new LanguageService((SessionFactory)context
+                                       .getAttribute(ServletConstants.SESSION_FACTORY));
+                       ArticleTypeService articleTypeService = 
+                               new ArticleTypeService((SessionFactory)context
+                                       .getAttribute(ServletConstants.SESSION_FACTORY));
+                       context.setAttribute(ServletConstants.TOPICS, topicService.list());
+                       context.setAttribute(ServletConstants.LANGUAGES, languageService.list());
+                       context.setAttribute(ServletConstants.ARTICLE_TYPES, articleTypeService.list());
+                       
                        
                        Map requestData = new HashMap();
                        Enumeration keys = request.getAttributeNames();
index cf86d8d..3c3409e 100755 (executable)
       <form method="POST" action="${config.docRoot}">
         <input type="hidden" name="module" value="Content">
         <input type="hidden" name="do" value="search">
-        <input type="hidden" name="selectarticleurl" value="${utility.encodeHTML(selectarticleurl)}">
+        <input type="hidden" name="selectarticleurl" value="${utility.encodeHTML(request.selectarticleurl)}">
          
         <table border="0" cellpadding="2" cellspacing="3">
           <tr <if !layout>class="bg-neutral"</if>>
diff --git a/templates/admin/content.tmpl b/templates/admin/content.tmpl
new file mode 100755 (executable)
index 0000000..07cbcd9
--- /dev/null
@@ -0,0 +1,204 @@
+<html>
+<head>
+  <title>${lang("content.htmltitle")}</title>
+  <link rel="stylesheet" type="text/css" href="${config.docRoot}/style/admin.css"
+</head>
+
+<body marginwidth="0" marginheight="0" topmargin="0" leftmargin="0">
+
+<include "FUNCTIONS.tmpl">
+<include "head.tmpl">
+
+<if request.new && request.new=="1">
+  <assign action="contentSave.do">
+  <assign new=request.new>
+<else>
+  <assign action="requestSave.do">
+  <assign new="0">
+</if>
+<assign thisurl="contentSave.do?id="+utility.encodeHTML(request.article.id) >
+
+<form method="post" action="${config.docRoot}/admin/contentSave.do">
+  <input type="hidden" name="id" value="${utility.encodeHTML(request.article.id)}">
+  <input type="hidden" name="returnurl" value="${utility.encodeHTML(request.returnurl)}">
+  <input type="hidden" name="new" value="${new}">
+
+<table width="100%" cellspacing="0" cellpadding="5">
+  <tr>
+    <td align="left" valign="top">
+      <if new=="0">
+        <call showButton(
+          "module=Comment&do=articlecomments&articleid="+request.article.id+"&returnurl="+utility.encodeURI(thisurl),
+          lang("content.comments"))>
+        <call showAbsoluteLinkButton(
+          request.article.publicurl,
+          lang("preview"))>
+        <list request.article.operations as op>
+          <call showButton(
+            "module=Localizer&do=articleoperation&operation="+op+"&articleid="+request.article.id+"&returnurl="+utility.encodeURI(thisurl), 
+            lang("content.operation."+op))>
+        </list>
+      </if>
+      
+    </td>
+    <td align="right" valign="top">
+      ${lang("content.published")} :
+      <input type="checkbox" name="is_published" value="1"<if request.article.published!="0" && request.article.published!=""> checked</if>>
+      <if new=="1">
+        <input type="submit" name="save" value="${lang("insert")}">
+      <else>
+        <input type="submit" name="save" value="${lang("save")}">
+      </if>
+    </td>
+  </tr>
+</table>
+<table width="100%" cellspacing="3" cellpadding="2">
+  <tr>
+    <td align="right" class="table-left">
+      id # :
+    </td>
+    <td class="listrow2">
+      ${request.article.id}
+    </td>
+  </tr>
+  
+  <tr>
+    <td align="right" class="table-left">
+      ${lang("content.lastchange_date")}:
+    </td>
+    <td class="listrow2">
+      ${utility.encodeHTML(request.article.webdbLastchange.format(config["Mir.DefaultDateTimeFormat"]))}<br>
+    </td>
+  </tr>
+
+  <tr>
+    <td align="right" valign="top" class="table-left">
+      ${lang("content.webdbCreate")}:
+    </td>
+    <td class="listrow2">
+      ${utility.encodeHTML(request.article.webdbCreate.format(config["Mir.DefaultDateTimeFormat"]))}<br>${lang("edit")}:
+      <input type="text" size="10" maxlength="16" name="date" value=""> &nbsp; <span class="small">(yyyy-mm-dd [HH:mm])</span>
+    </td>
+  </tr>
+
+  <call PulldownTableRow (lang("content.articletype"), "to_article_type", application.articletypes, "id", "name", request.article.articleType.id, "articletypes.")>
+  <call PulldownTableRow (lang("content.language"), "to_language", application.languages, "id", "name", request.article.language.id, "")>
+  
+  <tr>
+    <td align="right" valign="top" class="table-left">
+      ${lang("content.topic")}:
+    </td>
+    <td class="listrow2" >
+      <if config["Mir.Localizer.Admin.TopicListFlavor"]!="0">
+      <table border=0 cellpadding="2" cellspacing="0">
+        <tr> 
+          <assign col=config["Mir.Localizer.Admin.TopicListColumns"]>
+          <list application.topics as t>
+            <if col=="0">
+        </tr>
+        <tr>
+          <assign col=config["Mir.Localizer.Admin.TopicListColumns"]>
+            </if>
+          <td title="${utility.encodeHTML(t.description)}">
+            <input type="checkbox" name="to_topic" value="${t.id}" <list request.article.topicsAsList as to><if (t.id == to["id"])>checked</if></list>>
+            <span class="small"> ${t.title}</span>
+          </td>
+          <assign col=utility.increment(col, "-1")>
+          </list>
+            <if col!="0">
+              <td colspan="${col}">
+                &nbsp;
+              </td>
+            </if>
+        </tr>
+      </table>
+      <else>
+      <select name="to_topic" size="7" multiple>
+               <list topics as t>
+                 <option value="${t.id}" <list request.article.topics as to><if (t.id == to["id"])>selected</if></list>>${t.title}</option>
+        </list>
+      </select>
+      </if>
+    </td>
+  </tr>
+  
+  <call TextInputTableRow      (lang("content.title"), 40, 255, "title", request.article.title)>
+  <call TextInputTableRowLight (lang("content.subtitle"), 40, 255, "subtitle", request.article.subtitle)>
+  <call TextInputTableRowLight (lang("content.edittitle"), 40, 255, "edittitle", request.article.edittitle)>
+  <comment>
+    <call TextInputTableRowLight ("", 20, 20, "subtitle", request.article.edittitle)>
+  </comment>
+  <call TextInputTableRowLight (lang("content.location"), 40, 255, "source", request.article.source)>
+  <call TextInputTableRow      (lang("content.creator"), 40, 80, "creator", request.article.creator)>
+  <call TextInputTableRowLight (lang("content.creator.email"), 40, 80, "creator_email", request.article.creatorEmail)>
+  <call TextInputTableRowLight (lang("content.creator.url"), 40, 255, "creator_main_url", request.article.creatorMainUrl)>
+  <call TextInputTableRowLight (lang("content.creator.address"), 20, 80, "creator_address", request.article.creatorAddress)>
+  <call TextInputTableRowLight (lang("content.creator.telephone"), 20, 20, "creator_phone", request.article.creatorPhone)>
+  <call CheckboxTableRow       (lang("content.html"), "is_html", request.article.html )>
+  <call TextAreaTableRow       (lang("content.abstract"), "", 70, 15, "description", request.article.description)>
+  <call TextAreaTableRow       (lang("content.content"), "", 70, 20, "content_data", request.article.contentData)>
+  <call TextAreaTableRow       (lang("content.comment"), lang("content.internal"), 70, 6, "comment", request.article.comment)>
+
+  <tr>
+    <td colspan="2" align="right" valign="top">
+      <if new=="1">
+        <input type="submit" name="save" value="${lang("insert")}">
+      <else>
+        <input type="submit" name="save" value="${lang("save")}">
+      </if>
+    </td>
+  </tr>
+</table>
+  
+<if new=="0">
+
+<table width="90%" cellspacing="0" cellpadding="0">
+
+<tr>
+<td align="left" valign="top">
+
+<table cellspacing="3" cellpadding="2">
+  <tr>
+    <td class="table-head" colspan="2">
+      ${lang("content.family")}
+    </td>
+  </tr>
+    
+  <tr>
+    <td align=right valign=top class="table-left">
+      ${lang("content.parent")}:
+    </td>
+    <td align="left" valign="top" class="listrow2">
+      <if request.article.parentContent>
+        <b>${utility.encodeHTML(request.article.parentContent.title)}</b><br>
+        <a href="${config.docRoot}?module=Content&do=edit&id=${request.article.parentContent.id}&returnurl=${utility.encodeURI(thisurl)}">${lang("content.viewparent")}</a> |
+        <a href="${config.docRoot}?module=Content&do=clearparent&id=${request.article.id}&returnurl=${utility.encodeURI(thisurl)}">${lang("content.clearparent")}</a> |
+      </if>    
+        &nbsp;<a href="${config.docRoot}?module=Content&do=selectparent&id=${request.article.id}&returnurl=${utility.encodeURI(thisurl)}">${lang("content.selectparent")}</a>
+    </td>
+  </tr>
+    
+  <tr>
+    <td align=right valign=top class="table-left">
+      ${lang("content.children")}:
+    </td>
+    <td align="left" valign="top" class="listrow2">
+      <a href="${config.docRoot}?module=Content&do=listchildren&article_id=${request.article.id}">${lang("content.viewchildren")}</a>
+    </td>
+  </tr>
+</table>
+
+</td>
+<td align="right" valign="top">
+<call showArticleAttachments(request.article)>
+</td>
+</tr>
+</table>
+
+</if>          
+
+</form>
+
+  <include "foot.tmpl">
+</body>
+</html>
diff --git a/templates/admin/contentlist.tmpl b/templates/admin/contentlist.tmpl
new file mode 100755 (executable)
index 0000000..05d0bf5
--- /dev/null
@@ -0,0 +1,146 @@
+<comment>
+  if selectarticleurl is set, this list is used to select an article
+</comment>
+
+<if request.selectarticleurl && request.selectarticleurl !="">
+  <assign showsearch="1">
+  <assign showactions="0">
+<else>
+  <assign showactions="1">
+  <assign showsearch="0">
+</if>
+
+
+<assign showactions="1">
+<assign showsearch="0">
+<assign thisurl="contentList.do">
+
+
+<html>
+<head>
+  <title>${config["Mir.Name"]} | ${lang("contentlist.htmltitle")} </title>
+  <link rel="stylesheet" type="text/css" href="${config.docRoot}/style/admin.css">
+</head>
+
+<body marginwidth="0" marginheight="0" topmargin="0" leftmargin="0">
+<include "FUNCTIONS.tmpl">
+<include "head.tmpl">
+
+<if showsearch=="1">
+  <call ContentSearch ("layouted")>
+</if>
+
+<if request.articles>
+
+<if showactions=="1">
+  <if config["Mir.Localizer.Admin.ListOperationsFlavor"]!="0">
+    <form method="post" action="${config.docRoot}">
+      <input type="hidden" name="module" value="Localizer">
+      <input type="hidden" name="do" value="articleoperationbatch">
+      <input type="hidden" name="returnurl" value="${utility.encodeHTML(thisurl)}">
+      <p class="box">
+        <input type="submit" name="save" value="${lang("save")}"> &nbsp; (${lang("commentlist.activate")})
+      </p>
+  </if>    
+</if>
+
+<call showPrevNextLinks(prevurl, nexturl, "right")>
+
+<table border="0" width="100%" cellspacing="3" cellpadding="2">
+  <tr>
+    <td class="table-head" valign="top">
+      <span class="small">    
+      ${lang("content.creationdate")}<br>
+      ${lang("content.modificationdate")}<br>
+      ${lang("content.status")}
+      </span>
+    </td>
+    <td class="table-head" valign="top">
+      ${lang("content.type")} - ${lang("content.title")} (id # )<br>
+      ${lang("content.creator")} 
+    </td>
+    <td class="table-head" valign="top">
+      ${lang("content.comment")}
+    </td>
+    <td class="table-head" valign="top">&nbsp;</td>
+  </tr>
+
+<assign grey="0">
+  <list request.articles as entry>
+    <tr <if grey=="1"><assign grey="0">class="listrow1"<else>class="listrow2"<assign grey="1"></if>>
+      <td class="x-small">
+          ${entry.webdbCreate.format(config["Mir.DefaultDateTimeFormat"])}<br>
+          ${entry.webdbLastchange.format(config["Mir.DefaultDateTimeFormat"])}<br>
+          <if entry.published!="0">Pub.<else>-</if> <if entry.html!="0">HTML<else>-</if>
+      </td>
+      <td>
+        ${lang("articletypes." + entry.articleType.name)} <b>${entry.title}</b> (${entry.id})<br>
+        ${lang("by")} <i>${utility.encodeHTML(entry.creator)}</i><br>
+        <if showactions=="1">
+          <if config["Mir.Localizer.Admin.ListOperationsFlavor"]=="0">
+            <list entry.operations as op>
+              [ <a href="${config.docRoot}?module=Localizer&do=articleoperation&operation=${op}&articleid=${entry.id}&returnurl=${utility.encodeURI(thisurl)}">${lang("content.operation."+op)}</a> ]
+            </list>
+          </if>
+        <if config["Mir.Localizer.Admin.ListOperationsFlavor"]=="1">
+          <list entry.operations as op>
+            [ <input type="checkbox" name="operation" value="${entry.id};${op}"> ${lang("content.operation."+op)} ]
+          </list>
+        </if>
+          <if config["Mir.Localizer.Admin.ListOperationsFlavor"]=="2">
+            <if entry.operations>
+              <br>
+              <select name="operation">
+                <option value="" selected>&nbsp;</option>
+                <list entry.operations as op>
+                  <option value="${entry.id};${op}">${lang("content.operation."+op)}</option>
+                </list>
+              </select>
+            </if>
+          </if>
+          <if entry.operations> | </if>
+          <a href="${config.docRoot}/admin/contentEdit.do?id=${entry.id}&returnurl=${utility.encodeURI(thisurl)}">${lang("edit")}</a> |
+          <a href="${entry.publicurl}">${lang("preview")}</a> |
+          <a href="${config.docRoot}?module=Comment&do=articlecomments&articleid=${entry.id}&returnurl=${utility.encodeURI(thisurl)}">${lang("contentlist.comments")}</a> (${entry.commentsSize})
+        <else>
+          <span class="text">
+          <a href="${config.docRoot}?${request.selectarticleurl}&id=${entry.id}">${lang("contentlist.select")}</a>
+        </if>
+      </td>
+      <td width="25%"  <if grey=="1">class="listrow3"<else>class="listrow4"</if> valign="top">
+        <span class="small">${entry.comment}&nbsp;</span>
+      </td>
+      <td valign="top" class="listcommand">
+        <if showactions=="1">
+          <if config["Mir.Localizer.Admin.AllowDeleteArticle"]=="1">
+            <a href="${config.docRoot}?module=Content&do=delete&id=${entry.id}&okurl=${utility.encodeURI(thisurl)}&cancelurl=${utility.encodeURI(thisurl)}">[${lang("delete")}]</a>
+          </if>
+        </if>
+      </td>
+  </tr>
+</list>
+  <tr>
+    <td colspan="4" class="table-foot">
+      ${count} ${lang("records")} / ${lang("show_from_to", from, to)}
+    </td>
+  </tr>
+</table>
+
+<if showactions=="1">
+  <if config["Mir.Localizer.Admin.ListOperationsFlavor"]!="0">
+    <p class="box">
+      <input class="majorbutton" type="submit" name="save" value="${lang("save")}"> &nbsp; ( ${lang("commentlist.activate")})
+    </p>
+  </form> 
+  </if>  
+</if>
+
+<call showPrevNextLinks(prevurl, nexturl, "right")>
+
+<else>
+<p align="center" class="box">${lang("no_matches_found")}</p>
+</if>
+
+<include "foot.tmpl">
+</body>
+</html>
index bbf148a..ff09e29 100755 (executable)
@@ -22,8 +22,8 @@
 
     <p class="box-head"><b>${lang("start.articles.title")}</b></p>  
     <p class="box">
-      <list articletypes as a>
-          <a href="${config.docRoot}?module=Content&do=search&searcharticletype=${a.id}&searchorder=datedesc">&gt; ${lang("start.allarticlesoftype", lang("articletypes."+a.name))}</a><br>
+      <list request.articletypes as a>
+          <a href="${config.docRoot}/admin/contentList.do?articletype=${a.id}">&gt; ${lang("start.allarticlesoftype", lang("articletypes."+a.name))}</a><br>
       </list>
       <br>  
       <a href="${config.docRoot}?module=Content&do=list&where=${utility.encodeURI("is_published='f'")}&order=${utility.encodeURI("webdb_create desc")}" >&gt; ${lang("start.content.not_published")}</a><br>
@@ -62,7 +62,7 @@
     
     <p class="box-head"><b>${lang("start.addandedit.title")}</b></p>
     <div class="box">
-      <a href="${config.docRoot}?module=Content&do=add&where=aktuell">&gt; ${lang("start.content.new")}</a>
+      <a href="${config.docRoot}/admin/contentAdd.do?returnurl=index.do">&gt; ${lang("start.content.new")}</a>
       <br>
       
       <a href="${config.docRoot}?module=Breaking&do=list">&gt; ${lang("start.breaking.title")}</a>&nbsp;