Korrektur Lokalisierung einiger Content Typem.

git-svn-id: https://svn.libreccm.org/ccm/trunk@2188 8810af33-2d31-482b-a856-94f89814c4df
master
pb 2013-06-08 11:55:13 +00:00
parent 6ebcb1deef
commit 0042ff07c9
21 changed files with 160 additions and 96 deletions

View File

@ -32,8 +32,6 @@ import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
import com.arsdigita.cms.ui.authoring.BasicPageForm; import com.arsdigita.cms.ui.authoring.BasicPageForm;
import com.arsdigita.cms.ui.authoring.SimpleEditStep; import com.arsdigita.cms.ui.authoring.SimpleEditStep;
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
// replaced by AgendaGlobalizationUtil
// import com.arsdigita.cms.util.GlobalizationUtil;
import com.arsdigita.globalization.GlobalizationHelper; import com.arsdigita.globalization.GlobalizationHelper;

View File

@ -41,9 +41,9 @@ public class AgendaGlobalizationUtil implements Globalized {
"com.arsdigita.cms.CMSResources"; "com.arsdigita.cms.CMSResources";
/** /**
* This returns a globalized message using the type specific bundle, * Returns a globalized message using the appropriate bundle.
* BUNDLE_NAME if the key string contains the modules name agenda, * If the key string contains the modules name agenda the package specific
* otherwise the CMS ResourceBundle is used. * bundle is used, otherwise the CMS ResourceBundle.
*/ */
public static GlobalizedMessage globalize(String key) { public static GlobalizedMessage globalize(String key) {
if (key.indexOf(".agenda.") > 0) { if (key.indexOf(".agenda.") > 0) {
@ -54,9 +54,11 @@ public class AgendaGlobalizationUtil implements Globalized {
} }
/** /**
* Returns a globalized message object, using the package specific bundle, * Returns a globalized message object, using the approprate bundle,
* as specified by BUNDLE_NAME. Also takes in an Object[] of arguments to * takeing in an Object[] of arguments to interpolate into the retrieved
* interpolate into the retrieved message using the MessageFormat class. * 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) { public static GlobalizedMessage globalize(String key, Object[] args) {
if (key.indexOf(".agenda.") > 0) { if (key.indexOf(".agenda.") > 0) {

View File

@ -39,6 +39,12 @@ 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";
/**
* Constructor.
*
* @param itemModel
* @param parent
*/
public ArticlePropertiesStep(ItemSelectionModel itemModel, public ArticlePropertiesStep(ItemSelectionModel itemModel,
AuthoringKitWizard parent) { AuthoringKitWizard parent) {
super(itemModel, parent); super(itemModel, parent);

View File

@ -70,6 +70,7 @@ public class Bookmark extends ContentPage {
super( type ); super( type );
} }
@Override
public void beforeSave() { public void beforeSave() {
super.beforeSave(); super.beforeSave();
@ -78,10 +79,12 @@ public class Bookmark extends ContentPage {
/* accessors *****************************************************/ /* accessors *****************************************************/
@Override
public String getDescription() { public String getDescription() {
return (String) get( DESCRIPTION ); return (String) get( DESCRIPTION );
} }
@Override
public void setDescription( String description ) { public void setDescription( String description ) {
set( DESCRIPTION, description ); set( DESCRIPTION, description );
} }
@ -95,6 +98,7 @@ public class Bookmark extends ContentPage {
} }
// Search stuff to allow the content type to be searchable // Search stuff to allow the content type to be searchable
@Override
public String getSearchSummary() { public String getSearchSummary() {
return getDescription(); return getDescription();
} }

View File

@ -74,7 +74,6 @@ public class BookmarkPropertyForm
description.setRows(5); description.setRows(5);
add( description ); add( description );
// add( new Label( "Url:" ) );
add( new Label( new GlobalizedMessage add( new Label( new GlobalizedMessage
("cms.contenttypes.ui.bookmark.url",Bookmark.RESOURCES) ) ); ("cms.contenttypes.ui.bookmark.url",Bookmark.RESOURCES) ) );
ParameterModel urlParam ParameterModel urlParam

View File

@ -68,7 +68,7 @@ public class EventInitializer extends ContentTypeInitializer {
*/ */
@Override @Override
public String getTraversalXML() { public String getTraversalXML() {
return "/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/Event.xml"; return TRAVERSAL_ADAPTER_BASE_DIR + "Event.xml";
} }
} }

View File

@ -18,3 +18,5 @@ cms.contenttypes.ui.event.main_contributor=Main contributor:
cms.contenttypes.ui.event.event_type=Event Type: cms.contenttypes.ui.event.event_type=Event Type:
cms.contenttypes.ui.event.link_to_map=Link to Map cms.contenttypes.ui.event.link_to_map=Link to Map
cms.contenttypes.ui.event.cost=Cost: cms.contenttypes.ui.event.cost=Cost:
#Probably not used!
cms.contenttypes.ui.event.there_are_no_events=There are no events.

View File

@ -12,7 +12,7 @@ cms.contenttypes.ui.event.start_date=Anfangs-Datum:
cms.contenttypes.ui.event.start_time=Beginn: cms.contenttypes.ui.event.start_time=Beginn:
cms.contenttypes.ui.event.end_date=End-Datum: cms.contenttypes.ui.event.end_date=End-Datum:
cms.contenttypes.ui.event.end_time=Ende: 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.date_description=Termin Zusatz:
cms.contenttypes.ui.event.location=Ort: 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.event_type=Veranstaltungs-Typ:
cms.contenttypes.ui.event.link_to_map=Link zur Karte cms.contenttypes.ui.event.link_to_map=Link zur Karte
cms.contenttypes.ui.event.cost=Kosten: cms.contenttypes.ui.event.cost=Kosten:
cms.contenttypes.ui.event.there_are_no_events=Es sind keine Veranstaltungen vorhanden.

View File

@ -1,8 +1,8 @@
# EventResources_fr.properties # EventResources_fr.properties
# UTF-8 characters: # UTF-8 characters:
# è = \u00e8 (LETTER E WITH GRAVE) # \u00e8 = \u00e8 (LETTER E WITH GRAVE)
# é = \u00e9 (LETTER E WITH ACUTE) # \u00e9 = \u00e9 (LETTER E WITH ACUTE)
cms.contenttypes.event_type_not_registered=Type d'évenement non enregistré 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 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): 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.event_type=Event Type:
cms.contenttypes.ui.event.link_to_map=Link to Map cms.contenttypes.ui.event.link_to_map=Link to Map
cms.contenttypes.ui.event.cost=Cost: cms.contenttypes.ui.event.cost=Cost:
cms.contenttypes.ui.event.there_are_no_events=Il n'y a aucun \u00e9venement

View File

@ -84,18 +84,18 @@ public class EventPropertiesStep extends SimpleEditStep {
* of the release * of the release
**/ **/
public static Component getEventPropertySheet(ItemSelectionModel itemModel) { public static Component getEventPropertySheet(ItemSelectionModel itemModel) {
DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(itemModel); DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(itemModel);
// sheet.add((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.name").localize(), Event.NAME); sheet.add( EventGlobalizationUtil
// sheet.add((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.title").localize(), Event.TITLE); .globalize("cms.contenttypes.ui.title"), Event.TITLE);
// sheet.add((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.lead").localize(), Event.LEAD); sheet.add( EventGlobalizationUtil
.globalize("cms.contenttypes.ui.name"), Event.NAME);
sheet.add( EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.name"), Event.NAME); sheet.add( EventGlobalizationUtil
sheet.add( EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.title"), Event.TITLE); .globalize("cms.contenttypes.ui.event.lead"), Event.LEAD);
sheet.add( EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.lead"), Event.LEAD);
if (!ContentSection.getConfig().getHideLaunchDate()) { 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, ContentPage.LAUNCH_DATE,
new DomainObjectPropertySheet.AttributeFormatter() { new DomainObjectPropertySheet.AttributeFormatter() {
@ -104,15 +104,23 @@ public class EventPropertiesStep 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()).format(page.getLaunchDate()); return DateFormat
.getDateInstance(DateFormat.LONG,
GlobalizationHelper
.getNegotiatedLocale())
.format(page
.getLaunchDate());
} else { } 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() { new DomainObjectPropertySheet.AttributeFormatter() {
public String format(DomainObject item, 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, sheet.add( EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.end_time"), Event.END_DATE,
new DomainObjectPropertySheet.AttributeFormatter() { new DomainObjectPropertySheet.AttributeFormatter() {
@ -162,27 +169,33 @@ public class EventPropertiesStep extends SimpleEditStep {
} }
}); });
if (!Event.getConfig().getHideDateDescription()) { if (!Event.getConfig().getHideDateDescription()) {
// sheet.add((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.date_description").localize(), Event.EVENT_DATE); sheet.add( EventGlobalizationUtil
sheet.add( EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.date_description"), Event.EVENT_DATE); .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
sheet.add( EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.location"), Event.LOCATION); .globalize("cms.contenttypes.ui.event.location"),
Event.LOCATION);
if (!Event.getConfig().getHideMainContributor()) { if (!Event.getConfig().getHideMainContributor()) {
// sheet.add((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.main_contributor").localize(), Event.MAIN_CONTRIBUTOR); sheet.add( EventGlobalizationUtil.globalize(
sheet.add( EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.main_contributor"), Event.MAIN_CONTRIBUTOR); "cms.contenttypes.ui.event.main_contributor"),
Event.MAIN_CONTRIBUTOR);
} }
if (!Event.getConfig().getHideEventType()) { if (!Event.getConfig().getHideEventType()) {
// sheet.add((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.event_type").localize(), Event.EVENT_TYPE); sheet.add( EventGlobalizationUtil.globalize(
sheet.add( EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.event_type"), Event.EVENT_TYPE); "cms.contenttypes.ui.event.event_type"),
Event.EVENT_TYPE);
} }
if (!Event.getConfig().getHideLinkToMap()) { if (!Event.getConfig().getHideLinkToMap()) {
// sheet.add((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.link_to_map").localize(), Event.MAP_LINK); sheet.add( EventGlobalizationUtil.globalize(
sheet.add( EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.link_to_map"), Event.MAP_LINK ); "cms.contenttypes.ui.event.link_to_map"),
Event.MAP_LINK );
} }
if (!Event.getConfig().getHideCost()) { if (!Event.getConfig().getHideCost()) {
// sheet.add((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.cost").localize(), Event.COST); sheet.add( EventGlobalizationUtil.globalize(
sheet.add( EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.cost"), Event.COST ); "cms.contenttypes.ui.event.cost"),
Event.COST );
} }
return sheet; return sheet;
} }

View File

@ -52,7 +52,9 @@ import java.util.GregorianCalendar;
* This form can be extended to create forms for Event subclasses. * This form can be extended to create forms for Event subclasses.
**/ **/
public class EventPropertyForm extends BasicPageForm public class EventPropertyForm extends BasicPageForm
implements FormProcessListener, FormInitListener, FormSubmissionListener { implements FormProcessListener,
FormInitListener,
FormSubmissionListener {
/** Name of this form */ /** Name of this form */
public static final String ID = "event_edit"; public static final String ID = "event_edit";
@ -115,7 +117,8 @@ public class EventPropertyForm extends BasicPageForm
super.addWidgets(); super.addWidgets();
/* Summary (lead) */ /* 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); ParameterModel leadParam = new StringParameter(LEAD);
if(Event.getConfig().isLeadTextOptional()) { if(Event.getConfig().isLeadTextOptional()) {
leadParam.addParameterListener(new NotNullValidationListener()); leadParam.addParameterListener(new NotNullValidationListener());
@ -126,7 +129,8 @@ public class EventPropertyForm extends BasicPageForm
add(lead); add(lead);
/* Start date and time */ /* Start date and time */
ParameterModel eventStartDateParam = new DateParameter(START_DATE); 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()); eventStartDateParam.addParameterListener(new NotNullValidationListener());
// Use bebop date instead of java.util.date // Use bebop date instead of java.util.date
m_startDate = new com.arsdigita.bebop.form.Date(eventStartDateParam); m_startDate = new com.arsdigita.bebop.form.Date(eventStartDateParam);
@ -136,7 +140,8 @@ public class EventPropertyForm extends BasicPageForm
add(m_startDate); add(m_startDate);
ParameterModel eventStartTimeParam = new TimeParameter(START_TIME); 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()) { if(Event.getConfig().isStartTimeOptional()) {
eventStartTimeParam.addParameterListener(new NotNullValidationListener()); eventStartTimeParam.addParameterListener(new NotNullValidationListener());
} }
@ -145,7 +150,8 @@ public class EventPropertyForm extends BasicPageForm
/* End date and time */ /* End date and time */
ParameterModel eventEndDateParam = new DateParameter(END_DATE); 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 // Use bebop date instead of java.util.date
m_endDate = new com.arsdigita.bebop.form.Date(eventEndDateParam); m_endDate = new com.arsdigita.bebop.form.Date(eventEndDateParam);
m_endDate.setYearRange(Event.getConfig().getStartYear(), m_endDate.setYearRange(Event.getConfig().getStartYear(),
@ -153,14 +159,16 @@ public class EventPropertyForm extends BasicPageForm
add(m_endDate); add(m_endDate);
ParameterModel eventEndTimeParam = new TimeParameter(END_TIME); 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); Time endTime = new Time(eventEndTimeParam);
add(endTime); add(endTime);
/* optional additional / literal date description */ /* optional additional / literal date description */
if (!Event.getConfig().getHideDateDescription()) { 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); ParameterModel eventDateParam = new StringParameter(EVENT_DATE);
//eventDateParam //eventDateParam
// .addParameterListener(new NotNullValidationListener()); // .addParameterListener(new NotNullValidationListener());
@ -180,7 +188,8 @@ public class EventPropertyForm extends BasicPageForm
/* extensive description of location */ /* 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); ParameterModel locationParam = new StringParameter(LOCATION);
//locationParam //locationParam
// .addParameterListener(new NotNullValidationListener()); // .addParameterListener(new NotNullValidationListener());
@ -192,7 +201,8 @@ public class EventPropertyForm extends BasicPageForm
/* optional: main contributor */ /* optional: main contributor */
if (!Event.getConfig().getHideMainContributor()) { 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 = ParameterModel mainContributorParam =
new StringParameter(MAIN_CONTRIBUTOR); new StringParameter(MAIN_CONTRIBUTOR);
//mainContributorParam //mainContributorParam
@ -206,7 +216,8 @@ public class EventPropertyForm extends BasicPageForm
/* optional: event type */ /* optional: event type */
if (!Event.getConfig().getHideEventType()) { 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); ParameterModel eventTypeParam = new StringParameter(EVENT_TYPE);
//eventTypeParam //eventTypeParam
// .addParameterListener(new NotNullValidationListener()); // .addParameterListener(new NotNullValidationListener());
@ -219,7 +230,8 @@ public class EventPropertyForm extends BasicPageForm
/* optional: link to map */ /* optional: link to map */
if (!Event.getConfig().getHideLinkToMap()) { 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); ParameterModel mapLinkParam = new StringParameter(MAP_LINK);
//mapLinkParam //mapLinkParam
// .addParameterListener(new NotNullValidationListener()); // .addParameterListener(new NotNullValidationListener());
@ -232,7 +244,8 @@ public class EventPropertyForm extends BasicPageForm
/* optional: costs */ /* optional: costs */
if (!Event.getConfig().getHideCost()) { 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); ParameterModel costParam = new TrimmedStringParameter(COST);
TextField cost = new TextField(costParam); TextField cost = new TextField(costParam);
cost.setSize(30); cost.setSize(30);
@ -242,6 +255,11 @@ public class EventPropertyForm extends BasicPageForm
} }
/**
*
* @param e
* @throws FormProcessException
*/
@Override @Override
public void validate(FormSectionEvent e) throws FormProcessException { public void validate(FormSectionEvent e) throws FormProcessException {
super.validate(e); super.validate(e);
@ -253,7 +271,10 @@ public class EventPropertyForm extends BasicPageForm
if (endDate != null) { if (endDate != null) {
if (startDate == null || startDate.compareTo(endDate) > 0) { 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());
} }
} }
} }

View File

@ -36,22 +36,37 @@ public class EventGlobalizationUtil implements Globalized {
/** Name of Java resource files to handle CMS's globalisation. */ /** Name of Java resource files to handle CMS's globalisation. */
final public static String BUNDLE_NAME = 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, * Returns a globalized message using the appropriate bundle.
* provided by BUNDLE_NAME. * 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) { 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, * Returns a globalized message object, using the approprate bundle,
* as specified by BUNDLE_NAME. Also takes in an Object[] of arguments to * takeing in an Object[] of arguments to interpolate into the retrieved
* interpolate into the retrieved message using the MessageFormat class. * 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) { 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);
}
} }
} }

View File

@ -44,12 +44,6 @@ public class FileStorageItem extends ContentPage {
/** PDL property name for file */ /** PDL property name for file */
public static final String FILE = "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 */ /** Data object type for this domain object */
public static final String BASE_DATA_OBJECT_TYPE public static final String BASE_DATA_OBJECT_TYPE
= "com.arsdigita.cms.contenttypes.FileStorageItem"; = "com.arsdigita.cms.contenttypes.FileStorageItem";

View File

@ -18,21 +18,20 @@
*/ */
package com.arsdigita.cms.contenttypes.ui; 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.FormData;
import com.arsdigita.bebop.Label; import com.arsdigita.bebop.Label;
import com.arsdigita.bebop.event.FormInitListener; import com.arsdigita.bebop.event.FormInitListener;
import com.arsdigita.bebop.event.FormProcessListener; import com.arsdigita.bebop.event.FormProcessListener;
import com.arsdigita.bebop.event.FormSectionEvent; import com.arsdigita.bebop.event.FormSectionEvent;
import com.arsdigita.bebop.event.FormSubmissionListener; 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.ParameterModel;
import com.arsdigita.bebop.parameters.StringParameter; 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.ItemSelectionModel;
import com.arsdigita.cms.ui.authoring.BasicPageForm; 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. * Adds widgets to the form.
*/ */
@Override
protected void addWidgets() { protected void addWidgets() {
super.addWidgets(); super.addWidgets();
add( new Label( FileStorageItem.DESCRIPTION_LABEL ) ); add( new Label( GlobalizationUtil.globalize("cms.contenttypes.ui.lead") ) );
ParameterModel descriptionParam ParameterModel descriptionParam
= new StringParameter( FileStorageItem.DESCRIPTION ); = new StringParameter( FileStorageItem.DESCRIPTION );
// descriptionParam.addParameterListener( new NotNullValidationListener() ); // descriptionParam.addParameterListener( new NotNullValidationListener() );

View File

@ -44,7 +44,7 @@ import com.arsdigita.cms.util.GlobalizationUtil;
import java.io.IOException; import java.io.IOException;
import java.lang.RuntimeException; import java.lang.RuntimeException;
/* /**
* Edit page to attach a file to FileStorageItem. * Edit page to attach a file to FileStorageItem.
* *
* @see com.arsdigita.intranet.cms.FileStorageItem * @see com.arsdigita.intranet.cms.FileStorageItem
@ -67,7 +67,8 @@ public class FileStorageItemFileEdit extends SimpleEditStep {
form.getSaveCancelSection().getCancelButton()); form.getSaveCancelSection().getCancelButton());
DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(itemModel); 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); setDisplayComponent(sheet);
@ -89,9 +90,11 @@ public class FileStorageItemFileEdit extends SimpleEditStep {
addProcessListener(this); addProcessListener(this);
} }
@Override
protected void addWidgets() { 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() { add(new Label(new PrintListener() {
public void prepare(PrintEvent e) { public void prepare(PrintEvent e) {
@ -106,7 +109,7 @@ public class FileStorageItemFileEdit extends SimpleEditStep {
l.setLabel(file.getName()); l.setLabel(file.getName());
} else { } else {
l.setLabel(GlobalizationUtil l.setLabel(GlobalizationUtil
.globalize("cms.ui.authoring.none")); .globalize("cms.ui.authoring.file_upload.no_file"));
} }
} }
})); }));

View File

@ -70,9 +70,12 @@ public class FileStorageItemPropertiesStep
itemModel ) { itemModel ) {
DomainObjectPropertySheet sheet = new DomainObjectPropertySheet( itemModel ); DomainObjectPropertySheet sheet = new DomainObjectPropertySheet( itemModel );
sheet.add(GlobalizationUtil.globalize("cms.ui.authoring.name"), FileStorageItem.NAME ); sheet.add(GlobalizationUtil
sheet.add( GlobalizationUtil.globalize("cms.ui.authoring.title"), FileStorageItem.TITLE ); .globalize("cms.ui.authoring.name"), FileStorageItem.NAME );
sheet.add( GlobalizationUtil.globalize("cms.contenttypes.summary"), FileStorageItem.DESCRIPTION ); sheet.add( GlobalizationUtil
.globalize("cms.ui.authoring.title"), FileStorageItem.TITLE );
sheet.add( GlobalizationUtil
.globalize("cms.contenttypes.summary"), FileStorageItem.DESCRIPTION );
return sheet; return sheet;
} }

View File

@ -1,9 +1,6 @@
newsitem.authoring.body_text.description=Edit the title, name, lead, and date newsitem.authoring.body_text.description=Edit the title, name, lead, and date
newsitem.authoring.image.description=Edit the associated image newsitem.authoring.image.description=Edit the associated image
newsitem.authoring.image.title=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.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

View File

@ -9,9 +9,6 @@
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
newsitem.authoring.image.title=Bild 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.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:

View File

@ -7,9 +7,6 @@
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
newsitem.authoring.image.title=Bild 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.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:

View File

@ -79,7 +79,7 @@ public class NewsItemPropertiesStep extends SimpleEditStep {
sheet.add(NewsItemGlobalizationUtil sheet.add(NewsItemGlobalizationUtil
.globalize("cms.contenttypes.ui.title"), NewsItem.TITLE); .globalize("cms.contenttypes.ui.title"), NewsItem.TITLE);
sheet.add(NewsItemGlobalizationUtil sheet.add(NewsItemGlobalizationUtil
.globalize("cms.contenttypes.ui.newsitem.name"), NewsItem.NAME); .globalize("cms.contenttypes.ui.name"), NewsItem.NAME);
sheet.add(NewsItemGlobalizationUtil sheet.add(NewsItemGlobalizationUtil
.globalize("cms.contenttypes.ui.newsitem.lead"), NewsItem.LEAD); .globalize("cms.contenttypes.ui.newsitem.lead"), NewsItem.LEAD);

View File

@ -37,19 +37,30 @@ public class NewsItemGlobalizationUtil implements Globalized {
final public static String BUNDLE_NAME = final public static String BUNDLE_NAME =
"com.arsdigita.cms.contenttypes.NewsItemResources"; "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, * Returns a globalized message using the appropriate bundle.
* provided by BUNDLE_NAME. * 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) { 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, * Returns a globalized message object, using the appropriate bundle,
* as specified by BUNDLE_NAME. Also takes in an Object[] of arguments to * takeing in an Object[] of arguments to interpolate into the retrieved
* interpolate into the retrieved message using the MessageFormat class. * 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) { public static GlobalizedMessage globalize(String key, Object[] args) {
return new GlobalizedMessage(key, BUNDLE_NAME, args); return new GlobalizedMessage(key, BUNDLE_NAME, args);