CT Address

* Verwendet nun ausschließlich die UI von basetypes.Address

 CT fertig



git-svn-id: https://svn.libreccm.org/ccm/trunk@439 8810af33-2d31-482b-a856-94f89814c4df
master
quasi 2010-05-26 06:50:36 +00:00
parent 7e89a378fa
commit 8fde211eba
8 changed files with 109 additions and 225 deletions

View File

@ -1,24 +1,24 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<ccm:application xmlns:ccm="http://ccm.redhat.com/ccm-project" <ccm:application xmlns:ccm="http://ccm.redhat.com/ccm-project"
name="ccm-cms-types-address" name="ccm-cms-types-address"
prettyName="Red Hat CCM Content Types" prettyName="Red Hat CCM Content Types"
version="6.6.0" version="6.6.0"
release="1" release="1"
webapp="ROOT"> webapp="ROOT">
<ccm:dependencies> <ccm:dependencies>
<ccm:requires name="ccm-core" version="6.6.0" relation="ge"/> <ccm:requires name="ccm-core" version="6.6.0" relation="ge"/>
<ccm:requires name="ccm-cms" version="6.6.0" relation="ge"/> <ccm:requires name="ccm-cms" version="6.6.0" relation="ge"/>
</ccm:dependencies> </ccm:dependencies>
<ccm:directories> <ccm:directories>
<ccm:directory name="pdl"/> <ccm:directory name="pdl"/>
<ccm:directory name="sql"/> <ccm:directory name="sql"/>
<ccm:directory name="src"/> <ccm:directory name="src"/>
</ccm:directories> </ccm:directories>
<ccm:contacts> <ccm:contacts>
<ccm:contact uri="http://www.redhat.com/software/rhea" type="website"/> <ccm:contact uri="http://www.redhat.com/software/rhea" type="website"/>
<ccm:contact uri="mailto:rhea@redhat.com" type="support"/> <ccm:contact uri="mailto:rhea@redhat.com" type="support"/>
</ccm:contacts> </ccm:contacts>
<ccm:description> <ccm:description>
The Address Content Type for the Red Hat CCM CMS. The Address Content Type for the Red Hat CCM CMS.
</ccm:description> </ccm:description>
</ccm:application> </ccm:application>

View File

@ -2,27 +2,27 @@
<ctd:content-types xmlns:ctd="http://xmlns.redhat.com/cms/content-types" <ctd:content-types xmlns:ctd="http://xmlns.redhat.com/cms/content-types"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.redhat.com/cms/content-types content-types.xsd"> xsi:schemaLocation="http://xmlns.redhat.com/cms/content-types content-types.xsd">
<ctd:content-type <ctd:content-type
label="Address" label="Address"
description="An Address type" description="An Address type"
objectType="com.arsdigita.cms.contenttypes.Address" objectType="com.arsdigita.cms.contenttypes.Address"
classname="com.arsdigita.cms.contenttypes.Address"> classname="com.arsdigita.cms.contenttypes.Address">
<ctd:authoring-kit <ctd:authoring-kit
createComponent="com.arsdigita.cms.ui.authoring.PageCreate"> createComponent="com.arsdigita.cms.ui.authoring.PageCreate">
<ctd:authoring-step <ctd:authoring-step
labelKey="address.authoring.basic_properties.title" labelKey="address.authoring.basic_properties.title"
labelBundle="com.arsdigita.cms.basetypes.BasetypesResources" labelBundle="com.arsdigita.cms.basetypes.BasetypesResources"
descriptionKey="address.authoring.basic_properties.description" descriptionKey="address.authoring.basic_properties.description"
descriptionBundle="com.arsdigita.cms.basetypes.BasetypesResources" descriptionBundle="com.arsdigita.cms.basetypes.BasetypesResources"
component="com.arsdigita.cms.contenttypes.ui.AddressPropertiesStep" component="com.arsdigita.cms.basetypes.ui.AddressPropertiesStep"
ordering="1"/> ordering="1"/>
<ctd:include href="/WEB-INF/content-types/assign-categories-step.xml"/> <ctd:include href="/WEB-INF/content-types/assign-categories-step.xml"/>
</ctd:authoring-kit> </ctd:authoring-kit>
</ctd:content-type> </ctd:content-type>
</ctd:content-types> </ctd:content-types>

View File

@ -18,15 +18,12 @@
*/ */
package com.arsdigita.cms.contenttypes; package com.arsdigita.cms.contenttypes;
import com.arsdigita.globalization.LocaleNegotiator;
import com.arsdigita.cms.ContentType; import com.arsdigita.cms.ContentType;
import com.arsdigita.domain.DataObjectNotFoundException; import com.arsdigita.domain.DataObjectNotFoundException;
import com.arsdigita.persistence.DataObject; import com.arsdigita.persistence.DataObject;
import com.arsdigita.persistence.OID; import com.arsdigita.persistence.OID;
import com.arsdigita.util.Assert; import com.arsdigita.util.Assert;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Locale;
import java.util.TreeMap;
/** /**
* <p><code>DomainObject</code> class to represent address <code>ContentType</code> * <p><code>DomainObject</code> class to represent address <code>ContentType</code>

View File

@ -12,14 +12,13 @@ public class AddressInitializer extends ContentTypeInitializer {
public AddressInitializer() { public AddressInitializer() {
super("ccm-cms-types-address.pdl.mf", super("ccm-cms-types-address.pdl.mf",
Address.BASE_DATA_OBJECT_TYPE); Address.BASE_DATA_OBJECT_TYPE);
} }
@Override @Override
public String[] getStylesheets() { public String[] getStylesheets() {
return new String[] { return new String[]{
"/static/content-types/com/arsdigita/cms/contenttypes/Address.xsl" "/static/content-types/com/arsdigita/cms/contenttypes/Address.xsl"
}; };
} }
} }

View File

@ -13,5 +13,4 @@ public class AddressLoader extends AbstractContentTypeLoader {
public String[] getTypes() { public String[] getTypes() {
return TYPES; return TYPES;
} }
} }

View File

@ -1,47 +0,0 @@
/*
* Copyright (C) 2009 Jens Pelzetter, for the Center of Social Politics of 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
* 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.cms.ItemSelectionModel;
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
import com.arsdigita.cms.ui.authoring.BasicPageForm;
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
public class AddressPropertiesStep extends com.arsdigita.cms.basetypes.ui.AddressPropertiesStep {
public static final String EDIT_SHEET_NAME = "edit";
public AddressPropertiesStep(ItemSelectionModel itemModel,
AuthoringKitWizard parent) {
super(itemModel, parent);
}
@Override
protected void createEditSheet(ItemSelectionModel itemModel) {
BasicPageForm editSheet;
editSheet = new AddressPropertyForm(itemModel, this);
add(EDIT_SHEET_NAME, "Edit", new WorkflowLockedComponentAccess(editSheet, itemModel), editSheet.getSaveCancelSection().getCancelButton());
}
public static Component getAddressPropertySheet(ItemSelectionModel itemModel) {
return com.arsdigita.cms.basetypes.ui.AddressPropertiesStep.getAddressPropertySheet(itemModel);
}
}

View File

@ -1,64 +0,0 @@
/*
* Copyright (C) 2009 Jens Pelzetter, for the Center of Social Politics of 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
* 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.event.FormInitListener;
import com.arsdigita.bebop.event.FormProcessListener;
import com.arsdigita.bebop.event.FormSectionEvent;
import com.arsdigita.bebop.event.FormSubmissionListener;
import com.arsdigita.cms.ItemSelectionModel;
import org.apache.log4j.Logger;
/**
* Form to edit the properties of an address.
*
* @author: Jens Pelzetter
* @author: Sören Bernstein
*/
public class AddressPropertyForm extends com.arsdigita.cms.basetypes.ui.AddressPropertyForm implements FormProcessListener, FormInitListener, FormSubmissionListener {
private static final Logger s_log = Logger.getLogger(AddressPropertyForm.class);
private AddressPropertiesStep m_step;
public static final String ID = "Address_edit";
public AddressPropertyForm(ItemSelectionModel itemModel) {
this(itemModel, null);
}
public AddressPropertyForm(ItemSelectionModel itemModel, AddressPropertiesStep step) {
super(itemModel, step);
m_step = step;
addSubmissionListener(this);
}
@Override
protected void addWidgets() {
super.addWidgets();
}
@Override
public void init(FormSectionEvent fse) {
super.init(fse);
}
@Override
public void process(FormSectionEvent fse) {
super.process(fse);
}
}

View File

@ -6,66 +6,66 @@
xmlns:cms="http://www.arsdigita.com/cms/1.0" xmlns:cms="http://www.arsdigita.com/cms/1.0"
version="1.0"> version="1.0">
<xsl:template match="cms:item[objectType='com.arsdigita.cms.contenttypes.Address']" mode="cms:CT_graphics" <xsl:template match="cms:item[objectType='com.arsdigita.cms.contenttypes.Address']" mode="cms:CT_graphics"
name="cms:CT_graphics_com_arsdigita_cms_contenttypes_Address"> name="cms:CT_graphics_com_arsdigita_cms_contenttypes_Address">
<table width="435" border="0" cellspacing="0" cellpadding="0"> <table width="435" border="0" cellspacing="0" cellpadding="0">
<tr> <tr>
<td class="contentTitle" align="left" valign="top"> <td class="contentTitle" align="left" valign="top">
<xsl:value-of select="./title"/> <xsl:value-of select="./title"/>
</td> </td>
</tr> </tr>
<tr> <tr>
<td> <td>
<table width="100%" border="0" cellspacing="0" cellpadding="0"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
<xsl:if test="./address"> <xsl:if test="./address">
<tr> <tr>
<th>Address:</th> <th>Address:</th>
<td class="contentText" valign="top" align="left"><xsl:value-of select="./address"/></td> <td class="contentText" valign="top" align="left"><xsl:value-of select="./address"/></td>
</tr> </tr>
</xsl:if> </xsl:if>
<xsl:if test="./postalCode"> <xsl:if test="./postalCode">
<tr> <tr>
<th>Postal Code:</th> <th>Postal Code:</th>
<td class="contentText" valign="top" align="left"><xsl:value-of select="./postalCode"/></td> <td class="contentText" valign="top" align="left"><xsl:value-of select="./postalCode"/></td>
</tr> </tr>
</xsl:if> </xsl:if>
<xsl:if test="./city"> <xsl:if test="./city">
<tr> <tr>
<th>City:</th> <th>City:</th>
<td class="contentText" valign="top" align="left"><xsl:value-of select="./city"/></td> <td class="contentText" valign="top" align="left"><xsl:value-of select="./city"/></td>
</tr> </tr>
</xsl:if> </xsl:if>
<xsl:if test="./isoCountryCode/countryName"> <xsl:if test="./isoCountryCode/countryName">
<tr> <tr>
<th>Country:</th> <th>Country:</th>
<td class="contentText" valign="top" align="left"><xsl:value-of select="./country"/></td> <td class="contentText" valign="top" align="left"><xsl:value-of select="./country"/></td>
</tr> </tr>
</xsl:if> </xsl:if>
</table> </table>
</td> </td>
</tr> </tr>
</table> </table>
</xsl:template> </xsl:template>
<xsl:template match="cms:item[objectType='com.arsdigita.cms.contenttypes.Address']" mode="cms:CT_text" <xsl:template match="cms:item[objectType='com.arsdigita.cms.contenttypes.Address']" mode="cms:CT_text"
name="cms:CT_text_com_arsdigita_cms_contenttypes_Address"> name="cms:CT_text_com_arsdigita_cms_contenttypes_Address">
<h1 class="title"><xsl:value-of select="./title"/></h1> <h1 class="title"><xsl:value-of select="./title"/></h1>
<xsl:if test="./address"> <xsl:if test="./address">
<span class="subtitle">Address</span> <span class="subtitle">Address</span>
<span class="text"><xsl:value-of select="./address"/></span><br/> <span class="text"><xsl:value-of select="./address"/></span><br/>
</xsl:if> </xsl:if>
<xsl:if test="./postalCode"> <xsl:if test="./postalCode">
<span class="subtitle">Postal Code</span> <span class="subtitle">Postal Code</span>
<span class="text"><xsl:value-of select="./postalCode"/></span><br/> <span class="text"><xsl:value-of select="./postalCode"/></span><br/>
</xsl:if> </xsl:if>
<xsl:if test="./city"> <xsl:if test="./city">
<span class="subtitle">City</span> <span class="subtitle">City</span>
<span class="text"><xsl:value-of select="./city"/></span><br/> <span class="text"><xsl:value-of select="./city"/></span><br/>
</xsl:if> </xsl:if>
<xsl:if test="./isoCountryCode/countryName"> <xsl:if test="./isoCountryCode/countryName">
<span class="subtitle">Country</span> <span class="subtitle">Country</span>
<span class="text"><xsl:value-of select="./country"/></span><br/> <span class="text"><xsl:value-of select="./country"/></span><br/>
</xsl:if> </xsl:if>
</xsl:template> </xsl:template>
</xsl:stylesheet> </xsl:stylesheet>