- 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
master
jensp 2013-07-01 09:35:14 +00:00
parent 1a5f8672d6
commit 27aed37070
6 changed files with 139 additions and 87 deletions

View File

@ -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 {
/** 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,
editSheet = new GlossaryItemPropertyForm(itemModel, this);
add(EDIT_SHEET_NAME,
GlobalizationUtil.globalize("cms.ui.edit"),
new WorkflowLockedComponentAccess(editSheet, itemModel),
editSheet.getSaveCancelSection().getCancelButton() );
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
sheet.add(GlossaryGlobalizationUtil
.globalize("cms.contenttypes.ui.glossary.term"),
GlossaryItem.TITLE );
sheet.add(GlobalizationUtil
GlossaryItem.TITLE);
sheet.add(GlossaryGlobalizationUtil
.globalize("cms.contenttypes.ui.name"),
GlossaryItem.NAME );
sheet.add(FormSectionGlobalizationUtil
GlossaryItem.NAME);
sheet.add(GlossaryGlobalizationUtil
.globalize("cms.contenttypes.ui.glossary.definition"),
GlossaryItem.DEFINITION );
GlossaryItem.DEFINITION);
return sheet;
}

View File

@ -24,14 +24,14 @@ 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,
@ -39,46 +39,48 @@ public class GlossaryItemPropertyForm extends BasicPageForm
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
*/
@Override
protected GlobalizedMessage getTitleLabel() {
return FormSectionGlobalizationUtil
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) {

View File

@ -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"));
}
}

View File

@ -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");
}

View File

@ -0,0 +1 @@
org.undp.weblog.WebLogAppManager

View File

@ -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<WebLogApplication> {
public Class<WebLogApplication> 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;
}
}