From 27aed37070a31b63dc34bf30b939bb89d7d0a495 Mon Sep 17 00:00:00 2001 From: jensp Date: Mon, 1 Jul 2013 09:35:14 +0000 Subject: [PATCH] - GlossaryItem verwendete falschen GlobalizationUtil (aus anderem Modul) - Einbindung WebLog in Applications-Tab git-svn-id: https://svn.libreccm.org/ccm/trunk@2239 8810af33-2d31-482b-a856-94f89814c4df --- .../ui/GlossaryItemPropertiesStep.java | 61 +++++----- .../ui/GlossaryItemPropertyForm.java | 107 +++++++++--------- .../ui/GlossaryItemWidgetBuilder.java | 4 +- .../ui/authoring/GlossaryItemCreate.java | 6 +- ...a.ui.admin.applications.ApplicationManager | 1 + .../src/org/undp/weblog/WebLogAppManager.java | 47 ++++++++ 6 files changed, 139 insertions(+), 87 deletions(-) create mode 100644 ccm-weblog/src/META-INF/services/com.arsdigita.ui.admin.applications.ApplicationManager create mode 100644 ccm-weblog/src/org/undp/weblog/WebLogAppManager.java diff --git a/ccm-cms-types-glossaryitem/src/com/arsdigita/cms/contenttypes/ui/GlossaryItemPropertiesStep.java b/ccm-cms-types-glossaryitem/src/com/arsdigita/cms/contenttypes/ui/GlossaryItemPropertiesStep.java index 4bb59dcde..a56679866 100755 --- a/ccm-cms-types-glossaryitem/src/com/arsdigita/cms/contenttypes/ui/GlossaryItemPropertiesStep.java +++ b/ccm-cms-types-glossaryitem/src/com/arsdigita/cms/contenttypes/ui/GlossaryItemPropertiesStep.java @@ -20,63 +20,62 @@ package com.arsdigita.cms.contenttypes.ui; import com.arsdigita.bebop.Component; import com.arsdigita.cms.contenttypes.GlossaryItem; -import com.arsdigita.cms.contenttypes.util.FormSectionGlobalizationUtil; import com.arsdigita.cms.ui.authoring.BasicPageForm; import com.arsdigita.cms.ItemSelectionModel; +import com.arsdigita.cms.contenttypes.util.GlossaryGlobalizationUtil; import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; import com.arsdigita.cms.ui.authoring.SimpleEditStep; import com.arsdigita.cms.util.GlobalizationUtil; import com.arsdigita.toolbox.ui.DomainObjectPropertySheet; import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; - /** - * Authoring step to edit the simple attributes of the GlossaryItem content - * type (and its subclasses). + * Authoring step to edit the simple attributes of the GlossaryItem content type (and its subclasses). */ public class GlossaryItemPropertiesStep - extends SimpleEditStep { + extends SimpleEditStep { - /** The name of the editing sheet added to this step */ + /** + * The name of the editing sheet added to this step + */ public static final String EDIT_SHEET_NAME = "edit"; - public GlossaryItemPropertiesStep( ItemSelectionModel itemModel, - AuthoringKitWizard parent ) { - super( itemModel, parent ); + public GlossaryItemPropertiesStep(ItemSelectionModel itemModel, + AuthoringKitWizard parent) { + super(itemModel, parent); setDefaultEditKey(EDIT_SHEET_NAME); BasicPageForm editSheet; - editSheet = new GlossaryItemPropertyForm( itemModel, this); - add( EDIT_SHEET_NAME, - GlobalizationUtil.globalize("cms.ui.edit"), - new WorkflowLockedComponentAccess(editSheet, itemModel), - editSheet.getSaveCancelSection().getCancelButton() ); + editSheet = new GlossaryItemPropertyForm(itemModel, this); + add(EDIT_SHEET_NAME, + GlobalizationUtil.globalize("cms.ui.edit"), + new WorkflowLockedComponentAccess(editSheet, itemModel), + editSheet.getSaveCancelSection().getCancelButton()); - setDisplayComponent( getGlossaryDomainObjectPropertySheet( itemModel ) ); + setDisplayComponent(getGlossaryDomainObjectPropertySheet(itemModel)); } /** - * Returns a component that displays the properties of the - * GlossaryItem specified by the ItemSelectionModel passed in. + * Returns a component that displays the properties of the GlossaryItem 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 + * @return A component to display the state of the basic properties of the release */ - public static Component getGlossaryDomainObjectPropertySheet( ItemSelectionModel - itemModel ) { - DomainObjectPropertySheet sheet = new DomainObjectPropertySheet( itemModel ); + public static Component getGlossaryDomainObjectPropertySheet(ItemSelectionModel itemModel) { + DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(itemModel); - sheet.add(FormSectionGlobalizationUtil - .globalize("cms.contenttypes.ui.glossary.term"), - GlossaryItem.TITLE ); - sheet.add(GlobalizationUtil - .globalize("cms.contenttypes.ui.name"), - GlossaryItem.NAME ); - sheet.add(FormSectionGlobalizationUtil - .globalize("cms.contenttypes.ui.glossary.definition"), - GlossaryItem.DEFINITION ); + sheet.add(GlossaryGlobalizationUtil + .globalize("cms.contenttypes.ui.glossary.term"), + GlossaryItem.TITLE); + sheet.add(GlossaryGlobalizationUtil + .globalize("cms.contenttypes.ui.name"), + GlossaryItem.NAME); + sheet.add(GlossaryGlobalizationUtil + .globalize("cms.contenttypes.ui.glossary.definition"), + GlossaryItem.DEFINITION); return sheet; } diff --git a/ccm-cms-types-glossaryitem/src/com/arsdigita/cms/contenttypes/ui/GlossaryItemPropertyForm.java b/ccm-cms-types-glossaryitem/src/com/arsdigita/cms/contenttypes/ui/GlossaryItemPropertyForm.java index 1aff4d159..deb7519b5 100755 --- a/ccm-cms-types-glossaryitem/src/com/arsdigita/cms/contenttypes/ui/GlossaryItemPropertyForm.java +++ b/ccm-cms-types-glossaryitem/src/com/arsdigita/cms/contenttypes/ui/GlossaryItemPropertyForm.java @@ -24,61 +24,63 @@ import com.arsdigita.bebop.event.FormProcessListener; import com.arsdigita.bebop.event.FormSectionEvent; import com.arsdigita.bebop.event.FormSubmissionListener; import com.arsdigita.cms.contenttypes.GlossaryItem; -import com.arsdigita.cms.contenttypes.util.FormSectionGlobalizationUtil; +import com.arsdigita.cms.contenttypes.util.GlossaryGlobalizationUtil; import com.arsdigita.cms.ItemSelectionModel; import com.arsdigita.cms.ui.authoring.BasicPageForm; import com.arsdigita.globalization.GlobalizedMessage; /** - * Form to edit the basic properties of an GlossaryItem. This form can be - * extended to create forms for GlossaryItem subclasses. + * Form to edit the basic properties of an GlossaryItem. This form can be extended to create forms for GlossaryItem + * subclasses. */ public class GlossaryItemPropertyForm extends BasicPageForm - implements FormProcessListener, - FormInitListener, - FormSubmissionListener { + implements FormProcessListener, + FormInitListener, + FormSubmissionListener { private GlossaryItemPropertiesStep m_step; - - /** parameter names */ + /** + * parameter names + */ public static final String DEFINITION = "definition"; - - /** Name of this form */ + /** + * Name of this form + */ public static final String ID = "GlossaryItem_edit"; - + /** - * Creates a new form to edit the GlossaryItem object specified by the item - * selection model passed in. + * Creates a new form to edit the GlossaryItem object specified by the item selection model passed in. * - * @param itemModel The ItemSelectionModel to use to obtain the GlossaryItem to - * work on - **/ - public GlossaryItemPropertyForm( ItemSelectionModel itemModel ) { - this(itemModel,null); + * @param itemModel The ItemSelectionModel to use to obtain the GlossaryItem to work on + * + */ + public GlossaryItemPropertyForm(ItemSelectionModel itemModel) { + this(itemModel, null); } + /** - * Creates a new form to edit the GlossaryItem object specified by the item - * selection model passed in. + * Creates a new form to edit the GlossaryItem object specified by the item selection model passed in. * - * @param itemModel The ItemSelectionModel to use to obtain the GlossaryItem to - * work on + * @param itemModel The ItemSelectionModel to use to obtain the GlossaryItem to work on * @param step The GlossaryItemPropertiesStep which controls this form. - **/ - public GlossaryItemPropertyForm( ItemSelectionModel itemModel, - GlossaryItemPropertiesStep step ) { - super( ID, itemModel ); + * + */ + public GlossaryItemPropertyForm(ItemSelectionModel itemModel, + GlossaryItemPropertiesStep step) { + super(ID, itemModel); m_step = step; addSubmissionListener(this); } - /** * Adds widgets to the form. */ @Override protected void addWidgets() { - /** Insert default widgets (title/name) */ + /** + * Insert default widgets (title/name) + */ super.addWidgets(); GlossaryItemWidgetBuilder builder = new GlossaryItemWidgetBuilder(); @@ -88,45 +90,48 @@ public class GlossaryItemPropertyForm extends BasicPageForm /** * Replace the default Label ("Title") by a module specific one. - * @return + * + * @return */ @Override protected GlobalizedMessage getTitleLabel() { - return FormSectionGlobalizationUtil - .globalize("cms.contenttypes.ui.glossary.term"); + return GlossaryGlobalizationUtil + .globalize("cms.contenttypes.ui.glossary.term"); } - /** Form initialisation hook. Fills widgets with data. */ - public void init( FormSectionEvent fse ) { + /** + * Form initialisation hook. Fills widgets with data. + */ + public void init(FormSectionEvent fse) { FormData data = fse.getFormData(); - GlossaryItem glossary_item - = (GlossaryItem) super.initBasicWidgets( fse ); + GlossaryItem glossary_item = (GlossaryItem) super.initBasicWidgets(fse); - data.put( DEFINITION, glossary_item.getDefinition() ); + data.put(DEFINITION, glossary_item.getDefinition()); } - /** Cancels streamlined editing. */ - public void submitted( FormSectionEvent fse ) { - if (m_step != null && - getSaveCancelSection().getCancelButton() - .isSelected( fse.getPageState())) { + /** + * Cancels streamlined editing. + */ + public void submitted(FormSectionEvent fse) { + if (m_step != null && getSaveCancelSection().getCancelButton() + .isSelected(fse.getPageState())) { m_step.cancelStreamlinedCreation(fse.getPageState()); } } - - /** Form processing hook. Saves GlossaryItem object. */ - public void process( FormSectionEvent fse ) { + + /** + * Form processing hook. Saves GlossaryItem object. + */ + public void process(FormSectionEvent fse) { FormData data = fse.getFormData(); - - GlossaryItem glossary_item - = (GlossaryItem) super.processBasicWidgets( fse ); + + GlossaryItem glossary_item = (GlossaryItem) super.processBasicWidgets(fse); // save only if save button was pressed - if( glossary_item != null + if (glossary_item != null && getSaveCancelSection().getSaveButton() - .isSelected( fse.getPageState() ) ) { - glossary_item.setDefinition( (String) - data.get( DEFINITION ) ); + .isSelected(fse.getPageState())) { + glossary_item.setDefinition((String) data.get(DEFINITION)); glossary_item.save(); } if (m_step != null) { diff --git a/ccm-cms-types-glossaryitem/src/com/arsdigita/cms/contenttypes/ui/GlossaryItemWidgetBuilder.java b/ccm-cms-types-glossaryitem/src/com/arsdigita/cms/contenttypes/ui/GlossaryItemWidgetBuilder.java index 1bb57aaac..cc52a03fd 100644 --- a/ccm-cms-types-glossaryitem/src/com/arsdigita/cms/contenttypes/ui/GlossaryItemWidgetBuilder.java +++ b/ccm-cms-types-glossaryitem/src/com/arsdigita/cms/contenttypes/ui/GlossaryItemWidgetBuilder.java @@ -26,7 +26,7 @@ import com.arsdigita.bebop.parameters.NotNullValidationListener; import com.arsdigita.bebop.util.BebopConstants; import com.arsdigita.cms.contenttypes.GlossaryItem; import com.arsdigita.cms.contenttypes.ui.authoring.GlossaryItemCreate; -import com.arsdigita.cms.contenttypes.util.FormSectionGlobalizationUtil; +import com.arsdigita.cms.contenttypes.util.GlossaryGlobalizationUtil; import com.arsdigita.cms.ui.CMSDHTMLEditor; import static com.arsdigita.cms.contenttypes.ui.GlossaryItemPropertyForm.DEFINITION; @@ -69,7 +69,7 @@ public class GlossaryItemWidgetBuilder { } public Label makeDefinitionLabel() { - return new Label(FormSectionGlobalizationUtil + return new Label(GlossaryGlobalizationUtil .globalize("cms.contenttypes.ui.glossary.definition")); } } diff --git a/ccm-cms-types-glossaryitem/src/com/arsdigita/cms/contenttypes/ui/authoring/GlossaryItemCreate.java b/ccm-cms-types-glossaryitem/src/com/arsdigita/cms/contenttypes/ui/authoring/GlossaryItemCreate.java index fe5fcf4b0..1e030233d 100755 --- a/ccm-cms-types-glossaryitem/src/com/arsdigita/cms/contenttypes/ui/authoring/GlossaryItemCreate.java +++ b/ccm-cms-types-glossaryitem/src/com/arsdigita/cms/contenttypes/ui/authoring/GlossaryItemCreate.java @@ -27,7 +27,7 @@ import com.arsdigita.cms.contenttypes.ui.GlossaryItemWidgetBuilder; import com.arsdigita.cms.Folder; import com.arsdigita.cms.ContentBundle; import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.contenttypes.util.FormSectionGlobalizationUtil; +import com.arsdigita.cms.contenttypes.util.GlossaryGlobalizationUtil; import com.arsdigita.cms.ui.authoring.PageCreate; import com.arsdigita.cms.ui.authoring.CreationSelector; import com.arsdigita.globalization.GlobalizedMessage; @@ -77,7 +77,7 @@ public class GlossaryItemCreate extends PageCreate { */ @Override protected GlobalizedMessage getTitleLabel() { - return FormSectionGlobalizationUtil + return GlossaryGlobalizationUtil .globalize("cms.contenttypes.ui.glossary.term"); } @@ -110,6 +110,6 @@ public class GlossaryItemCreate extends PageCreate { getWorkflowSection().applyWorkflow(state, item); // Start edititng the component right away - m_parent.editItem(state, item); + m_parent.editItem(state, item); } } diff --git a/ccm-weblog/src/META-INF/services/com.arsdigita.ui.admin.applications.ApplicationManager b/ccm-weblog/src/META-INF/services/com.arsdigita.ui.admin.applications.ApplicationManager new file mode 100644 index 000000000..412ed4d99 --- /dev/null +++ b/ccm-weblog/src/META-INF/services/com.arsdigita.ui.admin.applications.ApplicationManager @@ -0,0 +1 @@ +org.undp.weblog.WebLogAppManager \ No newline at end of file diff --git a/ccm-weblog/src/org/undp/weblog/WebLogAppManager.java b/ccm-weblog/src/org/undp/weblog/WebLogAppManager.java new file mode 100644 index 000000000..54768b071 --- /dev/null +++ b/ccm-weblog/src/org/undp/weblog/WebLogAppManager.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2013 Jens Pelzetter + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ +package org.undp.weblog; + +import com.arsdigita.bebop.BoxPanel; +import com.arsdigita.bebop.Label; +import com.arsdigita.ui.admin.GlobalizationUtil; +import com.arsdigita.ui.admin.applications.AbstractApplicationManager; +import com.arsdigita.ui.admin.applications.ApplicationInstanceAwareContainer; + +/** + * + * @author Jens Pelzetter + * @version $Id$ + */ +public class WebLogAppManager extends AbstractApplicationManager { + + public Class getApplication() { + return WebLogApplication.class; + } + + public ApplicationInstanceAwareContainer getApplicationAdminForm() { + final ApplicationInstanceAwareContainer container = new ApplicationInstanceAwareContainer(); + + final BoxPanel panel = new BoxPanel(BoxPanel.VERTICAL); + panel.add(new Label(GlobalizationUtil.globalize("ui.admin.applications.no_settings"))); + container.add(panel); + + return container; + } +}