diff --git a/ccm-cms-types-newsitem/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/NewsItem.xml b/ccm-cms-types-newsitem/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/NewsItem.xml index 9d912616b..815e620b2 100755 --- a/ccm-cms-types-newsitem/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/NewsItem.xml +++ b/ccm-cms-types-newsitem/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/NewsItem.xml @@ -1,36 +1,36 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://xmlns.redhat.com/cms/content-types content-types.xsd"> - + - + - - - + + - - + - + diff --git a/ccm-cms-types-newsitem/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/NewsItem.xml b/ccm-cms-types-newsitem/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/NewsItem.xml index 33b20e840..c829a59a2 100755 --- a/ccm-cms-types-newsitem/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/NewsItem.xml +++ b/ccm-cms-types-newsitem/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/NewsItem.xml @@ -1,20 +1,20 @@ - - - + - - - + + + diff --git a/ccm-cms-types-newsitem/src/com/arsdigita/cms/contenttypes/NewsItem.java b/ccm-cms-types-newsitem/src/com/arsdigita/cms/contenttypes/NewsItem.java index 2c36613ae..77326cc00 100755 --- a/ccm-cms-types-newsitem/src/com/arsdigita/cms/contenttypes/NewsItem.java +++ b/ccm-cms-types-newsitem/src/com/arsdigita/cms/contenttypes/NewsItem.java @@ -18,8 +18,6 @@ */ package com.arsdigita.cms.contenttypes; - -import com.arsdigita.cms.basetypes.Article; import com.arsdigita.cms.ContentType; import com.arsdigita.domain.DataObjectNotFoundException; import com.arsdigita.persistence.DataObject; @@ -57,26 +55,23 @@ import java.util.Date; * @author Shashin Shinde sshinde@redhat.com * @version $Revision: #7 $ $Date: 2004/08/17 $ **/ -public class NewsItem extends Article { +public class NewsItem extends com.arsdigita.cms.basetypes.Article { /** PDL property name for lead */ public static final String LEAD = "lead"; /** PDL property name for news date */ public static final String NEWS_DATE = "newsDate"; public static final String IS_HOMEPAGE = "isHomepage"; - - public static final String RECENT_NEWS = - "com.arsdigita.cms.contenttypes.RecentNews"; - + public static final String RECENT_NEWS = + "com.arsdigita.cms.contenttypes.RecentNews"; /** Data object type for this domain object */ - public static final String BASE_DATA_OBJECT_TYPE - = "com.arsdigita.cms.contenttypes.NewsItem"; - + public static final String BASE_DATA_OBJECT_TYPE = "com.arsdigita.cms.contenttypes.NewsItem"; private static final NewsItemConfig s_config = new NewsItemConfig(); + static { s_config.load(); } - + public static final NewsItemConfig getConfig() { return s_config; } @@ -101,17 +96,19 @@ public class NewsItem extends Article { super(type); } + @Override public void initialize() { super.initialize(); - + if (isNew()) { setIsHomepage(Boolean.FALSE); } } + @Override public void beforeSave() { super.beforeSave(); - + Assert.exists(getContentType(), ContentType.class); } @@ -139,19 +136,19 @@ public class NewsItem extends Article { public String getDisplayNewsDate() { Date d = getNewsDate(); - return (d != null) ? DateFormat.getDateInstance(DateFormat.LONG) - .format(d) : null; + return (d != null) ? DateFormat.getDateInstance(DateFormat.LONG).format(d) : null; } public void setNewsDate(Date newsDate) { set(NEWS_DATE, newsDate); } - public static final int SUMMARY_LENGTH = 200; + + @Override public String getSearchSummary() { return com.arsdigita.util.StringUtils.truncateString(getLead(), - SUMMARY_LENGTH, - true); + SUMMARY_LENGTH, + true); } /*