From 43c5f627d17d7ae11a0c7ca6ea9752d5d94d0310 Mon Sep 17 00:00:00 2001 From: pb Date: Mon, 1 Jul 2013 06:38:30 +0000 Subject: [PATCH] Verbesserung Lokalisierung bei formitem/formsection. Teil von Ticket #1736. git-svn-id: https://svn.libreccm.org/ccm/trunk@2237 8810af33-2d31-482b-a856-94f89814c4df --- .../arsdigita/cms/formbuilder/FormItem.xml | 8 +- .../util/FormItemGlobalizationUtil.java | 55 ++++ .../formbuilder/FormItemResources.properties | 11 +- .../FormItemResources_de.properties | 13 +- .../FormItemResources_fr.properties | 11 + .../cms/ui/formbuilder/FormActions.java | 66 +++-- .../cms/ui/formbuilder/FormControls.java | 61 ++++- ...java => FormItemSingleSelectionModel.java} | 30 ++- .../cms/ui/formbuilder/FormProperties.java | 123 ++++++--- .../cms/formbuilder/FormSectionItem.xml | 12 +- .../util/FormSectionGlobalizationUtil.java | 55 ++++ .../FormSectionItemResources.properties | 7 +- .../FormSectionItemResources_de.properties | 7 +- .../FormSectionItemResources_fr.properties | 5 + .../ui/formbuilder/FormSectionActions.java | 10 + .../ui/formbuilder/FormSectionControls.java | 30 ++- .../formbuilder/FormSectionModelBuilder.java | 14 ++ .../ui/formbuilder/FormSectionProperties.java | 18 +- .../FormSectionSingleSelectionModel.java | 23 +- .../com/arsdigita/cms/CMSResources.properties | 9 +- .../arsdigita/cms/CMSResources_de.properties | 8 +- .../cms/CMSResources_en_GB.properties | 2 +- .../arsdigita/cms/CMSResources_fr.properties | 9 +- ...GenericContactEditAddressPropertyForm.java | 59 +++-- .../cms/contenttypes/ui/LinkPropertyForm.java | 22 +- ccm-core/src/ccm-core.config | 2 +- .../src/com/arsdigita/bebop/Completable.java | 2 +- .../com/arsdigita/bebop/SimpleComponent.java | 6 +- .../src/com/arsdigita/bebop/form/Widget.java | 20 +- ccm-core/src/com/arsdigita/core/Loader.java | 61 +---- .../{util => }/FormBuilderConfig.java | 17 +- .../FormBuilderConfig_parameter.properties | 0 .../{ui => }/FormbuilderResources.properties | 16 +- .../FormbuilderResources_de.properties | 36 ++- .../FormbuilderResources_fr.properties | 58 +++++ .../Initializer.java.nolongerInUse | 172 ------------- .../installer/Initializer.java.nolongerInUse | 235 ------------------ .../installer/package.html.nolongerInUse | 11 - .../formbuilder/ui/BaseEditAddObserver.java | 61 +++-- .../formbuilder/ui/ControlEditor.java | 81 ++++-- .../formbuilder/ui/ControlProperties.java | 25 +- .../ui/FormbuilderResources_fr.properties | 48 ---- .../arsdigita/formbuilder/ui/MoveControl.java | 40 ++- .../arsdigita/formbuilder/ui/NewAction.java | 13 +- .../arsdigita/formbuilder/ui/NewControl.java | 88 +++++-- .../arsdigita/formbuilder/ui/NewSection.java | 45 +++- .../formbuilder/ui/ProcessListenerEditor.java | 35 +-- .../ui/ProcessListenerProperties.java | 4 +- .../formbuilder/ui/editors/WidgetForm.java | 11 +- .../ui/editors/WidgetLabelForm.java | 15 +- .../util/ExtendedElement.java.nolongerInUse | 32 --- .../formbuilder/util/FormBuilderUtil.java | 48 +++- .../formbuilder/util/FormbuilderSetup.java | 4 - .../formbuilder/util/GlobalizationUtil.java | 3 +- 54 files changed, 989 insertions(+), 868 deletions(-) create mode 100755 ccm-cms-types-formitem/src/com/arsdigita/cms/contenttypes/util/FormItemGlobalizationUtil.java create mode 100755 ccm-cms-types-formitem/src/com/arsdigita/cms/formbuilder/FormItemResources_fr.properties rename ccm-cms-types-formitem/src/com/arsdigita/cms/ui/formbuilder/{FormSingleSelectionModel.java => FormItemSingleSelectionModel.java} (59%) create mode 100755 ccm-cms-types-formsectionitem/src/com/arsdigita/cms/contenttypes/util/FormSectionGlobalizationUtil.java create mode 100755 ccm-cms-types-formsectionitem/src/com/arsdigita/cms/formbuilder/FormSectionItemResources_fr.properties rename ccm-core/src/com/arsdigita/formbuilder/{util => }/FormBuilderConfig.java (85%) rename ccm-core/src/com/arsdigita/formbuilder/{util => }/FormBuilderConfig_parameter.properties (100%) rename ccm-core/src/com/arsdigita/formbuilder/{ui => }/FormbuilderResources.properties (77%) rename ccm-core/src/com/arsdigita/formbuilder/{ui => }/FormbuilderResources_de.properties (59%) create mode 100755 ccm-core/src/com/arsdigita/formbuilder/FormbuilderResources_fr.properties delete mode 100755 ccm-core/src/com/arsdigita/formbuilder/Initializer.java.nolongerInUse delete mode 100755 ccm-core/src/com/arsdigita/formbuilder/installer/Initializer.java.nolongerInUse delete mode 100755 ccm-core/src/com/arsdigita/formbuilder/installer/package.html.nolongerInUse delete mode 100755 ccm-core/src/com/arsdigita/formbuilder/ui/FormbuilderResources_fr.properties delete mode 100755 ccm-core/src/com/arsdigita/formbuilder/util/ExtendedElement.java.nolongerInUse diff --git a/ccm-cms-types-formitem/src/WEB-INF/content-types/com/arsdigita/cms/formbuilder/FormItem.xml b/ccm-cms-types-formitem/src/WEB-INF/content-types/com/arsdigita/cms/formbuilder/FormItem.xml index fe15fda10..eab646cf2 100755 --- a/ccm-cms-types-formitem/src/WEB-INF/content-types/com/arsdigita/cms/formbuilder/FormItem.xml +++ b/ccm-cms-types-formitem/src/WEB-INF/content-types/com/arsdigita/cms/formbuilder/FormItem.xml @@ -1,7 +1,10 @@ - + - + + + diff --git a/ccm-cms-types-formitem/src/com/arsdigita/cms/contenttypes/util/FormItemGlobalizationUtil.java b/ccm-cms-types-formitem/src/com/arsdigita/cms/contenttypes/util/FormItemGlobalizationUtil.java new file mode 100755 index 000000000..5a280876f --- /dev/null +++ b/ccm-cms-types-formitem/src/com/arsdigita/cms/contenttypes/util/FormItemGlobalizationUtil.java @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2004 Red Hat Inc. All Rights Reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ +package com.arsdigita.cms.contenttypes.util; + +import com.arsdigita.globalization.Globalized; +import com.arsdigita.globalization.GlobalizedMessage; + +/** + * Compilation of methods to simplify the handling of globalizing keys. + * Basically it adds the name of package's resource bundle files to the + * globalize methods and forwards to GlobalizedMessage, shortening the + * method invocation in the various application classes. + * + * @author randyg@arsdigita.com + * @version $Revision: #4 $ $Date: 2004/08/17 $ + */ +public class FormItemGlobalizationUtil implements Globalized { + + /** Name of Java resource files to handle FormItem's globalisation. */ + final public static String BUNDLE_NAME = + "com.arsdigita.cms.formbuilder.FormItemResources"; + + /** + * This returns a globalized message using the package specific bundle, + * provided by BUNDLE_NAME. + */ + public static GlobalizedMessage globalize(String key) { + return new GlobalizedMessage(key, BUNDLE_NAME); + } + + /** + * Returns a globalized message object, using the package specific bundle, + * as specified by BUNDLE_NAME. Also takes in an Object[] of arguments to + * interpolate into the retrieved message using the MessageFormat class. + */ + public static GlobalizedMessage globalize(String key, Object[] args) { + return new GlobalizedMessage(key, BUNDLE_NAME, args); + } +} diff --git a/ccm-cms-types-formitem/src/com/arsdigita/cms/formbuilder/FormItemResources.properties b/ccm-cms-types-formitem/src/com/arsdigita/cms/formbuilder/FormItemResources.properties index 4efa68bb9..f62483f5e 100755 --- a/ccm-cms-types-formitem/src/com/arsdigita/cms/formbuilder/FormItemResources.properties +++ b/ccm-cms-types-formitem/src/com/arsdigita/cms/formbuilder/FormItemResources.properties @@ -1,4 +1,11 @@ form_item.authoring.controls.description=Edit the controls present on the form -form_item.authoring.controls.title=Controls +form_item.authoring.controls.title=Edit Form Controls form_item.authoring.actions.description=Edit the form submission actions -form_item.authoring.actions.title=Actions +form_item.authoring.actions.title=Edit Form Actions +cms.contenttypes.ui.form_item.form_mode_label=Form mode: +cms.contenttypes.ui.form_item.form_mode_local=Local +cms.contenttypes.ui.form_item.form_mode_remote=Remote +cms.contenttypes.ui.form_item.remote_url_label=Remote URL: +cms.contenttypes.ui.form_item.empty=(empty) +cms.contenttypes.ui.form_item.submit_label=Submit +cms.contenttypes.ui.form_item.oh_no_you_dont=Oh no you don't diff --git a/ccm-cms-types-formitem/src/com/arsdigita/cms/formbuilder/FormItemResources_de.properties b/ccm-cms-types-formitem/src/com/arsdigita/cms/formbuilder/FormItemResources_de.properties index 03de8e09e..def2d165d 100644 --- a/ccm-cms-types-formitem/src/com/arsdigita/cms/formbuilder/FormItemResources_de.properties +++ b/ccm-cms-types-formitem/src/com/arsdigita/cms/formbuilder/FormItemResources_de.properties @@ -1,4 +1,11 @@ -form_item.authoring.controls.description=Elemente des Formulars editieren -form_item.authoring.controls.title=Controls +form_item.authoring.controls.description=Kontrollelemente des Formulars bearbeiten +form_item.authoring.controls.title=Formularelemente bearbeiten form_item.authoring.actions.description=Editieren der Aktionen des Formulars -form_item.authoring.actions.title=Aktionen +form_item.authoring.actions.title=Formular Aktionen bearbeiten +cms.contenttypes.ui.form_item.form_mode_label=Formularmodus: +cms.contenttypes.ui.form_item.form_mode_local=Lokal +cms.contenttypes.ui.form_item.form_mode_remote=Entfernt +cms.contenttypes.ui.form_item.remote_url_label=Entfernte URL: +cms.contenttypes.ui.form_item.empty=(leer) +cms.contenttypes.ui.form_item.submit_label=Ausf\u00fchren +cms.contenttypes.ui.form_item.oh_no_you_dont=Nein, das wollen sie nicht diff --git a/ccm-cms-types-formitem/src/com/arsdigita/cms/formbuilder/FormItemResources_fr.properties b/ccm-cms-types-formitem/src/com/arsdigita/cms/formbuilder/FormItemResources_fr.properties new file mode 100755 index 000000000..49c4e9c65 --- /dev/null +++ b/ccm-cms-types-formitem/src/com/arsdigita/cms/formbuilder/FormItemResources_fr.properties @@ -0,0 +1,11 @@ +form_item.authoring.controls.description=Edit the controls present on the form +form_item.authoring.controls.title=Edit Form Controls +form_item.authoring.actions.description=Edit the form submission actions +form_item.authoring.actions.title=Edit Form Actions +cms.contenttypes.ui.form_item.form_mode_label=Form mode: +cms.contenttypes.ui.form_item.form_mode_local=Local +cms.contenttypes.ui.form_item.form_mode_remote=Remote +cms.contenttypes.ui.form_item.remote_url_label=Remote URL: +cms.contenttypes.ui.form_item.empty=(empty) +cms.contenttypes.ui.form_item.submit_label=Submit +cms.contenttypes.ui.form_item.oh_no_you_dont=non, vous ne pouvez pas diff --git a/ccm-cms-types-formitem/src/com/arsdigita/cms/ui/formbuilder/FormActions.java b/ccm-cms-types-formitem/src/com/arsdigita/cms/ui/formbuilder/FormActions.java index fd33ffccd..97de4e2bc 100755 --- a/ccm-cms-types-formitem/src/com/arsdigita/cms/ui/formbuilder/FormActions.java +++ b/ccm-cms-types-formitem/src/com/arsdigita/cms/ui/formbuilder/FormActions.java @@ -37,15 +37,24 @@ import com.arsdigita.bebop.form.Option; import com.arsdigita.bebop.form.RadioGroup; import com.arsdigita.bebop.form.Submit; import com.arsdigita.bebop.form.TextField; +import com.arsdigita.cms.contenttypes.util.FormItemGlobalizationUtil; import com.arsdigita.cms.ItemSelectionModel; import com.arsdigita.cms.formbuilder.FormItem; +import com.arsdigita.cms.util.GlobalizationUtil; import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; import com.arsdigita.formbuilder.ui.ProcessListenerEditor; + import java.math.BigDecimal; + import java.net.MalformedURLException; import java.net.URL; + import org.apache.log4j.Logger; +/** + * + * + */ public class FormActions extends ProcessListenerEditor { private Form m_lrForm; @@ -60,17 +69,32 @@ public class FormActions extends ProcessListenerEditor { private static final Logger s_log = Logger.getLogger(FormActions.class); + /** + * Constructor. + * + * @param model + * @param parent + */ public FormActions(ItemSelectionModel model, AuthoringKitWizard parent) { - super("forms-cms", - new FormSingleSelectionModel(model)); + super("forms-cms", new FormItemSingleSelectionModel(model)); } + /** + * + * @param ps + * @return + */ private FormItem getFormItem(PageState ps) { - return (FormItem) ((FormSingleSelectionModel) m_form).getItemModel().getSelectedItem(ps); + return (FormItem) ((FormItemSingleSelectionModel) + m_form).getItemModel().getSelectedItem(ps); } + /** + * + */ + @Override protected void addComponents() { m_lrForm = new Form("locateRemoteForm", new ColumnPanel(2)); @@ -81,25 +105,32 @@ public class FormActions extends ProcessListenerEditor { panel.setColumnWidth(2, "80%"); panel.setWidth("100%"); - m_lrForm.add(new Label("Form mode:")); + m_lrForm.add(new Label(FormItemGlobalizationUtil.globalize( + "cms.contenttypes.ui.form_item.form_mode_label")) ); m_localRemote = new RadioGroup("remote"); - Option local = new Option(Boolean.FALSE.toString(), "Local"); - Option remote = new Option(Boolean.TRUE.toString(), "Remote"); + Option local = new Option(Boolean.FALSE.toString(), + new Label(FormItemGlobalizationUtil.globalize( + "cms.contenttypes.ui.form_item.form_mode_local") ) + ); + Option remote = new Option(Boolean.TRUE.toString(), + new Label(FormItemGlobalizationUtil.globalize( + "cms.contenttypes.ui.form_item.form_mode_remote")) ); m_localRemote.addOption(local); m_localRemote.addOption(remote); m_localRemote.setLayout(RadioGroup.VERTICAL); m_lrForm.add(m_localRemote); - m_remoteLabel = new Label("Remote URL"); + m_remoteLabel = new Label(FormItemGlobalizationUtil.globalize( + "cms.contenttypes.ui.form_item.remote_url_label")); m_lrForm.add(m_remoteLabel); m_urlEditLink = new SimpleContainer(); m_urlValue = new Label(); m_urlValue.setOutputEscaping(false); m_urlEditLink.add(m_urlValue); - m_urlEditLink.add(new Label(" ", false)); - ActionLink edit = new ActionLink("edit"); + ActionLink edit = new ActionLink(GlobalizationUtil + .globalize("cms.ui.edit") ); edit.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { PageState state = e.getPageState(); @@ -114,14 +145,11 @@ public class FormActions extends ProcessListenerEditor { m_remoteUrl = new TextField("remoteUrl"); m_lrForm.add(m_remoteUrl); - m_switch = new Submit("submit", "Submit"); + m_switch = new Submit("submit", + FormItemGlobalizationUtil.globalize( + "cms.contenttypes.ui.form_item.submit_label") ); m_lrForm.add(m_switch); - m_lrForm.add(new Label()); - - m_lrForm.add(new Label(" ", false), ColumnPanel.FULL_WIDTH); - - m_lrForm.addInitListener(new FormInitListener() { public void init(FormSectionEvent e) { initWidgets(e); @@ -138,7 +166,8 @@ public class FormActions extends ProcessListenerEditor { try { new URL(value); } catch (MalformedURLException ex) { - data.addError(m_remoteUrl.getName(), "Please enter a valid URL"); + data.addError(m_remoteUrl.getName(), + "Please enter a valid URL"); } } } @@ -157,6 +186,7 @@ public class FormActions extends ProcessListenerEditor { super.addComponents(); } + @Override public void register(Page page) { super.register(page); page.setVisibleDefault(m_remoteUrl, false); @@ -177,6 +207,10 @@ public class FormActions extends ProcessListenerEditor { initWidgets(e); } + /** + * + * @param e + */ protected void initWidgets(FormSectionEvent e) { s_log.debug("initWidgets"); PageState state = e.getPageState(); diff --git a/ccm-cms-types-formitem/src/com/arsdigita/cms/ui/formbuilder/FormControls.java b/ccm-cms-types-formitem/src/com/arsdigita/cms/ui/formbuilder/FormControls.java index 29443b383..199310b3d 100755 --- a/ccm-cms-types-formitem/src/com/arsdigita/cms/ui/formbuilder/FormControls.java +++ b/ccm-cms-types-formitem/src/com/arsdigita/cms/ui/formbuilder/FormControls.java @@ -22,10 +22,10 @@ package com.arsdigita.cms.ui.formbuilder; import com.arsdigita.bebop.Component; import com.arsdigita.bebop.Container; import com.arsdigita.bebop.PageState; +import com.arsdigita.cms.CMS; import com.arsdigita.cms.ContentItem; import com.arsdigita.cms.ItemSelectionModel; import com.arsdigita.cms.SecurityManager; -import com.arsdigita.cms.dispatcher.Utilities; import com.arsdigita.cms.formbuilder.FormSectionItem; import com.arsdigita.cms.formbuilder.FormSectionWrapper; import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; @@ -39,33 +39,65 @@ import com.arsdigita.util.UncheckedWrapperException; import java.math.BigDecimal; +/** + * Authoring step to edit the formular item's control elements of the FormItem + * content type (and its subclasses). + * + * It delegates completely to formsection and core form service to build and + * process the widgets. + * + */ public class FormControls extends ControlEditor { + + /** */ private ItemSelectionModel m_itemModel; + /** + * Constructor. + * + * @param item + * @param parent + */ public FormControls(ItemSelectionModel item, AuthoringKitWizard parent) { + // Create a EditorForm not a formSection super("forms-cms", - new FormSingleSelectionModel(item), true); + new FormItemSingleSelectionModel(item), true); m_itemModel = item; - + // Using FormSection capabilities! setFormSectionModelBuilder(new FormSectionModelBuilder(item)); } + /** + * + * @param container + * @param child + */ + @Override protected void addEditableComponent(Container container, Component child) { - WorkflowLockedContainer lock = new WorkflowLockedContainer(((FormSingleSelectionModel)getFormModel()).getItemModel()); + WorkflowLockedContainer lock = new + WorkflowLockedContainer(((FormItemSingleSelectionModel)getFormModel()) + .getItemModel()); lock.add(child); super.addEditableComponent(container, lock); } + /** + * + * @param state + * @param sectionID + * @return + */ + @Override protected PersistentComponent getFormSection(PageState state, BigDecimal sectionID) { FormSectionItem section = null; try { section = (FormSectionItem)DomainObjectFactory.newInstance( - new OID(FormSectionItem.BASE_DATA_OBJECT_TYPE, - sectionID)); + new OID(FormSectionItem.BASE_DATA_OBJECT_TYPE, + sectionID)); } catch (DataObjectNotFoundException ex) { throw new UncheckedWrapperException("cannot load section", ex); } @@ -75,12 +107,17 @@ public class FormControls extends ControlEditor { return wrapper; } - - + + /** + * + * @param state + * @return + */ + @Override protected boolean addItemEditObserver(PageState state) { - return Utilities.getSecurityManager(state).canAccess( - state.getRequest(), - SecurityManager.EDIT_ITEM, - (ContentItem) m_itemModel.getSelectedObject(state)); + return CMS.getSecurityManager(state).canAccess( + state.getRequest(), + SecurityManager.EDIT_ITEM, + (ContentItem) m_itemModel.getSelectedObject(state)); } } diff --git a/ccm-cms-types-formitem/src/com/arsdigita/cms/ui/formbuilder/FormSingleSelectionModel.java b/ccm-cms-types-formitem/src/com/arsdigita/cms/ui/formbuilder/FormItemSingleSelectionModel.java similarity index 59% rename from ccm-cms-types-formitem/src/com/arsdigita/cms/ui/formbuilder/FormSingleSelectionModel.java rename to ccm-cms-types-formitem/src/com/arsdigita/cms/ui/formbuilder/FormItemSingleSelectionModel.java index fde56a147..bff824257 100755 --- a/ccm-cms-types-formitem/src/com/arsdigita/cms/ui/formbuilder/FormSingleSelectionModel.java +++ b/ccm-cms-types-formitem/src/com/arsdigita/cms/ui/formbuilder/FormItemSingleSelectionModel.java @@ -25,14 +25,14 @@ import com.arsdigita.bebop.event.ChangeListener; import com.arsdigita.bebop.parameters.ParameterModel; import com.arsdigita.cms.ItemSelectionModel; import com.arsdigita.cms.formbuilder.FormItem; -import com.arsdigita.cms.util.GlobalizationUtil; +import com.arsdigita.cms.contenttypes.util.FormItemGlobalizationUtil; -public class FormSingleSelectionModel extends AbstractSingleSelectionModel { +public class FormItemSingleSelectionModel extends AbstractSingleSelectionModel { private ItemSelectionModel m_item; - public FormSingleSelectionModel(ItemSelectionModel item) { + public FormItemSingleSelectionModel(ItemSelectionModel item) { m_item = item; } @@ -40,6 +40,7 @@ public class FormSingleSelectionModel extends AbstractSingleSelectionModel { return m_item; } + @Override public boolean isSelected(PageState state) { return m_item.isSelected(state); } @@ -51,22 +52,35 @@ public class FormSingleSelectionModel extends AbstractSingleSelectionModel { public void setSelectedKey(PageState state, Object key) { - throw new RuntimeException( (String) GlobalizationUtil.globalize("cms.ui.formbuilder.oh_no_you_dont").localize()); + throw new RuntimeException( (String) FormItemGlobalizationUtil.globalize( + "cms.contenttypes.ui.form_item.oh_no_you_dont") + .localize()); } + @Override public void clearSelection(PageState state) { - throw new RuntimeException( (String) GlobalizationUtil.globalize("cms.ui.formbuilder.oh_no_you_dont").localize()); + throw new RuntimeException( (String) + FormItemGlobalizationUtil + .globalize("cms.contenttypes.ui.form_item.oh_no_you_dont").localize()); } + @Override public void addChangeListener(ChangeListener l) { - throw new RuntimeException( (String) GlobalizationUtil.globalize("cms.ui.formbuilder.oh_no_you_dont").localize()); + throw new RuntimeException( (String) + FormItemGlobalizationUtil + .globalize("cms.contenttypes.ui.form_item.oh_no_you_dont").localize()); } + @Override public void removeChangeListener(ChangeListener l) { - throw new RuntimeException( (String) GlobalizationUtil.globalize("cms.ui.formbuilder.oh_no_you_dont").localize()); + throw new RuntimeException( (String) FormItemGlobalizationUtil.globalize( + "cms.contenttypes.ui.form_item.oh_no_you_dont") + .localize()); } public ParameterModel getStateParameter() { - throw new RuntimeException( (String) GlobalizationUtil.globalize("cms.ui.formbuilder.oh_no_you_dont").localize()); + throw new RuntimeException( (String) FormItemGlobalizationUtil.globalize( + "cms.contenttypes.ui.form_item.oh_no_you_dont") + .localize()); } } diff --git a/ccm-cms-types-formitem/src/com/arsdigita/cms/ui/formbuilder/FormProperties.java b/ccm-cms-types-formitem/src/com/arsdigita/cms/ui/formbuilder/FormProperties.java index 5349b864f..573d23dd3 100755 --- a/ccm-cms-types-formitem/src/com/arsdigita/cms/ui/formbuilder/FormProperties.java +++ b/ccm-cms-types-formitem/src/com/arsdigita/cms/ui/formbuilder/FormProperties.java @@ -42,44 +42,83 @@ import com.arsdigita.domain.DomainObject; import com.arsdigita.formbuilder.PersistentForm; import com.arsdigita.toolbox.ui.DomainObjectPropertySheet; +/** + * Authoring step to edit the simple attributes of the FormItem content type + * (and its subclasses). The attributes edited are 'title', 'name', optionally + * 'launchDate' (if configured as active), and 'desciption' / summary. + * + */ public class FormProperties extends SimpleEditStep { - /** The name of the editing sheet added to this step */ + /** The name of the editing sheet for this step */ public static String EDIT_SHEET_NAME = "edit"; - public FormProperties(ItemSelectionModel model, + /** + * FormProperties Constructor, creates an empty property step sheet. + * + * @param model + * @param parent + */ + public FormProperties(ItemSelectionModel itemModel, AuthoringKitWizard parent) { - super(model, parent); + super(itemModel, parent); setDefaultEditKey(EDIT_SHEET_NAME); - BasicPageForm editForm = buildEditForm(model); + BasicPageForm editForm = buildEditForm(itemModel); - add(EDIT_SHEET_NAME, "Edit", new WorkflowLockedComponentAccess(editForm, model), + add(EDIT_SHEET_NAME, + GlobalizationUtil.globalize("cms.ui.edit"), + new WorkflowLockedComponentAccess(editForm, itemModel), editForm.getSaveCancelSection().getCancelButton()); - setDisplayComponent(buildDisplayComponent(model)); + + setDisplayComponent(buildDisplayComponent(itemModel)); } + /** + * + * @param model + * @return + */ protected BasicPageForm buildEditForm(ItemSelectionModel model) { return new FormPropertyEditForm(model, this); } + /** + * + * @param model + * @return + */ protected Component buildDisplayComponent(ItemSelectionModel model) { return new FormPropertySheet(model); } + /** + * Internal class to implement an edit form for properties. For most other + * content types this is implemented as a separate (external) public class. + * FormItem just uses the standard properties and relays complete on + * classes of the AP (i.e. specifically CMS and CORE). + */ protected class FormPropertyEditForm extends BasicPageForm - implements FormProcessListener, FormInitListener, - FormSubmissionListener { + implements FormProcessListener, + FormInitListener, + FormSubmissionListener { private TextArea m_desc; private TextField m_css; private FormProperties m_step; + /** + * Internal class constructor, just creates an empty form. + * @param itemModel + */ public FormPropertyEditForm(ItemSelectionModel itemModel) { this(itemModel, null); } /** + * Internal class constructor, just creates a form using passed in + * form properties. + * * @param itemModel the ItemSelectionModel that controls which form * to work on * @param formProperties The properties step that controls this form. @@ -91,29 +130,41 @@ public class FormProperties extends SimpleEditStep { addSubmissionListener(this); } + /** + * Fills the (empty) form as created by the constructor with widgets. + */ + @Override protected void addWidgets() { - super.addWidgets(); + super.addWidgets(); // adds standard properties title,name,launchdate + // add editing the description property m_desc = new TextArea(new StringParameter("description")); m_desc.setRows(5); m_desc.setCols(50); add(new Label(GlobalizationUtil - .globalize("cms.ui.formbuilder.description"))); + .globalize("cms.contenttypes.ui.description"))); add(m_desc); - //Css control hidden - /*add(new Label(GlobalizationUtil.globalize("cms.formbuilder.css"))); - m_css = new TextField(new StringParameter("css")); - add(m_css);*/ } + /** + * + * @param e + * @throws FormProcessException + */ public void init(FormSectionEvent e) throws FormProcessException { FormItem item = (FormItem)initBasicWidgets(e); } + /** + * Process the FORM after submit. + * + * @param e + * @throws FormProcessException + */ public void process(FormSectionEvent e) - throws FormProcessException { + throws FormProcessException { FormItem item = (FormItem)processBasicWidgets(e); item.save(); @@ -122,25 +173,34 @@ public class FormProperties extends SimpleEditStep { } } + /** + * + * @param e + * @return + */ + @Override public ContentPage initBasicWidgets(FormSectionEvent e) { FormItem item = (FormItem)super.initBasicWidgets(e); PersistentForm form = item.getForm(); m_desc.setValue(e.getPageState(), form.getDescription()); - //Css hidden - //m_css.setValue(e.getPageState(), item.getCSS()); return item; } + /** + * + * @param e + * @return + */ + @Override public ContentPage processBasicWidgets(FormSectionEvent e) { + FormItem item = (FormItem)super.processBasicWidgets(e); PersistentForm form = item.getForm(); - //Css hidden - //item.setCSS((String)m_css.getValue(e.getPageState())); item.save(); form.setAdminName(item.getName()); form.setHTMLName(item.getName()); @@ -160,24 +220,31 @@ public class FormProperties extends SimpleEditStep { } } + /** + * Internal class implents a DomainObjectProertySheet containent the + * required widgets for the editin FORM (i.e. title, name, description) + */ protected class FormPropertySheet extends DomainObjectPropertySheet { + public FormPropertySheet(ItemSelectionModel model) { super(model); - add(GlobalizationUtil.globalize("cms.ui.formbuilder.name"), - ContentPage.NAME); - add(GlobalizationUtil.globalize("cms.ui.formbuilder.title"), + add(GlobalizationUtil.globalize("cms.contenttypes.ui.title"), ContentPage.TITLE); - add(GlobalizationUtil.globalize("cms.ui.formbuilder.description"), - "form", new FormFormatter()); - //Css hidden temporarily - - //add(GlobalizationUtil.globalize("cms.formbuilder.css"), - // FormItem.CSS); + add(GlobalizationUtil.globalize("cms.contenttypes.ui.name"), + ContentPage.NAME); + add(GlobalizationUtil.globalize("cms.contenttypes.ui.description"), + "form", + new FormFormatter()); } } + /** + * Provides an AttributeFormatter for the 'description' property to be + * displayed in the property step. + */ private class FormFormatter implements DomainObjectPropertySheet.AttributeFormatter { + ItemSelectionModel m_item; public String format(DomainObject item, String attribute, PageState state) { diff --git a/ccm-cms-types-formsectionitem/src/WEB-INF/content-types/com/arsdigita/cms/formbuilder/FormSectionItem.xml b/ccm-cms-types-formsectionitem/src/WEB-INF/content-types/com/arsdigita/cms/formbuilder/FormSectionItem.xml index 7ecca38eb..8904adf98 100755 --- a/ccm-cms-types-formsectionitem/src/WEB-INF/content-types/com/arsdigita/cms/formbuilder/FormSectionItem.xml +++ b/ccm-cms-types-formsectionitem/src/WEB-INF/content-types/com/arsdigita/cms/formbuilder/FormSectionItem.xml @@ -1,6 +1,12 @@ - - + + + + + diff --git a/ccm-cms-types-formsectionitem/src/com/arsdigita/cms/contenttypes/util/FormSectionGlobalizationUtil.java b/ccm-cms-types-formsectionitem/src/com/arsdigita/cms/contenttypes/util/FormSectionGlobalizationUtil.java new file mode 100755 index 000000000..2c57329a0 --- /dev/null +++ b/ccm-cms-types-formsectionitem/src/com/arsdigita/cms/contenttypes/util/FormSectionGlobalizationUtil.java @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2004 Red Hat Inc. All Rights Reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ +package com.arsdigita.cms.contenttypes.util; + +import com.arsdigita.globalization.Globalized; +import com.arsdigita.globalization.GlobalizedMessage; + +/** + * Compilation of methods to simplify the handling of globalizing keys. + * Basically it adds the name of package's resource bundle files to the + * globalize methods and forwards to GlobalizedMessage, shortening the + * method invocation in the various application classes. + * + * @author randyg@arsdigita.com + * @version $Revision: #4 $ $Date: 2004/08/17 $ + */ +public class FormSectionGlobalizationUtil implements Globalized { + + /** Name of Java resource files to handle FormItem's globalisation. */ + final public static String BUNDLE_NAME = + "com.arsdigita.cms.formbuilder.FormSectionItemResources"; + + /** + * This returns a globalized message using the package specific bundle, + * provided by BUNDLE_NAME. + */ + public static GlobalizedMessage globalize(String key) { + return new GlobalizedMessage(key, BUNDLE_NAME); + } + + /** + * Returns a globalized message object, using the package specific bundle, + * as specified by BUNDLE_NAME. Also takes in an Object[] of arguments to + * interpolate into the retrieved message using the MessageFormat class. + */ + public static GlobalizedMessage globalize(String key, Object[] args) { + return new GlobalizedMessage(key, BUNDLE_NAME, args); + } +} diff --git a/ccm-cms-types-formsectionitem/src/com/arsdigita/cms/formbuilder/FormSectionItemResources.properties b/ccm-cms-types-formsectionitem/src/com/arsdigita/cms/formbuilder/FormSectionItemResources.properties index e64ebc8b7..4806dd1aa 100755 --- a/ccm-cms-types-formsectionitem/src/com/arsdigita/cms/formbuilder/FormSectionItemResources.properties +++ b/ccm-cms-types-formsectionitem/src/com/arsdigita/cms/formbuilder/FormSectionItemResources.properties @@ -1,4 +1,5 @@ form_section_item.authoring.controls.description=Edit the controls present on the form -form_section_item.authoring.controls.title=Controls -form_section_item.authoring.actions.description=Editieren der Aktionen des Formulars -form_section_item.authoring.actions.title=Actions \ No newline at end of file +form_section_item.authoring.controls.title=Edit Form Controls +form_section_item.authoring.actions.description=Edit the form actions present on the form +form_section_item.authoring.actions.title=Edit Form Actions +cms.contenttypes.ui.form_section.oh_no_you_dont=Oh no you don't diff --git a/ccm-cms-types-formsectionitem/src/com/arsdigita/cms/formbuilder/FormSectionItemResources_de.properties b/ccm-cms-types-formsectionitem/src/com/arsdigita/cms/formbuilder/FormSectionItemResources_de.properties index 3a49584a3..431b4e990 100644 --- a/ccm-cms-types-formsectionitem/src/com/arsdigita/cms/formbuilder/FormSectionItemResources_de.properties +++ b/ccm-cms-types-formsectionitem/src/com/arsdigita/cms/formbuilder/FormSectionItemResources_de.properties @@ -1,4 +1,5 @@ form_section_item.authoring.controls.description=Elemente des Formulars editieren -form_section_item.authoring.controls.title=Controls -form_section_item.authoring.actions.description=Edit the form submission actions -form_section_item.authoring.actions.title=Aktionen +form_section_item.authoring.controls.title=Formularelemente bearbeiten +form_section_item.authoring.actions.description=Editieren der Aktionen des Formulars +form_section_item.authoring.actions.title=Formularaktionen bearbeiten +cms.contenttypes.ui.form_section.oh_no_you_dont=Nein, das wollen sie nicht diff --git a/ccm-cms-types-formsectionitem/src/com/arsdigita/cms/formbuilder/FormSectionItemResources_fr.properties b/ccm-cms-types-formsectionitem/src/com/arsdigita/cms/formbuilder/FormSectionItemResources_fr.properties new file mode 100755 index 000000000..da54ab56f --- /dev/null +++ b/ccm-cms-types-formsectionitem/src/com/arsdigita/cms/formbuilder/FormSectionItemResources_fr.properties @@ -0,0 +1,5 @@ +form_section_item.authoring.controls.description=Edit the controls present on the form +form_section_item.authoring.controls.title=Edit Form Controls +form_section_item.authoring.actions.description=Edit the form actions present on the form +form_section_item.authoring.actions.title=Edit Form Actions +cms.contenttypes.ui.form_section.oh_no_you_dont=non, vous ne pouvez pas diff --git a/ccm-cms-types-formsectionitem/src/com/arsdigita/cms/ui/formbuilder/FormSectionActions.java b/ccm-cms-types-formsectionitem/src/com/arsdigita/cms/ui/formbuilder/FormSectionActions.java index d502a4a93..45f08fbd2 100755 --- a/ccm-cms-types-formsectionitem/src/com/arsdigita/cms/ui/formbuilder/FormSectionActions.java +++ b/ccm-cms-types-formsectionitem/src/com/arsdigita/cms/ui/formbuilder/FormSectionActions.java @@ -23,7 +23,17 @@ import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; import com.arsdigita.formbuilder.ui.ProcessListenerEditor; +/** + * + * + */ public class FormSectionActions extends ProcessListenerEditor { + + /** + * Constructor. + * @param model + * @param parent + */ public FormSectionActions(ItemSelectionModel model, AuthoringKitWizard parent) { super("forms-cms", diff --git a/ccm-cms-types-formsectionitem/src/com/arsdigita/cms/ui/formbuilder/FormSectionControls.java b/ccm-cms-types-formsectionitem/src/com/arsdigita/cms/ui/formbuilder/FormSectionControls.java index 26bd83427..f5840e940 100755 --- a/ccm-cms-types-formsectionitem/src/com/arsdigita/cms/ui/formbuilder/FormSectionControls.java +++ b/ccm-cms-types-formsectionitem/src/com/arsdigita/cms/ui/formbuilder/FormSectionControls.java @@ -22,19 +22,29 @@ package com.arsdigita.cms.ui.formbuilder; import com.arsdigita.bebop.Component; import com.arsdigita.bebop.Container; import com.arsdigita.bebop.PageState; +import com.arsdigita.cms.CMS; import com.arsdigita.cms.ContentItem; import com.arsdigita.cms.ItemSelectionModel; import com.arsdigita.cms.SecurityManager; -import com.arsdigita.cms.dispatcher.Utilities; import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; import com.arsdigita.cms.ui.workflow.WorkflowLockedContainer; import com.arsdigita.formbuilder.ui.ControlEditor; +/** + * + * + */ public class FormSectionControls extends ControlEditor { private ItemSelectionModel m_itemModel; + /** + * Constructor. + * + * @param item + * @param parent + */ public FormSectionControls(ItemSelectionModel item, AuthoringKitWizard parent) { @@ -44,15 +54,29 @@ public class FormSectionControls extends ControlEditor { m_itemModel = item; } + /** + * + * @param container + * @param child + */ + @Override protected void addEditableComponent(Container container, Component child) { - WorkflowLockedContainer lock = new WorkflowLockedContainer(((FormSectionSingleSelectionModel)getFormModel()).getItemModel()); + WorkflowLockedContainer lock = new + WorkflowLockedContainer(((FormSectionSingleSelectionModel)getFormModel()) + .getItemModel()); lock.add(child); super.addEditableComponent(container, lock); } + /** + * + * @param state + * @return + */ + @Override protected boolean addItemEditObserver(PageState state) { - return Utilities.getSecurityManager(state).canAccess( + return CMS.getSecurityManager(state).canAccess( state.getRequest(), SecurityManager.EDIT_ITEM, (ContentItem) m_itemModel.getSelectedObject(state)); diff --git a/ccm-cms-types-formsectionitem/src/com/arsdigita/cms/ui/formbuilder/FormSectionModelBuilder.java b/ccm-cms-types-formsectionitem/src/com/arsdigita/cms/ui/formbuilder/FormSectionModelBuilder.java index a0a0ec4be..69bdd020b 100755 --- a/ccm-cms-types-formsectionitem/src/com/arsdigita/cms/ui/formbuilder/FormSectionModelBuilder.java +++ b/ccm-cms-types-formsectionitem/src/com/arsdigita/cms/ui/formbuilder/FormSectionModelBuilder.java @@ -35,13 +35,27 @@ import com.arsdigita.persistence.SessionManager; +/** + * + * + */ public class FormSectionModelBuilder implements PrintListener { + + /** */ private ItemSelectionModel m_item; + /** + * Constructor. + * @param item + */ public FormSectionModelBuilder(ItemSelectionModel item) { m_item = item; } + /** + * + * @param e + */ public void prepare(PrintEvent e) { ContentItem item = (ContentItem)m_item.getSelectedObject(e.getPageState()); ContentSection section = item.getContentSection(); diff --git a/ccm-cms-types-formsectionitem/src/com/arsdigita/cms/ui/formbuilder/FormSectionProperties.java b/ccm-cms-types-formsectionitem/src/com/arsdigita/cms/ui/formbuilder/FormSectionProperties.java index 3f2f0855d..917565a2d 100755 --- a/ccm-cms-types-formsectionitem/src/com/arsdigita/cms/ui/formbuilder/FormSectionProperties.java +++ b/ccm-cms-types-formsectionitem/src/com/arsdigita/cms/ui/formbuilder/FormSectionProperties.java @@ -54,7 +54,8 @@ public class FormSectionProperties extends SimpleEditStep { setDefaultEditKey(EDIT_SHEET_NAME); BasicPageForm edit = new FormSectionPropertyEditForm(model, this); - add(EDIT_SHEET_NAME, "Edit", + add(EDIT_SHEET_NAME, + GlobalizationUtil.globalize("cms.ui.edit"), new WorkflowLockedComponentAccess(edit, model), edit.getSaveCancelSection().getCancelButton()); setDisplayComponent(buildDisplayComponent(model)); @@ -89,7 +90,8 @@ public class FormSectionProperties extends SimpleEditStep { m_desc = new TextArea(new StringParameter("description")); m_desc.setRows(5); m_desc.setCols(50); - add(new Label(GlobalizationUtil.globalize("cms.ui.formbuilder.description"))); + add(new Label(GlobalizationUtil + .globalize("cms.contenttypes.ui.description"))); add(m_desc); } @@ -133,17 +135,19 @@ public class FormSectionProperties extends SimpleEditStep { private Component buildDisplayComponent(ItemSelectionModel itemModel) { DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(itemModel); - sheet.add(GlobalizationUtil.globalize("cms.ui.formbuilder.name"), - ContentPage.NAME); - sheet.add(GlobalizationUtil.globalize("cms.ui.formbuilder.title"), + sheet.add(GlobalizationUtil.globalize("cms.contenttypes.ui.title"), ContentPage.TITLE); - sheet.add(GlobalizationUtil.globalize("cms.ui.formbuilder.description"), + sheet.add(GlobalizationUtil.globalize("cms.contenttypes.ui.name"), + ContentPage.NAME); + sheet.add(GlobalizationUtil.globalize("cms.contenttypes.ui.description"), "form", new FormSectionFormatter()); return sheet; } - private class FormSectionFormatter implements DomainObjectPropertySheet.AttributeFormatter { + private class FormSectionFormatter + implements DomainObjectPropertySheet.AttributeFormatter { + ItemSelectionModel m_item; public String format(DomainObject item, String attribute, PageState state) { diff --git a/ccm-cms-types-formsectionitem/src/com/arsdigita/cms/ui/formbuilder/FormSectionSingleSelectionModel.java b/ccm-cms-types-formsectionitem/src/com/arsdigita/cms/ui/formbuilder/FormSectionSingleSelectionModel.java index 959aeb0f6..9912aecf5 100755 --- a/ccm-cms-types-formsectionitem/src/com/arsdigita/cms/ui/formbuilder/FormSectionSingleSelectionModel.java +++ b/ccm-cms-types-formsectionitem/src/com/arsdigita/cms/ui/formbuilder/FormSectionSingleSelectionModel.java @@ -24,8 +24,8 @@ import com.arsdigita.bebop.PageState; import com.arsdigita.bebop.event.ChangeListener; import com.arsdigita.bebop.parameters.ParameterModel; import com.arsdigita.cms.ItemSelectionModel; +import com.arsdigita.cms.contenttypes.util.FormSectionGlobalizationUtil; import com.arsdigita.cms.formbuilder.FormSectionItem; -import com.arsdigita.cms.util.GlobalizationUtil; public class FormSectionSingleSelectionModel extends AbstractSingleSelectionModel { @@ -40,6 +40,7 @@ public class FormSectionSingleSelectionModel extends AbstractSingleSelectionMode return m_item; } + @Override public boolean isSelected(PageState state) { return m_item.isSelected(state); } @@ -51,22 +52,32 @@ public class FormSectionSingleSelectionModel extends AbstractSingleSelectionMode public void setSelectedKey(PageState state, Object key) { - throw new RuntimeException( (String) GlobalizationUtil.globalize("cms.ui.formbuilder.oh_no_you_dont").localize()); + throw new RuntimeException( (String) FormSectionGlobalizationUtil.globalize( + "cms.contenttypes.ui.form_section.oh_no_you_dont") + .localize()); } public void clearSelection(PageState state) { - throw new RuntimeException( (String) GlobalizationUtil.globalize("cms.ui.formbuilder.oh_no_you_dont").localize()); + throw new RuntimeException( (String) FormSectionGlobalizationUtil.globalize( + "cms.contenttypes.ui.form_section.oh_no_you_dont") + .localize()); } public void addChangeListener(ChangeListener l) { - throw new RuntimeException( (String) GlobalizationUtil.globalize("cms.ui.formbuilder.oh_no_you_dont").localize()); + throw new RuntimeException( (String) FormSectionGlobalizationUtil.globalize( + "cms.contenttypes.ui.form_section.oh_no_you_dont") + .localize()); } public void removeChangeListener(ChangeListener l) { - throw new RuntimeException( (String) GlobalizationUtil.globalize("cms.ui.formbuilder.oh_no_you_dont").localize()); + throw new RuntimeException( (String) FormSectionGlobalizationUtil.globalize( + "cms.contenttypes.ui.form_section.oh_no_you_dont") + .localize()); } public ParameterModel getStateParameter() { - throw new RuntimeException( (String) GlobalizationUtil.globalize("cms.ui.formbuilder.oh_no_you_dont").localize()); + throw new RuntimeException( (String) FormSectionGlobalizationUtil.globalize( + "cms.contenttypes.ui.form_section.oh_no_you_dont") + .localize()); } } diff --git a/ccm-cms/src/com/arsdigita/cms/CMSResources.properties b/ccm-cms/src/com/arsdigita/cms/CMSResources.properties index 1771fc76e..c41a9bcb8 100755 --- a/ccm-cms/src/com/arsdigita/cms/CMSResources.properties +++ b/ccm-cms/src/com/arsdigita/cms/CMSResources.properties @@ -24,7 +24,7 @@ cms.contenttypes.template.body_text.description=Edit the body text cms.contenttypes.shared.assign_categories.title=Assign Categories cms.contenttypes.shared.assign_categories.description=Assign Categories cms.contenttypes.shared.basic_properties.description=Edit Basic Properties -cms.contenttypes.shared.basic_properties.title=Basic Properties +cms.contenttypes.shared.basic_properties.title=Edit Basic Properties cms.contenttypes.shared.body_text.title=Body Text cms.contenttypes.shared.body_text.description=Edit the Body Text cms.contenttypes.ui.content_group_current_items=Current Items: @@ -409,14 +409,7 @@ cms.ui.folder.na=N/A cms.ui.folder.no_source_items_specified=No source items specified. cms.ui.folder.parent=Parent Folder cms.ui.folder.rename=Rename folder - - -# Package com.arsdigita.cms.ui.formbuilder -# ======================================== -cms.ui.formbuilder.description=Description: -cms.ui.formbuilder.name=Name: cms.ui.formbuilder.oh_no_you_dont=Oh no you don't -cms.ui.formbuilder.title=Title: # Package com.arsdigita.cms.ui.item diff --git a/ccm-cms/src/com/arsdigita/cms/CMSResources_de.properties b/ccm-cms/src/com/arsdigita/cms/CMSResources_de.properties index d54ab6399..45de5d6c1 100755 --- a/ccm-cms/src/com/arsdigita/cms/CMSResources_de.properties +++ b/ccm-cms/src/com/arsdigita/cms/CMSResources_de.properties @@ -24,7 +24,7 @@ cms.contenttypes.template.body_text.description=Haupttext bearbeiten cms.contenttypes.shared.assign_categories.title=Kategorien zuweisen cms.contenttypes.shared.assign_categories.description=Kategorien zuweisen cms.contenttypes.shared.basic_properties.description=Basiseigenschaften bearbeiten -cms.contenttypes.shared.basic_properties.title=Basiseigenschaften +cms.contenttypes.shared.basic_properties.title=Basiseigenschaften bearbeiten cms.contenttypes.shared.body_text.title=Haupttext cms.contenttypes.shared.body_text.description=Haupttext bearbeiten cms.contenttypes.ui.content_group_current_items=Aktuelle Items: @@ -406,13 +406,7 @@ cms.ui.folder.na=k.A. cms.ui.folder.no_source_items_specified=Kein Quelldokument angegeben. cms.ui.folder.parent=\u00dcbergeordneter Ordner cms.ui.folder.rename=Ordner umbenennen - -# Package com.arsdigita.cms.ui.formbuilder -# ======================================== -cms.ui.formbuilder.description=Beschreibung: -cms.ui.formbuilder.name=Name: cms.ui.formbuilder.oh_no_you_dont=Nein, das wollen sie nicht -cms.ui.formbuilder.title=Titel\: # Package com.arsdigita.cms.ui.item diff --git a/ccm-cms/src/com/arsdigita/cms/CMSResources_en_GB.properties b/ccm-cms/src/com/arsdigita/cms/CMSResources_en_GB.properties index 4788b7ca2..414e16ad2 100755 --- a/ccm-cms/src/com/arsdigita/cms/CMSResources_en_GB.properties +++ b/ccm-cms/src/com/arsdigita/cms/CMSResources_en_GB.properties @@ -4,7 +4,7 @@ cms.ui.lifecycles=Lifecycles cms.ui.unknownRole=Unknown role cms.ui.unknownStatus=Unknown status cms.contenttypes.ui.genericorgaunit.persons.status=Status -cms.contenttypes.shared.basic_properties.title=Basic Properties +cms.contenttypes.shared.basic_properties.title=Edit Basic Properties cms.ui.edit_assoc=Edit association cms.ui.type.permissions=Permissions (Create new items of this type) cms.ui.type.permissions.role=Role diff --git a/ccm-cms/src/com/arsdigita/cms/CMSResources_fr.properties b/ccm-cms/src/com/arsdigita/cms/CMSResources_fr.properties index 5abc3ac94..b3bbd86f9 100755 --- a/ccm-cms/src/com/arsdigita/cms/CMSResources_fr.properties +++ b/ccm-cms/src/com/arsdigita/cms/CMSResources_fr.properties @@ -268,14 +268,7 @@ cms.ui.folder.na=N/A cms.ui.folder.no_source_items_specified=Pas d'\u00e9l\u00e9ment source sp\u00e9cifi\u00e9 cms.ui.folder.parent=Parent Folder cms.ui.folder.rename=Rename folder - - -# Package com.arsdigita.cms.ui.formbuilder -# ======================================== -cms.ui.formbuilder.description=Description -cms.ui.formbuilder.name=Nom cms.ui.formbuilder.oh_no_you_dont=non, vous ne pouvez pas -cms.ui.formbuilder.title=Titre # Package com.arsdigita.cms.ui.item @@ -484,7 +477,7 @@ cms.ui.workflow.you_are_assigned_to_this_item=Vous \u00eates assign\u00e9 \u00e0 cms.ui.workflow.your_active_tasks=Vos t\u00e2ches actives cms.ui.workflows=Workflows cms.ui.you_do_not_have_sufficient_privileges_to_access_this_page=Vous n'\u00eates pas autoris\u00e9 \u00e0 voir cette page. -cms.contenttypes.shared.basic_properties.title=Basic Properties +cms.contenttypes.shared.basic_properties.title=Edit Basic Properties cms.ui.edit_assoc= cms.ui.type.permissions=Permissions (Create new items of this type) cms.ui.type.permissions.role=Role 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 fed3831eb..36bebf079 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactEditAddressPropertyForm.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactEditAddressPropertyForm.java @@ -1,10 +1,20 @@ /* - * GenericContactEditAddressPropertyForm.java + * Copyright (C) 2009 Sören Bernstein, Universität Bremen * - * Created on 8. Juli 2009, 10:27 + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. * - * To change this template, choose Tools | Template Manager - * and open the template in the editor. + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * */ package com.arsdigita.cms.contenttypes.ui; @@ -39,20 +49,25 @@ import org.apache.log4j.Logger; /** * - * @author quasi + * @author quasi, Created on 8. Juli 2009, 10:27 */ -public class GenericContactEditAddressPropertyForm extends BasicPageForm implements FormProcessListener, FormInitListener, FormSubmissionListener { +public class GenericContactEditAddressPropertyForm 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 GenericContactAddressPropertiesStep m_step; public static final String ADDRESS = GenericAddress.ADDRESS; public static final String POSTAL_CODE = GenericAddress.POSTAL_CODE; public static final String CITY = GenericAddress.CITY; public static final String STATE = GenericAddress.STATE; public static final String ISO_COUNTRY_CODE = GenericAddress.ISO_COUNTRY_CODE; - /** - * ID of the form - */ + + private GenericContactAddressPropertiesStep m_step; + + /** ID of the form */ public static final String ID = "ContactEditAddress"; /** @@ -70,7 +85,8 @@ public class GenericContactEditAddressPropertyForm extends BasicPageForm impleme * @param itemModel * @param step */ - public GenericContactEditAddressPropertyForm(ItemSelectionModel itemModel, GenericContactAddressPropertiesStep step) { + public GenericContactEditAddressPropertyForm(ItemSelectionModel itemModel, + GenericContactAddressPropertiesStep step) { super(ID, itemModel); m_step = step; addSubmissionListener(this); @@ -112,10 +128,11 @@ public class GenericContactEditAddressPropertyForm extends BasicPageForm impleme } if (!GenericContact.getConfig().getHideAddressCountry()) { - add(new Label(ContenttypesGlobalizationUtil - .globalize("cms.contenttypes.ui.address.iso_country_code"))); + 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)); + countryParam.addParameterListener(new + StringInRangeValidationListener(0, 2)); SingleSelect country = new SingleSelect(countryParam); @@ -124,10 +141,13 @@ public class GenericContactEditAddressPropertyForm extends BasicPageForm impleme 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( @@ -139,7 +159,8 @@ public class GenericContactEditAddressPropertyForm extends BasicPageForm impleme String isoCode = (String) data.getValue(); if (isoCode == null || isoCode.length() == 0) { data.addError((String) ContenttypesGlobalizationUtil - .globalize("cms.contenttypes.ui.address.error_iso_country") + .globalize( + "cms.contenttypes.ui.address.error_iso_country") .localize()); } } diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/LinkPropertyForm.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/LinkPropertyForm.java index 2e3241b8d..fbf765baf 100755 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/LinkPropertyForm.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/LinkPropertyForm.java @@ -89,22 +89,34 @@ public class LinkPropertyForm extends FormSection private ContentType m_contentType; protected final String ITEM_SEARCH = "contentItem"; + /** - * Creates a new form to edit the Link object specified by the item - * selection model passed in. + * Constructor creates a new form to edit the Link object specified by the + * item selection model passed in. * * @param itemModel The ItemSelectionModel to use to obtain the ContentItem * to which this link is (or will be) attached * @param link The LinkSelectionModel to use to obtain the Link to work on */ public LinkPropertyForm(ItemSelectionModel itemModel, - LinkSelectionModel link) { + LinkSelectionModel link) { this(itemModel, link, null); } - + + /** + * Constructor creates a new form to edit the Link object specified by the + * item selection model passed in. + * + * @param itemModel + * @param link + * @param contentType * + */ public LinkPropertyForm(ItemSelectionModel itemModel, - LinkSelectionModel link, ContentType contentType) { + LinkSelectionModel link, + ContentType contentType) { + super(new ColumnPanel(2)); + s_log.debug("property form constructor"); m_linkModel = link; m_itemModel = itemModel; diff --git a/ccm-core/src/ccm-core.config b/ccm-core/src/ccm-core.config index 7d294ecfc..c58377fad 100755 --- a/ccm-core/src/ccm-core.config +++ b/ccm-core/src/ccm-core.config @@ -8,7 +8,7 @@ storage="ccm-core/dispatcher.properties"/> - diff --git a/ccm-core/src/com/arsdigita/bebop/Completable.java b/ccm-core/src/com/arsdigita/bebop/Completable.java index 48b9126ae..1b343a224 100755 --- a/ccm-core/src/com/arsdigita/bebop/Completable.java +++ b/ccm-core/src/com/arsdigita/bebop/Completable.java @@ -30,7 +30,7 @@ import java.util.Iterator; import org.apache.log4j.Logger; /** - * Completable + * Completable. * * @author rhs@mit.edu * @version $Revision: #10 $ $Date: 2004/08/16 $ diff --git a/ccm-core/src/com/arsdigita/bebop/SimpleComponent.java b/ccm-core/src/com/arsdigita/bebop/SimpleComponent.java index a0a6c26ab..b318dd97a 100755 --- a/ccm-core/src/com/arsdigita/bebop/SimpleComponent.java +++ b/ccm-core/src/com/arsdigita/bebop/SimpleComponent.java @@ -38,13 +38,13 @@ import com.arsdigita.xml.Element; * @version $Id: SimpleComponent.java 1498 2007-03-19 16:22:15Z apevec $ */ public class SimpleComponent extends Completable - implements Component, Cloneable { + implements Component, Cloneable { private boolean m_locked; /** - * The Attribute object is protected to make - * it easier for the Form Builder service to persist the SimpleComponent. + * The Attribute object is protected to make it easier for the Form Builder + * service to persist the SimpleComponent. * Locking violation is not a problem since if the SimpleComponent is locked * then the Attribute object will also be locked. */ diff --git a/ccm-core/src/com/arsdigita/bebop/form/Widget.java b/ccm-core/src/com/arsdigita/bebop/form/Widget.java index cf2d09ded..5cbb659a3 100755 --- a/ccm-core/src/com/arsdigita/bebop/form/Widget.java +++ b/ccm-core/src/com/arsdigita/bebop/form/Widget.java @@ -70,7 +70,8 @@ import com.arsdigita.xml.Element; * @author Rory Solomon * @version $Id: Widget.java 1537 2007-03-23 15:33:34Z chrisgilbert23 $ */ -public abstract class Widget extends BlockStylable implements Cloneable, BebopConstants { +public abstract class Widget extends BlockStylable implements Cloneable, + BebopConstants { private static final Logger s_log = Logger.getLogger(Widget.class); @@ -98,7 +99,8 @@ public abstract class Widget extends BlockStylable implements Cloneable, BebopCo public abstract boolean isCompound(); /** - * Returns a string naming the type of this widget. Must be implemented by subclasses + * Returns a string naming the type of this widget. Must be implemented by + * subclasses */ protected abstract String getType(); @@ -362,11 +364,10 @@ public abstract class Widget extends BlockStylable implements Cloneable, BebopCo } /** - * Marks this widget as disabled, which has the effect of - * preventing the widget's value being submitted with - * the form, and will typically cause the widget to be - * 'grayed out' on the form. This method can only be called - * on unlocked widgets. + * Marks this widget as disabled, which has the effect of preventing the + * widget's value being submitted with the form, and will typically cause + * the widget to be 'grayed out' on the form. This method can only be + * called on unlocked widgets. */ public void setDisabled() { Assert.isUnlocked(this); @@ -374,7 +375,7 @@ public abstract class Widget extends BlockStylable implements Cloneable, BebopCo } /** - * Sets a popup hint for the widget + * Sets a popup hint for the widget. */ public void setHint(String hint) { Assert.isUnlocked(this); @@ -383,7 +384,8 @@ public abstract class Widget extends BlockStylable implements Cloneable, BebopCo /** - * Gets the default value in the parameter model for this element. */ + * Gets the default value in the parameter model for this element. + */ public String getDefaultValue() { Object o = m_parameterModel.getDefaultValue(); if (o==null) { diff --git a/ccm-core/src/com/arsdigita/core/Loader.java b/ccm-core/src/com/arsdigita/core/Loader.java index 3717e8923..89629340c 100755 --- a/ccm-core/src/com/arsdigita/core/Loader.java +++ b/ccm-core/src/com/arsdigita/core/Loader.java @@ -100,7 +100,9 @@ public class Loader extends PackageLoader { // Parameter Section // ///////////////////////////////////////////////////////////////////////////// private EmailParameter m_email = new EmailParameter("waf.admin.email"); - private StringParameter m_screen = new StringParameter("waf.admin.name.screen", Parameter.OPTIONAL, null) { + private StringParameter m_screen = new StringParameter("waf.admin.name.screen", + Parameter.OPTIONAL, + null) { @Override public Object getDefaultValue() { String email = getEmail(); @@ -334,63 +336,6 @@ public class Loader extends PackageLoader { } - /** - * . - * Note: Loading of Subsite is currently required by Login - * module otherwise Login doesn't work! - * - * @param rootNode - // * @deprecated will be removed without replacement. Naot needed anymore - */ - /* private void loadSubsite(SiteNode rootNode) { - s_log.debug("CoreLoader: Going to execute method loadSubsite()."); - String sDispatcher = ""; - - PackageInstance packageInstance = rootNode.getPackageInstance(); - if (packageInstance == null) { - throw new IllegalStateException - ("No package instance mounted at the root node"); - } - PackageType subsite = packageInstance.getType(); - - // getType() returns a disconnected object. To get a connected object - // we do a findByKey(key). - String packageKey = subsite.getKey(); - try { - subsite = PackageType.findByKey(packageKey); - } catch (DataObjectNotFoundException e) { - throw new IllegalStateException - ("Package Type with key \"" + packageKey + "\" was not found.\n"); - } - - // Set subsite dispatcher class. - subsite.setDispatcherClass(getDispatcher()); - } */ -// /** -// * Create Root Site Node for loadSubsite() -// * @return root node -// * @deprecated will be removed without replacement. Naot needed anymore -// */ -/* private SiteNode loadKernel() { - // Create Root Site Node - s_log.debug("CoreLoader: Going to execute method loadKernel()."); - - final SiteNode rootNode = SiteNode.createSiteNode(null, null); - - // Create Package Types and Instances - s_log.debug("loadKernel: creating Package Types and Instances."); - PackageType subsite = PackageType.create - ("acs-subsite", "ACS Subsite", "ACS Subsites", - "http://arsdigita.com/acs-subsite/"); - PackageInstance subsiteInstance = subsite.createInstance("Main Site"); - - // Mount instances. - s_log.debug("loadKernel: mount Instances."); - rootNode.mountPackage(subsiteInstance); - - s_log.debug("CoreLoader: Going to complete method loadKernel()."); - return rootNode; - } */ /** * Ensure that at least one User with universal "admin" permission exists * after installation. diff --git a/ccm-core/src/com/arsdigita/formbuilder/util/FormBuilderConfig.java b/ccm-core/src/com/arsdigita/formbuilder/FormBuilderConfig.java similarity index 85% rename from ccm-core/src/com/arsdigita/formbuilder/util/FormBuilderConfig.java rename to ccm-core/src/com/arsdigita/formbuilder/FormBuilderConfig.java index 1b9096a3e..ab2b7f1d9 100755 --- a/ccm-core/src/com/arsdigita/formbuilder/util/FormBuilderConfig.java +++ b/ccm-core/src/com/arsdigita/formbuilder/FormBuilderConfig.java @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ -package com.arsdigita.formbuilder.util; +package com.arsdigita.formbuilder; import com.arsdigita.runtime.AbstractConfig; import com.arsdigita.util.parameter.BooleanParameter; @@ -61,19 +61,26 @@ public final class FormBuilderConfig extends AbstractConfig { * point to the help page. If it starts with "/" then it is * assumed to be located on this server. If it starts with * anything else, it is assumed to be a link to a foreign site. - * This can be null is no help link should appear + * This can be null if no help link should appear. + * + * NOTE: As of version 6.6 and earlier the help function is not working. + * Returns null to deactivate the help link. */ public String getActionsHelpLink() { - return (String) get(m_actionsHelp); + // return (String) get(m_actionsHelp); + return null; } /** * This returns the string that can be used to create the URL to * point to the help page. - * This can be null is no help link should appear + * This can be null is no help link should appear + * + * NOTE: See deactivated help system above. */ public String getControlsHelpLink() { - return (String)get(m_controlsHelp); + // return (String)get(m_controlsHelp); + return null; } public boolean getInterpolateEmailActionsToAddress() { diff --git a/ccm-core/src/com/arsdigita/formbuilder/util/FormBuilderConfig_parameter.properties b/ccm-core/src/com/arsdigita/formbuilder/FormBuilderConfig_parameter.properties similarity index 100% rename from ccm-core/src/com/arsdigita/formbuilder/util/FormBuilderConfig_parameter.properties rename to ccm-core/src/com/arsdigita/formbuilder/FormBuilderConfig_parameter.properties diff --git a/ccm-core/src/com/arsdigita/formbuilder/ui/FormbuilderResources.properties b/ccm-core/src/com/arsdigita/formbuilder/FormbuilderResources.properties similarity index 77% rename from ccm-core/src/com/arsdigita/formbuilder/ui/FormbuilderResources.properties rename to ccm-core/src/com/arsdigita/formbuilder/FormbuilderResources.properties index f6f85a39f..e8a1f343e 100755 --- a/ccm-core/src/com/arsdigita/formbuilder/ui/FormbuilderResources.properties +++ b/ccm-core/src/com/arsdigita/formbuilder/FormbuilderResources.properties @@ -35,11 +35,11 @@ formbuilder.ui.you_are_about_to_delete_a_question=You are about to delete a ques formbuilder.ui.form_properties=Form Properties formbuilder.ui.view_persisted_form=View Persisted Form formbuilder.ui.move_it_here=[move it here] -formbuilder.ui.add_new=Add new -formbuilder.ui.action= action +formbuilder.ui.form_widget.add_new_label=Select a form widget to add: +formbuilder.ui.form_action.add_new_label=Add new form action: formbuilder.ui.form_widget= form widget formbuilder.ui.form_section= form section -formbuilder.ui.form_section_null_error= No form sections currently available +formbuilder.ui.form_section.null_error=No form sections currently available formbuilder.ui.specify_options=Specify Options formbuilder.ui.default_selection=Default selection formbuilder.ui.value=Value @@ -54,3 +54,13 @@ formbuilder.ui.add_a_question_for_parameter=Add a Question for Parameter formbuilder.ui.move_question_to_position_1=Move question to position (1- formbuilder.ui.edit=edit formbuilder.ui.delete=delete +formbuilder.ui.form_widget.create_button=Create selected form control widget +formbuilder.ui.form_section.add_new_label=Select a form section to add: +formbuilder.ui.form_section.add_button=Add selected form section +formbuilder.ui.form_section.select_one=-- Select a form section -- +formbuilder.ui.form_widget.select_one=-- Select a form control element -- +formbuilder.ui.form_widget.null_error=No widget selected. +formbuilder.ui.form_action.add_button=Add Form Action +formbuilder.ui.form_action.delete_confirm=Are you sure you wish to delete this action? +formbuilder.ui.move=move +formbuilder.ui.delete_confirm=Are you sure you wish to delete this widget? diff --git a/ccm-core/src/com/arsdigita/formbuilder/ui/FormbuilderResources_de.properties b/ccm-core/src/com/arsdigita/formbuilder/FormbuilderResources_de.properties similarity index 59% rename from ccm-core/src/com/arsdigita/formbuilder/ui/FormbuilderResources_de.properties rename to ccm-core/src/com/arsdigita/formbuilder/FormbuilderResources_de.properties index 66ef26c5a..aeabd592b 100644 --- a/ccm-core/src/com/arsdigita/formbuilder/ui/FormbuilderResources_de.properties +++ b/ccm-core/src/com/arsdigita/formbuilder/FormbuilderResources_de.properties @@ -10,20 +10,20 @@ formbuilder.ui.editors.default_value=Default Wert\: formbuilder.ui.editors.start_year=Beginn (Jahr) formbuilder.ui.editors.end_year=Ende (Jahr) formbuilder.ui.editors.value=Wert\: -formbuilder.ui.editors.add_option=Option hinzuf\u00FCgen +formbuilder.ui.editors.add_option=Option hinzuf\u00fcgen formbuilder.ui.editors.option_label=Option Label: -formbuilder.ui.editors.max_length=Max. L\u00E4nge\: +formbuilder.ui.editors.max_length=Max. L\u00e4nge\: formbuilder.ui.editors.width=Breite\: formbuilder.ui.editors.name=Widget Variablen Name\: formbuilder.ui.editors.description=Beschreibung\: formbuilder.ui.editors.to=An\: formbuilder.ui.editors.label=Widget Variable Label: formbuilder.ui.editors.UserEmailLabel=Widget Label: -formbuilder.ui.editors.height=H\u00F6he\: +formbuilder.ui.editors.height=H\u00f6he\: formbuilder.ui.editors.data_type=Datentyp\: formbuilder.ui.editors.answer_required=Antwort erforderlich\: -formbuilder.ui.editors.textfieldmsg=Dieses Feld bleibt leer, au\u00DFer es soll eine H\u00F6chzahl an Zeichen festgelegt werden, die eingetragen werden k\u00F6nnen. Wenn mehr als 3 Zeilen f\u00FCr eine Antwort ben\u00F6tigt werden, wird die Zahl in der Box "Breite" eingetragen. -formbuilder.ui.editors.textareamsg=Diese Felder bleiben leer, au\u00DFer es soll eine H\u00F6chzahl an Zeichen festgelegt werden, die eingetragen werden k\u00F6nnen.\t +formbuilder.ui.editors.textfieldmsg=Dieses Feld bleibt leer, au\u00dfer es soll eine H\u00f6chzahl an Zeichen festgelegt werden, die eingetragen werden k\u00f6nnen. Wenn mehr als 3 Zeilen f\u00fcr eine Antwort ben\u00f6tigt werden, wird die Zahl in der Box "Breite" eingetragen. +formbuilder.ui.editors.textareamsg=Diese Felder bleiben leer, au\u00dfer es soll eine H\u00f6chzahl an Zeichen festgelegt werden, die eingetragen werden k\u00f6nnen.\t formbuilder.ui.manage_questions_of_a_form=Manage Questions of a Form formbuilder.ui.label_to_be_ignored=label to be ignored formbuilder.ui.select_widget=Select Widget @@ -31,26 +31,36 @@ formbuilder.ui.move_question_to_position=Move question to position formbuilder.ui.editors.text_form_title=Text Body: formbuilder.ui.help=Hilfe formbuilder.ui.editors.heading_form_title=Heading: -formbuilder.ui.you_are_about_to_delete_a_question=Sie sind im Begriff, eine Frage zu l\u00F6schen +formbuilder.ui.you_are_about_to_delete_a_question=Sie sind im Begriff, eine Frage zu l\u00f6schen formbuilder.ui.form_properties=Formulareigenschaften formbuilder.ui.view_persisted_form=View Persisted Form formbuilder.ui.move_it_here=[hierhere verschieben] -formbuilder.ui.add_new=Neu Hinzuf\u00FCgen -formbuilder.ui.action= action +formbuilder.ui.form_widget.add_new_label=Auswahl eines neuen Formularelements: +formbuilder.ui.form_action.add_new_label=Eine neue Formularaktion hinzuf\u00fcgen: formbuilder.ui.form_widget= form widget formbuilder.ui.form_section= form section -formbuilder.ui.form_section_null_error= No form sections currently available +formbuilder.ui.form_section.null_error=Aktuell sind keine Formularsektionen verf\u00fcgbar. formbuilder.ui.specify_options=Specify Options formbuilder.ui.default_selection=Default Auswahl formbuilder.ui.value=Value formbuilder.ui.is_answer_required=Ist Anwort notwendig formbuilder.ui.what_is_the_datatype_of_the_answer=Was ist der Datentyp der Antwort formbuilder.ui.number_of_options_150_required=Anzahl Optionen (1-50, erforderlich) -formbuilder.util.return_to_index_page=Zur\u00FCck zur Index Seite +formbuilder.util.return_to_index_page=Zur\u00fcck zur Index Seite formbuilder.ui.editors.edit=editieren -formbuilder.ui.editors.delete=l\u00F6schen +formbuilder.ui.editors.delete=l\u00f6schen formbuilder.ui.add_a_question_at_position=Add a Question at Position formbuilder.ui.add_a_question_for_parameter=Add a Question for Parameter formbuilder.ui.move_question_to_position_1=Move question to position (1- -formbuilder.ui.edit=edit -formbuilder.ui.delete=l\u00F6schen +formbuilder.ui.edit=bearbeiten +formbuilder.ui.delete=l\u00f6schen +formbuilder.ui.form_widget.create_button=Formularelement erstellen +formbuilder.ui.form_section.add_new_label=Auswahl einer Formularsektion: +formbuilder.ui.form_section.add_button=Formularsektion hinzuf\u00fcgen +formbuilder.ui.form_section.select_one=-- Eine Formularsektion ausw\u00e4hlen -- +formbuilder.ui.form_widget.select_one=-- Ein Formularelement ausw\u00e4hlen -- +formbuilder.ui.form_widget.null_error=Es wurde kein Formularelement ausgew\u00e4hlt. +formbuilder.ui.form_action.add_button=Formularaktion hinzuf\u00fcgen +formbuilder.ui.form_action.delete_confirm=Sind sie sicher, diese Aktion zu l\u00f6schen? +formbuilder.ui.move=verschieben +formbuilder.ui.delete_confirm=Sind Sie sicher, dieses Element zu l\u00f6schen? diff --git a/ccm-core/src/com/arsdigita/formbuilder/FormbuilderResources_fr.properties b/ccm-core/src/com/arsdigita/formbuilder/FormbuilderResources_fr.properties new file mode 100755 index 000000000..e5e2cead3 --- /dev/null +++ b/ccm-core/src/com/arsdigita/formbuilder/FormbuilderResources_fr.properties @@ -0,0 +1,58 @@ +formbuilder.ui.hidden_field=Champ cach\u00e9: +formbuilder.ui.editors.from=De: +formbuilder.ui.editors.subject=Objet: +formbuilder.ui.editors.body=Contenu: +formbuilder.ui.editors.url=URL: +formbuilder.ui.editors.query=Requ\u00e8te +formbuilder.ui.editors.multiselect=S\u00e9lection multiple +formbuilder.ui.editors.default_value=Valeur par d\u00e9faut: +formbuilder.ui.editors.start_year=Ann\u00e9e de d\u00e9but +formbuilder.ui.editors.end_year=Ann\u00e9e de fin +formbuilder.ui.editors.value=Valeur: +formbuilder.ui.editors.add_option=Ajouter une option +formbuilder.ui.editors.option_label=Libell\u00e9 de l'option +formbuilder.ui.editors.max_length=Longueur maximum +formbuilder.ui.editors.width=Largeur +formbuilder.ui.editors.name=Nom: +formbuilder.ui.editors.description=Description: +formbuilder.ui.editors.to=A: +formbuilder.ui.editors.label=Libell\u00e9: +formbuilder.ui.editors.height=Hauteur: +formbuilder.ui.editors.data_type=Type de donn\u00e9e +formbuilder.ui.editors.answer_required=R\u00e9ponse obligatoire: +formbuilder.ui.manage_questions_of_a_form=Gestion des questions d'un formulaire +formbuilder.ui.label_to_be_ignored=libell\u00e9 \u00e0 ignorer +formbuilder.ui.select_widget=S\u00e9lectionner le Widget +formbuilder.ui.move_question_to_position=D\u00e9placer la question \u00e0 la position +formbuilder.ui.you_are_about_to_delete_a_question=Vous \u00eates sur le point d'effacer une question +formbuilder.ui.form_properties=Propri\u00e9t\u00e9 du formulaire +formbuilder.ui.view_persisted_form=Formulaire de vue persistante +formbuilder.ui.move_it_here=[d\u00e9placer ici] +formbuilder.ui.form_widget.add_new_label=Ajouter un(e) nouveau(elle): +formbuilder.ui.form_action.add_new_label=Add new form action: +formbuilder.ui.form_widget= formulaire widget +formbuilder.ui.form_section= formulaire section +formbuilder.ui.specify_options=Sp\u00e9cifier les options +formbuilder.ui.default_selection=S\u00e9lection par d\u00e9faut +formbuilder.ui.value=Valeur +formbuilder.ui.is_answer_required=Est-ce que la r\u00e9ponse est obligatoire +formbuilder.ui.what_is_the_datatype_of_the_answer=Quel est le type de donn\u00e9es de la r\u00e9ponse +formbuilder.ui.number_of_options_150_required=Nombre d'option (1-50, obligatoire) +formbuilder.util.return_to_index_page=Retour \u00e0 la page d'index +formbuilder.ui.editors.edit=modifier +formbuilder.ui.editors.delete=effacer +formbuilder.ui.add_a_question_at_position=Ajouter une question \u00e0 la position +formbuilder.ui.add_a_question_for_parameter=ajouter une question pour le param\u00e8tre +formbuilder.ui.move_question_to_position_1=D\u00e9placer la question \u00e0 la position (1- +formbuilder.ui.edit=modifier +formbuilder.ui.delete=effacer +formbuilder.ui.form_widget.create_button=Create selected form control widget +formbuilder.ui.form_section.add_new_label=Select a form section to add: +formbuilder.ui.form_section.add_button=Add selected form section +formbuilder.ui.form_section.select_one=-- Select a form section -- +formbuilder.ui.form_widget.select_one=-- Select a form control element -- +formbuilder.ui.form_widget.null_error=No widget selected. +formbuilder.ui.form_action.add_button=Add Form Action +formbuilder.ui.form_action.delete_confirm=Are you sure you wish to delete this action? +formbuilder.ui.move=move +formbuilder.ui.delete_confirm=Are you sure you wish to delete this widget? diff --git a/ccm-core/src/com/arsdigita/formbuilder/Initializer.java.nolongerInUse b/ccm-core/src/com/arsdigita/formbuilder/Initializer.java.nolongerInUse deleted file mode 100755 index b091dd3b3..000000000 --- a/ccm-core/src/com/arsdigita/formbuilder/Initializer.java.nolongerInUse +++ /dev/null @@ -1,172 +0,0 @@ -/* - * Copyright (C) 2001-2004 Red Hat Inc. All Rights Reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.formbuilder; - -import com.arsdigita.domain.DataObjectNotFoundException; - -import com.arsdigita.kernel.PackageType; -import com.arsdigita.kernel.PackageInstance; -import com.arsdigita.kernel.SiteNode; -// import com.arsdigita.kernel.Stylesheet; - -import com.arsdigita.persistence.SessionManager; -import com.arsdigita.persistence.TransactionContext; - -import com.arsdigita.initializer.Configuration; -import com.arsdigita.initializer.InitializationException; - -import org.apache.log4j.Logger; - - - -// //////////////////////////////////////////////////////////////////////// -// -// This old style Initializer is obviously no longer used (for a long time -// and several releases. Formbuilder as an own application is deprecated and -// replaced by content type forms. -// -// Removed. -// -// It is a loader task (loading package type and instance) and should be -// handled there it required in the future. -// -// //////////////////////////////////////////////////////////////////////// - - - -/** - * Registers the formbuilder package type and creates an instance - * that is mounted under formbuilder (this is done only once). - * - * @author Peter Marklund - * @version $Id: Initializer.java 287 2005-02-22 00:29:02Z sskracic $ - */ -public class Initializer - implements com.arsdigita.initializer.Initializer { - - private Configuration m_conf = new Configuration(); - - private static final Logger log = - Logger.getLogger(Initializer.class); - - /** - * Constructor - * - * @throws InitializationException - */ - public Initializer() throws InitializationException { - - } - - /** - * Returns the configuration object used by this initializer. - */ - public Configuration getConfiguration() { - return m_conf; - } - - - /** - * Called on startup. Note. As you can not find a call - * to this method in enterprise.ini, this method - * may appear to execute mysteriously. - * However, the process that runs through enterprise.ini - * automitically calls the startup() method of any - * class that implements com.arsdigita.util.initializer.Initializer - * present in enterprise.ini - */ - public void startup() { - - log.info("FormBuilder Initializer starting."); - - TransactionContext txn = SessionManager.getSession() - .getTransactionContext(); - txn.beginTxn(); - - checkFormBuilderSetup(); - - txn.commitTxn(); - } - - private void checkFormBuilderSetup() { - /* This checks to see if a package by this name - * is present. If it isn't, setupFormBuilder - * will do the necessary setup such as add the - * package type, package instance, site node - * and style sheet. - */ - try { - log.debug("FormBuilder Initializer - verifying setup."); - PackageType.findByKey("formbuilder"); - } catch (DataObjectNotFoundException e) { - setupFormBuilder(); - } - } - - - private void setupFormBuilder() { - log.debug("FormBuilder Initializer - setting up new package"); - - /** Adding the package type to the installation - */ - - PackageType FormBuilderType = PackageType.create - ("formbuilder", "Form Builder", "Form Builders", - "http://arsdigita.com/formbuilder"); - log.debug("Just added package type FormBuilder"); - - - /** Adding the node and the package instance - * on that node. - */ - - SiteNode FormBuilderTypeNode = SiteNode.createSiteNode("formbuilder"); - PackageInstance formBuilder = FormBuilderType.createInstance("FormBuilderType"); - - /** Specifying the URL stub for this package instance. - */ - FormBuilderTypeNode.mountPackage(formBuilder); - FormBuilderTypeNode.save(); - - - /** Adding a style sheet - */ -// Stylesheet FormBuilderSheet = Stylesheet.createStylesheet ("/packages/formbuilder/xsl/formbuilder.xsl"); -// FormBuilderType.addStylesheet(FormBuilderSheet); - - - /** Mapping the package type to a dispatcher - * class - */ - FormBuilderType.setDispatcherClass("com.arsdigita.formbuilder.FormBuilderDispatcher"); - - /** Saving changes - */ - FormBuilderType.save(); - - } - - /** - * Called on shutdown. It's probably not a good idea to depend on this - * being called. - **/ - public void shutdown() { - } - -} diff --git a/ccm-core/src/com/arsdigita/formbuilder/installer/Initializer.java.nolongerInUse b/ccm-core/src/com/arsdigita/formbuilder/installer/Initializer.java.nolongerInUse deleted file mode 100755 index 3ccbe1863..000000000 --- a/ccm-core/src/com/arsdigita/formbuilder/installer/Initializer.java.nolongerInUse +++ /dev/null @@ -1,235 +0,0 @@ -/* - * Copyright (C) 2002-2004 Red Hat Inc. All Rights Reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.formbuilder.installer; - -import com.arsdigita.formbuilder.BebopObjectType; -import com.arsdigita.formbuilder.MetaObject; - -import com.arsdigita.domain.DataObjectNotFoundException; -import com.arsdigita.persistence.SessionManager; -import com.arsdigita.persistence.TransactionContext; -import com.arsdigita.initializer.Configuration; -import com.arsdigita.initializer.InitializationException; -import com.arsdigita.formbuilder.PersistentProcessListener; -import com.arsdigita.kernel.BaseInitializer; -import java.util.Iterator; -import java.util.List; - -import com.arsdigita.formbuilder.PersistentDataQuery; -import com.arsdigita.formbuilder.PersistentComponent; - - -// ///////////////////////////////////////////////////////////////// -// -// REPLACED by formbuilder.util.FormbuilderSetup -// Not a initializer tast bud a loader task -// -// ///////////////////////////////////////////////////////////////// - - -/** - * Initializer - * - * @author Daniel Berrange - * @version $Revision: #10 $ $Date: 2004/08/16 $ - */ -public class Initializer extends BaseInitializer { - - public static String WIDGET_TYPES = "widgetTypes"; - public static String PROCESS_LISTENER_TYPES = "processListenerTypes"; - public static String DATA_QUERIES = "dataQueries"; - private Configuration m_conf = new Configuration(); - - public Initializer() throws InitializationException { - m_conf.initParameter(WIDGET_TYPES, - "The persistent widget types", - List.class); - m_conf.initParameter(PROCESS_LISTENER_TYPES, - "The persistent process listener types", - List.class); - m_conf.initParameter(DATA_QUERIES, - "The queries for the data driven select box", - List.class); - } - - /* Quasimodo: BEGIN */ - /** - * Initializer - * - * A new Initializer, which doesn't use the Configuration and the enterprise - * init. This initializer can be called during DomainInitEvents, so it is - * ready for the new Initializer framework. Configuration will be read from - * parameters (for now - maybe there's wil be a better way in the future). - * - * @throws InitializationException - */ - public Initializer(List widgets, List processListeners, List dataQueries) throws InitializationException { - TransactionContext txn = SessionManager.getSession().getTransactionContext(); - txn.beginTxn(); - - // Load widgets, processListeners and dataQueries from parameters - loadMetaObjects(widgets, PersistentComponent.class); - loadMetaObjects(processListeners, PersistentProcessListener.class); - loadDataQueries(dataQueries); - - txn.commitTxn(); - } - - /** - * Returns the configuration object used by this initializer. - **/ - public Configuration getConfiguration() { - return m_conf; - } - - /** - * Called on startup. Note. As you can not find a call - * to this method in enterprise.ini, this method - * may appear to execute mysteriously. - * However, the process that runs through enterprise.ini - * automitically calls the startup() method of any - * class that implements com.arsdigita.util.initializer.Initializer - * present in enterprise.ini - * - **/ - protected void doStartup() { - - TransactionContext txn = SessionManager.getSession().getTransactionContext(); - txn.beginTxn(); - - List widgets = (List) m_conf.getParameter(WIDGET_TYPES); - loadMetaObjects(widgets, PersistentComponent.class); - - List listeners = (List) m_conf.getParameter(PROCESS_LISTENER_TYPES); - loadMetaObjects(listeners, PersistentProcessListener.class); - - List queries = (List) m_conf.getParameter(DATA_QUERIES); - loadDataQueries(queries); - - txn.commitTxn(); - } - - /** - * Called on shutdown. It's probably not a good idea to depend on this - * being called. - **/ - protected void doShutdown() { - } - - public BebopObjectType getObjectType(String name, - Class type) { - BebopObjectType objectType = null; - try { - objectType = BebopObjectType.findByClass(name, - type); - } catch (DataObjectNotFoundException ex) { - objectType = BebopObjectType.create(name, - type); - objectType.save(); - } - return objectType; - } - - protected void loadMetaObjects(List objects, Class type) - throws InitializationException { - - // If the objects list is not null, load the object list into the database - // pboy: Obviously, this is a Loader task. - if (objects != null) { - - // XXX we don't yet delete types which are no longer in the list - Iterator objects_i = objects.iterator(); - while (objects_i.hasNext()) { - List object = (List) objects_i.next(); - - String appName = (String) object.get(0); - String prettyName = (String) object.get(1); - String prettyPlural = (String) object.get(2); - String className = (String) object.get(3); - String propertiesForm = (String) object.get(4); - - try { - Class.forName(className); - } catch (ClassNotFoundException ex) { - throw new InitializationException("cannot find class " + className); - } - try { - Class.forName(propertiesForm); - } catch (ClassNotFoundException ex) { - throw new InitializationException("cannot find class " + propertiesForm); - } - - try { - MetaObject mo = MetaObject.findByClassName(getObjectType(appName, - type), - className); - - mo.setPrettyName(prettyName); - mo.setPrettyPlural(prettyPlural); - mo.setWidgetClassName(className); - mo.setPropertiesFormName(propertiesForm); - - mo.save(); - } catch (DataObjectNotFoundException ex) { - MetaObject mo = MetaObject.create(getObjectType(appName, - type), - prettyName, - prettyPlural, - className, - propertiesForm); - mo.save(); - } - } - } - } - - protected void loadDataQueries(List objects) - throws InitializationException { - - // If the objects list is not null, load the object list into the database - if (objects != null) { - - // XXX we don't yet delete types which are no longer in the list - Iterator objects_i = objects.iterator(); - while (objects_i.hasNext()) { - List object = (List) objects_i.next(); - - String appName = (String) object.get(0); - String name = (String) object.get(1); - String description = (String) object.get(2); - - try { - PersistentDataQuery q = PersistentDataQuery.findByName(getObjectType(appName, - PersistentDataQuery.class), - name); - - q.setName(name); - q.setDescription(description); - - q.save(); - } catch (DataObjectNotFoundException ex) { - PersistentDataQuery q = PersistentDataQuery.create(getObjectType(appName, - PersistentDataQuery.class), - description, name); - q.save(); - } - } - } - } -} diff --git a/ccm-core/src/com/arsdigita/formbuilder/installer/package.html.nolongerInUse b/ccm-core/src/com/arsdigita/formbuilder/installer/package.html.nolongerInUse deleted file mode 100755 index bd85a5942..000000000 --- a/ccm-core/src/com/arsdigita/formbuilder/installer/package.html.nolongerInUse +++ /dev/null @@ -1,11 +0,0 @@ - - - - Package com.arsdigita. formbuilder.installer - - -

-Installer for formbuilder service. -

- - diff --git a/ccm-core/src/com/arsdigita/formbuilder/ui/BaseEditAddObserver.java b/ccm-core/src/com/arsdigita/formbuilder/ui/BaseEditAddObserver.java index a88725c5f..45e595bbf 100755 --- a/ccm-core/src/com/arsdigita/formbuilder/ui/BaseEditAddObserver.java +++ b/ccm-core/src/com/arsdigita/formbuilder/ui/BaseEditAddObserver.java @@ -18,47 +18,49 @@ */ package com.arsdigita.formbuilder.ui; -import com.arsdigita.formbuilder.CompoundComponent; -import com.arsdigita.formbuilder.PersistentComponent; -import com.arsdigita.formbuilder.PersistentHidden; -import com.arsdigita.formbuilder.PersistentLabel; -import com.arsdigita.formbuilder.util.GlobalizationUtil ; - import com.arsdigita.bebop.BaseLink; import com.arsdigita.bebop.BoxPanel; import com.arsdigita.bebop.Component; import com.arsdigita.bebop.FormSection; import com.arsdigita.bebop.Label; +import com.arsdigita.formbuilder.CompoundComponent; +import com.arsdigita.formbuilder.PersistentComponent; +import com.arsdigita.formbuilder.PersistentHidden; +import com.arsdigita.formbuilder.PersistentLabel; +import com.arsdigita.formbuilder.util.GlobalizationUtil ; +import com.arsdigita.globalization.GlobalizedMessage; import org.apache.log4j.Logger; /** - * This is an extension of the BaseAddObserver which - * handles the editing of controls on a form by - * adding additional links on each row. + * This is an extension of the BaseAddObserver which handles the editing of + * controls on a form by adding additional links on each row. */ public abstract class BaseEditAddObserver extends BaseAddObserver { + private static final Logger s_log = Logger.getLogger(BaseEditAddObserver.class); + /** + * + * @param formSection + * @param component + * @param componentPosition + */ public void beforeAddingComponent(FormSection formSection, PersistentComponent component, int componentPosition) { super.beforeAddingComponent(formSection, component, componentPosition); - - // Propagate the 3 column layout to form sections - /* - try { - CompoundComponent fs = (CompoundComponent)componentFactory; - fs.setContainer(new ColumnPanel(3, true)); - } catch (ClassCastException ex) { - // Nada - } - */ } + /** + * + * @param persistentComponent + * @param componentPosition + * @param component + */ public void addingComponent(PersistentComponent persistentComponent, int componentPosition, Component component) { @@ -67,15 +69,23 @@ public abstract class BaseEditAddObserver extends BaseAddObserver { component); } + /** + * + * @param formSection + * @param component + * @param componentPosition + */ public void afterAddingComponent(FormSection formSection, PersistentComponent component, int componentPosition) { + super.afterAddingComponent(formSection, component, componentPosition); if (component instanceof PersistentHidden) { PersistentHidden hidden = (PersistentHidden)component; - formSection.add(new Label(GlobalizationUtil.globalize("formbuilder.ui.hidden_field"))); + formSection.add(new Label(GlobalizationUtil.globalize( + "formbuilder.ui.hidden_field"))); formSection.add(new Label(hidden.getParameterName())); } @@ -86,15 +96,19 @@ public abstract class BaseEditAddObserver extends BaseAddObserver { s_log.debug("Adding widget " + component.getClass().getName()); if (component.isEditable()) { + // createLink implementation creates the name and the GlobMsg BaseLink edit = createLink("edit", component); b.add(edit); } + // createLink implementation creates the name and the GlobMsg BaseLink move = createLink("move", component); b.add(move); + // createLink implementation creates the name and the GlobMsg BaseLink delete = createLink("delete", component); - delete.setConfirmation("Are you sure you wish to delete this widget?"); + delete.setConfirmation(GlobalizationUtil.globalize( + "formbuilder.ui.delete_confirm")); b.add(delete); if (component instanceof CompoundComponent) { @@ -108,7 +122,10 @@ public abstract class BaseEditAddObserver extends BaseAddObserver { /** * This method is use to create a link for editing * a component. + * It is the respnsibility of the implementation to provide a + * corresponding GlobalizedMessage for the label of the component name. */ - protected abstract BaseLink createLink(String label, + protected abstract BaseLink createLink(String name, PersistentComponent component); + } diff --git a/ccm-core/src/com/arsdigita/formbuilder/ui/ControlEditor.java b/ccm-core/src/com/arsdigita/formbuilder/ui/ControlEditor.java index 83455f08a..a2a61d483 100755 --- a/ccm-core/src/com/arsdigita/formbuilder/ui/ControlEditor.java +++ b/ccm-core/src/com/arsdigita/formbuilder/ui/ControlEditor.java @@ -18,13 +18,6 @@ */ package com.arsdigita.formbuilder.ui; -import com.arsdigita.formbuilder.PersistentComponent; -import com.arsdigita.formbuilder.PersistentForm; -import com.arsdigita.formbuilder.PersistentFormSection; -import com.arsdigita.formbuilder.PersistentWidget; -import com.arsdigita.formbuilder.WidgetLabel; -import com.arsdigita.formbuilder.util.FormBuilderUtil; -import com.arsdigita.formbuilder.util.GlobalizationUtil; import com.arsdigita.bebop.BaseLink; import com.arsdigita.bebop.BoxPanel; @@ -52,6 +45,14 @@ import com.arsdigita.bebop.form.Widget; import com.arsdigita.bebop.parameters.BigDecimalParameter; import com.arsdigita.bebop.util.Traversal; import com.arsdigita.domain.DomainObjectFactory; +import com.arsdigita.formbuilder.PersistentComponent; +import com.arsdigita.formbuilder.PersistentForm; +import com.arsdigita.formbuilder.PersistentFormSection; +import com.arsdigita.formbuilder.PersistentWidget; +import com.arsdigita.formbuilder.WidgetLabel; +import com.arsdigita.formbuilder.util.FormBuilderUtil; +import com.arsdigita.formbuilder.util.GlobalizationUtil; +import com.arsdigita.globalization.GlobalizedMessage; import com.arsdigita.persistence.OID; import com.arsdigita.util.UncheckedWrapperException; import com.arsdigita.web.RedirectSignal; @@ -62,10 +63,11 @@ import java.math.BigDecimal; import org.apache.log4j.Logger; /** - * This class provides a basic UI component for editing the - * controls on a persistent form. It is designed to be dropped - * into any page without requiring any significant additional - * infrasructure + * This class provides a basic UI component for editing the controls on a + * persistent form. + * + * It is designed to be dropped into any page without requiring any significant + * additional infrasructure */ public class ControlEditor extends SimpleContainer { private static final Logger s_log = Logger.getLogger( ControlEditor.class ); @@ -81,9 +83,8 @@ public class ControlEditor extends SimpleContainer { private MoveControl m_move_control; /** - * Constructor. Creates a new control editor widget, - * for editing the form specified in the single - * selection model. The key returned by the single + * Constructor creates a new control editor widget, for editing the form + * specified in the single selection model. The key returned by the single * selection model should be an instance of the * {@link java.math.BigDecimal} class. * @@ -96,15 +97,13 @@ public class ControlEditor extends SimpleContainer { } /** - * Constructor. Creates a new control editor widget, - * for editing the form specified in the single - * selection model. The key returned by the single + * Constructor creates a new control editor widget, for editing the form + * specified in the single selection model. The key returned by the single * selection model should be an instance of the * {@link java.math.BigDecimal} class. * - * This constructor also allows the programmer - * to turn on the use of form sections, although - * they must also call the setFormSectionModelBuilder + * This constructor also allows the programmer to turn on the use of + * form sections, although they must also call the setFormSectionModelBuilder * method to populate the list box. * * @param app the application type @@ -120,6 +119,8 @@ public class ControlEditor extends SimpleContainer { m_new_control = new NewControl(app); m_new_section = new NewSection(form); + // NOTE: as of version 6.6 (including earlier versions) the help + // system doesn't work at all. Config should return null constant. String helpURL = FormBuilderUtil.getConfig().getControlsHelpLink(); if (helpURL != null) { add(new Link(new Label(GlobalizationUtil.globalize @@ -185,7 +186,7 @@ public class ControlEditor extends SimpleContainer { } public void respond(PageState state) - throws javax.servlet.ServletException { + throws javax.servlet.ServletException { super.respond(state); String name = state.getControlEventName(); @@ -327,7 +328,8 @@ public class ControlEditor extends SimpleContainer { DomainObjectFactory.newInstance( formOID ); if (addItemEditObserver(state)) { - section.setComponentAddObserver(new ItemEditAddObserver(ControlEditor.this, state)); + section.setComponentAddObserver(new + ItemEditAddObserver(ControlEditor.this, state)); section.setFormContainer(new ColumnPanel(3)); } else { section.setFormContainer(new ColumnPanel(2)); @@ -369,15 +371,37 @@ public class ControlEditor extends SimpleContainer { m_state = state; } + /** + * + * @param dest + * @param component + * @return + * @deprecated + */ protected BaseLink createLink(String dest, PersistentComponent component) { + + GlobalizedMessage label; + if (dest == "delete") { + label = GlobalizationUtil.globalize("formbuilder.ui.delete"); + } else if (dest == "move") { + label = GlobalizationUtil.globalize("formbuilder.ui.move"); + } else { + label = GlobalizationUtil.globalize("formbuilder.ui.edit"); + } + return new CallbackLink(m_handler, - "[" + dest + "]", + // "[" + dest + "]", + label, dest, component.getID().toString()); } + /** + * + */ private class CallbackLink extends ControlLink { + Component m_handler; String m_action; String m_component; @@ -393,6 +417,17 @@ public class ControlEditor extends SimpleContainer { m_component = component; } + public CallbackLink(Component handler, + GlobalizedMessage label, + String action, + String component) { + super(new Label(label)); + + m_handler = handler; + m_action = action; + m_component = component; + } + public void setControlEvent(PageState state) { state.setControlEvent(m_handler, m_action, m_component); } diff --git a/ccm-core/src/com/arsdigita/formbuilder/ui/ControlProperties.java b/ccm-core/src/com/arsdigita/formbuilder/ui/ControlProperties.java index 794731fd2..f06c64a15 100755 --- a/ccm-core/src/com/arsdigita/formbuilder/ui/ControlProperties.java +++ b/ccm-core/src/com/arsdigita/formbuilder/ui/ControlProperties.java @@ -34,12 +34,25 @@ import com.arsdigita.formbuilder.PersistentComponent; import com.arsdigita.util.UncheckedWrapperException; +/** + * + * + */ public class ControlProperties extends MetaObjectProperties { + private SingleSelectionModel m_form; private SingleSelectionModel m_type; private SingleSelectionModel m_control; + /** + * Constructor. + * + * @param form + * @param type + * @param control + * @param app + */ public ControlProperties(SingleSelectionModel form, SingleSelectionModel type, SingleSelectionModel control, @@ -54,6 +67,11 @@ public class ControlProperties extends MetaObjectProperties { } + /** + * + * @param state + * @param visible + */ public void setVisible(PageState state, boolean visible) { super.setVisible(state, visible); @@ -73,7 +91,8 @@ public class ControlProperties extends MetaObjectProperties { } else if (type != null) { setFormVisible(state, type); } else { - throw new RuntimeException("Neither control or type parameters are set"); + throw new RuntimeException( + "Neither control or type parameters are set"); } } } @@ -101,7 +120,9 @@ public class ControlProperties extends MetaObjectProperties { PropertiesEditor e = new PropertiesEditor(f); return e; } catch (ClassCastException ex2) { - throw new UncheckedWrapperException("Editor must be a PropertiesEditor or PropertiesForm", ex2); + throw new UncheckedWrapperException( + "Editor must be a PropertiesEditor or PropertiesForm", + ex2); } } } diff --git a/ccm-core/src/com/arsdigita/formbuilder/ui/FormbuilderResources_fr.properties b/ccm-core/src/com/arsdigita/formbuilder/ui/FormbuilderResources_fr.properties deleted file mode 100755 index 738b87e2d..000000000 --- a/ccm-core/src/com/arsdigita/formbuilder/ui/FormbuilderResources_fr.properties +++ /dev/null @@ -1,48 +0,0 @@ -formbuilder.ui.hidden_field=Champ caché: -formbuilder.ui.editors.from=De: -formbuilder.ui.editors.subject=Objet: -formbuilder.ui.editors.body=Contenu: -formbuilder.ui.editors.url=URL: -formbuilder.ui.editors.query=Requète -formbuilder.ui.editors.multiselect=Sélection multiple -formbuilder.ui.editors.default_value=Valeur par défaut: -formbuilder.ui.editors.start_year=Année de début -formbuilder.ui.editors.end_year=Année de fin -formbuilder.ui.editors.value=Valeur: -formbuilder.ui.editors.add_option=Ajouter une option -formbuilder.ui.editors.option_label=Libellé de l'option -formbuilder.ui.editors.max_length=Longueur maximum -formbuilder.ui.editors.width=Largeur -formbuilder.ui.editors.name=Nom: -formbuilder.ui.editors.description=Description: -formbuilder.ui.editors.to=A: -formbuilder.ui.editors.label=Libellé: -formbuilder.ui.editors.height=Hauteur: -formbuilder.ui.editors.data_type=Type de donnée -formbuilder.ui.editors.answer_required=Réponse obligatoire: -formbuilder.ui.manage_questions_of_a_form=Gestion des questions d'un formulaire -formbuilder.ui.label_to_be_ignored=libellé à ignorer -formbuilder.ui.select_widget=Sélectionner le Widget -formbuilder.ui.move_question_to_position=Déplacer la question à la position -formbuilder.ui.you_are_about_to_delete_a_question=Vous êtes sur le point d'effacer une question -formbuilder.ui.form_properties=Propriété du formulaire -formbuilder.ui.view_persisted_form=Formulaire de vue persistante -formbuilder.ui.move_it_here=[déplacer ici] -formbuilder.ui.add_new=Ajouter un(e) nouveau(elle) -formbuilder.ui.action= action -formbuilder.ui.form_widget= formulaire widget -formbuilder.ui.form_section= formulaire section -formbuilder.ui.specify_options=Spécifier les options -formbuilder.ui.default_selection=Sélection par défaut -formbuilder.ui.value=Valeur -formbuilder.ui.is_answer_required=Est-ce que la réponse est obligatoire -formbuilder.ui.what_is_the_datatype_of_the_answer=Quel est le type de données de la réponse -formbuilder.ui.number_of_options_150_required=Nombre d'option (1-50, obligatoire) -formbuilder.util.return_to_index_page=Retour à la page d'index -formbuilder.ui.editors.edit=modifier -formbuilder.ui.editors.delete=effacer -formbuilder.ui.add_a_question_at_position=Ajouter une question à la position -formbuilder.ui.add_a_question_for_parameter=ajouter une question pour le paramètre -formbuilder.ui.move_question_to_position_1=Déplacer la question à la position (1- -formbuilder.ui.edit=modifier -formbuilder.ui.delete=effacer diff --git a/ccm-core/src/com/arsdigita/formbuilder/ui/MoveControl.java b/ccm-core/src/com/arsdigita/formbuilder/ui/MoveControl.java index d2f276250..128c1450b 100755 --- a/ccm-core/src/com/arsdigita/formbuilder/ui/MoveControl.java +++ b/ccm-core/src/com/arsdigita/formbuilder/ui/MoveControl.java @@ -16,15 +16,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ -package com.arsdigita.formbuilder.ui; -import com.arsdigita.formbuilder.PersistentComponent; -import com.arsdigita.formbuilder.PersistentForm; -import com.arsdigita.formbuilder.PersistentFormSection; -import com.arsdigita.formbuilder.PersistentWidget; -import com.arsdigita.formbuilder.WidgetLabel; -import com.arsdigita.formbuilder.ui.BaseAddObserver; -import com.arsdigita.formbuilder.util.GlobalizationUtil ; +package com.arsdigita.formbuilder.ui; import com.arsdigita.bebop.ColumnPanel; import com.arsdigita.bebop.Component; @@ -39,6 +32,15 @@ import com.arsdigita.bebop.MetaForm; import com.arsdigita.bebop.PageState; import com.arsdigita.bebop.SingleSelectionModel; import com.arsdigita.domain.DomainObjectFactory; +import com.arsdigita.formbuilder.PersistentComponent; +import com.arsdigita.formbuilder.PersistentForm; +import com.arsdigita.formbuilder.PersistentFormSection; +import com.arsdigita.formbuilder.PersistentWidget; +import com.arsdigita.formbuilder.WidgetLabel; +import com.arsdigita.formbuilder.ui.BaseAddObserver; +import com.arsdigita.formbuilder.util.GlobalizationUtil ; +import com.arsdigita.globalization.Globalized; +import com.arsdigita.globalization.GlobalizedMessage; import com.arsdigita.persistence.OID; import java.math.BigDecimal; @@ -148,7 +150,7 @@ public class MoveControl extends MetaForm { PersistentForm form = (PersistentForm)section; return (Form)form.createComponent(); } catch (ClassCastException ex) { - Form form = new Form("view_form", new ColumnPanel(1));//, new BoxPanel(BoxPanel.HORIZONTAL)); + Form form = new Form("view_form", new ColumnPanel(1)); form.add((FormSection)section.createComponent()); return form; } @@ -245,16 +247,22 @@ public class MoveControl extends MetaForm { } protected void addLabel(FormSection form) { - Label l = new Label(GlobalizationUtil.globalize("formbuilder.ui.move_it_here")); + Label l = new Label(GlobalizationUtil + .globalize("formbuilder.ui.move_it_here")); form.add(l, GridPanel.FULL_WIDTH); } protected void addLink(FormSection form, int row) { - ControlLink l = new MoveLink("[move it here]", row); + ControlLink l = new MoveLink(GlobalizationUtil.globalize( + "formbuilder.ui.move_it_here"), + row); form.add(l, GridPanel.FULL_WIDTH); } + /** + * Private classMoveLink extends ControlLonk to handle the row. + */ private class MoveLink extends ControlLink { int m_row; @@ -264,8 +272,16 @@ public class MoveControl extends MetaForm { m_row = row; } + public MoveLink(GlobalizedMessage label, + int row) { + super(new Label(label)); + m_row = row; + } + public void setControlEvent(PageState state) { - state.setControlEvent(m_handler, "move", (new Integer(m_row)).toString()); + state.setControlEvent(m_handler, + "move", + (new Integer(m_row)).toString()); } } } diff --git a/ccm-core/src/com/arsdigita/formbuilder/ui/NewAction.java b/ccm-core/src/com/arsdigita/formbuilder/ui/NewAction.java index f3667f536..5ac5e5128 100755 --- a/ccm-core/src/com/arsdigita/formbuilder/ui/NewAction.java +++ b/ccm-core/src/com/arsdigita/formbuilder/ui/NewAction.java @@ -48,7 +48,8 @@ public class NewAction extends Form { FormSection fs = new FormSection(new BoxPanel(BoxPanel.HORIZONTAL)); - fs.add(new Label(GlobalizationUtil.globalize("formbuilder.ui.add_new"))); + fs.add(new Label(GlobalizationUtil.globalize( + "formbuilder.ui.form_action.add_new_label"))); m_selection = new ParameterSingleSelectionModel(new BigDecimalParameter("type")); @@ -56,12 +57,13 @@ public class NewAction extends Form { loadComponents(app); fs.add(m_type); - fs.add(new Label(GlobalizationUtil.globalize("formbuilder.ui.action"))); - fs.add(new Submit("Add")); + fs.add(new Submit(GlobalizationUtil.globalize( + "formbuilder.ui.form_action.add_button"))); add(fs); } + @Override public void register(Page page) { super.register(page); page.addComponentStateParam(this, @@ -74,8 +76,9 @@ public class NewAction extends Form { */ protected void loadComponents(String app) { try { - MetaObjectCollection objects = MetaObject.getWidgets(app, - PersistentProcessListener.class); + MetaObjectCollection objects = MetaObject + .getWidgets(app, + PersistentProcessListener.class); objects.addOrder(MetaObject.PRETTY_NAME); while (objects.next()) { diff --git a/ccm-core/src/com/arsdigita/formbuilder/ui/NewControl.java b/ccm-core/src/com/arsdigita/formbuilder/ui/NewControl.java index 70419c584..62bc2820b 100755 --- a/ccm-core/src/com/arsdigita/formbuilder/ui/NewControl.java +++ b/ccm-core/src/com/arsdigita/formbuilder/ui/NewControl.java @@ -16,73 +16,107 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ + package com.arsdigita.formbuilder.ui; -import com.arsdigita.formbuilder.util.GlobalizationUtil ; - -import com.arsdigita.formbuilder.MetaObject; -import com.arsdigita.formbuilder.MetaObjectCollection; - import com.arsdigita.bebop.BoxPanel; -import com.arsdigita.bebop.Form; -import com.arsdigita.bebop.FormProcessException; -import com.arsdigita.bebop.Label; - import com.arsdigita.bebop.event.FormInitListener; import com.arsdigita.bebop.event.FormSectionEvent; +import com.arsdigita.bebop.Form; +import com.arsdigita.bebop.FormProcessException; +import com.arsdigita.bebop.FormSection; import com.arsdigita.bebop.form.Option; import com.arsdigita.bebop.form.SingleSelect; import com.arsdigita.bebop.form.Submit; - - -import com.arsdigita.domain.DataObjectNotFoundException; - -import com.arsdigita.util.UncheckedWrapperException; +import com.arsdigita.bebop.Label; import com.arsdigita.bebop.ParameterSingleSelectionModel; import com.arsdigita.bebop.parameters.BigDecimalParameter; import com.arsdigita.bebop.SingleSelectionModel; -import com.arsdigita.bebop.FormSection; import com.arsdigita.bebop.Page; +import com.arsdigita.bebop.parameters.NotNullValidationListener; +import com.arsdigita.domain.DataObjectNotFoundException; +import com.arsdigita.formbuilder.MetaObject; +import com.arsdigita.formbuilder.MetaObjectCollection; import com.arsdigita.formbuilder.PersistentComponent; +import com.arsdigita.formbuilder.util.GlobalizationUtil ; +import com.arsdigita.util.UncheckedWrapperException; - +/** + * Class to create and manage a new control widget selected from a list of + * available form widets. + * + * + */ public class NewControl extends Form { + + /** */ ParameterSingleSelectionModel m_selection; + /** */ SingleSelect m_type; + /** + * NewControl constructor, creates a form to select from a list of + * available form widgets and creates one upon request. Typically it is + * used by pachages which interactively create user input forms, e.g. the + * form item content type. + * + * @param app + */ public NewControl(String app) { super("new_control"); + /* Create a form to select and add a form control widget */ FormSection fs = new FormSection(new BoxPanel(BoxPanel.HORIZONTAL)); + fs.add(new Label(GlobalizationUtil.globalize( + "formbuilder.ui.form_widget.add_new_label"))); - fs.add(new Label(GlobalizationUtil.globalize("formbuilder.ui.add_new"))); - - m_selection = new ParameterSingleSelectionModel(new BigDecimalParameter("type")); + m_selection = new ParameterSingleSelectionModel( + new BigDecimalParameter("type")); m_type = new SingleSelect(m_selection.getStateParameter()); + // Doesn't work. Checks for null right at the construction of the form. + // m_type.addOption(new + // Option("", + // new Label(GlobalizationUtil.globalize( + // "formbuilder.ui.form_widget.select_one")) + // )); + // Compare to NewSection.java + // m_type.addValidationListener(new NotNullValidationListener( + // GlobalizationUtil.globalize( + // "formbuilder.ui.form_widget.null_error") + // )); loadComponents(app); fs.add(m_type); - fs.add(new Label(GlobalizationUtil.globalize("formbuilder.ui.form_widget"))); - fs.add(new Submit("Create")); + fs.add(new Submit( GlobalizationUtil.globalize( + "formbuilder.ui.form_widget.create_button") )); addInitListener(new NewControlInitListener()); add(fs); } + /** + * + * @param page + */ + @Override public void register(Page page) { super.register(page); page.addComponentStateParam(this, m_selection.getStateParameter()); } + /** + * + * @param app + */ protected void loadComponents(String app) { try { - MetaObjectCollection objects = MetaObject.getWidgets(app, - PersistentComponent.class); + MetaObjectCollection objects = MetaObject + .getWidgets(app,PersistentComponent.class); objects.addOrder(MetaObject.PRETTY_NAME); while (objects.next()) { @@ -96,10 +130,17 @@ public class NewControl extends Form { } } + /** + * + * @return + */ public SingleSelectionModel getSelection() { return m_selection; } + /** + * + */ private class NewControlInitListener implements FormInitListener { public void init(FormSectionEvent e) throws FormProcessException { @@ -107,7 +148,6 @@ public class NewControl extends Form { // FIXME: what is the point of this method? -- 2002-11-26 // BigDecimal type = (BigDecimal)m_selection.getSelectedKey(e.getPageState()); - //m_type.setOptionSelected(type.toString()); } } diff --git a/ccm-core/src/com/arsdigita/formbuilder/ui/NewSection.java b/ccm-core/src/com/arsdigita/formbuilder/ui/NewSection.java index ed57efa90..ca1417e55 100755 --- a/ccm-core/src/com/arsdigita/formbuilder/ui/NewSection.java +++ b/ccm-core/src/com/arsdigita/formbuilder/ui/NewSection.java @@ -18,10 +18,6 @@ */ package com.arsdigita.formbuilder.ui; -import com.arsdigita.formbuilder.PersistentForm; -import com.arsdigita.formbuilder.PersistentFormSection; -import com.arsdigita.formbuilder.util.GlobalizationUtil ; - import com.arsdigita.bebop.BoxPanel; import com.arsdigita.bebop.Form; import com.arsdigita.bebop.FormSection; @@ -29,10 +25,14 @@ import com.arsdigita.bebop.Label; import com.arsdigita.bebop.PageState; import com.arsdigita.bebop.SingleSelectionModel; import com.arsdigita.bebop.event.PrintListener; +import com.arsdigita.bebop.form.Option; import com.arsdigita.bebop.form.SingleSelect; import com.arsdigita.bebop.form.Submit; import com.arsdigita.bebop.parameters.BigDecimalParameter; import com.arsdigita.bebop.parameters.NotNullValidationListener; +import com.arsdigita.formbuilder.PersistentForm; +import com.arsdigita.formbuilder.PersistentFormSection; +import com.arsdigita.formbuilder.util.GlobalizationUtil ; import com.arsdigita.domain.DomainObjectFactory; import com.arsdigita.persistence.OID; import com.arsdigita.util.UncheckedWrapperException; @@ -41,25 +41,47 @@ import com.arsdigita.xml.Element; import java.math.BigDecimal; import java.util.TooManyListenersException; +/** + * Class to create and add a FormSection to a form item. + * + */ public class NewSection extends Form { + private SingleSelectionModel m_form; private SingleSelect m_sections; + /** + * NewSection constructor, creates a form to select from a list of + * existing form sections and add it to a form item beeing edited. + * Typically it is used by packages which interactively create user input + * forms, e.g. the form item content type. + * + * @param form + */ public NewSection(SingleSelectionModel form) { - super("new_section"); + super("new_section"); m_form = form; + /* Create a form to select and add a form section */ FormSection fs = new FormSection(new BoxPanel(BoxPanel.HORIZONTAL)); + fs.add(new Label(GlobalizationUtil.globalize( + "formbuilder.ui.form_section.add_new_label"))); m_sections = new SingleSelect(new BigDecimalParameter("section")); - m_sections.addValidationListener - (new NotNullValidationListener - (GlobalizationUtil.globalize("formbuilder.ui.form_section_null_error"))); - fs.add(new Label(GlobalizationUtil.globalize("formbuilder.ui.add_new"))); + m_sections.addOption(new + Option("", + new Label(GlobalizationUtil.globalize( + "formbuilder.ui.form_section.select_one")) + )); + m_sections.addValidationListener(new NotNullValidationListener( + GlobalizationUtil.globalize( + "formbuilder.ui.form_section.null_error") + )); fs.add(m_sections); - fs.add(new Label(GlobalizationUtil.globalize("formbuilder.ui.form_section"))); - fs.add(new Submit("Add")); + // fs.add(new Label(GlobalizationUtil.globalize("formbuilder.ui.form_section"))); + fs.add(new Submit(GlobalizationUtil.globalize( + "formbuilder.ui.form_section.add_button") )); add(fs); } @@ -78,6 +100,7 @@ public class NewSection extends Form { } } + @Override public void generateXML(PageState state, Element parent) { OID formOID = new OID( PersistentFormSection.BASE_DATA_OBJECT_TYPE, m_form.getSelectedKey(state) ); diff --git a/ccm-core/src/com/arsdigita/formbuilder/ui/ProcessListenerEditor.java b/ccm-core/src/com/arsdigita/formbuilder/ui/ProcessListenerEditor.java index a26d911a0..ee04c4892 100755 --- a/ccm-core/src/com/arsdigita/formbuilder/ui/ProcessListenerEditor.java +++ b/ccm-core/src/com/arsdigita/formbuilder/ui/ProcessListenerEditor.java @@ -16,15 +16,9 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ + package com.arsdigita.formbuilder.ui; - -import com.arsdigita.formbuilder.util.GlobalizationUtil ; - -import com.arsdigita.formbuilder.PersistentFormSection; -import com.arsdigita.formbuilder.PersistentProcessListener; -import com.arsdigita.formbuilder.util.FormBuilderUtil; - import com.arsdigita.bebop.BoxPanel; import com.arsdigita.bebop.Component; import com.arsdigita.bebop.ControlLink; @@ -43,6 +37,10 @@ import com.arsdigita.bebop.event.TableActionListener; import com.arsdigita.bebop.table.TableCellRenderer; import com.arsdigita.domain.DataObjectNotFoundException; import com.arsdigita.domain.DomainObjectFactory; +import com.arsdigita.formbuilder.PersistentFormSection; +import com.arsdigita.formbuilder.PersistentProcessListener; +import com.arsdigita.formbuilder.util.FormBuilderUtil; +import com.arsdigita.formbuilder.util.GlobalizationUtil ; import com.arsdigita.persistence.OID; import com.arsdigita.util.UncheckedWrapperException; import com.arsdigita.web.RedirectSignal; @@ -51,12 +49,13 @@ import java.io.IOException; import java.math.BigDecimal; /** - * This class provides a pluggable widget for editing the - * persistent process listeners for a persistent form. It - * is designed to be used without requiring any significant + * This class provides a pluggable widget for editing the persistent process + * listeners for a persistent form. + * It is designed to be used without requiring any significant * infrastructure on a page. */ public class ProcessListenerEditor extends SimpleContainer { + protected SingleSelectionModel m_form; protected SingleSelectionModel m_action; protected NewAction m_newAction; @@ -65,9 +64,8 @@ public class ProcessListenerEditor extends SimpleContainer { protected ProcessListenerProperties m_edit_action; /** - * Constructor. Creates a new control editor widget, - * for editing the form specified in the single - * selection model. The key returned by the single + * Constructor, creates a new control editor widget for editing the form + * specified in the single selection model. The key returned by the single * selection model should be an instance of the * {@link java.math.BigDecimal} class. * @@ -77,11 +75,11 @@ public class ProcessListenerEditor extends SimpleContainer { SingleSelectionModel form) { m_form = form; + // Help system is currently not workable String helpURL = FormBuilderUtil.getConfig().getActionsHelpLink(); if (helpURL != null) { add(new Link(new Label(GlobalizationUtil.globalize ("formbuilder.ui.help")), helpURL)); - add(new Label("")); // spacer } m_newAction = new NewAction(app); @@ -98,11 +96,14 @@ public class ProcessListenerEditor extends SimpleContainer { if (column == 0) { return new Label(l.getDescription()); } else if (column == 1) { - ControlLink lk = new ControlLink( (String) GlobalizationUtil.globalize("formbuilder.ui.edit").localize()); + ControlLink lk = new ControlLink( new Label(GlobalizationUtil + .globalize("formbuilder.ui.edit") )); return lk; } else if (column == 2) { - ControlLink lk = new ControlLink( (String) GlobalizationUtil.globalize("formbuilder.ui.delete").localize()); - lk.setConfirmation("Are you sure you wish to delete this action?"); + ControlLink lk = new ControlLink( new Label(GlobalizationUtil + .globalize("formbuilder.ui.delete") )); + lk.setConfirmation(GlobalizationUtil.globalize( + "formbuilder.ui.form_action.delete_confirm")); return lk; } diff --git a/ccm-core/src/com/arsdigita/formbuilder/ui/ProcessListenerProperties.java b/ccm-core/src/com/arsdigita/formbuilder/ui/ProcessListenerProperties.java index 92df5de2e..635880592 100755 --- a/ccm-core/src/com/arsdigita/formbuilder/ui/ProcessListenerProperties.java +++ b/ccm-core/src/com/arsdigita/formbuilder/ui/ProcessListenerProperties.java @@ -102,7 +102,9 @@ public class ProcessListenerProperties extends MetaObjectProperties { PropertiesEditor e = new PropertiesEditor(f); return e; } catch (ClassCastException ex2) { - throw new UncheckedWrapperException("Editor must be a PropertiesEditor or PropertiesForm", ex2); + throw new UncheckedWrapperException( + "Editor must be a PropertiesEditor or PropertiesForm", + ex2); } } } diff --git a/ccm-core/src/com/arsdigita/formbuilder/ui/editors/WidgetForm.java b/ccm-core/src/com/arsdigita/formbuilder/ui/editors/WidgetForm.java index b07dccd78..efb26ebb0 100755 --- a/ccm-core/src/com/arsdigita/formbuilder/ui/editors/WidgetForm.java +++ b/ccm-core/src/com/arsdigita/formbuilder/ui/editors/WidgetForm.java @@ -151,7 +151,9 @@ public abstract class WidgetForm extends PropertiesForm { description.setCols(50); description.setRows(5); description.addValidationListener(new StringInRangeValidationListener(0, 200)); - section.add(new Label(GlobalizationUtil.globalize("formbuilder.ui.editors.description")), ColumnPanel.RIGHT); + section.add(new Label(GlobalizationUtil.globalize( + "formbuilder.ui.editors.description")), + ColumnPanel.RIGHT); section.add(description); m_description = description; @@ -159,7 +161,9 @@ public abstract class WidgetForm extends PropertiesForm { protected void addRequiredRadioGroup(FormSection section) { m_required = new RadioGroup( new BooleanParameter( "required" ) ); - section.add(new Label(GlobalizationUtil.globalize("formbuilder.ui.editors.answer_required")), ColumnPanel.RIGHT); + section.add(new Label(GlobalizationUtil.globalize( + "formbuilder.ui.editors.answer_required")), + ColumnPanel.RIGHT); section.add(m_required); m_required.addOption(new Option(Boolean.TRUE.toString(), "Yes")); @@ -360,7 +364,8 @@ public abstract class WidgetForm extends PropertiesForm { try { widget = getWidget(action); } catch (DataObjectNotFoundException ex) { - throw new FormProcessException("cannot find persistent widget " + action, ex); + throw new FormProcessException("cannot find persistent widget " + + action, ex); } initWidgets(e, widget); } diff --git a/ccm-core/src/com/arsdigita/formbuilder/ui/editors/WidgetLabelForm.java b/ccm-core/src/com/arsdigita/formbuilder/ui/editors/WidgetLabelForm.java index bfc1c0935..bd890c2ef 100755 --- a/ccm-core/src/com/arsdigita/formbuilder/ui/editors/WidgetLabelForm.java +++ b/ccm-core/src/com/arsdigita/formbuilder/ui/editors/WidgetLabelForm.java @@ -105,9 +105,11 @@ public abstract class WidgetLabelForm extends WidgetForm { // Revision by CS Gupta if(!isEmailFormField()) - return GlobalizationUtil.globalize("formbuilder.ui.editors.UserEmailLabel"); + return GlobalizationUtil + .globalize("formbuilder.ui.editors.UserEmailLabel"); else - return GlobalizationUtil.globalize("formbuilder.ui.editors.label"); + return GlobalizationUtil + .globalize("formbuilder.ui.editors.label"); } @@ -126,7 +128,8 @@ public abstract class WidgetLabelForm extends WidgetForm { if (widget != null) { WidgetLabel l = WidgetLabel.findByWidget(widget); if( null == l ) - throw new FormProcessException("cannot find WidgetLabel for " + widget.getOID()); + throw new FormProcessException("cannot find WidgetLabel for " + + widget.getOID()); m_label.setValue(state, l.getLabel()); } else { @@ -151,7 +154,8 @@ public abstract class WidgetLabelForm extends WidgetForm { try { l = WidgetLabel.findByWidget(widget); } catch (DataObjectNotFoundException ex) { - throw new FormProcessException("cannot find WidgetLabel for " + widget.getOID()); + throw new FormProcessException("cannot find WidgetLabel for " + + widget.getOID()); } l.setLabel(label); @@ -166,7 +170,8 @@ public abstract class WidgetLabelForm extends WidgetForm { String label = (String)data.get("label"); - BigDecimal form_id = (BigDecimal)getSelection().getSelectedKey(e.getPageState()); + BigDecimal form_id = (BigDecimal)getSelection() + .getSelectedKey(e.getPageState()); PersistentFormSection form = null; try { diff --git a/ccm-core/src/com/arsdigita/formbuilder/util/ExtendedElement.java.nolongerInUse b/ccm-core/src/com/arsdigita/formbuilder/util/ExtendedElement.java.nolongerInUse deleted file mode 100755 index 67de96893..000000000 --- a/ccm-core/src/com/arsdigita/formbuilder/util/ExtendedElement.java.nolongerInUse +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (C) 2001-2004 Red Hat Inc. All Rights Reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.formbuilder.util; - - -/** - * @deprecated The functionality provided by this class is - * now part of the base com.arsdigita.xml.Element class - */ -public class ExtendedElement extends com.arsdigita.xml.Element { - - - public ExtendedElement( String name, String uri ) { - super(name, uri); - } -} diff --git a/ccm-core/src/com/arsdigita/formbuilder/util/FormBuilderUtil.java b/ccm-core/src/com/arsdigita/formbuilder/util/FormBuilderUtil.java index edb2b8a27..d5ae5bdf7 100755 --- a/ccm-core/src/com/arsdigita/formbuilder/util/FormBuilderUtil.java +++ b/ccm-core/src/com/arsdigita/formbuilder/util/FormBuilderUtil.java @@ -26,6 +26,7 @@ import com.arsdigita.bebop.Label; import com.arsdigita.bebop.form.TextField; import com.arsdigita.bebop.form.TextArea; import com.arsdigita.bebop.FormData; +import com.arsdigita.formbuilder.FormBuilderConfig; import com.arsdigita.formbuilder.PersistentWidget; import com.arsdigita.formbuilder.parameters.PersistentParameterListener; import com.arsdigita.util.UncheckedWrapperException; @@ -56,6 +57,10 @@ public class FormBuilderUtil { private static FormBuilderConfig s_config; + /** + * + * @return + */ public static FormBuilderConfig getConfig() { if (s_config == null) { s_config = new FormBuilderConfig(); @@ -65,12 +70,22 @@ public class FormBuilderUtil { } - public static void addTextFieldToForm(FormSection form, String name, String label) { + /** + * + * @param form + * @param name + * @param label + */ + public static void addTextFieldToForm(FormSection form, + String name, + String label) { form.add(new Label(label)); form.add(new TextField(name)); } - public static void addTextAreaToForm(FormSection form, String name, String label) { + public static void addTextAreaToForm(FormSection form, + String name, + String label) { form.add(new Label(label)); form.add(new TextArea(name)); } @@ -88,9 +103,16 @@ public class FormBuilderUtil { } + /** + * + * @param className + * @param arg + * @return + */ public static Object instantiateObjectOneArg(String className, Object arg) { - s_log.info("instantiate object class " + className + " arg class " + arg.getClass()); + s_log.info("instantiate object class " + className + + " arg class " + arg.getClass()); Class argClass = arg.getClass(); RuntimeException exn = null; while (argClass != null) { @@ -109,10 +131,22 @@ public class FormBuilderUtil { throw exn; } + /** + * + * @param className + * @return + */ public static Object instantiateObject(String className) { return instantiateObject(className, new Class[] {}, new Object[] {}); } + /** + * + * @param className + * @param argumentTypes + * @param arguments + * @return + */ public static Object instantiateObject(String className, Class[] argumentTypes, Object[] arguments) { @@ -137,6 +171,11 @@ public class FormBuilderUtil { return object; } + /** + * + * @param className + * @return + */ public static Class loadClass(String className) { Class returnClass = null; @@ -168,7 +207,8 @@ public class FormBuilderUtil { } if (!argumentIsValid) { - throw new IllegalArgumentException("Integer argument with value " + argument + + throw new IllegalArgumentException("Integer argument with value " + + argument + " is out of range. Should be between " + lowerLimit + " and " + upperLimit); } diff --git a/ccm-core/src/com/arsdigita/formbuilder/util/FormbuilderSetup.java b/ccm-core/src/com/arsdigita/formbuilder/util/FormbuilderSetup.java index 274714379..324188648 100644 --- a/ccm-core/src/com/arsdigita/formbuilder/util/FormbuilderSetup.java +++ b/ccm-core/src/com/arsdigita/formbuilder/util/FormbuilderSetup.java @@ -26,13 +26,9 @@ import com.arsdigita.formbuilder.MetaObject; import com.arsdigita.formbuilder.PersistentProcessListener; import com.arsdigita.formbuilder.PersistentDataQuery; import com.arsdigita.formbuilder.PersistentComponent; -//__import com.arsdigita.kernel.BaseInitializer; -// import com.arsdigita.persistence.SessionManager; -// import com.arsdigita.persistence.TransactionContext; import com.arsdigita.runtime.ConfigError; import java.util.Iterator; - import java.util.List; import org.apache.log4j.Logger; diff --git a/ccm-core/src/com/arsdigita/formbuilder/util/GlobalizationUtil.java b/ccm-core/src/com/arsdigita/formbuilder/util/GlobalizationUtil.java index da2c8e2e7..b20bace30 100755 --- a/ccm-core/src/com/arsdigita/formbuilder/util/GlobalizationUtil.java +++ b/ccm-core/src/com/arsdigita/formbuilder/util/GlobalizationUtil.java @@ -32,7 +32,8 @@ import com.arsdigita.globalization.GlobalizedMessage; public class GlobalizationUtil implements Globalized { - private static final String BUNDLE_NAME = "com.arsdigita.formbuilder/ui/FormbuilderResources"; + private static final String BUNDLE_NAME = + "com.arsdigita.formbuilder.FormbuilderResources"; public static GlobalizedMessage globalize(String key) { return new GlobalizedMessage(key, BUNDLE_NAME);