diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/ContentGroupPropertiesStep.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/ContentGroupPropertiesStep.java index 9cf33c85c..d62f8ad6a 100755 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/ContentGroupPropertiesStep.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/ContentGroupPropertiesStep.java @@ -72,7 +72,8 @@ public abstract class ContentGroupPropertiesStep extends SimpleEditStep { */ public Component getPropertySheet(ItemSelectionModel itemModel) { GridPanel panel = new GridPanel(2); - panel.add(new Label(GlobalizationUtil.globalize("cms.contenttypes.ui.content_group_name"))); + panel.add(new Label(GlobalizationUtil + .globalize("cms.contenttypes.ui.content_group_name"))); panel.add(new Label(new PrintListener() { public void prepare(PrintEvent e) { Label label = (Label)e.getTarget(); @@ -82,7 +83,9 @@ public abstract class ContentGroupPropertiesStep extends SimpleEditStep { ContentGroup group = item.getContentGroup(getMainAttributeName()); if (group == null) { - label.setLabel("None", e.getPageState()); + label.setLabel(GlobalizationUtil.globalize( + "cms.contenttypes.ui.content_group_name"), + e.getPageState()); label.setFontWeight(Label.ITALIC); } else { label.setLabel(group.getName(), e.getPageState()); diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/ContentGroupPropertyForm.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/ContentGroupPropertyForm.java index cd5c44dc0..5ff2067d4 100755 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/ContentGroupPropertyForm.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/ContentGroupPropertyForm.java @@ -78,13 +78,15 @@ public class ContentGroupPropertyForm extends BasicItemForm { * Adds widgets to the form. */ protected void addWidgets() { - add(new Label(GlobalizationUtil.globalize("cms.contenttypes.ui.content_group_name"))); + add(new Label(GlobalizationUtil + .globalize("cms.contenttypes.ui.content_group_name"))); TextField nameWidget = new TextField(new TrimmedStringParameter(ContentGroup.NAME)); nameWidget.addValidationListener(new NotNullValidationListener()); add(nameWidget); - add(new Label(GlobalizationUtil.globalize("cms.contenttypes.ui.content_group_current_items")) { + add(new Label(GlobalizationUtil + .globalize("cms.contenttypes.ui.content_group_current_items")) { public boolean isVisible(PageState state) { ContentGroupContainer item = (ContentGroupContainer) getItemSelectionModel() @@ -106,7 +108,8 @@ public class ContentGroupPropertyForm extends BasicItemForm { }; add(m_checkboxGroup); - add(new Label(GlobalizationUtil.globalize("cms.contenttypes.ui.content_group_new_item"))); + add(new Label(GlobalizationUtil + .globalize("cms.contenttypes.ui.content_group_new_item"))); try { add(new ItemSearchWidget(RELATED_ITEM, getSearchContentType())); } catch (DataObjectNotFoundException de) { diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericArticlePropertyForm.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericArticlePropertyForm.java index 278a4863e..057b56614 100755 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericArticlePropertyForm.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericArticlePropertyForm.java @@ -56,7 +56,8 @@ public class GenericArticlePropertyForm extends BasicPageForm * GenericArticle to work on * @param step The GenericArticlePropertiesStep which controls this form. */ - public GenericArticlePropertyForm(ItemSelectionModel itemModel, GenericArticlePropertiesStep step) { + public GenericArticlePropertyForm(ItemSelectionModel itemModel, + GenericArticlePropertiesStep step) { super(ID, itemModel); m_step = step; addSubmissionListener(this); diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactAddressPropertiesStep.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactAddressPropertiesStep.java index 65d63017b..458929b92 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactAddressPropertiesStep.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactAddressPropertiesStep.java @@ -91,26 +91,26 @@ public class GenericContactAddressPropertiesStep extends SimpleEditStep { DomainObjectPropertySheet sheet = new DomainObjectPropertySheet( itemModel); - sheet.add((String) ContenttypesGlobalizationUtil.globalize( - "cms.contenttypes.ui.address.address").localize(), + sheet.add(ContenttypesGlobalizationUtil.globalize( + "cms.contenttypes.ui.address.address"), "address." + GenericAddress.ADDRESS); if (!GenericContact.getConfig().getHideAddressPostalCode()) { - sheet.add((String) ContenttypesGlobalizationUtil.globalize( - "cms.contenttypes.ui.address.postal_code").localize(), + sheet.add(ContenttypesGlobalizationUtil.globalize( + "cms.contenttypes.ui.address.postal_code"), "address." + GenericAddress.POSTAL_CODE); } - sheet.add((String) ContenttypesGlobalizationUtil.globalize( - "cms.contenttypes.ui.address.city").localize(), + sheet.add(ContenttypesGlobalizationUtil.globalize( + "cms.contenttypes.ui.address.city"), "address." + GenericAddress.CITY); if (!GenericContact.getConfig().getHideAddressState()) { - sheet.add((String) ContenttypesGlobalizationUtil.globalize( - "cms.contenttypes.ui.address.state").localize(), + sheet.add(ContenttypesGlobalizationUtil.globalize( + "cms.contenttypes.ui.address.state"), "address." + GenericAddress.STATE); } if (!GenericContact.getConfig().getHideAddressCountry()) { - sheet.add((String) ContenttypesGlobalizationUtil.globalize( - "cms.contenttypes.ui.address.iso_country_code").localize(), + sheet.add(ContenttypesGlobalizationUtil.globalize( + "cms.contenttypes.ui.address.iso_country_code"), "address." + GenericAddress.ISO_COUNTRY_CODE, new DomainObjectPropertySheet.AttributeFormatter() { @@ -138,11 +138,12 @@ public class GenericContactAddressPropertiesStep extends SimpleEditStep { public static Component getEmptyBaseAddressPropertySheet( ItemSelectionModel itemModel) { return new Label( - ((String) ContenttypesGlobalizationUtil.globalize( - "cms.contenttypes.ui.contact.emptyAddress").localize())); + (ContenttypesGlobalizationUtil.globalize( + "cms.contenttypes.ui.contact.emptyAddress"))); } - private class EditAddressWorkflowLockedComponentAccess extends WorkflowLockedComponentAccess { + private class EditAddressWorkflowLockedComponentAccess + extends WorkflowLockedComponentAccess { public EditAddressWorkflowLockedComponentAccess(Component c, ItemSelectionModel i) { diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactAttachAddressPropertyForm.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactAttachAddressPropertyForm.java index 1384c8650..f745d1c23 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactAttachAddressPropertyForm.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactAttachAddressPropertyForm.java @@ -72,8 +72,8 @@ public class GenericContactAttachAddressPropertyForm extends BasicPageForm @Override public void addWidgets() { - add(new Label((String) ContenttypesGlobalizationUtil.globalize( - "cms.contenttypes.ui.contact.select_address").localize())); + add(new Label(ContenttypesGlobalizationUtil.globalize( + "cms.contenttypes.ui.contact.select_address"))); this.m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType. findByAssociatedObjectType( "com.arsdigita.cms.contenttypes.GenericAddress")); @@ -130,15 +130,13 @@ public class GenericContactAttachAddressPropertyForm extends BasicPageForm Submit target = (Submit) e.getTarget(); if (contact.getAddress() != null) { - target.setButtonLabel((String) ContenttypesGlobalizationUtil. + target.setButtonLabel(ContenttypesGlobalizationUtil. globalize( - "cms.contenttypes.ui.contact.select_address.change"). - localize()); + "cms.contenttypes.ui.contact.select_address.change")); } else { - target.setButtonLabel((String) ContenttypesGlobalizationUtil. + target.setButtonLabel(ContenttypesGlobalizationUtil. globalize( - "cms.contenttypes.ui.contact.select_address.add"). - localize()); + "cms.contenttypes.ui.contact.select_address.add")); } } }); diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactAttachPersonPropertyForm.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactAttachPersonPropertyForm.java index 8d7cec2ec..c1ae77692 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactAttachPersonPropertyForm.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactAttachPersonPropertyForm.java @@ -82,8 +82,8 @@ public class GenericContactAttachPersonPropertyForm extends BasicPageForm @Override public void addWidgets() { - add(new Label((String) ContenttypesGlobalizationUtil.globalize( - "cms.contenttypes.ui.contact.select_person").localize())); + add(new Label(ContenttypesGlobalizationUtil.globalize( + "cms.contenttypes.ui.contact.select_person"))); this.m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType. findByAssociatedObjectType( "com.arsdigita.cms.contenttypes.GenericPerson")); @@ -97,8 +97,8 @@ public class GenericContactAttachPersonPropertyForm extends BasicPageForm SingleSelect contactType = new SingleSelect(contactTypeParam); contactType.addValidationListener(new NotNullValidationListener()); contactType.addOption(new Option("", - new Label((String) ContenttypesGlobalizationUtil. - globalize("cms.ui.select_one").localize()))); + new Label(ContenttypesGlobalizationUtil + .globalize("cms.ui.select_one")))); // Add the Options to the SingleSelect widget GenericContactTypeCollection contacttypes = @@ -160,15 +160,13 @@ public class GenericContactAttachPersonPropertyForm extends BasicPageForm Submit target = (Submit) e.getTarget(); if (contact.getPerson() != null) { - target.setButtonLabel((String) ContenttypesGlobalizationUtil. + target.setButtonLabel(ContenttypesGlobalizationUtil. globalize( - "cms.contenttypes.ui.contact.select_person.change"). - localize()); + "cms.contenttypes.ui.contact.select_person.change")); } else { - target.setButtonLabel((String) ContenttypesGlobalizationUtil. + target.setButtonLabel(ContenttypesGlobalizationUtil. globalize( - "cms.contenttypes.ui.contact.select_person.add"). - localize()); + "cms.contenttypes.ui.contact.select_person.add")); } } }); diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactDeleteAddressForm.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactDeleteAddressForm.java index 8cc3398f9..0a8feb8f6 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactDeleteAddressForm.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactDeleteAddressForm.java @@ -43,7 +43,8 @@ public class GenericContactDeleteAddressForm extends BasicPageForm implements Fo @Override public void addWidgets() { - add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.delete_address.label").localize())); + add(new Label(ContenttypesGlobalizationUtil + .globalize("cms.contenttypes.ui.contact.delete_address.label"))); } /** @@ -55,9 +56,13 @@ public class GenericContactDeleteAddressForm extends BasicPageForm implements Fo getSaveCancelSection().getSaveButton().addPrintListener(new PrintListener() { public void prepare(PrintEvent e) { - GenericContact contact = (GenericContact) getItemSelectionModel().getSelectedObject(e.getPageState()); + GenericContact contact = (GenericContact) + getItemSelectionModel() + .getSelectedObject(e.getPageState()); Submit target = (Submit) e.getTarget(); - target.setButtonLabel((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.delete_address.button_label").localize()); + target.setButtonLabel(ContenttypesGlobalizationUtil + .globalize( + "cms.contenttypes.ui.contact.delete_address.button_label")); } }); } catch (Exception ex) { @@ -68,7 +73,8 @@ public class GenericContactDeleteAddressForm extends BasicPageForm implements Fo public final void process(final FormSectionEvent fse) throws FormProcessException { final PageState state = fse.getPageState(); - final GenericContact contact = (GenericContact) getItemSelectionModel().getSelectedObject(state); + final GenericContact contact = (GenericContact) getItemSelectionModel() + .getSelectedObject(state); if (contact != null && contact.getAddress() != null) { contact.unsetAddress(); diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactDeletePersonForm.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactDeletePersonForm.java index 6e7b7b933..3d68a2d24 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactDeletePersonForm.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactDeletePersonForm.java @@ -27,14 +27,16 @@ import com.arsdigita.util.UncheckedWrapperException; * * @author quasi */ -public class GenericContactDeletePersonForm extends BasicPageForm implements FormProcessListener { +public class GenericContactDeletePersonForm extends BasicPageForm + implements FormProcessListener { /** * ID of the form */ public static final String ID = "ContactDeletePerson"; - GenericContactDeletePersonForm(ItemSelectionModel itemModel, GenericContactPersonPropertiesStep step) { + GenericContactDeletePersonForm(ItemSelectionModel itemModel, + GenericContactPersonPropertiesStep step) { super(ID, itemModel); addSaveCancelSection(); } @@ -45,7 +47,8 @@ public class GenericContactDeletePersonForm extends BasicPageForm implements For @Override public void addWidgets() { - add(new Label((String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.delete_person.label").localize())); + add(new Label(ContenttypesGlobalizationUtil + .globalize("cms.contenttypes.ui.contact.delete_person.label"))); } /** @@ -54,12 +57,16 @@ public class GenericContactDeletePersonForm extends BasicPageForm implements For @Override public void addSaveCancelSection() { try { - getSaveCancelSection().getSaveButton().addPrintListener(new PrintListener() { + getSaveCancelSection().getSaveButton() + .addPrintListener(new PrintListener() { public void prepare(PrintEvent e) { - GenericContact contact = (GenericContact)getItemSelectionModel().getSelectedObject(e.getPageState()); + GenericContact contact = (GenericContact) + getItemSelectionModel() + .getSelectedObject(e.getPageState()); Submit target = (Submit) e.getTarget(); - target.setButtonLabel((String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.delete_person").localize()); + target.setButtonLabel(ContenttypesGlobalizationUtil + .globalize("cms.contenttypes.ui.contact.delete_person")); } }); } catch (Exception ex) { @@ -70,7 +77,8 @@ public class GenericContactDeletePersonForm extends BasicPageForm implements For public final void process(final FormSectionEvent fse) throws FormProcessException { final PageState state = fse.getPageState(); - final GenericContact contact = (GenericContact)getItemSelectionModel().getSelectedObject(state); + final GenericContact contact = (GenericContact)getItemSelectionModel() + .getSelectedObject(state); if (contact != null && contact.getPerson() != null) { contact.unsetPerson(); diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactEditAddressPropertyForm.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactEditAddressPropertyForm.java index 507160730..fed3831eb 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactEditAddressPropertyForm.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactEditAddressPropertyForm.java @@ -78,7 +78,8 @@ public class GenericContactEditAddressPropertyForm extends BasicPageForm impleme @Override public void addWidgets() { - add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.address").localize())); + add(new Label(ContenttypesGlobalizationUtil + .globalize("cms.contenttypes.ui.address.address"))); ParameterModel addressParam = new StringParameter(ADDRESS); addressParam.addParameterListener(new NotNullValidationListener()); addressParam.addParameterListener(new StringInRangeValidationListener(0, 1000)); @@ -88,33 +89,40 @@ public class GenericContactEditAddressPropertyForm extends BasicPageForm impleme add(address); if (!GenericContact.getConfig().getHideAddressPostalCode()) { - add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.postal_code").localize())); + add(new Label(ContenttypesGlobalizationUtil + .globalize("cms.contenttypes.ui.address.postal_code"))); ParameterModel postalCodeParam = new StringParameter(POSTAL_CODE); TextField postalCode = new TextField(postalCodeParam); /* XXX NumberListener ?*/ add(postalCode); } - add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.city").localize())); + add(new Label(ContenttypesGlobalizationUtil + .globalize("cms.contenttypes.ui.address.city"))); ParameterModel cityParam = new StringParameter(CITY); TextField city = new TextField(cityParam); add(city); if (!GenericContact.getConfig().getHideAddressState()) { - add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.state").localize())); + add(new Label(ContenttypesGlobalizationUtil + .globalize("cms.contenttypes.ui.address.state"))); ParameterModel stateParam = new StringParameter(STATE); TextField state = new TextField(stateParam); add(state); } if (!GenericContact.getConfig().getHideAddressCountry()) { - add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.iso_country_code").localize())); + add(new Label(ContenttypesGlobalizationUtil + .globalize("cms.contenttypes.ui.address.iso_country_code"))); ParameterModel countryParam = new StringParameter(ISO_COUNTRY_CODE); countryParam.addParameterListener(new StringInRangeValidationListener(0, 2)); SingleSelect country = new SingleSelect(countryParam); - country.addOption(new Option("", new Label((String) ContenttypesGlobalizationUtil.globalize("cms.ui.select_one").localize()))); + country.addOption(new + Option("", + new Label(ContenttypesGlobalizationUtil + .globalize("cms.ui.select_one")))); Iterator countries = GenericAddress.getSortedListOfCountries(null).entrySet().iterator(); while (countries.hasNext()) { @@ -126,14 +134,16 @@ public class GenericContactEditAddressPropertyForm extends BasicPageForm impleme new ParameterListener() { @Override - public void validate(ParameterEvent e) throws FormProcessException { - ParameterData data = e.getParameterData(); - String isoCode = (String) data.getValue(); - if (isoCode == null || isoCode.length() == 0) { - data.addError((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.error_iso_country").localize()); - } - } - }); + public void validate(ParameterEvent e) throws FormProcessException { + ParameterData data = e.getParameterData(); + String isoCode = (String) data.getValue(); + if (isoCode == null || isoCode.length() == 0) { + data.addError((String) ContenttypesGlobalizationUtil + .globalize("cms.contenttypes.ui.address.error_iso_country") + .localize()); + } + } + }); add(country); } diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactEditPersonPropertyForm.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactEditPersonPropertyForm.java index 5a651fb32..8043148c6 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactEditPersonPropertyForm.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactEditPersonPropertyForm.java @@ -65,12 +65,14 @@ public class GenericContactEditPersonPropertyForm extends BasicPageForm implemen } /** - * Constrctor taking an ItemSelectionModel and an instance of ContactPropertiesStep. + * Constructor taking an ItemSelectionModel and an instance of + * ContactPropertiesStep. * * @param itemModel * @param step */ - public GenericContactEditPersonPropertyForm(ItemSelectionModel itemModel, GenericContactPersonPropertiesStep step) { + public GenericContactEditPersonPropertyForm(ItemSelectionModel itemModel, + GenericContactPersonPropertiesStep step) { super(ID, itemModel); m_step = step; addSubmissionListener(this); @@ -78,42 +80,51 @@ public class GenericContactEditPersonPropertyForm extends BasicPageForm implemen @Override public void addWidgets() { - add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.surname").localize())); + add(new Label(ContenttypesGlobalizationUtil + .globalize("cms.contenttypes.ui.person.surname"))); ParameterModel surnameParam = new StringParameter(SURNAME); surnameParam.addParameterListener(new NotNullValidationListener()); surnameParam.addParameterListener(new StringInRangeValidationListener(0, 1000)); TextField surname = new TextField(surnameParam); add(surname); - add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.givenname").localize())); + add(new Label(ContenttypesGlobalizationUtil + .globalize("cms.contenttypes.ui.person.givenname"))); ParameterModel givennameParam = new StringParameter(GIVENNAME); givennameParam.addParameterListener(new NotNullValidationListener()); givennameParam.addParameterListener(new StringInRangeValidationListener(0, 1000)); TextField givenname = new TextField(givennameParam); add(givenname); - add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.titlepre").localize())); + add(new Label(ContenttypesGlobalizationUtil + .globalize("cms.contenttypes.ui.person.titlepre"))); ParameterModel titlepreParam = new StringParameter(TITLEPRE); titlepreParam.addParameterListener(new StringInRangeValidationListener(0, 1000)); TextField titlepre = new TextField(titlepreParam); add(titlepre); - add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.titlepost").localize())); + add(new Label(ContenttypesGlobalizationUtil + .globalize("cms.contenttypes.ui.person.titlepost"))); ParameterModel titlepostParam = new StringParameter(TITLEPOST); titlepostParam.addParameterListener(new StringInRangeValidationListener(0, 1000)); TextField titlepost = new TextField(titlepostParam); add(titlepost); // GenericContact type field - add(new Label(ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.contact.type"))); + add(new Label(ContenttypesGlobalizationUtil + .globalize("cms.contenttypes.ui.person.contact.type"))); ParameterModel contactTypeParam = new StringParameter(CONTACTS_KEY); SingleSelect contactType = new SingleSelect(contactTypeParam); contactType.addValidationListener(new NotNullValidationListener()); - contactType.addOption(new Option("", new Label((String) ContenttypesGlobalizationUtil.globalize("cms.ui.select_one").localize()))); + contactType.addOption(new + Option("", + new Label(ContenttypesGlobalizationUtil + .globalize("cms.ui.select_one")))); // Add the Options to the SingleSelect widget GenericContactTypeCollection contacttypes = new GenericContactTypeCollection(); - contacttypes.addLanguageFilter(GlobalizationHelper.getNegotiatedLocale().getLanguage()); + contacttypes.addLanguageFilter(GlobalizationHelper + .getNegotiatedLocale().getLanguage()); while (contacttypes.next()) { RelationAttribute ct = contacttypes.getRelationAttribute(); @@ -126,7 +137,8 @@ public class GenericContactEditPersonPropertyForm extends BasicPageForm implemen public void init(FormSectionEvent fse) { FormData data = fse.getFormData(); PageState state = fse.getPageState(); - GenericContact contact = (GenericContact) getItemSelectionModel().getSelectedObject(state); + GenericContact contact = (GenericContact) getItemSelectionModel() + .getSelectedObject(state); if (contact.getPerson() != null) { data.put(SURNAME, contact.getPerson().getSurname()); @@ -147,7 +159,8 @@ public class GenericContactEditPersonPropertyForm extends BasicPageForm implemen public void process(FormSectionEvent fse) { FormData data = fse.getFormData(); PageState state = fse.getPageState(); - GenericContact contact = (GenericContact) getItemSelectionModel().getSelectedObject(state); + GenericContact contact = (GenericContact) getItemSelectionModel() + .getSelectedObject(state); if (getSaveCancelSection().getSaveButton().isSelected(fse.getPageState())) { diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactEntriesPropertiesStep.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactEntriesPropertiesStep.java index f3f124643..6c4b36dfd 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactEntriesPropertiesStep.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactEntriesPropertiesStep.java @@ -38,15 +38,35 @@ public class GenericContactEntriesPropertiesStep extends SimpleEditStep { /** The name of the editing sheet added to this step */ private static String ADD_CONTACT_ENTRY_SHEET_NAME = "addContactEntry"; - public GenericContactEntriesPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent) { + /** + * + * @param itemModel + * @param parent + */ + public GenericContactEntriesPropertiesStep(ItemSelectionModel itemModel, + AuthoringKitWizard parent) { this(itemModel, parent, null); } - public GenericContactEntriesPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent, String prefix) { + /** + * + * @param itemModel + * @param parent + * @param prefix + */ + public GenericContactEntriesPropertiesStep(ItemSelectionModel itemModel, + AuthoringKitWizard parent, + String prefix) { super(itemModel, parent, prefix); BasicItemForm addContactEntrySheet = new GenericContactEntryAddForm(itemModel); - add(ADD_CONTACT_ENTRY_SHEET_NAME, (String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.add_contactEntry").localize(), new WorkflowLockedComponentAccess(addContactEntrySheet, itemModel), addContactEntrySheet.getSaveCancelSection().getCancelButton()); + add(ADD_CONTACT_ENTRY_SHEET_NAME, + (String)ContenttypesGlobalizationUtil + .globalize("cms.contenttypes.ui.contact.add_contactEntry") + .localize(), + new WorkflowLockedComponentAccess(addContactEntrySheet, + itemModel), + addContactEntrySheet.getSaveCancelSection().getCancelButton()); GenericContactEntriesTable contactEntriesTable = new GenericContactEntriesTable(itemModel); setDisplayComponent(contactEntriesTable); diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactEntriesTable.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactEntriesTable.java index c7c980201..3aeca3be9 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactEntriesTable.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactEntriesTable.java @@ -63,14 +63,34 @@ public class GenericContactEntriesTable extends Table implements TableActionList this.m_itemModel = itemModel; // if table is empty: - setEmptyView(new Label(ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.contactEntry.none"))); + setEmptyView(new Label(ContenttypesGlobalizationUtil + .globalize("cms.contenttypes.ui.contact.contactEntry.none"))); TableColumnModel tab_model = getColumnModel(); // define columns - tab_model.add(new TableColumn(0, ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.contactEntry.key").localize(), TABLE_COL_EDIT)); - tab_model.add(new TableColumn(1, ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.contactEntry.value").localize())); - tab_model.add(new TableColumn(2, ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.contactEntry.description").localize())); - tab_model.add(new TableColumn(3, ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.contactEntry.action").localize(), TABLE_COL_DEL)); + tab_model.add(new TableColumn( + 0, + ContenttypesGlobalizationUtil.globalize( + "cms.contenttypes.ui.contact.contactEntry.key") + , + TABLE_COL_EDIT)); + tab_model.add(new TableColumn( + 1, + ContenttypesGlobalizationUtil.globalize( + "cms.contenttypes.ui.contact.contactEntry.value") + + )); + tab_model.add(new TableColumn( + 2, + ContenttypesGlobalizationUtil.globalize( + "cms.contenttypes.ui.contact.contactEntry.description") + .localize())); + tab_model.add(new TableColumn( + 3, + ContenttypesGlobalizationUtil.globalize( + "cms.contenttypes.ui.contact.contactEntry.action") + .localize(), + TABLE_COL_DEL)); setModelBuilder(new ContactTableModelBuilder(itemModel)); @@ -85,7 +105,8 @@ public class GenericContactEntriesTable extends Table implements TableActionList * XXXX * */ - private class ContactTableModelBuilder extends LockableImpl implements TableModelBuilder { + private class ContactTableModelBuilder extends LockableImpl + implements TableModelBuilder { private ItemSelectionModel m_itemModel; @@ -97,7 +118,8 @@ public class GenericContactEntriesTable extends Table implements TableActionList table.getRowSelectionModel().clearSelection(state); - GenericContact contact = (GenericContact) m_itemModel.getSelectedObject(state); + GenericContact contact = (GenericContact) + m_itemModel.getSelectedObject(state); return new ContactTableModel(table, state, contact); } } @@ -148,8 +170,11 @@ public class GenericContactEntriesTable extends Table implements TableActionList public Object getElementAt(int columnIndex) { switch (columnIndex) { case 0: - GenericContactEntryKeys keys = new GenericContactEntryKeys(m_contactEntry.getKey()); - keys.addLanguageFilter(GlobalizationHelper.getNegotiatedLocale().getLanguage()); + GenericContactEntryKeys keys = new + GenericContactEntryKeys(m_contactEntry.getKey()); + keys.addLanguageFilter( + GlobalizationHelper.getNegotiatedLocale() + .getLanguage()); if (keys.next()) { Object key = keys.getName(); @@ -162,11 +187,15 @@ public class GenericContactEntriesTable extends Table implements TableActionList case 1: return m_contactEntry.getValue(); case 2: - return (m_contactEntry.getDescription() != null && m_contactEntry.getDescription().length() > MAX_DESC_LENGTH) - ? m_contactEntry.getDescription().substring(0, MAX_DESC_LENGTH) + return (m_contactEntry.getDescription() != null + && m_contactEntry.getDescription().length() > + MAX_DESC_LENGTH) + ? m_contactEntry.getDescription().substring( + 0, MAX_DESC_LENGTH) : m_contactEntry.getDescription(); case 3: - return GlobalizationUtil.globalize("cms.ui.delete").localize(); + // return GlobalizationUtil.globalize("cms.ui.delete").localize(); + return GlobalizationUtil.globalize("cms.ui.delete"); default: return null; } @@ -210,21 +239,25 @@ public class GenericContactEntriesTable extends Table implements TableActionList * Check for the permissions to delete item and put either a Label or * a ControlLink accordingly. */ - private class DeleteCellRenderer extends LockableImpl implements TableCellRenderer { + private class DeleteCellRenderer extends LockableImpl + implements TableCellRenderer { public Component getComponent(Table table, PageState state, Object value, boolean isSelected, Object key, int row, int column) { SecurityManager sm = Utilities.getSecurityManager(state); - GenericContact contact = (GenericContact) m_itemModel.getSelectedObject(state); + GenericContact contact = (GenericContact) + m_itemModel.getSelectedObject(state); boolean canDelete = sm.canAccess(state.getRequest(), SecurityManager.DELETE_ITEM, contact); if (canDelete) { ControlLink link = new ControlLink(value.toString()); - link.setConfirmation((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.confirm_delete").localize()); + link.setConfirmation( + ContenttypesGlobalizationUtil + .globalize("cms.contenttypes.ui.contact.confirm_delete")); return link; } else { return new Label(value.toString()); diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactEntryAddForm.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactEntryAddForm.java index caef3133a..e0f319465 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactEntryAddForm.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactEntryAddForm.java @@ -58,7 +58,8 @@ public class GenericContactEntryAddForm extends BasicItemForm { protected void addWidgets() { // Key field - add(new Label(ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.contactEntry.key"))); + add(new Label(ContenttypesGlobalizationUtil + .globalize("cms.contenttypes.ui.contact.contactEntry.key"))); ParameterModel contactEntryKeyParam = new StringParameter(GenericContactEntry.KEY); SingleSelect contactEntryKey = new SingleSelect(contactEntryKeyParam); contactEntryKey.addValidationListener(new NotNullValidationListener()); @@ -75,14 +76,16 @@ public class GenericContactEntryAddForm extends BasicItemForm { add(contactEntryKey); // Value field - add(new Label(ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.contactEntry.value"))); + add(new Label(ContenttypesGlobalizationUtil + .globalize("cms.contenttypes.ui.contact.contactEntry.value"))); ParameterModel contactEntryValueParam = new StringParameter(GenericContactEntry.VALUE); TextField contactEntryValue = new TextField(contactEntryValueParam); contactEntryValue.addValidationListener(new NotNullValidationListener()); add(contactEntryValue); // Description field, only for internal usage - add(new Label(ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.contactEntry.description"))); + add(new Label(ContenttypesGlobalizationUtil + .globalize("cms.contenttypes.ui.contact.contactEntry.description"))); ParameterModel contactEntryDescriptionParam = new StringParameter(GenericContactEntry.DESCRIPTION); TextField contactEntryDescription = new TextField(contactEntryDescriptionParam); add(contactEntryDescription); diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactPersonPropertiesStep.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactPersonPropertiesStep.java index d3c6d00fe..ffe5f30d7 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactPersonPropertiesStep.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactPersonPropertiesStep.java @@ -34,16 +34,25 @@ public class GenericContactPersonPropertiesStep extends SimpleEditStep { /** * Creates a new instance of GenericContactPersonPropertiesStep */ - public GenericContactPersonPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent) { + public GenericContactPersonPropertiesStep(ItemSelectionModel itemModel, + AuthoringKitWizard parent) { this(itemModel, parent, ""); } - public GenericContactPersonPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent, String prefix) { + public GenericContactPersonPropertiesStep(ItemSelectionModel itemModel, + AuthoringKitWizard parent, + String prefix) { super(itemModel, parent, prefix); - BasicPageForm addPersonSheet = new GenericContactAttachPersonPropertyForm(itemModel, this); + BasicPageForm addPersonSheet = new + GenericContactAttachPersonPropertyForm(itemModel, this); addPerson = new WorkflowLockedComponentAccess(addPersonSheet, itemModel); - add(ADD_PERSON_SHEET_NAME, (String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.attach_person").localize(), addPerson, addPersonSheet.getSaveCancelSection().getCancelButton()); + add(ADD_PERSON_SHEET_NAME, + (String) ContenttypesGlobalizationUtil + .globalize("cms.contenttypes.ui.contact.attach_person") + .localize(), + addPerson, + addPersonSheet.getSaveCancelSection().getCancelButton()); /* Set the displayComponent for this step */ setDisplayComponent(getPersonPropertySheet(itemModel)); diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactPersonSheet.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactPersonSheet.java index b64492411..1ba6a0057 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactPersonSheet.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactPersonSheet.java @@ -67,7 +67,8 @@ public class GenericContactPersonSheet colModel.add(new TableColumn( 0, ContenttypesGlobalizationUtil.globalize( - "cms.contenttypes.ui.contact.person").localize(), + // "cms.contenttypes.ui.contact.person").localize(), + "cms.contenttypes.ui.contact.person"), TABLE_COL_EDIT)); colModel.add(new TableColumn( 1, @@ -97,7 +98,8 @@ public class GenericContactPersonSheet @Override public TableModel makeModel(Table table, PageState state) { table.getRowSelectionModel().clearSelection(state); - GenericContact contact = (GenericContact) m_itemModel.getSelectedObject(state); + GenericContact contact = (GenericContact) + m_itemModel.getSelectedObject(state); return new GenericContactPersonSheetModel(table, state, contact); @@ -145,8 +147,9 @@ public class GenericContactPersonSheet return m_person.getFullName(); case 1: return ContenttypesGlobalizationUtil.globalize( - "cms.contenttypes.ui.contact.delete_person"). - localize(); + "cms.contenttypes.ui.contact.delete_person") + // .localize(); + ; default: return null; } @@ -170,8 +173,10 @@ public class GenericContactPersonSheet int row, int column) { - com.arsdigita.cms.SecurityManager securityManager = Utilities.getSecurityManager(state); - GenericContact contact = (GenericContact) m_itemModel.getSelectedObject(state); + com.arsdigita.cms.SecurityManager securityManager = + Utilities.getSecurityManager(state); + GenericContact contact = (GenericContact) + m_itemModel.getSelectedObject(state); boolean canEdit = securityManager.canAccess( state.getRequest(), @@ -190,7 +195,11 @@ public class GenericContactPersonSheet ContentSection section = person.getContentSection();//CMS.getContext().getContentSection(); ItemResolver resolver = section.getItemResolver(); - return new Link(value.toString(), resolver.generateItemURL(state, person, section, person.getVersion())); + return new Link(value.toString(), + resolver.generateItemURL(state, + person, + section, + person.getVersion())); } else { @@ -224,10 +233,10 @@ public class GenericContactPersonSheet if (canEdit) { ControlLink link = new ControlLink(value.toString()); - link.setConfirmation((String) ContenttypesGlobalizationUtil.globalize( + link.setConfirmation(ContenttypesGlobalizationUtil.globalize( "cms.contenttypes.ui.contact.person" - + ".confirm_remove"). - localize()); + + ".confirm_remove") + ); return link; } else { Label label = new Label(value.toString()); diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactPropertiesStep.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactPropertiesStep.java index f13a7795d..f3a4da47a 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactPropertiesStep.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactPropertiesStep.java @@ -25,7 +25,8 @@ import org.apache.log4j.Logger; */ public class GenericContactPropertiesStep extends SimpleEditStep { - private static final Logger logger = Logger.getLogger(GenericContactPropertiesStep.class); + private static final Logger logger = Logger.getLogger( + GenericContactPropertiesStep.class); /** * Name of the this edit sheet (Don't know if this this really needed. * It has the same value in almost all PropertiesStep classes) @@ -38,7 +39,8 @@ public class GenericContactPropertiesStep extends SimpleEditStep { * @param itemModel * @param parent */ - public GenericContactPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent) { + public GenericContactPropertiesStep(ItemSelectionModel itemModel, + AuthoringKitWizard parent) { super(itemModel, parent); setDefaultEditKey(EDIT_BASIC_SHEET_NAME); @@ -48,42 +50,75 @@ public class GenericContactPropertiesStep extends SimpleEditStep { setDisplayComponent(segmentedPanel); } - protected SegmentedPanel createEditSheet(ItemSelectionModel itemModel, AuthoringKitWizard parent) { + /** + * + * @param itemModel + * @param parent + * @return + */ + protected SegmentedPanel createEditSheet(ItemSelectionModel itemModel, + AuthoringKitWizard parent) { /* Use a Segmented Panel for the multiple parts of data */ SegmentedPanel segmentedPanel = new SegmentedPanel(); - /* The different parts of information are displayed in seperated segments each containing a SimpleEditStep */ + /* The different parts of information are displayed in seperated + * segments each containing a SimpleEditStep */ /* Well, not so simple anymore... */ /* A new SimpleEditStep */ - SimpleEditStep basicProperties = new SimpleEditStep(itemModel, parent, EDIT_BASIC_SHEET_NAME); + SimpleEditStep basicProperties = new SimpleEditStep(itemModel, + parent, + EDIT_BASIC_SHEET_NAME); /* Create the edit component for this SimpleEditStep and the corresponding link */ BasicPageForm editBasicSheet = new GenericContactPropertyForm(itemModel, this); - basicProperties.add(EDIT_BASIC_SHEET_NAME, (String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.edit_basic_properties").localize(), new WorkflowLockedComponentAccess(editBasicSheet, itemModel), editBasicSheet.getSaveCancelSection().getCancelButton()); + basicProperties.add( + EDIT_BASIC_SHEET_NAME, + (String) ContenttypesGlobalizationUtil + .globalize("cms.contenttypes.ui.contact.edit_basic_properties") + .localize(), + new WorkflowLockedComponentAccess( + editBasicSheet, + itemModel), + editBasicSheet.getSaveCancelSection().getCancelButton()); /* Set the displayComponent for this step */ basicProperties.setDisplayComponent(getContactPropertySheet(itemModel)); /* Add the SimpleEditStep to the segmented panel */ - segmentedPanel.addSegment(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.basic_properties").localize()), basicProperties); + segmentedPanel + .addSegment(new Label(ContenttypesGlobalizationUtil + .globalize("cms.contenttypes.ui.contact.basic_properties")), + basicProperties); // If not disabled via registry, add the ui for attaching a person if (!GenericContact.getConfig().getHidePerson()) { - GenericContactPersonPropertiesStep personProperties = new GenericContactPersonPropertiesStep(itemModel, parent); - segmentedPanel.addSegment(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.person").localize()), personProperties); + GenericContactPersonPropertiesStep personProperties = new + GenericContactPersonPropertiesStep(itemModel, parent); + segmentedPanel + .addSegment(new Label(ContenttypesGlobalizationUtil + .globalize("cms.contenttypes.ui.contact.person")), + personProperties); } if (!GenericContact.getConfig().getHideAddress()) { - GenericContactAddressPropertiesStep addressProperties = new GenericContactAddressPropertiesStep(itemModel, parent); - segmentedPanel.addSegment(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.address").localize()), addressProperties); + GenericContactAddressPropertiesStep addressProperties = new + GenericContactAddressPropertiesStep(itemModel, parent); + segmentedPanel + .addSegment(new Label(ContenttypesGlobalizationUtil + .globalize("cms.contenttypes.ui.contact.address")), + addressProperties); } - GenericContactEntriesPropertiesStep contactEntries = new GenericContactEntriesPropertiesStep(itemModel, parent); - segmentedPanel.addSegment(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.contactEntry").localize()), contactEntries); + GenericContactEntriesPropertiesStep contactEntries = new + GenericContactEntriesPropertiesStep(itemModel, parent); + segmentedPanel + .addSegment(new Label(ContenttypesGlobalizationUtil + .globalize("cms.contenttypes.ui.contact.contactEntry")), + contactEntries); return segmentedPanel; } @@ -105,7 +140,10 @@ public class GenericContactPropertiesStep extends SimpleEditStep { sheet.add(GlobalizationUtil.globalize("cms.contenttypes.ui.title"), "title"); if (!ContentSection.getConfig().getHideLaunchDate()) { - sheet.add(GlobalizationUtil.globalize("cms.ui.authoring.page_launch_date"), ContentPage.LAUNCH_DATE, new DomainObjectPropertySheet.AttributeFormatter() { + + sheet.add(GlobalizationUtil.globalize("cms.ui.authoring.page_launch_date"), + ContentPage.LAUNCH_DATE, + new DomainObjectPropertySheet.AttributeFormatter() { public String format(DomainObject obj, String attribute, PageState state) { ContentPage page = (ContentPage) obj; diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactPropertyForm.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactPropertyForm.java index 0e4cc8475..96c3d44ce 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactPropertyForm.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactPropertyForm.java @@ -15,9 +15,13 @@ import org.apache.log4j.Logger; /** * Form for editing the basic properties of a basic contact. */ -public class GenericContactPropertyForm extends BasicPageForm implements FormProcessListener, FormInitListener, FormSubmissionListener { +public class GenericContactPropertyForm extends BasicPageForm + implements FormProcessListener, + FormInitListener, + FormSubmissionListener { - private static final Logger logger = Logger.getLogger(GenericContactPropertyForm.class); + private static final Logger logger = Logger.getLogger( + GenericContactPropertyForm.class); private GenericContactPropertiesStep m_step; @@ -40,23 +44,30 @@ public class GenericContactPropertyForm extends BasicPageForm implements FormPro } /** - * Constrctor taking an ItemSelectionModel and an instance of BaseContactPropertiesStep. + * Constructor taking an ItemSelectionModel and an instance of + * BaseContactPropertiesStep. * * @param itemModel * @param step */ - public GenericContactPropertyForm(ItemSelectionModel itemModel, GenericContactPropertiesStep step) { + public GenericContactPropertyForm(ItemSelectionModel itemModel, + GenericContactPropertiesStep step) { super(ID, itemModel); m_step = step; addSubmissionListener(this); } + /** + * + */ @Override public void addWidgets() { super.addWidgets(); /* - add(new Label((String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.contact.basic_properties.description").localize()))); + add(new Label(BaseContactGlobalizationUtil.globalize( + "cms.contenttypes.ui.contact.basic_properties.description") + ))); TextArea description = new TextArea(DESCRIPTION); description.setRows(5); description.setCols(30); @@ -78,9 +89,9 @@ public class GenericContactPropertyForm extends BasicPageForm implements FormPro GenericContact contact = (GenericContact)super.processBasicWidgets(e); - if((contact != null) && (getSaveCancelSection().getSaveButton().isSelected(e.getPageState()))) { + if((contact != null) + && (getSaveCancelSection().getSaveButton().isSelected(e.getPageState()))) { // contact.setDescription((String)data.get(DESCRIPTION)); - contact.save(); } @@ -90,7 +101,8 @@ public class GenericContactPropertyForm extends BasicPageForm implements FormPro } public void submitted(FormSectionEvent e) throws FormProcessException { - if((m_step != null) && (getSaveCancelSection().getCancelButton().isSelected(e.getPageState()))) { + if((m_step != null) + && (getSaveCancelSection().getCancelButton().isSelected(e.getPageState()))) { m_step.cancelStreamlinedCreation(e.getPageState()); } } diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactTypeAddForm.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactTypeAddForm.java index b10ddaab3..6385b784f 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactTypeAddForm.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactTypeAddForm.java @@ -52,10 +52,12 @@ import org.apache.log4j.Logger; */ public class GenericContactTypeAddForm extends BasicItemForm { + private static final Logger s_log = Logger.getLogger( + GenericContactTypeAddForm.class); + public final static String KEY = RelationAttribute.KEY; public final static String LANGUAGE = RelationAttribute.LANGUAGE; public final static String NAME = RelationAttribute.NAME; - private static final Logger s_log = Logger.getLogger(GenericContactTypeAddForm.class); private GenericPersonPropertiesStep m_step; private SaveCancelSection m_saveCancelSection; private ItemSelectionModel m_itemModel; @@ -72,7 +74,8 @@ public class GenericContactTypeAddForm extends BasicItemForm { @Override protected void addWidgets() { // Key - add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contacttypes.key").localize())); + add(new Label(ContenttypesGlobalizationUtil + .globalize("cms.contenttypes.ui.contacttypes.key"))); ParameterModel keyParam = new StringParameter(KEY); keyParam.addParameterListener(new NotNullValidationListener()); keyParam.addParameterListener(new StringInRangeValidationListener(0, 1000)); @@ -80,14 +83,16 @@ public class GenericContactTypeAddForm extends BasicItemForm { add(key); // Language - add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contacttypes.language").localize())); + add(new Label(ContenttypesGlobalizationUtil + .globalize("cms.contenttypes.ui.contacttypes.language"))); ParameterModel languageParam = new StringParameter(LANGUAGE); language = new SingleSelect(languageParam); language.addValidationListener(new NotNullValidationListener()); language.addOption(new Option("", new Label((String) ContenttypesGlobalizationUtil.globalize("cms.ui.select_one").localize()))); // Name - add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contacttypes.name").localize())); + add(new Label(ContenttypesGlobalizationUtil + .globalize("cms.contenttypes.ui.contacttypes.name"))); ParameterModel nameParam = new StringParameter(NAME); nameParam.addParameterListener(new NotNullValidationListener()); nameParam.addParameterListener(new StringInRangeValidationListener(0, 1000)); @@ -100,8 +105,11 @@ public class GenericContactTypeAddForm extends BasicItemForm { public void init(FormSectionEvent fse) { FormData data = fse.getFormData(); PageState state = fse.getPageState(); - RelationAttribute contacttype = (RelationAttribute) getItemSelectionModel().getSelectedObject(state); - GenericContactTypeCollection contacttypeCollection = new GenericContactTypeCollection(contacttype.getKey()); + RelationAttribute contacttype = (RelationAttribute) + getItemSelectionModel() + .getSelectedObject(state); + GenericContactTypeCollection contacttypeCollection = new + GenericContactTypeCollection(contacttype.getKey()); // all supported languages (by registry entry) KernelConfig kernelConfig = Kernel.getConfig(); @@ -113,7 +121,10 @@ public class GenericContactTypeAddForm extends BasicItemForm { // If lanuage exists, remove it from the selection list if (!contacttypeCollection.hasLanguage(code)) { - language.addOption(new Option(code, new Locale(code).getDisplayLanguage()), state); + language.addOption(new + Option(code, + new Locale(code).getDisplayLanguage()), + state); } } @@ -127,7 +138,9 @@ public class GenericContactTypeAddForm extends BasicItemForm { public void process(FormSectionEvent fse) { FormData data = fse.getFormData(); PageState state = fse.getPageState(); - RelationAttribute contacttype = (RelationAttribute) getItemSelectionModel().getSelectedObject(state); + RelationAttribute contacttype = (RelationAttribute) + getItemSelectionModel() + .getSelectedObject(state); // if (!this.getSaveCancelSection().getCancelButton().isSelected(state)) { diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactTypePropertiesStep.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactTypePropertiesStep.java index 8bba7243e..e6e0d7a54 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactTypePropertiesStep.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactTypePropertiesStep.java @@ -33,20 +33,25 @@ public class GenericContactTypePropertiesStep extends SimpleEditStep { /** The name of the editing sheet added to this step */ private static String ADD_CONTACT_SHEET_NAME = "addContactType"; - public GenericContactTypePropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent) { + public GenericContactTypePropertiesStep(ItemSelectionModel itemModel, + AuthoringKitWizard parent) { this(itemModel, parent, null); } - public GenericContactTypePropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent, String prefix) { + public GenericContactTypePropertiesStep(ItemSelectionModel itemModel, + AuthoringKitWizard parent, + String prefix) { super(itemModel, parent, prefix); BasicItemForm addContactTypeSheet = new GenericContactTypeAddForm(itemModel); add(ADD_CONTACT_SHEET_NAME, - (String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.add_contacttype").localize(), + (String) ContenttypesGlobalizationUtil.globalize( + "cms.contenttypes.ui.person.add_contacttype").localize(), new WorkflowLockedComponentAccess(addContactTypeSheet, itemModel), addContactTypeSheet.getSaveCancelSection().getCancelButton()); - GenericContactTypeTable contacttypesTable = new GenericContactTypeTable(itemModel); + GenericContactTypeTable contacttypesTable = new + GenericContactTypeTable(itemModel); setDisplayComponent(contacttypesTable); } diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactTypeTable.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactTypeTable.java index dd0070df1..19119ca20 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactTypeTable.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactTypeTable.java @@ -64,9 +64,26 @@ public class GenericContactTypeTable extends Table implements TableActionListene TableColumnModel tab_model = getColumnModel(); // define columns - tab_model.add(new TableColumn(0, ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contacttypes.key").localize(), TABLE_COL_EDIT)); - tab_model.add(new TableColumn(1, ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contacttypes.title").localize())); - tab_model.add(new TableColumn(2, ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contacttypes.action").localize(), TABLE_COL_DEL)); + tab_model.add(new TableColumn( + 0, + ContenttypesGlobalizationUtil + .globalize("cms.contenttypes.ui.contacttypes.key") + // .localize() + , + TABLE_COL_EDIT)); + tab_model.add(new TableColumn( + 1, + ContenttypesGlobalizationUtil + .globalize("cms.contenttypes.ui.contacttypes.title") + //.localize() + )); + tab_model.add(new TableColumn( + 2, + ContenttypesGlobalizationUtil + .globalize("cms.contenttypes.ui.contacttypes.action") + .localize() + , + TABLE_COL_DEL)); setModelBuilder(new GenericContactTypeTableModelBuilder(itemModel)); @@ -81,7 +98,8 @@ public class GenericContactTypeTable extends Table implements TableActionListene * XXXX * */ - private class GenericContactTypeTableModelBuilder extends LockableImpl implements TableModelBuilder { + private class GenericContactTypeTableModelBuilder extends LockableImpl + implements TableModelBuilder { private ItemSelectionModel m_itemModel; @@ -105,12 +123,16 @@ public class GenericContactTypeTable extends Table implements TableActionListene final private int MAX_DESC_LENGTH = 25; private Table m_table; private RelationAttribute m_contacttype; - private GenericContactTypeCollection m_contacttypeCollection = new GenericContactTypeCollection(); + private GenericContactTypeCollection m_contacttypeCollection = new + GenericContactTypeCollection(); - private GenericContactTypeTableModel(Table t, PageState ps, RelationAttribute contacttype) { + private GenericContactTypeTableModel(Table t, + PageState ps, + RelationAttribute contacttype) { m_table = t; m_contacttype = contacttype; -// m_contacttypeCollection.addLanguageFilter(DispatcherHelper.getNegotiatedLocale().getLanguage()); +// m_contacttypeCollection.addLanguageFilter( +// DispatcherHelper.getNegotiatedLocale().getLanguage()); } public int getColumnCount() { @@ -147,7 +169,9 @@ public class GenericContactTypeTable extends Table implements TableActionListene case 1: return m_contacttypeCollection.getName(); case 2: - return GlobalizationUtil.globalize("cms.ui.delete").localize(); + return GlobalizationUtil.globalize("cms.ui.delete") + //.localize() + ; default: return null; } @@ -173,7 +197,8 @@ public class GenericContactTypeTable extends Table implements TableActionListene int row, int column) { SecurityManager sm = Utilities.getSecurityManager(state); - RelationAttribute contacttype = (RelationAttribute) m_itemModel.getSelectedObject(state); + RelationAttribute contacttype = (RelationAttribute) + m_itemModel.getSelectedObject(state); // boolean canEdit = sm.canAccess(state.getRequest(), // SecurityManager.EDIT_ITEM, @@ -198,14 +223,18 @@ public class GenericContactTypeTable extends Table implements TableActionListene int row, int column) { SecurityManager sm = Utilities.getSecurityManager(state); - RelationAttribute contacttype = (RelationAttribute) m_itemModel.getSelectedObject(state); + RelationAttribute contacttype = (RelationAttribute) + m_itemModel.getSelectedObject(state); // boolean canDelete = sm.canAccess(state.getRequest(), // SecurityManager.DELETE_ITEM, // contacttype); // if (canDelete) { ControlLink link = new ControlLink(value.toString()); - link.setConfirmation((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contacttype.confirm_delete").localize()); + link.setConfirmation(ContenttypesGlobalizationUtil + .globalize( + "cms.contenttypes.ui.contacttype.confirm_delete") + ); return link; // } else { // return new Label(value.toString()); @@ -223,7 +252,8 @@ public class GenericContactTypeTable extends Table implements TableActionListene PageState state = evt.getPageState(); // Get selected GenericContactType - RelationAttribute contacttype = new RelationAttribute(new BigDecimal(evt.getRowKey().toString())); + RelationAttribute contacttype = new RelationAttribute(new + BigDecimal(evt.getRowKey().toString())); // Get selected column TableColumn col = getColumnModel().get(evt.getColumn().intValue()); diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrgaUnitExtraXmlGenerator.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrgaUnitExtraXmlGenerator.java index 4f2e6b288..8f3ba11bd 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrgaUnitExtraXmlGenerator.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrgaUnitExtraXmlGenerator.java @@ -33,7 +33,7 @@ import org.apache.log4j.Logger; * jensp $ */ public abstract class GenericOrgaUnitExtraXmlGenerator - implements ExtraXMLGenerator { + implements ExtraXMLGenerator { private final static Logger logger = Logger.getLogger( diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrgaUnitMembersTab.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrgaUnitMembersTab.java index 79bd300f8..733ff0349 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrgaUnitMembersTab.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrgaUnitMembersTab.java @@ -151,7 +151,7 @@ public abstract class GenericOrgaUnitMembersTab implements GenericOrgaUnitTab { final List persons, final PageState state) { final GenericOrganizationalUnitSubordinateCollection subOrgaUnits = - orgaunit.getSubordinateOrgaUnits(); + orgaunit.getSubordinateOrgaUnits(); final StringBuffer assocTypeFilter = new StringBuffer(); for (String assocType : getAssocTypesToMerge()) { if (assocTypeFilter.length() > 0) { diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitContactAddForm.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitContactAddForm.java index aed4aa73c..19c122398 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitContactAddForm.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitContactAddForm.java @@ -73,8 +73,8 @@ public class GenericOrganizationalUnitContactAddForm @Override protected void addWidgets() { - add(new Label((String) ContenttypesGlobalizationUtil.globalize( - "cms.contenttypes.ui.genericorgaunit.select_contact").localize())); + add(new Label(ContenttypesGlobalizationUtil.globalize( + "cms.contenttypes.ui.genericorgaunit.select_contact"))); m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType. findByAssociatedObjectType(GenericContact.class.getName())); m_itemSearch.setDisableCreatePane(false); @@ -90,8 +90,8 @@ public class GenericOrganizationalUnitContactAddForm SingleSelect contactType = new SingleSelect(contactTypeParam); contactType.addValidationListener(new NotNullValidationListener()); contactType.addOption(new Option("", - new Label((String) ContenttypesGlobalizationUtil. - globalize("cms.ui.select_one").localize()))); + new Label(ContenttypesGlobalizationUtil. + globalize("cms.ui.select_one")))); GenericContactTypeCollection contacttypes = new GenericContactTypeCollection(); @@ -197,7 +197,7 @@ public class GenericOrganizationalUnitContactAddForm if ((editStep.getSelectedContact() == null) && (data.get(ITEM_SEARCH) == null)) { data.addError( - "cms.contenttypes.ui.genericorgaunit.select_contact.no_contact_selected"); + "cms.contenttypes.ui.genericorgaunit.select_contact.no_contact_selected"); return; } diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitContactTable.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitContactTable.java index b889d6c86..1398b20ac 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitContactTable.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitContactTable.java @@ -83,11 +83,11 @@ public class GenericOrganizationalUnitContactTable extends Table implements tabModel.add(new TableColumn( 0, ContenttypesGlobalizationUtil.globalize( - "cms.contenttypes.ui.genericorgaunit.contact.type").localize())); + "cms.contenttypes.ui.genericorgaunit.contact.type"))); tabModel.add(new TableColumn( 1, ContenttypesGlobalizationUtil.globalize( - "cms.contenttypes.ui.genericorgaunit.contact.title").localize(), + "cms.contenttypes.ui.genericorgaunit.contact.title"), TABLE_COL_EDIT)); tabModel.add(new TableColumn( 2, diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPersonAddForm.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPersonAddForm.java index 7d39afd5c..b94650dc9 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPersonAddForm.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPersonAddForm.java @@ -74,8 +74,8 @@ public class GenericOrganizationalUnitPersonAddForm @Override protected void addWidgets() { - add(new Label((String) ContenttypesGlobalizationUtil.globalize( - "cms.contenttypes.ui.genericorgaunit.select_person").localize())); + add(new Label(ContenttypesGlobalizationUtil.globalize( + "cms.contenttypes.ui.genericorgaunit.select_person"))); m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType. findByAssociatedObjectType(getPersonType())); /*m_itemSearch.getItemField().addValidationListener( @@ -95,8 +95,8 @@ public class GenericOrganizationalUnitPersonAddForm roleSelect.addValidationListener(new NotNullValidationListener()); roleSelect.addOption( new Option("", - new Label((String) ContenttypesGlobalizationUtil. - globalize("cms.ui.select_one").localize()))); + new Label(ContenttypesGlobalizationUtil + .globalize("cms.ui.select_one")))); RelationAttributeCollection roles = new RelationAttributeCollection( getRoleAttributeName()); roles.addLanguageFilter(GlobalizationHelper.getNegotiatedLocale(). @@ -116,8 +116,8 @@ public class GenericOrganizationalUnitPersonAddForm SingleSelect statusSelect = new SingleSelect(statusModel); statusSelect.addValidationListener(new NotNullValidationListener()); statusSelect.addOption(new Option("", - new Label((String) ContenttypesGlobalizationUtil. - globalize("cms.ui.select_one").localize()))); + new Label(ContenttypesGlobalizationUtil. + globalize("cms.ui.select_one")))); RelationAttributeCollection statusColl = new RelationAttributeCollection( getStatusAttributeName()); diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPersonsTable.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPersonsTable.java index f77531ff8..e1319b7a6 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPersonsTable.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPersonsTable.java @@ -70,18 +70,18 @@ public class GenericOrganizationalUnitPersonsTable extends Table implements this.personSelector = personSelector; setEmptyView(new Label(ContenttypesGlobalizationUtil.globalize( - "cms.contenttypes.ui.genericorgaunit.persons.none"))); + "cms.contenttypes.ui.genericorgaunit.persons.none"))); TableColumnModel tabModel = getColumnModel(); tabModel.add(new TableColumn( 0, ContenttypesGlobalizationUtil.globalize( - "cms.contenttypes.ui.genericorgaunit.persons.name").localize(), + "cms.contenttypes.ui.genericorgaunit.persons.name"), TABLE_COL_EDIT)); tabModel.add(new TableColumn( 1, ContenttypesGlobalizationUtil.globalize( - "cms.contenttypes.ui.genericorgaunit.persons.role").localize())); + "cms.contenttypes.ui.genericorgaunit.persons.role"))); tabModel.add( new TableColumn( 2, diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPropertiesStep.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPropertiesStep.java index d577c66b1..76eec9cb1 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPropertiesStep.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPropertiesStep.java @@ -123,9 +123,8 @@ public class GenericOrganizationalUnitPropertiesStep extends SimpleEditStep { itemModel)); segmentedPanel.addSegment( - new Label((String) ContenttypesGlobalizationUtil.globalize( - "cms.contenttypes.ui.genericorganunit.basic_properties"). - localize()), + new Label(ContenttypesGlobalizationUtil.globalize( + "cms.contenttypes.ui.genericorganunit.basic_properties")), basicProperties); } diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPropertyForm.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPropertyForm.java index 7deb485d5..7c79d8eda 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPropertyForm.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPropertyForm.java @@ -76,8 +76,8 @@ public class GenericOrganizationalUnitPropertyForm add(name);*/ add(new Label( - (String) ContenttypesGlobalizationUtil.globalize( - "cms.contenttypes.ui.genericorgaunit.addendum").localize())); + ContenttypesGlobalizationUtil.globalize( + "cms.contenttypes.ui.genericorgaunit.addendum"))); ParameterModel addendumParam = new StringParameter(ADDENDUM); TextField addendum = new TextField(addendumParam); add(addendum); diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitSuperiorOrgaUnitsTable.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitSuperiorOrgaUnitsTable.java index 2c8e0f816..5abc76b7f 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitSuperiorOrgaUnitsTable.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitSuperiorOrgaUnitsTable.java @@ -35,13 +35,10 @@ import com.arsdigita.cms.CMS; import com.arsdigita.cms.ContentSection; import com.arsdigita.cms.ItemSelectionModel; import com.arsdigita.cms.contenttypes.GenericOrganizationalUnit; -import com.arsdigita.cms.contenttypes.GenericOrganizationalUnitBundle; import com.arsdigita.cms.contenttypes.GenericOrganizationalUnitSuperiorCollection; import com.arsdigita.cms.dispatcher.ItemResolver; import com.arsdigita.cms.dispatcher.Utilities; -import com.arsdigita.domain.DomainObjectFactory; import com.arsdigita.globalization.GlobalizationHelper; -import com.arsdigita.persistence.OID; import com.arsdigita.util.LockableImpl; import java.math.BigDecimal; diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonAliasDeleteForm.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonAliasDeleteForm.java index 119840f93..4a3f9ef40 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonAliasDeleteForm.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonAliasDeleteForm.java @@ -53,8 +53,8 @@ public class GenericPersonAliasDeleteForm @Override public void addWidgets() { - add(new Label((String) ContenttypesGlobalizationUtil.globalize( - "cms.contenttypes.ui.person.alias.delete.confirm").localize())); + add(new Label(ContenttypesGlobalizationUtil.globalize( + "cms.contenttypes.ui.person.alias.delete.confirm"))); } @Override @@ -65,7 +65,8 @@ public class GenericPersonAliasDeleteForm @Override public void process(final FormSectionEvent fse) throws FormProcessException { final PageState state = fse.getPageState(); - final GenericPerson person = (GenericPerson) getItemSelectionModel().getSelectedObject(state); + final GenericPerson person = (GenericPerson) getItemSelectionModel() + .getSelectedObject(state); if ((person != null) && (person.getAlias() != null)) { person.unsetAlias(); @@ -87,10 +88,9 @@ public class GenericPersonAliasDeleteForm (GenericPerson) getItemSelectionModel(). getSelectedObject(event.getPageState()); Submit target = (Submit) event.getTarget(); - target.setButtonLabel((String) ContenttypesGlobalizationUtil. + target.setButtonLabel(ContenttypesGlobalizationUtil. globalize( - "cms.contenttypes.ui.person.alias.delete.label"). - localize()); + "cms.contenttypes.ui.person.alias.delete.label")); } }); } catch (Exception ex) { diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonAliasSetForm.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonAliasSetForm.java index 9aff309a7..a3c1c7fca 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonAliasSetForm.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonAliasSetForm.java @@ -69,8 +69,8 @@ public class GenericPersonAliasSetForm @Override public void addWidgets() { - add(new Label((String) ContenttypesGlobalizationUtil.globalize( - "cms.contenttypes.ui.person.alias.select").localize())); + add(new Label(ContenttypesGlobalizationUtil.globalize( + "cms.contenttypes.ui.person.alias.select"))); itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType. findByAssociatedObjectType( "com.arsdigita.cms.contenttypes.GenericPerson")); @@ -125,15 +125,13 @@ public class GenericPersonAliasSetForm Submit target = (Submit) event.getTarget(); if (person.getAlias() != null) { - target.setButtonLabel((String) ContenttypesGlobalizationUtil. + target.setButtonLabel(ContenttypesGlobalizationUtil. globalize( - "cms.contenttypes.ui.contact.alias.select.change"). - localize()); + "cms.contenttypes.ui.contact.alias.select.change")); } else { - target.setButtonLabel((String) ContenttypesGlobalizationUtil. + target.setButtonLabel(ContenttypesGlobalizationUtil. globalize( - "cms.contenttypes.ui.contact.alias.select.add"). - localize()); + "cms.contenttypes.ui.contact.alias.select.add")); } } }); diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonContactAddForm.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonContactAddForm.java index 95685fb25..3ea054f91 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonContactAddForm.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonContactAddForm.java @@ -76,8 +76,8 @@ public class GenericPersonContactAddForm extends BasicItemForm { protected void addWidgets() { // Attach a GenericContact object - add(new Label((String) ContenttypesGlobalizationUtil.globalize( - "cms.contenttypes.ui.person.select_contact").localize())); + add(new Label(ContenttypesGlobalizationUtil.globalize( + "cms.contenttypes.ui.person.select_contact"))); this.m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType. findByAssociatedObjectType( "com.arsdigita.cms.contenttypes.GenericContact")); @@ -92,8 +92,8 @@ public class GenericPersonContactAddForm extends BasicItemForm { SingleSelect contactType = new SingleSelect(contactTypeParam); contactType.addValidationListener(new NotNullValidationListener()); contactType.addOption(new Option("", - new Label((String) ContenttypesGlobalizationUtil. - globalize("cms.ui.select_one").localize()))); + new Label(ContenttypesGlobalizationUtil. + globalize("cms.ui.select_one")))); // Add the Options to the SingleSelect widget GenericContactTypeCollection contacttypes = diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonContactTable.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonContactTable.java index f0bf2a36f..c509cf38e 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonContactTable.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonContactTable.java @@ -305,9 +305,8 @@ public class GenericPersonContactTable extends Table implements person); if (canDelete) { ControlLink link = new ControlLink(value.toString()); - link.setConfirmation((String) ContenttypesGlobalizationUtil. - globalize("cms.contenttypes.ui.person.confirm_delete"). - localize()); + link.setConfirmation(ContenttypesGlobalizationUtil. + globalize("cms.contenttypes.ui.person.confirm_delete")); return link; } else { return new Label(value.toString()); diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonOrgaUnitsTable.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonOrgaUnitsTable.java index 1bf43d265..5c02eb2d7 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonOrgaUnitsTable.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonOrgaUnitsTable.java @@ -28,7 +28,6 @@ import com.arsdigita.bebop.table.TableColumn; import com.arsdigita.bebop.table.TableColumnModel; import com.arsdigita.bebop.table.TableModel; import com.arsdigita.bebop.table.TableModelBuilder; -import com.arsdigita.cms.CMS; import com.arsdigita.cms.ContentSection; import com.arsdigita.cms.ItemSelectionModel; import com.arsdigita.cms.contenttypes.GenericOrganizationalUnit; @@ -36,7 +35,6 @@ import com.arsdigita.cms.contenttypes.GenericOrganizationalUnitBundleCollection; import com.arsdigita.cms.contenttypes.GenericPerson; import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil; import com.arsdigita.cms.dispatcher.ItemResolver; -import com.arsdigita.domain.DomainObjectFactory; import com.arsdigita.persistence.DataCollection; import com.arsdigita.persistence.DataObject; import com.arsdigita.util.LockableImpl; @@ -59,16 +57,19 @@ public class GenericPersonOrgaUnitsTable extends Table { this.itemModel = itemModel; - setEmptyView(new Label(ContenttypesGlobalizationUtil.globalize("person.ui.orgaunits.none"))); + setEmptyView(new Label(ContenttypesGlobalizationUtil + .globalize("person.ui.orgaunits.none"))); final TableColumnModel columnModel = getColumnModel(); columnModel.add(new TableColumn( 0, - ContenttypesGlobalizationUtil.globalize("person.ui.orgaunits.columns.name").localize(), + ContenttypesGlobalizationUtil + .globalize("person.ui.orgaunits.columns.name").localize(), TABLE_COL_EDIT)); columnModel.add(new TableColumn( 2, - ContenttypesGlobalizationUtil.globalize("person.ui.orgaunits.columns.type").localize(), + ContenttypesGlobalizationUtil + .globalize("person.ui.orgaunits.columns.type").localize(), TABLE_COL_TYPE)); setModelBuilder(new ModelBuilder(itemModel)); diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonPropertiesStep.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonPropertiesStep.java index 5d82234b0..1d1542adb 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonPropertiesStep.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonPropertiesStep.java @@ -69,9 +69,10 @@ public class GenericPersonPropertiesStep extends SimpleEditStep { itemModel)); /* Add the SimpleEditStep to the segmented panel */ - segmentedPanel.addSegment(new Label((String) ContenttypesGlobalizationUtil. - globalize("cms.contenttypes.ui.person.basic_properties"). - localize()), basicProperties); + segmentedPanel.addSegment(new + Label(ContenttypesGlobalizationUtil + .globalize("cms.contenttypes.ui.person.basic_properties")), + basicProperties); // GenericPersonContactPropertiesStep contactProperties = new GenericPersonContactPropertiesStep(itemModel, parent); @@ -80,8 +81,8 @@ public class GenericPersonPropertiesStep extends SimpleEditStep { GenericPersonAliasPropertiesStep aliasStep = new GenericPersonAliasPropertiesStep( itemModel, parent); - segmentedPanel.addSegment(new Label((String) ContenttypesGlobalizationUtil. - globalize("cms.contenttypes.ui.person.alias").localize()), + segmentedPanel.addSegment(new Label(ContenttypesGlobalizationUtil. + globalize("cms.contenttypes.ui.person.alias")), aliasStep); /* Sets the composed segmentedPanel as display component */ diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonPropertyForm.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonPropertyForm.java index dc7267369..2aa630aec 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonPropertyForm.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonPropertyForm.java @@ -76,14 +76,16 @@ public class GenericPersonPropertyForm extends BasicPageForm implements FormProc super.addWidgets(); mandatoryFieldWidgets(this); - add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.birthdate").localize())); + add(new Label(ContenttypesGlobalizationUtil + .globalize("cms.contenttypes.ui.person.birthdate"))); ParameterModel birthdateParam = new DateParameter(BIRTHDATE); com.arsdigita.bebop.form.Date birthdate = new com.arsdigita.bebop.form.Date(birthdateParam); Calendar today = new GregorianCalendar(); birthdate.setYearRange(1900, today.get(Calendar.YEAR)); add(birthdate); - add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.gender").localize())); + add(new Label(ContenttypesGlobalizationUtil + .globalize("cms.contenttypes.ui.person.gender"))); ParameterModel genderParam = new StringParameter(GENDER); SingleSelect gender = new SingleSelect(genderParam); gender.addOption(new Option("", new Label((String) ContenttypesGlobalizationUtil.globalize("cms.ui.select_one").localize()))); @@ -91,7 +93,8 @@ public class GenericPersonPropertyForm extends BasicPageForm implements FormProc gender.addOption(new Option("m", new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.gender.m").localize()))); add(gender); - add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.description").localize())); + add(new Label(ContenttypesGlobalizationUtil + .globalize("cms.contenttypes.ui.person.description"))); ParameterModel descriptionParam = new StringParameter(DESCRIPTION); TextArea description = new TextArea(descriptionParam); description.setCols(50); @@ -101,23 +104,27 @@ public class GenericPersonPropertyForm extends BasicPageForm implements FormProc } public static void mandatoryFieldWidgets(FormSection form) { - form.add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.titlepre").localize())); + form.add(new Label(ContenttypesGlobalizationUtil + .globalize("cms.contenttypes.ui.person.titlepre"))); ParameterModel titlepreParam = new StringParameter(TITLEPRE); TextField titlepre = new TextField(titlepreParam); form.add(titlepre); - form.add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.surname").localize())); + form.add(new Label(ContenttypesGlobalizationUtil + .globalize("cms.contenttypes.ui.person.surname"))); ParameterModel surnameParam = new StringParameter(SURNAME); surnameParam.addParameterListener(new NotNullValidationListener()); TextField surname = new TextField(surnameParam); form.add(surname); - form.add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.givenname").localize())); + form.add(new Label(ContenttypesGlobalizationUtil + .globalize("cms.contenttypes.ui.person.givenname"))); ParameterModel givennameParam = new StringParameter(GIVENNAME); TextField givenname = new TextField(givennameParam); form.add(givenname); - form.add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.titlepost").localize())); + form.add(new Label(ContenttypesGlobalizationUtil + .globalize("cms.contenttypes.ui.person.titlepost"))); ParameterModel titlepostParam = new StringParameter(TITLEPOST); TextField titlepost = new TextField(titlepostParam); form.add(titlepost); diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/ResettableContainer.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/ResettableContainer.java index 1981d098e..3a0341d8e 100755 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/ResettableContainer.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/ResettableContainer.java @@ -33,19 +33,13 @@ import java.util.Iterator; * * @author Phong Nguyen * @version $Revision: #7 $ - **/ + */ public class ResettableContainer extends SimpleContainer implements Resettable { - // $Source: /cvsroot/content-types/apps/content-types/src/ui/ResettableContainer.java,v $ - // $Revision: #7 $ - // $Date: 2004/08/17 $ - // $Author: sskracic $ - - - // A list of all resettable components in this container + /** A list of all resettable components in this container */ private ArrayList m_resettableComponents = new ArrayList(); - // A list of all components that are not visible by default + /** A list of all components that are not visible by default */ private ArrayList m_componentsNotVisibleByDefault = new ArrayList();