Ergänzung Lokalisation, Module sind nicht einsetzbar/insgesamt nicht fertig.
git-svn-id: https://svn.libreccm.org/ccm/trunk@2229 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
0710003090
commit
c26f5b917d
|
|
@ -7,9 +7,11 @@
|
|||
description="An HTML Form"
|
||||
objectType="com.arsdigita.cms.contenttypes.HTMLForm"
|
||||
classname="com.arsdigita.cms.contenttypes.HTMLForm">
|
||||
|
||||
<ctd:authoring-kit createComponent="com.arsdigita.cms.ui.authoring.PageCreate">
|
||||
<ctd:authoring-step
|
||||
labelKey="cms.contenttypes.shared.basic_properties.title"
|
||||
|
||||
<ctd:authoring-step
|
||||
labelKey="cms.contenttypes.shared.basic_properties.title"
|
||||
labelBundle="com.arsdigita.cms.CMSResources"
|
||||
descriptionKey="cms.contenttypes.shared.basic_properties.description"
|
||||
descriptionBundle="com.arsdigita.cms.CMSResources"
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
<initializer class="com.arsdigita.cms.Initializer"/>
|
||||
</requires>
|
||||
<provides>
|
||||
<table name="ct_htmlform"/>
|
||||
<initializer class="com.arsdigita.cms.contenttypes.HTMLFormInitializer"/>
|
||||
</provides>
|
||||
<scripts>
|
||||
|
|
|
|||
|
|
@ -15,10 +15,10 @@
|
|||
|
||||
package com.arsdigita.cms.contenttypes;
|
||||
|
||||
import com.arsdigita.cms.ContentType;
|
||||
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||
import com.arsdigita.persistence.DataObject;
|
||||
import com.arsdigita.persistence.OID;
|
||||
import com.arsdigita.cms.ContentType;
|
||||
import com.arsdigita.util.Assert;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
|
@ -41,8 +41,7 @@ public class HTMLForm extends GenericArticle {
|
|||
= "com.arsdigita.cms.contenttypes.HTMLForm";
|
||||
|
||||
/** Data object type for this domain object (for CMS compatibility) */
|
||||
public static final String TYPE
|
||||
= BASE_DATA_OBJECT_TYPE;
|
||||
public static final String TYPE = BASE_DATA_OBJECT_TYPE;
|
||||
|
||||
public HTMLForm() {
|
||||
this( BASE_DATA_OBJECT_TYPE );
|
||||
|
|
|
|||
|
|
@ -16,21 +16,33 @@
|
|||
package com.arsdigita.cms.contenttypes;
|
||||
|
||||
/**
|
||||
* Loader.
|
||||
* Loader executes nonrecurring once at install time and loads the
|
||||
* HTMLForm contenttype package persistently into database.
|
||||
*
|
||||
* It uses the base class to create the database schema and the required
|
||||
* table entries for the contenttype.
|
||||
*
|
||||
*
|
||||
* @author Justin Ross <jross@redhat.com>
|
||||
* @version $Id: //ps/apps/london/htmlform/dev/src/com/arsdigita/cms/contenttypes/HTMLFormLoader.java#1 $
|
||||
* @version $Id: HTMLFormLoader.java#1 $
|
||||
*/
|
||||
public class HTMLFormLoader extends AbstractContentTypeLoader {
|
||||
public final static String versionId =
|
||||
"$Id: //ps/apps/london/htmlform/dev/src/com/arsdigita/cms/contenttypes/HTMLFormLoader.java#1 $" +
|
||||
"$Author: mbooth $" +
|
||||
"$DateTime: 2004/03/05 09:47:41 $";
|
||||
|
||||
/** Defines the xml file containing the FAQ content types
|
||||
* property definitions. */
|
||||
private static final String[] TYPES = {
|
||||
"/WEB-INF/content-types/com/arsdigita/cms/contenttypes/HTMLForm.xml"
|
||||
};
|
||||
|
||||
/**
|
||||
* Provides the of HTMLForm contenttype property definitions
|
||||
* implementing the parent's class abstract method.
|
||||
*
|
||||
* The file defines the types name as displayed in content center
|
||||
* select box and the authoring steps. These are loaded into database.
|
||||
*
|
||||
* @return String Atring Array of fully qualified file names
|
||||
*/
|
||||
public String[] getTypes() {
|
||||
return TYPES;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,8 +52,10 @@ public class HTMLFormPropertiesStep extends SimpleEditStep {
|
|||
BasicPageForm editSheet;
|
||||
|
||||
editSheet = new HTMLFormPropertyForm(itemModel, this);
|
||||
add(EDIT_SHEET_NAME, "Edit", new WorkflowLockedComponentAccess(editSheet, itemModel),
|
||||
editSheet.getSaveCancelSection().getCancelButton());
|
||||
add(EDIT_SHEET_NAME,
|
||||
GlobalizationUtil.globalize("cms.ui.edit"),
|
||||
new WorkflowLockedComponentAccess(editSheet, itemModel),
|
||||
editSheet.getSaveCancelSection().getCancelButton());
|
||||
|
||||
setDisplayComponent(getHTMLFormPropertySheet(itemModel));
|
||||
}
|
||||
|
|
@ -69,26 +71,17 @@ public class HTMLFormPropertiesStep extends SimpleEditStep {
|
|||
public static Component getHTMLFormPropertySheet(ItemSelectionModel itemModel) {
|
||||
DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(itemModel);
|
||||
|
||||
sheet.add(GlobalizationUtil.globalize("cms.contenttypes.ui.name"), HTMLForm.NAME);
|
||||
sheet.add(GlobalizationUtil.globalize("cms.contenttypes.ui.title"), HTMLForm.TITLE);
|
||||
sheet.add(GlobalizationUtil.globalize("cms.contenttypes.ui.title"),
|
||||
HTMLForm.TITLE);
|
||||
sheet.add(GlobalizationUtil.globalize("cms.contenttypes.ui.name"),
|
||||
HTMLForm.NAME);
|
||||
if (!ContentSection.getConfig().getHideLaunchDate()) {
|
||||
sheet.add(GlobalizationUtil.globalize("cms.contenttypes.ui.launch_date"),
|
||||
ContentPage.LAUNCH_DATE,
|
||||
new DomainObjectPropertySheet.AttributeFormatter() {
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
});
|
||||
new LaunchDateAttributeFormatter() );
|
||||
}
|
||||
sheet.add(GlobalizationUtil.globalize("cms.contenttypes.ui.lead"), HTMLForm.LEAD);
|
||||
sheet.add(GlobalizationUtil.globalize("cms.contenttypes.ui.lead"),
|
||||
HTMLForm.LEAD);
|
||||
|
||||
return sheet;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,7 +40,10 @@ import com.arsdigita.cms.util.GlobalizationUtil;
|
|||
* Form to edit the basic properties of an HTMLForm. This form can be
|
||||
* extended to create forms for HTMLForm subclasses.
|
||||
*/
|
||||
public class HTMLFormPropertyForm extends BasicPageForm implements FormProcessListener, FormInitListener, FormSubmissionListener {
|
||||
public class HTMLFormPropertyForm extends BasicPageForm
|
||||
implements FormProcessListener,
|
||||
FormInitListener,
|
||||
FormSubmissionListener {
|
||||
|
||||
private final static org.apache.log4j.Logger s_log =
|
||||
org.apache.log4j.Logger.getLogger(HTMLFormPropertyForm.class);
|
||||
|
|
@ -64,7 +67,8 @@ public class HTMLFormPropertyForm extends BasicPageForm implements FormProcessLi
|
|||
* HTMLForm to work on
|
||||
* @param step The HTMLFormPropertiesStep which controls this form.
|
||||
*/
|
||||
public HTMLFormPropertyForm(ItemSelectionModel itemModel, HTMLFormPropertiesStep step) {
|
||||
public HTMLFormPropertyForm(ItemSelectionModel itemModel,
|
||||
HTMLFormPropertiesStep step) {
|
||||
super(ID, itemModel);
|
||||
m_step = step;
|
||||
addSubmissionListener(this);
|
||||
|
|
@ -81,7 +85,10 @@ public class HTMLFormPropertyForm extends BasicPageForm implements FormProcessLi
|
|||
ParameterModel leadParam = new StringParameter(LEAD);
|
||||
|
||||
if (ContentSection.getConfig().mandatoryDescriptions()) {
|
||||
leadParam.addParameterListener(new NotEmptyValidationListener(GlobalizationUtil.globalize("cms.contenttypes.ui.description_missing")));
|
||||
leadParam.addParameterListener(new
|
||||
NotEmptyValidationListener(
|
||||
GlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.description_missing")));
|
||||
}
|
||||
//leadParam
|
||||
// .addParameterListener( new NotNullValidationListener() );
|
||||
|
|
@ -109,7 +116,8 @@ public class HTMLFormPropertyForm extends BasicPageForm implements FormProcessLi
|
|||
/** Cancels streamlined editing. */
|
||||
public void submitted(FormSectionEvent fse) {
|
||||
if (m_step != null
|
||||
&& getSaveCancelSection().getCancelButton().isSelected(fse.getPageState())) {
|
||||
&& getSaveCancelSection()
|
||||
.getCancelButton().isSelected(fse.getPageState())) {
|
||||
m_step.cancelStreamlinedCreation(fse.getPageState());
|
||||
}
|
||||
}
|
||||
|
|
@ -122,7 +130,8 @@ public class HTMLFormPropertyForm extends BasicPageForm implements FormProcessLi
|
|||
|
||||
// save only if save button was pressed
|
||||
if (htmlform != null
|
||||
&& getSaveCancelSection().getSaveButton().isSelected(fse.getPageState())) {
|
||||
&& getSaveCancelSection()
|
||||
.getSaveButton().isSelected(fse.getPageState())) {
|
||||
|
||||
htmlform.setLead((String) data.get(LEAD));
|
||||
htmlform.save();
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ import com.arsdigita.cms.ItemSelectionModel;
|
|||
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
|
||||
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
||||
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
||||
import com.arsdigita.cms.util.GlobalizationUtil;
|
||||
|
||||
public class MemberPropertiesStep extends GenericPersonPropertiesStep {
|
||||
|
||||
|
|
@ -36,9 +37,10 @@ public class MemberPropertiesStep extends GenericPersonPropertiesStep {
|
|||
protected void createEditSheet(ItemSelectionModel itemModel) {
|
||||
BasicPageForm editSheet;
|
||||
editSheet = new MemberPropertyForm(itemModel, this);
|
||||
add(EDIT_SHEET_NAME, "Edit",
|
||||
new WorkflowLockedComponentAccess(editSheet, itemModel), editSheet.
|
||||
getSaveCancelSection().getCancelButton());
|
||||
add(EDIT_SHEET_NAME,
|
||||
GlobalizationUtil.globalize("cms.ui.edit"),
|
||||
new WorkflowLockedComponentAccess(editSheet, itemModel),
|
||||
editSheet.getSaveCancelSection().getCancelButton());
|
||||
}
|
||||
|
||||
public static Component getMemberPropertySheet(ItemSelectionModel itemModel) {
|
||||
|
|
|
|||
|
|
@ -38,21 +38,29 @@ import org.apache.log4j.Logger;
|
|||
*
|
||||
* @author: Jens Pelzetter
|
||||
*/
|
||||
public class MemberPropertyForm
|
||||
extends GenericPersonPropertyForm
|
||||
implements FormProcessListener,
|
||||
FormInitListener,
|
||||
FormSubmissionListener {
|
||||
public class MemberPropertyForm extends GenericPersonPropertyForm
|
||||
implements FormProcessListener,
|
||||
FormInitListener,
|
||||
FormSubmissionListener {
|
||||
|
||||
private static final Logger s_log = Logger.getLogger(
|
||||
MemberPropertyForm.class);
|
||||
private MemberPropertiesStep m_step;
|
||||
public static final String ID = "Member_edit";
|
||||
|
||||
/**
|
||||
*
|
||||
* @param itemModel
|
||||
*/
|
||||
public MemberPropertyForm(ItemSelectionModel itemModel) {
|
||||
this(itemModel, null);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param itemModel
|
||||
* @param step
|
||||
*/
|
||||
public MemberPropertyForm(ItemSelectionModel itemModel,
|
||||
MemberPropertiesStep step) {
|
||||
super(itemModel, step);
|
||||
|
|
@ -65,12 +73,14 @@ public class MemberPropertyForm
|
|||
super.addWidgets();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(FormSectionEvent fse) {
|
||||
super.init(fse);
|
||||
FormData data = fse.getFormData();
|
||||
Member member = (Member) super.initBasicWidgets(fse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void process(FormSectionEvent fse) {
|
||||
super.process(fse);
|
||||
FormData data = fse.getFormData();
|
||||
|
|
|
|||
|
|
@ -23,44 +23,53 @@ import org.apache.log4j.Logger;
|
|||
*/
|
||||
public class ResearchNetworkPropertiesStep extends SimpleEditStep {
|
||||
|
||||
private final static Logger s_log = Logger.getLogger(ResearchNetworkPropertiesStep.class);
|
||||
private final static Logger s_log = Logger.getLogger(
|
||||
ResearchNetworkPropertiesStep.class);
|
||||
public final static String EDIT_SHEET_NAME = "edit";
|
||||
|
||||
public ResearchNetworkPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent) {
|
||||
public ResearchNetworkPropertiesStep(ItemSelectionModel itemModel,
|
||||
AuthoringKitWizard parent) {
|
||||
super(itemModel, parent);
|
||||
|
||||
setDefaultEditKey(EDIT_SHEET_NAME);
|
||||
BasicPageForm editSheet;
|
||||
|
||||
editSheet = new ResearchNetworkPropertyForm(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());
|
||||
|
||||
setDisplayComponent(getResearchNetworkPropertySheet(itemModel));
|
||||
}
|
||||
|
||||
public static Component getResearchNetworkPropertySheet(ItemSelectionModel itemModel) {
|
||||
|
||||
DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(itemModel);
|
||||
|
||||
//Display the properties
|
||||
sheet.add(ResearchNetworkGlobalizationUtil.globalize("cms.contenttypes.researchnetwork.ui.title"), ResearchNetwork.RESEARCHNETWORK_TITLE);
|
||||
sheet.add(ResearchNetworkGlobalizationUtil.globalize("cms.contenttypes.researchnetwork.ui.direction"), ResearchNetwork.RESEARCHNETWORK_DIRECTION);
|
||||
sheet.add(ResearchNetworkGlobalizationUtil.globalize("cms.contenttypes.researchnetwork.ui.coordination"), ResearchNetwork.RESEARCHNETWORK_COORDINATION);
|
||||
sheet.add(ResearchNetworkGlobalizationUtil.globalize("cms.contenttypes.researchnetwork.ui.website"), ResearchNetwork.RESEARCHNETWORK_WEBSITE);
|
||||
sheet.add(ResearchNetworkGlobalizationUtil.globalize("cms.contenttypes.researchnetwork.ui.description"), ResearchNetwork.RESEARCHNETWORK_DESCRIPTION);
|
||||
|
||||
sheet.add(ResearchNetworkGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.researchnetwork.ui.title"),
|
||||
ResearchNetwork.RESEARCHNETWORK_TITLE);
|
||||
if (!ContentSection.getConfig().getHideLaunchDate()) {
|
||||
sheet.add(GlobalizationUtil.globalize("cms.ui.authoring.page_launch_date"), ContentPage.LAUNCH_DATE, new DomainObjectPropertySheet.AttributeFormatter() {
|
||||
|
||||
public String format(DomainObject obj, String attribute, PageState state) {
|
||||
ContentPage page = (ContentPage) obj;
|
||||
if (page.getLaunchDate() != null) {
|
||||
return DateFormat.getDateInstance(DateFormat.LONG).format(page.getLaunchDate());
|
||||
} else {
|
||||
return (String) GlobalizationUtil.globalize("cms.ui.unknown").localize();
|
||||
}
|
||||
}
|
||||
});
|
||||
sheet.add(com.arsdigita.cms.util.GlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.launch_date"),
|
||||
ContentPage.LAUNCH_DATE,
|
||||
new LaunchDateAttributeFormatter() );
|
||||
}
|
||||
sheet.add(ResearchNetworkGlobalizationUtil
|
||||
.globalize("cms.contenttypes.researchnetwork.ui.description"),
|
||||
ResearchNetwork.RESEARCHNETWORK_DESCRIPTION);
|
||||
sheet.add(ResearchNetworkGlobalizationUtil
|
||||
.globalize("cms.contenttypes.researchnetwork.ui.direction"),
|
||||
ResearchNetwork.RESEARCHNETWORK_DIRECTION);
|
||||
sheet.add(ResearchNetworkGlobalizationUtil
|
||||
.globalize("cms.contenttypes.researchnetwork.ui.coordination"),
|
||||
ResearchNetwork.RESEARCHNETWORK_COORDINATION);
|
||||
sheet.add(ResearchNetworkGlobalizationUtil
|
||||
.globalize("cms.contenttypes.researchnetwork.ui.website"),
|
||||
ResearchNetwork.RESEARCHNETWORK_WEBSITE);
|
||||
|
||||
|
||||
return sheet;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,6 +54,12 @@ public class ResearchNetworkPropertyForm extends BasicPageForm implements FormPr
|
|||
researchNetworkTitle.addValidationListener(new NotNullValidationListener());
|
||||
add(researchNetworkTitle);
|
||||
|
||||
add(new Label(ResearchNetworkGlobalizationUtil.globalize("cms.contenttypes.researchnetwork.ui.description")));
|
||||
TextArea researchNetworkAreaDescription = new TextArea(RESEARCHNETWORK_DESCRIPTION);
|
||||
researchNetworkAreaDescription.setRows(10);
|
||||
researchNetworkAreaDescription.setCols(30);
|
||||
add(researchNetworkAreaDescription);
|
||||
|
||||
add(new Label(ResearchNetworkGlobalizationUtil.globalize("cms.contenttypes.researchnetwork.ui.direction")));
|
||||
TextArea researchNetworkDirection = new TextArea(RESEARCHNETWORK_DIRECTION);
|
||||
researchNetworkDirection.setRows(5);
|
||||
|
|
@ -70,12 +76,6 @@ public class ResearchNetworkPropertyForm extends BasicPageForm implements FormPr
|
|||
ParameterModel researchNetworkWebsiteParam = new StringParameter(RESEARCHNETWORK_WEBSITE);
|
||||
TextField researchNetworkWebsite = new TextField(researchNetworkWebsiteParam);
|
||||
add(researchNetworkWebsite);
|
||||
|
||||
add(new Label(ResearchNetworkGlobalizationUtil.globalize("cms.contenttypes.researchnetwork.ui.description")));
|
||||
TextArea researchNetworkAreaDescription = new TextArea(RESEARCHNETWORK_DESCRIPTION);
|
||||
researchNetworkAreaDescription.setRows(10);
|
||||
researchNetworkAreaDescription.setCols(30);
|
||||
add(researchNetworkAreaDescription);
|
||||
}
|
||||
|
||||
public void init(FormSectionEvent e) throws FormProcessException {
|
||||
|
|
|
|||
|
|
@ -19,7 +19,8 @@ import java.math.BigDecimal;
|
|||
|
||||
|
||||
/**
|
||||
* The content type which allows arbitrary assets to be associated to it.
|
||||
* The content type which allows arbitrary assets to be associated to it as
|
||||
* kind of 'body text'.
|
||||
* The associations will be 'compositions'
|
||||
*
|
||||
* @author <a href="mailto:slater@arsdigita.com">Michael Slater</a>
|
||||
|
|
@ -29,14 +30,14 @@ import java.math.BigDecimal;
|
|||
public class FreeformContentItem extends ContentPage {
|
||||
|
||||
/**
|
||||
* Examples of the different MimeTypes this FreeformContentItem
|
||||
* would handle as alternative body assets. Developers would hav
|
||||
* to supply support for any news mimetype added. This would include:
|
||||
* TODO: what are all the tasks a developer needs to do to
|
||||
* Examples of the different MimeTypes this FreeformContentItem
|
||||
* would handle as alternative body assets. Developers would hav
|
||||
* to supply support for any news mimetype added. This would include:
|
||||
* TODO: what are all the tasks a developer needs to do to
|
||||
* add a new mimetype support?
|
||||
*
|
||||
* TODO: this information could be an oracle table
|
||||
**/
|
||||
* TODO: this information could be persisted in a DB table
|
||||
*/
|
||||
public static final String HTML = "Text/Html";
|
||||
public static final String WML = "Text/WirelessHtml";
|
||||
public static final String ADOBE = "Adobe/pdf";
|
||||
|
|
@ -60,7 +61,7 @@ public class FreeformContentItem extends ContentPage {
|
|||
|
||||
/**
|
||||
* Default constructor. This creates a new content page.
|
||||
**/
|
||||
*/
|
||||
public FreeformContentItem() {
|
||||
super(BASE_DATA_OBJECT_TYPE);
|
||||
}
|
||||
|
|
@ -122,9 +123,9 @@ public class FreeformContentItem extends ContentPage {
|
|||
}
|
||||
|
||||
/**
|
||||
* Associate a Freeform[Text|Binary]Asset with this
|
||||
* item and set its rank. Don't handle rank conflicts,
|
||||
* holes here. Handle them in a higher-order method.
|
||||
* Associate a Freeform[Text|Binary]Asset with this item and set its rank.
|
||||
* Don't handle rank conflicts, holes here. Handle them in a higher-order
|
||||
* method.
|
||||
*
|
||||
* @param oneAsset The asset to add
|
||||
* @param rank The rank for the asset. Setting this to 0 will cause
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
package com.arsdigita.london.cms.freeform.assets;
|
||||
package com.arsdigita.london.cms.freeform.asset;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.arsdigita.persistence.OID;
|
||||
|
|
@ -11,7 +11,7 @@ import com.arsdigita.bebop.event.FormSectionEvent;
|
|||
import com.arsdigita.bebop.FormProcessException;
|
||||
|
||||
|
||||
import com.arsdigita.london.cms.freeform.assets.FreeformTextAsset;
|
||||
import com.arsdigita.london.cms.freeform.asset.FreeformTextAsset;
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.bebop.SingleSelectionModel;
|
||||
import com.arsdigita.bebop.form.SingleSelect;
|
||||
|
|
|
|||
Loading…
Reference in New Issue