From: idfx Date: Sat, 20 Dec 2003 20:27:09 +0000 (+0000) Subject: working on struts/hibernate for content-admin X-Git-Tag: BEFORE_MERGE_1_1~36 X-Git-Url: http://erislabs.net/gitweb/?a=commitdiff_plain;ds=sidebyside;h=fa508a480d38c156297fba93bafba8427d9601c6;p=mir.git working on struts/hibernate for content-admin --- diff --git a/dbscripts/updates/update20031005.sql b/dbscripts/updates/update20031005.sql new file mode 100755 index 00000000..16b3cfc9 --- /dev/null +++ b/dbscripts/updates/update20031005.sql @@ -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 index 00000000..9f2a995e --- /dev/null +++ b/etc/hibernate.cfg.xml @@ -0,0 +1,44 @@ + + + + + + + + jdbc:postgresql://localhost:5432/mir + org.postgresql.Driver + eppc + + 10 + 100 + false + true + net.sf.hibernate.dialect.PostgreSQLDialect + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/source/mir/core/model/Comment.hbm.xml b/source/mir/core/model/Comment.hbm.xml index 69126ff3..b834a028 100755 --- a/source/mir/core/model/Comment.hbm.xml +++ b/source/mir/core/model/Comment.hbm.xml @@ -15,16 +15,19 @@ comment_id_seq + + + + - - - + + + + + + + + + diff --git a/source/mir/core/model/Comment.java b/source/mir/core/model/Comment.java index 9b186e7e..3b2a2639 100755 --- a/source/mir/core/model/Comment.java +++ b/source/mir/core/model/Comment.java @@ -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(); + } } diff --git a/source/mir/core/model/Content.hbm.xml b/source/mir/core/model/Content.hbm.xml index fc98f554..f80f916a 100755 --- a/source/mir/core/model/Content.hbm.xml +++ b/source/mir/core/model/Content.hbm.xml @@ -15,11 +15,13 @@ media_id_seq @@ -163,26 +165,37 @@ class="mir.core.model.ArticleType" column="to_article_type" /> + + + + + + + table="content" + cascade="all" + inverse="true" + > @@ -190,15 +203,17 @@ class="mir.core.model.Content" /> - - + + + + + + + + diff --git a/source/mir/core/model/Content.java b/source/mir/core/model/Content.java index a9330df8..397cb1c7 100755 --- a/source/mir/core/model/Content.java +++ b/source/mir/core/model/Content.java @@ -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 index 00000000..02cbf3d9 --- /dev/null +++ b/source/mir/core/model/IComment.java @@ -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 diff --git a/source/mir/core/model/IContent.java b/source/mir/core/model/IContent.java index f56b38d0..245e5a6b 100755 --- a/source/mir/core/model/IContent.java +++ b/source/mir/core/model/IContent.java @@ -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 index 00000000..9c37ff44 --- /dev/null +++ b/source/mir/core/model/ITopic.java @@ -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 diff --git a/source/mir/core/model/Language.java b/source/mir/core/model/Language.java index 8b959c66..8e1a82bc 100755 --- a/source/mir/core/model/Language.java +++ b/source/mir/core/model/Language.java @@ -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; } diff --git a/source/mir/core/model/Media.hbm.xml b/source/mir/core/model/Media.hbm.xml index 510ecb4a..78cafb27 100755 --- a/source/mir/core/model/Media.hbm.xml +++ b/source/mir/core/model/Media.hbm.xml @@ -21,11 +21,13 @@ name="id" type="int" column="id" + unsaved-value="0" > media_id_seq + + + + + - + - + diff --git a/source/mir/core/model/Media.java b/source/mir/core/model/Media.java index ddcfc895..37711266 100755 --- a/source/mir/core/model/Media.java +++ b/source/mir/core/model/Media.java @@ -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) { diff --git a/source/mir/core/model/Topic.java b/source/mir/core/model/Topic.java index 872bae8f..3086787a 100755 --- a/source/mir/core/model/Topic.java +++ b/source/mir/core/model/Topic.java @@ -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 */ diff --git a/source/mir/core/service/storage/ContentService.java b/source/mir/core/service/storage/ContentService.java index cff8e7a1..ec044566 100755 --- a/source/mir/core/service/storage/ContentService.java +++ b/source/mir/core/service/storage/ContentService.java @@ -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()); } } diff --git a/source/mir/core/service/storage/StorageService.java b/source/mir/core/service/storage/StorageService.java index 03b9ad40..d81e07f5 100755 --- a/source/mir/core/service/storage/StorageService.java +++ b/source/mir/core/service/storage/StorageService.java @@ -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){ diff --git a/source/mir/core/test/Test.java b/source/mir/core/test/Test.java index 0ddcd671..7f3d92ec 100755 --- a/source/mir/core/test/Test.java +++ b/source/mir/core/test/Test.java @@ -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 index 00000000..2f8a0ca4 --- /dev/null +++ b/source/mir/core/ui/action/admin/ContentAction.java @@ -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"); + } +} diff --git a/source/mir/core/ui/action/admin/StartpageAction.java b/source/mir/core/ui/action/admin/StartpageAction.java index b4b4e45e..ff73e184 100755 --- a/source/mir/core/ui/action/admin/StartpageAction.java +++ b/source/mir/core/ui/action/admin/StartpageAction.java @@ -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"); } } diff --git a/source/mir/core/ui/plugin/HibernatePlugin.java b/source/mir/core/ui/plugin/HibernatePlugin.java index d636598a..664c5e96 100755 --- a/source/mir/core/ui/plugin/HibernatePlugin.java +++ b/source/mir/core/ui/plugin/HibernatePlugin.java @@ -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() diff --git a/source/mir/core/ui/servlet/ServletConstants.java b/source/mir/core/ui/servlet/ServletConstants.java index 9f8701c5..2f22b7ca 100755 --- a/source/mir/core/ui/servlet/ServletConstants.java +++ b/source/mir/core/ui/servlet/ServletConstants.java @@ -35,9 +35,15 @@ package mir.core.ui.servlet; * ServletConstants
* 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"; diff --git a/source/mir/core/ui/servlet/TemplateServlet.java b/source/mir/core/ui/servlet/TemplateServlet.java index 78e40088..5ec2abd0 100755 --- a/source/mir/core/ui/servlet/TemplateServlet.java +++ b/source/mir/core/ui/servlet/TemplateServlet.java @@ -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(); diff --git a/templates/admin/FUNCTIONS.tmpl b/templates/admin/FUNCTIONS.tmpl index cf86d8d4..3c3409ee 100755 --- a/templates/admin/FUNCTIONS.tmpl +++ b/templates/admin/FUNCTIONS.tmpl @@ -228,7 +228,7 @@
- + class="bg-neutral"> diff --git a/templates/admin/content.tmpl b/templates/admin/content.tmpl new file mode 100755 index 00000000..07cbcd9f --- /dev/null +++ b/templates/admin/content.tmpl @@ -0,0 +1,204 @@ + + + ${lang("content.htmltitle")} + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + + + + + ${lang("content.published")} : + checked> + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ id # : + + ${request.article.id} +
+ ${lang("content.lastchange_date")}: + + ${utility.encodeHTML(request.article.webdbLastchange.format(config["Mir.DefaultDateTimeFormat"]))}
+
+ ${lang("content.webdbCreate")}: + + ${utility.encodeHTML(request.article.webdbCreate.format(config["Mir.DefaultDateTimeFormat"]))}
${lang("edit")}: +   (yyyy-mm-dd [HH:mm]) +
+ ${lang("content.topic")}: + + + + + + + + + + + + + + + + + + +
+ checked> + ${t.title} + +   +
+ + +
+
+ + + + + +
+ + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ ${lang("content.family")} +
+ ${lang("content.parent")}: + + + ${utility.encodeHTML(request.article.parentContent.title)}
+ ${lang("content.viewparent")} | + ${lang("content.clearparent")} | +
+  ${lang("content.selectparent")} +
+ ${lang("content.children")}: + + ${lang("content.viewchildren")} +
+ +
+ +
+ +
+ +
+ + + + diff --git a/templates/admin/contentlist.tmpl b/templates/admin/contentlist.tmpl new file mode 100755 index 00000000..05d0bf53 --- /dev/null +++ b/templates/admin/contentlist.tmpl @@ -0,0 +1,146 @@ + + if selectarticleurl is set, this list is used to select an article + + + + + + + + + + + + + + + + + + + ${config["Mir.Name"]} | ${lang("contentlist.htmltitle")} + + + + + + + + + + + + + + + +
+ + + +

+   (${lang("commentlist.activate")}) +

+ + + + + + + + + + + + + + + + class="listrow1"class="listrow2"> + + + + + + + + + +
+ + ${lang("content.creationdate")}
+ ${lang("content.modificationdate")}
+ ${lang("content.status")} +
+
+ ${lang("content.type")} - ${lang("content.title")} (id # )
+ ${lang("content.creator")} +
+ ${lang("content.comment")} +  
+ ${entry.webdbCreate.format(config["Mir.DefaultDateTimeFormat"])}
+ ${entry.webdbLastchange.format(config["Mir.DefaultDateTimeFormat"])}
+ Pub.- HTML- +
+ ${lang("articletypes." + entry.articleType.name)} ${entry.title} (${entry.id})
+ ${lang("by")} ${utility.encodeHTML(entry.creator)}
+ + + + [ ${lang("content.operation."+op)} ] + + + + + [ ${lang("content.operation."+op)} ] + + + + +
+ +
+
+ | + ${lang("edit")} | + ${lang("preview")} | + ${lang("contentlist.comments")} (${entry.commentsSize}) + + + ${lang("contentlist.select")} +
+
class="listrow3"class="listrow4" valign="top"> + ${entry.comment}  + + + + [${lang("delete")}] + + +
+ ${count} ${lang("records")} / ${lang("show_from_to", from, to)} +
+ + + +

+   ( ${lang("commentlist.activate")}) +

+ +
+
+ + + + +

${lang("no_matches_found")}

+
+ + + + diff --git a/templates/admin/index.tmpl b/templates/admin/index.tmpl index bbf148a3..ff09e298 100755 --- a/templates/admin/index.tmpl +++ b/templates/admin/index.tmpl @@ -22,8 +22,8 @@

${lang("start.articles.title")}

- - > ${lang("start.allarticlesoftype", lang("articletypes."+a.name))}
+ + > ${lang("start.allarticlesoftype", lang("articletypes."+a.name))}

> ${lang("start.content.not_published")}
@@ -62,7 +62,7 @@

${lang("start.addandedit.title")}