- 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-94f89814c4dfmaster
parent
1a5f8672d6
commit
27aed37070
|
|
@ -20,63 +20,62 @@ package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
import com.arsdigita.bebop.Component;
|
import com.arsdigita.bebop.Component;
|
||||||
import com.arsdigita.cms.contenttypes.GlossaryItem;
|
import com.arsdigita.cms.contenttypes.GlossaryItem;
|
||||||
import com.arsdigita.cms.contenttypes.util.FormSectionGlobalizationUtil;
|
|
||||||
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
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.AuthoringKitWizard;
|
||||||
import com.arsdigita.cms.ui.authoring.SimpleEditStep;
|
import com.arsdigita.cms.ui.authoring.SimpleEditStep;
|
||||||
import com.arsdigita.cms.util.GlobalizationUtil;
|
import com.arsdigita.cms.util.GlobalizationUtil;
|
||||||
import com.arsdigita.toolbox.ui.DomainObjectPropertySheet;
|
import com.arsdigita.toolbox.ui.DomainObjectPropertySheet;
|
||||||
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Authoring step to edit the simple attributes of the GlossaryItem content
|
* Authoring step to edit the simple attributes of the GlossaryItem content type (and its subclasses).
|
||||||
* type (and its subclasses).
|
|
||||||
*/
|
*/
|
||||||
public class GlossaryItemPropertiesStep
|
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 static final String EDIT_SHEET_NAME = "edit";
|
||||||
|
|
||||||
public GlossaryItemPropertiesStep( ItemSelectionModel itemModel,
|
public GlossaryItemPropertiesStep(ItemSelectionModel itemModel,
|
||||||
AuthoringKitWizard parent ) {
|
AuthoringKitWizard parent) {
|
||||||
super( itemModel, parent );
|
super(itemModel, parent);
|
||||||
|
|
||||||
setDefaultEditKey(EDIT_SHEET_NAME);
|
setDefaultEditKey(EDIT_SHEET_NAME);
|
||||||
BasicPageForm editSheet;
|
BasicPageForm editSheet;
|
||||||
|
|
||||||
editSheet = new GlossaryItemPropertyForm( itemModel, this);
|
editSheet = new GlossaryItemPropertyForm(itemModel, this);
|
||||||
add( EDIT_SHEET_NAME,
|
add(EDIT_SHEET_NAME,
|
||||||
GlobalizationUtil.globalize("cms.ui.edit"),
|
GlobalizationUtil.globalize("cms.ui.edit"),
|
||||||
new WorkflowLockedComponentAccess(editSheet, itemModel),
|
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
|
* Returns a component that displays the properties of the GlossaryItem specified by the ItemSelectionModel passed
|
||||||
* GlossaryItem specified by the ItemSelectionModel passed in.
|
* in.
|
||||||
|
*
|
||||||
* @param itemModel The ItemSelectionModel to use
|
* @param itemModel The ItemSelectionModel to use
|
||||||
* @pre itemModel != null
|
* @pre itemModel != null
|
||||||
* @return A component to display the state of the basic properties
|
* @return A component to display the state of the basic properties of the release
|
||||||
* of the release
|
|
||||||
*/
|
*/
|
||||||
public static Component getGlossaryDomainObjectPropertySheet( ItemSelectionModel
|
public static Component getGlossaryDomainObjectPropertySheet(ItemSelectionModel itemModel) {
|
||||||
itemModel ) {
|
DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(itemModel);
|
||||||
DomainObjectPropertySheet sheet = new DomainObjectPropertySheet( itemModel );
|
|
||||||
|
|
||||||
sheet.add(FormSectionGlobalizationUtil
|
sheet.add(GlossaryGlobalizationUtil
|
||||||
.globalize("cms.contenttypes.ui.glossary.term"),
|
.globalize("cms.contenttypes.ui.glossary.term"),
|
||||||
GlossaryItem.TITLE );
|
GlossaryItem.TITLE);
|
||||||
sheet.add(GlobalizationUtil
|
sheet.add(GlossaryGlobalizationUtil
|
||||||
.globalize("cms.contenttypes.ui.name"),
|
.globalize("cms.contenttypes.ui.name"),
|
||||||
GlossaryItem.NAME );
|
GlossaryItem.NAME);
|
||||||
sheet.add(FormSectionGlobalizationUtil
|
sheet.add(GlossaryGlobalizationUtil
|
||||||
.globalize("cms.contenttypes.ui.glossary.definition"),
|
.globalize("cms.contenttypes.ui.glossary.definition"),
|
||||||
GlossaryItem.DEFINITION );
|
GlossaryItem.DEFINITION);
|
||||||
|
|
||||||
return sheet;
|
return sheet;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,14 +24,14 @@ import com.arsdigita.bebop.event.FormProcessListener;
|
||||||
import com.arsdigita.bebop.event.FormSectionEvent;
|
import com.arsdigita.bebop.event.FormSectionEvent;
|
||||||
import com.arsdigita.bebop.event.FormSubmissionListener;
|
import com.arsdigita.bebop.event.FormSubmissionListener;
|
||||||
import com.arsdigita.cms.contenttypes.GlossaryItem;
|
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.ItemSelectionModel;
|
||||||
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
||||||
import com.arsdigita.globalization.GlobalizedMessage;
|
import com.arsdigita.globalization.GlobalizedMessage;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Form to edit the basic properties of an GlossaryItem. This form can be
|
* Form to edit the basic properties of an GlossaryItem. This form can be extended to create forms for GlossaryItem
|
||||||
* extended to create forms for GlossaryItem subclasses.
|
* subclasses.
|
||||||
*/
|
*/
|
||||||
public class GlossaryItemPropertyForm extends BasicPageForm
|
public class GlossaryItemPropertyForm extends BasicPageForm
|
||||||
implements FormProcessListener,
|
implements FormProcessListener,
|
||||||
|
|
@ -39,46 +39,48 @@ public class GlossaryItemPropertyForm extends BasicPageForm
|
||||||
FormSubmissionListener {
|
FormSubmissionListener {
|
||||||
|
|
||||||
private GlossaryItemPropertiesStep m_step;
|
private GlossaryItemPropertiesStep m_step;
|
||||||
|
/**
|
||||||
/** parameter names */
|
* parameter names
|
||||||
|
*/
|
||||||
public static final String DEFINITION = "definition";
|
public static final String DEFINITION = "definition";
|
||||||
|
/**
|
||||||
/** Name of this form */
|
* Name of this form
|
||||||
|
*/
|
||||||
public static final String ID = "GlossaryItem_edit";
|
public static final String ID = "GlossaryItem_edit";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new form to edit the GlossaryItem object specified by the item
|
* Creates a new form to edit the GlossaryItem object specified by the item selection model passed in.
|
||||||
* selection model passed in.
|
|
||||||
*
|
*
|
||||||
* @param itemModel The ItemSelectionModel to use to obtain the GlossaryItem to
|
* @param itemModel The ItemSelectionModel to use to obtain the GlossaryItem to work on
|
||||||
* work on
|
*
|
||||||
**/
|
*/
|
||||||
public GlossaryItemPropertyForm( ItemSelectionModel itemModel ) {
|
public GlossaryItemPropertyForm(ItemSelectionModel itemModel) {
|
||||||
this(itemModel,null);
|
this(itemModel, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new form to edit the GlossaryItem object specified by the item
|
* Creates a new form to edit the GlossaryItem object specified by the item selection model passed in.
|
||||||
* selection model passed in.
|
|
||||||
*
|
*
|
||||||
* @param itemModel The ItemSelectionModel to use to obtain the GlossaryItem to
|
* @param itemModel The ItemSelectionModel to use to obtain the GlossaryItem to work on
|
||||||
* work on
|
|
||||||
* @param step The GlossaryItemPropertiesStep which controls this form.
|
* @param step The GlossaryItemPropertiesStep which controls this form.
|
||||||
**/
|
*
|
||||||
public GlossaryItemPropertyForm( ItemSelectionModel itemModel,
|
*/
|
||||||
GlossaryItemPropertiesStep step ) {
|
public GlossaryItemPropertyForm(ItemSelectionModel itemModel,
|
||||||
super( ID, itemModel );
|
GlossaryItemPropertiesStep step) {
|
||||||
|
super(ID, itemModel);
|
||||||
m_step = step;
|
m_step = step;
|
||||||
addSubmissionListener(this);
|
addSubmissionListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds widgets to the form.
|
* Adds widgets to the form.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected void addWidgets() {
|
protected void addWidgets() {
|
||||||
|
|
||||||
/** Insert default widgets (title/name) */
|
/**
|
||||||
|
* Insert default widgets (title/name)
|
||||||
|
*/
|
||||||
super.addWidgets();
|
super.addWidgets();
|
||||||
|
|
||||||
GlossaryItemWidgetBuilder builder = new GlossaryItemWidgetBuilder();
|
GlossaryItemWidgetBuilder builder = new GlossaryItemWidgetBuilder();
|
||||||
|
|
@ -88,45 +90,48 @@ public class GlossaryItemPropertyForm extends BasicPageForm
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Replace the default Label ("Title") by a module specific one.
|
* Replace the default Label ("Title") by a module specific one.
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected GlobalizedMessage getTitleLabel() {
|
protected GlobalizedMessage getTitleLabel() {
|
||||||
return FormSectionGlobalizationUtil
|
return GlossaryGlobalizationUtil
|
||||||
.globalize("cms.contenttypes.ui.glossary.term");
|
.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();
|
FormData data = fse.getFormData();
|
||||||
GlossaryItem glossary_item
|
GlossaryItem glossary_item = (GlossaryItem) super.initBasicWidgets(fse);
|
||||||
= (GlossaryItem) super.initBasicWidgets( fse );
|
|
||||||
|
|
||||||
data.put( DEFINITION, glossary_item.getDefinition() );
|
data.put(DEFINITION, glossary_item.getDefinition());
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Cancels streamlined editing. */
|
/**
|
||||||
public void submitted( FormSectionEvent fse ) {
|
* Cancels streamlined editing.
|
||||||
if (m_step != null &&
|
*/
|
||||||
getSaveCancelSection().getCancelButton()
|
public void submitted(FormSectionEvent fse) {
|
||||||
.isSelected( fse.getPageState())) {
|
if (m_step != null && getSaveCancelSection().getCancelButton()
|
||||||
|
.isSelected(fse.getPageState())) {
|
||||||
m_step.cancelStreamlinedCreation(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();
|
FormData data = fse.getFormData();
|
||||||
|
|
||||||
GlossaryItem glossary_item
|
GlossaryItem glossary_item = (GlossaryItem) super.processBasicWidgets(fse);
|
||||||
= (GlossaryItem) super.processBasicWidgets( fse );
|
|
||||||
|
|
||||||
// save only if save button was pressed
|
// save only if save button was pressed
|
||||||
if( glossary_item != null
|
if (glossary_item != null
|
||||||
&& getSaveCancelSection().getSaveButton()
|
&& getSaveCancelSection().getSaveButton()
|
||||||
.isSelected( fse.getPageState() ) ) {
|
.isSelected(fse.getPageState())) {
|
||||||
glossary_item.setDefinition( (String)
|
glossary_item.setDefinition((String) data.get(DEFINITION));
|
||||||
data.get( DEFINITION ) );
|
|
||||||
glossary_item.save();
|
glossary_item.save();
|
||||||
}
|
}
|
||||||
if (m_step != null) {
|
if (m_step != null) {
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ import com.arsdigita.bebop.parameters.NotNullValidationListener;
|
||||||
import com.arsdigita.bebop.util.BebopConstants;
|
import com.arsdigita.bebop.util.BebopConstants;
|
||||||
import com.arsdigita.cms.contenttypes.GlossaryItem;
|
import com.arsdigita.cms.contenttypes.GlossaryItem;
|
||||||
import com.arsdigita.cms.contenttypes.ui.authoring.GlossaryItemCreate;
|
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 com.arsdigita.cms.ui.CMSDHTMLEditor;
|
||||||
|
|
||||||
import static com.arsdigita.cms.contenttypes.ui.GlossaryItemPropertyForm.DEFINITION;
|
import static com.arsdigita.cms.contenttypes.ui.GlossaryItemPropertyForm.DEFINITION;
|
||||||
|
|
@ -69,7 +69,7 @@ public class GlossaryItemWidgetBuilder {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Label makeDefinitionLabel() {
|
public Label makeDefinitionLabel() {
|
||||||
return new Label(FormSectionGlobalizationUtil
|
return new Label(GlossaryGlobalizationUtil
|
||||||
.globalize("cms.contenttypes.ui.glossary.definition"));
|
.globalize("cms.contenttypes.ui.glossary.definition"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ import com.arsdigita.cms.contenttypes.ui.GlossaryItemWidgetBuilder;
|
||||||
import com.arsdigita.cms.Folder;
|
import com.arsdigita.cms.Folder;
|
||||||
import com.arsdigita.cms.ContentBundle;
|
import com.arsdigita.cms.ContentBundle;
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
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.PageCreate;
|
||||||
import com.arsdigita.cms.ui.authoring.CreationSelector;
|
import com.arsdigita.cms.ui.authoring.CreationSelector;
|
||||||
import com.arsdigita.globalization.GlobalizedMessage;
|
import com.arsdigita.globalization.GlobalizedMessage;
|
||||||
|
|
@ -77,7 +77,7 @@ public class GlossaryItemCreate extends PageCreate {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected GlobalizedMessage getTitleLabel() {
|
protected GlobalizedMessage getTitleLabel() {
|
||||||
return FormSectionGlobalizationUtil
|
return GlossaryGlobalizationUtil
|
||||||
.globalize("cms.contenttypes.ui.glossary.term");
|
.globalize("cms.contenttypes.ui.glossary.term");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
org.undp.weblog.WebLogAppManager
|
||||||
|
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue