CT NewsItem
* Kleine Korrekturen git-svn-id: https://svn.libreccm.org/ccm/trunk@440 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
8fde211eba
commit
90acf45f3c
|
|
@ -18,8 +18,6 @@
|
||||||
*/
|
*/
|
||||||
package com.arsdigita.cms.contenttypes;
|
package com.arsdigita.cms.contenttypes;
|
||||||
|
|
||||||
|
|
||||||
import com.arsdigita.cms.basetypes.Article;
|
|
||||||
import com.arsdigita.cms.ContentType;
|
import com.arsdigita.cms.ContentType;
|
||||||
import com.arsdigita.domain.DataObjectNotFoundException;
|
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||||
import com.arsdigita.persistence.DataObject;
|
import com.arsdigita.persistence.DataObject;
|
||||||
|
|
@ -57,22 +55,19 @@ import java.util.Date;
|
||||||
* @author Shashin Shinde <a href="mailto:sshinde@redhat.com">sshinde@redhat.com</a>
|
* @author Shashin Shinde <a href="mailto:sshinde@redhat.com">sshinde@redhat.com</a>
|
||||||
* @version $Revision: #7 $ $Date: 2004/08/17 $
|
* @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 */
|
/** PDL property name for lead */
|
||||||
public static final String LEAD = "lead";
|
public static final String LEAD = "lead";
|
||||||
/** PDL property name for news date */
|
/** PDL property name for news date */
|
||||||
public static final String NEWS_DATE = "newsDate";
|
public static final String NEWS_DATE = "newsDate";
|
||||||
public static final String IS_HOMEPAGE = "isHomepage";
|
public static final String IS_HOMEPAGE = "isHomepage";
|
||||||
|
|
||||||
public static final String RECENT_NEWS =
|
public static final String RECENT_NEWS =
|
||||||
"com.arsdigita.cms.contenttypes.RecentNews";
|
"com.arsdigita.cms.contenttypes.RecentNews";
|
||||||
|
|
||||||
/** Data object type for this domain object */
|
/** Data object type for this domain object */
|
||||||
public static final String BASE_DATA_OBJECT_TYPE
|
public static final String BASE_DATA_OBJECT_TYPE = "com.arsdigita.cms.contenttypes.NewsItem";
|
||||||
= "com.arsdigita.cms.contenttypes.NewsItem";
|
|
||||||
|
|
||||||
private static final NewsItemConfig s_config = new NewsItemConfig();
|
private static final NewsItemConfig s_config = new NewsItemConfig();
|
||||||
|
|
||||||
static {
|
static {
|
||||||
s_config.load();
|
s_config.load();
|
||||||
}
|
}
|
||||||
|
|
@ -101,6 +96,7 @@ public class NewsItem extends Article {
|
||||||
super(type);
|
super(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
super.initialize();
|
super.initialize();
|
||||||
|
|
||||||
|
|
@ -109,6 +105,7 @@ public class NewsItem extends Article {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void beforeSave() {
|
public void beforeSave() {
|
||||||
super.beforeSave();
|
super.beforeSave();
|
||||||
|
|
||||||
|
|
@ -139,15 +136,15 @@ public class NewsItem extends Article {
|
||||||
|
|
||||||
public String getDisplayNewsDate() {
|
public String getDisplayNewsDate() {
|
||||||
Date d = getNewsDate();
|
Date d = getNewsDate();
|
||||||
return (d != null) ? DateFormat.getDateInstance(DateFormat.LONG)
|
return (d != null) ? DateFormat.getDateInstance(DateFormat.LONG).format(d) : null;
|
||||||
.format(d) : null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setNewsDate(Date newsDate) {
|
public void setNewsDate(Date newsDate) {
|
||||||
set(NEWS_DATE, newsDate);
|
set(NEWS_DATE, newsDate);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final int SUMMARY_LENGTH = 200;
|
public static final int SUMMARY_LENGTH = 200;
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getSearchSummary() {
|
public String getSearchSummary() {
|
||||||
return com.arsdigita.util.StringUtils.truncateString(getLead(),
|
return com.arsdigita.util.StringUtils.truncateString(getLead(),
|
||||||
SUMMARY_LENGTH,
|
SUMMARY_LENGTH,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue