diff --git a/ccm-cms/src/com/arsdigita/cms/CMSResources.properties b/ccm-cms/src/com/arsdigita/cms/CMSResources.properties index 5b691eb5f..39b954d69 100755 --- a/ccm-cms/src/com/arsdigita/cms/CMSResources.properties +++ b/ccm-cms/src/com/arsdigita/cms/CMSResources.properties @@ -1085,3 +1085,4 @@ cms.ui.contentcenter.section_hint=All content items are organized in one or more cms.ui.contentcenter.location=Location cms.ui.contentcenter.location_hint=In Legacy mode links to public pages. cms.ui.contentcenter.action_hint=If activated displays a form for each content section to create an object of a given type (configurable) in the root of the given content section. The list of available types retrieved for each content section. Administrators will disable this option in order to prevent disorganizing the root directory. +cms.ui.property_already_exist=The following Property already exists: diff --git a/ccm-cms/src/com/arsdigita/cms/CMSResources_de.properties b/ccm-cms/src/com/arsdigita/cms/CMSResources_de.properties index 4929f233c..e2074f059 100755 --- a/ccm-cms/src/com/arsdigita/cms/CMSResources_de.properties +++ b/ccm-cms/src/com/arsdigita/cms/CMSResources_de.properties @@ -1079,3 +1079,4 @@ cms.ui.contentcenter.section_hint=All documents are organized in one or more con cms.ui.contentcenter.location=Ort cms.ui.contentcenter.location_hint=In Legacy mode links to public pages. cms.ui.contentcenter.action_hint=Falls aktiv wird ein Formular angezeigt, um im ROOT Verzeichnis der entsprechenden Sektion ein neues Dokument anzulegen. Administratoren deaktivieren diese Option, um das ROOT Verzeichnis nicht zu \u00fcberfrachten. +cms.ui.property_already_exist=Das folgende Objekt existiert bereits: diff --git a/ccm-cms/src/com/arsdigita/cms/CMSResources_en_GB.properties b/ccm-cms/src/com/arsdigita/cms/CMSResources_en_GB.properties index 5ff66bba6..f8712c103 100755 --- a/ccm-cms/src/com/arsdigita/cms/CMSResources_en_GB.properties +++ b/ccm-cms/src/com/arsdigita/cms/CMSResources_en_GB.properties @@ -122,3 +122,4 @@ cms.ui.contentcenter.section_hint=All content items are organized in one or more cms.ui.contentcenter.location=Location cms.ui.contentcenter.location_hint=In Legacy mode links to public pages. cms.ui.contentcenter.action_hint=If activated displays a form for each content section to create an object of a given type (configurable) in the root of the given content section. The list of available types retrieved for each content section. Administrators will disable this option in order to prevent disorganizing the root directory. +cms.ui.property_already_exist=The following Property already exists: diff --git a/ccm-cms/src/com/arsdigita/cms/CMSResources_fr.properties b/ccm-cms/src/com/arsdigita/cms/CMSResources_fr.properties index bff94cc12..d3df9db1c 100755 --- a/ccm-cms/src/com/arsdigita/cms/CMSResources_fr.properties +++ b/ccm-cms/src/com/arsdigita/cms/CMSResources_fr.properties @@ -591,3 +591,4 @@ cms.ui.contentcenter.section_hint=All documents are organized in one or more con cms.ui.contentcenter.location=TRANSLATE: Location cms.ui.contentcenter.location_hint=In Legacy mode links to public pages. cms.ui.contentcenter.action_hint=If activated displays a form for each content section to create an object of a given type (configurable) in the root of the given content section. The list of available types retrieved for each content section. Administrators will disable this option in order to prevent disorganizing the root directory. +cms.ui.property_already_exist=The following Property already exists: diff --git a/ccm-cms/src/com/arsdigita/cms/ui/authoring/PageCreateDynamic.java b/ccm-cms/src/com/arsdigita/cms/ui/authoring/PageCreateDynamic.java index 2a13ce0c0..358b1e7af 100755 --- a/ccm-cms/src/com/arsdigita/cms/ui/authoring/PageCreateDynamic.java +++ b/ccm-cms/src/com/arsdigita/cms/ui/authoring/PageCreateDynamic.java @@ -385,9 +385,8 @@ public class PageCreateDynamic extends FormSection if(getSaveCancelSection().getCancelButton().isSelected(state)) { m_parent.redirectBack(state); - throw new FormProcessException( (String) GlobalizationUtil - .globalize("cms.ui.authoring.submission_cancelled") - .localize()); + throw new FormProcessException(GlobalizationUtil + .globalize("cms.ui.authoring.submission_cancelled")); } } diff --git a/ccm-cms/src/com/arsdigita/cms/ui/authoringkit/EditKit.java b/ccm-cms/src/com/arsdigita/cms/ui/authoringkit/EditKit.java index e7f04f841..f58c2ecca 100755 --- a/ccm-cms/src/com/arsdigita/cms/ui/authoringkit/EditKit.java +++ b/ccm-cms/src/com/arsdigita/cms/ui/authoringkit/EditKit.java @@ -92,7 +92,7 @@ public class EditKit extends Form throws FormProcessException { PageState state = event.getPageState(); if ( isCancelled(state) ) { - throw new FormProcessException( (String) GlobalizationUtil.globalize("cms.ui.cancel_hit").localize()); + throw new FormProcessException(GlobalizationUtil.globalize("cms.ui.cancel_hit")); } } }); diff --git a/ccm-cms/src/com/arsdigita/cms/ui/category/CategoryLocalizationForm.java b/ccm-cms/src/com/arsdigita/cms/ui/category/CategoryLocalizationForm.java index 4e27563e0..69de7d718 100644 --- a/ccm-cms/src/com/arsdigita/cms/ui/category/CategoryLocalizationForm.java +++ b/ccm-cms/src/com/arsdigita/cms/ui/category/CategoryLocalizationForm.java @@ -250,7 +250,7 @@ public class CategoryLocalizationForm extends BaseForm { if (compField.equalsIgnoreCase(title) && (m_category == null || !m_category.getCategory(state).equals(child))) { - throw new FormProcessException(lz("cms.ui.category.name_not_unique")); + throw new FormProcessException(GlobalizationUtil.globalize("cms.ui.category.name_not_unique")); } } } diff --git a/ccm-cms/src/com/arsdigita/cms/ui/folder/FolderManipulator.java b/ccm-cms/src/com/arsdigita/cms/ui/folder/FolderManipulator.java index 594a542c7..896819431 100755 --- a/ccm-cms/src/com/arsdigita/cms/ui/folder/FolderManipulator.java +++ b/ccm-cms/src/com/arsdigita/cms/ui/folder/FolderManipulator.java @@ -71,6 +71,7 @@ import com.arsdigita.cms.ItemCollection; import com.arsdigita.cms.SecurityManager; import com.arsdigita.cms.lifecycle.LifecycleDefinition; import com.arsdigita.cms.ui.lifecycle.PublishLock; +import com.arsdigita.cms.util.GlobalizationUtil; import com.arsdigita.domain.DataObjectNotFoundException; import com.arsdigita.domain.DomainObjectFactory; import com.arsdigita.kernel.ACSObject; @@ -627,7 +628,7 @@ public class FolderManipulator extends SimpleContainer implements if (targetSelector.isCancelled(state)) { reset(state); - throw new FormProcessException("cms.ui.folder.cancelled"); + throw new FormProcessException(GlobalizationUtil.globalize("cms.ui.folder.cancelled")); } } diff --git a/ccm-cms/src/com/arsdigita/cms/ui/lifecycle/BaseLifecycleForm.java b/ccm-cms/src/com/arsdigita/cms/ui/lifecycle/BaseLifecycleForm.java index 5b324bb35..3598967d1 100755 --- a/ccm-cms/src/com/arsdigita/cms/ui/lifecycle/BaseLifecycleForm.java +++ b/ccm-cms/src/com/arsdigita/cms/ui/lifecycle/BaseLifecycleForm.java @@ -33,6 +33,7 @@ import com.arsdigita.cms.lifecycle.LifecycleDefinition; import com.arsdigita.cms.lifecycle.LifecycleDefinitionCollection; import com.arsdigita.cms.ui.BaseForm; import com.arsdigita.cms.ui.FormSecurityListener; +import com.arsdigita.cms.util.GlobalizationUtil; import com.arsdigita.globalization.GlobalizedMessage; import org.apache.log4j.Logger; @@ -100,7 +101,7 @@ class BaseLifecycleForm extends BaseForm { definitions.close(); throw new FormProcessException - (lz("cms.ui.lifecycle.name_not_unique")); + (GlobalizationUtil.globalize("cms.ui.lifecycle.name_not_unique")); } } } diff --git a/ccm-cms/src/com/arsdigita/cms/ui/lifecycle/ItemLifecycleSelectForm.java b/ccm-cms/src/com/arsdigita/cms/ui/lifecycle/ItemLifecycleSelectForm.java index 867ab1bba..c6bbaf010 100755 --- a/ccm-cms/src/com/arsdigita/cms/ui/lifecycle/ItemLifecycleSelectForm.java +++ b/ccm-cms/src/com/arsdigita/cms/ui/lifecycle/ItemLifecycleSelectForm.java @@ -86,7 +86,8 @@ import javax.servlet.http.HttpServletRequest; import org.apache.log4j.Logger; /** - *

A form to select and apply a lifecycle to a content item.

+ *

+ * A form to select and apply a lifecycle to a content item.

* * @author Michael Pih * @author Xixi D'moon <xdmoon@redhat.com> @@ -96,8 +97,8 @@ import org.apache.log4j.Logger; */ class ItemLifecycleSelectForm extends BaseForm { - private static final Logger s_log = - Logger.getLogger(ItemLifecycleSelectForm.class); + private static final Logger s_log + = Logger.getLogger(ItemLifecycleSelectForm.class); private final static String LIFECYCLE = "lifecycle"; private final static String START_DATE = "start_date"; private final static String END_DATE = "end_date"; @@ -157,7 +158,7 @@ class ItemLifecycleSelectForm extends BaseForm { m_startHour.setSize(3); m_startHour.addValidationListener( - new NumberInRangeValidationListener(1, 12)); + new NumberInRangeValidationListener(1, 12)); // Minute m_startMinute = new TextField(new IntegerParameter("start_minute")); @@ -165,7 +166,7 @@ class ItemLifecycleSelectForm extends BaseForm { m_startMinute.setSize(3); m_startMinute.addValidationListener(new NumberInRangeValidationListener( - 0, 59)); + 0, 59)); // AM/PM m_startAmpm = new SingleSelect(new IntegerParameter("start_ampm")); @@ -202,7 +203,7 @@ class ItemLifecycleSelectForm extends BaseForm { m_endHour.setSize(3); m_endHour.addValidationListener(new NumberInRangeValidationListener(1, - 12)); + 12)); // Minute m_endMinute = new TextField(new IntegerParameter("end_minute")); @@ -210,7 +211,7 @@ class ItemLifecycleSelectForm extends BaseForm { m_endMinute.setSize(3); m_endMinute.addValidationListener( - new NumberInRangeValidationListener(0, 59)); + new NumberInRangeValidationListener(0, 59)); // AM/PM m_endAmpm = new SingleSelect(new IntegerParameter("end_ampm")); @@ -228,10 +229,10 @@ class ItemLifecycleSelectForm extends BaseForm { SimpleContainer cont = new SimpleContainer(); cont.add(m_notificationDays); cont.add(new Label(GlobalizationUtil.globalize("cms.ui.item.days"), - false)); + false)); cont.add(m_notificationHours); cont.add(new Label(GlobalizationUtil.globalize("cms.ui.item.hours"), - false)); + false)); addField(gz("cms.ui.item.notification_period"), cont); @@ -267,7 +268,7 @@ class ItemLifecycleSelectForm extends BaseForm { // ready to be applied to an item. if (!pdc.isEmpty()) { target.addOption(new Option(ld.getID().toString(), - ld.getLabel())); + ld.getLabel())); } pdc.close(); @@ -291,14 +292,14 @@ class ItemLifecycleSelectForm extends BaseForm { // associated lifecycle. final LifecycleDefinition ld = item.getLifecycle(). - getLifecycleDefinition(); + getLifecycleDefinition(); m_cycleSelect.setValue(state, ld.getID()); } else { // Set the default lifecycle (if it exists). final ContentSection section = CMS.getContext().getContentSection(); final LifecycleDefinition ld = ContentTypeLifecycleDefinition. - getLifecycleDefinition(section, item.getContentType()); + getLifecycleDefinition(section, item.getContentType()); if (ld != null) { m_cycleSelect.setValue(state, ld.getID()); @@ -308,7 +309,7 @@ class ItemLifecycleSelectForm extends BaseForm { // Set the default start date. // XXX Isn't just new Date() sufficient? final java.util.Date start = new java.util.Date(System. - currentTimeMillis()); + currentTimeMillis()); m_startDate.setValue(state, start); final Calendar calendar = Calendar.getInstance(); @@ -321,7 +322,7 @@ class ItemLifecycleSelectForm extends BaseForm { m_startHour.setValue(state, new Integer(12)); } else { m_startHour.setValue(state, new Integer(calendar.get( - Calendar.HOUR))); + Calendar.HOUR))); } final Integer min = new Integer(calendar.get(Calendar.MINUTE)); @@ -333,16 +334,16 @@ class ItemLifecycleSelectForm extends BaseForm { } m_startAmpm.setValue(state, - new Integer(calendar.get(Calendar.AM_PM))); + new Integer(calendar.get(Calendar.AM_PM))); BigInteger[] defaultTime = BigInteger.valueOf(ContentSection.getConfig(). - getDefaultNotificationTime()). - divideAndRemainder(BigInteger.valueOf(24)); + getDefaultNotificationTime()). + divideAndRemainder(BigInteger.valueOf(24)); m_notificationDays.setValue(state, new Integer(defaultTime[0]. - intValue())); + intValue())); m_notificationHours.setValue(state, new Integer(defaultTime[1]. - intValue())); + intValue())); } } @@ -359,7 +360,7 @@ class ItemLifecycleSelectForm extends BaseForm { @Override public final void process(final FormSectionEvent e) - throws FormProcessException { + throws FormProcessException { final PageState state = e.getPageState(); final ContentItem item = m_item.getContentItem(state); @@ -380,41 +381,41 @@ class ItemLifecycleSelectForm extends BaseForm { @Override public void uncaughtException(final Thread thread, - final Throwable ex) { + final Throwable ex) { final StringWriter strWriter = new StringWriter(); final PrintWriter writer = new PrintWriter(strWriter); ex.printStackTrace(writer); PublishLock.getInstance().setError(item, strWriter.toString()); s_log.error(String.format( - "An error occurred while " - + "publishing the item '%s': ", - item.getOID().toString()), - ex); + "An error occurred while " + + "publishing the item '%s': ", + item.getOID().toString()), + ex); if ((CMSConfig.getInstanceOf().getPublicationFailureSender() - == null) - && (CMSConfig.getInstanceOf(). + == null) + && (CMSConfig.getInstanceOf(). getPublicationFailureReceiver() == null)) { return; } final PartyCollection receiverParties = Party. - retrieveAllParties(); + retrieveAllParties(); Party receiver = null; receiverParties.addEqualsFilter("primaryEmail", - CMSConfig.getInstanceOf(). - getPublicationFailureReceiver()); + CMSConfig.getInstanceOf(). + getPublicationFailureReceiver()); if (receiverParties.next()) { receiver = receiverParties.getParty(); } receiverParties.close(); final PartyCollection senderParties = Party. - retrieveAllParties(); + retrieveAllParties(); Party sender = null; senderParties.addEqualsFilter("primaryEmail", CMSConfig. - getInstanceOf().getPublicationFailureReceiver()); + getInstanceOf().getPublicationFailureReceiver()); if (senderParties.next()) { sender = senderParties.getParty(); } @@ -423,20 +424,20 @@ class ItemLifecycleSelectForm extends BaseForm { if ((sender != null) && (receiver != null)) { final Writer traceWriter = new StringWriter(); final PrintWriter printWriter = new PrintWriter( - traceWriter); + traceWriter); ex.printStackTrace(printWriter); final Notification notification = new Notification( - sender, - receiver, - String.format("Failed to publish item '%s'", - item.getOID().toString()), - String.format("Publishing item '%s' failed " - + "with error message: %s.\n\n" - + "Stacktrace:\n%s", - item.getOID().toString(), - ex.getMessage(), - traceWriter.toString())); + sender, + receiver, + String.format("Failed to publish item '%s'", + item.getOID().toString()), + String.format("Publishing item '%s' failed " + + "with error message: %s.\n\n" + + "Stacktrace:\n%s", + item.getOID().toString(), + ex.getMessage(), + traceWriter.toString())); notification.save(); } } @@ -449,16 +450,16 @@ class ItemLifecycleSelectForm extends BaseForm { if (CMSConfig.getInstanceOf().getThreadedPublishing()) { throw new RedirectSignal( - URL.getDispatcherPath() - + ContentItemPage.getItemURL(item, - ContentItemPage.PUBLISHING_TAB), - true); + URL.getDispatcherPath() + + ContentItemPage.getItemURL(item, + ContentItemPage.PUBLISHING_TAB), + true); } else { if (ContentSection.getConfig().getUseStreamlinedCreation()) { throw new RedirectSignal( - URL.there(state.getRequest(), - ContentCenter.getURL()), - true); + URL.there(state.getRequest(), + ContentCenter.getURL()), + true); } } @@ -642,7 +643,7 @@ class ItemLifecycleSelectForm extends BaseForm { start.set(Calendar.AM_PM, startAmpm.intValue()); if (startHour.intValue() != 12) { start.set(Calendar.HOUR_OF_DAY, - 12 * startAmpm.intValue() + startHour.intValue()); + 12 * startAmpm.intValue() + startHour.intValue()); start.set(Calendar.HOUR, startHour.intValue()); } else { if (startAmpm.intValue() == 0) { @@ -704,7 +705,7 @@ class ItemLifecycleSelectForm extends BaseForm { */ final OID oid = OID.valueOf(oidStr); final ContentItem item = (ContentItem) DomainObjectFactory. - newInstance(oid); + newInstance(oid); // If the item is already published, remove the current lifecycle. // Do not touch the live version. @@ -765,13 +766,13 @@ class ItemLifecycleSelectForm extends BaseForm { notificationDate = computeNotificationDate(endOfCycle, notificationPeriod); s_log.debug("adding custom phase"); Phase expirationImminentPhase = lifecycle.addCustomPhase("expirationImminent", - new Long( - notificationDate. - getTime()), - new Long(endOfCycle. - getTime())); + new Long( + notificationDate. + getTime()), + new Long(endOfCycle. + getTime())); expirationImminentPhase.setListenerClassName( - "com.arsdigita.cms.lifecycle.NotifyLifecycleListener"); + "com.arsdigita.cms.lifecycle.NotifyLifecycleListener"); expirationImminentPhase.save(); } } @@ -785,7 +786,7 @@ class ItemLifecycleSelectForm extends BaseForm { if (workflowOid != null) { final Workflow workflow = (Workflow) DomainObjectFactory.newInstance(OID. - valueOf(workflowOid)); + valueOf(workflowOid)); try { finish(workflow, item, user); } catch (TaskException ex) { @@ -797,13 +798,13 @@ class ItemLifecycleSelectForm extends BaseForm { } static void finish(Workflow workflow, ContentItem item, User user) throws - TaskException { + TaskException { if ((workflow != null) && (user != null)) { final Engine engine = Engine.getInstance(CMSEngine.CMS_ENGINE_TYPE); // ; final Iterator iter = engine.getEnabledTasks(user, workflow.getID()). - iterator(); + iterator(); while (iter.hasNext()) { final CMSTask task = (CMSTask) iter.next(); @@ -840,8 +841,8 @@ class ItemLifecycleSelectForm extends BaseForm { final Integer startHour = (Integer) m_startHour.getValue(state); if (startHour == null) { - throw new FormProcessException(lz( - "cms.ui.item.start_time_incomplete")); + throw new FormProcessException(GlobalizationUtil.globalize( + "cms.ui.item.start_time_incomplete")); } Integer startMinute = (Integer) m_startMinute.getValue(state); @@ -852,10 +853,10 @@ class ItemLifecycleSelectForm extends BaseForm { Integer startAmpm = (Integer) m_startAmpm.getValue(state); java.util.Date startDate = (java.util.Date) m_startDate.getValue( - state); + state); if (startDate == null) { - throw new FormProcessException(lz( - "cms.ui.item.lifecycle.start_date_invalid")); + throw new FormProcessException(GlobalizationUtil.globalize( + "cms.ui.item.lifecycle.start_date_invalid")); } java.util.Date nowDate = new java.util.Date(System.currentTimeMillis()); @@ -867,7 +868,7 @@ class ItemLifecycleSelectForm extends BaseForm { if (startHour.intValue() != 12) { cStart.set(Calendar.HOUR_OF_DAY, - 12 * startAmpm.intValue() + startHour.intValue()); + 12 * startAmpm.intValue() + startHour.intValue()); cStart.set(Calendar.HOUR, startHour.intValue()); } else { if (startAmpm.intValue() == 0) { @@ -887,8 +888,8 @@ class ItemLifecycleSelectForm extends BaseForm { cStart.set(Calendar.MILLISECOND, cNow.get(Calendar.MILLISECOND)); if (cNow.after(cStart)) { - throw new FormProcessException(lz( - "cms.ui.item.lifecycle.start_date_in_past")); + throw new FormProcessException(GlobalizationUtil.globalize( + "cms.ui.item.lifecycle.start_date_in_past")); } Integer endHour = (Integer) m_endHour.getValue(state); @@ -896,8 +897,8 @@ class ItemLifecycleSelectForm extends BaseForm { java.util.Date endDate = (java.util.Date) m_endDate.getValue(state); if (endHour == null && (endMinute != null || endDate != null)) { - throw new FormProcessException(lz( - "cms.ui.item.lifecycle.end_time_incomplete")); + throw new FormProcessException(GlobalizationUtil.globalize( + "cms.ui.item.lifecycle.end_time_incomplete")); } if (endMinute == null && endHour != null) { @@ -909,8 +910,8 @@ class ItemLifecycleSelectForm extends BaseForm { Integer endAmpm = (Integer) m_endAmpm.getValue(state); if (endDate == null && !timeBlank) { - throw new FormProcessException(lz( - "cms.ui.item.lifecycle.end_date_invalid")); + throw new FormProcessException(GlobalizationUtil.globalize( + "cms.ui.item.lifecycle.end_date_invalid")); } if (endDate != null) { @@ -919,7 +920,7 @@ class ItemLifecycleSelectForm extends BaseForm { if (endHour.intValue() != 12) { cEnd.set(Calendar.HOUR_OF_DAY, - 12 * endAmpm.intValue() + endHour.intValue()); + 12 * endAmpm.intValue() + endHour.intValue()); cEnd.set(Calendar.HOUR, endHour.intValue()); } else { if (endAmpm.intValue() == 0) { @@ -940,8 +941,8 @@ class ItemLifecycleSelectForm extends BaseForm { //check if the end date is prior to the start date if (cStart.after(cEnd)) { - throw new FormProcessException(lz( - "cms.ui.item.lifecycle.end_date_before_start_date")); + throw new FormProcessException(GlobalizationUtil.globalize( + "cms.ui.item.lifecycle.end_date_before_start_date")); } Integer notificationDays = (Integer) m_notificationDays.getValue(state); @@ -958,17 +959,14 @@ class ItemLifecycleSelectForm extends BaseForm { if (notificationPeriod > 0) { // point in time for notification == end date - notificationPeriod java.util.Date notificationDate = computeNotificationDate(cEnd.getTime(), - notificationPeriod); + notificationPeriod); s_log.debug("cStart (Date): " + cStart.getTime()); s_log.debug("notificationDate: " + notificationDate); // complain if date for notification is before the start date if (notificationDate.before(cStart.getTime())) { s_log.debug("notification date is before start date!"); - String errorMessage = (String) GlobalizationUtil. - globalize( - "cms.ui.item.notification_period_before_start"). - localize(); - throw new FormProcessException(errorMessage); + + throw new FormProcessException(GlobalizationUtil.globalize("cms.ui.item.notification_period_before_start")); } else { s_log.debug("notification date is after start date, OK"); } @@ -995,7 +993,7 @@ class ItemLifecycleSelectForm extends BaseForm { } final String zone = mStart.getTimeZone().getDisplayName(true, - TimeZone.SHORT); + TimeZone.SHORT); target.setLabel(zone); } @@ -1009,18 +1007,18 @@ class ItemLifecycleSelectForm extends BaseForm { * is unpublished) and the notification period. * * @param endDate the endDate of the lifecycle, i.e. the date when the item - * is going to be unpublished + * is going to be unpublished * @param notification how many hours the users shouls be notified in - * advance + * advance */ private java.util.Date computeNotificationDate(java.util.Date endDate, - int notificationPeriod) { + int notificationPeriod) { if (endDate == null) { return null; } return new java.util.Date(endDate.getTime() - (long) notificationPeriod - * 3600000L); + * 3600000L); } } diff --git a/ccm-cms/src/com/arsdigita/cms/ui/templates/TemplateBody.java b/ccm-cms/src/com/arsdigita/cms/ui/templates/TemplateBody.java index eb7aaa3d5..dba223db5 100755 --- a/ccm-cms/src/com/arsdigita/cms/ui/templates/TemplateBody.java +++ b/ccm-cms/src/com/arsdigita/cms/ui/templates/TemplateBody.java @@ -27,7 +27,6 @@ import com.arsdigita.bebop.event.ActionEvent; import com.arsdigita.bebop.event.ActionListener; import com.arsdigita.bebop.event.FormSectionEvent; import com.arsdigita.bebop.FormProcessException; -import com.arsdigita.bebop.form.SingleSelect; import com.arsdigita.bebop.form.TextArea; import com.arsdigita.bebop.form.Option; import com.arsdigita.bebop.form.SingleSelect; @@ -65,12 +64,12 @@ public class TemplateBody extends TextAssetBody { /** * Construct a new TemplateBody component * - * @param itemModel The {@link ItemSelectionModel} which will - * be responsible for loading the current template + * @param itemModel The {@link ItemSelectionModel} which will be responsible + * for loading the current template * - * @param parent The parent wizard which contains the form. The form - * may use the wizard's methods, such as stepForward and stepBack, - * in its process listener. + * @param parent The parent wizard which contains the form. The form may use + * the wizard's methods, such as stepForward and stepBack, in its process + * listener. */ public TemplateBody(ItemSelectionModel itemModel, AuthoringKitWizard parent) { super(itemModel); @@ -78,27 +77,27 @@ public class TemplateBody extends TextAssetBody { // Reset the component when it is hidden parent.getList().addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - PageState state = e.getPageState(); - reset(state); - } - }); + public void actionPerformed(ActionEvent e) { + PageState state = e.getPageState(); + reset(state); + } + }); // Set the right component access on the forms - // FIXME: Update this for templating permissions ! Component f = getComponent(FILE_UPLOAD); if (f != null) { setComponentAccess(FILE_UPLOAD, - new WorkflowLockedComponentAccess(f, itemModel)); + new WorkflowLockedComponentAccess(f, itemModel)); } Component t = getComponent(TEXT_ENTRY); setComponentAccess(TEXT_ENTRY, - new WorkflowLockedComponentAccess(t, itemModel)); + new WorkflowLockedComponentAccess(t, itemModel)); } protected DomainObjectPropertySheet getBodyPropertySheet(ItemSelectionModel assetModel) { - TextAssetBodyPropertySheet sheet = - new TextAssetBodyPropertySheet(assetModel); + TextAssetBodyPropertySheet sheet + = new TextAssetBodyPropertySheet(assetModel); sheet.getColumn(1).setCellRenderer(new TemplateLabelCellRenderer()); return sheet; } @@ -114,8 +113,8 @@ public class TemplateBody extends TextAssetBody { } /** - * Set additional parameters of a brand new text asset, such as the - * parent ID, after the asset has been successfully uploaded + * Set additional parameters of a brand new text asset, such as the parent + * ID, after the asset has been successfully uploaded * * @param s the current page state * @param a the new TextAsset @@ -126,15 +125,15 @@ public class TemplateBody extends TextAssetBody { /** * Adds the options for the mime type select widget - **/ + * + */ protected void setMimeTypeOptions(SingleSelect mimeSelect) { - Map mimeTypes = Template.SUPPORTED_MIME_TYPES; + Map mimeTypes = Template.SUPPORTED_MIME_TYPES; Iterator keys = mimeTypes.keySet().iterator(); while (keys.hasNext()) { - String key = (String)keys.next(); - mimeSelect.addOption - (new Option(key, - new Label((GlobalizedMessage)mimeTypes.get(key)))); + String key = (String) keys.next(); + mimeSelect.addOption(new Option(key, + new Label((GlobalizedMessage) mimeTypes.get(key)))); } } @@ -144,7 +143,7 @@ public class TemplateBody extends TextAssetBody { s_log.debug("Adding text widgets to " + c); } - ColumnPanel panel = (ColumnPanel)c.getPanel(); + ColumnPanel panel = (ColumnPanel) c.getPanel(); panel.setBorder(false); panel.setPadColor("#FFFFFF"); panel.setColumnWidth(1, "20%"); @@ -161,7 +160,7 @@ public class TemplateBody extends TextAssetBody { mime.setClassAttr("displayOneOptionAsLabel"); c.add(new Label(GlobalizationUtil.globalize("cms.ui.authoring.edit_body_text")), - ColumnPanel.LEFT | ColumnPanel.FULL_WIDTH); + ColumnPanel.LEFT | ColumnPanel.FULL_WIDTH); final TextArea text = new TextArea(PageTextForm.TEXT_ENTRY); c.add(text, ColumnPanel.LEFT | ColumnPanel.FULL_WIDTH); @@ -187,20 +186,17 @@ public class TemplateBody extends TextAssetBody { mimeWidget.clearOptions(); setMimeTypeOptions(mimeWidget); mimeWidget.setDefaultValue(FileUploadSection.GUESS_MIME); - mimeWidget.addOption - (new Option(FileUploadSection.GUESS_MIME, new Label - (GlobalizationUtil.globalize - ("cms.ui.authoring.file_upload.auto_detect")))); + mimeWidget.addOption(new Option(FileUploadSection.GUESS_MIME, new Label(GlobalizationUtil.globalize("cms.ui.authoring.file_upload.auto_detect")))); } /** - * This is the form that is used to upload files. This method can - * be used so that a subclass can use their own subclass of PageFileForm. + * This is the form that is used to upload files. This method can be used so + * that a subclass can use their own subclass of PageFileForm. */ protected PageFileForm getPageFileForm() { return new TemplateFileForm(); } - + protected String getDefaultMimeType() { return Template.JSP_MIME_TYPE; } @@ -220,9 +216,7 @@ public class TemplateBody extends TextAssetBody { String mimeType = mime.getMimeType(); if (!Template.SUPPORTED_MIME_TYPES.keySet().contains(mimeType)) { - throw new FormProcessException - ("The mime type " + mimeType + "is not one of the " + - "supported Template Mime Types"); + throw new FormProcessException(GlobalizationUtil.globalize("cms.ui.template_not_supportet")); } if (Template.XSL_MIME_TYPE.equals(mimeType)) { @@ -230,9 +224,8 @@ public class TemplateBody extends TextAssetBody { try { new Document(content); } catch (Exception ex) { - throw new FormProcessException - ("The uploaded file is not properly formatted XML: " + - ex.getMessage()); + throw new FormProcessException(GlobalizationUtil.globalize("cms.ui.uploaded_file_not_properly_formatted" + + ex.getMessage())); } } } @@ -241,23 +234,22 @@ public class TemplateBody extends TextAssetBody { protected class TemplateLabelCellRenderer extends TextAssetBodyLabelCellRenderer { public Component getComponent(Table table, PageState state, Object value, - boolean isSelected, Object key, - int row, int column) { + boolean isSelected, Object key, + int row, int column) { Label label = null; - if (MIME_TYPE_KEY.equals(key) && - value instanceof TextAsset) { - MimeType type = ((TextAsset)value).getMimeType(); + if (MIME_TYPE_KEY.equals(key) + && value instanceof TextAsset) { + MimeType type = ((TextAsset) value).getMimeType(); if (type != null) { - GlobalizedMessage mimeTypeMessage = - (GlobalizedMessage)Template.SUPPORTED_MIME_TYPES.get - (type.getMimeType()); + GlobalizedMessage mimeTypeMessage + = (GlobalizedMessage) Template.SUPPORTED_MIME_TYPES.get(type.getMimeType()); if (mimeTypeMessage != null) { return new Label(mimeTypeMessage, false); - } + } } - } - return super.getComponent(table, state, value, isSelected, - key, row, column); + } + return super.getComponent(table, state, value, isSelected, + key, row, column); } } diff --git a/ccm-cms/src/com/arsdigita/cms/ui/type/ElementAddForm.java b/ccm-cms/src/com/arsdigita/cms/ui/type/ElementAddForm.java index 9c9d7c2eb..3a5176e5c 100755 --- a/ccm-cms/src/com/arsdigita/cms/ui/type/ElementAddForm.java +++ b/ccm-cms/src/com/arsdigita/cms/ui/type/ElementAddForm.java @@ -290,8 +290,7 @@ public abstract class ElementAddForm extends CMSForm { if ( dot.hasProperty(label) ) { throw new FormProcessException - ("A property named \"" + label.toLowerCase() + - "\" already exists."); + (GlobalizationUtil.globalize("cms.ui.property_already_exist" + label.toLowerCase())); } doValidate(event); @@ -326,7 +325,7 @@ public abstract class ElementAddForm extends CMSForm { private final class SubmissionListener implements FormSubmissionListener { public void submitted(FormSectionEvent e) throws FormProcessException { if (m_cancel.isSelected(e.getPageState())) { - throw new FormProcessException("cancelled"); + throw new FormProcessException(GlobalizationUtil.globalize("cms.ui.cancelled")); } } } diff --git a/ccm-cms/src/com/arsdigita/cms/ui/workflow/TaskAddUser.java b/ccm-cms/src/com/arsdigita/cms/ui/workflow/TaskAddUser.java index bcbbb51ad..fd3231c85 100755 --- a/ccm-cms/src/com/arsdigita/cms/ui/workflow/TaskAddUser.java +++ b/ccm-cms/src/com/arsdigita/cms/ui/workflow/TaskAddUser.java @@ -148,7 +148,7 @@ class TaskAddUser extends SimpleContainer { if (users == null) { throw new FormProcessException - (lz("cms.ui.workflow.no_users_were_selected")); + ((GlobalizationUtil.globalize("cms.ui.workflow.no_users_were_selected")); } else { // Add each checked user to the task.