Lokalisierung und Resource Bundles vervollständigt.

git-svn-id: https://svn.libreccm.org/ccm/trunk@2174 8810af33-2d31-482b-a856-94f89814c4df
master
pb 2013-06-06 00:32:50 +00:00
parent d29291bd87
commit 0a59971906
21 changed files with 216 additions and 128 deletions

View File

@ -2,9 +2,9 @@ agenda.authoring.basic_properties.title=Agenda Properties
agenda.authoring.basic_properties.description=Edit the basic address properties
agenda.authoring.categories.title=Assign categories
agenda.authoring.categories.description=Assign categories
cms.contenttypes.ui.agenda.agenda_date=Date
cms.contenttypes.ui.agenda.location=Location
cms.contenttypes.ui.agenda.attendees=Attendees
cms.contenttypes.ui.agenda.subject_items=Subject Items
cms.contenttypes.ui.agenda.contact_info=Contact Information
cms.contenttypes.ui.agenda.creation_date=Creation Date
cms.contenttypes.ui.agenda.agenda_date=Date:
cms.contenttypes.ui.agenda.location=Location:
cms.contenttypes.ui.agenda.attendees=Attendees:
cms.contenttypes.ui.agenda.subject_items=Subject Items:
cms.contenttypes.ui.agenda.contact_info=Contact Information:
cms.contenttypes.ui.agenda.creation_date=Creation Date:

View File

@ -2,9 +2,9 @@ agenda.authoring.basic_properties.title=Eigenschaften von Agenda
agenda.authoring.basic_properties.description=Editieren der grundlegenden Agenda Eigenschaften
agenda.authoring.categories.title=Kategorien zuweisen
agenda.authoring.categories.description=Zuweisen von Kategorien
cms.contenttypes.ui.agenda.agenda_date=Datum
cms.contenttypes.ui.agenda.location=Ort
cms.contenttypes.ui.agenda.attendees=Teilnehmer
cms.contenttypes.ui.agenda.subject_items=Themen
cms.contenttypes.ui.agenda.contact_info=Kontakt Information
cms.contenttypes.ui.agenda.creation_date=Erstellungsdatum
cms.contenttypes.ui.agenda.agenda_date=Datum:
cms.contenttypes.ui.agenda.location=Ort:
cms.contenttypes.ui.agenda.attendees=Teilnehmer:
cms.contenttypes.ui.agenda.subject_items=Themen:
cms.contenttypes.ui.agenda.contact_info=Kontakt Information:
cms.contenttypes.ui.agenda.creation_date=Erstellungsdatum:

View File

@ -78,14 +78,14 @@ public class AgendaPropertiesStep extends SimpleEditStep {
itemModel ) {
DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(itemModel);
sheet.add((String) AgendaGlobalizationUtil
.globalize("cms.contenttypes.ui.name").localize(), Agenda.NAME );
sheet.add((String) AgendaGlobalizationUtil
.globalize("cms.contenttypes.ui.title").localize(), Agenda.TITLE);
sheet.add(AgendaGlobalizationUtil
.globalize("cms.contenttypes.ui.title"), Agenda.TITLE);
sheet.add(AgendaGlobalizationUtil
.globalize("cms.contenttypes.ui.name"), Agenda.NAME );
if (!ContentSection.getConfig().getHideLaunchDate()) {
sheet.add((String) AgendaGlobalizationUtil
.globalize("cms.ui.authoring.page_launch_date").localize(),
sheet.add(AgendaGlobalizationUtil
.globalize("cms.ui.authoring.page_launch_date"),
ContentPage.LAUNCH_DATE,
new DomainObjectPropertySheet.AttributeFormatter() {
public String format(DomainObject item,
@ -93,7 +93,9 @@ public class AgendaPropertiesStep extends SimpleEditStep {
PageState state) {
ContentPage page = (ContentPage) item;
if(page.getLaunchDate() != null) {
return DateFormat.getDateInstance(DateFormat.LONG, GlobalizationHelper.getNegotiatedLocale())
return DateFormat.getDateInstance
(DateFormat.LONG,
GlobalizationHelper.getNegotiatedLocale())
.format(page.getLaunchDate());
} else {
return (String)AgendaGlobalizationUtil.globalize("cms.ui.unknown").localize();
@ -101,20 +103,20 @@ public class AgendaPropertiesStep extends SimpleEditStep {
}
});
}
sheet.add((String) AgendaGlobalizationUtil
.globalize("cms.contenttypes.ui.summary").localize(), Agenda.SUMMARY);
sheet.add((String) AgendaGlobalizationUtil
.globalize("cms.contenttypes.ui.agenda.agenda_date").localize(), Agenda.AGENDA_DATE);
sheet.add((String) AgendaGlobalizationUtil
.globalize("cms.contenttypes.ui.agenda.location").localize(), Agenda.LOCATION);
sheet.add((String) AgendaGlobalizationUtil
.globalize("cms.contenttypes.ui.agenda.attendees").localize(), Agenda.ATTENDEES);
sheet.add((String) AgendaGlobalizationUtil
.globalize("cms.contenttypes.ui.agenda.subject_items").localize(), Agenda.SUBJECT_ITEMS);
sheet.add((String) AgendaGlobalizationUtil
.globalize("cms.contenttypes.ui.agenda.contact_info").localize(), Agenda.CONTACT_INFO);
sheet.add((String) AgendaGlobalizationUtil
.globalize("cms.contenttypes.ui.agenda.creation_date").localize(),
sheet.add(AgendaGlobalizationUtil
.globalize("cms.contenttypes.ui.summary"), Agenda.SUMMARY);
sheet.add(AgendaGlobalizationUtil
.globalize("cms.contenttypes.ui.agenda.agenda_date"), Agenda.AGENDA_DATE);
sheet.add(AgendaGlobalizationUtil
.globalize("cms.contenttypes.ui.agenda.location"), Agenda.LOCATION);
sheet.add(AgendaGlobalizationUtil
.globalize("cms.contenttypes.ui.agenda.attendees"), Agenda.ATTENDEES);
sheet.add(AgendaGlobalizationUtil
.globalize("cms.contenttypes.ui.agenda.subject_items"), Agenda.SUBJECT_ITEMS);
sheet.add(AgendaGlobalizationUtil
.globalize("cms.contenttypes.ui.agenda.contact_info"), Agenda.CONTACT_INFO);
sheet.add(AgendaGlobalizationUtil
.globalize("cms.contenttypes.ui.agenda.creation_date"),
Agenda.AGENDA_DATE,
new DomainObjectPropertySheet.AttributeFormatter() {
public String format(DomainObject item,
@ -122,10 +124,13 @@ public class AgendaPropertiesStep extends SimpleEditStep {
PageState state) {
Agenda agenda = (Agenda) item;
if(agenda.getCreationDate() != null) {
return DateFormat.getDateInstance(DateFormat.LONG, GlobalizationHelper.getNegotiatedLocale())
return DateFormat.getDateInstance(
DateFormat.LONG,
GlobalizationHelper.getNegotiatedLocale())
.format(agenda.getCreationDate());
} else {
return (String)AgendaGlobalizationUtil.globalize("cms.ui.unknown").localize();
return (String)AgendaGlobalizationUtil
.globalize("cms.ui.unknown").localize();
}
}
});

View File

@ -36,12 +36,21 @@ public class AgendaGlobalizationUtil implements Globalized {
final public static String BUNDLE_NAME =
"com.arsdigita.cms.contenttypes.AgendaResources";
/** Name of Java resource files to handle CMS globalisation. */
final public static String ALTERNATE_BUNDLE_NAME =
"com.arsdigita.cms.CMSResources";
/**
* This returns a globalized message using the type specific bundle,
* BUNDLE_NAME
* BUNDLE_NAME if the key string contains the modules name agenda,
* otherwise the CMS ResourceBundle is used.
*/
public static GlobalizedMessage globalize(String key) {
if (key.indexOf(".agenda.") > 0) {
return new GlobalizedMessage(key, BUNDLE_NAME);
} else {
return new GlobalizedMessage(key, ALTERNATE_BUNDLE_NAME);
}
}
/**
@ -50,6 +59,10 @@ public class AgendaGlobalizationUtil implements Globalized {
* interpolate into the retrieved message using the MessageFormat class.
*/
public static GlobalizedMessage globalize(String key, Object[] args) {
if (key.indexOf(".agenda.") > 0) {
return new GlobalizedMessage(key, BUNDLE_NAME, args);
} else {
return new GlobalizedMessage(key, ALTERNATE_BUNDLE_NAME, args);
}
}
}

View File

@ -1,2 +0,0 @@
article.authoring.image.title=Image
article.authoring.image.description=Image

View File

@ -1,2 +0,0 @@
article.authoring.image.title=Bild
article.authoring.image.description=Bild

View File

@ -39,7 +39,8 @@ public class ArticlePropertiesStep extends GenericArticlePropertiesStep {
/** The name of the editing sheet added to this step */
public static String EDIT_SHEET_NAME = "edit";
public ArticlePropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent) {
public ArticlePropertiesStep(ItemSelectionModel itemModel,
AuthoringKitWizard parent) {
super(itemModel, parent);
}
@ -47,7 +48,10 @@ public class ArticlePropertiesStep extends GenericArticlePropertiesStep {
protected void createEditSheet(ItemSelectionModel itemModel) {
BasicPageForm editSheet;
editSheet = new ArticlePropertyForm(itemModel, this);
add(EDIT_SHEET_NAME, "Edit", new WorkflowLockedComponentAccess(editSheet, itemModel), editSheet.getSaveCancelSection().getCancelButton());
add(EDIT_SHEET_NAME,
"Edit",
new WorkflowLockedComponentAccess(editSheet, itemModel),
editSheet.getSaveCancelSection().getCancelButton());
}
@Override
@ -64,9 +68,11 @@ public class ArticlePropertiesStep extends GenericArticlePropertiesStep {
* of the release
*/
public static Component getArticlePropertySheet(ItemSelectionModel itemModel) {
DomainObjectPropertySheet sheet = (DomainObjectPropertySheet) getGenericArticlePropertySheet(itemModel);
DomainObjectPropertySheet sheet = (DomainObjectPropertySheet)
getGenericArticlePropertySheet(itemModel);
sheet.add(GlobalizationUtil.globalize("cms.contenttypes.ui.lead"), Article.LEAD);
sheet.add(GlobalizationUtil.globalize("cms.contenttypes.ui.lead"),
Article.LEAD);
return sheet;
}

View File

@ -64,7 +64,8 @@ public class ArticlePropertyForm extends GenericArticlePropertyForm
* Article to work on
* @param step The ArticlePropertiesStep which controls this form.
*/
public ArticlePropertyForm(ItemSelectionModel itemModel, ArticlePropertiesStep step) {
public ArticlePropertyForm(ItemSelectionModel itemModel,
ArticlePropertiesStep step) {
super(itemModel, step);
m_step = step;
addSubmissionListener(this);
@ -88,7 +89,8 @@ public class ArticlePropertyForm extends GenericArticlePropertyForm
}
//leadParam
// .addParameterListener( new NotNullValidationListener() );
leadParam.addParameterListener(new StringInRangeValidationListener(0, 1000));
leadParam.addParameterListener(new StringInRangeValidationListener(0,
1000));
TextArea lead = new TextArea(leadParam);
lead.setCols(40);
lead.setRows(5);
@ -113,8 +115,8 @@ public class ArticlePropertyForm extends GenericArticlePropertyForm
/** Cancels streamlined editing. */
@Override
public void submitted(FormSectionEvent fse) {
if (m_step != null
&& getSaveCancelSection().getCancelButton().isSelected(fse.getPageState())) {
if (m_step != null && getSaveCancelSection().getCancelButton()
.isSelected(fse.getPageState())) {
m_step.cancelStreamlinedCreation(fse.getPageState());
}
}
@ -128,7 +130,8 @@ public class ArticlePropertyForm extends GenericArticlePropertyForm
// save only if save button was pressed
if (article != null
&& getSaveCancelSection().getSaveButton().isSelected(fse.getPageState())) {
&& getSaveCancelSection().getSaveButton()
.isSelected(fse.getPageState())) {
article.setLead((String) data.get(LEAD));
article.save();

View File

@ -44,6 +44,10 @@ public class Bookmark extends ContentPage {
public static final String BASE_DATA_OBJECT_TYPE
= "com.arsdigita.cms.contenttypes.Bookmark";
/** Path and filename of Bookmarks Resource Bundle file */
public static final String RESOURCES =
"com.arsdigita.cms.contenttypes.BookmarkResources";
public Bookmark() {
this( BASE_DATA_OBJECT_TYPE );
}

View File

@ -0,0 +1 @@
cms.contenttypes.ui.bookmark.url=URL:

View File

@ -0,0 +1 @@
cms.contenttypes.ui.bookmark.url=URL:

View File

@ -0,0 +1 @@
cms.contenttypes.ui.bookmark.url=URL:

View File

@ -0,0 +1 @@
cms.contenttypes.ui.bookmark.url=URL:

View File

@ -18,15 +18,17 @@
*/
package com.arsdigita.cms.contenttypes.ui;
import com.arsdigita.cms.contenttypes.Bookmark;
import com.arsdigita.bebop.Component;
import com.arsdigita.cms.ui.authoring.BasicPageForm;
import com.arsdigita.cms.contenttypes.Bookmark;
import com.arsdigita.cms.ItemSelectionModel;
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
import com.arsdigita.cms.ui.authoring.BasicPageForm;
import com.arsdigita.cms.ui.authoring.SimpleEditStep;
import com.arsdigita.toolbox.ui.DomainObjectPropertySheet;
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
import com.arsdigita.cms.util.GlobalizationUtil;
import com.arsdigita.globalization.GlobalizedMessage;
import com.arsdigita.toolbox.ui.DomainObjectPropertySheet;
/**
@ -65,10 +67,19 @@ public class BookmarkPropertiesStep
itemModel ) {
DomainObjectPropertySheet sheet = new DomainObjectPropertySheet( itemModel );
sheet.add( "Name (URL):", Bookmark.NAME );
sheet.add( "Page Title:", Bookmark.TITLE );
sheet.add( "Description:", Bookmark.DESCRIPTION );
sheet.add( "URL:", Bookmark.URL );
// sheet.add( "Page Title:", Bookmark.TITLE );
sheet.add(GlobalizationUtil
.globalize("cms.contenttypes.ui.title"), Bookmark.TITLE );
// sheet.add( "Name (URL):", Bookmark.NAME );
sheet.add(GlobalizationUtil
.globalize("cms.contenttypes.ui.name"), Bookmark.NAME );
// sheet.add( "Description:", Bookmark.DESCRIPTION );
sheet.add(GlobalizationUtil
.globalize("cms.contenttypes.ui.summary"), Bookmark.DESCRIPTION );
// sheet.add( "URL:", Bookmark.URL );
sheet.add(new GlobalizedMessage
("cms.contenttypes.ui.bookmark.url",Bookmark.RESOURCES),
Bookmark.URL );
return sheet;
}

View File

@ -27,10 +27,11 @@ import com.arsdigita.bebop.event.FormSectionEvent;
import com.arsdigita.bebop.form.TextArea;
import com.arsdigita.bebop.form.TextField;
import com.arsdigita.bebop.parameters.ParameterModel;
import com.arsdigita.bebop.parameters.ParameterModel;
import com.arsdigita.bebop.parameters.StringParameter;
import com.arsdigita.cms.ItemSelectionModel;
import com.arsdigita.cms.ui.authoring.BasicPageForm;
import com.arsdigita.cms.util.GlobalizationUtil;
import com.arsdigita.globalization.GlobalizedMessage;
/**
@ -64,7 +65,8 @@ public class BookmarkPropertyForm
protected void addWidgets() {
super.addWidgets();
add( new Label( "Description:" ) );
add( new Label( GlobalizationUtil.globalize(
"cms.contenttypes.ui.summary") ) );
ParameterModel descriptionParam
= new StringParameter( DESCRIPTION );
TextArea description = new TextArea( descriptionParam );
@ -72,7 +74,9 @@ public class BookmarkPropertyForm
description.setRows(5);
add( description );
add( new Label( "Url:" ) );
// add( new Label( "Url:" ) );
add( new Label( new GlobalizedMessage
("cms.contenttypes.ui.bookmark.url",Bookmark.RESOURCES) ) );
ParameterModel urlParam
= new StringParameter( URL );
TextField url = new TextField( urlParam );

View File

@ -8,3 +8,6 @@ cms.contenttypes.ui.newsitem.lead=Lead Text:
cms.contenttypes.ui.newsitem.date=News Date:
cms.contenttypes.ui.newsitem.homepage=Homepage
cms.contenttypes.ui.newsitem.news_date=Date
cms.contenttypes.ui.newsitem.unknown=unknown
cms.contenttypes.ui.newsitem.yes=Yes
cms.contenttypes.ui.newsitem.no=No

View File

@ -1,10 +1,10 @@
# NewsItemResources_de.properties
#
# Alle deutschem Umlaute muessen als UTF-8 eingetragen werden:
# ä = \u00e4 Ä = \u00c4
# ü = \u00fc Ü = \u00dc
# ö = \u00f6 Ö = \u00d6
# ß = \u00df
# \u00c3\u00a4 = \u00e4 \u00c3\u0084 = \u00c4
# \u00c3\u00bc = \u00fc \u00c3\u009c = \u00dc
# \u00c3\u00b6 = \u00f6 \u00c3\u0096 = \u00d6
# \u00c3\u009f = \u00df
#
newsitem.authoring.body_text.description=Bearbeitung von Titel, Namen, Zusammenfassung und Datum
newsitem.authoring.image.description=Bearbeitung des Bildes
@ -16,3 +16,6 @@ cms.contenttypes.ui.newsitem.lead=Zusammenfassung (Lead):
cms.contenttypes.ui.newsitem.date=Erscheinungsdatum:
cms.contenttypes.ui.newsitem.homepage=Homepage:
cms.contenttypes.ui.newsitem.news_date=Erscheinungsdatum:
cms.contenttypes.ui.newsitem.unknown=unbekannt
cms.contenttypes.ui.newsitem.yes=Ja
cms.contenttypes.ui.newsitem.no=Nein

View File

@ -1,8 +1,8 @@
# NewsItemResources_fr.properties
#
# UTF-8 characters:
# è = \u00e8 (LETTER E WITH GRAVE)
# é = \u00e9 (LETTER E WITH ACUTE)
# \u00c3\u00a8 = \u00e8 (LETTER E WITH GRAVE)
# \u00c3\u00a9 = \u00e9 (LETTER E WITH ACUTE)
#
newsitem.authoring.body_text.description=Bearbeitung von Titel, Namen, Zusammenfassung und Datum
newsitem.authoring.image.description=Bearbeitung des Bildes
@ -14,3 +14,6 @@ cms.contenttypes.ui.newsitem.lead=Zusammenfassung (Lead):
cms.contenttypes.ui.newsitem.date=Erscheinungsdatum:
cms.contenttypes.ui.newsitem.homepage=Homepage:
cms.contenttypes.ui.newsitem.news_date=Erscheinungsdatum:
cms.contenttypes.ui.newsitem.unknown=unknown
cms.contenttypes.ui.newsitem.yes=Yes
cms.contenttypes.ui.newsitem.no=No

View File

@ -57,7 +57,8 @@ public class NewsItemPropertiesStep extends SimpleEditStep {
BasicPageForm editSheet;
editSheet = new NewsItemPropertyForm(itemModel, this);
add(EDIT_SHEET_NAME, "Edit", new WorkflowLockedComponentAccess(editSheet, itemModel),
add(EDIT_SHEET_NAME, "Edit", new WorkflowLockedComponentAccess(editSheet,
itemModel),
editSheet.getSaveCancelSection().getCancelButton());
setDisplayComponent(getNewsDomainObjectPropertySheet(itemModel));
@ -75,11 +76,16 @@ public class NewsItemPropertiesStep extends SimpleEditStep {
public static Component getNewsDomainObjectPropertySheet(ItemSelectionModel itemModel) {
DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(itemModel);
sheet.add((String) NewsItemGlobalizationUtil.globalize("cms.contenttypes.ui.title").localize(), NewsItem.TITLE);
sheet.add((String) NewsItemGlobalizationUtil.globalize("cms.contenttypes.ui.newsitem.name").localize(), NewsItem.NAME);
sheet.add((String) NewsItemGlobalizationUtil.globalize("cms.contenttypes.ui.newsitem.lead").localize(), NewsItem.LEAD);
sheet.add(NewsItemGlobalizationUtil
.globalize("cms.contenttypes.ui.title"), NewsItem.TITLE);
sheet.add(NewsItemGlobalizationUtil
.globalize("cms.contenttypes.ui.newsitem.name"), NewsItem.NAME);
sheet.add(NewsItemGlobalizationUtil
.globalize("cms.contenttypes.ui.newsitem.lead"), NewsItem.LEAD);
if (!ContentSection.getConfig().getHideLaunchDate()) {
sheet.add(NewsItemGlobalizationUtil.globalize("cms.contenttypes.ui.launch_date"),
sheet.add(NewsItemGlobalizationUtil.globalize(
"cms.contenttypes.ui.launch_date"),
ContentPage.LAUNCH_DATE,
new DomainObjectPropertySheet.AttributeFormatter() {
@ -88,9 +94,14 @@ public class NewsItemPropertiesStep extends SimpleEditStep {
PageState state) {
ContentPage page = (ContentPage) item;
if (page.getLaunchDate() != null) {
return DateFormat.getDateInstance(DateFormat.LONG, GlobalizationHelper.getNegotiatedLocale()).format(page.getLaunchDate());
return DateFormat.getDateInstance(
DateFormat.LONG,
GlobalizationHelper.getNegotiatedLocale())
.format(page.getLaunchDate());
} else {
return (String) NewsItemGlobalizationUtil.globalize("cms.ui.unknown").localize();
return (String) NewsItemGlobalizationUtil
.globalize("cms.contenttypes.ui.newsitem.unknown")
.localize();
}
}
});
@ -98,7 +109,8 @@ public class NewsItemPropertiesStep extends SimpleEditStep {
// Show news item on homepage?
if (!NewsItem.getConfig().getHideHomepageField()) {
sheet.add((String) NewsItemGlobalizationUtil.globalize("cms.contenttypes.ui.newsitem.homepage").localize(),
sheet.add(NewsItemGlobalizationUtil
.globalize("cms.contenttypes.ui.newsitem.homepage"),
NewsItem.IS_HOMEPAGE,
new DomainObjectPropertySheet.AttributeFormatter() {
@ -108,15 +120,21 @@ public class NewsItemPropertiesStep extends SimpleEditStep {
NewsItem pr = (NewsItem) item;
if (pr.isHomepage().booleanValue()) {
return (String) NewsItemGlobalizationUtil.globalize("cms.ui.yes").localize();
return (String) NewsItemGlobalizationUtil
.globalize("cms.contenttypes.ui.newsitem.yes")
.localize();
}
return (String) NewsItemGlobalizationUtil.globalize("cms.ui.no").localize();
return (String) NewsItemGlobalizationUtil
.globalize("cms.contenttypes.ui.newsitem.no")
.localize();
}
});
}
sheet.add((String) NewsItemGlobalizationUtil.globalize("cms.contenttypes.ui.newsitem.news_date").localize(), NewsItem.NEWS_DATE,
sheet.add(NewsItemGlobalizationUtil.globalize(
"cms.contenttypes.ui.newsitem.news_date"),
NewsItem.NEWS_DATE,
new DomainObjectPropertySheet.AttributeFormatter() {
public String format(DomainObject item,
@ -124,9 +142,14 @@ public class NewsItemPropertiesStep extends SimpleEditStep {
PageState state) {
NewsItem pr = (NewsItem) item;
if (pr.getNewsDate() != null) {
return DateFormat.getDateInstance(DateFormat.LONG, GlobalizationHelper.getNegotiatedLocale()).format(pr.getNewsDate());
return DateFormat.getDateInstance(
DateFormat.LONG,
GlobalizationHelper.getNegotiatedLocale())
.format(pr.getNewsDate());
} else {
return (String) NewsItemGlobalizationUtil.globalize("cms.ui.unknown").localize();
return (String) NewsItemGlobalizationUtil
.globalize("cms.contenttypes.ui.newsitem.unknown")
.localize();
}
}
});

View File

@ -35,7 +35,7 @@ import com.arsdigita.cms.ItemSelectionModel;
import com.arsdigita.cms.contenttypes.NewsItem;
import com.arsdigita.cms.ui.authoring.BasicPageForm;
import com.arsdigita.cms.contenttypes.util.NewsItemGlobalizationUtil;
import java.util.Calendar;
import java.util.Calendar;
import java.util.GregorianCalendar;
@ -79,7 +79,8 @@ public class NewsItemPropertyForm extends BasicPageForm
* NewsItem to work on
* @param step The NewsItemPropertiesStep which controls this form.
*/
public NewsItemPropertyForm(ItemSelectionModel itemModel, NewsItemPropertiesStep step) {
public NewsItemPropertyForm(ItemSelectionModel itemModel,
NewsItemPropertiesStep step) {
super(ID, itemModel);
m_step = step;
addSubmissionListener(this);
@ -88,11 +89,13 @@ public class NewsItemPropertyForm extends BasicPageForm
/**
* Adds widgets to the form.
*/
@Override
protected void addWidgets() {
super.addWidgets();
// summary (lead)
add(new Label((String) NewsItemGlobalizationUtil.globalize("cms.contenttypes.ui.newsitem.lead").localize()));
add(new Label(NewsItemGlobalizationUtil
.globalize("cms.contenttypes.ui.newsitem.lead")));
ParameterModel leadParam = new StringParameter(LEAD);
//leadParam
// .addParameterListener(new NotNullValidationListener());
@ -105,21 +108,26 @@ public class NewsItemPropertyForm extends BasicPageForm
if (!NewsItem.getConfig().getHideHomepageField()) {
RadioGroup homepageWidget = new RadioGroup(IS_HOMEPAGE);
homepageWidget.addOption(new Option("true",
new Label((String) NewsItemGlobalizationUtil.globalize("cms.ui.yes").localize())));
new Label(NewsItemGlobalizationUtil.globalize(
"cms.contenttypes.ui.newsitem.yes"))));
homepageWidget.addOption(new Option("false",
new Label((String) NewsItemGlobalizationUtil.globalize("cms.ui.no").localize())));
new Label(NewsItemGlobalizationUtil.globalize(
"cms.contenttypes.ui.newsitem.no"))));
add(new Label((String) NewsItemGlobalizationUtil.globalize("cms.contenttypes.ui.newsitem.homepage").localize()));
add(new Label(NewsItemGlobalizationUtil.globalize(
"cms.contenttypes.ui.newsitem.homepage")));
add(homepageWidget);
}
// publication date
add(new Label((String) NewsItemGlobalizationUtil.globalize("cms.contenttypes.ui.newsitem.date").localize()));
add(new Label(NewsItemGlobalizationUtil.globalize(
"cms.contenttypes.ui.newsitem.date")));
ParameterModel newsDateParam = new DateParameter(NEWS_DATE);
newsDateParam.addParameterListener(new NotNullValidationListener());
m_newsDate = new com.arsdigita.bebop.form.Date(newsDateParam);
m_newsDate.setYearRange(NewsItem.getConfig().getStartYear(),
GregorianCalendar.getInstance().get(Calendar.YEAR) + NewsItem.getConfig().getEndYearDelta());
GregorianCalendar.getInstance().get(Calendar.YEAR)
+ NewsItem.getConfig().getEndYearDelta());
add(m_newsDate);
}
@ -146,7 +154,8 @@ public class NewsItemPropertyForm extends BasicPageForm
/** Cancels streamlined editing. */
public void submitted(FormSectionEvent fse) {
if (m_step != null
&& getSaveCancelSection().getCancelButton().isSelected(fse.getPageState())) {
&& getSaveCancelSection().getCancelButton()
.isSelected(fse.getPageState())) {
m_step.cancelStreamlinedCreation(fse.getPageState());
}
}
@ -159,7 +168,8 @@ public class NewsItemPropertyForm extends BasicPageForm
// save only if save button was newsed
if (item != null
&& getSaveCancelSection().getSaveButton().isSelected(fse.getPageState())) {
&& getSaveCancelSection().getSaveButton()
.isSelected(fse.getPageState())) {
item.setNewsDate((java.util.Date) data.get(NEWS_DATE));
item.setLead((String) data.get(LEAD));