Beseitung verschiedener Lokalisierungsfehler.
git-svn-id: https://svn.libreccm.org/ccm/trunk@2180 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
a82c036d3c
commit
18cca65010
|
|
@ -940,7 +940,6 @@ cms.tasks.ui.anyone=Anyone
|
|||
cms.tasks.ui.assigned_to=Assigned to
|
||||
cms.tasks.ui.assignment_info=Assignment info
|
||||
cms.tasks.ui.content_center=Content Center
|
||||
cms.tasks.ui.create=Create
|
||||
cms.tasks.ui.description=Description
|
||||
cms.tasks.ui.disabled=Disabled
|
||||
cms.tasks.ui.due_date=Due date
|
||||
|
|
|
|||
|
|
@ -933,7 +933,6 @@ cms.tasks.ui.anyone=Jedermann
|
|||
cms.tasks.ui.assigned_to=Zugewiesen an:
|
||||
cms.tasks.ui.assignment_info=Informationen \u00fcber die Zuweisung
|
||||
cms.tasks.ui.content_center=Content Center
|
||||
cms.tasks.ui.create=Erstellen
|
||||
cms.tasks.ui.description=Beschreibung
|
||||
cms.tasks.ui.disabled=Deaktiviert
|
||||
cms.tasks.ui.due_date=F\u00e4lligkeitsdatum
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2009 Jens Pelzetter, for the Center of Social Politics of the University of Bremen
|
||||
* Copyright (C) 2009 Jens Pelzetter, for the University of Bremen
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public License
|
||||
|
|
@ -52,20 +52,34 @@ public class GenericAddressPropertiesStep extends SimpleEditStep {
|
|||
protected void createEditSheet(ItemSelectionModel itemModel) {
|
||||
BasicPageForm editSheet;
|
||||
editSheet = new GenericAddressPropertyForm(itemModel, this);
|
||||
add(EDIT_SHEET_NAME, "Edit", new WorkflowLockedComponentAccess(editSheet, itemModel), editSheet.getSaveCancelSection().getCancelButton());
|
||||
add(EDIT_SHEET_NAME,
|
||||
"Edit",
|
||||
new WorkflowLockedComponentAccess(editSheet, itemModel),
|
||||
editSheet.getSaveCancelSection().getCancelButton());
|
||||
}
|
||||
|
||||
public static Component getAddressPropertySheet(ItemSelectionModel itemModel) {
|
||||
DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(itemModel);
|
||||
|
||||
sheet.add((String) GlobalizationUtil.globalize("cms.contenttypes.ui.name").localize(), GenericAddress.NAME);
|
||||
sheet.add((String) GlobalizationUtil.globalize("cms.contenttypes.ui.title").localize(), GenericAddress.TITLE);
|
||||
sheet.add((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.address").localize(), GenericAddress.ADDRESS);
|
||||
sheet.add((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.postal_code").localize(), GenericAddress.POSTAL_CODE);
|
||||
sheet.add((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.city").localize(), GenericAddress.CITY);
|
||||
sheet.add((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.state").localize(), GenericAddress.STATE);
|
||||
sheet.add(GlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.name"), GenericAddress.NAME);
|
||||
sheet.add(GlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.title"), GenericAddress.TITLE);
|
||||
sheet.add(ContenttypesGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.address.address"),
|
||||
GenericAddress.ADDRESS);
|
||||
sheet.add(ContenttypesGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.address.postal_code"),
|
||||
GenericAddress.POSTAL_CODE);
|
||||
sheet.add(ContenttypesGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.address.city"),
|
||||
GenericAddress.CITY);
|
||||
sheet.add(ContenttypesGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.address.state"),
|
||||
GenericAddress.STATE);
|
||||
|
||||
sheet.add((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.iso_country_code").localize(),
|
||||
sheet.add(ContenttypesGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.address.iso_country_code"),
|
||||
GenericAddress.ISO_COUNTRY_CODE,
|
||||
new DomainObjectPropertySheet.AttributeFormatter() {
|
||||
|
||||
|
|
@ -74,15 +88,19 @@ public class GenericAddressPropertiesStep extends SimpleEditStep {
|
|||
PageState state) {
|
||||
GenericAddress address = (GenericAddress) item;
|
||||
if (address != null && address.getIsoCountryCode() != null) {
|
||||
return GenericAddress.getCountryNameFromIsoCode(address.getIsoCountryCode());
|
||||
return GenericAddress
|
||||
.getCountryNameFromIsoCode(address.getIsoCountryCode());
|
||||
} else {
|
||||
return (String) GlobalizationUtil.globalize("cms.ui.unknown").localize();
|
||||
return (String) GlobalizationUtil
|
||||
.globalize("cms.ui.unknown")
|
||||
.localize();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (!ContentSection.getConfig().getHideLaunchDate()) {
|
||||
sheet.add((String) GlobalizationUtil.globalize("cms.ui.authoring.page_launch_date").localize(),
|
||||
sheet.add(GlobalizationUtil
|
||||
.globalize("cms.ui.authoring.page_launch_date"),
|
||||
ContentPage.LAUNCH_DATE,
|
||||
new DomainObjectPropertySheet.AttributeFormatter() {
|
||||
|
||||
|
|
@ -91,9 +109,13 @@ public class GenericAddressPropertiesStep extends SimpleEditStep {
|
|||
PageState state) {
|
||||
ContentPage page = (ContentPage) item;
|
||||
if (page.getLaunchDate() != null) {
|
||||
return DateFormat.getDateInstance(DateFormat.LONG).format(page.getLaunchDate());
|
||||
return DateFormat
|
||||
.getDateInstance(DateFormat.LONG)
|
||||
.format(page.getLaunchDate());
|
||||
} else {
|
||||
return (String) GlobalizationUtil.globalize("cms.ui.unknown").localize();
|
||||
return (String) GlobalizationUtil
|
||||
.globalize("cms.ui.unknown")
|
||||
.localize();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -75,7 +75,8 @@ public class GenericAddressPropertyForm extends BasicPageForm implements FormPro
|
|||
protected void addWidgets() {
|
||||
super.addWidgets();
|
||||
|
||||
add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.address").localize()));
|
||||
add(new Label(ContenttypesGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.address.address")));
|
||||
ParameterModel addressParam = new StringParameter(ADDRESS);
|
||||
addressParam.addParameterListener(new NotNullValidationListener());
|
||||
addressParam.addParameterListener(new StringInRangeValidationListener(0, 1000));
|
||||
|
|
@ -84,46 +85,58 @@ public class GenericAddressPropertyForm extends BasicPageForm implements FormPro
|
|||
address.setCols(30);
|
||||
add(address);
|
||||
|
||||
add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.postal_code").localize()));
|
||||
add(new Label(ContenttypesGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.address.postal_code")));
|
||||
ParameterModel postalCodeParam = new StringParameter(POSTAL_CODE);
|
||||
TextField postalCode = new TextField(postalCodeParam);
|
||||
/* XXX NumberListener ?*/
|
||||
add(postalCode);
|
||||
|
||||
add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.city").localize()));
|
||||
add(new Label(ContenttypesGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.address.city")));
|
||||
ParameterModel cityParam = new StringParameter(CITY);
|
||||
TextField city = new TextField(cityParam);
|
||||
add(city);
|
||||
|
||||
add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.state").localize()));
|
||||
add(new Label(ContenttypesGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.address.state")));
|
||||
ParameterModel stateParam = new StringParameter(STATE);
|
||||
TextField state = new TextField(stateParam);
|
||||
add(state);
|
||||
|
||||
if (!GenericAddress.getConfig().getHideCountryCodeSelection()) {
|
||||
add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.iso_country_code").localize()));
|
||||
add(new Label(ContenttypesGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.address.iso_country_code")));
|
||||
ParameterModel countryParam = new StringParameter(ISO_COUNTRY_CODE);
|
||||
countryParam.addParameterListener(new StringInRangeValidationListener(0, 2));
|
||||
|
||||
SingleSelect country = new SingleSelect(countryParam);
|
||||
|
||||
country.addOption(new Option("", new Label((String) ContenttypesGlobalizationUtil.globalize("cms.ui.select_one").localize())));
|
||||
country.addOption(new Option("",
|
||||
new Label(ContenttypesGlobalizationUtil
|
||||
.globalize("cms.ui.select_one"))));
|
||||
|
||||
Iterator countries = GenericAddress.getSortedListOfCountries(null).entrySet().iterator();
|
||||
Iterator countries = GenericAddress.getSortedListOfCountries(null)
|
||||
.entrySet().iterator();
|
||||
while (countries.hasNext()) {
|
||||
Map.Entry<String, String> elem = (Map.Entry<String, String>) countries.next();
|
||||
country.addOption(new Option(elem.getValue().toString(), elem.getKey().toString()));
|
||||
Map.Entry<String, String> elem =
|
||||
(Map.Entry<String, String>) countries.next();
|
||||
country.addOption(new Option(elem.getValue().toString(),
|
||||
elem.getKey().toString()));
|
||||
}
|
||||
|
||||
country.addValidationListener(
|
||||
new ParameterListener() {
|
||||
|
||||
public void validate(ParameterEvent e) throws FormProcessException {
|
||||
public void validate(ParameterEvent e)
|
||||
throws FormProcessException {
|
||||
ParameterData data = e.getParameterData();
|
||||
String isoCode = (String) data.getValue();
|
||||
s_log.debug("ISO code is : " + isoCode);
|
||||
if (isoCode == null || isoCode.length() == 0) {
|
||||
data.addError((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.error_iso_country").localize());
|
||||
data.addError((String) ContenttypesGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.address.error_iso_country")
|
||||
.localize());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -220,7 +220,7 @@ public class ContentItemPage extends CMSPage implements ActionListener {
|
|||
m_tabbedPane.addTab(new Label(gz("cms.ui.item.summary")), m_summaryPane);
|
||||
m_tabbedPane.addTab(new Label(gz("cms.ui.item.authoring")), m_wizardPane);
|
||||
m_tabbedPane.addTab(new Label(gz("cms.ui.item.languages")),
|
||||
m_languagesPane);
|
||||
m_languagesPane);
|
||||
m_tabbedPane.addTab(new Label(gz("cms.ui.item.workflow")),
|
||||
m_workflowPane);
|
||||
m_tabbedPane.addTab(new Label(gz("cms.ui.item.lifecycles")),
|
||||
|
|
@ -300,6 +300,7 @@ public class ContentItemPage extends CMSPage implements ActionListener {
|
|||
* @param request The HTTP request
|
||||
* @return The current content section
|
||||
*/
|
||||
@Override
|
||||
public ContentSection getContentSection(HttpServletRequest request) {
|
||||
// Resets all content sections associations.
|
||||
ContentSection section = super.getContentSection(request);
|
||||
|
|
@ -315,6 +316,7 @@ public class ContentItemPage extends CMSPage implements ActionListener {
|
|||
* @param state The page state
|
||||
* @return The current content item, null if there is none
|
||||
*/
|
||||
@Override
|
||||
public ContentItem getContentItem(PageState state) {
|
||||
return (ContentItem) m_itemModel.getSelectedObject(state);
|
||||
}
|
||||
|
|
@ -486,6 +488,12 @@ public class ContentItemPage extends CMSPage implements ActionListener {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param state
|
||||
* @param item
|
||||
* @return
|
||||
*/
|
||||
private String getDefaultPreviewLink(final PageState state,
|
||||
final ContentItem item) {
|
||||
final ContentSection section = CMS.getContext().getContentSection();
|
||||
|
|
|
|||
|
|
@ -57,11 +57,10 @@ import java.util.Collection;
|
|||
* @author Stanislav Freidin (stas@arsdigita.com)
|
||||
* @version $Revision: #13 $ $DateTime: 2004/08/17 23:15:09 $
|
||||
**/
|
||||
public abstract class BasicItemForm
|
||||
extends FormSection
|
||||
implements FormInitListener,
|
||||
FormProcessListener,
|
||||
FormValidationListener {
|
||||
public abstract class BasicItemForm extends FormSection
|
||||
implements FormInitListener,
|
||||
FormProcessListener,
|
||||
FormValidationListener {
|
||||
|
||||
private static final Logger s_log = Logger.getLogger(BasicItemForm.class);
|
||||
private final ItemSelectionModel m_itemModel;
|
||||
|
|
@ -73,7 +72,11 @@ public abstract class BasicItemForm
|
|||
public static final String LANGUAGE = ContentItem.LANGUAGE;
|
||||
|
||||
/**
|
||||
* Construct a new BasicItemForm
|
||||
* Construct a new BasicItemForm with 2 ColumnPanels and add basic content.
|
||||
*
|
||||
* The left Panel is used for Labels, the right Panel for values.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @param formName the name of this form
|
||||
* @param itemModel The {@link ItemSelectionModel} which will
|
||||
|
|
@ -81,11 +84,13 @@ public abstract class BasicItemForm
|
|||
*/
|
||||
public BasicItemForm(String formName, ItemSelectionModel itemModel) {
|
||||
super(new ColumnPanel(2));
|
||||
//super(formName, new ColumnPanel(2));
|
||||
|
||||
m_widgetSection = new FormSection(new ColumnPanel(2, true));
|
||||
|
||||
super.add(m_widgetSection, ColumnPanel.INSERT);
|
||||
m_itemModel = itemModel;
|
||||
|
||||
/* Prepare Panel design */
|
||||
ColumnPanel panel = (ColumnPanel) getPanel();
|
||||
panel.setBorder(false);
|
||||
panel.setPadColor("#FFFFFF");
|
||||
|
|
@ -93,6 +98,7 @@ public abstract class BasicItemForm
|
|||
panel.setColumnWidth(2, "80%");
|
||||
panel.setWidth("100%");
|
||||
|
||||
/* Add basic contents */
|
||||
addWidgets();
|
||||
|
||||
m_saveCancelSection = new SaveCancelSection();
|
||||
|
|
@ -104,7 +110,8 @@ public abstract class BasicItemForm
|
|||
}
|
||||
|
||||
/**
|
||||
* Construct a new BasicItemForm with nothing on it
|
||||
* Construct a new BasicItemForm with a specified number of ColumnPanels
|
||||
* and without any content
|
||||
*
|
||||
* @param formName the name of this form
|
||||
* @param columnPanel the columnpanel of the form
|
||||
|
|
@ -115,9 +122,9 @@ public abstract class BasicItemForm
|
|||
ColumnPanel columnPanel,
|
||||
ItemSelectionModel itemModel) {
|
||||
super(columnPanel);
|
||||
//super(formName, columnPanel);
|
||||
m_widgetSection =
|
||||
new FormSection(new ColumnPanel(columnPanel.getNumCols(), true));
|
||||
|
||||
m_widgetSection = new FormSection(new ColumnPanel(columnPanel.getNumCols(),
|
||||
true));
|
||||
super.add(m_widgetSection, ColumnPanel.INSERT);
|
||||
m_itemModel = itemModel;
|
||||
}
|
||||
|
|
@ -129,13 +136,21 @@ public abstract class BasicItemForm
|
|||
m_saveCancelSection = new SaveCancelSection();
|
||||
super.add(m_saveCancelSection, ColumnPanel.FULL_WIDTH | ColumnPanel.LEFT);
|
||||
}
|
||||
private Label m_script = new Label(
|
||||
"<script language=\"javascript\" src=\"/javascript/manipulate-input.js\"></script>",
|
||||
false);
|
||||
|
||||
|
||||
/**
|
||||
* Add various widgets to the form. Child classes should override
|
||||
* this method to perform all their widget-adding needs
|
||||
* */
|
||||
private Label m_script = new Label(
|
||||
"<script language=\"javascript\" src=\"/javascript/manipulate-input.js\"></script>",
|
||||
false);
|
||||
|
||||
/**
|
||||
* Add basic widgets to the form.
|
||||
*
|
||||
* Widgets added are 'title' and 'name (url)' which are part of any content
|
||||
* item.
|
||||
* Child classes will override this method to perform all their widget-adding
|
||||
* needs but may use super() to add the basic widgets.
|
||||
*/
|
||||
protected void addWidgets() {
|
||||
//add(new FormErrorDisplay(this), ColumnPanel.FULL_WIDTH | ColumnPanel.LEFT);
|
||||
|
|
|
|||
|
|
@ -44,11 +44,14 @@ import javax.servlet.ServletException;
|
|||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* A form for editing subclasses of ContentPage. This is just a convenience class.
|
||||
* A form for editing subclasses of ContentPage.
|
||||
*
|
||||
* This is just a convenience class. It uses parent class to construct the form
|
||||
* including basic widgets (i.e. title and name/url as well as save/cancel
|
||||
* buttons) and adds optional Lunchdate
|
||||
*
|
||||
* @author Stanislav Freidin (stas@arsdigita.com)
|
||||
* @version $Revision: #22 $ $DateTime: 2004/08/17 23:15:09 $
|
||||
*
|
||||
*/
|
||||
public abstract class BasicPageForm extends BasicItemForm {
|
||||
|
||||
|
|
@ -85,19 +88,17 @@ public abstract class BasicPageForm extends BasicItemForm {
|
|||
*/
|
||||
@Override
|
||||
protected void addWidgets() {
|
||||
|
||||
/* Add basic widgets title/name which are part of any content item */
|
||||
super.addWidgets();
|
||||
|
||||
// add(new Label(GlobalizationUtil.globalize("cms.ui.authoring.page_description")));
|
||||
// ParameterModel descriptionParam = new StringParameter(DESCRIPTION);
|
||||
// TextArea description = new TextArea(descriptionParam);
|
||||
// description.setCols(50);
|
||||
// description.setRows(5);
|
||||
// add(description);
|
||||
//
|
||||
/* Optionally add Lunchdate */
|
||||
if (!ContentSection.getConfig().getHideLaunchDate()) {
|
||||
add(new Label(GlobalizationUtil.globalize("cms.ui.authoring.page_launch_date")));
|
||||
add(new Label(GlobalizationUtil
|
||||
.globalize("cms.ui.authoring.page_launch_date")));
|
||||
ParameterModel launchDateParam = new DateParameter(LAUNCH_DATE);
|
||||
com.arsdigita.bebop.form.Date launchDate = new com.arsdigita.bebop.form.Date(launchDateParam);
|
||||
com.arsdigita.bebop.form.Date launchDate =
|
||||
new com.arsdigita.bebop.form.Date(launchDateParam);
|
||||
if (ContentSection.getConfig().getRequireLaunchDate()) {
|
||||
launchDate.addValidationListener(new LaunchDateValidationListener());
|
||||
// if launch date is required, help user by suggesting today's date
|
||||
|
|
@ -108,7 +109,8 @@ public abstract class BasicPageForm extends BasicItemForm {
|
|||
}
|
||||
|
||||
/**
|
||||
* Utility method to initialize the name/title widgets. Child classes may call this method from the init listener
|
||||
* Utility method to initialize the name/title widgets. Child classes may
|
||||
* call this method from the init listener
|
||||
*
|
||||
* @param e the {@link FormSectionEvent} which was passed to the init listener
|
||||
* @return the ContentPage instance which was extracted from the ItemSelectionModel
|
||||
|
|
@ -118,15 +120,14 @@ public abstract class BasicPageForm extends BasicItemForm {
|
|||
|
||||
FormData data = e.getFormData();
|
||||
PageState state = e.getPageState();
|
||||
ContentPage item =
|
||||
(ContentPage) getItemSelectionModel().getSelectedObject(state);
|
||||
ContentPage item = (ContentPage)
|
||||
getItemSelectionModel().getSelectedObject(state);
|
||||
|
||||
if (item != null) {
|
||||
// Preset fields
|
||||
data.put(CONTENT_ITEM_ID, item.getID().toString());
|
||||
data.put(NAME, item.getName());
|
||||
data.put(TITLE, item.getTitle());
|
||||
// data.put(DESCRIPTION, item.getDescription());
|
||||
if (!ContentSection.getConfig().getHideLaunchDate()) {
|
||||
data.put(LAUNCH_DATE, item.getLaunchDate());
|
||||
// if launch date is required, help user by suggesting today's date
|
||||
|
|
@ -140,11 +141,17 @@ public abstract class BasicPageForm extends BasicItemForm {
|
|||
return item;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param fse
|
||||
* @throws FormProcessException
|
||||
*/
|
||||
@Override
|
||||
public void validate(final FormSectionEvent fse) throws FormProcessException {
|
||||
super.validate(fse);
|
||||
|
||||
final ContentItem item = getItemSelectionModel().getSelectedItem(fse.getPageState());
|
||||
final ContentItem item = getItemSelectionModel()
|
||||
.getSelectedItem(fse.getPageState());
|
||||
ACSObject parent = item.getParent();
|
||||
|
||||
|
||||
|
|
@ -163,7 +170,8 @@ public abstract class BasicPageForm extends BasicItemForm {
|
|||
}
|
||||
|
||||
/**
|
||||
* Utility method to process the name/title widgets. Child classes may call this method from the process listener.
|
||||
* Utility method to process the name/title widgets. Child classes may call
|
||||
* this method from the process listener.
|
||||
*
|
||||
* @param e the {@link FormSectionEvent} which was passed to the process listener
|
||||
* @return
|
||||
|
|
@ -180,7 +188,6 @@ public abstract class BasicPageForm extends BasicItemForm {
|
|||
// Update attributes
|
||||
item.setName((String) data.get(NAME));
|
||||
item.setTitle((String) data.get(TITLE));
|
||||
// item.setDescription((String)data.get(DESCRIPTION));
|
||||
if (!ContentSection.getConfig().getHideLaunchDate()) {
|
||||
item.setLaunchDate((Date) data.get(LAUNCH_DATE));
|
||||
}
|
||||
|
|
@ -190,8 +197,11 @@ public abstract class BasicPageForm extends BasicItemForm {
|
|||
}
|
||||
|
||||
/**
|
||||
* A utility method that will create a new item and tell the selection model to select the new item. Creation
|
||||
* components may call this method in the process listener of their form. See {@link PageCreate} for an example.
|
||||
* A utility method that will create a new item and tell the selection model
|
||||
* to select the new item.
|
||||
*
|
||||
* Creation components may call this method in the process listener of their
|
||||
* form. See {@link PageCreate} for an example.
|
||||
*
|
||||
* @param state the current page state
|
||||
* @return the new content item (or a proper subclass thereof) @pre state != null @post return != null
|
||||
|
|
|
|||
|
|
@ -179,9 +179,9 @@ public class CreationSelector extends MetaForm {
|
|||
} catch (Exception e) {
|
||||
s_log.error("Instantiation failure", e);
|
||||
throw new UncheckedWrapperException (
|
||||
"Failed to instantiate creation component " +
|
||||
kit.getCreateComponent() + ": " + e.getMessage(),
|
||||
e);
|
||||
"Failed to instantiate creation component " +
|
||||
kit.getCreateComponent() + ": " + e.getMessage(),
|
||||
e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ public class EmptyPage extends Page {
|
|||
super("", new SimpleContainer());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generateXML(PageState state, Document parent) {
|
||||
Element page = parent.createRootElement("cms:emptyPage", CMS.CMS_XML_NS);
|
||||
page.addAttribute("title", getTitle().getGlobalizedMessage().getKey());
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ package com.arsdigita.cms.ui.authoring;
|
|||
import com.arsdigita.bebop.BoxPanel;
|
||||
import com.arsdigita.bebop.Form;
|
||||
import com.arsdigita.bebop.Label;
|
||||
import com.arsdigita.bebop.Page;
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.bebop.event.PrintEvent;
|
||||
import com.arsdigita.bebop.event.PrintListener;
|
||||
|
|
@ -48,9 +47,9 @@ import com.arsdigita.xml.Element;
|
|||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* A form which displays a select box of all content types available
|
||||
* under the given content section, and forwards to the item creation
|
||||
* UI when the user selects a content type to instantiate.
|
||||
* A form which displays a select box of all content types available under the
|
||||
* given content section, and forwards to the item creation UI when the user
|
||||
* selects a content type to instantiate.
|
||||
*
|
||||
* @author Stanislav Freidin (sfreidin@arsdigtia.com)
|
||||
* @version $Revision: #12 $ $DateTime: 2004/08/17 23:15:09 $
|
||||
|
|
@ -59,9 +58,8 @@ import java.math.BigDecimal;
|
|||
public abstract class NewItemForm extends Form {
|
||||
|
||||
public static final String RESOURCE_BUNDLE =
|
||||
"com.arsdigita.cms.ui.authoring.AuthoringResources";
|
||||
public static String DP_TYPE_PREFIX =
|
||||
"com.arsdigita.dp.";
|
||||
"com.arsdigita.cms.ui.authoring.AuthoringResources";
|
||||
public static String DP_TYPE_PREFIX = "com.arsdigita.dp.";
|
||||
private SingleSelect m_typeWidget;
|
||||
private Submit m_submit;
|
||||
private Label m_emptyLabel;
|
||||
|
|
@ -183,6 +181,7 @@ public abstract class NewItemForm extends Form {
|
|||
}
|
||||
|
||||
// Generate XML - show/hide labels/widgets
|
||||
@Override
|
||||
public void generateXML(PageState state, Element parent) {
|
||||
|
||||
if (isVisible(state)) {
|
||||
|
|
|
|||
|
|
@ -37,15 +37,21 @@ import java.util.Date;
|
|||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
* A form which will create a new ContentPage or one of its
|
||||
* subclasses.
|
||||
* A form which will create a new ContentPage or one of its subclasses.
|
||||
*
|
||||
* Used to create a new document / content item. Creates widgets to select the
|
||||
* workflow, type of content item, and language. Super class adds additional
|
||||
* widgets (title and name/url) to complete the form.
|
||||
*
|
||||
* It's a pane which is part of a more complex page, additionally containing
|
||||
* folder structure, content items in the folder, permissions, etc.
|
||||
*
|
||||
* @author Stanislav Freidin (stas@arsdigita.com)
|
||||
* @version $Revision: #21 $ $DateTime: 2004/08/17 23:15:09 $
|
||||
* @version $Id: PageCreate.java 2140 2011-01-16 12:04:20Z pboy $
|
||||
*/
|
||||
public class PageCreate extends BasicPageForm
|
||||
implements FormSubmissionListener, CreationComponent {
|
||||
implements FormSubmissionListener, CreationComponent {
|
||||
|
||||
protected final CreationSelector m_parent;
|
||||
protected ApplyWorkflowFormSection m_workflowSection;
|
||||
|
|
@ -75,21 +81,29 @@ public class PageCreate extends BasicPageForm
|
|||
m_workflowSection.setCreationSelector(m_parent);
|
||||
addSubmissionListener(this);
|
||||
|
||||
getSaveCancelSection().getSaveButton().setButtonLabel("Create");
|
||||
getSaveCancelSection().getSaveButton()
|
||||
.setButtonLabel(GlobalizationUtil.globalize(
|
||||
"cms.ui.create"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add various widgets to the form. Child classes should override
|
||||
* this method to perform all their widget-adding needs.
|
||||
*/
|
||||
@Override
|
||||
protected void addWidgets() {
|
||||
|
||||
/* Add workflow selection */
|
||||
ContentType type = getItemSelectionModel().getContentType();
|
||||
m_workflowSection = new ApplyWorkflowFormSection(type);
|
||||
add(m_workflowSection, ColumnPanel.INSERT);
|
||||
/* content type */
|
||||
add(new Label(GlobalizationUtil.globalize("cms.ui.authoring.content_type")));
|
||||
add(new Label(type.getLabel()));
|
||||
/* language selection */
|
||||
add(new Label(GlobalizationUtil.globalize("cms.ui.language.field")));
|
||||
add(new LanguageWidget(LANGUAGE));
|
||||
/* Additional widgets from super type: title and name (url) */
|
||||
super.addWidgets();
|
||||
}
|
||||
|
||||
|
|
@ -126,9 +140,10 @@ public class PageCreate extends BasicPageForm
|
|||
}
|
||||
|
||||
/**
|
||||
* Validate inputs to ensure name uniqueness. Note: We can't call {@code super.validate(FormSectionEvent)} here
|
||||
* because the super method {@link BasicPageForm#validate(com.arsdigita.bebop.event.FormSectionEvent)} tries
|
||||
* to access things which on existing yet.
|
||||
* Validate inputs to ensure name uniqueness. Note: We can't call
|
||||
* {@code super.validate(FormSectionEvent)} here because the super method
|
||||
* {@link BasicPageForm#validate(com.arsdigita.bebop.event.FormSectionEvent)}
|
||||
* tries to access things which on existing yet.
|
||||
*
|
||||
* @param event
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -73,8 +73,8 @@ public class CategoryLocalizationAddForm extends CategoryLocalizationForm {
|
|||
|
||||
// Select one entry
|
||||
m_locale.addOption(new Option("",
|
||||
new Label((String) GlobalizationUtil.globalize(
|
||||
"cms.ui.select_one").localize())), state);
|
||||
new Label(GlobalizationUtil.globalize(
|
||||
"cms.ui.select_one"))), state);
|
||||
|
||||
// all supported languages (by registry entry)
|
||||
KernelConfig kernelConfig = Kernel.getConfig();
|
||||
|
|
|
|||
|
|
@ -94,8 +94,8 @@ public class TasksPanel extends CMSContainer {
|
|||
// Number of tasks to show
|
||||
private final int m_maxRows;
|
||||
private TaskList m_taskList;
|
||||
private ActionLink m_viewAllLink;
|
||||
private ActionLink m_viewShortLink;
|
||||
// private ActionLink m_viewAllLink;
|
||||
// private ActionLink m_viewShortLink;
|
||||
private Paginator m_paginator;
|
||||
private ActionLink m_viewLockLink, m_viewUnlockLink, m_viewAllLockLink;
|
||||
private Label m_viewLockLabel, m_viewUnlockLabel, m_viewAllLockLabel;
|
||||
|
|
@ -631,7 +631,7 @@ public class TasksPanel extends CMSContainer {
|
|||
state.setControlEvent(this, SORT_UP, header);
|
||||
}
|
||||
SimpleContainer container = new SimpleContainer();
|
||||
container.add(new Label((String)GlobalizationUtil.globalize(labelKey).localize()));
|
||||
container.add(new Label(GlobalizationUtil.globalize(labelKey)));
|
||||
if (header.equals(sortKey)) {
|
||||
String imageURLStub = null;
|
||||
if (SORT_UP.equals(sortDirection)) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue