HTMLForm content type deleted from trunk
git-svn-id: https://svn.libreccm.org/ccm/trunk@2402 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
e5e5707394
commit
5b78576107
|
|
@ -1,62 +0,0 @@
|
|||
#Fri May 04 16:16:11 CEST 2007
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.4
|
||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
||||
org.eclipse.jdt.core.compiler.compliance=1.4
|
||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.deprecation=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
|
||||
org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
|
||||
org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
|
||||
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
|
||||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
|
||||
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
|
||||
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
|
||||
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
|
||||
org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
|
||||
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
|
||||
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.nullReference=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
|
||||
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
|
||||
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
|
||||
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
|
||||
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.unusedImport=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unusedLabel=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unusedLocal=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
|
||||
org.eclipse.jdt.core.compiler.source=1.4
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
#Mon Apr 30 16:18:18 CEST 2007
|
||||
eclipse.preferences.version=1
|
||||
internal.default.compliance=user
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<ccm:application xmlns:ccm="http://ccm.redhat.com/ccm-project"
|
||||
name="ccm-cms-types-htmlform"
|
||||
prettyName="Red Hat CCM Content Types"
|
||||
version="6.6.0"
|
||||
release="1"
|
||||
webapp="ROOT">
|
||||
<ccm:dependencies>
|
||||
<ccm:requires name="ccm-core" version="6.6.0" relation="ge"/>
|
||||
<ccm:requires name="ccm-cms" version="6.6.0" relation="ge"/>
|
||||
</ccm:dependencies>
|
||||
<ccm:directories>
|
||||
<ccm:directory name="pdl"/>
|
||||
<ccm:directory name="src"/>
|
||||
</ccm:directories>
|
||||
<ccm:contacts>
|
||||
<ccm:contact uri="http://www.redhat.com/software/ccm" type="website"/>
|
||||
<ccm:contact uri="mailto:ccm@redhat.com" type="support"/>
|
||||
</ccm:contacts>
|
||||
<ccm:description>
|
||||
The HTML For Content Type for the Red Hat CCM CMS.
|
||||
</ccm:description>
|
||||
</ccm:application>
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
//
|
||||
// Copyright (C) 2001, 2002, 2003 Red Hat Inc. All Rights Reserved.
|
||||
//
|
||||
// The contents of this file are subject to the CCM Public
|
||||
// License (the "License"); you may not use this file except in
|
||||
// compliance with the License. You may obtain a copy of
|
||||
// the License at http://www.redhat.com/licenses/ccmpl.html
|
||||
//
|
||||
// Software distributed under the License is distributed on an "AS
|
||||
// IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
// implied. See the License for the specific language governing
|
||||
// rights and limitations under the License.
|
||||
//
|
||||
// $Id: //ps/apps/london/htmlform/dev/pdl/com/arsdigita/cms/contenttypes/HTMLForm.pdl#1 $
|
||||
// $DateTime: 2004/03/05 09:47:41 $
|
||||
|
||||
model com.arsdigita.cms.contenttypes;
|
||||
|
||||
|
||||
object type HTMLForm extends GenericArticle {
|
||||
String [0..1] lead = ct_htmlform.lead VARCHAR(1000);
|
||||
|
||||
reference key (ct_htmlform.item_id);
|
||||
}
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ctd:content-types xmlns:ctd="http://xmlns.redhat.com/cms/content-types"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://xmlns.redhat.com/cms/content-types content-types.xsd">
|
||||
|
||||
<ctd:content-type label="HTML Form"
|
||||
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"
|
||||
labelBundle="com.arsdigita.cms.CMSResources"
|
||||
descriptionKey="cms.contenttypes.shared.basic_properties.description"
|
||||
descriptionBundle="com.arsdigita.cms.CMSResources"
|
||||
component="com.arsdigita.cms.contenttypes.ui.HTMLFormPropertiesStep"/>
|
||||
|
||||
<ctd:include href="/WEB-INF/content-types/edit-body-text-step.xml"/>
|
||||
|
||||
<ctd:include href="/WEB-INF/content-types/assign-categories-step.xml"/>
|
||||
</ctd:authoring-kit>
|
||||
</ctd:content-type>
|
||||
|
||||
</ctd:content-types>
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<registry>
|
||||
<!-- nothing yet -->
|
||||
</registry>
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
<load>
|
||||
<requires>
|
||||
<table name="inits"/>
|
||||
<table name="acs_objects"/>
|
||||
<table name="cms_items"/>
|
||||
<initializer class="com.arsdigita.cms.Initializer"/>
|
||||
</requires>
|
||||
<provides>
|
||||
<table name="ct_htmlform"/>
|
||||
<initializer class="com.arsdigita.cms.contenttypes.HTMLFormInitializer"/>
|
||||
</provides>
|
||||
<scripts>
|
||||
<data class="com.arsdigita.cms.contenttypes.HTMLFormLoader"/>
|
||||
</scripts>
|
||||
</load>
|
||||
|
|
@ -1,91 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2001, 2002, 2003 Red Hat Inc. All Rights Reserved.
|
||||
*
|
||||
* The contents of this file are subject to the CCM Public
|
||||
* License (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.redhat.com/licenses/ccmpl.html
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
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.util.Assert;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* This content type represents an article.
|
||||
*
|
||||
* @version $Revision: #1 $ $Date: 2004/03/05 $
|
||||
*/
|
||||
public class HTMLForm extends GenericArticle {
|
||||
|
||||
private final static org.apache.log4j.Logger s_log =
|
||||
org.apache.log4j.Logger.getLogger(HTMLForm.class);
|
||||
|
||||
/** PDL property name for lead */
|
||||
public static final String LEAD = "lead";
|
||||
|
||||
/** Data object type for this domain object */
|
||||
public static final String BASE_DATA_OBJECT_TYPE
|
||||
= "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 HTMLForm() {
|
||||
this( BASE_DATA_OBJECT_TYPE );
|
||||
}
|
||||
|
||||
public HTMLForm( BigDecimal id )
|
||||
throws DataObjectNotFoundException {
|
||||
this( new OID( BASE_DATA_OBJECT_TYPE, id ) );
|
||||
}
|
||||
|
||||
public HTMLForm( OID id )
|
||||
throws DataObjectNotFoundException {
|
||||
super( id );
|
||||
}
|
||||
|
||||
public HTMLForm( DataObject obj ) {
|
||||
super( obj );
|
||||
}
|
||||
|
||||
public HTMLForm( String type ) {
|
||||
super( type );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeSave() {
|
||||
super.beforeSave();
|
||||
|
||||
Assert.exists(getContentType(), ContentType.class);
|
||||
}
|
||||
|
||||
public String getLead() {
|
||||
return (String) get( LEAD );
|
||||
}
|
||||
|
||||
public void setLead( String lead ) {
|
||||
set( LEAD, lead );
|
||||
}
|
||||
|
||||
public static final int SUMMARY_LENGTH = 200;
|
||||
@Override
|
||||
public String getSearchSummary() {
|
||||
return com.arsdigita.util.StringUtils.truncateString(getLead(),
|
||||
SUMMARY_LENGTH,
|
||||
true);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,60 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2001, 2002, 2003 Red Hat Inc. All Rights Reserved.
|
||||
*
|
||||
* The contents of this file are subject to the CCM Public
|
||||
* License (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.redhat.com/licenses/ccmpl.html
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.arsdigita.cms.contenttypes;
|
||||
|
||||
|
||||
/**
|
||||
* Executes at each system startup and initializes the HTMLForm content type.
|
||||
*
|
||||
* Defines the content type specific properties and just uses the super class
|
||||
* methods to register the content type with the (transient) content type store
|
||||
* (map). This is done by runtimeRuntime startup method which runs the init()
|
||||
* methods of all initializers (this one just using the parent implementation).
|
||||
*
|
||||
*
|
||||
* @author Justin Ross <jross@redhat.com>
|
||||
* @version $Id: com/arsdigita/cms/contenttypes/HTMLFormInitializer.java#2 $
|
||||
*/
|
||||
public class HTMLFormInitializer extends ContentTypeInitializer {
|
||||
|
||||
/**
|
||||
* Constructor, sets the PDL manifest file and object type string.
|
||||
*/
|
||||
public HTMLFormInitializer() {
|
||||
super("ccm-cms-types-htmlform.pdl.mf", HTMLForm.BASE_DATA_OBJECT_TYPE);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Retrieve location of this content type's internal default theme
|
||||
* stylesheet(s) which concomitantly serve as a fallback if a custom theme
|
||||
* is engaged.
|
||||
*
|
||||
* Custom themes usually will provide their own stylesheet(s) and their own
|
||||
* access method, but may not support every content type.
|
||||
*
|
||||
* Overwrites parent method with AgendaItem specific value for use by the
|
||||
* parent class worker methods.
|
||||
*
|
||||
* @return String array of XSL stylesheet files of the internal default theme
|
||||
*/
|
||||
@Override
|
||||
public String[] getStylesheets() {
|
||||
return new String[] {
|
||||
// "/static/content-types/com/arsdigita/cms/contenttypes/HTMLForm.xsl" };
|
||||
INTERNAL_THEME_TYPES_DIR + "HTMLForm.xsl" };
|
||||
}
|
||||
}
|
||||
|
|
@ -1,49 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2001, 2002, 2003 Red Hat Inc. All Rights Reserved.
|
||||
*
|
||||
* The contents of this file are subject to the CCM Public
|
||||
* License (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.redhat.com/licenses/ccmpl.html
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.arsdigita.cms.contenttypes;
|
||||
|
||||
/**
|
||||
* 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: HTMLFormLoader.java#1 $
|
||||
*/
|
||||
public class HTMLFormLoader extends AbstractContentTypeLoader {
|
||||
|
||||
/** 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;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,88 +0,0 @@
|
|||
/*
|
||||
* 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.HTMLForm;
|
||||
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 HTMLForm content
|
||||
* type (and its subclasses). The attributes edited are 'name', 'title'
|
||||
* and 'lead'. This authoring step replaces
|
||||
* the <code>com.arsdigita.ui.authoring.PageEdit</code> step for this type.
|
||||
*/
|
||||
public class HTMLFormPropertiesStep extends SimpleEditStep {
|
||||
|
||||
/** The name of the editing sheet added to this step */
|
||||
public static String EDIT_SHEET_NAME = "edit";
|
||||
|
||||
public HTMLFormPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent) {
|
||||
super(itemModel, parent);
|
||||
|
||||
setDefaultEditKey(EDIT_SHEET_NAME);
|
||||
|
||||
BasicPageForm editSheet;
|
||||
|
||||
editSheet = new HTMLFormPropertyForm(itemModel, this);
|
||||
add(EDIT_SHEET_NAME,
|
||||
GlobalizationUtil.globalize("cms.ui.edit"),
|
||||
new WorkflowLockedComponentAccess(editSheet, itemModel),
|
||||
editSheet.getSaveCancelSection().getCancelButton());
|
||||
|
||||
setDisplayComponent(getHTMLFormPropertySheet(itemModel));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a component that displays the properties of the
|
||||
* HTMLForm 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 getHTMLFormPropertySheet(ItemSelectionModel itemModel) {
|
||||
DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(itemModel);
|
||||
|
||||
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 LaunchDateAttributeFormatter() );
|
||||
}
|
||||
sheet.add(GlobalizationUtil.globalize("cms.contenttypes.ui.lead"),
|
||||
HTMLForm.LEAD);
|
||||
|
||||
return sheet;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,143 +0,0 @@
|
|||
/*
|
||||
* 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.FormData;
|
||||
import com.arsdigita.bebop.FormProcessException;
|
||||
import com.arsdigita.bebop.Label;
|
||||
import com.arsdigita.bebop.event.FormInitListener;
|
||||
import com.arsdigita.bebop.event.FormProcessListener;
|
||||
import com.arsdigita.bebop.event.FormSubmissionListener;
|
||||
import com.arsdigita.bebop.event.FormSectionEvent;
|
||||
import com.arsdigita.bebop.form.TextArea;
|
||||
import com.arsdigita.bebop.parameters.NotEmptyValidationListener;
|
||||
import com.arsdigita.bebop.parameters.ParameterModel;
|
||||
import com.arsdigita.bebop.parameters.StringInRangeValidationListener;
|
||||
import com.arsdigita.bebop.parameters.StringParameter;
|
||||
import com.arsdigita.cms.ContentSection;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contenttypes.HTMLForm;
|
||||
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
||||
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 {
|
||||
|
||||
private final static org.apache.log4j.Logger s_log =
|
||||
org.apache.log4j.Logger.getLogger(HTMLFormPropertyForm.class);
|
||||
private HTMLFormPropertiesStep m_step;
|
||||
public static final String LEAD = "lead";
|
||||
|
||||
/**
|
||||
* Creates a new form to edit the HTMLForm object specified
|
||||
* by the item selection model passed in.
|
||||
* @param itemModel The ItemSelectionModel to use to obtain the
|
||||
* HTMLForm to work on
|
||||
*/
|
||||
public HTMLFormPropertyForm(ItemSelectionModel itemModel) {
|
||||
this(itemModel, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new form to edit the HTMLForm object specified
|
||||
* by the item selection model passed in.
|
||||
* @param itemModel The ItemSelectionModel to use to obtain the
|
||||
* HTMLForm to work on
|
||||
* @param step The HTMLFormPropertiesStep which controls this form.
|
||||
*/
|
||||
public HTMLFormPropertyForm(ItemSelectionModel itemModel,
|
||||
HTMLFormPropertiesStep step) {
|
||||
super(ID, itemModel);
|
||||
m_step = step;
|
||||
addSubmissionListener(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds widgets to the form.
|
||||
*/
|
||||
@Override
|
||||
protected void addWidgets() {
|
||||
super.addWidgets();
|
||||
|
||||
add(new Label(GlobalizationUtil.globalize("cms.contenttypes.ui.lead")));
|
||||
ParameterModel leadParam = new StringParameter(LEAD);
|
||||
|
||||
if (ContentSection.getConfig().mandatoryDescriptions()) {
|
||||
leadParam.addParameterListener(new
|
||||
NotEmptyValidationListener(
|
||||
GlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.description_missing")));
|
||||
}
|
||||
//leadParam
|
||||
// .addParameterListener( new NotNullValidationListener() );
|
||||
leadParam.addParameterListener(new StringInRangeValidationListener(0, 1000));
|
||||
TextArea lead = new TextArea(leadParam);
|
||||
lead.setCols(40);
|
||||
lead.setRows(5);
|
||||
add(lead);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate(FormSectionEvent e) throws FormProcessException {
|
||||
super.validate(e);
|
||||
}
|
||||
|
||||
/** Form initialisation hook. Fills widgets with data. */
|
||||
public void init(FormSectionEvent fse) {
|
||||
// Do some initialization hook stuff
|
||||
FormData data = fse.getFormData();
|
||||
HTMLForm htmlform = (HTMLForm) super.initBasicWidgets(fse);
|
||||
|
||||
data.put(LEAD, htmlform.getLead());
|
||||
}
|
||||
|
||||
/** 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 Event object. */
|
||||
public void process(FormSectionEvent fse) {
|
||||
FormData data = fse.getFormData();
|
||||
|
||||
HTMLForm htmlform = (HTMLForm) super.processBasicWidgets(fse);
|
||||
|
||||
// save only if save button was pressed
|
||||
if (htmlform != null
|
||||
&& getSaveCancelSection()
|
||||
.getSaveButton().isSelected(fse.getPageState())) {
|
||||
|
||||
htmlform.setLead((String) data.get(LEAD));
|
||||
htmlform.save();
|
||||
}
|
||||
if (m_step != null) {
|
||||
m_step.maybeForwardToNextStep(fse.getPageState());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
<!DOCTYPE stylesheet [
|
||||
<!ENTITY nbsp " " ><!-- no-break space = non-breaking space, U+00A0 ISOnum -->
|
||||
]>
|
||||
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:cms="http://www.arsdigita.com/cms/1.0"
|
||||
version="1.0">
|
||||
|
||||
<xsl:template match="cms:item[objectType='com.arsdigita.cms.contenttypes.HTMLForm']" mode="cms:CT_graphics"
|
||||
name="cms:CT_graphics_com_arsdigita_cms_contenttypes_HTMLForm">
|
||||
<table width="435" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td width="435" align="left" valign="top">
|
||||
<table width="435" border="0" cellspacing="1" cellpadding="0">
|
||||
<tr>
|
||||
<td class="contentTitle" align="left" valign="top">
|
||||
<xsl:value-of select="./title"/>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="contentSynopsis" align="left" valign="top">
|
||||
<xsl:value-of select="./lead"/>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="contentText" align="left" valign="top">
|
||||
<br/><xsl:value-of disable-output-escaping="yes" select="./textAsset/content"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="cms:item[objectType='com.arsdigita.cms.contenttypes.HTMLForm']" mode="cms:CT_text"
|
||||
name="cms:CT_text_com_arsdigita_cms_contenttypes_HTMLForm">
|
||||
<h1 class="mainTitle">HTMLForm <xsl:text disable-output-escaping="yes">&</xsl:text>gt; <xsl:value-of select="./title"/></h1>
|
||||
<span class="synopsis"><xsl:value-of select="./lead" /></span><br />
|
||||
<br/>
|
||||
<span class="text"><xsl:value-of disable-output-escaping="yes" select="./textAsset/content"/></span>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
Loading…
Reference in New Issue