From d57a954009d3b3d523b96c7ad191e03d1687b508 Mon Sep 17 00:00:00 2001 From: pb Date: Sat, 29 Jun 2013 00:13:35 +0000 Subject: [PATCH] Weitere Verbesserungen Lokalisierung. git-svn-id: https://svn.libreccm.org/ccm/trunk@2232 8810af33-2d31-482b-a856-94f89814c4df --- .../cms/contenttypes/DecisionTree.xml | 26 +-- .../cms/contenttypes/DecisionTree.java | 1 + .../DecisionTreeOptionTarget.java | 1 + .../DecisionTreeResources.properties | 121 +++++++---- .../DecisionTreeResources_de.properties | 121 +++++++---- .../DecisionTreeResources_en.properties | 121 +++++++---- .../DecisionTreeResources_fr.properties | 121 +++++++---- .../DecisionTreeSectionCollection.java | 3 +- .../ui/DecisionTreeOptionDeleteForm.java | 43 ++-- .../ui/DecisionTreeOptionEditForm.java | 35 ++-- ...tions.java => DecisionTreeOptionStep.java} | 125 +++++++----- .../ui/DecisionTreeOptionTable.java | 188 ++++++++++++------ ...onTreeParameterNameValidationListener.java | 11 +- .../ui/DecisionTreePropertiesForm.java | 9 +- .../ui/DecisionTreePropertiesStep.java | 45 +++-- .../ui/DecisionTreeSectionDeleteForm.java | 50 ++++- .../ui/DecisionTreeSectionEditForm.java | 36 ++-- ...ions.java => DecisionTreeSectionStep.java} | 59 +++--- .../ui/DecisionTreeSectionTable.java | 170 ++++++++++------ .../ui/DecisionTreeTargetDeleteForm.java | 15 +- .../ui/DecisionTreeTargetEditForm.java | 69 ++++--- ...rgets.java => DecisionTreeTargetStep.java} | 69 +++---- .../ui/DecisionTreeTargetTable.java | 101 ++++++---- .../DecisionTreeGlobalizationUtil.java} | 6 +- .../ui/mparticle/SectionTable.java | 3 +- .../ui/SimpleAddressPropertiesStep.java | 96 ++++----- .../ui/SimpleAddressPropertyForm.java | 78 ++++---- .../arsdigita/cms/CMSResources_de.properties | 2 +- .../ui/GenericContactPropertiesStep.java | 3 - .../cms/ui/authoring/AuthoringKitWizard.java | 1 - .../contenttypes/ui/ContactPhonesTable.java | 2 +- 31 files changed, 1060 insertions(+), 671 deletions(-) rename ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/{DecisionTreeViewOptions.java => DecisionTreeOptionStep.java} (69%) rename ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/{DecisionTreeViewSections.java => DecisionTreeSectionStep.java} (82%) rename ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/{DecisionTreeViewTargets.java => DecisionTreeTargetStep.java} (76%) rename ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/{DecisionTreeUtil.java => util/DecisionTreeGlobalizationUtil.java} (91%) diff --git a/ccm-cms-types-decisiontree/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/DecisionTree.xml b/ccm-cms-types-decisiontree/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/DecisionTree.xml index 294afa30d..10e75b181 100644 --- a/ccm-cms-types-decisiontree/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/DecisionTree.xml +++ b/ccm-cms-types-decisiontree/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/DecisionTree.xml @@ -9,34 +9,36 @@ classname="com.arsdigita.cms.contenttypes.DecisionTree"> - + component="com.arsdigita.cms.contenttypes.ui.DecisionTreeSectionStep"/> + component="com.arsdigita.cms.contenttypes.ui.DecisionTreeOptionStep"/> + component="com.arsdigita.cms.contenttypes.ui.DecisionTreeTargetStep" /> + diff --git a/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/DecisionTree.java b/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/DecisionTree.java index 80508434d..d040343a3 100644 --- a/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/DecisionTree.java +++ b/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/DecisionTree.java @@ -94,6 +94,7 @@ public class DecisionTree extends ContentPage implements XMLGenerator { * @return the base PDL object type for this item. Child classes * should override this method to return the correct value. */ + @Override public String getBaseDataObjectType() { return BASE_DATA_OBJECT_TYPE; } diff --git a/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/DecisionTreeOptionTarget.java b/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/DecisionTreeOptionTarget.java index 7ab52e52d..f904a1bf2 100644 --- a/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/DecisionTreeOptionTarget.java +++ b/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/DecisionTreeOptionTarget.java @@ -94,6 +94,7 @@ public class DecisionTreeOptionTarget extends ContentItem { * @return the base PDL object type for this item. Child classes * should override this method to return the correct value. */ + @Override public String getBaseDataObjectType() { return BASE_DATA_OBJECT_TYPE; } diff --git a/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/DecisionTreeResources.properties b/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/DecisionTreeResources.properties index f115745b5..ae40d83b0 100644 --- a/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/DecisionTreeResources.properties +++ b/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/DecisionTreeResources.properties @@ -1,44 +1,77 @@ -error.parameter_name_characters=This parameter can only contain letters, digits, or "-_" -form.none=-- none -- -form.please_select=-- please select -- -form_label.cancel_url=Cancel URL -form_label.description=Description -form_label.instructions=Instructions -form_label.label=Label -form_label.match_value=Value to Match -form_label.parameter_name=Parameter Name -form_label.section=Section -form_label.target_section=Target Section -form_label.target_url=Target URL -form_label.title=Title -form_label.value=Value -form_validation.target_required=Either a target URL or a target section is required. -form_validation.duplicate_target=Please enter a target URL or a target section, but not both. -properties.cancel_url=Cancel URL: -section_options.add_new_option=Add new option -section_options.add_option=Add Option -section_options.delete_option=Delete option -section_options.description=The options that belong to this decision tree's sections. -section_options.edit_option=Edit Option -section_options.move_option_name=Move option -section_options.move_to_beginning=Move to beginning -section_options.no_options_yet=No options yet -section_options.title=Section Options -section_options.view_all_options=View all options -option_targets.add_new_target=Add new target -option_targets.add_target=Add Target -option_targets.delete_target=Delete target -option_targets.description=The targets that belong to this decision treeS. -option_targets.edit_target=Edit Target -option_targets.no_targets_yet=No targets yet -option_targets.title=Option Targets -option_targets.view_all_targets=View all targets -tree_section.submission_cancelled=Submission cancelled -tree_sections.add_new_section=Add new section -tree_sections.add_section=Add Section -tree_sections.delete_section=Delete section -tree_sections.description=The sections that belong to this decision tree. -tree_sections.edit_section=Edit Section -tree_sections.no_sections_yet=No sections yet -tree_sections.title=Tree Sections -tree_sections.view_all_sections=View all sections +cms.contenttypes.ui.decisiontree.error.parameter_name_characters=This parameter can only contain letters, digits, or "-_" +cms.contenttypes.ui.decisiontree.targets.form.none=-- none -- +cms.contenttypes.ui.decisiontree.options.form.please_select=-- please select a section for this option-- +cms.contenttypes.ui.decisiontree.properties.form.description_label=Description +cms.contenttypes.ui.decisiontree.sections.form.instructions_label=Instructions +cms.contenttypes.ui.decisiontree.options.form.label=Label +cms.contenttypes.ui.decisiontree.targets.form.match_value=Value to Match +cms.contenttypes.ui.decisiontree.sections.form.parameter_name_label=Parameter Name +cms.contenttypes.ui.decisiontree.options.form.section=Section +cms.contenttypes.ui.decisiontree.targets.form.target_section_label=Target Section +cms.contenttypes.ui.decisiontree.targets.form.target_url_label=Target URL +cms.contenttypes.ui.decisiontree.sections.form.title_label=Title +cms.contenttypes.ui.decisiontree.options.form.value=Value +cms.contenttypes.ui.decisiontree.targets.form.target_required=Either a target URL or a target section is required. +cms.contenttypes.ui.decisiontree.targets.form.duplicate_target=Please enter a target URL or a target section, but not both. +cms.contenttypes.ui.decisiontree.properties.cancel_url=Cancel URL after user abort: +cms.contenttypes.ui.decisiontree.options.add_new=Add new option +cms.contenttypes.ui.decisiontree.options.add=Add Option +cms.contenttypes.ui.decisiontree.options.delete=Delete option +cms.contenttypes.ui.authoring.decisiontree.section_options.description=The options that belong to this decision tree's sections. +cms.contenttypes.ui.decisiontree.options.edit=Edit Option +cms.contenttypes.ui.decisiontree.options.table.move_option_name=Move option {0} +cms.contenttypes.ui.decisiontree.options.table.move_to_beginning=Move to beginning +cms.contenttypes.ui.decisiontree.options.none_yet=No options yet +cms.contenttypes.ui.authoring.decisiontree.section_options.title=Decision Options +cms.contenttypes.ui.decisiontree.options.view_all=View all options +cms.contenttypes.ui.decisiontree.targets.add_new=Add new target +cms.contenttypes.ui.decisiontree.targets.add=Add Target +cms.contenttypes.ui.decisiontree.targets.delete=Delete target +cms.contenttypes.ui.authoring.decisiontree.option_targets.description=The targets that belong to this decision treeS. +cms.contenttypes.ui.decisiontree.targets.edit=Edit Target +cms.contenttypes.ui.decisiontree.targets.none_yet=No targets yet +cms.contenttypes.ui.authoring.decisiontree.option_targets.title=Decision Option Targets +cms.contenttypes.ui.decisiontree.targets.view_all=View all targets +cms.contenttypes.ui.decisiontree.options.form.submission_cancelled=Opion submission cancelled +cms.contenttypes.ui.decisiontree.sections.add_new_label=Add new section +cms.contenttypes.ui.decisiontree.sections.add=Add Section +cms.contenttypes.ui.decisiontree.sections.delete=Delete section +cms.contenttypes.ui.authoring.decisiontree.tree_sections.description=The sections that belong to this decision tree. +cms.contenttypes.ui.decisiontree.sections.edit=Edit Section +cms.contenttypes.ui.decisiontree.sections.no_sections_yet=No sections yet +cms.contenttypes.ui.authoring.decisiontree.tree_sections.title=Decision Sections +cms.contenttypes.ui.decisiontree.sections.view_all=View all sections +cms.contenttypes.ui.decisiontree.sections.table.header_section=Decision Section +cms.contenttypes.ui.decisiontree.sections.table.header_edit=Edit +cms.contenttypes.ui.decisiontree.sections.table.header_delete=Delete +cms.contenttypes.ui.decisiontree.sections.table.header_first_section=First Section? +cms.contenttypes.ui.decisiontree.sections.table.link_delete=delete +cms.contenttypes.ui.decisiontree.sections.table.link_edit=edit +cms.contenttypes.ui.decisiontree.sections.table.link_set_first=set +cms.contenttypes.ui.decisiontree.options.table.header_section=Decision Section +cms.contenttypes.ui.decisiontree.options.table.header_option=Decision Option +cms.contenttypes.ui.decisiontree.options.table.header_edit=Edit +cms.contenttypes.ui.decisiontree.options.table.header_move=Move +cms.contenttypes.ui.decisiontree.options.table.header_delete=Delete +cms.contenttypes.ui.decisiontree.options.table.link_delete=delete +cms.contenttypes.ui.decisiontree.options.table.link_move=move +cms.contenttypes.ui.decisiontree.options.table.link_edit=edit +cms.contenttypes.ui.decisiontree.targets.form.please_select=-- please select an option for this option-- +cms.contenttypes.ui.decisiontree.targets.form.submission_cancelled=Target submission cancelled +cms.contenttypes.ui.decisiontree.targets.form.delete.delete_button=Delete +cms.contenttypes.ui.decisiontree.targets.form.delete.target_match_value=Target Match Value +cms.contenttypes.ui.decisiontree.targets.submission_cancelled=Submission cancelled +cms.contenttypes.ui.decisiontree.sections.form.submission_cancelled=Submission cancelled +cms.contenttypes.ui.decisiontree.options.table.link_move_below=move below +cms.contenttypes.ui.decisiontree.options.table.link_no_move=leave it here +cms.contenttypes.ui.decisiontree.targets.table.header_section=Decision Section +cms.contenttypes.ui.decisiontree.targets.table.header_match=Decision Option +cms.contenttypes.ui.decisiontree.targets.table.header_edit=Edit +cms.contenttypes.ui.decisiontree.targets.table.header_delete=Delete +cms.contenttypes.ui.decisiontree.targets.table.link_edit=edit +cms.contenttypes.ui.decisiontree.targets.table.link_delete=delete +cms.contenttypes.ui.decisiontree.sections.delete_button=Delete +cms.contenttypes.ui.decisiontree.sections.delete_section_msg=Section to be deleted: "{0}" +cms.contenttypes.ui.decisiontree.options.delete_option_msg=Option to be deleted: "{0}" +cms.contenttypes.ui.decisiontree.options.delete_button=Delete +cms.contenttypes.ui.decisiontree.options.delete.submission_cancelled=Option Delete submission cancelled diff --git a/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/DecisionTreeResources_de.properties b/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/DecisionTreeResources_de.properties index 28b01b0bb..89c6f9c34 100644 --- a/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/DecisionTreeResources_de.properties +++ b/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/DecisionTreeResources_de.properties @@ -1,44 +1,77 @@ -error.parameter_name_characters=Dieser Parameter lann nur Buchstaben, Zahlen oder "-_" enthalten. -form.none=-- keine -- -form.please_select=-- bitte ausw\u00e4hlen -- -form_label.cancel_url=URL Abrechen -form_label.description=Beschreibung -form_label.instructions=Anweisungen -form_label.label=Benennung -form_label.match_value=Korrespondierender Wert -form_label.parameter_name=Parameter Name -form_label.section=Sektion -form_label.target_section=Zielsektion -form_label.target_url=Ziel-URL -form_label.title=Titel -form_label.value=Wert -form_validation.target_required=Entweder eine Ziel-URL oder eine Ziel-Sektion isr erforderlich. -form_validation.duplicate_target=Bitte eine Ziel-URL oder eine Ziel-Sektion angeben, aber nicht beides. -properties.cancel_url=URL Abbrechen: -section_options.add_new_option=Eine neue Option hinzuf\u00fcgen -section_options.add_option=Option hinzuf\u00fcgen -section_options.delete_option=Option l\u00f6schen -section_options.description=Optionen, die zu dieser Sektion geh\u00f6ren. -section_options.edit_option=Option bearbeiten -section_options.move_option_name=Option verschieben -section_options.move_to_beginning=An den Anfang verschieben -section_options.no_options_yet=Bisher keine Optionen eingetragen. -section_options.title=Optionen in der Sektion -section_options.view_all_options=Alle Optionen anzeigen -option_targets.add_new_target=Ein neues Ziel hinzuf\u00fcgen -option_targets.add_target=Ziel hinzuf\u00fcgen -option_targets.delete_target=Ziel l\u00f6schen -option_targets.description=Ziele, die zu dieser Sektion geh\u00f6ren. -option_targets.edit_target=Ziel bearbeiten -option_targets.no_targets_yet=Bisher keine Ziele verf\u00fcgbar. -option_targets.title=Option Targets -option_targets.view_all_targets=Alle Ziele anzeigen -tree_section.submission_cancelled=Speichern abgebrochen -tree_sections.add_new_section=Eine neue Sektion hinzuf\u00fcgen -tree_sections.add_section=Sektion hinzuf\u00fcgen -tree_sections.delete_section=Sektion l\u00f6schen -tree_sections.description=Die Sektionen, die zu diesem Entscheidungsbaum geh\u00f6ren. -tree_sections.edit_section=Sektion bearbeiten -tree_sections.no_sections_yet=Bisher keine Sektionen verf\u00fcgbar. -tree_sections.title=Sektionen -tree_sections.view_all_sections=Alle Sektionen anzeigen +cms.contenttypes.ui.decisiontree.error.parameter_name_characters=Dieser Parameter kann nur Buchstaben, Zahlen oder "-_" enthalten. +cms.contenttypes.ui.decisiontree.targets.form.none=-- keine -- +cms.contenttypes.ui.decisiontree.options.form.please_select=-- bitte zugeh\u00f6rige Sektion ausw\u00e4hlen -- +cms.contenttypes.ui.decisiontree.properties.form.description_label=Beschreibung +cms.contenttypes.ui.decisiontree.sections.form.instructions_label=Anweisungen +cms.contenttypes.ui.decisiontree.options.form.label=Benennung +cms.contenttypes.ui.decisiontree.targets.form.match_value=Korrespondierender Wert +cms.contenttypes.ui.decisiontree.sections.form.parameter_name_label=Parameter Name +cms.contenttypes.ui.decisiontree.options.form.section=Sektion +cms.contenttypes.ui.decisiontree.targets.form.target_section_label=Zielsektion +cms.contenttypes.ui.decisiontree.targets.form.target_url_label=Ziel-URL +cms.contenttypes.ui.decisiontree.sections.form.title_label=Titel +cms.contenttypes.ui.decisiontree.options.form.value=Wert +cms.contenttypes.ui.decisiontree.targets.form.target_required=Entweder eine Ziel-URL oder eine Ziel-Sektion isr erforderlich. +cms.contenttypes.ui.decisiontree.targets.form.duplicate_target=Bitte eine Ziel-URL oder eine Ziel-Sektion angeben, aber nicht beides. +cms.contenttypes.ui.decisiontree.properties.cancel_url=URL nach Benutzer Abbruch: +cms.contenttypes.ui.decisiontree.options.add_new=Eine neue Option hinzuf\u00fcgen +cms.contenttypes.ui.decisiontree.options.add=Option hinzuf\u00fcgen +cms.contenttypes.ui.decisiontree.options.delete=Option l\u00f6schen +cms.contenttypes.ui.authoring.decisiontree.section_options.description=Optionen, die zu dieser Sektion geh\u00f6ren. +cms.contenttypes.ui.decisiontree.options.edit=Option bearbeiten +cms.contenttypes.ui.decisiontree.options.table.move_option_name=Option verschieben {0} +cms.contenttypes.ui.decisiontree.options.table.move_to_beginning=An den Anfang verschieben +cms.contenttypes.ui.decisiontree.options.none_yet=Bisher keine Optionen eingetragen. +cms.contenttypes.ui.authoring.decisiontree.section_options.title=Entscheidungsoptionen +cms.contenttypes.ui.decisiontree.options.view_all=Alle Optionen anzeigen +cms.contenttypes.ui.decisiontree.targets.add_new=Ein neues Ziel hinzuf\u00fcgen +cms.contenttypes.ui.decisiontree.targets.add=Ziel hinzuf\u00fcgen +cms.contenttypes.ui.decisiontree.targets.delete=Ziel l\u00f6schen +cms.contenttypes.ui.authoring.decisiontree.option_targets.description=Ziele, die zu dieser Sektion geh\u00f6ren. +cms.contenttypes.ui.decisiontree.targets.edit=Ziel bearbeiten +cms.contenttypes.ui.decisiontree.targets.none_yet=Bisher keine Ziele verf\u00fcgbar. +cms.contenttypes.ui.authoring.decisiontree.option_targets.title=Folgeschritte +cms.contenttypes.ui.decisiontree.targets.view_all=Alle Ziele anzeigen +cms.contenttypes.ui.decisiontree.options.form.submission_cancelled=Speichern der Option abgebrochen +cms.contenttypes.ui.decisiontree.sections.add_new_label=Eine neue Sektion hinzuf\u00fcgen +cms.contenttypes.ui.decisiontree.sections.add=Sektion hinzuf\u00fcgen +cms.contenttypes.ui.decisiontree.sections.delete=Sektion l\u00f6schen +cms.contenttypes.ui.authoring.decisiontree.tree_sections.description=Die Sektionen bearbeiten, die zu diesem Entscheidungsbaum geh\u00f6ren. +cms.contenttypes.ui.decisiontree.sections.edit=Sektion bearbeiten +cms.contenttypes.ui.decisiontree.sections.no_sections_yet=Bisher keine Sektionen verf\u00fcgbar. +cms.contenttypes.ui.authoring.decisiontree.tree_sections.title=Entscheidungsschritte +cms.contenttypes.ui.decisiontree.sections.view_all=Alle Sektionen anzeigen +cms.contenttypes.ui.decisiontree.sections.table.header_section=Entscheidungsschritt +cms.contenttypes.ui.decisiontree.sections.table.header_edit=Bearbeiten +cms.contenttypes.ui.decisiontree.sections.table.header_delete=L\u00f6schen +cms.contenttypes.ui.decisiontree.sections.table.header_first_section=Erste Sektion? +cms.contenttypes.ui.decisiontree.sections.table.link_delete=l\u00f6schen +cms.contenttypes.ui.decisiontree.sections.table.link_edit=bearbeiten +cms.contenttypes.ui.decisiontree.sections.table.link_set_first=festlegen +cms.contenttypes.ui.decisiontree.options.table.header_section=Entscheidungsschritt +cms.contenttypes.ui.decisiontree.options.table.header_option=Entscheidungsoption +cms.contenttypes.ui.decisiontree.options.table.header_edit=Bearbeiten +cms.contenttypes.ui.decisiontree.options.table.header_move=Verschieben +cms.contenttypes.ui.decisiontree.options.table.header_delete=Entfernen +cms.contenttypes.ui.decisiontree.options.table.link_delete=entfernen +cms.contenttypes.ui.decisiontree.options.table.link_move=verschieben +cms.contenttypes.ui.decisiontree.options.table.link_edit=bearbeiten +cms.contenttypes.ui.decisiontree.targets.form.please_select=-- bitte zugeh\u00f6rige Option ausw\u00e4hlen -- +cms.contenttypes.ui.decisiontree.targets.form.submission_cancelled=Speichern des Target abgebrochen +cms.contenttypes.ui.decisiontree.targets.form.delete.delete_button=L\u00f6schen +cms.contenttypes.ui.decisiontree.targets.form.delete.target_match_value=Target Match Value +cms.contenttypes.ui.decisiontree.targets.submission_cancelled=Submission cancelled +cms.contenttypes.ui.decisiontree.sections.form.submission_cancelled=Submission cancelled +cms.contenttypes.ui.decisiontree.options.table.link_move_below=unterhalb dieses Eintrags verschieben +cms.contenttypes.ui.decisiontree.options.table.link_no_move=hier belassen +cms.contenttypes.ui.decisiontree.targets.table.header_section=Entscheidungsschritt +cms.contenttypes.ui.decisiontree.targets.table.header_match=Entscheidungsoption +cms.contenttypes.ui.decisiontree.targets.table.header_edit=Bearbeiten +cms.contenttypes.ui.decisiontree.targets.table.header_delete=Entfernen +cms.contenttypes.ui.decisiontree.targets.table.link_edit=bearbeiten +cms.contenttypes.ui.decisiontree.targets.table.link_delete=entfernen +cms.contenttypes.ui.decisiontree.sections.delete_button=L\u00f6schen +cms.contenttypes.ui.decisiontree.sections.delete_section_msg=Zu l\u00f6schende Sektion: "{0}" +cms.contenttypes.ui.decisiontree.options.delete_option_msg=Zu l\u00f6schende Option: "{0}" +cms.contenttypes.ui.decisiontree.options.delete_button=Entfernen +cms.contenttypes.ui.decisiontree.options.delete.submission_cancelled=Option Delete submission cancelled diff --git a/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/DecisionTreeResources_en.properties b/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/DecisionTreeResources_en.properties index f115745b5..0e4bbd851 100644 --- a/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/DecisionTreeResources_en.properties +++ b/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/DecisionTreeResources_en.properties @@ -1,44 +1,77 @@ -error.parameter_name_characters=This parameter can only contain letters, digits, or "-_" -form.none=-- none -- -form.please_select=-- please select -- -form_label.cancel_url=Cancel URL -form_label.description=Description -form_label.instructions=Instructions -form_label.label=Label -form_label.match_value=Value to Match -form_label.parameter_name=Parameter Name -form_label.section=Section -form_label.target_section=Target Section -form_label.target_url=Target URL -form_label.title=Title -form_label.value=Value -form_validation.target_required=Either a target URL or a target section is required. -form_validation.duplicate_target=Please enter a target URL or a target section, but not both. -properties.cancel_url=Cancel URL: -section_options.add_new_option=Add new option -section_options.add_option=Add Option -section_options.delete_option=Delete option -section_options.description=The options that belong to this decision tree's sections. -section_options.edit_option=Edit Option -section_options.move_option_name=Move option -section_options.move_to_beginning=Move to beginning -section_options.no_options_yet=No options yet -section_options.title=Section Options -section_options.view_all_options=View all options -option_targets.add_new_target=Add new target -option_targets.add_target=Add Target -option_targets.delete_target=Delete target -option_targets.description=The targets that belong to this decision treeS. -option_targets.edit_target=Edit Target -option_targets.no_targets_yet=No targets yet -option_targets.title=Option Targets -option_targets.view_all_targets=View all targets -tree_section.submission_cancelled=Submission cancelled -tree_sections.add_new_section=Add new section -tree_sections.add_section=Add Section -tree_sections.delete_section=Delete section -tree_sections.description=The sections that belong to this decision tree. -tree_sections.edit_section=Edit Section -tree_sections.no_sections_yet=No sections yet -tree_sections.title=Tree Sections -tree_sections.view_all_sections=View all sections +cms.contenttypes.ui.decisiontree.error.parameter_name_characters=This parameter can only contain letters, digits, or "-_" +cms.contenttypes.ui.decisiontree.targets.form.none=-- none -- +cms.contenttypes.ui.decisiontree.options.form.please_select=-- please select -- +cms.contenttypes.ui.decisiontree.properties.form.description_label=Description +cms.contenttypes.ui.decisiontree.sections.form.instructions_label=Instructions +cms.contenttypes.ui.decisiontree.options.form.label=Label +cms.contenttypes.ui.decisiontree.targets.form.match_value=Value to Match +cms.contenttypes.ui.decisiontree.sections.form.parameter_name_label=Parameter Name +cms.contenttypes.ui.decisiontree.options.form.section=Section +cms.contenttypes.ui.decisiontree.targets.form.target_section_label=Target Section +cms.contenttypes.ui.decisiontree.targets.form.target_url_label=Target URL +cms.contenttypes.ui.decisiontree.sections.form.title_label=Title +cms.contenttypes.ui.decisiontree.options.form.value=Value +cms.contenttypes.ui.decisiontree.targets.form.target_required=Either a target URL or a target section is required. +cms.contenttypes.ui.decisiontree.targets.form.duplicate_target=Please enter a target URL or a target section, but not both. +cms.contenttypes.ui.decisiontree.properties.cancel_url=Cancel URL after user abort: +cms.contenttypes.ui.decisiontree.options.add_new=Add new option +cms.contenttypes.ui.decisiontree.options.add=Add Option +cms.contenttypes.ui.decisiontree.options.delete=Delete option +cms.contenttypes.ui.authoring.decisiontree.section_options.description=The options that belong to this decision tree's sections. +cms.contenttypes.ui.decisiontree.options.edit=Edit Option +cms.contenttypes.ui.decisiontree.options.table.move_option_name=Move option {0} +cms.contenttypes.ui.decisiontree.options.table.move_to_beginning=Move to beginning +cms.contenttypes.ui.decisiontree.options.none_yet=No options yet +cms.contenttypes.ui.authoring.decisiontree.section_options.title=Decision Options +cms.contenttypes.ui.decisiontree.options.view_all=View all options +cms.contenttypes.ui.decisiontree.targets.add_new=Add new target +cms.contenttypes.ui.decisiontree.targets.add=Add Target +cms.contenttypes.ui.decisiontree.targets.delete=Delete target +cms.contenttypes.ui.authoring.decisiontree.option_targets.description=The targets that belong to this decision treeS. +cms.contenttypes.ui.decisiontree.targets.edit=Edit Target +cms.contenttypes.ui.decisiontree.targets.none_yet=No targets yet +cms.contenttypes.ui.authoring.decisiontree.option_targets.title=Decision Option Targets +cms.contenttypes.ui.decisiontree.targets.view_all=View all targets +cms.contenttypes.ui.decisiontree.options.form.submission_cancelled=Option submission cancelled +cms.contenttypes.ui.decisiontree.sections.add_new_label=Add new section +cms.contenttypes.ui.decisiontree.sections.add=Add Section +cms.contenttypes.ui.decisiontree.sections.delete=Delete section +cms.contenttypes.ui.authoring.decisiontree.tree_sections.description=The sections that belong to this decision tree. +cms.contenttypes.ui.decisiontree.sections.edit=Edit Section +cms.contenttypes.ui.decisiontree.sections.no_sections_yet=No sections yet +cms.contenttypes.ui.authoring.decisiontree.tree_sections.title=Decision Sections +cms.contenttypes.ui.decisiontree.sections.view_all=View all sections +cms.contenttypes.ui.decisiontree.sections.table.header_section=Decision Section +cms.contenttypes.ui.decisiontree.sections.table.header_edit=Edit +cms.contenttypes.ui.decisiontree.sections.table.header_delete=Delete +cms.contenttypes.ui.decisiontree.sections.table.header_first_section=First Section? +cms.contenttypes.ui.decisiontree.sections.table.link_delete=delete +cms.contenttypes.ui.decisiontree.sections.table.link_edit=edit +cms.contenttypes.ui.decisiontree.sections.table.link_set_first=set +cms.contenttypes.ui.decisiontree.options.table.header_section=Decision Section +cms.contenttypes.ui.decisiontree.options.table.header_option=Decision Option +cms.contenttypes.ui.decisiontree.options.table.header_edit=Edit +cms.contenttypes.ui.decisiontree.options.table.header_move=Move +cms.contenttypes.ui.decisiontree.options.table.header_delete=Delete +cms.contenttypes.ui.decisiontree.options.table.link_delete=delete +cms.contenttypes.ui.decisiontree.options.table.link_move=move +cms.contenttypes.ui.decisiontree.options.table.link_edit=edit +cms.contenttypes.ui.decisiontree.targets.form.please_select=-- please select -- +cms.contenttypes.ui.decisiontree.targets.form.submission_cancelled=Target submission cancelled +cms.contenttypes.ui.decisiontree.targets.form.delete.delete_button=Delete +cms.contenttypes.ui.decisiontree.targets.form.delete.target_match_value=Target Match Value +cms.contenttypes.ui.decisiontree.targets.submission_cancelled=Submission cancelled +cms.contenttypes.ui.decisiontree.sections.form.submission_cancelled=Submission cancelled +cms.contenttypes.ui.decisiontree.options.table.link_move_below=move below +cms.contenttypes.ui.decisiontree.options.table.link_no_move=leave it here +cms.contenttypes.ui.decisiontree.targets.table.header_section=Decision Section +cms.contenttypes.ui.decisiontree.targets.table.header_match=Decision Option +cms.contenttypes.ui.decisiontree.targets.table.header_edit=Edit +cms.contenttypes.ui.decisiontree.targets.table.header_delete=Delete +cms.contenttypes.ui.decisiontree.targets.table.link_edit=edit +cms.contenttypes.ui.decisiontree.targets.table.link_delete=delete +cms.contenttypes.ui.decisiontree.sections.delete_button=Delete +cms.contenttypes.ui.decisiontree.sections.delete_section_msg=Section to be deleted: "{0}" +cms.contenttypes.ui.decisiontree.options.delete_option_msg=Option to be deleted: "{0}" +cms.contenttypes.ui.decisiontree.options.delete_button=Delete +cms.contenttypes.ui.decisiontree.options.delete.submission_cancelled=Option Delete submission cancelled diff --git a/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/DecisionTreeResources_fr.properties b/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/DecisionTreeResources_fr.properties index f115745b5..0e4bbd851 100644 --- a/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/DecisionTreeResources_fr.properties +++ b/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/DecisionTreeResources_fr.properties @@ -1,44 +1,77 @@ -error.parameter_name_characters=This parameter can only contain letters, digits, or "-_" -form.none=-- none -- -form.please_select=-- please select -- -form_label.cancel_url=Cancel URL -form_label.description=Description -form_label.instructions=Instructions -form_label.label=Label -form_label.match_value=Value to Match -form_label.parameter_name=Parameter Name -form_label.section=Section -form_label.target_section=Target Section -form_label.target_url=Target URL -form_label.title=Title -form_label.value=Value -form_validation.target_required=Either a target URL or a target section is required. -form_validation.duplicate_target=Please enter a target URL or a target section, but not both. -properties.cancel_url=Cancel URL: -section_options.add_new_option=Add new option -section_options.add_option=Add Option -section_options.delete_option=Delete option -section_options.description=The options that belong to this decision tree's sections. -section_options.edit_option=Edit Option -section_options.move_option_name=Move option -section_options.move_to_beginning=Move to beginning -section_options.no_options_yet=No options yet -section_options.title=Section Options -section_options.view_all_options=View all options -option_targets.add_new_target=Add new target -option_targets.add_target=Add Target -option_targets.delete_target=Delete target -option_targets.description=The targets that belong to this decision treeS. -option_targets.edit_target=Edit Target -option_targets.no_targets_yet=No targets yet -option_targets.title=Option Targets -option_targets.view_all_targets=View all targets -tree_section.submission_cancelled=Submission cancelled -tree_sections.add_new_section=Add new section -tree_sections.add_section=Add Section -tree_sections.delete_section=Delete section -tree_sections.description=The sections that belong to this decision tree. -tree_sections.edit_section=Edit Section -tree_sections.no_sections_yet=No sections yet -tree_sections.title=Tree Sections -tree_sections.view_all_sections=View all sections +cms.contenttypes.ui.decisiontree.error.parameter_name_characters=This parameter can only contain letters, digits, or "-_" +cms.contenttypes.ui.decisiontree.targets.form.none=-- none -- +cms.contenttypes.ui.decisiontree.options.form.please_select=-- please select -- +cms.contenttypes.ui.decisiontree.properties.form.description_label=Description +cms.contenttypes.ui.decisiontree.sections.form.instructions_label=Instructions +cms.contenttypes.ui.decisiontree.options.form.label=Label +cms.contenttypes.ui.decisiontree.targets.form.match_value=Value to Match +cms.contenttypes.ui.decisiontree.sections.form.parameter_name_label=Parameter Name +cms.contenttypes.ui.decisiontree.options.form.section=Section +cms.contenttypes.ui.decisiontree.targets.form.target_section_label=Target Section +cms.contenttypes.ui.decisiontree.targets.form.target_url_label=Target URL +cms.contenttypes.ui.decisiontree.sections.form.title_label=Title +cms.contenttypes.ui.decisiontree.options.form.value=Value +cms.contenttypes.ui.decisiontree.targets.form.target_required=Either a target URL or a target section is required. +cms.contenttypes.ui.decisiontree.targets.form.duplicate_target=Please enter a target URL or a target section, but not both. +cms.contenttypes.ui.decisiontree.properties.cancel_url=Cancel URL after user abort: +cms.contenttypes.ui.decisiontree.options.add_new=Add new option +cms.contenttypes.ui.decisiontree.options.add=Add Option +cms.contenttypes.ui.decisiontree.options.delete=Delete option +cms.contenttypes.ui.authoring.decisiontree.section_options.description=The options that belong to this decision tree's sections. +cms.contenttypes.ui.decisiontree.options.edit=Edit Option +cms.contenttypes.ui.decisiontree.options.table.move_option_name=Move option {0} +cms.contenttypes.ui.decisiontree.options.table.move_to_beginning=Move to beginning +cms.contenttypes.ui.decisiontree.options.none_yet=No options yet +cms.contenttypes.ui.authoring.decisiontree.section_options.title=Decision Options +cms.contenttypes.ui.decisiontree.options.view_all=View all options +cms.contenttypes.ui.decisiontree.targets.add_new=Add new target +cms.contenttypes.ui.decisiontree.targets.add=Add Target +cms.contenttypes.ui.decisiontree.targets.delete=Delete target +cms.contenttypes.ui.authoring.decisiontree.option_targets.description=The targets that belong to this decision treeS. +cms.contenttypes.ui.decisiontree.targets.edit=Edit Target +cms.contenttypes.ui.decisiontree.targets.none_yet=No targets yet +cms.contenttypes.ui.authoring.decisiontree.option_targets.title=Decision Option Targets +cms.contenttypes.ui.decisiontree.targets.view_all=View all targets +cms.contenttypes.ui.decisiontree.options.form.submission_cancelled=Option submission cancelled +cms.contenttypes.ui.decisiontree.sections.add_new_label=Add new section +cms.contenttypes.ui.decisiontree.sections.add=Add Section +cms.contenttypes.ui.decisiontree.sections.delete=Delete section +cms.contenttypes.ui.authoring.decisiontree.tree_sections.description=The sections that belong to this decision tree. +cms.contenttypes.ui.decisiontree.sections.edit=Edit Section +cms.contenttypes.ui.decisiontree.sections.no_sections_yet=No sections yet +cms.contenttypes.ui.authoring.decisiontree.tree_sections.title=Decision Sections +cms.contenttypes.ui.decisiontree.sections.view_all=View all sections +cms.contenttypes.ui.decisiontree.sections.table.header_section=Decision Section +cms.contenttypes.ui.decisiontree.sections.table.header_edit=Edit +cms.contenttypes.ui.decisiontree.sections.table.header_delete=Delete +cms.contenttypes.ui.decisiontree.sections.table.header_first_section=First Section? +cms.contenttypes.ui.decisiontree.sections.table.link_delete=delete +cms.contenttypes.ui.decisiontree.sections.table.link_edit=edit +cms.contenttypes.ui.decisiontree.sections.table.link_set_first=set +cms.contenttypes.ui.decisiontree.options.table.header_section=Decision Section +cms.contenttypes.ui.decisiontree.options.table.header_option=Decision Option +cms.contenttypes.ui.decisiontree.options.table.header_edit=Edit +cms.contenttypes.ui.decisiontree.options.table.header_move=Move +cms.contenttypes.ui.decisiontree.options.table.header_delete=Delete +cms.contenttypes.ui.decisiontree.options.table.link_delete=delete +cms.contenttypes.ui.decisiontree.options.table.link_move=move +cms.contenttypes.ui.decisiontree.options.table.link_edit=edit +cms.contenttypes.ui.decisiontree.targets.form.please_select=-- please select -- +cms.contenttypes.ui.decisiontree.targets.form.submission_cancelled=Target submission cancelled +cms.contenttypes.ui.decisiontree.targets.form.delete.delete_button=Delete +cms.contenttypes.ui.decisiontree.targets.form.delete.target_match_value=Target Match Value +cms.contenttypes.ui.decisiontree.targets.submission_cancelled=Submission cancelled +cms.contenttypes.ui.decisiontree.sections.form.submission_cancelled=Submission cancelled +cms.contenttypes.ui.decisiontree.options.table.link_move_below=move below +cms.contenttypes.ui.decisiontree.options.table.link_no_move=leave it here +cms.contenttypes.ui.decisiontree.targets.table.header_section=Decision Section +cms.contenttypes.ui.decisiontree.targets.table.header_match=Decision Option +cms.contenttypes.ui.decisiontree.targets.table.header_edit=Edit +cms.contenttypes.ui.decisiontree.targets.table.header_delete=Delete +cms.contenttypes.ui.decisiontree.targets.table.link_edit=edit +cms.contenttypes.ui.decisiontree.targets.table.link_delete=delete +cms.contenttypes.ui.decisiontree.sections.delete_button=Delete +cms.contenttypes.ui.decisiontree.sections.delete_section_msg=Section to be deleted: "{0}" +cms.contenttypes.ui.decisiontree.options.delete_option_msg=Option to be deleted: "{0}" +cms.contenttypes.ui.decisiontree.options.delete_button=Delete +cms.contenttypes.ui.decisiontree.options.delete.submission_cancelled=Option Delete submission cancelled diff --git a/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/DecisionTreeSectionCollection.java b/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/DecisionTreeSectionCollection.java index 915002162..2571b6c5e 100644 --- a/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/DecisionTreeSectionCollection.java +++ b/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/DecisionTreeSectionCollection.java @@ -30,8 +30,6 @@ import com.arsdigita.persistence.DataCollection; */ public class DecisionTreeSectionCollection extends DomainCollection { - public static final String versionId = "$Id$"; - /** * Constructor. * @@ -55,6 +53,7 @@ public class DecisionTreeSectionCollection extends DomainCollection { * the collection. * **/ + @Override public DomainObject getDomainObject() { return new DecisionTreeSection(m_dataCollection.getDataObject()); } diff --git a/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeOptionDeleteForm.java b/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeOptionDeleteForm.java index 82a0e2453..bfdffafe6 100644 --- a/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeOptionDeleteForm.java +++ b/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeOptionDeleteForm.java @@ -34,7 +34,7 @@ import com.arsdigita.bebop.event.FormProcessListener; import com.arsdigita.bebop.event.FormSectionEvent; import com.arsdigita.bebop.event.FormSubmissionListener; import com.arsdigita.cms.contenttypes.DecisionTreeSectionOption; -import com.arsdigita.cms.contenttypes.DecisionTreeUtil; +import com.arsdigita.cms.contenttypes.util.DecisionTreeGlobalizationUtil; import com.arsdigita.cms.ItemSelectionModel; /** @@ -46,17 +46,21 @@ import com.arsdigita.cms.ItemSelectionModel; public class DecisionTreeOptionDeleteForm extends Form implements FormInitListener, FormSubmissionListener, - FormProcessListener -{ + FormProcessListener { private final static Logger s_log = Logger.getLogger( DecisionTreeOptionDeleteForm.class.getName()); protected ItemSelectionModel m_selTree; protected ItemSelectionModel m_selOption; protected SaveCancelSection m_saveCancelSection; - private Label m_optionLabel; + /** Label denoting the name of the option to delete. */ + private Label optionLabel; + /** Value containin the actual name of the option to be deleted. Will be + * passed into the Label field above using string formatter */ + private String[] optionValue = new String[1]; /** + * Constructor. * * @param selTree * @param selOption @@ -75,9 +79,12 @@ public class DecisionTreeOptionDeleteForm extends Form panel.setColumnWidth(2, "80%"); panel.setWidth("100%"); - m_optionLabel = new Label("Option Label"); - add(m_optionLabel, ColumnPanel.FULL_WIDTH | ColumnPanel.LEFT); - addSaveCancelSection(); + optionLabel = new Label( // "Option Label"); + DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.options.delete_option_msg", + optionValue)); + add(optionLabel, ColumnPanel.FULL_WIDTH | ColumnPanel.LEFT); + addSaveCancelSection(); // add a save/cancel section to the form addInitListener(this); addSubmissionListener(this); @@ -85,12 +92,14 @@ public class DecisionTreeOptionDeleteForm extends Form } /** - * - * @return + * Create and adjust the label(s) of the SaveCancel button bar. + * @return a new save/cancel bar with customized button labels */ protected SaveCancelSection addSaveCancelSection () { m_saveCancelSection = new SaveCancelSection(); - m_saveCancelSection.getSaveButton().setButtonLabel("Delete"); + m_saveCancelSection.getSaveButton().setButtonLabel( // "Delete"); + DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.options.delete_button")); add(m_saveCancelSection, ColumnPanel.FULL_WIDTH | ColumnPanel.LEFT); return m_saveCancelSection; } @@ -101,21 +110,23 @@ public class DecisionTreeOptionDeleteForm extends Form * @throws FormProcessException */ public void init ( FormSectionEvent event ) throws FormProcessException { + PageState state = event.getPageState(); - BigDecimal id = new BigDecimal(m_selOption - .getSelectedKey(state).toString()); + BigDecimal id = new BigDecimal(m_selOption.getSelectedKey(state) + .toString()); DecisionTreeSectionOption option = new DecisionTreeSectionOption(id); - - m_optionLabel.setLabel(option.getLabel(), state); + optionValue[0] = option.getLabel(); //insert the actual name to the label } public void submitted ( FormSectionEvent event ) throws FormProcessException { PageState state = event.getPageState(); if ( m_saveCancelSection.getCancelButton().isSelected(state) ) { - throw new FormProcessException( (String) DecisionTreeUtil - .globalize("tree_section.submission_cancelled").localize()); + throw new FormProcessException( (String) + DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.options.delete.submission_cancelled") + .localize()); } } diff --git a/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeOptionEditForm.java b/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeOptionEditForm.java index a8f64828d..098ba4aa5 100644 --- a/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeOptionEditForm.java +++ b/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeOptionEditForm.java @@ -46,7 +46,7 @@ import com.arsdigita.cms.contenttypes.DecisionTree; import com.arsdigita.cms.contenttypes.DecisionTreeSection; import com.arsdigita.cms.contenttypes.DecisionTreeSectionCollection; import com.arsdigita.cms.contenttypes.DecisionTreeSectionOption; -import com.arsdigita.cms.contenttypes.DecisionTreeUtil; +import com.arsdigita.cms.contenttypes.util.DecisionTreeGlobalizationUtil; import com.arsdigita.cms.ItemSelectionModel; /** @@ -66,7 +66,7 @@ public class DecisionTreeOptionEditForm extends Form private ItemSelectionModel m_selTree; private ItemSelectionModel m_selOption; - private DecisionTreeViewOptions m_container; + private DecisionTreeOptionStep m_container; private SaveCancelSection m_saveCancelSection; private SingleSelect m_sectionWidget; @@ -94,8 +94,9 @@ public class DecisionTreeOptionEditForm extends Form * @param container container which this form is added to */ public DecisionTreeOptionEditForm(ItemSelectionModel selTree, - ItemSelectionModel selOption, - DecisionTreeViewOptions container) { + ItemSelectionModel selOption, + DecisionTreeOptionStep container) { + super("DecisionTreeOptionEditForm", new ColumnPanel(2)); m_selTree = selTree; m_selOption = selOption; @@ -180,10 +181,14 @@ public class DecisionTreeOptionEditForm extends Form * Add form widgets for a Section. */ protected void addWidgets() { - Option pleaseSelect = new Option("", (String)DecisionTreeUtil.globalize("form.please_select").localize()); + Option pleaseSelect = new Option( + "", + new Label(DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.options.form.please_select") + )); - add(new Label(DecisionTreeUtil - .globalize("form_label.section"))); + add(new Label(DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.options.form.section"))); m_sectionWidget = new SingleSelect(SECTION); m_sectionWidget.addValidationListener(new NotNullValidationListener()); m_sectionWidget.addOption(pleaseSelect); @@ -200,14 +205,15 @@ public class DecisionTreeOptionEditForm extends Form add(m_sectionWidget); - add(new Label(DecisionTreeUtil - .globalize("form_label.label"))); + add(new Label(DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.options.form.label"))); TextField labelWidget = new TextField(new TrimmedStringParameter(LABEL)); labelWidget.addValidationListener(new NotNullValidationListener()); labelWidget.setSize(60); add(labelWidget); - add(new Label(DecisionTreeUtil.globalize("form_label.value"))); + add(new Label(DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.options.form.value"))); TextField valueWidget = new TextField(new TrimmedStringParameter(VALUE)); valueWidget.addValidationListener(new NotNullValidationListener()); valueWidget.setSize(60); @@ -225,11 +231,11 @@ public class DecisionTreeOptionEditForm extends Form if ( m_saveCancelSection.getCancelButton() .isSelected(state) && m_container != null) { m_container.onlyShowComponent( - state, DecisionTreeViewOptions.OPTION_TABLE + + state, DecisionTreeOptionStep.OPTION_TABLE + m_container.getTypeIDStr()); throw new FormProcessException( - (String)DecisionTreeUtil - .globalize("tree_section.submission_cancelled") + (String)DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.options.form.submission_cancelled") .localize()); } } @@ -267,11 +273,12 @@ public class DecisionTreeOptionEditForm extends Form if (m_container != null) { m_container.onlyShowComponent( state, - DecisionTreeViewOptions.OPTION_TABLE + + DecisionTreeOptionStep.OPTION_TABLE + m_container.getTypeIDStr()); } } + @Override public void register(Page p) { super.register(p); } diff --git a/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeViewOptions.java b/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeOptionStep.java similarity index 69% rename from ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeViewOptions.java rename to ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeOptionStep.java index c8ab28ddf..e667a873c 100644 --- a/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeViewOptions.java +++ b/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeOptionStep.java @@ -38,16 +38,12 @@ import com.arsdigita.bebop.event.PrintListener; import com.arsdigita.bebop.event.TableActionEvent; import com.arsdigita.bebop.event.TableActionListener; import com.arsdigita.bebop.parameters.BigDecimalParameter; -import com.arsdigita.bebop.table.TableColumn; -import com.arsdigita.cms.contenttypes.DecisionTree; -import com.arsdigita.cms.contenttypes.DecisionTreeUtil; +import com.arsdigita.cms.CMS; import com.arsdigita.cms.contenttypes.DecisionTreeSectionOption; -import com.arsdigita.cms.contenttypes.DecisionTreeSection; +import com.arsdigita.cms.contenttypes.util.DecisionTreeGlobalizationUtil; import com.arsdigita.cms.ContentItem; import com.arsdigita.cms.ItemSelectionModel; import com.arsdigita.cms.SecurityManager; -import com.arsdigita.cms.contenttypes.ui.ResettableContainer; -import com.arsdigita.cms.dispatcher.Utilities; import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; import com.arsdigita.util.Assert; @@ -61,11 +57,14 @@ import com.arsdigita.util.Assert; * @author Carsten Clasohm * @version $Id$ */ -public class DecisionTreeViewOptions extends ResettableContainer +public class DecisionTreeOptionStep extends ResettableContainer { - /** id keys for each editing panel */ + // id keys for each editing panel + /** id key for table panel */ public static final String OPTION_TABLE = "opt_tbl"; + /** id key for edit form panel */ public static final String OPTION_EDIT = "opt_edt"; + /** id key for delete form panel */ public static final String OPTION_DEL = "opt_del"; /** class attributes */ @@ -78,9 +77,12 @@ public class DecisionTreeViewOptions extends ResettableContainer protected ItemSelectionModel m_moveOption; protected BigDecimalParameter m_moveParameter; - /** visual components that do the 'real work' */ + // visual components that do the 'real work' + /** Table visual component that does the 'real work' */ protected DecisionTreeOptionTable m_optionTable; + /** EditForm visual component that does the 'real work' */ protected DecisionTreeOptionEditForm m_optionEdit; + /** DeleteForm visual component that does the 'real work' */ protected DecisionTreeOptionDeleteForm m_optionDelete; protected ActionLink m_beginLink; @@ -88,7 +90,14 @@ public class DecisionTreeViewOptions extends ResettableContainer private String m_typeIDStr; - public DecisionTreeViewOptions (ItemSelectionModel selTree, AuthoringKitWizard wizard) { + /** + * Constructor. + * + * @param selTree + * @param wizard + */ + public DecisionTreeOptionStep (ItemSelectionModel selTree, + AuthoringKitWizard wizard) { super(); m_selTree = selTree; m_wizard = wizard; @@ -111,31 +120,37 @@ public class DecisionTreeViewOptions extends ResettableContainer c.setBorderColor("#FFFFFF"); c.setPadColor("#FFFFFF"); + // Just create Link to add a new option, to be added below the table body + final ActionLink addOptionLink = buildAddLink(); + m_moveParameter = new BigDecimalParameter("moveOption"); - m_moveOption = new ItemSelectionModel(DecisionTreeSectionOption.class.getName(), - DecisionTreeSectionOption.BASE_DATA_OBJECT_TYPE, - m_moveParameter); + m_moveOption = new ItemSelectionModel( + DecisionTreeSectionOption.class.getName(), + DecisionTreeSectionOption.BASE_DATA_OBJECT_TYPE, + m_moveParameter); m_optionTable = new DecisionTreeOptionTable(m_selTree, m_moveOption); m_optionTable.setClassAttr(DATA_TABLE); // selected option is based on the selection in the OptionTable - m_selOption = new ItemSelectionModel(DecisionTreeSectionOption.class.getName(), - DecisionTreeSectionOption.BASE_DATA_OBJECT_TYPE, - m_optionTable.getRowSelectionModel()); + m_selOption = new ItemSelectionModel( + DecisionTreeSectionOption.class.getName(), + DecisionTreeSectionOption.BASE_DATA_OBJECT_TYPE, + m_optionTable.getRowSelectionModel()); m_optionTable.setOptionModel(m_selOption); - Label emptyView = new Label(DecisionTreeUtil - .globalize("section_options.no_options_yet")); + Label emptyView = new Label(DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.options.none_yet")); m_optionTable.setEmptyView(emptyView); - m_moveOptionLabel = new Label ("Option Name"); + m_moveOptionLabel = new Label (); //will be set later below c.add(m_moveOptionLabel, ColumnPanel.FULL_WIDTH | ColumnPanel.LEFT); - m_beginLink = new ActionLink(DecisionTreeUtil - .globalize("section_options.move_to_beginning")); + m_beginLink = new ActionLink(DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.options.table.move_to_beginning")); c.add(m_beginLink); + m_beginLink.addActionListener ( new ActionListener() { public void actionPerformed ( ActionEvent event ) { PageState state = event.getPageState(); @@ -155,9 +170,11 @@ public class DecisionTreeViewOptions extends ResettableContainer if ( m_moveOption.getSelectedKey(state) == null ) { m_beginLink.setVisible(state, false); m_moveOptionLabel.setVisible(state, false); + addOptionLink.setVisible(state, true); } else { m_beginLink.setVisible(state, true); m_moveOptionLabel.setVisible(state, true); + addOptionLink.setVisible(state, false); DecisionTreeSectionOption option = (DecisionTreeSectionOption) m_moveOption @@ -165,11 +182,12 @@ public class DecisionTreeViewOptions extends ResettableContainer String optionName = option.getSection().getTitle() + " - " + option.getLabel(); - m_moveOptionLabel.setLabel - ( (String)DecisionTreeUtil - .globalize("section_options.move_option_name") - .localize() - + " \"" + optionName + "\"", state); + String[] moveOptionValues = {" \"" + optionName + "\""}; + m_moveOptionLabel.setLabel( // overwrite previously defined empty + DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.options.table.move_option_name", + moveOptionValues) + , state); } } }); @@ -178,14 +196,11 @@ public class DecisionTreeViewOptions extends ResettableContainer m_optionTable.addTableActionListener (new TableActionListener () { public void cellSelected (TableActionEvent event) { PageState state = event.getPageState(); + int col = event.getColumn(); - TableColumn col = m_optionTable.getColumnModel() - .get(event.getColumn().intValue()); - String colName = (String)col.getHeaderValue(); - - if (DecisionTreeOptionTable.COL_DEL.equals(colName)) { + if ( col == DecisionTreeOptionTable.COL_IDX_DEL ) { onlyShowComponent(state, OPTION_DEL+m_typeIDStr); - } else if (DecisionTreeOptionTable.COL_EDIT.equals(colName)) { + } else if ( col == DecisionTreeOptionTable.COL_IDX_EDIT ) { onlyShowComponent(state, OPTION_EDIT+m_typeIDStr); } } @@ -195,14 +210,16 @@ public class DecisionTreeViewOptions extends ResettableContainer c.add(m_optionTable); // link to add new section - c.add(buildAddLink()); + c.add(addOptionLink); return c; } /** - * Builds a container to hold a SectionEditForm and a link - * to return to the section list. + * Builds a container to hold a SectionEditForm and a link to return to + * the option list. + * This container replaces the option table when the "edit" link is + * selected {@see buildOptionTable ()} above. */ protected Container buildOptionEdit () { ColumnPanel c = new ColumnPanel(1); @@ -217,9 +234,11 @@ public class DecisionTreeViewOptions extends ResettableContainer Label label = (Label)event.getTarget(); if (m_selOption.getSelectedKey(state) == null) { - label.setLabel((String)DecisionTreeUtil.globalize("section_options.add_option").localize()); + label.setLabel(DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.options.add")); } else { - label.setLabel((String)DecisionTreeUtil.globalize("section_options.edit_option").localize()); + label.setLabel(DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.options.edit")); } } })); @@ -229,15 +248,15 @@ public class DecisionTreeViewOptions extends ResettableContainer c.add(m_optionEdit); c.add(buildViewAllLink()); - // link to add new section - c.add(buildAddLink()); + c.add(buildAddLink()); // link to add new section return c; } /** - * Builds a container to hold the component to confirm - * deletion of a section. + * Builds a container to hold the component to confirm deletion of an option. + * This container replaces the option table when the "delete" link is + * selected {@see buildOptionTable ()} above. */ protected Container buildOptionDelete () { ColumnPanel c = new ColumnPanel(1); @@ -245,7 +264,8 @@ public class DecisionTreeViewOptions extends ResettableContainer c.setBorderColor("#FFFFFF"); c.setPadColor("#FFFFFF"); - c.add(new Label(DecisionTreeUtil.globalize("section_options.delete_option"))); + c.add(new Label(DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.options.delete"))); m_optionDelete = new DecisionTreeOptionDeleteForm(m_selTree, m_selOption); m_optionDelete.addSubmissionListener ( new FormSubmissionListener () { public void submitted ( FormSectionEvent e ) { @@ -264,7 +284,8 @@ public class DecisionTreeViewOptions extends ResettableContainer * Utility method to create a link to display the section list. */ protected ActionLink buildViewAllLink () { - ActionLink viewAllLink = new ActionLink( (String) DecisionTreeUtil.globalize("section_options.view_all_options").localize()); + ActionLink viewAllLink = new ActionLink( DecisionTreeGlobalizationUtil + .globalize("cms.contenttypes.ui.decisiontree.options.view_all")); viewAllLink.setClassAttr(ACTION_LINK); viewAllLink.addActionListener( new ActionListener() { public void actionPerformed ( ActionEvent event ) { @@ -279,14 +300,17 @@ public class DecisionTreeViewOptions extends ResettableContainer * Utility method to create a link to display the section list. */ protected ActionLink buildAddLink () { - ActionLink addLink = new ActionLink( (String) DecisionTreeUtil.globalize("section_options.add_new_option").localize()) { + ActionLink addLink = new ActionLink( DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.options.add_new")) { + @Override public boolean isVisible(PageState state) { - SecurityManager sm = Utilities.getSecurityManager(state); + SecurityManager sm = CMS.getSecurityManager(state); ContentItem item = (ContentItem)m_selTree.getSelectedObject(state); - return super.isVisible(state) && - sm.canAccess(state.getRequest(), SecurityManager.EDIT_ITEM, - item); + return super.isVisible(state) + && sm.canAccess(state.getRequest(), + SecurityManager.EDIT_ITEM, + item); } }; @@ -302,6 +326,11 @@ public class DecisionTreeViewOptions extends ResettableContainer return addLink; } + /** + * + * @param p + */ + @Override public void register ( Page p ) { super.register(p); p.addGlobalStateParam(m_moveParameter); diff --git a/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeOptionTable.java b/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeOptionTable.java index 3af9f9858..10ebcfb3d 100644 --- a/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeOptionTable.java +++ b/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeOptionTable.java @@ -34,6 +34,7 @@ import com.arsdigita.bebop.table.TableColumn; import com.arsdigita.bebop.table.TableColumnModel; import com.arsdigita.bebop.table.TableModel; import com.arsdigita.bebop.table.TableModelBuilder; +import com.arsdigita.cms.CMS; import com.arsdigita.cms.contenttypes.DecisionTree; import com.arsdigita.cms.contenttypes.DecisionTreeSection; import com.arsdigita.cms.contenttypes.DecisionTreeSectionOption; @@ -41,7 +42,7 @@ import com.arsdigita.cms.contenttypes.DecisionTreeSectionOptionCollection; 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.contenttypes.util.DecisionTreeGlobalizationUtil; import com.arsdigita.util.LockableImpl; /** @@ -53,12 +54,13 @@ import com.arsdigita.util.LockableImpl; */ public class DecisionTreeOptionTable extends Table { - // column headings - public static final String COL_SECTION = "Section"; - public static final String COL_OPTION = "Option"; - public static final String COL_EDIT = "Edit"; - public static final String COL_MOVE = "Move"; - public static final String COL_DEL = "Delete"; + + // match columns by (symbolic) index, makes for easier reordering + public static final int COL_IDX_SECTION = 0; + public static final int COL_IDX_OPTION = 1; + public static final int COL_IDX_EDIT = 2; + public static final int COL_IDX_MOVE = 3; + public static final int COL_IDX_DEL = 4; private ItemSelectionModel m_selTree; private ItemSelectionModel m_selOption; @@ -80,11 +82,31 @@ public class DecisionTreeOptionTable extends Table m_moveOption = moveOption; TableColumnModel model = getColumnModel(); - model.add(new TableColumn(0, COL_SECTION)); - model.add(new TableColumn(1, COL_OPTION)); - model.add(new TableColumn(2, COL_EDIT)); - model.add(new TableColumn(3, COL_MOVE)); - model.add(new TableColumn(4, COL_DEL)); + model.add(new TableColumn( + COL_IDX_SECTION, + new Label(DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.options.table.header_section") + ) )); + model.add(new TableColumn( + COL_IDX_OPTION, + new Label(DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.options.table.header_option") + ) )); + model.add(new TableColumn( + COL_IDX_EDIT, + new Label(DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.options.table.header_edit") + ) )); + model.add(new TableColumn( + COL_IDX_MOVE, + new Label(DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.options.table.header_move") + ) )); + model.add(new TableColumn( + COL_IDX_DEL, + new Label(DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.options.table.header_delete") + ) )); model.get(2).setCellRenderer(new SectionTableCellRenderer(true)); model.get(3).setCellRenderer(new SectionTableCellRenderer(true)); @@ -96,19 +118,24 @@ public class DecisionTreeOptionTable extends Table public void cellSelected ( TableActionEvent event ) { PageState state = event.getPageState(); - TableColumn col = getColumnModel() - .get(event.getColumn().intValue()); - String colName = (String)col.getHeaderValue(); + TableColumn col = getColumnModel().get(event.getColumn() + .intValue()); + int colIndex = event.getColumn(); - if ( COL_MOVE.equals(colName) ) { + if ( colIndex == COL_IDX_MOVE ) { if ( m_moveOption.getSelectedKey(state) == null ) { - m_moveOption.setSelectedKey(state, m_selOption.getSelectedKey(state)); + m_moveOption.setSelectedKey( + state, + m_selOption.getSelectedKey(state)); } else { - BigDecimal id = (BigDecimal) m_moveOption.getSelectedKey(state); - DecisionTreeSectionOption option = new DecisionTreeSectionOption(id); + BigDecimal id = (BigDecimal) m_moveOption + .getSelectedKey(state); + DecisionTreeSectionOption option = new + DecisionTreeSectionOption(id); BigDecimal dest = new BigDecimal((String) event.getRowKey()); - DecisionTreeSectionOption destOption = new DecisionTreeSectionOption(dest); + DecisionTreeSectionOption destOption = new + DecisionTreeSectionOption(dest); DecisionTreeSection section = option.getSection(); @@ -143,15 +170,16 @@ public class DecisionTreeOptionTable extends Table } /** - * The model builder to generate a suitable model for the OptionTable + * Internal class model builder to generate a suitable model for the + * OptionTable. */ protected class OptionTableModelBuilder extends LockableImpl - implements TableModelBuilder - { + implements TableModelBuilder { protected ItemSelectionModel m_selTree; protected ItemSelectionModel m_moveOption; - public OptionTableModelBuilder(ItemSelectionModel selTree, ItemSelectionModel moveOption) { + public OptionTableModelBuilder(ItemSelectionModel selTree, + ItemSelectionModel moveOption) { m_selTree = selTree; m_moveOption = moveOption; } @@ -163,8 +191,10 @@ public class DecisionTreeOptionTable extends Table } } - protected class OptionTableModel implements TableModel - { + /** + * Internal class + */ + protected class OptionTableModel implements TableModel { private TableColumnModel m_colModel; private PageState m_state; private DecisionTreeSectionOptionCollection m_options; @@ -172,7 +202,8 @@ public class DecisionTreeOptionTable extends Table private DecisionTreeSectionOption m_option; /** Constructor. */ - public OptionTableModel(Table table, PageState state, DecisionTree tree, ItemSelectionModel moveOption) { + public OptionTableModel(Table table, PageState state, DecisionTree tree, + ItemSelectionModel moveOption) { m_colModel = table.getColumnModel(); m_state = state; m_options = tree.getOptions(); @@ -195,32 +226,53 @@ public class DecisionTreeOptionTable extends Table return false; } - /** Return the data element for the given column and the current row. */ + /** + * Return the data element for the given column and the current row. + */ public Object getElementAt(int columnIndex) { if (m_colModel == null) { return null; } - // match columns by name... makes for easier reordering - TableColumn col = m_colModel.get(columnIndex); - String colName = (String) col.getHeaderValue(); - - if (COL_SECTION.equals(colName)) { + // match columns by (symbolic) index, makes for easier reordering + if ( columnIndex == COL_IDX_SECTION ) { return m_option.getSection().getTitle(); - } else if (COL_OPTION.equals(colName)) { + } else if (columnIndex == COL_IDX_OPTION ) { return m_option.getLabel(); - } else if (COL_EDIT.equals(colName)) { - return "edit"; - } else if (COL_MOVE.equals(colName)) { + } else if ( columnIndex == COL_IDX_EDIT ) { + return new Label(DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.options.table.link_edit") + ); + } else if ( columnIndex == COL_IDX_MOVE ) { if ( m_moveOption.getSelectedKey(m_state) == null ) { - return "move"; + return new Label(DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.options.table.link_move") + ); } else { - DecisionTreeSectionOption src = new DecisionTreeSectionOption(new BigDecimal((String) m_moveOption.getSelectedKey(m_state))); - if (m_option.getSection().equals(src.getSection())) - return "move below here"; - else - return ""; + DecisionTreeSectionOption src = + new DecisionTreeSectionOption( + new BigDecimal((String)m_moveOption + .getSelectedKey(m_state))); + if (m_option.getSection().equals(src.getSection())) { + + if ( m_option.getLabel().equals(src.getLabel() ) ) + return new Label(DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.options.table.link_no_move") + ); + else + // return "move below here"; + return new Label(DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.options.table.link_move_below") + ); + } else + // no link should be provided for options not belonging + // to the same section as the option to be moved + // return anything different from Label to prevent + // creation of an ActionLink + return null; } - } else if (COL_DEL.equals(colName)) { - return "delete"; + } else if ( columnIndex == COL_IDX_DEL ) { + return new Label(DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.options.table.link_delete") + ); } return null; @@ -245,30 +297,42 @@ public class DecisionTreeOptionTable extends Table m_active = active; } + /** + * + * @param table + * @param state + * @param value + * @param isSelected + * @param key + * @param row + * @param column + * @return + */ public Component getComponent(Table table, PageState state, - Object value, boolean isSelected, - Object key, int row, int column) { + Object value, boolean isSelected, + Object key, int row, int column) { Component ret = null; - SecurityManager sm = Utilities.getSecurityManager(state); + SecurityManager sm = CMS.getSecurityManager(state); ContentItem item = (ContentItem)m_selTree.getSelectedObject(state); - boolean active = m_active && - sm.canAccess(state.getRequest(), SecurityManager.EDIT_ITEM, - item); + boolean active = m_active && sm.canAccess(state.getRequest(), + SecurityManager.EDIT_ITEM, + item); - if (value instanceof Component) { - ret = (Component)value; - } else { - if (value == null) { - ret = new Label("", false); + if (value == null) { + ret = new Label("", false); + } else if (value instanceof Label) { + if (active) { + // ret = new ControlLink(value.toString()); + ret = new ControlLink( (Component)value ); } else { - if (active) { - ret = new ControlLink(value.toString()); - } else { - ret = new Label(value.toString()); - } + // ret = new Label(value.toString()); + ret = (Component)value; } - } + } else { + // last resort, should never happen + ret = (Component)value; + } return ret; } diff --git a/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeParameterNameValidationListener.java b/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeParameterNameValidationListener.java index fae0cece5..24f37d06e 100644 --- a/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeParameterNameValidationListener.java +++ b/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeParameterNameValidationListener.java @@ -22,22 +22,21 @@ import com.arsdigita.bebop.FormProcessException; import com.arsdigita.bebop.event.ParameterEvent; import com.arsdigita.bebop.parameters.GlobalizedParameterListener; import com.arsdigita.bebop.parameters.ParameterData; -import com.arsdigita.cms.contenttypes.DecisionTreeUtil; +import com.arsdigita.cms.contenttypes.util.DecisionTreeGlobalizationUtil; import com.arsdigita.globalization.GlobalizedMessage; /** - * Verifies that the - * parameter's value contains only letters, digits, "-" and "_". + * Verifies that the parameter's value contains only letters, digits, "-" and "_". * * @author Carsten Clasohm * @version $Id$ - **/ - + */ public class DecisionTreeParameterNameValidationListener extends GlobalizedParameterListener { public DecisionTreeParameterNameValidationListener() { - setError(DecisionTreeUtil.globalize("error.parameter_name_characters")); + setError(DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.error.parameter_name_characters")); } public DecisionTreeParameterNameValidationListener(GlobalizedMessage error) { diff --git a/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreePropertiesForm.java b/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreePropertiesForm.java index d1aaf0666..6db63a254 100644 --- a/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreePropertiesForm.java +++ b/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreePropertiesForm.java @@ -30,7 +30,7 @@ import com.arsdigita.bebop.form.TextField; import com.arsdigita.bebop.parameters.StringParameter; import com.arsdigita.bebop.parameters.TrimmedStringParameter; import com.arsdigita.cms.contenttypes.DecisionTree; -import com.arsdigita.cms.contenttypes.DecisionTreeUtil; +import com.arsdigita.cms.contenttypes.util.DecisionTreeGlobalizationUtil; import com.arsdigita.cms.ItemSelectionModel; import com.arsdigita.cms.ui.authoring.BasicPageForm; @@ -65,17 +65,20 @@ public class DecisionTreePropertiesForm extends BasicPageForm implements addSubmissionListener(this); } + @Override protected void addWidgets() { super.addWidgets(); - add(new Label(DecisionTreeUtil.globalize("form_label.description"))); + add(new Label(DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.properties.form.description_label"))); TextArea description = new TextArea(new TrimmedStringParameter(DESCRIPTION)); description.setRows(5); description.setCols(30); add(description); - add(new Label(DecisionTreeUtil.globalize("form_label.cancel_url"))); + add(new Label(DecisionTreeGlobalizationUtil.globalize + ("cms.contenttypes.ui.decisiontree.properties.cancel_url"))); TextField cancelURL = new TextField(new StringParameter(CANCEL_URL)); cancelURL.setSize(60); add(cancelURL); diff --git a/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreePropertiesStep.java b/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreePropertiesStep.java index dea8868ab..f27fa8739 100644 --- a/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreePropertiesStep.java +++ b/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreePropertiesStep.java @@ -19,9 +19,10 @@ package com.arsdigita.cms.contenttypes.ui; import com.arsdigita.bebop.Component; -import com.arsdigita.cms.contenttypes.DecisionTreeUtil; import com.arsdigita.cms.ContentItem; import com.arsdigita.cms.ContentPage; +import com.arsdigita.cms.ContentSection; +import com.arsdigita.cms.contenttypes.util.DecisionTreeGlobalizationUtil; import com.arsdigita.cms.ItemSelectionModel; import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; import com.arsdigita.cms.ui.authoring.BasicPageForm; @@ -43,7 +44,8 @@ public class DecisionTreePropertiesStep extends SimpleEditStep { public final static String CANCEL_URL = "cancelURL"; public DecisionTreePropertiesStep(ItemSelectionModel itemModel, - AuthoringKitWizard parent) { + AuthoringKitWizard parent) { + super(itemModel, parent); setDefaultEditKey(EDIT_SHEET_NAME); @@ -51,27 +53,42 @@ public class DecisionTreePropertiesStep extends SimpleEditStep { BasicPageForm editSheet; editSheet = new DecisionTreePropertiesForm( itemModel, this ); - add(EDIT_SHEET_NAME, "Edit", new WorkflowLockedComponentAccess(editSheet, itemModel), - editSheet.getSaveCancelSection().getCancelButton() ); + add(EDIT_SHEET_NAME, + GlobalizationUtil.globalize("cms.ui.edit"), + new WorkflowLockedComponentAccess(editSheet, itemModel), + editSheet.getSaveCancelSection().getCancelButton() ); setDisplayComponent(getPropertySheet(itemModel)); } /** - * Returns a component that displays the properties of the - * Article specified by the ItemSelectionModel passed in. - * @param itemModel The ItemSelectionModel to use - * @pre itemModel != null - * @return A component to display the state of the basic properties - * of the release + * Returns a component that displays the properties of the DecisionTree + * specified by the ItemSelectionModel passed in. + * + * @param itemModel The ItemSelectionModel to use + * @pre itemModel != null + * @return A component to display the state of the basic + * properties of the release */ public static Component getPropertySheet( ItemSelectionModel itemModel ) { + DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(itemModel); - sheet.add(GlobalizationUtil.globalize("cms.contenttypes.ui.name"), ContentItem.NAME); - sheet.add(GlobalizationUtil.globalize("cms.contenttypes.ui.title"), ContentPage.TITLE); - sheet.add(GlobalizationUtil.globalize("cms.contenttypes.ui.description"), ContentPage.DESCRIPTION); - sheet.add(DecisionTreeUtil.globalize("properties.cancel_url"), CANCEL_URL); + sheet.add(GlobalizationUtil.globalize("cms.contenttypes.ui.title"), + ContentPage.TITLE); + sheet.add(GlobalizationUtil.globalize("cms.contenttypes.ui.name"), + ContentItem.NAME); + if (!ContentSection.getConfig().getHideLaunchDate()) { + sheet.add(GlobalizationUtil + .globalize("cms.contenttypes.ui.launch_date"), + ContentPage.LAUNCH_DATE, + new LaunchDateAttributeFormatter() ); + } + sheet.add(GlobalizationUtil.globalize("cms.contenttypes.ui.description"), + ContentPage.DESCRIPTION); + sheet.add(DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.properties.cancel_url"), + CANCEL_URL); return sheet; } diff --git a/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeSectionDeleteForm.java b/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeSectionDeleteForm.java index 093d57a84..6559c3bb1 100644 --- a/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeSectionDeleteForm.java +++ b/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeSectionDeleteForm.java @@ -32,8 +32,8 @@ import com.arsdigita.bebop.event.FormProcessListener; import com.arsdigita.bebop.event.FormSectionEvent; import com.arsdigita.bebop.event.FormSubmissionListener; import com.arsdigita.cms.contenttypes.DecisionTree; -import com.arsdigita.cms.contenttypes.DecisionTreeUtil; import com.arsdigita.cms.contenttypes.DecisionTreeSection; +import com.arsdigita.cms.contenttypes.util.DecisionTreeGlobalizationUtil; import com.arsdigita.cms.ItemSelectionModel; import com.arsdigita.util.Assert; @@ -44,18 +44,24 @@ import com.arsdigita.util.Assert; * @version $Id$ */ public class DecisionTreeSectionDeleteForm extends Form - implements FormInitListener, FormSubmissionListener, FormProcessListener -{ + implements FormInitListener, + FormSubmissionListener, + FormProcessListener { private final static Logger log = Logger.getLogger( DecisionTreeSectionDeleteForm.class.getName()); protected ItemSelectionModel m_selTree; protected ItemSelectionModel m_selSection; protected SaveCancelSection m_saveCancelSection; + /** Label denoting the name of the section to delete. */ private Label m_sectionNameLabel; + /** Value containin the name of the section to be deleted. Will be passed + * into the Label field above using string formatter */ + private String[] m_sectionNameValue = new String[1]; /** + * Constructor. * * @param selArticle * @param selSection @@ -73,40 +79,62 @@ public class DecisionTreeSectionDeleteForm extends Form panel.setColumnWidth(2, "80%"); panel.setWidth("100%"); - m_sectionNameLabel = new Label ("Section Name"); + m_sectionNameLabel = new Label ( // Section name + DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.sections.delete_section_msg", + m_sectionNameValue)); add(m_sectionNameLabel, ColumnPanel.FULL_WIDTH | ColumnPanel.LEFT); - addSaveCancelSection(); + addSaveCancelSection(); // add a save/cancel section to the form addInitListener(this); addSubmissionListener(this); addProcessListener(this); } + /** + * Create and adjust the label(s) of the SaveCancel button bar. + * @return + */ protected SaveCancelSection addSaveCancelSection () { m_saveCancelSection = new SaveCancelSection(); - m_saveCancelSection.getSaveButton().setButtonLabel("Delete"); + m_saveCancelSection.getSaveButton().setButtonLabel( + DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.sections.delete_button")); add(m_saveCancelSection, ColumnPanel.FULL_WIDTH | ColumnPanel.LEFT); return m_saveCancelSection; } + /** + * + * @param event + * @throws FormProcessException + */ public void init ( FormSectionEvent event ) throws FormProcessException { + + String sectionTitle = " "; PageState state = event.getPageState(); - DecisionTreeSection section = - (DecisionTreeSection)m_selSection.getSelectedObject(state); + DecisionTreeSection section = (DecisionTreeSection) + m_selSection.getSelectedObject(state); if ( section == null ) { log.error("No section selected"); } else { - m_sectionNameLabel.setLabel(section.getTitle(),state); + // Just be be sure, null should never happen because section it + // meant to have a title. + if (section.getTitle() != null) sectionTitle = section.getTitle(); } + m_sectionNameValue[0] = sectionTitle; } public void submitted ( FormSectionEvent event ) throws FormProcessException { PageState state = event.getPageState(); if ( m_saveCancelSection.getCancelButton().isSelected(state) ) { - throw new FormProcessException( (String) DecisionTreeUtil.globalize("tree_section.submission_cancelled").localize()); + throw new FormProcessException( (String) + DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.sections.form.submission_cancelled") + .localize()); } } @@ -121,6 +149,6 @@ public class DecisionTreeSectionDeleteForm extends Form article.removeSection(section); - log.info("section " + m_selSection.getSelectedKey(state) + " delete"); + log.debug("section " + m_selSection.getSelectedKey(state) + " delete"); } } diff --git a/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeSectionEditForm.java b/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeSectionEditForm.java index bd862f073..596cfebfc 100644 --- a/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeSectionEditForm.java +++ b/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeSectionEditForm.java @@ -38,11 +38,10 @@ import com.arsdigita.bebop.event.FormSubmissionListener; import com.arsdigita.bebop.form.TextField; import com.arsdigita.bebop.parameters.BigDecimalParameter; import com.arsdigita.bebop.parameters.NotEmptyValidationListener; -import com.arsdigita.bebop.parameters.StringIsLettersOrDigitsValidationListener; import com.arsdigita.bebop.parameters.TrimmedStringParameter; import com.arsdigita.cms.contenttypes.DecisionTree; import com.arsdigita.cms.contenttypes.DecisionTreeSection; -import com.arsdigita.cms.contenttypes.DecisionTreeUtil; +import com.arsdigita.cms.contenttypes.util.DecisionTreeGlobalizationUtil; import com.arsdigita.cms.ItemSelectionModel; import com.arsdigita.cms.TextAsset; import com.arsdigita.cms.ui.CMSDHTMLEditor; @@ -51,7 +50,7 @@ import com.arsdigita.util.UncheckedWrapperException; /** - * Form to edit a TreeSection for a DecisionTree. + * Form to edit a Section of a DecisionTree. * * @author Carsten Clasohm * @version $Id$ @@ -69,7 +68,7 @@ public class DecisionTreeSectionEditForm extends Form private BigDecimalParameter m_instructionsParam; private ItemSelectionModel m_selInstructions; - private DecisionTreeViewSections m_container; + private DecisionTreeSectionStep m_container; private SaveCancelSection m_saveCancelSection; @@ -80,25 +79,25 @@ public class DecisionTreeSectionEditForm extends Form private static final String INSTRUCTIONS_PARAM = "instructionsParam"; /** - * Constructor. + * Constructor creates an emnpty section form. * * @param selTree the current article * @param selSection the current section */ public DecisionTreeSectionEditForm(ItemSelectionModel selTree, - ItemSelectionModel selSection) { + ItemSelectionModel selSection) { this(selTree, selSection, null); } /** - * Constructor. + * Constructor creates an emnpty section form. * * @param selArticle the current article * @param selSection the current section * @param container container which this form is added to */ public DecisionTreeSectionEditForm(ItemSelectionModel selTree, - ItemSelectionModel selSection, - DecisionTreeViewSections container) { + ItemSelectionModel selSection, + DecisionTreeSectionStep container) { super("SectionEditForm", new ColumnPanel(2)); m_selTree = selTree; m_selSection = selSection; @@ -150,18 +149,21 @@ public class DecisionTreeSectionEditForm extends Form * Add form widgets for a Section. */ protected void addWidgets() { - add(new Label(DecisionTreeUtil.globalize("form_label.title"))); + add(new Label(DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.sections.form.title_label"))); TextField titleWidget = new TextField(new TrimmedStringParameter(TITLE)); titleWidget.addValidationListener(new NotEmptyValidationListener()); add(titleWidget); - add(new Label(DecisionTreeUtil.globalize("form_label.parameter_name"))); + add(new Label(DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.sections.form.parameter_name_label"))); TextField parameterWidget = new TextField(new TrimmedStringParameter(PARAMETER_NAME)); parameterWidget.addValidationListener(new NotEmptyValidationListener()); parameterWidget.addValidationListener(new DecisionTreeParameterNameValidationListener()); add(parameterWidget); - add(new Label(DecisionTreeUtil.globalize("form_label.instructions")), + add(new Label(DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.sections.form.instructions_label")), ColumnPanel.LEFT | ColumnPanel.FULL_WIDTH); CMSDHTMLEditor textWidget = new CMSDHTMLEditor(new TrimmedStringParameter(INSTRUCTIONS)); @@ -217,12 +219,12 @@ public class DecisionTreeSectionEditForm extends Form if ( m_saveCancelSection.getCancelButton() .isSelected(state) && m_container != null) { m_container.onlyShowComponent( - state, DecisionTreeViewSections.SECTION_TABLE + + state, DecisionTreeSectionStep.SECTION_TABLE + m_container.getTypeIDStr()); throw new FormProcessException( - (String)DecisionTreeUtil - .globalize("tree_section.submission_cancelled") - .localize()); + (String)DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.sections.form.submission_cancelled") + .localize()); } } @@ -273,7 +275,7 @@ public class DecisionTreeSectionEditForm extends Form if ( m_container != null) { m_container.onlyShowComponent( state, - DecisionTreeViewSections.SECTION_TABLE + + DecisionTreeSectionStep.SECTION_TABLE + m_container.getTypeIDStr()); } } diff --git a/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeViewSections.java b/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeSectionStep.java similarity index 82% rename from ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeViewSections.java rename to ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeSectionStep.java index d27d6f8b1..3156baaf7 100644 --- a/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeViewSections.java +++ b/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeSectionStep.java @@ -32,15 +32,14 @@ import com.arsdigita.bebop.event.PrintEvent; import com.arsdigita.bebop.event.PrintListener; import com.arsdigita.bebop.event.TableActionEvent; import com.arsdigita.bebop.event.TableActionListener; -import com.arsdigita.bebop.table.TableColumn; +import com.arsdigita.cms.CMS; import com.arsdigita.cms.contenttypes.DecisionTree; -import com.arsdigita.cms.contenttypes.DecisionTreeUtil; import com.arsdigita.cms.contenttypes.DecisionTreeSection; +import com.arsdigita.cms.contenttypes.util.DecisionTreeGlobalizationUtil; import com.arsdigita.cms.ContentItem; import com.arsdigita.cms.ItemSelectionModel; import com.arsdigita.cms.SecurityManager; import com.arsdigita.cms.contenttypes.ui.ResettableContainer; -import com.arsdigita.cms.dispatcher.Utilities; import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; import com.arsdigita.util.Assert; @@ -54,9 +53,9 @@ import com.arsdigita.util.Assert; * @author Carsten Clasohm * @version $Id$ */ -public class DecisionTreeViewSections extends ResettableContainer +public class DecisionTreeSectionStep extends ResettableContainer { - /** id keys for each editing panel */ + /** id keys for each editing panel */ public static final String SECTION_TABLE = "sec_tbl"; public static final String SECTION_EDIT = "sec_edt"; public static final String SECTION_DEL = "sec_del"; @@ -76,8 +75,13 @@ public class DecisionTreeViewSections extends ResettableContainer private String m_typeIDStr; - public DecisionTreeViewSections (ItemSelectionModel selTree, - AuthoringKitWizard wizard) { + /** + * + * @param selTree + * @param wizard + */ + public DecisionTreeSectionStep (ItemSelectionModel selTree, + AuthoringKitWizard wizard) { super(); m_selTree = selTree; m_wizard = wizard; @@ -110,24 +114,24 @@ public class DecisionTreeViewSections extends ResettableContainer m_sectionTable.setSectionModel(m_selSection); - Label emptyView = new Label(DecisionTreeUtil - .globalize("tree_sections.no_sections_yet")); + Label emptyView = new Label(DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.sections.no_sections_yet")); m_sectionTable.setEmptyView(emptyView); - // handle clicks to delete a Section + // handle clicks to edit, delete or make a Section first m_sectionTable.addTableActionListener (new TableActionListener () { public void cellSelected (TableActionEvent event) { + PageState state = event.getPageState(); - TableColumn col = m_sectionTable.getColumnModel() - .get(event.getColumn().intValue()); - String colName = (String)col.getHeaderValue(); - - if (DecisionTreeSectionTable.COL_DEL.equals(colName)) { + int col = event.getColumn(); + if ( col == DecisionTreeSectionTable.COL_IDX_DEL ) { onlyShowComponent(state, SECTION_DEL+m_typeIDStr); - } else if (DecisionTreeSectionTable.COL_EDIT.equals(colName)) { + + } else if ( col == DecisionTreeSectionTable.COL_IDX_EDIT ) { onlyShowComponent(state, SECTION_EDIT+m_typeIDStr); - } else if (DecisionTreeSectionTable.COL_FIRST.equals(colName)) { + + } else if ( col == DecisionTreeSectionTable.COL_IDX_FIRST ) { DecisionTree tree = (DecisionTree)m_selTree .getSelectedObject(state); DecisionTreeSection section = (DecisionTreeSection)m_selSection @@ -164,11 +168,11 @@ public class DecisionTreeViewSections extends ResettableContainer Label label = (Label)event.getTarget(); if (m_selSection.getSelectedKey(state) == null) { - label.setLabel(DecisionTreeUtil - .globalize("tree_sections.add_section")); + label.setLabel(DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.sections.add")); } else { - label.setLabel(DecisionTreeUtil - .globalize("tree_sections.edit_section")); + label.setLabel(DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.sections.edit")); } } })); @@ -194,7 +198,8 @@ public class DecisionTreeViewSections extends ResettableContainer c.setBorderColor("#FFFFFF"); c.setPadColor("#FFFFFF"); - c.add(new Label(DecisionTreeUtil.globalize("tree_sections.delete_section"))); + c.add(new Label(DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.sections.delete"))); m_sectionDelete = new DecisionTreeSectionDeleteForm(m_selTree, m_selSection); m_sectionDelete.addSubmissionListener ( new FormSubmissionListener () { public void submitted ( FormSectionEvent e ) { @@ -213,8 +218,8 @@ public class DecisionTreeViewSections extends ResettableContainer * Utility method to create a link to display the section list. */ protected ActionLink buildViewAllLink () { - ActionLink viewAllLink = new ActionLink(DecisionTreeUtil - .globalize("tree_sections.view_all_sections")); + ActionLink viewAllLink = new ActionLink(DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.sections.view_all")); viewAllLink.setClassAttr(ACTION_LINK); viewAllLink.addActionListener( new ActionListener() { public void actionPerformed ( ActionEvent event ) { @@ -229,11 +234,11 @@ public class DecisionTreeViewSections extends ResettableContainer * Utility method to create a link to display the section list. */ protected ActionLink buildAddLink () { - ActionLink addLink = new ActionLink(DecisionTreeUtil - .globalize("tree_sections.add_new_section")) { + ActionLink addLink = new ActionLink(DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.sections.add_new_label")) { @Override public boolean isVisible(PageState state) { - SecurityManager sm = Utilities.getSecurityManager(state); + SecurityManager sm = CMS.getSecurityManager(state); ContentItem item = (ContentItem)m_selTree.getSelectedObject(state); return super.isVisible(state) && diff --git a/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeSectionTable.java b/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeSectionTable.java index a4d1c5d6f..ddad296b3 100644 --- a/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeSectionTable.java +++ b/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeSectionTable.java @@ -19,8 +19,6 @@ package com.arsdigita.cms.contenttypes.ui; -import org.apache.log4j.Logger; - import com.arsdigita.bebop.Component; import com.arsdigita.bebop.ControlLink; import com.arsdigita.bebop.Label; @@ -31,30 +29,35 @@ import com.arsdigita.bebop.table.TableColumn; import com.arsdigita.bebop.table.TableColumnModel; import com.arsdigita.bebop.table.TableModel; import com.arsdigita.bebop.table.TableModelBuilder; +import com.arsdigita.cms.CMS; import com.arsdigita.cms.contenttypes.DecisionTree; import com.arsdigita.cms.contenttypes.DecisionTreeSection; import com.arsdigita.cms.contenttypes.DecisionTreeSectionCollection; +import com.arsdigita.cms.contenttypes.util.DecisionTreeGlobalizationUtil; import com.arsdigita.cms.ContentItem; import com.arsdigita.cms.ItemSelectionModel; import com.arsdigita.cms.SecurityManager; -import com.arsdigita.cms.dispatcher.Utilities; import com.arsdigita.util.LockableImpl; +import org.apache.log4j.Logger; + /** - * A table that displays the sections for the currently - * selected DecisionTree. + * A table that displays the sections for the currently selected DecisionTree. + * + * If no sections are created / exists, it prints an empty section statement + * and a link to add new sections. Otherwise * * @author Carsten Clasohm * @version $Id$ */ -public class DecisionTreeSectionTable extends Table -{ - // column headings - public static final String COL_TITLE = "Section"; - public static final String COL_EDIT = "Edit"; - public static final String COL_DEL = "Delete"; - public static final String COL_FIRST = "First Section?"; +public class DecisionTreeSectionTable extends Table { + + // match columns by (symbolic) index, makes for easier reordering + public static final int COL_IDX_TITLE = 0; // title section + public static final int COL_IDX_EDIT = 1; // edit section link + public static final int COL_IDX_DEL = 2; // delete section link + public static final int COL_IDX_FIRST = 3; // first section link private ItemSelectionModel m_selTree; @@ -72,18 +75,38 @@ public class DecisionTreeSectionTable extends Table m_selTree = selArticle; TableColumnModel model = getColumnModel(); - model.add( new TableColumn(0, COL_TITLE)); - model.add( new TableColumn(1, COL_EDIT)); - model.add( new TableColumn(2, COL_DEL)); - model.add( new TableColumn(3, COL_FIRST)); + model.add( new TableColumn( + COL_IDX_TITLE, + new Label(DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.sections.table.header_section") + ) )); + model.add( new TableColumn( + COL_IDX_EDIT, + new Label(DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.sections.table.header_edit") + ) )); + model.add( new TableColumn( + COL_IDX_DEL, + new Label(DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.sections.table.header_delete") + ) )); + model.add( new TableColumn( + COL_IDX_FIRST, + new Label(DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.sections.table.header_first_section") + ) )); - model.get(1).setCellRenderer(new SectionTableCellRenderer(true)); - model.get(2).setCellRenderer(new SectionTableCellRenderer(true)); - model.get(3).setCellRenderer(new SectionTableCellRenderer(true)); + model.get(COL_IDX_EDIT).setCellRenderer(new SectionTableCellRenderer(true)); + model.get(COL_IDX_DEL).setCellRenderer(new SectionTableCellRenderer(true)); + model.get(COL_IDX_FIRST).setCellRenderer(new SectionTableCellRenderer(true)); setModelBuilder(new SectionTableModelBuilder(m_selTree)); } + /** + * + * @param selSection + */ public void setSectionModel ( ItemSelectionModel selSection ) { if ( selSection == null ) { s_log.warn("null item model"); @@ -94,37 +117,49 @@ public class DecisionTreeSectionTable extends Table * The model builder to generate a suitable model for the SectionTable */ protected class SectionTableModelBuilder extends LockableImpl - implements TableModelBuilder - { + implements TableModelBuilder { + protected ItemSelectionModel m_selTree; + /** + * Internal class constructor. + */ public SectionTableModelBuilder (ItemSelectionModel selTree) { m_selTree = selTree; } + /** + * Internal class worker method. + * + * @param table + * @param state + * @return + */ public TableModel makeModel(Table table, PageState state) { - table.getRowSelectionModel().clearSelection(state); + table.getRowSelectionModel().clearSelection(state); DecisionTree tree = (DecisionTree)m_selTree.getSelectedObject(state); return new SectionTableModel(table, state, tree); } } - protected class SectionTableModel - implements TableModel - { + /** + * Internal protected class. + */ + protected class SectionTableModel implements TableModel { + private TableColumnModel m_colModel; private DecisionTreeSectionCollection m_sections; private DecisionTreeSection m_section; - /** Constructor. */ + /** Internal class' Constructor. */ public SectionTableModel (Table table, PageState state, DecisionTree tree) { m_colModel = table.getColumnModel(); m_sections = tree.getSections(); } - /** Return the number of columsn this TableModel has. */ + /** Return the number of columns this TableModel has. */ public int getColumnCount () { return m_colModel.size(); } @@ -140,27 +175,31 @@ public class DecisionTreeSectionTable extends Table return false; } - /** Return the data element for the given column and the current row. */ + /** + * Return the data element for the given column and the current row. + */ public Object getElementAt(int columnIndex) { + if (m_colModel == null) { return null; } - // match columns by name... makes for easier reordering - TableColumn col = m_colModel.get(columnIndex); - String colName = (String)col.getHeaderValue(); - - if ( COL_TITLE.equals(colName) ) { + if ( columnIndex == COL_IDX_TITLE ) { return m_section.getTitle(); - } else if ( COL_EDIT.equals(colName) ) { - return "edit"; - } else if ( COL_DEL.equals(colName) ) { - return "delete"; - } else if ( COL_FIRST.equals(colName) ) { + } else if ( columnIndex == COL_IDX_EDIT ) { + return new Label(DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.sections.table.link_edit")); + } else if ( columnIndex == COL_IDX_DEL ) { + return new Label(DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.sections.table.link_delete")); + } else if ( columnIndex == COL_IDX_FIRST ) { DecisionTree tree = m_section.getTree(); DecisionTreeSection firstSection = tree.getFirstSection(); if (firstSection != null && firstSection.getID() == m_section.getID()) { - return ""; + // return anything different from Label to prevent the + // construction of a link + return null; } else { - return "set"; + return new Label(DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.sections.table.link_set_first")); } } @@ -173,42 +212,61 @@ public class DecisionTreeSectionTable extends Table } } + /** + * + */ public class SectionTableCellRenderer extends LockableImpl - implements TableCellRenderer - { + implements TableCellRenderer { private boolean m_active; + /** + * Internal class constructor. + */ public SectionTableCellRenderer () { this(false); } + /** + * Internal class constructor. + * @param active + */ public SectionTableCellRenderer ( boolean active ) { m_active = active; } + /** + * + * @param table + * @param state + * @param value + * @param isSelected + * @param key + * @param row + * @param column + * @return + */ public Component getComponent ( Table table, PageState state, Object value, boolean isSelected, Object key, int row, int column ) { Component ret = null; - SecurityManager sm = Utilities.getSecurityManager(state); + SecurityManager sm = CMS.getSecurityManager(state); ContentItem item = (ContentItem)m_selTree.getSelectedObject(state); - boolean active = m_active && - sm.canAccess(state.getRequest(), SecurityManager.EDIT_ITEM, - item); + boolean active = m_active && sm.canAccess(state.getRequest(), + SecurityManager.EDIT_ITEM, + item); - if (value instanceof Component) { - ret = (Component)value; - } else { - if (value == null) { - ret = new Label("", false); + if (value == null) { + ret = new Label("", false); + } else if (value instanceof Label) { + if (active) { + ret = new ControlLink( (Component)value ); } else { - if (active) { - ret = new ControlLink(value.toString()); - } else { - ret = new Label(value.toString()); - } + ret = (Component)value; } + } else { + // last resort, should never happen + ret = (Component)value; } return ret; diff --git a/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeTargetDeleteForm.java b/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeTargetDeleteForm.java index 0369a0131..adfed8f69 100644 --- a/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeTargetDeleteForm.java +++ b/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeTargetDeleteForm.java @@ -32,8 +32,8 @@ import com.arsdigita.bebop.event.FormInitListener; import com.arsdigita.bebop.event.FormProcessListener; import com.arsdigita.bebop.event.FormSectionEvent; import com.arsdigita.bebop.event.FormSubmissionListener; -import com.arsdigita.cms.contenttypes.DecisionTreeUtil; import com.arsdigita.cms.contenttypes.DecisionTreeOptionTarget; +import com.arsdigita.cms.contenttypes.util.DecisionTreeGlobalizationUtil; import com.arsdigita.cms.ItemSelectionModel; /** @@ -71,7 +71,9 @@ public class DecisionTreeTargetDeleteForm extends Form panel.setColumnWidth(2, "80%"); panel.setWidth("100%"); - m_targetMatchValue = new Label("Target Match Value"); + m_targetMatchValue = new Label( + DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.targets.form.delete.target_match_value")); add(m_targetMatchValue, ColumnPanel.FULL_WIDTH | ColumnPanel.LEFT); addSaveCancelSection(); @@ -82,7 +84,9 @@ public class DecisionTreeTargetDeleteForm extends Form protected SaveCancelSection addSaveCancelSection () { m_saveCancelSection = new SaveCancelSection(); - m_saveCancelSection.getSaveButton().setButtonLabel("Delete"); + m_saveCancelSection.getSaveButton().setButtonLabel( + DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.targets.form.delete.delete_button")); add(m_saveCancelSection, ColumnPanel.FULL_WIDTH | ColumnPanel.LEFT); return m_saveCancelSection; } @@ -102,8 +106,9 @@ public class DecisionTreeTargetDeleteForm extends Form if ( m_saveCancelSection.getCancelButton().isSelected(state) ) { throw new FormProcessException( (String) - DecisionTreeUtil.globalize("tree_section.submission_cancelled") - .localize()); + DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.targets.submission_cancelled") + .localize()); } } diff --git a/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeTargetEditForm.java b/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeTargetEditForm.java index b0b263906..7b2496ee7 100644 --- a/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeTargetEditForm.java +++ b/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeTargetEditForm.java @@ -43,12 +43,12 @@ import com.arsdigita.bebop.form.SingleSelect; import com.arsdigita.bebop.form.TextField; import com.arsdigita.bebop.parameters.NotNullValidationListener; import com.arsdigita.cms.contenttypes.DecisionTree; -import com.arsdigita.cms.contenttypes.DecisionTreeUtil; import com.arsdigita.cms.contenttypes.DecisionTreeSectionOption; import com.arsdigita.cms.contenttypes.DecisionTreeSectionOptionCollection; import com.arsdigita.cms.contenttypes.DecisionTreeOptionTarget; import com.arsdigita.cms.contenttypes.DecisionTreeSection; import com.arsdigita.cms.contenttypes.DecisionTreeSectionCollection; +import com.arsdigita.cms.contenttypes.util.DecisionTreeGlobalizationUtil; import com.arsdigita.cms.ItemSelectionModel; /** @@ -68,10 +68,10 @@ public class DecisionTreeTargetEditForm extends Form private ItemSelectionModel m_selTree; private ItemSelectionModel m_selTarget; - private DecisionTreeViewTargets m_container; + private DecisionTreeTargetStep m_container; private SaveCancelSection m_saveCancelSection; - private SingleSelect m_sectionWidget; + // private SingleSelect m_sectionWidget; private SingleSelect m_matchValueWidget; private SingleSelect m_targetSectionWidget; private TextField m_targetURLWidget; @@ -100,7 +100,8 @@ public class DecisionTreeTargetEditForm extends Form */ public DecisionTreeTargetEditForm(ItemSelectionModel selTree, ItemSelectionModel selTarget, - DecisionTreeViewTargets container) { + DecisionTreeTargetStep container) { + super("DecisionTreeTargetEditForm", new ColumnPanel(2)); m_selTree = selTree; m_selTarget = selTarget; @@ -198,9 +199,12 @@ public class DecisionTreeTargetEditForm extends Form DecisionTreeSectionOptionCollection sectionOptions = tree.getOptions(); if (sectionOptions != null) { while (sectionOptions.next()) { - DecisionTreeSectionOption sectionOption = sectionOptions.getOption(); - String label = sectionOption.getSection().getTitle() + " : " + sectionOption.getLabel(); - Option option = new Option(sectionOption.getID().toString(), label); + DecisionTreeSectionOption sectionOption = sectionOptions + .getOption(); + String label = sectionOption.getSection().getTitle() + + " : " + sectionOption.getLabel(); + Option option = new Option(sectionOption.getID().toString(), + label); target.addOption(option, state); } sectionOptions.close(); @@ -215,7 +219,8 @@ public class DecisionTreeTargetEditForm extends Form FormData data = fse.getFormData(); if (m_selTarget.getSelectedKey(state) != null) { - BigDecimal id = new BigDecimal(m_selTarget.getSelectedKey(state).toString()); + BigDecimal id = new BigDecimal(m_selTarget.getSelectedKey(state) + .toString()); DecisionTreeOptionTarget target = new DecisionTreeOptionTarget(id); data.put(MATCH_OPTION, target.getMatchOption().getID()); @@ -231,10 +236,17 @@ public class DecisionTreeTargetEditForm extends Form * Add form widgets for a Section. */ protected void addWidgets() { - Option pleaseSelect = new Option("", (String)DecisionTreeUtil.globalize("form.please_select").localize()); - Option none = new Option("", (String)DecisionTreeUtil.globalize("form.none").localize()); + Option pleaseSelect = new Option( + "", + new Label(DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.targets.form.please_select") )); + Option none = new Option( + "", + new Label( DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.targets.form.none"))); - add(new Label(DecisionTreeUtil.globalize("form_label.match_value"))); + add(new Label(DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.targets.form.match_value"))); m_matchValueWidget = new SingleSelect(MATCH_OPTION); m_matchValueWidget.addValidationListener(new NotNullValidationListener()); m_matchValueWidget.addOption(pleaseSelect); @@ -251,12 +263,14 @@ public class DecisionTreeTargetEditForm extends Form add(m_matchValueWidget); - add(new Label(DecisionTreeUtil.globalize("form_label.target_url"))); + add(new Label(DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.targets.form.target_url_label"))); m_targetURLWidget = new TextField(TARGET_URL); m_targetURLWidget.setSize(60); add(m_targetURLWidget); - add(new Label(DecisionTreeUtil.globalize("form_label.target_section"))); + add(new Label(DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.targets.form.target_section_label"))); m_targetSectionWidget = new SingleSelect(TARGET_SECTION); m_targetSectionWidget.addOption(none); @@ -276,13 +290,19 @@ public class DecisionTreeTargetEditForm extends Form public final void validate(final FormSectionEvent event) throws FormProcessException { final PageState state = event.getPageState(); - if ("".equals(m_targetURLWidget.getValue(state)) && "".equals(m_targetSectionWidget.getValue(state))) { - String msg = (String) DecisionTreeUtil.globalize("form_validation.target_required").localize(); + if ("".equals(m_targetURLWidget.getValue(state)) + && "".equals(m_targetSectionWidget.getValue(state))) { + String msg = (String) DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.targets.form.target_required") + .localize(); throw new FormProcessException(msg); } - if (!"".equals(m_targetURLWidget.getValue(state)) && !"".equals(m_targetSectionWidget.getValue(state))) { - String msg = (String) DecisionTreeUtil.globalize("form_validation.duplicate_target").localize(); + if (!"".equals(m_targetURLWidget.getValue(state)) + && !"".equals(m_targetSectionWidget.getValue(state))) { + String msg = (String) DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.targets.form.duplicate_target") + .localize(); throw new FormProcessException(msg); } } @@ -300,18 +320,18 @@ public class DecisionTreeTargetEditForm extends Form if ( m_saveCancelSection.getCancelButton() .isSelected(state) && m_container != null) { m_container.onlyShowComponent( - state, DecisionTreeViewTargets.TARGET_TABLE + + state, DecisionTreeTargetStep.TARGET_TABLE + m_container.getTypeIDStr()); throw new FormProcessException( - (String)DecisionTreeUtil - .globalize("tree_section.submission_cancelled") - .localize()); + (String)DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.targets.form.submission_cancelled") + .localize()); } } /** - * Called after form has been validated. Create the new DecisionTreeOptionTarget and - * assign it to the current DecisionTree. + * Called after form has been validated. Create the new + * DecisionTreeOptionTarget and assign it to the current DecisionTree. */ public void process(FormSectionEvent event) throws FormProcessException { PageState state = event.getPageState(); @@ -344,11 +364,12 @@ public class DecisionTreeTargetEditForm extends Form if (m_container != null) { m_container.onlyShowComponent( state, - DecisionTreeViewTargets.TARGET_TABLE + + DecisionTreeTargetStep.TARGET_TABLE + m_container.getTypeIDStr()); } } + @Override public void register(Page p) { super.register(p); } diff --git a/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeViewTargets.java b/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeTargetStep.java similarity index 76% rename from ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeViewTargets.java rename to ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeTargetStep.java index c746e9e24..ce8ffff60 100644 --- a/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeViewTargets.java +++ b/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeTargetStep.java @@ -33,15 +33,13 @@ import com.arsdigita.bebop.event.PrintEvent; import com.arsdigita.bebop.event.PrintListener; import com.arsdigita.bebop.event.TableActionEvent; import com.arsdigita.bebop.event.TableActionListener; -import com.arsdigita.bebop.table.TableColumn; +import com.arsdigita.cms.CMS; import com.arsdigita.cms.contenttypes.DecisionTree; -import com.arsdigita.cms.contenttypes.DecisionTreeUtil; import com.arsdigita.cms.contenttypes.DecisionTreeSection; +import com.arsdigita.cms.contenttypes.util.DecisionTreeGlobalizationUtil; import com.arsdigita.cms.ContentItem; import com.arsdigita.cms.ItemSelectionModel; import com.arsdigita.cms.SecurityManager; -import com.arsdigita.cms.contenttypes.ui.ResettableContainer; -import com.arsdigita.cms.dispatcher.Utilities; import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; import com.arsdigita.util.Assert; @@ -55,7 +53,7 @@ import com.arsdigita.util.Assert; * @author Carsten Clasohm * @version $Id$ */ -public class DecisionTreeViewTargets extends ResettableContainer +public class DecisionTreeTargetStep extends ResettableContainer { /** id keys for each editing panel */ public static final String TARGET_TABLE = "tgt_tbl"; @@ -82,7 +80,7 @@ public class DecisionTreeViewTargets extends ResettableContainer * @param selTree * @param wizard */ - public DecisionTreeViewTargets (ItemSelectionModel selTree, + public DecisionTreeTargetStep (ItemSelectionModel selTree, AuthoringKitWizard wizard) { super(); m_selTree = selTree; @@ -116,30 +114,20 @@ public class DecisionTreeViewTargets extends ResettableContainer m_targetTable.setSectionModel(m_selTarget); - Label emptyView = new Label(DecisionTreeUtil - .globalize("option_targets.no_targets_yet")); + Label emptyView = new Label(DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.targets.none_yet")); m_targetTable.setEmptyView(emptyView); - // handle clicks to preview or delete a Section + // handle clicks to preview or delete a Target m_targetTable.addTableActionListener (new TableActionListener () { public void cellSelected (TableActionEvent event) { PageState state = event.getPageState(); + int col = event.getColumn(); - TableColumn col = m_targetTable.getColumnModel() - .get(event.getColumn().intValue()); - String colName = (String)col.getHeaderValue(); - - if (DecisionTreeSectionTable.COL_DEL.equals(colName)) { + if ( col == DecisionTreeTargetTable.COL_IDX_DEL ) { onlyShowComponent(state, TARGET_DEL+m_typeIDStr); - } else if (DecisionTreeSectionTable.COL_EDIT.equals(colName)) { + } else if ( col == DecisionTreeTargetTable.COL_IDX_EDIT ) { onlyShowComponent(state, TARGET_EDIT+m_typeIDStr); - } else if (DecisionTreeSectionTable.COL_FIRST.equals(colName)) { - DecisionTree tree = - (DecisionTree)m_selTree.getSelectedObject(state); - DecisionTreeSection section = - (DecisionTreeSection)m_selTarget.getSelectedItem(state); - tree.setFirstSection(section); - tree.save(); } } @@ -147,7 +135,7 @@ public class DecisionTreeViewTargets extends ResettableContainer }); c.add(m_targetTable); - // link to add new section + // link to add new target c.add(buildAddLink()); return c; @@ -170,21 +158,21 @@ public class DecisionTreeViewTargets extends ResettableContainer Label label = (Label)event.getTarget(); if (m_selTarget.getSelectedKey(state) == null) { - label.setLabel(DecisionTreeUtil - .globalize("option_targets.add_target")); + label.setLabel(DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.targets.add")); } else { - label.setLabel(DecisionTreeUtil - .globalize("option_targets.edit_target")); + label.setLabel(DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.targets.edit")); } } })); - // form to edit a Section + // form to edit a Target m_targetEdit = new DecisionTreeTargetEditForm(m_selTree, m_selTarget, this); c.add(m_targetEdit); c.add(buildViewAllLink()); - // link to add new section + // link to add new target c.add(buildAddLink()); return c; @@ -192,7 +180,7 @@ public class DecisionTreeViewTargets extends ResettableContainer /** * Builds a container to hold the component to confirm - * deletion of a section. + * deletion of a target. */ protected Container buildTargetDelete () { ColumnPanel c = new ColumnPanel(1); @@ -200,7 +188,8 @@ public class DecisionTreeViewTargets extends ResettableContainer c.setBorderColor("#FFFFFF"); c.setPadColor("#FFFFFF"); - c.add(new Label(DecisionTreeUtil.globalize("option_targets.delete_target"))); + c.add(new Label(DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.targets.delete"))); m_targetDelete = new DecisionTreeTargetDeleteForm(m_selTree, m_selTarget); m_targetDelete.addSubmissionListener ( new FormSubmissionListener () { public void submitted ( FormSectionEvent e ) { @@ -216,11 +205,12 @@ public class DecisionTreeViewTargets extends ResettableContainer } /** - * Utility method to create a link to display the section list. + * Utility method to create a link to display the targets list. */ protected ActionLink buildViewAllLink () { ActionLink viewAllLink = new - ActionLink( DecisionTreeUtil.globalize("option_targets.view_all_targets")); + ActionLink( DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.targets.view_all")); viewAllLink.setClassAttr(ACTION_LINK); viewAllLink.addActionListener( new ActionListener() { public void actionPerformed ( ActionEvent event ) { @@ -236,16 +226,17 @@ public class DecisionTreeViewTargets extends ResettableContainer */ protected ActionLink buildAddLink () { - ActionLink addLink = new ActionLink( DecisionTreeUtil - .globalize("option_targets.add_new_target")) { + ActionLink addLink = new ActionLink( DecisionTreeGlobalizationUtil + .globalize("cms.contenttypes.ui.decisiontree.targets.add_new")) { @Override public boolean isVisible(PageState state) { - SecurityManager sm = Utilities.getSecurityManager(state); + SecurityManager sm = CMS.getSecurityManager(state); ContentItem item = (ContentItem)m_selTree.getSelectedObject(state); - return super.isVisible(state) && - sm.canAccess(state.getRequest(), SecurityManager.EDIT_ITEM, - item); + return super.isVisible(state) && sm.canAccess( + state.getRequest(), + SecurityManager.EDIT_ITEM, + item); } }; diff --git a/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeTargetTable.java b/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeTargetTable.java index 3bb0d5c13..aaca11754 100644 --- a/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeTargetTable.java +++ b/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/ui/DecisionTreeTargetTable.java @@ -31,12 +31,14 @@ import com.arsdigita.bebop.table.TableColumn; import com.arsdigita.bebop.table.TableColumnModel; import com.arsdigita.bebop.table.TableModel; import com.arsdigita.bebop.table.TableModelBuilder; +import com.arsdigita.cms.CMS; import com.arsdigita.cms.contenttypes.DecisionTree; import com.arsdigita.cms.contenttypes.DecisionTreeOptionTarget; import com.arsdigita.cms.contenttypes.DecisionTreeOptionTargetCollection; import com.arsdigita.cms.ContentItem; import com.arsdigita.cms.ItemSelectionModel; import com.arsdigita.cms.SecurityManager; +import com.arsdigita.cms.contenttypes.util.DecisionTreeGlobalizationUtil; import com.arsdigita.cms.dispatcher.Utilities; import com.arsdigita.util.LockableImpl; @@ -54,10 +56,10 @@ public class DecisionTreeTargetTable extends Table DecisionTreeTargetTable.class); // column headings - public static final String COL_SECTION = "Section"; - public static final String COL_MATCH = "Match"; - public static final String COL_EDIT = "Edit"; - public static final String COL_DEL = "Delete"; + public static final int COL_IDX_SECTION = 0; + public static final int COL_IDX_MATCH = 1; + public static final int COL_IDX_EDIT = 2; + public static final int COL_IDX_DEL = 3; private ItemSelectionModel m_selTree; @@ -72,13 +74,29 @@ public class DecisionTreeTargetTable extends Table m_selTree = selArticle; TableColumnModel model = getColumnModel(); - model.add(new TableColumn(0, COL_SECTION)); - model.add(new TableColumn(1, COL_MATCH)); - model.add(new TableColumn(2, COL_EDIT)); - model.add(new TableColumn(3, COL_DEL)); + model.add(new TableColumn( + COL_IDX_SECTION, + new Label(DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.targets.table.header_section") + ) )); + model.add(new TableColumn( + COL_IDX_MATCH, + new Label(DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.targets.table.header_match") + ) )); + model.add(new TableColumn( + COL_IDX_EDIT, + new Label(DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.targets.table.header_edit") + ) )); + model.add(new TableColumn( + COL_IDX_DEL, + new Label(DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.targets.table.header_delete") + ) )); - model.get(2).setCellRenderer(new SectionTableCellRenderer(true)); - model.get(3).setCellRenderer(new SectionTableCellRenderer(true)); + model.get(COL_IDX_EDIT).setCellRenderer(new SectionTableCellRenderer(true)); + model.get(COL_IDX_DEL).setCellRenderer(new SectionTableCellRenderer(true)); setModelBuilder(new OptionTableModelBuilder(m_selTree)); } @@ -147,18 +165,20 @@ public class DecisionTreeTargetTable extends Table public Object getElementAt(int columnIndex) { if (m_colModel == null) { return null; } - // match columns by name... makes for easier reordering - TableColumn col = m_colModel.get(columnIndex); - String colName = (String) col.getHeaderValue(); - - if (COL_SECTION.equals(colName)) { + if ( columnIndex == COL_IDX_SECTION ) { return m_target.getMatchOption().getSection().getTitle(); - } else if (COL_MATCH.equals(colName)) { + } else if ( columnIndex == COL_IDX_MATCH ) { return m_target.getMatchOption().getLabel(); - } else if (COL_EDIT.equals(colName)) { - return "edit"; - } else if (COL_DEL.equals(colName)) { - return "delete"; + } else if ( columnIndex == COL_IDX_EDIT ) { + // return "edit"; + return new Label(DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.targets.table.link_edit") + ); + } else if ( columnIndex == COL_IDX_DEL ) { + // return "delete"; + return new Label(DecisionTreeGlobalizationUtil.globalize( + "cms.contenttypes.ui.decisiontree.targets.table.link_delete") + ); } return null; @@ -189,30 +209,39 @@ public class DecisionTreeTargetTable extends Table m_active = active; } - /** */ + /** + * + * @param table + * @param state + * @param value + * @param isSelected + * @param key + * @param row + * @param column + * @return + */ public Component getComponent(Table table, PageState state, - Object value, boolean isSelected, - Object key, int row, int column) { + Object value, boolean isSelected, + Object key, int row, int column) { Component ret = null; - SecurityManager sm = Utilities.getSecurityManager(state); + SecurityManager sm = CMS.getSecurityManager(state); ContentItem item = (ContentItem)m_selTree.getSelectedObject(state); - boolean active = m_active && - sm.canAccess(state.getRequest(), SecurityManager.EDIT_ITEM, - item); + boolean active = m_active && sm.canAccess(state.getRequest(), + SecurityManager.EDIT_ITEM, + item); - if (value instanceof Component) { + if (value == null) { ret = (Component)value; - } else { - if (value == null) { - ret = new Label("", false); + } else if (value instanceof Label) { + if (active) { + ret = new ControlLink( (Component)value ); } else { - if (active) { - ret = new ControlLink(value.toString()); - } else { - ret = new Label(value.toString()); - } + ret = (Component)value; } + } else { + // last resort, should never happen + ret = (Component)value; } return ret; diff --git a/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/DecisionTreeUtil.java b/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/util/DecisionTreeGlobalizationUtil.java similarity index 91% rename from ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/DecisionTreeUtil.java rename to ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/util/DecisionTreeGlobalizationUtil.java index 50ce790b4..46bc433b5 100644 --- a/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/DecisionTreeUtil.java +++ b/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/util/DecisionTreeGlobalizationUtil.java @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ -package com.arsdigita.cms.contenttypes; +package com.arsdigita.cms.contenttypes.util; import com.arsdigita.globalization.Globalized; import com.arsdigita.globalization.GlobalizedMessage; @@ -31,14 +31,14 @@ import com.arsdigita.globalization.GlobalizedMessage; * @author Carsten Clasohm * @version $Id$ */ -public class DecisionTreeUtil implements Globalized { +public class DecisionTreeGlobalizationUtil implements Globalized { /** Name of Java resource files to handle DecisionTree's globalisation. */ public static final String BUNDLE_NAME = "com.arsdigita.cms.contenttypes.DecisionTreeResources"; /** - * This returns a globalized message using the package specific bundle, + * Returns a globalized message using the package specific bundle, * provided by BUNDLE_NAME. */ public static GlobalizedMessage globalize(String key) { diff --git a/ccm-cms-types-mparticle/src/com/arsdigita/cms/contenttypes/ui/mparticle/SectionTable.java b/ccm-cms-types-mparticle/src/com/arsdigita/cms/contenttypes/ui/mparticle/SectionTable.java index 86f6c49f3..13dda22f2 100755 --- a/ccm-cms-types-mparticle/src/com/arsdigita/cms/contenttypes/ui/mparticle/SectionTable.java +++ b/ccm-cms-types-mparticle/src/com/arsdigita/cms/contenttypes/ui/mparticle/SectionTable.java @@ -319,7 +319,8 @@ public class SectionTable extends Table this(false); } - public SectionTableCellRenderer ( boolean active ) { + public SectionTableCellRenderer + ( boolean active ) { m_active = active; } diff --git a/ccm-cms-types-simpleaddress/src/com/arsdigita/cms/contenttypes/ui/SimpleAddressPropertiesStep.java b/ccm-cms-types-simpleaddress/src/com/arsdigita/cms/contenttypes/ui/SimpleAddressPropertiesStep.java index 3a9af26dc..657a150b6 100755 --- a/ccm-cms-types-simpleaddress/src/com/arsdigita/cms/contenttypes/ui/SimpleAddressPropertiesStep.java +++ b/ccm-cms-types-simpleaddress/src/com/arsdigita/cms/contenttypes/ui/SimpleAddressPropertiesStep.java @@ -31,32 +31,34 @@ import com.arsdigita.cms.ui.authoring.BasicPageForm; import com.arsdigita.cms.ui.authoring.SimpleEditStep; import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; import com.arsdigita.cms.contenttypes.util.SimpleAddressGlobalizationUtil; +import com.arsdigita.cms.util.GlobalizationUtil; import java.text.DateFormat; /** - * Authoring step to edit the simple attributes of the SimpleAddress content type - * (and its subclasses). This authoring step replaces the + * Authoring step to edit the simple attributes of the SimpleAddress content + * type (and its subclasses). This authoring step replaces the * com.arsdigita.ui.authoring.PageEdit step for this type. * * @author Dominik Kacprzak * @version $Revision: #6 $ $Date: 2004/08/17 $ * - **/ + */ public class SimpleAddressPropertiesStep extends SimpleEditStep { /** The name of the editing sheet added to this step */ public static final String EDIT_SHEET_NAME = "edit"; public SimpleAddressPropertiesStep(ItemSelectionModel itemModel, - AuthoringKitWizard parent ) { + AuthoringKitWizard parent ) { super(itemModel, parent ); setDefaultEditKey(EDIT_SHEET_NAME); BasicPageForm editSheet; editSheet = new SimpleAddressPropertyForm(itemModel, this); - add(EDIT_SHEET_NAME, "Edit", + add(EDIT_SHEET_NAME, + GlobalizationUtil.globalize("cms.ui.edit"), new WorkflowLockedComponentAccess(editSheet, itemModel), editSheet.getSaveCancelSection().getCancelButton() ); @@ -76,78 +78,62 @@ public class SimpleAddressPropertiesStep extends SimpleEditStep { itemModel ) { DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(itemModel); - sheet.add( (String) SimpleAddressGlobalizationUtil.globalize - ("cms.contenttypes.ui.name").localize(), - SimpleAddress.NAME ); - sheet.add( (String) SimpleAddressGlobalizationUtil.globalize - ("cms.contenttypes.ui.title").localize(), - SimpleAddress.TITLE); + sheet.add(GlobalizationUtil.globalize("cms.contenttypes.ui.title"), + SimpleAddress.TITLE); + sheet.add(GlobalizationUtil.globalize("cms.contenttypes.ui.name"), + SimpleAddress.NAME ); if (!ContentSection.getConfig().getHideLaunchDate()) { - sheet.add( (String) SimpleAddressGlobalizationUtil.globalize - ("cms.ui.authoring.page_launch_date").localize(), - ContentPage.LAUNCH_DATE, - new DomainObjectPropertySheet.AttributeFormatter() { - public String format(DomainObject item, - String attribute, - PageState state) { - ContentPage page = (ContentPage) item; - if (page.getLaunchDate() != null) { - return DateFormat.getDateInstance(DateFormat.LONG) - .format(page.getLaunchDate()); - } else { - return (String)SimpleAddressGlobalizationUtil - .globalize("cms.ui.unknown").localize(); - } - } - }); + sheet.add(GlobalizationUtil + .globalize("cms.contenttypes.ui.launch_date"), + ContentPage.LAUNCH_DATE, + new LaunchDateAttributeFormatter() ); } - sheet.add( (String) SimpleAddressGlobalizationUtil.globalize - ("cms.contenttypes.ui.simpleaddress.address").localize(), - SimpleAddress.ADDRESS); + sheet.add(SimpleAddressGlobalizationUtil.globalize( + "cms.contenttypes.ui.simpleaddress.address"), + SimpleAddress.ADDRESS); if (!SimpleAddress.getConfig().getHideCountryCodeSelection()) { - sheet.add( (String) SimpleAddressGlobalizationUtil.globalize - ("cms.contenttypes.ui.simpleaddress.iso_country_code") - .localize(), - SimpleAddress.ISO_COUNTRY_CODE, - new DomainObjectPropertySheet.AttributeFormatter() { - public String format( DomainObject item, + sheet.add(SimpleAddressGlobalizationUtil.globalize( + "cms.contenttypes.ui.simpleaddress.iso_country_code"), + SimpleAddress.ISO_COUNTRY_CODE, + new DomainObjectPropertySheet.AttributeFormatter() { + public String format( DomainObject item, String attribute, PageState state ) { SimpleAddress address = ( SimpleAddress ) item; if ( address.getCountryIsoCode() != null ) { return address.getCountryIsoCode(); } else { - return (String)SimpleAddressGlobalizationUtil - .globalize - ("cms.ui.unknown").localize(); + return (String)GlobalizationUtil + .globalize("cms.ui.unknown") + .localize(); } } }); } if (!SimpleAddress.getConfig().getHidePostalCode()) { - sheet.add( (String) SimpleAddressGlobalizationUtil.globalize - ("cms.contenttypes.ui.simpleaddress.postal_code").localize(), - SimpleAddress.POSTAL_CODE); + sheet.add(SimpleAddressGlobalizationUtil.globalize( + "cms.contenttypes.ui.simpleaddress.postal_code"), + SimpleAddress.POSTAL_CODE); } - sheet.add((String) SimpleAddressGlobalizationUtil - .globalize("cms.contenttypes.ui.simpleaddress.phone").localize(), + sheet.add(SimpleAddressGlobalizationUtil.globalize( + "cms.contenttypes.ui.simpleaddress.phone"), SimpleAddress.PHONE); - sheet.add((String) SimpleAddressGlobalizationUtil.globalize - ("cms.contenttypes.ui.simpleaddress.mobile").localize(), + sheet.add(SimpleAddressGlobalizationUtil.globalize( + "cms.contenttypes.ui.simpleaddress.mobile"), SimpleAddress.MOBILE); - sheet.add((String) SimpleAddressGlobalizationUtil.globalize - ("cms.contenttypes.ui.simpleaddress.fax").localize(), + sheet.add(SimpleAddressGlobalizationUtil.globalize( + "cms.contenttypes.ui.simpleaddress.fax"), SimpleAddress.FAX); - sheet.add((String) SimpleAddressGlobalizationUtil.globalize - ("cms.contenttypes.ui.simpleaddress.email").localize(), + sheet.add(SimpleAddressGlobalizationUtil.globalize( + "cms.contenttypes.ui.simpleaddress.email"), SimpleAddress.EMAIL); - sheet.add((String) SimpleAddressGlobalizationUtil.globalize - ("cms.contenttypes.ui.simpleaddress.uri").localize(), + sheet.add(SimpleAddressGlobalizationUtil.globalize( + "cms.contenttypes.ui.simpleaddress.uri"), SimpleAddress.URI); - sheet.add((String) SimpleAddressGlobalizationUtil.globalize - ("cms.contenttypes.ui.simpleaddress.notes").localize(), + sheet.add(SimpleAddressGlobalizationUtil.globalize( + "cms.contenttypes.ui.simpleaddress.notes"), SimpleAddress.NOTES); return sheet; diff --git a/ccm-cms-types-simpleaddress/src/com/arsdigita/cms/contenttypes/ui/SimpleAddressPropertyForm.java b/ccm-cms-types-simpleaddress/src/com/arsdigita/cms/contenttypes/ui/SimpleAddressPropertyForm.java index 806b53bba..4afe4fa8e 100755 --- a/ccm-cms-types-simpleaddress/src/com/arsdigita/cms/contenttypes/ui/SimpleAddressPropertyForm.java +++ b/ccm-cms-types-simpleaddress/src/com/arsdigita/cms/contenttypes/ui/SimpleAddressPropertyForm.java @@ -43,6 +43,7 @@ import com.arsdigita.cms.contenttypes.SimpleAddress; import com.arsdigita.cms.contenttypes.util.SimpleAddressGlobalizationUtil; import com.arsdigita.cms.contenttypes.IsoCountry; import com.arsdigita.cms.ui.authoring.BasicPageForm; +import com.arsdigita.cms.util.GlobalizationUtil; import com.arsdigita.domain.DomainCollection; import org.apache.log4j.Logger; @@ -55,7 +56,7 @@ import org.apache.log4j.Logger; * * @author Dominik Kacprzak * @version $Revision: $ $Date: $ - **/ + */ public class SimpleAddressPropertyForm extends BasicPageForm implements FormProcessListener, FormInitListener, FormSubmissionListener { @@ -79,7 +80,7 @@ public class SimpleAddressPropertyForm extends BasicPageForm public static final String EMAIL = SimpleAddress.EMAIL; /** SimpleAddress notes parameter name */ public static final String NOTES = SimpleAddress.NOTES; - /** SimpleAddress URI parameter name*/ + /** SimpleAddress URI parameter name */ public static final String URI = SimpleAddress.URI; /** Name of this form */ @@ -89,9 +90,9 @@ public class SimpleAddressPropertyForm extends BasicPageForm * Creates a new form to edit the SimpleAddress object specified by the item * selection model passed in. * - * @param itemModel The ItemSelectionModel to use to obtain the SimpleAddress to - * work on - **/ + * @param itemModel The ItemSelectionModel to use to obtain the SimpleAddress + * to work on + */ public SimpleAddressPropertyForm( ItemSelectionModel itemModel ) { this(itemModel,null); } @@ -99,11 +100,12 @@ public class SimpleAddressPropertyForm extends BasicPageForm * Creates a new form to edit the SimpleAddress object specified by the item * selection model passed in. * - * @param itemModel The ItemSelectionModel to use to obtain the SimpleAddress to - * work on + * @param itemModel The ItemSelectionModel to use to obtain the SimpleAddress + * to work on * @param step The SimpleAddressPropertiesStep which controls this form. - **/ - public SimpleAddressPropertyForm( ItemSelectionModel itemModel, SimpleAddressPropertiesStep step ) { + */ + public SimpleAddressPropertyForm( ItemSelectionModel itemModel, + SimpleAddressPropertiesStep step ) { super( ID, itemModel ); m_step = step; addSubmissionListener(this); @@ -111,24 +113,25 @@ public class SimpleAddressPropertyForm extends BasicPageForm /** * Adds widgets to the form. - **/ + */ @Override protected void addWidgets() { super.addWidgets(); - add( new Label( (String)SimpleAddressGlobalizationUtil.globalize - ( "cms.contenttypes.ui.simpleaddress.address" ).localize() ) ); + add( new Label( SimpleAddressGlobalizationUtil.globalize( + "cms.contenttypes.ui.simpleaddress.address" ) ) ); ParameterModel addressBodyParam = new StringParameter( ADDRESS ); addressBodyParam.addParameterListener( new NotNullValidationListener( ) ); - addressBodyParam.addParameterListener( new StringInRangeValidationListener(0, 1000) ); + addressBodyParam.addParameterListener( + new StringInRangeValidationListener(0, 1000) ); TextArea addressBody = new TextArea( addressBodyParam ); addressBody.setRows(5); addressBody.setCols(30); add( addressBody ); if (!SimpleAddress.getConfig().getHideCountryCodeSelection()) { - add( new Label( (String)SimpleAddressGlobalizationUtil.globalize - ( "cms.contenttypes.ui.simpleaddress.iso_country_code" ).localize() ) ); + add( new Label(SimpleAddressGlobalizationUtil.globalize( + "cms.contenttypes.ui.simpleaddress.iso_country_code") )); ParameterModel isoCountryCodeParam = new StringParameter( ISO_COUNTRY_CODE ); //isoCountryCodeParam.addParameterListener( new NotNullValidationListener( ) ); // Don't assume submission via drop-down menu isoCountryCode @@ -137,8 +140,8 @@ public class SimpleAddressPropertyForm extends BasicPageForm SingleSelect isoCountryCode = new SingleSelect( isoCountryCodeParam ); isoCountryCode.addOption( new Option( "", - new Label( (String)SimpleAddressGlobalizationUtil.globalize - ("cms.ui.select_one" ).localize() ) ) ); + new Label(GlobalizationUtil.globalize( + "cms.ui.select_one" )) )); // retrieve country iso codes @@ -158,9 +161,9 @@ public class SimpleAddressPropertyForm extends BasicPageForm s_log.debug("ISO code is : " + isoCode); if (isoCode == null || isoCode.length() == 0) { data.addError( - (String)SimpleAddressGlobalizationUtil.globalize( + SimpleAddressGlobalizationUtil.globalize( "cms.contenttypes.ui.simpleaddress.error_iso_country") - .localize()); + ); } }}); @@ -168,8 +171,8 @@ public class SimpleAddressPropertyForm extends BasicPageForm } if (!SimpleAddress.getConfig().getHidePostalCode()) { - add( new Label( (String)SimpleAddressGlobalizationUtil.globalize - ( "cms.contenttypes.ui.simpleaddress.postal_code" ).localize() ) ); + add( new Label(SimpleAddressGlobalizationUtil.globalize( + "cms.contenttypes.ui.simpleaddress.postal_code") ) ); ParameterModel postalCodeParam = new StringParameter( POSTAL_CODE ); // postalCodeParam.addParameterListener( new NotNullValidationListener( ) ); postalCodeParam.addParameterListener( @@ -188,8 +191,8 @@ public class SimpleAddressPropertyForm extends BasicPageForm phone.setMaxLength( 20 ); add( phone ); - add( new Label( (String)SimpleAddressGlobalizationUtil.globalize - ( "cms.contenttypes.ui.simpleaddress.mobile" ).localize() ) ); + add( new Label(SimpleAddressGlobalizationUtil.globalize( + "cms.contenttypes.ui.simpleaddress.mobile" ) ) ); ParameterModel mobileParam = new StringParameter( MOBILE ); mobileParam.addParameterListener( new StringInRangeValidationListener(0, 20) ); TextField mobile = new TextField( mobileParam ); @@ -197,8 +200,8 @@ public class SimpleAddressPropertyForm extends BasicPageForm mobile.setMaxLength( 20 ); add( mobile ); - add( new Label( (String)SimpleAddressGlobalizationUtil.globalize - ( "cms.contenttypes.ui.simpleaddress.fax" ).localize() ) ); + add( new Label(SimpleAddressGlobalizationUtil.globalize( + "cms.contenttypes.ui.simpleaddress.fax") ) ); ParameterModel faxParam = new StringParameter( FAX ); faxParam.addParameterListener( new StringInRangeValidationListener(0, 20) ); TextField fax = new TextField( faxParam ); @@ -206,8 +209,8 @@ public class SimpleAddressPropertyForm extends BasicPageForm fax.setMaxLength( 20 ); add( fax ); - add( new Label( (String)SimpleAddressGlobalizationUtil.globalize - ( "cms.contenttypes.ui.simpleaddress.email" ).localize() ) ); + add( new Label(SimpleAddressGlobalizationUtil.globalize( + "cms.contenttypes.ui.simpleaddress.email" ) ) ); ParameterModel emailParam = new StringParameter( EMAIL ); emailParam.addParameterListener( new StringInRangeValidationListener(0, 75) ); TextField email = new TextField( emailParam ); @@ -218,12 +221,11 @@ public class SimpleAddressPropertyForm extends BasicPageForm .localize().toString()); add( email ); add(new Label("")); - add(new Label( (String)SimpleAddressGlobalizationUtil.globalize - ( "cms.contenttypes.ui.simpleaddress.email_desc" ) - .localize() ) ); + add(new Label(SimpleAddressGlobalizationUtil.globalize( + "cms.contenttypes.ui.simpleaddress.email_desc") ) ); - add( new Label( (String)SimpleAddressGlobalizationUtil.globalize - ( "cms.contenttypes.ui.simpleaddress.uri" ).localize() ) ); + add( new Label(SimpleAddressGlobalizationUtil.globalize( + "cms.contenttypes.ui.simpleaddress.uri") ) ); ParameterModel uriParam = new StringParameter( URI ); uriParam.addParameterListener( new StringInRangeValidationListener(0,250) ); TextField uri = new TextField( uriParam ); @@ -245,11 +247,11 @@ public class SimpleAddressPropertyForm extends BasicPageForm .localize().toString()); add( uri ); add(new Label("")); - add(new Label((String)SimpleAddressGlobalizationUtil.globalize - ( "cms.contenttypes.ui.simpleaddress.uri_desc" ).localize() ) ); + add(new Label(SimpleAddressGlobalizationUtil.globalize( + "cms.contenttypes.ui.simpleaddress.uri_desc") ) ); - add( new Label( (String)SimpleAddressGlobalizationUtil.globalize - ( "cms.contenttypes.ui.simpleaddress.notes" ).localize() ) ); + add( new Label(SimpleAddressGlobalizationUtil.globalize( + "cms.contenttypes.ui.simpleaddress.notes") ) ); ParameterModel notesParam = new StringParameter( NOTES ); TextArea notes = new TextArea( notesParam ); notes.setRows(8); @@ -259,7 +261,7 @@ public class SimpleAddressPropertyForm extends BasicPageForm /** * Form initialization hook. Fills widgets with data. - **/ + */ public void init(FormSectionEvent fse) { FormData data = fse.getFormData(); SimpleAddress address = ( SimpleAddress ) super.initBasicWidgets(fse); @@ -301,7 +303,7 @@ public class SimpleAddressPropertyForm extends BasicPageForm /** * Form processing hook. Saves SimpleAddress object. - **/ + */ public void process(FormSectionEvent fse) { FormData data = fse.getFormData(); diff --git a/ccm-cms/src/com/arsdigita/cms/CMSResources_de.properties b/ccm-cms/src/com/arsdigita/cms/CMSResources_de.properties index 8c8b53648..d54ab6399 100755 --- a/ccm-cms/src/com/arsdigita/cms/CMSResources_de.properties +++ b/ccm-cms/src/com/arsdigita/cms/CMSResources_de.properties @@ -283,7 +283,7 @@ cms.ui.authoring.remove_image=Bild entfernen cms.ui.authoring.select_an_existing_image=Vorhandenes Bild ausw\u00c4hlen cms.ui.authoring.sql_error_in_getting_byte_content=SQL Fehler beim Holen von Bin\u00e4rinhalt! cms.ui.authoring.sqle=SQLE -cms.ui.authoring.steps=Authoring steps +cms.ui.authoring.steps=Bearbeitungsschritte cms.ui.authoring.submission_cancelled=Submission Cancelled cms.ui.authoring.text_type=Art des Textes: cms.ui.authoring.this_article_does_not_have_an_image=Dieser Artikel hat kein Bild. diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactPropertiesStep.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactPropertiesStep.java index 013730f76..52f287353 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactPropertiesStep.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactPropertiesStep.java @@ -1,6 +1,5 @@ package com.arsdigita.cms.contenttypes.ui; -import com.arsdigita.bebop.PageState; import com.arsdigita.cms.ContentPage; import com.arsdigita.cms.ContentSection; import com.arsdigita.cms.ItemSelectionModel; @@ -8,7 +7,6 @@ import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; import com.arsdigita.cms.ui.authoring.BasicPageForm; import com.arsdigita.cms.ui.authoring.SimpleEditStep; import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; -import com.arsdigita.domain.DomainObject; import com.arsdigita.toolbox.ui.DomainObjectPropertySheet; import com.arsdigita.cms.util.GlobalizationUtil; import com.arsdigita.bebop.Component; @@ -17,7 +15,6 @@ import com.arsdigita.bebop.SegmentedPanel; import com.arsdigita.cms.contenttypes.GenericContact; import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil; -import java.text.DateFormat; import org.apache.log4j.Logger; /** diff --git a/ccm-cms/src/com/arsdigita/cms/ui/authoring/AuthoringKitWizard.java b/ccm-cms/src/com/arsdigita/cms/ui/authoring/AuthoringKitWizard.java index 7613316f6..e9cad0eca 100755 --- a/ccm-cms/src/com/arsdigita/cms/ui/authoring/AuthoringKitWizard.java +++ b/ccm-cms/src/com/arsdigita/cms/ui/authoring/AuthoringKitWizard.java @@ -60,7 +60,6 @@ import com.arsdigita.toolbox.ui.Section; import com.arsdigita.util.Assert; import com.arsdigita.util.SequentialMap; import com.arsdigita.util.UncheckedWrapperException; -import com.arsdigita.globalization.GlobalizedMessage; import org.apache.log4j.Logger; import java.lang.reflect.Constructor; diff --git a/ccm-ldn-types-contact/src/com/arsdigita/london/contenttypes/ui/ContactPhonesTable.java b/ccm-ldn-types-contact/src/com/arsdigita/london/contenttypes/ui/ContactPhonesTable.java index 4374a33ea..34bc09f06 100755 --- a/ccm-ldn-types-contact/src/com/arsdigita/london/contenttypes/ui/ContactPhonesTable.java +++ b/ccm-ldn-types-contact/src/com/arsdigita/london/contenttypes/ui/ContactPhonesTable.java @@ -251,7 +251,7 @@ class ContactPhonesTable extends Table implements TableActionListener { } } else { - /* Just returns the label without underlying link */ + /* Just returns the object as a componment */ ret = (Component)value; }