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.basic_properties.description=Edit the basic address properties
agenda.authoring.categories.title=Assign categories agenda.authoring.categories.title=Assign categories
agenda.authoring.categories.description=Assign categories agenda.authoring.categories.description=Assign categories
cms.contenttypes.ui.agenda.agenda_date=Date cms.contenttypes.ui.agenda.agenda_date=Date:
cms.contenttypes.ui.agenda.location=Location cms.contenttypes.ui.agenda.location=Location:
cms.contenttypes.ui.agenda.attendees=Attendees cms.contenttypes.ui.agenda.attendees=Attendees:
cms.contenttypes.ui.agenda.subject_items=Subject Items cms.contenttypes.ui.agenda.subject_items=Subject Items:
cms.contenttypes.ui.agenda.contact_info=Contact Information cms.contenttypes.ui.agenda.contact_info=Contact Information:
cms.contenttypes.ui.agenda.creation_date=Creation Date 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.basic_properties.description=Editieren der grundlegenden Agenda Eigenschaften
agenda.authoring.categories.title=Kategorien zuweisen agenda.authoring.categories.title=Kategorien zuweisen
agenda.authoring.categories.description=Zuweisen von Kategorien agenda.authoring.categories.description=Zuweisen von Kategorien
cms.contenttypes.ui.agenda.agenda_date=Datum cms.contenttypes.ui.agenda.agenda_date=Datum:
cms.contenttypes.ui.agenda.location=Ort cms.contenttypes.ui.agenda.location=Ort:
cms.contenttypes.ui.agenda.attendees=Teilnehmer cms.contenttypes.ui.agenda.attendees=Teilnehmer:
cms.contenttypes.ui.agenda.subject_items=Themen cms.contenttypes.ui.agenda.subject_items=Themen:
cms.contenttypes.ui.agenda.contact_info=Kontakt Information cms.contenttypes.ui.agenda.contact_info=Kontakt Information:
cms.contenttypes.ui.agenda.creation_date=Erstellungsdatum cms.contenttypes.ui.agenda.creation_date=Erstellungsdatum:

View File

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

View File

@ -103,7 +103,7 @@ public class AgendaPropertyForm extends BasicPageForm
ParameterModel summaryParam = new StringParameter(SUMMARY); ParameterModel summaryParam = new StringParameter(SUMMARY);
//summaryParam //summaryParam
// .addParameterListener(new NotNullValidationListener()); // .addParameterListener(new NotNullValidationListener());
summaryParam.addParameterListener(new StringInRangeValidationListener(0, 4000)); summaryParam.addParameterListener(new StringInRangeValidationListener(0, 4000));
TextArea summary = new TextArea(summaryParam); TextArea summary = new TextArea(summaryParam);
summary.setCols(40); summary.setCols(40);
summary.setRows(5); summary.setRows(5);
@ -120,7 +120,7 @@ public class AgendaPropertyForm extends BasicPageForm
ParameterModel locationParam = new StringParameter(LOCATION); ParameterModel locationParam = new StringParameter(LOCATION);
//locationParam //locationParam
// .addParameterListener(new NotNullValidationListener()); // .addParameterListener(new NotNullValidationListener());
locationParam.addParameterListener(new StringInRangeValidationListener(0, 1000)); locationParam.addParameterListener(new StringInRangeValidationListener(0, 1000));
TextArea location = new TextArea(locationParam); TextArea location = new TextArea(locationParam);
location.setCols(40); location.setCols(40);
location.setRows(3); location.setRows(3);
@ -130,7 +130,7 @@ public class AgendaPropertyForm extends BasicPageForm
ParameterModel attendeesParam = new StringParameter(ATTENDEES); ParameterModel attendeesParam = new StringParameter(ATTENDEES);
//attendeesParam //attendeesParam
// .addParameterListener(new NotNullValidationListener()); // .addParameterListener(new NotNullValidationListener());
attendeesParam.addParameterListener(new StringInRangeValidationListener(0, 1000)); attendeesParam.addParameterListener(new StringInRangeValidationListener(0, 1000));
TextArea attendees = new TextArea(attendeesParam); TextArea attendees = new TextArea(attendeesParam);
attendees.setCols(40); attendees.setCols(40);
attendees.setRows(3); attendees.setRows(3);
@ -140,7 +140,7 @@ public class AgendaPropertyForm extends BasicPageForm
ParameterModel subjectItemsParam = new StringParameter(SUBJECT_ITEMS); ParameterModel subjectItemsParam = new StringParameter(SUBJECT_ITEMS);
//subjectItemsParam //subjectItemsParam
// .addParameterListener(new NotNullValidationListener()); // .addParameterListener(new NotNullValidationListener());
subjectItemsParam.addParameterListener(new StringInRangeValidationListener(0, 1000)); subjectItemsParam.addParameterListener(new StringInRangeValidationListener(0, 1000));
TextArea subjectItems = new TextArea(subjectItemsParam); TextArea subjectItems = new TextArea(subjectItemsParam);
subjectItems.setCols(40); subjectItems.setCols(40);
subjectItems.setRows(3); subjectItems.setRows(3);
@ -150,7 +150,7 @@ public class AgendaPropertyForm extends BasicPageForm
ParameterModel contactInfoParam = new StringParameter(CONTACT_INFO); ParameterModel contactInfoParam = new StringParameter(CONTACT_INFO);
//contactInfoParam //contactInfoParam
// .addParameterListener(new NotNullValidationListener()); // .addParameterListener(new NotNullValidationListener());
contactInfoParam.addParameterListener(new StringInRangeValidationListener(0, 1000)); contactInfoParam.addParameterListener(new StringInRangeValidationListener(0, 1000));
TextArea contactInfo = new TextArea(contactInfoParam); TextArea contactInfo = new TextArea(contactInfoParam);
contactInfo.setCols(40); contactInfo.setCols(40);
contactInfo.setRows(3); contactInfo.setRows(3);

View File

@ -35,13 +35,22 @@ public class AgendaGlobalizationUtil implements Globalized {
/** Name of Java resource files to handle Agenda's globalisation. */ /** Name of Java resource files to handle Agenda's globalisation. */
final public static String BUNDLE_NAME = final public static String BUNDLE_NAME =
"com.arsdigita.cms.contenttypes.AgendaResources"; "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, * 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) { public static GlobalizedMessage globalize(String key) {
return new GlobalizedMessage(key, BUNDLE_NAME); 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. * interpolate into the retrieved message using the MessageFormat class.
*/ */
public static GlobalizedMessage globalize(String key, Object[] args) { public static GlobalizedMessage globalize(String key, Object[] args) {
return new GlobalizedMessage(key, BUNDLE_NAME, 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 */ /** The name of the editing sheet added to this step */
public static String EDIT_SHEET_NAME = "edit"; public static String EDIT_SHEET_NAME = "edit";
public ArticlePropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent) { public ArticlePropertiesStep(ItemSelectionModel itemModel,
AuthoringKitWizard parent) {
super(itemModel, parent); super(itemModel, parent);
} }
@ -47,7 +48,10 @@ public class ArticlePropertiesStep extends GenericArticlePropertiesStep {
protected void createEditSheet(ItemSelectionModel itemModel) { protected void createEditSheet(ItemSelectionModel itemModel) {
BasicPageForm editSheet; BasicPageForm editSheet;
editSheet = new ArticlePropertyForm(itemModel, this); 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 @Override
@ -64,9 +68,11 @@ public class ArticlePropertiesStep extends GenericArticlePropertiesStep {
* of the release * of the release
*/ */
public static Component getArticlePropertySheet(ItemSelectionModel itemModel) { 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; return sheet;
} }

View File

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

View File

@ -44,6 +44,10 @@ public class Bookmark extends ContentPage {
public static final String BASE_DATA_OBJECT_TYPE public static final String BASE_DATA_OBJECT_TYPE
= "com.arsdigita.cms.contenttypes.Bookmark"; = "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() { public Bookmark() {
this( BASE_DATA_OBJECT_TYPE ); 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; package com.arsdigita.cms.contenttypes.ui;
import com.arsdigita.cms.contenttypes.Bookmark;
import com.arsdigita.bebop.Component; 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.ItemSelectionModel;
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
import com.arsdigita.cms.ui.authoring.BasicPageForm;
import com.arsdigita.cms.ui.authoring.SimpleEditStep; import com.arsdigita.cms.ui.authoring.SimpleEditStep;
import com.arsdigita.toolbox.ui.DomainObjectPropertySheet;
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; 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 ) { itemModel ) {
DomainObjectPropertySheet sheet = new DomainObjectPropertySheet( itemModel ); DomainObjectPropertySheet sheet = new DomainObjectPropertySheet( itemModel );
sheet.add( "Name (URL):", Bookmark.NAME ); // sheet.add( "Page Title:", Bookmark.TITLE );
sheet.add( "Page Title:", Bookmark.TITLE ); sheet.add(GlobalizationUtil
sheet.add( "Description:", Bookmark.DESCRIPTION ); .globalize("cms.contenttypes.ui.title"), Bookmark.TITLE );
sheet.add( "URL:", Bookmark.URL ); // 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; 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.TextArea;
import com.arsdigita.bebop.form.TextField; import com.arsdigita.bebop.form.TextField;
import com.arsdigita.bebop.parameters.ParameterModel; import com.arsdigita.bebop.parameters.ParameterModel;
import com.arsdigita.bebop.parameters.ParameterModel;
import com.arsdigita.bebop.parameters.StringParameter; import com.arsdigita.bebop.parameters.StringParameter;
import com.arsdigita.cms.ItemSelectionModel; import com.arsdigita.cms.ItemSelectionModel;
import com.arsdigita.cms.ui.authoring.BasicPageForm; 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() { protected void addWidgets() {
super.addWidgets(); super.addWidgets();
add( new Label( "Description:" ) ); add( new Label( GlobalizationUtil.globalize(
"cms.contenttypes.ui.summary") ) );
ParameterModel descriptionParam ParameterModel descriptionParam
= new StringParameter( DESCRIPTION ); = new StringParameter( DESCRIPTION );
TextArea description = new TextArea( descriptionParam ); TextArea description = new TextArea( descriptionParam );
@ -72,7 +74,9 @@ public class BookmarkPropertyForm
description.setRows(5); description.setRows(5);
add( description ); add( description );
add( new Label( "Url:" ) ); // add( new Label( "Url:" ) );
add( new Label( new GlobalizedMessage
("cms.contenttypes.ui.bookmark.url",Bookmark.RESOURCES) ) );
ParameterModel urlParam ParameterModel urlParam
= new StringParameter( URL ); = new StringParameter( URL );
TextField url = new TextField( urlParam ); 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.date=News Date:
cms.contenttypes.ui.newsitem.homepage=Homepage cms.contenttypes.ui.newsitem.homepage=Homepage
cms.contenttypes.ui.newsitem.news_date=Date 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 # NewsItemResources_de.properties
# #
# Alle deutschem Umlaute muessen als UTF-8 eingetragen werden: # Alle deutschem Umlaute muessen als UTF-8 eingetragen werden:
# ä = \u00e4 Ä = \u00c4 # \u00c3\u00a4 = \u00e4 \u00c3\u0084 = \u00c4
# ü = \u00fc Ü = \u00dc # \u00c3\u00bc = \u00fc \u00c3\u009c = \u00dc
# ö = \u00f6 Ö = \u00d6 # \u00c3\u00b6 = \u00f6 \u00c3\u0096 = \u00d6
# ß = \u00df # \u00c3\u009f = \u00df
# #
newsitem.authoring.body_text.description=Bearbeitung von Titel, Namen, Zusammenfassung und Datum newsitem.authoring.body_text.description=Bearbeitung von Titel, Namen, Zusammenfassung und Datum
newsitem.authoring.image.description=Bearbeitung des Bildes 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.date=Erscheinungsdatum:
cms.contenttypes.ui.newsitem.homepage=Homepage: cms.contenttypes.ui.newsitem.homepage=Homepage:
cms.contenttypes.ui.newsitem.news_date=Erscheinungsdatum: 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 # NewsItemResources_fr.properties
# #
# UTF-8 characters: # UTF-8 characters:
# è = \u00e8 (LETTER E WITH GRAVE) # \u00c3\u00a8 = \u00e8 (LETTER E WITH GRAVE)
# é = \u00e9 (LETTER E WITH ACUTE) # \u00c3\u00a9 = \u00e9 (LETTER E WITH ACUTE)
# #
newsitem.authoring.body_text.description=Bearbeitung von Titel, Namen, Zusammenfassung und Datum newsitem.authoring.body_text.description=Bearbeitung von Titel, Namen, Zusammenfassung und Datum
newsitem.authoring.image.description=Bearbeitung des Bildes 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.date=Erscheinungsdatum:
cms.contenttypes.ui.newsitem.homepage=Homepage: cms.contenttypes.ui.newsitem.homepage=Homepage:
cms.contenttypes.ui.newsitem.news_date=Erscheinungsdatum: 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; BasicPageForm editSheet;
editSheet = new NewsItemPropertyForm(itemModel, this); 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()); editSheet.getSaveCancelSection().getCancelButton());
setDisplayComponent(getNewsDomainObjectPropertySheet(itemModel)); setDisplayComponent(getNewsDomainObjectPropertySheet(itemModel));
@ -75,61 +76,83 @@ public class NewsItemPropertiesStep extends SimpleEditStep {
public static Component getNewsDomainObjectPropertySheet(ItemSelectionModel itemModel) { public static Component getNewsDomainObjectPropertySheet(ItemSelectionModel itemModel) {
DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(itemModel); DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(itemModel);
sheet.add((String) NewsItemGlobalizationUtil.globalize("cms.contenttypes.ui.title").localize(), NewsItem.TITLE); sheet.add(NewsItemGlobalizationUtil
sheet.add((String) NewsItemGlobalizationUtil.globalize("cms.contenttypes.ui.newsitem.name").localize(), NewsItem.NAME); .globalize("cms.contenttypes.ui.title"), NewsItem.TITLE);
sheet.add((String) NewsItemGlobalizationUtil.globalize("cms.contenttypes.ui.newsitem.lead").localize(), NewsItem.LEAD); sheet.add(NewsItemGlobalizationUtil
if (!ContentSection.getConfig().getHideLaunchDate()) { .globalize("cms.contenttypes.ui.newsitem.name"), NewsItem.NAME);
sheet.add(NewsItemGlobalizationUtil.globalize("cms.contenttypes.ui.launch_date"), sheet.add(NewsItemGlobalizationUtil
ContentPage.LAUNCH_DATE, .globalize("cms.contenttypes.ui.newsitem.lead"), NewsItem.LEAD);
new DomainObjectPropertySheet.AttributeFormatter() {
public String format(DomainObject item, if (!ContentSection.getConfig().getHideLaunchDate()) {
String attribute, sheet.add(NewsItemGlobalizationUtil.globalize(
PageState state) { "cms.contenttypes.ui.launch_date"),
ContentPage page = (ContentPage) item; ContentPage.LAUNCH_DATE,
if (page.getLaunchDate() != null) { new DomainObjectPropertySheet.AttributeFormatter() {
return DateFormat.getDateInstance(DateFormat.LONG, GlobalizationHelper.getNegotiatedLocale()).format(page.getLaunchDate());
} else { public String format(DomainObject item,
return (String) NewsItemGlobalizationUtil.globalize("cms.ui.unknown").localize(); String attribute,
} PageState state) {
} ContentPage page = (ContentPage) item;
}); if (page.getLaunchDate() != null) {
return DateFormat.getDateInstance(
DateFormat.LONG,
GlobalizationHelper.getNegotiatedLocale())
.format(page.getLaunchDate());
} else {
return (String) NewsItemGlobalizationUtil
.globalize("cms.contenttypes.ui.newsitem.unknown")
.localize();
}
}
});
} }
// Show news item on homepage? // Show news item on homepage?
if (!NewsItem.getConfig().getHideHomepageField()) { if (!NewsItem.getConfig().getHideHomepageField()) {
sheet.add((String) NewsItemGlobalizationUtil.globalize("cms.contenttypes.ui.newsitem.homepage").localize(), sheet.add(NewsItemGlobalizationUtil
NewsItem.IS_HOMEPAGE, .globalize("cms.contenttypes.ui.newsitem.homepage"),
new DomainObjectPropertySheet.AttributeFormatter() { NewsItem.IS_HOMEPAGE,
new DomainObjectPropertySheet.AttributeFormatter() {
public String format(DomainObject item, public String format(DomainObject item,
String attribute, String attribute,
PageState state) { PageState state) {
NewsItem pr = (NewsItem) item; NewsItem pr = (NewsItem) item;
if (pr.isHomepage().booleanValue()) { 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(
new DomainObjectPropertySheet.AttributeFormatter() { "cms.contenttypes.ui.newsitem.news_date"),
NewsItem.NEWS_DATE,
new DomainObjectPropertySheet.AttributeFormatter() {
public String format(DomainObject item, public String format(DomainObject item,
String attribute, String attribute,
PageState state) { PageState state) {
NewsItem pr = (NewsItem) item; NewsItem pr = (NewsItem) item;
if (pr.getNewsDate() != null) { if (pr.getNewsDate() != null) {
return DateFormat.getDateInstance(DateFormat.LONG, GlobalizationHelper.getNegotiatedLocale()).format(pr.getNewsDate()); return DateFormat.getDateInstance(
} else { DateFormat.LONG,
return (String) NewsItemGlobalizationUtil.globalize("cms.ui.unknown").localize(); GlobalizationHelper.getNegotiatedLocale())
} .format(pr.getNewsDate());
} } else {
}); return (String) NewsItemGlobalizationUtil
.globalize("cms.contenttypes.ui.newsitem.unknown")
.localize();
}
}
});
return sheet; return sheet;
} }

View File

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