From 18cca65010bac537ce7acb0e9a05cc0e54e71811 Mon Sep 17 00:00:00 2001 From: pb Date: Thu, 6 Jun 2013 23:10:05 +0000 Subject: [PATCH] Beseitung verschiedener Lokalisierungsfehler. git-svn-id: https://svn.libreccm.org/ccm/trunk@2180 8810af33-2d31-482b-a856-94f89814c4df --- .../com/arsdigita/cms/CMSResources.properties | 1 - .../arsdigita/cms/CMSResources_de.properties | 1 - .../ui/GenericAddressPropertiesStep.java | 50 +++++++++++++------ .../ui/GenericAddressPropertyForm.java | 35 +++++++++---- .../com/arsdigita/cms/ui/ContentItemPage.java | 10 +++- .../cms/ui/authoring/BasicItemForm.java | 47 +++++++++++------ .../cms/ui/authoring/BasicPageForm.java | 50 +++++++++++-------- .../cms/ui/authoring/CreationSelector.java | 6 +-- .../arsdigita/cms/ui/authoring/EmptyPage.java | 1 + .../cms/ui/authoring/NewItemForm.java | 13 +++-- .../cms/ui/authoring/PageCreate.java | 29 ++++++++--- .../category/CategoryLocalizationAddForm.java | 4 +- .../cms/ui/contentcenter/TasksPanel.java | 6 +-- 13 files changed, 167 insertions(+), 86 deletions(-) diff --git a/ccm-cms/src/com/arsdigita/cms/CMSResources.properties b/ccm-cms/src/com/arsdigita/cms/CMSResources.properties index fd8b7b28e..e0b06cb39 100755 --- a/ccm-cms/src/com/arsdigita/cms/CMSResources.properties +++ b/ccm-cms/src/com/arsdigita/cms/CMSResources.properties @@ -940,7 +940,6 @@ cms.tasks.ui.anyone=Anyone cms.tasks.ui.assigned_to=Assigned to cms.tasks.ui.assignment_info=Assignment info cms.tasks.ui.content_center=Content Center -cms.tasks.ui.create=Create cms.tasks.ui.description=Description cms.tasks.ui.disabled=Disabled cms.tasks.ui.due_date=Due date diff --git a/ccm-cms/src/com/arsdigita/cms/CMSResources_de.properties b/ccm-cms/src/com/arsdigita/cms/CMSResources_de.properties index 18a58af0a..370cdae86 100755 --- a/ccm-cms/src/com/arsdigita/cms/CMSResources_de.properties +++ b/ccm-cms/src/com/arsdigita/cms/CMSResources_de.properties @@ -933,7 +933,6 @@ cms.tasks.ui.anyone=Jedermann cms.tasks.ui.assigned_to=Zugewiesen an: cms.tasks.ui.assignment_info=Informationen \u00fcber die Zuweisung cms.tasks.ui.content_center=Content Center -cms.tasks.ui.create=Erstellen cms.tasks.ui.description=Beschreibung cms.tasks.ui.disabled=Deaktiviert cms.tasks.ui.due_date=F\u00e4lligkeitsdatum diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericAddressPropertiesStep.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericAddressPropertiesStep.java index ceb889417..7c835e864 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericAddressPropertiesStep.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericAddressPropertiesStep.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009 Jens Pelzetter, for the Center of Social Politics of the University of Bremen + * Copyright (C) 2009 Jens Pelzetter, for the University of Bremen * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -52,20 +52,34 @@ public class GenericAddressPropertiesStep extends SimpleEditStep { protected void createEditSheet(ItemSelectionModel itemModel) { BasicPageForm editSheet; editSheet = new GenericAddressPropertyForm(itemModel, this); - add(EDIT_SHEET_NAME, "Edit", new WorkflowLockedComponentAccess(editSheet, itemModel), editSheet.getSaveCancelSection().getCancelButton()); + add(EDIT_SHEET_NAME, + "Edit", + new WorkflowLockedComponentAccess(editSheet, itemModel), + editSheet.getSaveCancelSection().getCancelButton()); } public static Component getAddressPropertySheet(ItemSelectionModel itemModel) { DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(itemModel); - sheet.add((String) GlobalizationUtil.globalize("cms.contenttypes.ui.name").localize(), GenericAddress.NAME); - sheet.add((String) GlobalizationUtil.globalize("cms.contenttypes.ui.title").localize(), GenericAddress.TITLE); - sheet.add((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.address").localize(), GenericAddress.ADDRESS); - sheet.add((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.postal_code").localize(), GenericAddress.POSTAL_CODE); - sheet.add((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.city").localize(), GenericAddress.CITY); - sheet.add((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.state").localize(), GenericAddress.STATE); + sheet.add(GlobalizationUtil + .globalize("cms.contenttypes.ui.name"), GenericAddress.NAME); + sheet.add(GlobalizationUtil + .globalize("cms.contenttypes.ui.title"), GenericAddress.TITLE); + sheet.add(ContenttypesGlobalizationUtil + .globalize("cms.contenttypes.ui.address.address"), + GenericAddress.ADDRESS); + sheet.add(ContenttypesGlobalizationUtil + .globalize("cms.contenttypes.ui.address.postal_code"), + GenericAddress.POSTAL_CODE); + sheet.add(ContenttypesGlobalizationUtil + .globalize("cms.contenttypes.ui.address.city"), + GenericAddress.CITY); + sheet.add(ContenttypesGlobalizationUtil + .globalize("cms.contenttypes.ui.address.state"), + GenericAddress.STATE); - sheet.add((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.iso_country_code").localize(), + sheet.add(ContenttypesGlobalizationUtil + .globalize("cms.contenttypes.ui.address.iso_country_code"), GenericAddress.ISO_COUNTRY_CODE, new DomainObjectPropertySheet.AttributeFormatter() { @@ -74,15 +88,19 @@ public class GenericAddressPropertiesStep extends SimpleEditStep { PageState state) { GenericAddress address = (GenericAddress) item; if (address != null && address.getIsoCountryCode() != null) { - return GenericAddress.getCountryNameFromIsoCode(address.getIsoCountryCode()); + return GenericAddress + .getCountryNameFromIsoCode(address.getIsoCountryCode()); } else { - return (String) GlobalizationUtil.globalize("cms.ui.unknown").localize(); + return (String) GlobalizationUtil + .globalize("cms.ui.unknown") + .localize(); } } }); if (!ContentSection.getConfig().getHideLaunchDate()) { - sheet.add((String) GlobalizationUtil.globalize("cms.ui.authoring.page_launch_date").localize(), + sheet.add(GlobalizationUtil + .globalize("cms.ui.authoring.page_launch_date"), ContentPage.LAUNCH_DATE, new DomainObjectPropertySheet.AttributeFormatter() { @@ -91,9 +109,13 @@ public class GenericAddressPropertiesStep extends SimpleEditStep { PageState state) { ContentPage page = (ContentPage) item; if (page.getLaunchDate() != null) { - return DateFormat.getDateInstance(DateFormat.LONG).format(page.getLaunchDate()); + return DateFormat + .getDateInstance(DateFormat.LONG) + .format(page.getLaunchDate()); } else { - return (String) GlobalizationUtil.globalize("cms.ui.unknown").localize(); + return (String) GlobalizationUtil + .globalize("cms.ui.unknown") + .localize(); } } }); diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericAddressPropertyForm.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericAddressPropertyForm.java index 812dc116c..900f38f1b 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericAddressPropertyForm.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericAddressPropertyForm.java @@ -75,7 +75,8 @@ public class GenericAddressPropertyForm extends BasicPageForm implements FormPro protected void addWidgets() { super.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)); @@ -84,46 +85,58 @@ public class GenericAddressPropertyForm extends BasicPageForm implements FormPro address.setCols(30); add(address); - 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); - 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 (!GenericAddress.getConfig().getHideCountryCodeSelection()) { - 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(); + Iterator countries = GenericAddress.getSortedListOfCountries(null) + .entrySet().iterator(); while (countries.hasNext()) { - Map.Entry elem = (Map.Entry) countries.next(); - country.addOption(new Option(elem.getValue().toString(), elem.getKey().toString())); + Map.Entry elem = + (Map.Entry) countries.next(); + country.addOption(new Option(elem.getValue().toString(), + elem.getKey().toString())); } country.addValidationListener( new ParameterListener() { - public void validate(ParameterEvent e) throws FormProcessException { + public void validate(ParameterEvent e) + throws FormProcessException { ParameterData data = e.getParameterData(); String isoCode = (String) data.getValue(); s_log.debug("ISO code is : " + isoCode); if (isoCode == null || isoCode.length() == 0) { - data.addError((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.error_iso_country").localize()); + data.addError((String) ContenttypesGlobalizationUtil + .globalize("cms.contenttypes.ui.address.error_iso_country") + .localize()); } } }); diff --git a/ccm-cms/src/com/arsdigita/cms/ui/ContentItemPage.java b/ccm-cms/src/com/arsdigita/cms/ui/ContentItemPage.java index 55e86e2a1..740ec692a 100755 --- a/ccm-cms/src/com/arsdigita/cms/ui/ContentItemPage.java +++ b/ccm-cms/src/com/arsdigita/cms/ui/ContentItemPage.java @@ -220,7 +220,7 @@ public class ContentItemPage extends CMSPage implements ActionListener { m_tabbedPane.addTab(new Label(gz("cms.ui.item.summary")), m_summaryPane); m_tabbedPane.addTab(new Label(gz("cms.ui.item.authoring")), m_wizardPane); m_tabbedPane.addTab(new Label(gz("cms.ui.item.languages")), - m_languagesPane); + m_languagesPane); m_tabbedPane.addTab(new Label(gz("cms.ui.item.workflow")), m_workflowPane); m_tabbedPane.addTab(new Label(gz("cms.ui.item.lifecycles")), @@ -300,6 +300,7 @@ public class ContentItemPage extends CMSPage implements ActionListener { * @param request The HTTP request * @return The current content section */ + @Override public ContentSection getContentSection(HttpServletRequest request) { // Resets all content sections associations. ContentSection section = super.getContentSection(request); @@ -315,6 +316,7 @@ public class ContentItemPage extends CMSPage implements ActionListener { * @param state The page state * @return The current content item, null if there is none */ + @Override public ContentItem getContentItem(PageState state) { return (ContentItem) m_itemModel.getSelectedObject(state); } @@ -486,6 +488,12 @@ public class ContentItemPage extends CMSPage implements ActionListener { } } + /** + * + * @param state + * @param item + * @return + */ private String getDefaultPreviewLink(final PageState state, final ContentItem item) { final ContentSection section = CMS.getContext().getContentSection(); diff --git a/ccm-cms/src/com/arsdigita/cms/ui/authoring/BasicItemForm.java b/ccm-cms/src/com/arsdigita/cms/ui/authoring/BasicItemForm.java index 21b9ce9be..db146ad50 100755 --- a/ccm-cms/src/com/arsdigita/cms/ui/authoring/BasicItemForm.java +++ b/ccm-cms/src/com/arsdigita/cms/ui/authoring/BasicItemForm.java @@ -57,11 +57,10 @@ import java.util.Collection; * @author Stanislav Freidin (stas@arsdigita.com) * @version $Revision: #13 $ $DateTime: 2004/08/17 23:15:09 $ **/ -public abstract class BasicItemForm - extends FormSection - implements FormInitListener, - FormProcessListener, - FormValidationListener { +public abstract class BasicItemForm extends FormSection + implements FormInitListener, + FormProcessListener, + FormValidationListener { private static final Logger s_log = Logger.getLogger(BasicItemForm.class); private final ItemSelectionModel m_itemModel; @@ -73,7 +72,11 @@ public abstract class BasicItemForm public static final String LANGUAGE = ContentItem.LANGUAGE; /** - * Construct a new BasicItemForm + * Construct a new BasicItemForm with 2 ColumnPanels and add basic content. + * + * The left Panel is used for Labels, the right Panel for values. + * + * * * @param formName the name of this form * @param itemModel The {@link ItemSelectionModel} which will @@ -81,11 +84,13 @@ public abstract class BasicItemForm */ public BasicItemForm(String formName, ItemSelectionModel itemModel) { super(new ColumnPanel(2)); - //super(formName, new ColumnPanel(2)); + m_widgetSection = new FormSection(new ColumnPanel(2, true)); + super.add(m_widgetSection, ColumnPanel.INSERT); m_itemModel = itemModel; + /* Prepare Panel design */ ColumnPanel panel = (ColumnPanel) getPanel(); panel.setBorder(false); panel.setPadColor("#FFFFFF"); @@ -93,6 +98,7 @@ public abstract class BasicItemForm panel.setColumnWidth(2, "80%"); panel.setWidth("100%"); + /* Add basic contents */ addWidgets(); m_saveCancelSection = new SaveCancelSection(); @@ -104,7 +110,8 @@ public abstract class BasicItemForm } /** - * Construct a new BasicItemForm with nothing on it + * Construct a new BasicItemForm with a specified number of ColumnPanels + * and without any content * * @param formName the name of this form * @param columnPanel the columnpanel of the form @@ -115,9 +122,9 @@ public abstract class BasicItemForm ColumnPanel columnPanel, ItemSelectionModel itemModel) { super(columnPanel); - //super(formName, columnPanel); - m_widgetSection = - new FormSection(new ColumnPanel(columnPanel.getNumCols(), true)); + + m_widgetSection = new FormSection(new ColumnPanel(columnPanel.getNumCols(), + true)); super.add(m_widgetSection, ColumnPanel.INSERT); m_itemModel = itemModel; } @@ -129,13 +136,21 @@ public abstract class BasicItemForm m_saveCancelSection = new SaveCancelSection(); super.add(m_saveCancelSection, ColumnPanel.FULL_WIDTH | ColumnPanel.LEFT); } - private Label m_script = new Label( - "", - false); + /** - * Add various widgets to the form. Child classes should override - * this method to perform all their widget-adding needs + * */ + private Label m_script = new Label( + "", + false); + + /** + * Add basic widgets to the form. + * + * Widgets added are 'title' and 'name (url)' which are part of any content + * item. + * Child classes will override this method to perform all their widget-adding + * needs but may use super() to add the basic widgets. */ protected void addWidgets() { //add(new FormErrorDisplay(this), ColumnPanel.FULL_WIDTH | ColumnPanel.LEFT); diff --git a/ccm-cms/src/com/arsdigita/cms/ui/authoring/BasicPageForm.java b/ccm-cms/src/com/arsdigita/cms/ui/authoring/BasicPageForm.java index be2c3a704..1d09369ae 100755 --- a/ccm-cms/src/com/arsdigita/cms/ui/authoring/BasicPageForm.java +++ b/ccm-cms/src/com/arsdigita/cms/ui/authoring/BasicPageForm.java @@ -44,11 +44,14 @@ import javax.servlet.ServletException; import java.util.Date; /** - * A form for editing subclasses of ContentPage. This is just a convenience class. + * A form for editing subclasses of ContentPage. + * + * This is just a convenience class. It uses parent class to construct the form + * including basic widgets (i.e. title and name/url as well as save/cancel + * buttons) and adds optional Lunchdate * * @author Stanislav Freidin (stas@arsdigita.com) * @version $Revision: #22 $ $DateTime: 2004/08/17 23:15:09 $ - * */ public abstract class BasicPageForm extends BasicItemForm { @@ -85,19 +88,17 @@ public abstract class BasicPageForm extends BasicItemForm { */ @Override protected void addWidgets() { + + /* Add basic widgets title/name which are part of any content item */ super.addWidgets(); -// add(new Label(GlobalizationUtil.globalize("cms.ui.authoring.page_description"))); -// ParameterModel descriptionParam = new StringParameter(DESCRIPTION); -// TextArea description = new TextArea(descriptionParam); -// description.setCols(50); -// description.setRows(5); -// add(description); -// + /* Optionally add Lunchdate */ if (!ContentSection.getConfig().getHideLaunchDate()) { - add(new Label(GlobalizationUtil.globalize("cms.ui.authoring.page_launch_date"))); + add(new Label(GlobalizationUtil + .globalize("cms.ui.authoring.page_launch_date"))); ParameterModel launchDateParam = new DateParameter(LAUNCH_DATE); - com.arsdigita.bebop.form.Date launchDate = new com.arsdigita.bebop.form.Date(launchDateParam); + com.arsdigita.bebop.form.Date launchDate = + new com.arsdigita.bebop.form.Date(launchDateParam); if (ContentSection.getConfig().getRequireLaunchDate()) { launchDate.addValidationListener(new LaunchDateValidationListener()); // if launch date is required, help user by suggesting today's date @@ -108,7 +109,8 @@ public abstract class BasicPageForm extends BasicItemForm { } /** - * Utility method to initialize the name/title widgets. Child classes may call this method from the init listener + * Utility method to initialize the name/title widgets. Child classes may + * call this method from the init listener * * @param e the {@link FormSectionEvent} which was passed to the init listener * @return the ContentPage instance which was extracted from the ItemSelectionModel @@ -118,15 +120,14 @@ public abstract class BasicPageForm extends BasicItemForm { FormData data = e.getFormData(); PageState state = e.getPageState(); - ContentPage item = - (ContentPage) getItemSelectionModel().getSelectedObject(state); + ContentPage item = (ContentPage) + getItemSelectionModel().getSelectedObject(state); if (item != null) { // Preset fields data.put(CONTENT_ITEM_ID, item.getID().toString()); data.put(NAME, item.getName()); data.put(TITLE, item.getTitle()); -// data.put(DESCRIPTION, item.getDescription()); if (!ContentSection.getConfig().getHideLaunchDate()) { data.put(LAUNCH_DATE, item.getLaunchDate()); // if launch date is required, help user by suggesting today's date @@ -140,11 +141,17 @@ public abstract class BasicPageForm extends BasicItemForm { return item; } + /** + * + * @param fse + * @throws FormProcessException + */ @Override public void validate(final FormSectionEvent fse) throws FormProcessException { super.validate(fse); - final ContentItem item = getItemSelectionModel().getSelectedItem(fse.getPageState()); + final ContentItem item = getItemSelectionModel() + .getSelectedItem(fse.getPageState()); ACSObject parent = item.getParent(); @@ -163,7 +170,8 @@ public abstract class BasicPageForm extends BasicItemForm { } /** - * Utility method to process the name/title widgets. Child classes may call this method from the process listener. + * Utility method to process the name/title widgets. Child classes may call + * this method from the process listener. * * @param e the {@link FormSectionEvent} which was passed to the process listener * @return @@ -180,7 +188,6 @@ public abstract class BasicPageForm extends BasicItemForm { // Update attributes item.setName((String) data.get(NAME)); item.setTitle((String) data.get(TITLE)); -// item.setDescription((String)data.get(DESCRIPTION)); if (!ContentSection.getConfig().getHideLaunchDate()) { item.setLaunchDate((Date) data.get(LAUNCH_DATE)); } @@ -190,8 +197,11 @@ public abstract class BasicPageForm extends BasicItemForm { } /** - * A utility method that will create a new item and tell the selection model to select the new item. Creation - * components may call this method in the process listener of their form. See {@link PageCreate} for an example. + * A utility method that will create a new item and tell the selection model + * to select the new item. + * + * Creation components may call this method in the process listener of their + * form. See {@link PageCreate} for an example. * * @param state the current page state * @return the new content item (or a proper subclass thereof) @pre state != null @post return != null diff --git a/ccm-cms/src/com/arsdigita/cms/ui/authoring/CreationSelector.java b/ccm-cms/src/com/arsdigita/cms/ui/authoring/CreationSelector.java index 700a15034..6717a8f41 100755 --- a/ccm-cms/src/com/arsdigita/cms/ui/authoring/CreationSelector.java +++ b/ccm-cms/src/com/arsdigita/cms/ui/authoring/CreationSelector.java @@ -179,9 +179,9 @@ public class CreationSelector extends MetaForm { } catch (Exception e) { s_log.error("Instantiation failure", e); throw new UncheckedWrapperException ( - "Failed to instantiate creation component " + - kit.getCreateComponent() + ": " + e.getMessage(), - e); + "Failed to instantiate creation component " + + kit.getCreateComponent() + ": " + e.getMessage(), + e); } } diff --git a/ccm-cms/src/com/arsdigita/cms/ui/authoring/EmptyPage.java b/ccm-cms/src/com/arsdigita/cms/ui/authoring/EmptyPage.java index c5a4cc6ab..025a4172c 100755 --- a/ccm-cms/src/com/arsdigita/cms/ui/authoring/EmptyPage.java +++ b/ccm-cms/src/com/arsdigita/cms/ui/authoring/EmptyPage.java @@ -19,6 +19,7 @@ public class EmptyPage extends Page { super("", new SimpleContainer()); } + @Override public void generateXML(PageState state, Document parent) { Element page = parent.createRootElement("cms:emptyPage", CMS.CMS_XML_NS); page.addAttribute("title", getTitle().getGlobalizedMessage().getKey()); diff --git a/ccm-cms/src/com/arsdigita/cms/ui/authoring/NewItemForm.java b/ccm-cms/src/com/arsdigita/cms/ui/authoring/NewItemForm.java index f83de4a1c..b59009fa1 100755 --- a/ccm-cms/src/com/arsdigita/cms/ui/authoring/NewItemForm.java +++ b/ccm-cms/src/com/arsdigita/cms/ui/authoring/NewItemForm.java @@ -21,7 +21,6 @@ package com.arsdigita.cms.ui.authoring; import com.arsdigita.bebop.BoxPanel; import com.arsdigita.bebop.Form; import com.arsdigita.bebop.Label; -import com.arsdigita.bebop.Page; import com.arsdigita.bebop.PageState; import com.arsdigita.bebop.event.PrintEvent; import com.arsdigita.bebop.event.PrintListener; @@ -48,9 +47,9 @@ import com.arsdigita.xml.Element; import java.math.BigDecimal; /** - * A form which displays a select box of all content types available - * under the given content section, and forwards to the item creation - * UI when the user selects a content type to instantiate. + * A form which displays a select box of all content types available under the + * given content section, and forwards to the item creation UI when the user + * selects a content type to instantiate. * * @author Stanislav Freidin (sfreidin@arsdigtia.com) * @version $Revision: #12 $ $DateTime: 2004/08/17 23:15:09 $ @@ -59,9 +58,8 @@ import java.math.BigDecimal; public abstract class NewItemForm extends Form { public static final String RESOURCE_BUNDLE = - "com.arsdigita.cms.ui.authoring.AuthoringResources"; - public static String DP_TYPE_PREFIX = - "com.arsdigita.dp."; + "com.arsdigita.cms.ui.authoring.AuthoringResources"; + public static String DP_TYPE_PREFIX = "com.arsdigita.dp."; private SingleSelect m_typeWidget; private Submit m_submit; private Label m_emptyLabel; @@ -183,6 +181,7 @@ public abstract class NewItemForm extends Form { } // Generate XML - show/hide labels/widgets + @Override public void generateXML(PageState state, Element parent) { if (isVisible(state)) { diff --git a/ccm-cms/src/com/arsdigita/cms/ui/authoring/PageCreate.java b/ccm-cms/src/com/arsdigita/cms/ui/authoring/PageCreate.java index 2f98ee029..a86b21831 100755 --- a/ccm-cms/src/com/arsdigita/cms/ui/authoring/PageCreate.java +++ b/ccm-cms/src/com/arsdigita/cms/ui/authoring/PageCreate.java @@ -37,15 +37,21 @@ import java.util.Date; import org.apache.log4j.Logger; /** - * A form which will create a new ContentPage or one of its - * subclasses. + * A form which will create a new ContentPage or one of its subclasses. + * + * Used to create a new document / content item. Creates widgets to select the + * workflow, type of content item, and language. Super class adds additional + * widgets (title and name/url) to complete the form. + * + * It's a pane which is part of a more complex page, additionally containing + * folder structure, content items in the folder, permissions, etc. * * @author Stanislav Freidin (stas@arsdigita.com) * @version $Revision: #21 $ $DateTime: 2004/08/17 23:15:09 $ * @version $Id: PageCreate.java 2140 2011-01-16 12:04:20Z pboy $ */ public class PageCreate extends BasicPageForm - implements FormSubmissionListener, CreationComponent { + implements FormSubmissionListener, CreationComponent { protected final CreationSelector m_parent; protected ApplyWorkflowFormSection m_workflowSection; @@ -75,21 +81,29 @@ public class PageCreate extends BasicPageForm m_workflowSection.setCreationSelector(m_parent); addSubmissionListener(this); - getSaveCancelSection().getSaveButton().setButtonLabel("Create"); + getSaveCancelSection().getSaveButton() + .setButtonLabel(GlobalizationUtil.globalize( + "cms.ui.create")); } /** * Add various widgets to the form. Child classes should override * this method to perform all their widget-adding needs. */ + @Override protected void addWidgets() { + + /* Add workflow selection */ ContentType type = getItemSelectionModel().getContentType(); m_workflowSection = new ApplyWorkflowFormSection(type); add(m_workflowSection, ColumnPanel.INSERT); + /* content type */ add(new Label(GlobalizationUtil.globalize("cms.ui.authoring.content_type"))); add(new Label(type.getLabel())); + /* language selection */ add(new Label(GlobalizationUtil.globalize("cms.ui.language.field"))); add(new LanguageWidget(LANGUAGE)); + /* Additional widgets from super type: title and name (url) */ super.addWidgets(); } @@ -126,9 +140,10 @@ public class PageCreate extends BasicPageForm } /** - * Validate inputs to ensure name uniqueness. Note: We can't call {@code super.validate(FormSectionEvent)} here - * because the super method {@link BasicPageForm#validate(com.arsdigita.bebop.event.FormSectionEvent)} tries - * to access things which on existing yet. + * Validate inputs to ensure name uniqueness. Note: We can't call + * {@code super.validate(FormSectionEvent)} here because the super method + * {@link BasicPageForm#validate(com.arsdigita.bebop.event.FormSectionEvent)} + * tries to access things which on existing yet. * * @param event */ diff --git a/ccm-cms/src/com/arsdigita/cms/ui/category/CategoryLocalizationAddForm.java b/ccm-cms/src/com/arsdigita/cms/ui/category/CategoryLocalizationAddForm.java index 23d46d34e..92d2fb788 100644 --- a/ccm-cms/src/com/arsdigita/cms/ui/category/CategoryLocalizationAddForm.java +++ b/ccm-cms/src/com/arsdigita/cms/ui/category/CategoryLocalizationAddForm.java @@ -73,8 +73,8 @@ public class CategoryLocalizationAddForm extends CategoryLocalizationForm { // Select one entry m_locale.addOption(new Option("", - new Label((String) GlobalizationUtil.globalize( - "cms.ui.select_one").localize())), state); + new Label(GlobalizationUtil.globalize( + "cms.ui.select_one"))), state); // all supported languages (by registry entry) KernelConfig kernelConfig = Kernel.getConfig(); diff --git a/ccm-cms/src/com/arsdigita/cms/ui/contentcenter/TasksPanel.java b/ccm-cms/src/com/arsdigita/cms/ui/contentcenter/TasksPanel.java index 042c780e7..d108d6d19 100755 --- a/ccm-cms/src/com/arsdigita/cms/ui/contentcenter/TasksPanel.java +++ b/ccm-cms/src/com/arsdigita/cms/ui/contentcenter/TasksPanel.java @@ -94,8 +94,8 @@ public class TasksPanel extends CMSContainer { // Number of tasks to show private final int m_maxRows; private TaskList m_taskList; - private ActionLink m_viewAllLink; - private ActionLink m_viewShortLink; + // private ActionLink m_viewAllLink; + // private ActionLink m_viewShortLink; private Paginator m_paginator; private ActionLink m_viewLockLink, m_viewUnlockLink, m_viewAllLockLink; private Label m_viewLockLabel, m_viewUnlockLabel, m_viewAllLockLabel; @@ -631,7 +631,7 @@ public class TasksPanel extends CMSContainer { state.setControlEvent(this, SORT_UP, header); } SimpleContainer container = new SimpleContainer(); - container.add(new Label((String)GlobalizationUtil.globalize(labelKey).localize())); + container.add(new Label(GlobalizationUtil.globalize(labelKey))); if (header.equals(sortKey)) { String imageURLStub = null; if (SORT_UP.equals(sortDirection)) {