From 0042ff07c91ffaf0d9e7c9698fc4826ca30318c7 Mon Sep 17 00:00:00 2001 From: pb Date: Sat, 8 Jun 2013 11:55:13 +0000 Subject: [PATCH] Korrektur Lokalisierung einiger Content Typem. git-svn-id: https://svn.libreccm.org/ccm/trunk@2188 8810af33-2d31-482b-a856-94f89814c4df --- .../contenttypes/ui/AgendaPropertiesStep.java | 2 - .../util/AgendaGlobalizationUtil.java | 14 ++-- .../ui/ArticlePropertiesStep.java | 6 ++ .../arsdigita/cms/contenttypes/Bookmark.java | 4 ++ .../contenttypes/ui/BookmarkPropertyForm.java | 1 - .../cms/contenttypes/EventInitializer.java | 2 +- .../contenttypes/EventResources.properties | 2 + .../contenttypes/EventResources_de.properties | 3 +- .../contenttypes/EventResources_fr.properties | 7 +- .../contenttypes/ui/EventPropertiesStep.java | 65 +++++++++++-------- .../contenttypes/ui/EventPropertyForm.java | 47 ++++++++++---- .../util/EventGlobalizationUtil.java | 31 ++++++--- .../cms/contenttypes/FileStorageItem.java | 6 -- .../ui/FileStorageItemPropertyForm.java | 12 ++-- .../ui/authoring/FileStorageItemFileEdit.java | 11 ++-- .../FileStorageItemPropertiesStep.java | 9 ++- .../contenttypes/NewsItemResources.properties | 3 - .../NewsItemResources_de.properties | 3 - .../NewsItemResources_fr.properties | 3 - .../ui/NewsItemPropertiesStep.java | 2 +- .../util/NewsItemGlobalizationUtil.java | 23 +++++-- 21 files changed, 160 insertions(+), 96 deletions(-) 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 ac1dde22e..d683a029d 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 @@ -32,8 +32,6 @@ 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.workflow.WorkflowLockedComponentAccess; -// replaced by AgendaGlobalizationUtil -// import com.arsdigita.cms.util.GlobalizationUtil; import com.arsdigita.globalization.GlobalizationHelper; 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 14df32a14..8b398b083 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 @@ -41,9 +41,9 @@ public class AgendaGlobalizationUtil implements Globalized { "com.arsdigita.cms.CMSResources"; /** - * 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. + * Returns a globalized message using the appropriate bundle. + * If the key string contains the modules name agenda the package specific + * bundle is used, otherwise the CMS ResourceBundle. */ public static GlobalizedMessage globalize(String key) { if (key.indexOf(".agenda.") > 0) { @@ -54,9 +54,11 @@ public class AgendaGlobalizationUtil implements Globalized { } /** - * Returns a globalized message object, using the package specific bundle, - * as specified by BUNDLE_NAME. Also takes in an Object[] of arguments to - * interpolate into the retrieved message using the MessageFormat class. + * Returns a globalized message object, using the approprate bundle, + * takeing in an Object[] of arguments to interpolate into the retrieved + * message using the MessageFormat class. + * If the key string contains the modules name agenda the package specific + * bundle is used, otherwise the CMS ResourceBundle. */ public static GlobalizedMessage globalize(String key, Object[] args) { if (key.indexOf(".agenda.") > 0) { 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 76da1e6e3..8e0c5f0f0 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,6 +39,12 @@ public class ArticlePropertiesStep extends GenericArticlePropertiesStep { /** The name of the editing sheet added to this step */ public static String EDIT_SHEET_NAME = "edit"; + /** + * Constructor. + * + * @param itemModel + * @param parent + */ public ArticlePropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent) { super(itemModel, parent); 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 d3611a8fc..089ea0187 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 @@ -70,6 +70,7 @@ public class Bookmark extends ContentPage { super( type ); } + @Override public void beforeSave() { super.beforeSave(); @@ -78,10 +79,12 @@ public class Bookmark extends ContentPage { /* accessors *****************************************************/ + @Override public String getDescription() { return (String) get( DESCRIPTION ); } + @Override public void setDescription( String description ) { set( DESCRIPTION, description ); } @@ -95,6 +98,7 @@ public class Bookmark extends ContentPage { } // Search stuff to allow the content type to be searchable + @Override public String getSearchSummary() { return getDescription(); } 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 2d848a66e..e80e887ae 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 @@ -74,7 +74,6 @@ public class BookmarkPropertyForm description.setRows(5); add( description ); -// add( new Label( "Url:" ) ); add( new Label( new GlobalizedMessage ("cms.contenttypes.ui.bookmark.url",Bookmark.RESOURCES) ) ); ParameterModel urlParam diff --git a/ccm-cms-types-event/src/com/arsdigita/cms/contenttypes/EventInitializer.java b/ccm-cms-types-event/src/com/arsdigita/cms/contenttypes/EventInitializer.java index 92c61b6b7..ac211357e 100755 --- a/ccm-cms-types-event/src/com/arsdigita/cms/contenttypes/EventInitializer.java +++ b/ccm-cms-types-event/src/com/arsdigita/cms/contenttypes/EventInitializer.java @@ -68,7 +68,7 @@ public class EventInitializer extends ContentTypeInitializer { */ @Override public String getTraversalXML() { - return "/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/Event.xml"; + return TRAVERSAL_ADAPTER_BASE_DIR + "Event.xml"; } } diff --git a/ccm-cms-types-event/src/com/arsdigita/cms/contenttypes/EventResources.properties b/ccm-cms-types-event/src/com/arsdigita/cms/contenttypes/EventResources.properties index 43ea30da7..074c5d058 100755 --- a/ccm-cms-types-event/src/com/arsdigita/cms/contenttypes/EventResources.properties +++ b/ccm-cms-types-event/src/com/arsdigita/cms/contenttypes/EventResources.properties @@ -18,3 +18,5 @@ cms.contenttypes.ui.event.main_contributor=Main contributor: cms.contenttypes.ui.event.event_type=Event Type: cms.contenttypes.ui.event.link_to_map=Link to Map cms.contenttypes.ui.event.cost=Cost: +#Probably not used! +cms.contenttypes.ui.event.there_are_no_events=There are no events. diff --git a/ccm-cms-types-event/src/com/arsdigita/cms/contenttypes/EventResources_de.properties b/ccm-cms-types-event/src/com/arsdigita/cms/contenttypes/EventResources_de.properties index 3c62a2872..53a6bc9de 100755 --- a/ccm-cms-types-event/src/com/arsdigita/cms/contenttypes/EventResources_de.properties +++ b/ccm-cms-types-event/src/com/arsdigita/cms/contenttypes/EventResources_de.properties @@ -12,7 +12,7 @@ cms.contenttypes.ui.event.start_date=Anfangs-Datum: cms.contenttypes.ui.event.start_time=Beginn: cms.contenttypes.ui.event.end_date=End-Datum: cms.contenttypes.ui.event.end_time=Ende: -cms.contenttypes.ui.event.end_date_after_start_date=Das Anfangs-Datum ist sp\u00E4ter als das End-Datum +cms.contenttypes.ui.event.end_date_after_start_date=Das Anfangs-Datum ist sp\u00e4ter als das End-Datum # cms.contenttypes.ui.event.date_description=Termin Zusatz: cms.contenttypes.ui.event.location=Ort: @@ -20,3 +20,4 @@ cms.contenttypes.ui.event.main_contributor=Haupt-Mitarbeiter: cms.contenttypes.ui.event.event_type=Veranstaltungs-Typ: cms.contenttypes.ui.event.link_to_map=Link zur Karte cms.contenttypes.ui.event.cost=Kosten: +cms.contenttypes.ui.event.there_are_no_events=Es sind keine Veranstaltungen vorhanden. diff --git a/ccm-cms-types-event/src/com/arsdigita/cms/contenttypes/EventResources_fr.properties b/ccm-cms-types-event/src/com/arsdigita/cms/contenttypes/EventResources_fr.properties index 902c4e20e..6b996efe3 100755 --- a/ccm-cms-types-event/src/com/arsdigita/cms/contenttypes/EventResources_fr.properties +++ b/ccm-cms-types-event/src/com/arsdigita/cms/contenttypes/EventResources_fr.properties @@ -1,8 +1,8 @@ # EventResources_fr.properties # UTF-8 characters: -# è = \u00e8 (LETTER E WITH GRAVE) -# é = \u00e9 (LETTER E WITH ACUTE) -cms.contenttypes.event_type_not_registered=Type d'évenement non enregistré +# \u00e8 = \u00e8 (LETTER E WITH GRAVE) +# \u00e9 = \u00e9 (LETTER E WITH ACUTE) +cms.contenttypes.event_type_not_registered=Type d'\u00e9venement non enregistr\u00e9 event.authoring.basic_properties.description=Edit the title, name, start date, date/time, location, lead, main contributor, type, map link, and cost # cms.contenttypes.ui.event.name=Name (URL): @@ -21,3 +21,4 @@ cms.contenttypes.ui.event.main_contributor=Main contributor: cms.contenttypes.ui.event.event_type=Event Type: cms.contenttypes.ui.event.link_to_map=Link to Map cms.contenttypes.ui.event.cost=Cost: +cms.contenttypes.ui.event.there_are_no_events=Il n'y a aucun \u00e9venement diff --git a/ccm-cms-types-event/src/com/arsdigita/cms/contenttypes/ui/EventPropertiesStep.java b/ccm-cms-types-event/src/com/arsdigita/cms/contenttypes/ui/EventPropertiesStep.java index 58309a6a3..de314e630 100755 --- a/ccm-cms-types-event/src/com/arsdigita/cms/contenttypes/ui/EventPropertiesStep.java +++ b/ccm-cms-types-event/src/com/arsdigita/cms/contenttypes/ui/EventPropertiesStep.java @@ -84,18 +84,18 @@ public class EventPropertiesStep extends SimpleEditStep { * of the release **/ public static Component getEventPropertySheet(ItemSelectionModel itemModel) { + DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(itemModel); - - // sheet.add((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.name").localize(), Event.NAME); - // sheet.add((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.title").localize(), Event.TITLE); - // sheet.add((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.lead").localize(), Event.LEAD); - - sheet.add( EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.name"), Event.NAME); - sheet.add( EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.title"), Event.TITLE); - sheet.add( EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.lead"), Event.LEAD); + sheet.add( EventGlobalizationUtil + .globalize("cms.contenttypes.ui.title"), Event.TITLE); + sheet.add( EventGlobalizationUtil + .globalize("cms.contenttypes.ui.name"), Event.NAME); + sheet.add( EventGlobalizationUtil + .globalize("cms.contenttypes.ui.event.lead"), Event.LEAD); if (!ContentSection.getConfig().getHideLaunchDate()) { - sheet.add(EventGlobalizationUtil.globalize("cms.contenttypes.ui.launch_date"), + sheet.add(EventGlobalizationUtil + .globalize("cms.contenttypes.ui.launch_date"), ContentPage.LAUNCH_DATE, new DomainObjectPropertySheet.AttributeFormatter() { @@ -104,15 +104,23 @@ public class EventPropertiesStep 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) EventGlobalizationUtil.globalize("cms.ui.unknown").localize(); + return (String) EventGlobalizationUtil + .globalize("cms.ui.unknown") + .localize(); } } }); } -// sheet.add((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.start_time").localize(), Event.START_DATE, - sheet.add( EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.start_time"), Event.START_DATE, + + sheet.add( EventGlobalizationUtil + .globalize("cms.contenttypes.ui.event.start_time"), Event.START_DATE, new DomainObjectPropertySheet.AttributeFormatter() { public String format(DomainObject item, @@ -137,7 +145,6 @@ public class EventPropertiesStep extends SimpleEditStep { } }); -// sheet.add((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.end_time").localize(), Event.END_DATE, sheet.add( EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.end_time"), Event.END_DATE, new DomainObjectPropertySheet.AttributeFormatter() { @@ -162,27 +169,33 @@ public class EventPropertiesStep extends SimpleEditStep { } }); if (!Event.getConfig().getHideDateDescription()) { - // sheet.add((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.date_description").localize(), Event.EVENT_DATE); - sheet.add( EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.date_description"), Event.EVENT_DATE); + sheet.add( EventGlobalizationUtil + .globalize("cms.contenttypes.ui.event.date_description"), + Event.EVENT_DATE); } -// sheet.add((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.location").localize(), Event.LOCATION); - sheet.add( EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.location"), Event.LOCATION); + sheet.add( EventGlobalizationUtil + .globalize("cms.contenttypes.ui.event.location"), + Event.LOCATION); if (!Event.getConfig().getHideMainContributor()) { - // sheet.add((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.main_contributor").localize(), Event.MAIN_CONTRIBUTOR); - sheet.add( EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.main_contributor"), Event.MAIN_CONTRIBUTOR); + sheet.add( EventGlobalizationUtil.globalize( + "cms.contenttypes.ui.event.main_contributor"), + Event.MAIN_CONTRIBUTOR); } if (!Event.getConfig().getHideEventType()) { - // sheet.add((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.event_type").localize(), Event.EVENT_TYPE); - sheet.add( EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.event_type"), Event.EVENT_TYPE); + sheet.add( EventGlobalizationUtil.globalize( + "cms.contenttypes.ui.event.event_type"), + Event.EVENT_TYPE); } if (!Event.getConfig().getHideLinkToMap()) { - // sheet.add((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.link_to_map").localize(), Event.MAP_LINK); - sheet.add( EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.link_to_map"), Event.MAP_LINK ); + sheet.add( EventGlobalizationUtil.globalize( + "cms.contenttypes.ui.event.link_to_map"), + Event.MAP_LINK ); } if (!Event.getConfig().getHideCost()) { - // sheet.add((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.cost").localize(), Event.COST); - sheet.add( EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.cost"), Event.COST ); + sheet.add( EventGlobalizationUtil.globalize( + "cms.contenttypes.ui.event.cost"), + Event.COST ); } return sheet; } diff --git a/ccm-cms-types-event/src/com/arsdigita/cms/contenttypes/ui/EventPropertyForm.java b/ccm-cms-types-event/src/com/arsdigita/cms/contenttypes/ui/EventPropertyForm.java index 5b7943f71..06351929b 100755 --- a/ccm-cms-types-event/src/com/arsdigita/cms/contenttypes/ui/EventPropertyForm.java +++ b/ccm-cms-types-event/src/com/arsdigita/cms/contenttypes/ui/EventPropertyForm.java @@ -52,7 +52,9 @@ import java.util.GregorianCalendar; * This form can be extended to create forms for Event subclasses. **/ public class EventPropertyForm extends BasicPageForm - implements FormProcessListener, FormInitListener, FormSubmissionListener { + implements FormProcessListener, + FormInitListener, + FormSubmissionListener { /** Name of this form */ public static final String ID = "event_edit"; @@ -115,7 +117,8 @@ public class EventPropertyForm extends BasicPageForm super.addWidgets(); /* Summary (lead) */ - add(new Label(EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.lead")) ); + add(new Label(EventGlobalizationUtil + .globalize("cms.contenttypes.ui.event.lead")) ); ParameterModel leadParam = new StringParameter(LEAD); if(Event.getConfig().isLeadTextOptional()) { leadParam.addParameterListener(new NotNullValidationListener()); @@ -126,7 +129,8 @@ public class EventPropertyForm extends BasicPageForm add(lead); /* Start date and time */ ParameterModel eventStartDateParam = new DateParameter(START_DATE); - add(new Label(EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.start_date")) ); + add(new Label(EventGlobalizationUtil + .globalize("cms.contenttypes.ui.event.start_date")) ); eventStartDateParam.addParameterListener(new NotNullValidationListener()); // Use bebop date instead of java.util.date m_startDate = new com.arsdigita.bebop.form.Date(eventStartDateParam); @@ -136,7 +140,8 @@ public class EventPropertyForm extends BasicPageForm add(m_startDate); ParameterModel eventStartTimeParam = new TimeParameter(START_TIME); - add(new Label(EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.start_time")) ); + add(new Label(EventGlobalizationUtil + .globalize("cms.contenttypes.ui.event.start_time")) ); if(Event.getConfig().isStartTimeOptional()) { eventStartTimeParam.addParameterListener(new NotNullValidationListener()); } @@ -145,7 +150,8 @@ public class EventPropertyForm extends BasicPageForm /* End date and time */ ParameterModel eventEndDateParam = new DateParameter(END_DATE); - add(new Label((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.end_date").localize())); + add(new Label(EventGlobalizationUtil + .globalize("cms.contenttypes.ui.event.end_date"))); // Use bebop date instead of java.util.date m_endDate = new com.arsdigita.bebop.form.Date(eventEndDateParam); m_endDate.setYearRange(Event.getConfig().getStartYear(), @@ -153,14 +159,16 @@ public class EventPropertyForm extends BasicPageForm add(m_endDate); ParameterModel eventEndTimeParam = new TimeParameter(END_TIME); - add(new Label((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.end_time").localize())); + add(new Label(EventGlobalizationUtil + .globalize("cms.contenttypes.ui.event.end_time"))); Time endTime = new Time(eventEndTimeParam); add(endTime); /* optional additional / literal date description */ if (!Event.getConfig().getHideDateDescription()) { - add(new Label((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.date_description").localize())); + add(new Label(EventGlobalizationUtil + .globalize("cms.contenttypes.ui.event.date_description"))); ParameterModel eventDateParam = new StringParameter(EVENT_DATE); //eventDateParam // .addParameterListener(new NotNullValidationListener()); @@ -180,7 +188,8 @@ public class EventPropertyForm extends BasicPageForm /* extensive description of location */ - add(new Label((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.location").localize())); + add(new Label(EventGlobalizationUtil + .globalize("cms.contenttypes.ui.event.location"))); ParameterModel locationParam = new StringParameter(LOCATION); //locationParam // .addParameterListener(new NotNullValidationListener()); @@ -192,7 +201,8 @@ public class EventPropertyForm extends BasicPageForm /* optional: main contributor */ if (!Event.getConfig().getHideMainContributor()) { - add(new Label((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.main_contributor").localize())); + add(new Label(EventGlobalizationUtil + .globalize("cms.contenttypes.ui.event.main_contributor"))); ParameterModel mainContributorParam = new StringParameter(MAIN_CONTRIBUTOR); //mainContributorParam @@ -206,7 +216,8 @@ public class EventPropertyForm extends BasicPageForm /* optional: event type */ if (!Event.getConfig().getHideEventType()) { - add(new Label((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.event_type").localize())); + add(new Label(EventGlobalizationUtil + .globalize("cms.contenttypes.ui.event.event_type"))); ParameterModel eventTypeParam = new StringParameter(EVENT_TYPE); //eventTypeParam // .addParameterListener(new NotNullValidationListener()); @@ -219,7 +230,8 @@ public class EventPropertyForm extends BasicPageForm /* optional: link to map */ if (!Event.getConfig().getHideLinkToMap()) { - add(new Label((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.link_to_map").localize())); + add(new Label(EventGlobalizationUtil + .globalize("cms.contenttypes.ui.event.link_to_map"))); ParameterModel mapLinkParam = new StringParameter(MAP_LINK); //mapLinkParam // .addParameterListener(new NotNullValidationListener()); @@ -232,7 +244,8 @@ public class EventPropertyForm extends BasicPageForm /* optional: costs */ if (!Event.getConfig().getHideCost()) { - add(new Label((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.cost").localize())); + add(new Label(EventGlobalizationUtil + .globalize("cms.contenttypes.ui.event.cost"))); ParameterModel costParam = new TrimmedStringParameter(COST); TextField cost = new TextField(costParam); cost.setSize(30); @@ -242,6 +255,11 @@ public class EventPropertyForm extends BasicPageForm } + /** + * + * @param e + * @throws FormProcessException + */ @Override public void validate(FormSectionEvent e) throws FormProcessException { super.validate(e); @@ -253,7 +271,10 @@ public class EventPropertyForm extends BasicPageForm if (endDate != null) { if (startDate == null || startDate.compareTo(endDate) > 0) { - throw new FormProcessException((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.end_date_after_start_date").localize()); + throw new FormProcessException((String) + EventGlobalizationUtil.globalize( + "cms.contenttypes.ui.event.end_date_after_start_date") + .localize()); } } } diff --git a/ccm-cms-types-event/src/com/arsdigita/cms/contenttypes/util/EventGlobalizationUtil.java b/ccm-cms-types-event/src/com/arsdigita/cms/contenttypes/util/EventGlobalizationUtil.java index 5f476203a..7266b6432 100755 --- a/ccm-cms-types-event/src/com/arsdigita/cms/contenttypes/util/EventGlobalizationUtil.java +++ b/ccm-cms-types-event/src/com/arsdigita/cms/contenttypes/util/EventGlobalizationUtil.java @@ -36,22 +36,37 @@ public class EventGlobalizationUtil implements Globalized { /** Name of Java resource files to handle CMS's globalisation. */ final public static String BUNDLE_NAME = - "com.arsdigita.cms.contenttypes.EventResourceBundle"; + "com.arsdigita.cms.contenttypes.EventResources"; + + /** 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 package specific bundle, - * provided by BUNDLE_NAME. + * Returns a globalized message using the appropriate bundle. + * If the key string contains the modules name event the package specific + * bundle is used, otherwise the CMS ResourceBundle. */ public static GlobalizedMessage globalize(String key) { - return new GlobalizedMessage(key, BUNDLE_NAME); + if (key.indexOf("event.") > 0) { + return new GlobalizedMessage(key, BUNDLE_NAME); + } else { + return new GlobalizedMessage(key, ALTERNATE_BUNDLE_NAME); + } } /** - * Returns a globalized message object, using the package specific bundle, - * as specified by BUNDLE_NAME. Also takes in an Object[] of arguments to - * interpolate into the retrieved message using the MessageFormat class. + * Returns a globalized message object, using the approprate bundle, + * takeing in an Object[] of arguments to interpolate into the retrieved + * message using the MessageFormat class. + * If the key string contains the modules name event the package specific + * bundle is used, otherwise the CMS ResourceBundle. */ public static GlobalizedMessage globalize(String key, Object[] args) { - return new GlobalizedMessage(key, BUNDLE_NAME, args); + if (key.indexOf("event.") > 0) { + return new GlobalizedMessage(key, BUNDLE_NAME, args); + } else { + return new GlobalizedMessage(key, ALTERNATE_BUNDLE_NAME, args); + } } } diff --git a/ccm-cms-types-filestorageitem/src/com/arsdigita/cms/contenttypes/FileStorageItem.java b/ccm-cms-types-filestorageitem/src/com/arsdigita/cms/contenttypes/FileStorageItem.java index 063c9e680..74c168d4d 100755 --- a/ccm-cms-types-filestorageitem/src/com/arsdigita/cms/contenttypes/FileStorageItem.java +++ b/ccm-cms-types-filestorageitem/src/com/arsdigita/cms/contenttypes/FileStorageItem.java @@ -44,12 +44,6 @@ public class FileStorageItem extends ContentPage { /** PDL property name for file */ public static final String FILE = "file"; - /** Labels to avoid duplicated hard-coded strings anywhere in the content - * type files */ - public static final String DESCRIPTION_LABEL = "Description: "; - public static final String ITEM_LABEL = "FileStorageItem"; - public static final String DESCRIPTION_TYPE = "An FileStorageItem type."; - /** Data object type for this domain object */ public static final String BASE_DATA_OBJECT_TYPE = "com.arsdigita.cms.contenttypes.FileStorageItem"; diff --git a/ccm-cms-types-filestorageitem/src/com/arsdigita/cms/contenttypes/ui/FileStorageItemPropertyForm.java b/ccm-cms-types-filestorageitem/src/com/arsdigita/cms/contenttypes/ui/FileStorageItemPropertyForm.java index 025083bff..32d87b3e3 100755 --- a/ccm-cms-types-filestorageitem/src/com/arsdigita/cms/contenttypes/ui/FileStorageItemPropertyForm.java +++ b/ccm-cms-types-filestorageitem/src/com/arsdigita/cms/contenttypes/ui/FileStorageItemPropertyForm.java @@ -18,21 +18,20 @@ */ package com.arsdigita.cms.contenttypes.ui; -import com.arsdigita.cms.contenttypes.FileStorageItem; -import com.arsdigita.cms.contenttypes.ui.authoring.FileStorageItemPropertiesStep; import com.arsdigita.bebop.FormData; import com.arsdigita.bebop.Label; import com.arsdigita.bebop.event.FormInitListener; import com.arsdigita.bebop.event.FormProcessListener; import com.arsdigita.bebop.event.FormSectionEvent; import com.arsdigita.bebop.event.FormSubmissionListener; -import com.arsdigita.cms.ui.CMSDHTMLEditor; -import com.arsdigita.bebop.parameters.NotNullValidationListener; -import com.arsdigita.bebop.parameters.ParameterModel; import com.arsdigita.bebop.parameters.ParameterModel; import com.arsdigita.bebop.parameters.StringParameter; +import com.arsdigita.cms.contenttypes.FileStorageItem; +import com.arsdigita.cms.contenttypes.ui.authoring.FileStorageItemPropertiesStep; import com.arsdigita.cms.ItemSelectionModel; import com.arsdigita.cms.ui.authoring.BasicPageForm; +import com.arsdigita.cms.ui.CMSDHTMLEditor; +import com.arsdigita.cms.util.GlobalizationUtil; /** @@ -76,10 +75,11 @@ public class FileStorageItemPropertyForm /** * Adds widgets to the form. */ + @Override protected void addWidgets() { super.addWidgets(); - add( new Label( FileStorageItem.DESCRIPTION_LABEL ) ); + add( new Label( GlobalizationUtil.globalize("cms.contenttypes.ui.lead") ) ); ParameterModel descriptionParam = new StringParameter( FileStorageItem.DESCRIPTION ); // descriptionParam.addParameterListener( new NotNullValidationListener() ); diff --git a/ccm-cms-types-filestorageitem/src/com/arsdigita/cms/contenttypes/ui/authoring/FileStorageItemFileEdit.java b/ccm-cms-types-filestorageitem/src/com/arsdigita/cms/contenttypes/ui/authoring/FileStorageItemFileEdit.java index b863e1ae8..409b7e132 100755 --- a/ccm-cms-types-filestorageitem/src/com/arsdigita/cms/contenttypes/ui/authoring/FileStorageItemFileEdit.java +++ b/ccm-cms-types-filestorageitem/src/com/arsdigita/cms/contenttypes/ui/authoring/FileStorageItemFileEdit.java @@ -44,7 +44,7 @@ import com.arsdigita.cms.util.GlobalizationUtil; import java.io.IOException; import java.lang.RuntimeException; -/* +/** * Edit page to attach a file to FileStorageItem. * * @see com.arsdigita.intranet.cms.FileStorageItem @@ -67,7 +67,8 @@ public class FileStorageItemFileEdit extends SimpleEditStep { form.getSaveCancelSection().getCancelButton()); DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(itemModel); - sheet.add(GlobalizationUtil.globalize("cms.ui.file"), "file.name"); + sheet.add(GlobalizationUtil.globalize("cms.ui.authoring.file_upload.file"), + "file.name"); setDisplayComponent(sheet); @@ -89,9 +90,11 @@ public class FileStorageItemFileEdit extends SimpleEditStep { addProcessListener(this); } + @Override protected void addWidgets() { - add(new Label(GlobalizationUtil.globalize("cms.ui.file"))); + add(new Label(GlobalizationUtil.globalize( + "cms.ui.authoring.file_upload.file"))); add(new Label(new PrintListener() { public void prepare(PrintEvent e) { @@ -106,7 +109,7 @@ public class FileStorageItemFileEdit extends SimpleEditStep { l.setLabel(file.getName()); } else { l.setLabel(GlobalizationUtil - .globalize("cms.ui.authoring.none")); + .globalize("cms.ui.authoring.file_upload.no_file")); } } })); diff --git a/ccm-cms-types-filestorageitem/src/com/arsdigita/cms/contenttypes/ui/authoring/FileStorageItemPropertiesStep.java b/ccm-cms-types-filestorageitem/src/com/arsdigita/cms/contenttypes/ui/authoring/FileStorageItemPropertiesStep.java index 46bee0a22..f3e49a4d1 100755 --- a/ccm-cms-types-filestorageitem/src/com/arsdigita/cms/contenttypes/ui/authoring/FileStorageItemPropertiesStep.java +++ b/ccm-cms-types-filestorageitem/src/com/arsdigita/cms/contenttypes/ui/authoring/FileStorageItemPropertiesStep.java @@ -70,9 +70,12 @@ public class FileStorageItemPropertiesStep itemModel ) { DomainObjectPropertySheet sheet = new DomainObjectPropertySheet( itemModel ); - sheet.add(GlobalizationUtil.globalize("cms.ui.authoring.name"), FileStorageItem.NAME ); - sheet.add( GlobalizationUtil.globalize("cms.ui.authoring.title"), FileStorageItem.TITLE ); - sheet.add( GlobalizationUtil.globalize("cms.contenttypes.summary"), FileStorageItem.DESCRIPTION ); + sheet.add(GlobalizationUtil + .globalize("cms.ui.authoring.name"), FileStorageItem.NAME ); + sheet.add( GlobalizationUtil + .globalize("cms.ui.authoring.title"), FileStorageItem.TITLE ); + sheet.add( GlobalizationUtil + .globalize("cms.contenttypes.summary"), FileStorageItem.DESCRIPTION ); return sheet; } 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 29d30c8c5..b0824a64c 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 @@ -1,9 +1,6 @@ newsitem.authoring.body_text.description=Edit the title, name, lead, and date newsitem.authoring.image.description=Edit the associated image newsitem.authoring.image.title=Image -# -cms.contenttypes.ui.newsitem.name=Name (URL): -cms.contenttypes.ui.newsitem.title=Title: cms.contenttypes.ui.newsitem.lead=Lead Text: cms.contenttypes.ui.newsitem.date=News Date: cms.contenttypes.ui.newsitem.homepage=Homepage 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 645d3ccb3..384639315 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 @@ -9,9 +9,6 @@ newsitem.authoring.body_text.description=Bearbeitung von Titel, Namen, Zusammenfassung und Datum newsitem.authoring.image.description=Bearbeitung des Bildes newsitem.authoring.image.title=Bild -# -cms.contenttypes.ui.newsitem.name=Name (URL): -cms.contenttypes.ui.newsitem.title=Titel: cms.contenttypes.ui.newsitem.lead=Zusammenfassung (Lead): cms.contenttypes.ui.newsitem.date=Erscheinungsdatum: cms.contenttypes.ui.newsitem.homepage=Homepage: 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 74829fa83..8a9cb2cdd 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 @@ -7,9 +7,6 @@ newsitem.authoring.body_text.description=Bearbeitung von Titel, Namen, Zusammenfassung und Datum newsitem.authoring.image.description=Bearbeitung des Bildes newsitem.authoring.image.title=Bild -# -cms.contenttypes.ui.newsitem.name=Name (URL): -cms.contenttypes.ui.newsitem.title=Titel: cms.contenttypes.ui.newsitem.lead=Zusammenfassung (Lead): cms.contenttypes.ui.newsitem.date=Erscheinungsdatum: cms.contenttypes.ui.newsitem.homepage=Homepage: 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 b7fae1dfb..b031943aa 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 @@ -79,7 +79,7 @@ public class NewsItemPropertiesStep extends SimpleEditStep { sheet.add(NewsItemGlobalizationUtil .globalize("cms.contenttypes.ui.title"), NewsItem.TITLE); sheet.add(NewsItemGlobalizationUtil - .globalize("cms.contenttypes.ui.newsitem.name"), NewsItem.NAME); + .globalize("cms.contenttypes.ui.name"), NewsItem.NAME); sheet.add(NewsItemGlobalizationUtil .globalize("cms.contenttypes.ui.newsitem.lead"), NewsItem.LEAD); diff --git a/ccm-cms-types-newsitem/src/com/arsdigita/cms/contenttypes/util/NewsItemGlobalizationUtil.java b/ccm-cms-types-newsitem/src/com/arsdigita/cms/contenttypes/util/NewsItemGlobalizationUtil.java index 107135659..e96488fb5 100755 --- a/ccm-cms-types-newsitem/src/com/arsdigita/cms/contenttypes/util/NewsItemGlobalizationUtil.java +++ b/ccm-cms-types-newsitem/src/com/arsdigita/cms/contenttypes/util/NewsItemGlobalizationUtil.java @@ -37,19 +37,30 @@ public class NewsItemGlobalizationUtil implements Globalized { final public static String BUNDLE_NAME = "com.arsdigita.cms.contenttypes.NewsItemResources"; + /** 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 package specific bundle, - * provided by BUNDLE_NAME. + * Returns a globalized message using the appropriate bundle. + * If the key string contains the modules name newsitem the package specific + * bundle is used, otherwise the CMS ResourceBundle. */ public static GlobalizedMessage globalize(String key) { - return new GlobalizedMessage(key, BUNDLE_NAME); + if (key.indexOf(".newsitem.") > 0) { + return new GlobalizedMessage(key, BUNDLE_NAME); + } else { + return new GlobalizedMessage(key, ALTERNATE_BUNDLE_NAME); + } } /** - * Returns a globalized message object, using the package specific bundle, - * as specified by BUNDLE_NAME. Also takes in an Object[] of arguments to - * interpolate into the retrieved message using the MessageFormat class. + * Returns a globalized message object, using the appropriate bundle, + * takeing in an Object[] of arguments to interpolate into the retrieved + * message using the MessageFormat class. + * If the key string contains the modules name newsitem the package specific + * bundle is used, otherwise the CMS ResourceBundle. */ public static GlobalizedMessage globalize(String key, Object[] args) { return new GlobalizedMessage(key, BUNDLE_NAME, args);