From 0a59971906880bc2cabc0526e93964fedd91042f Mon Sep 17 00:00:00 2001 From: pb Date: Thu, 6 Jun 2013 00:32:50 +0000 Subject: [PATCH] =?UTF-8?q?Lokalisierung=20und=20Resource=20Bundles=20verv?= =?UTF-8?q?ollst=C3=A4ndigt.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://svn.libreccm.org/ccm/trunk@2174 8810af33-2d31-482b-a856-94f89814c4df --- .../contenttypes/AgendaResources.properties | 12 +- .../AgendaResources_de.properties | 12 +- .../contenttypes/ui/AgendaPropertiesStep.java | 51 ++++---- .../contenttypes/ui/AgendaPropertyForm.java | 10 +- .../util/AgendaGlobalizationUtil.java | 21 +++- .../contenttypes/ArticleResources.properties | 2 - .../ArticleResources_de.properties | 2 - .../ui/ArticlePropertiesStep.java | 14 ++- .../contenttypes/ui/ArticlePropertyForm.java | 13 +- .../arsdigita/cms/contenttypes/Bookmark.java | 4 + .../contenttypes/BookmarkResources.properties | 1 + .../BookmarkResources_de.properties | 1 + .../BookmarkResources_en.properties | 1 + .../BookmarkResources_fr.properties | 1 + .../ui/BookmarkPropertiesStep.java | 25 ++-- .../contenttypes/ui/BookmarkPropertyForm.java | 10 +- .../contenttypes/NewsItemResources.properties | 3 + .../NewsItemResources_de.properties | 11 +- .../NewsItemResources_fr.properties | 7 +- .../ui/NewsItemPropertiesStep.java | 113 +++++++++++------- .../contenttypes/ui/NewsItemPropertyForm.java | 30 +++-- 21 files changed, 216 insertions(+), 128 deletions(-) delete mode 100755 ccm-cms-types-article/src/com/arsdigita/cms/contenttypes/ArticleResources.properties delete mode 100755 ccm-cms-types-article/src/com/arsdigita/cms/contenttypes/ArticleResources_de.properties create mode 100755 ccm-cms-types-bookmark/src/com/arsdigita/cms/contenttypes/BookmarkResources.properties create mode 100755 ccm-cms-types-bookmark/src/com/arsdigita/cms/contenttypes/BookmarkResources_de.properties create mode 100755 ccm-cms-types-bookmark/src/com/arsdigita/cms/contenttypes/BookmarkResources_en.properties create mode 100755 ccm-cms-types-bookmark/src/com/arsdigita/cms/contenttypes/BookmarkResources_fr.properties diff --git a/ccm-cms-types-agenda/src/com/arsdigita/cms/contenttypes/AgendaResources.properties b/ccm-cms-types-agenda/src/com/arsdigita/cms/contenttypes/AgendaResources.properties index 9ec119a39..dfbfce67c 100755 --- a/ccm-cms-types-agenda/src/com/arsdigita/cms/contenttypes/AgendaResources.properties +++ b/ccm-cms-types-agenda/src/com/arsdigita/cms/contenttypes/AgendaResources.properties @@ -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: diff --git a/ccm-cms-types-agenda/src/com/arsdigita/cms/contenttypes/AgendaResources_de.properties b/ccm-cms-types-agenda/src/com/arsdigita/cms/contenttypes/AgendaResources_de.properties index 89fdad188..e05e439d4 100755 --- a/ccm-cms-types-agenda/src/com/arsdigita/cms/contenttypes/AgendaResources_de.properties +++ b/ccm-cms-types-agenda/src/com/arsdigita/cms/contenttypes/AgendaResources_de.properties @@ -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: diff --git a/ccm-cms-types-agenda/src/com/arsdigita/cms/contenttypes/ui/AgendaPropertiesStep.java b/ccm-cms-types-agenda/src/com/arsdigita/cms/contenttypes/ui/AgendaPropertiesStep.java index ecd6af9dd..ac1dde22e 100755 --- a/ccm-cms-types-agenda/src/com/arsdigita/cms/contenttypes/ui/AgendaPropertiesStep.java +++ b/ccm-cms-types-agenda/src/com/arsdigita/cms/contenttypes/ui/AgendaPropertiesStep.java @@ -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(); } } }); diff --git a/ccm-cms-types-agenda/src/com/arsdigita/cms/contenttypes/ui/AgendaPropertyForm.java b/ccm-cms-types-agenda/src/com/arsdigita/cms/contenttypes/ui/AgendaPropertyForm.java index 653a52451..416df9f86 100755 --- a/ccm-cms-types-agenda/src/com/arsdigita/cms/contenttypes/ui/AgendaPropertyForm.java +++ b/ccm-cms-types-agenda/src/com/arsdigita/cms/contenttypes/ui/AgendaPropertyForm.java @@ -103,7 +103,7 @@ public class AgendaPropertyForm extends BasicPageForm ParameterModel summaryParam = new StringParameter(SUMMARY); //summaryParam // .addParameterListener(new NotNullValidationListener()); - summaryParam.addParameterListener(new StringInRangeValidationListener(0, 4000)); + summaryParam.addParameterListener(new StringInRangeValidationListener(0, 4000)); TextArea summary = new TextArea(summaryParam); summary.setCols(40); summary.setRows(5); @@ -120,7 +120,7 @@ public class AgendaPropertyForm extends BasicPageForm ParameterModel locationParam = new StringParameter(LOCATION); //locationParam // .addParameterListener(new NotNullValidationListener()); - locationParam.addParameterListener(new StringInRangeValidationListener(0, 1000)); + locationParam.addParameterListener(new StringInRangeValidationListener(0, 1000)); TextArea location = new TextArea(locationParam); location.setCols(40); location.setRows(3); @@ -130,7 +130,7 @@ public class AgendaPropertyForm extends BasicPageForm ParameterModel attendeesParam = new StringParameter(ATTENDEES); //attendeesParam // .addParameterListener(new NotNullValidationListener()); - attendeesParam.addParameterListener(new StringInRangeValidationListener(0, 1000)); + attendeesParam.addParameterListener(new StringInRangeValidationListener(0, 1000)); TextArea attendees = new TextArea(attendeesParam); attendees.setCols(40); attendees.setRows(3); @@ -140,7 +140,7 @@ public class AgendaPropertyForm extends BasicPageForm ParameterModel subjectItemsParam = new StringParameter(SUBJECT_ITEMS); //subjectItemsParam // .addParameterListener(new NotNullValidationListener()); - subjectItemsParam.addParameterListener(new StringInRangeValidationListener(0, 1000)); + subjectItemsParam.addParameterListener(new StringInRangeValidationListener(0, 1000)); TextArea subjectItems = new TextArea(subjectItemsParam); subjectItems.setCols(40); subjectItems.setRows(3); @@ -150,7 +150,7 @@ public class AgendaPropertyForm extends BasicPageForm ParameterModel contactInfoParam = new StringParameter(CONTACT_INFO); //contactInfoParam // .addParameterListener(new NotNullValidationListener()); - contactInfoParam.addParameterListener(new StringInRangeValidationListener(0, 1000)); + contactInfoParam.addParameterListener(new StringInRangeValidationListener(0, 1000)); TextArea contactInfo = new TextArea(contactInfoParam); contactInfo.setCols(40); contactInfo.setRows(3); diff --git a/ccm-cms-types-agenda/src/com/arsdigita/cms/contenttypes/util/AgendaGlobalizationUtil.java b/ccm-cms-types-agenda/src/com/arsdigita/cms/contenttypes/util/AgendaGlobalizationUtil.java index 40867b76f..14df32a14 100755 --- a/ccm-cms-types-agenda/src/com/arsdigita/cms/contenttypes/util/AgendaGlobalizationUtil.java +++ b/ccm-cms-types-agenda/src/com/arsdigita/cms/contenttypes/util/AgendaGlobalizationUtil.java @@ -35,13 +35,22 @@ public class AgendaGlobalizationUtil implements Globalized { /** Name of Java resource files to handle Agenda's globalisation. */ 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 + * This returns a globalized message using the type specific bundle, + * BUNDLE_NAME if the key string contains the modules name agenda, + * otherwise the CMS ResourceBundle is used. */ 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. */ 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); + } } } diff --git a/ccm-cms-types-article/src/com/arsdigita/cms/contenttypes/ArticleResources.properties b/ccm-cms-types-article/src/com/arsdigita/cms/contenttypes/ArticleResources.properties deleted file mode 100755 index 5673bcf5e..000000000 --- a/ccm-cms-types-article/src/com/arsdigita/cms/contenttypes/ArticleResources.properties +++ /dev/null @@ -1,2 +0,0 @@ -article.authoring.image.title=Image -article.authoring.image.description=Image \ No newline at end of file diff --git a/ccm-cms-types-article/src/com/arsdigita/cms/contenttypes/ArticleResources_de.properties b/ccm-cms-types-article/src/com/arsdigita/cms/contenttypes/ArticleResources_de.properties deleted file mode 100755 index e13d0a048..000000000 --- a/ccm-cms-types-article/src/com/arsdigita/cms/contenttypes/ArticleResources_de.properties +++ /dev/null @@ -1,2 +0,0 @@ -article.authoring.image.title=Bild -article.authoring.image.description=Bild diff --git a/ccm-cms-types-article/src/com/arsdigita/cms/contenttypes/ui/ArticlePropertiesStep.java b/ccm-cms-types-article/src/com/arsdigita/cms/contenttypes/ui/ArticlePropertiesStep.java index b0455e22e..76da1e6e3 100755 --- a/ccm-cms-types-article/src/com/arsdigita/cms/contenttypes/ui/ArticlePropertiesStep.java +++ b/ccm-cms-types-article/src/com/arsdigita/cms/contenttypes/ui/ArticlePropertiesStep.java @@ -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; } diff --git a/ccm-cms-types-article/src/com/arsdigita/cms/contenttypes/ui/ArticlePropertyForm.java b/ccm-cms-types-article/src/com/arsdigita/cms/contenttypes/ui/ArticlePropertyForm.java index b02920635..9e918418a 100755 --- a/ccm-cms-types-article/src/com/arsdigita/cms/contenttypes/ui/ArticlePropertyForm.java +++ b/ccm-cms-types-article/src/com/arsdigita/cms/contenttypes/ui/ArticlePropertyForm.java @@ -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(); diff --git a/ccm-cms-types-bookmark/src/com/arsdigita/cms/contenttypes/Bookmark.java b/ccm-cms-types-bookmark/src/com/arsdigita/cms/contenttypes/Bookmark.java index 5f6a244b3..d3611a8fc 100755 --- a/ccm-cms-types-bookmark/src/com/arsdigita/cms/contenttypes/Bookmark.java +++ b/ccm-cms-types-bookmark/src/com/arsdigita/cms/contenttypes/Bookmark.java @@ -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 ); } diff --git a/ccm-cms-types-bookmark/src/com/arsdigita/cms/contenttypes/BookmarkResources.properties b/ccm-cms-types-bookmark/src/com/arsdigita/cms/contenttypes/BookmarkResources.properties new file mode 100755 index 000000000..4eeae5d9f --- /dev/null +++ b/ccm-cms-types-bookmark/src/com/arsdigita/cms/contenttypes/BookmarkResources.properties @@ -0,0 +1 @@ +cms.contenttypes.ui.bookmark.url=URL: diff --git a/ccm-cms-types-bookmark/src/com/arsdigita/cms/contenttypes/BookmarkResources_de.properties b/ccm-cms-types-bookmark/src/com/arsdigita/cms/contenttypes/BookmarkResources_de.properties new file mode 100755 index 000000000..4eeae5d9f --- /dev/null +++ b/ccm-cms-types-bookmark/src/com/arsdigita/cms/contenttypes/BookmarkResources_de.properties @@ -0,0 +1 @@ +cms.contenttypes.ui.bookmark.url=URL: diff --git a/ccm-cms-types-bookmark/src/com/arsdigita/cms/contenttypes/BookmarkResources_en.properties b/ccm-cms-types-bookmark/src/com/arsdigita/cms/contenttypes/BookmarkResources_en.properties new file mode 100755 index 000000000..4eeae5d9f --- /dev/null +++ b/ccm-cms-types-bookmark/src/com/arsdigita/cms/contenttypes/BookmarkResources_en.properties @@ -0,0 +1 @@ +cms.contenttypes.ui.bookmark.url=URL: diff --git a/ccm-cms-types-bookmark/src/com/arsdigita/cms/contenttypes/BookmarkResources_fr.properties b/ccm-cms-types-bookmark/src/com/arsdigita/cms/contenttypes/BookmarkResources_fr.properties new file mode 100755 index 000000000..4eeae5d9f --- /dev/null +++ b/ccm-cms-types-bookmark/src/com/arsdigita/cms/contenttypes/BookmarkResources_fr.properties @@ -0,0 +1 @@ +cms.contenttypes.ui.bookmark.url=URL: diff --git a/ccm-cms-types-bookmark/src/com/arsdigita/cms/contenttypes/ui/BookmarkPropertiesStep.java b/ccm-cms-types-bookmark/src/com/arsdigita/cms/contenttypes/ui/BookmarkPropertiesStep.java index 7cc46bbc1..4c943e7f6 100755 --- a/ccm-cms-types-bookmark/src/com/arsdigita/cms/contenttypes/ui/BookmarkPropertiesStep.java +++ b/ccm-cms-types-bookmark/src/com/arsdigita/cms/contenttypes/ui/BookmarkPropertiesStep.java @@ -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; } diff --git a/ccm-cms-types-bookmark/src/com/arsdigita/cms/contenttypes/ui/BookmarkPropertyForm.java b/ccm-cms-types-bookmark/src/com/arsdigita/cms/contenttypes/ui/BookmarkPropertyForm.java index d415cfc71..2d848a66e 100755 --- a/ccm-cms-types-bookmark/src/com/arsdigita/cms/contenttypes/ui/BookmarkPropertyForm.java +++ b/ccm-cms-types-bookmark/src/com/arsdigita/cms/contenttypes/ui/BookmarkPropertyForm.java @@ -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 ); diff --git a/ccm-cms-types-newsitem/src/com/arsdigita/cms/contenttypes/NewsItemResources.properties b/ccm-cms-types-newsitem/src/com/arsdigita/cms/contenttypes/NewsItemResources.properties index c60d8d93d..29d30c8c5 100755 --- a/ccm-cms-types-newsitem/src/com/arsdigita/cms/contenttypes/NewsItemResources.properties +++ b/ccm-cms-types-newsitem/src/com/arsdigita/cms/contenttypes/NewsItemResources.properties @@ -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 diff --git a/ccm-cms-types-newsitem/src/com/arsdigita/cms/contenttypes/NewsItemResources_de.properties b/ccm-cms-types-newsitem/src/com/arsdigita/cms/contenttypes/NewsItemResources_de.properties index 0f4f97f0d..645d3ccb3 100755 --- a/ccm-cms-types-newsitem/src/com/arsdigita/cms/contenttypes/NewsItemResources_de.properties +++ b/ccm-cms-types-newsitem/src/com/arsdigita/cms/contenttypes/NewsItemResources_de.properties @@ -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 diff --git a/ccm-cms-types-newsitem/src/com/arsdigita/cms/contenttypes/NewsItemResources_fr.properties b/ccm-cms-types-newsitem/src/com/arsdigita/cms/contenttypes/NewsItemResources_fr.properties index 02bec80a4..74829fa83 100755 --- a/ccm-cms-types-newsitem/src/com/arsdigita/cms/contenttypes/NewsItemResources_fr.properties +++ b/ccm-cms-types-newsitem/src/com/arsdigita/cms/contenttypes/NewsItemResources_fr.properties @@ -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 diff --git a/ccm-cms-types-newsitem/src/com/arsdigita/cms/contenttypes/ui/NewsItemPropertiesStep.java b/ccm-cms-types-newsitem/src/com/arsdigita/cms/contenttypes/ui/NewsItemPropertiesStep.java index 211d0f05f..b7fae1dfb 100755 --- a/ccm-cms-types-newsitem/src/com/arsdigita/cms/contenttypes/ui/NewsItemPropertiesStep.java +++ b/ccm-cms-types-newsitem/src/com/arsdigita/cms/contenttypes/ui/NewsItemPropertiesStep.java @@ -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,61 +76,83 @@ 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); - if (!ContentSection.getConfig().getHideLaunchDate()) { - sheet.add(NewsItemGlobalizationUtil.globalize("cms.contenttypes.ui.launch_date"), - ContentPage.LAUNCH_DATE, - new DomainObjectPropertySheet.AttributeFormatter() { + 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); - public String format(DomainObject item, - 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.ui.unknown").localize(); - } - } - }); + if (!ContentSection.getConfig().getHideLaunchDate()) { + sheet.add(NewsItemGlobalizationUtil.globalize( + "cms.contenttypes.ui.launch_date"), + ContentPage.LAUNCH_DATE, + new DomainObjectPropertySheet.AttributeFormatter() { + + public String format(DomainObject item, + 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? if (!NewsItem.getConfig().getHideHomepageField()) { - sheet.add((String) NewsItemGlobalizationUtil.globalize("cms.contenttypes.ui.newsitem.homepage").localize(), - NewsItem.IS_HOMEPAGE, - new DomainObjectPropertySheet.AttributeFormatter() { + sheet.add(NewsItemGlobalizationUtil + .globalize("cms.contenttypes.ui.newsitem.homepage"), + NewsItem.IS_HOMEPAGE, + new DomainObjectPropertySheet.AttributeFormatter() { - public String format(DomainObject item, - String attribute, - PageState state) { - NewsItem pr = (NewsItem) item; + public String format(DomainObject item, + String attribute, + PageState state) { + NewsItem pr = (NewsItem) item; - if (pr.isHomepage().booleanValue()) { - return (String) NewsItemGlobalizationUtil.globalize("cms.ui.yes").localize(); - } + if (pr.isHomepage().booleanValue()) { + 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, - new DomainObjectPropertySheet.AttributeFormatter() { + sheet.add(NewsItemGlobalizationUtil.globalize( + "cms.contenttypes.ui.newsitem.news_date"), + NewsItem.NEWS_DATE, + new DomainObjectPropertySheet.AttributeFormatter() { - public String format(DomainObject item, - String attribute, - PageState state) { - NewsItem pr = (NewsItem) item; - if (pr.getNewsDate() != null) { - return DateFormat.getDateInstance(DateFormat.LONG, GlobalizationHelper.getNegotiatedLocale()).format(pr.getNewsDate()); - } else { - return (String) NewsItemGlobalizationUtil.globalize("cms.ui.unknown").localize(); - } - } - }); + public String format(DomainObject item, + String attribute, + PageState state) { + NewsItem pr = (NewsItem) item; + if (pr.getNewsDate() != null) { + return DateFormat.getDateInstance( + DateFormat.LONG, + GlobalizationHelper.getNegotiatedLocale()) + .format(pr.getNewsDate()); + } else { + return (String) NewsItemGlobalizationUtil + .globalize("cms.contenttypes.ui.newsitem.unknown") + .localize(); + } + } + }); return sheet; } diff --git a/ccm-cms-types-newsitem/src/com/arsdigita/cms/contenttypes/ui/NewsItemPropertyForm.java b/ccm-cms-types-newsitem/src/com/arsdigita/cms/contenttypes/ui/NewsItemPropertyForm.java index 6b015b2b0..8643d1369 100755 --- a/ccm-cms-types-newsitem/src/com/arsdigita/cms/contenttypes/ui/NewsItemPropertyForm.java +++ b/ccm-cms-types-newsitem/src/com/arsdigita/cms/contenttypes/ui/NewsItemPropertyForm.java @@ -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));