com.arsdigita.ui.authoring.PageEdit step for this type.
+ */
+public class ArticlePropertiesStep extends GenericArticlePropertiesStep {
+
+ /** The name of the editing sheet added to this step */
+ public static String EDIT_SHEET_NAME = "edit";
+
+ /**
+ * Constructor.
+ *
+ * @param itemModel
+ * @param parent
+ */
+ public ArticlePropertiesStep(ItemSelectionModel itemModel,
+ AuthoringKitWizard parent) {
+ super(itemModel, parent);
+ }
+
+ @Override
+ protected void createEditSheet(ItemSelectionModel itemModel) {
+ BasicPageForm editSheet;
+ editSheet = new ArticlePropertyForm(itemModel, this);
+ add(EDIT_SHEET_NAME,
+ GlobalizationUtil.globalize("cms.ui.edit"),
+ new WorkflowLockedComponentAccess(editSheet, itemModel),
+ editSheet.getSaveCancelSection().getCancelButton());
+ }
+
+ @Override
+ protected void setDisplayComponent(ItemSelectionModel itemModel) {
+ setDisplayComponent(getArticlePropertySheet(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
+ */
+ public static Component getArticlePropertySheet(ItemSelectionModel itemModel) {
+ DomainObjectPropertySheet sheet = (DomainObjectPropertySheet)
+ getGenericArticlePropertySheet(itemModel);
+
+ sheet.add(GlobalizationUtil.globalize("cms.contenttypes.ui.lead"),
+ Article.LEAD);
+
+ return sheet;
+ }
+}
diff --git a/ccm-cms/src/main/java/com/arsdigita/cms/contenttypes/ui/GenericArticlePropertiesStep.java.TODO b/ccm-cms/src/main/java/com/arsdigita/cms/contenttypes/ui/GenericArticlePropertiesStep.java.TODO
new file mode 100755
index 000000000..992b064b0
--- /dev/null
+++ b/ccm-cms/src/main/java/com/arsdigita/cms/contenttypes/ui/GenericArticlePropertiesStep.java.TODO
@@ -0,0 +1,109 @@
+/*
+ * Copyright (C) 2002-2004 Red Hat Inc. All Rights Reserved.
+ *
+ * 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 com.arsdigita.cms.contenttypes.ui;
+
+import com.arsdigita.bebop.Component;
+import com.arsdigita.bebop.PageState;
+import com.arsdigita.cms.ContentPage;
+import com.arsdigita.cms.ContentSection;
+import com.arsdigita.cms.ItemSelectionModel;
+import com.arsdigita.cms.contenttypes.GenericArticle;
+import com.arsdigita.domain.DomainObject;
+import com.arsdigita.toolbox.ui.DomainObjectPropertySheet;
+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.cms.util.GlobalizationUtil;
+import java.text.DateFormat;
+
+/**
+ * Authoring step to edit the simple attributes of the GenericArticle content
+ * type (and its subclasses). The attributes edited are 'name', 'title',
+ * 'article date', 'location', and 'article type'.
+ * This authoring step replaces
+ * the com.arsdigita.ui.authoring.PageEdit step for this type.
+ */
+public class GenericArticlePropertiesStep extends SimpleEditStep {
+
+ /** The name of the editing sheet added to this step */
+ public static String EDIT_SHEET_NAME = "edit";
+ DomainObjectPropertySheet get;
+
+ public GenericArticlePropertiesStep(ItemSelectionModel itemModel,
+ AuthoringKitWizard parent) {
+ super(itemModel, parent);
+
+ setDefaultEditKey(EDIT_SHEET_NAME);
+ createEditSheet(itemModel);
+
+ setDisplayComponent(itemModel);
+ }
+
+ protected void createEditSheet(ItemSelectionModel itemModel) {
+ BasicPageForm editSheet;
+ editSheet = new GenericArticlePropertyForm(itemModel, this);
+ add(EDIT_SHEET_NAME,
+ GlobalizationUtil.globalize("cms.ui.edit"),
+ new WorkflowLockedComponentAccess(editSheet, itemModel),
+ editSheet.getSaveCancelSection().getCancelButton());
+ }
+
+ protected void setDisplayComponent(ItemSelectionModel itemModel) {
+ setDisplayComponent(getGenericArticlePropertySheet(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
+ */
+ public static Component getGenericArticlePropertySheet(ItemSelectionModel itemModel) {
+ DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(itemModel);
+
+ sheet.add(GlobalizationUtil.globalize("cms.contenttypes.ui.title"),
+ GenericArticle.TITLE);
+ sheet.add(GlobalizationUtil.globalize("cms.contenttypes.ui.name"),
+ GenericArticle.NAME);
+ if (!ContentSection.getConfig().getHideLaunchDate()) {
+ sheet.add(GlobalizationUtil.globalize("cms.contenttypes.ui.launch_date"),
+ ContentPage.LAUNCH_DATE,
+ new DomainObjectPropertySheet.AttributeFormatter() {
+
+ @Override
+ 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) GlobalizationUtil.globalize(
+ "cms.ui.unknown").localize();
+ }
+ }
+ });
+ }
+ return sheet;
+ }
+}
diff --git a/ccm-cms/src/main/java/com/arsdigita/cms/ui/authoring/AdditionalDisplayComponent.java b/ccm-cms/src/main/java/com/arsdigita/cms/ui/authoring/AdditionalDisplayComponent.java
new file mode 100644
index 000000000..bef38563b
--- /dev/null
+++ b/ccm-cms/src/main/java/com/arsdigita/cms/ui/authoring/AdditionalDisplayComponent.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2007 Chris Gilbert All Rights Reserved.
+ *
+ * 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 com.arsdigita.cms.ui.authoring;
+
+import com.arsdigita.bebop.Component;
+import com.arsdigita.cms.ItemSelectionModel;
+
+/**
+ * class used for decoupled display components that caters for a callback to
+ * provide them with a handle on the ItemSelectionModel
+ *
+ * @author chris.gilbert@westsussex.gov.uk
+ *
+ */
+public interface AdditionalDisplayComponent extends Component {
+
+ public void setItemSelectionModel(ItemSelectionModel model);
+
+}
diff --git a/ccm-cms/src/main/java/com/arsdigita/cms/ui/authoring/SimpleEditStep.java.TODO b/ccm-cms/src/main/java/com/arsdigita/cms/ui/authoring/SimpleEditStep.java.TODO
new file mode 100755
index 000000000..f0cc02112
--- /dev/null
+++ b/ccm-cms/src/main/java/com/arsdigita/cms/ui/authoring/SimpleEditStep.java.TODO
@@ -0,0 +1,311 @@
+/*
+ * Copyright (C) 2001-2004 Red Hat Inc. All Rights Reserved.
+ *
+ * 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 com.arsdigita.cms.ui.authoring;
+
+import com.arsdigita.bebop.Page;
+import com.arsdigita.bebop.PageState;
+import com.arsdigita.bebop.event.ActionEvent;
+import com.arsdigita.bebop.event.ActionListener;
+import com.arsdigita.bebop.event.RequestEvent;
+import com.arsdigita.bebop.event.RequestListener;
+import com.arsdigita.bebop.parameters.StringParameter;
+
+import org.librecms.contentsection.ContentItem;
+
+import com.arsdigita.cms.ItemSelectionModel;
+import com.arsdigita.cms.dispatcher.Utilities;
+import com.arsdigita.cms.ui.ContentItemPage;
+import com.arsdigita.cms.ui.SecurityPropertyEditor;
+import com.arsdigita.toolbox.ui.ComponentAccess;
+import com.arsdigita.toolbox.ui.DomainObjectPropertySheet;
+
+import org.apache.logging.log4j.LogManager;
+
+import java.text.DateFormat;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.logging.log4j.Logger;
+import org.libreccm.core.CcmObject;
+
+/**
+ * A simple implementation of an Authoring Kit editing step. Extends
+ * {@link SecurityPropertyEditor} and provides authoring kit integration. See
+ * the authoring kit documentation for more info.
+ *
+ * Child classes should a). call setDisplayComponent() b). call add() zero or
+ * more times
+ *
+ * @author Stanislav Freidin
+ * @author Jens Pelzetter
+ */
+public class SimpleEditStep extends SecurityPropertyEditor
+ implements AuthoringStepComponent, RequestListener {
+
+ private AuthoringKitWizard authoringKitWizard;
+ private ItemSelectionModel itemSelectionModel;
+ private String defaultEditKey = null;
+
+ private StringParameter streamlinedCreationParameter;
+ private static final String STREAMLINED = "_streamlined";
+ private static final String STREAMLINED_DONE = "1";
+
+ private static List+ * + * The first argument is the visible label for the property, and the second + * argument is the name of the property as it appears in the PDL file. + * + * Instead of specifying the property directly, you may specify the "path" to + * the property. For example, + *+ * DomainObjectPropertySheet mySheet = + * new DomainObjectPropertySheet(myDomainObjectSelectionModel); + * mySheet.add("Name:", ContentPage.NAME); + * mySheet.add("Title:", ContentPage.TITLE); + *
+ * + * The code above tells the+ * mySheet.add("Address Line 1:", "user.address.street"); + *
DomainObjectPropertySheet to look for
+ * the child of the current object named "user"; then look for the child of the
+ * user named "address", and finally to return the property of the address named
+ * "street".
+ *
+ * Note that, by default, DomainObjectPropertySheet retrieves the
+ * values for its properties directly from the underlying {@link DataObject} of
+ * the {@link DomainObject}. This means that the Java getXXX
+ * methods of the DomainObject will never be called. Of course, it
+ * is always possible to create a custom {@link AttributeFormatter} that will
+ * call the appropriate methods.
+ *
+ * @author Stanislav Freidin
+ * @author Peter Boy (localization)
+ * @author Jens Pelzetter
+ */
+public class DomainObjectPropertySheet extends PropertySheet {
+
+ private Listobject.get(attribute).toString()
+ *
+ * In case of associations, however, more complicated processing will be
+ * required.
+ */
+ public interface AttributeFormatter {
+
+ /**
+ * Formatter for the value of an attribute. It has to retrieve the value
+ * for the specified attribute of the object and format it as an string
+ * if it is one already.
+ *
+ * Note: the format method has to be executed at each page request. Take
+ * care to properly adjust globalization and localization inside thes
+ * method and not earlier in one of the classes using it!
+ *
+ * @param obj Object containing the attribute to format.
+ * @param attribute Name of the attribute to retrieve and format
+ * @param state PageState of the request
+ *
+ * @return A String representation of the retrieved attribute of the
+ * domain object.
+ */
+ String format(CcmObject obj, String attribute, PageState state);
+
+ }
+
+ /**
+ * Associates a label with the attribute and the formatter.
+ */
+ protected static class Property {
+
+ private GlobalizedMessage label;
+ private String attribute;
+ private AttributeFormatter formatter;
+
+ /**
+ * Constructor, takes the set of parameter to create a new Property.
+ *
+ * @param label the labal for the attribute
+ * @param attribute the attribute (as String, i.e name of the property)
+ * @param formatter the formatter to convert the attribute a into a
+ * String
+ */
+ public Property(final GlobalizedMessage label,
+ final String attribute,
+ final AttributeFormatter formatter) {
+ this.label = label;
+ this.attribute = attribute;
+ this.formatter = formatter;
+ }
+
+ /**
+ * @deprecated use getGlobalizedLabel instead
+ */
+ public String getLabel() {
+ return label.getKey();
+ }
+
+ /**
+ * Fetch the (globalises) label of the property.
+ *
+ * @return
+ */
+ public GlobalizedMessage getGlobalizedLabel() {
+ return label;
+ }
+
+ /**
+ * Fetch the attribute.
+ *
+ * @return name of the attribute (a String)
+ */
+ public String getAttribute() {
+ return attribute;
+ }
+
+ /**
+ * Fetch the formatter for the attribute
+ *
+ * @return
+ */
+ public AttributeFormatter getFormatter() {
+ return formatter;
+ }
+
+ }
+
+ /**
+ * Build up the object properties model from the iterator over all
+ * properties.
+ */
+ private static class DomainObjectPropertiesModel
+ implements PropertySheetModel {
+
+ private CcmObject object;
+ private PageState pageState;
+ private Iterator