baseAddress zu Address umbenannt. Läßt sich nicht mehr zusammen mit oldaddress installieren

Restliche Dateien

git-svn-id: https://svn.libreccm.org/ccm/trunk@431 8810af33-2d31-482b-a856-94f89814c4df
master
quasi 2010-05-20 10:58:56 +00:00
parent fce6e1c6fa
commit 002897dd97
8 changed files with 273 additions and 57 deletions

View File

@ -0,0 +1,114 @@
/*
* 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;
import com.arsdigita.globalization.LocaleNegotiator;
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;
import java.util.Locale;
import java.util.TreeMap;
/**
* <p><code>DomainObject</code> class to represent address <code>ContentType</code>
* objects.
* <br />
* This content type represents a generic address which is not country specific.
* It provides methods for creating new address objects, retrieving existing
* objects from the persistent storage and retrieving and setting is properties.</p>
* <p>This class extends {@link com.arsdigita.cms.ContentItem content item} and
* adds extended attributes specific for an not country specific address:</p>
*
* @author Sören Bernstein
**/
public class Address extends com.arsdigita.cms.basetypes.Address {
/** Data object type for this domain object */
public static final String BASE_DATA_OBJECT_TYPE = "com.arsdigita.cms.contenttypes.Address";
/**
* Default constructor. This creates a new (empty) Address.
**/
public Address() {
this(BASE_DATA_OBJECT_TYPE);
}
/**
* Constructor. The contained <code>DataObject</code> is retrieved
* from the persistent storage mechanism with an <code>OID</code>
* specified by <i>id</i> and
* <code>Address.BASE_DATA_OBJECT_TYPE</code>.
*
* @param id The <code>id</code> for the retrieved
* <code>DataObject</code>.
**/
public Address(BigDecimal id) throws DataObjectNotFoundException {
this(new OID(BASE_DATA_OBJECT_TYPE, id));
}
/**
* Constructor. The contained <code>DataObject</code> is retrieved
* from the persistent storage mechanism with an <code>OID</code>
* specified by <i>id</i>.
*
* @param id The <code>OID</code> for the retrieved
* <code>DataObject</code>.
**/
public Address(OID id) throws DataObjectNotFoundException {
super(id);
}
/**
* Constructor. Retrieves or creates a content item using the
* <code>DataObject</code> argument.
*
* @param obj The <code>DataObject</code> with which to create or
* load a content item
*/
public Address(DataObject obj) {
super(obj);
}
/**
* Constructor. Creates a new content item using the given data
* object type. Such items are created as draft versions.
*
* @param type The <code>String</code> data object type of the
* item to create
*/
public Address(String type) {
super(type);
}
/**
* For new content items, sets the associated content type if it
* has not been already set.
*/
@Override
public void beforeSave() {
super.beforeSave();
Assert.exists(getContentType(), ContentType.class);
}
/* accessors *****************************************************/
}

View File

@ -0,0 +1,25 @@
package com.arsdigita.cms.contenttypes;
import org.apache.log4j.Logger;
/**
* The CMS initializer
*
*/
public class AddressInitializer extends ContentTypeInitializer {
private static final Logger s_log = Logger.getLogger(AddressInitializer.class);
public AddressInitializer() {
super("ccm-cms-types-address.pdl.mf",
Address.BASE_DATA_OBJECT_TYPE);
}
@Override
public String[] getStylesheets() {
return new String[] {
"/static/content-types/com/arsdigita/cms/contenttypes/Address.xsl"
};
}
}

View File

@ -0,0 +1,17 @@
package com.arsdigita.cms.contenttypes;
/**
* Loader
*
*/
public class AddressLoader extends AbstractContentTypeLoader {
private static final String[] TYPES = {
"/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Address.xml"
};
public String[] getTypes() {
return TYPES;
}
}

View File

@ -1,27 +0,0 @@
package com.arsdigita.cms.contenttypes;
import org.apache.log4j.Logger;
/**
* The CMS initializer
*
*/
public class BaseAddressInitializer extends ContentTypeInitializer {
public final static String versionId =
"$Id: BaseAddressInitializer.java $" +
"$Author: quasi $" +
"$DateTime: 2009/03/15 $";
private static final Logger s_log = Logger.getLogger(BaseAddressInitializer.class);
public BaseAddressInitializer() {
super("ccm-cms-types-baseAddress.pdl.mf",
BaseAddress.BASE_DATA_OBJECT_TYPE);
}
public String[] getStylesheets() {
return new String[] {
"/static/content-types/com/arsdigita/cms/contenttypes/BaseAddress.xsl"
};
}
}

View File

@ -1,25 +0,0 @@
package com.arsdigita.cms.contenttypes;
import com.arsdigita.cms.contenttypes.AbstractContentTypeLoader;
/**
* Loader
*
*/
public class BaseAddressLoader extends AbstractContentTypeLoader {
public final static String versionId =
"$Id: BaseAddressLoader.java$" +
"$Author: quasi $" +
"$DateTime: 2009/03/15 $";
private static final String[] TYPES = {
"/WEB-INF/content-types/com/arsdigita/cms/contenttypes/BaseAddress.xml"
};
public String[] getTypes() {
return TYPES;
}
}

View File

@ -0,0 +1,48 @@
/*
* 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) {
Component sheet = AddressPropertiesStep.getAddressPropertySheet(itemModel);
return sheet;
}
}

View File

@ -0,0 +1,64 @@
/*
* 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,8 +6,8 @@
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.BaseAddress']" 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_BaseAddress"> 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">
@ -47,8 +47,8 @@
</table> </table>
</xsl:template> </xsl:template>
<xsl:template match="cms:item[objectType='com.arsdigita.cms.contenttypes.BaseAddress']" 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_BaseAddress"> 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>