diff --git a/ccm-cms-types-baseContact/src/ccm-cms-types-baseContact.config b/ccm-cms-types-baseContact/src/ccm-cms-types-baseContact.config deleted file mode 100755 index 78e4942dd..000000000 --- a/ccm-cms-types-baseContact/src/ccm-cms-types-baseContact.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/BaseContact.java b/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/BaseContact.java deleted file mode 100755 index 3a79eb7e7..000000000 --- a/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/BaseContact.java +++ /dev/null @@ -1,140 +0,0 @@ -/* - * Copyright (C) 2003-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.persistence.OID; -import com.arsdigita.persistence.DataObject; -import com.arsdigita.domain.DataObjectNotFoundException; -import com.arsdigita.cms.ContentType; -import com.arsdigita.util.Assert; -import java.math.BigDecimal; - - -/** - * This content type represents an BaseContact - * - */ -public class BaseContact extends com.arsdigita.cms.basetypes.Contact { - - /** PDL property names */ -// public static final String PERSON = "person"; -// public static final String ADDRESS = "address"; -// public static final String CONTACT_ENTRIES = "contactentries"; - - // Config -// private static final BaseContactConfig s_config = new BaseContactConfig(); -// static { -// s_config.load(); -// } - - /** Data object type for tihs domain object */ - public static final String BASE_DATA_OBJECT_TYPE - = "com.arsdigita.cms.contenttypes.BaseContact"; - - public BaseContact() { - super(BASE_DATA_OBJECT_TYPE); - } - - public BaseContact(BigDecimal id) - throws DataObjectNotFoundException { - this(new OID(BASE_DATA_OBJECT_TYPE, id)); - } - - public BaseContact(OID id) - throws DataObjectNotFoundException { - super(id); - } - - public BaseContact(DataObject obj) { - super(obj); - } - - public BaseContact(String type) { - super(type); - } - - @Override - public void beforeSave() { - super.beforeSave(); - - Assert.exists(getContentType(), ContentType.class); - } - - /** - * Retrieves the current configuration - */ -// public static final BaseContactConfig getConfig() { -// return s_config; -// } - - - /////////////////////////////////////////////////////////////// - // accessors -// -// // Get the person for this contact -// public Member getPerson() { -// return (Member) DomainObjectFactory.newInstance((DataObject)get(PERSON)); -// } -// -// // Set the person for this contact -// public void setPerson(Member person) { -// set(PERSON, person); -// } -// -// // Unset the address for this contact -// public void unsetPerson() { -// set(PERSON, null); -// } -// -// // Get the address for this contact -// public BaseAddress getAddress() { -// return (BaseAddress)DomainObjectFactory.newInstance((DataObject)get(ADDRESS)); -// } -// -// // Set the address for this contact -// public void setAddress(BaseAddress address) { -// set(ADDRESS, address); -// } -// -// // Unset the address for this contact -// public void unsetAddress() { -// set(ADDRESS, null); -// } -// -// // Get all contact entries for this contact, p. ex. phone number, type of contact etc. -// public BaseContactEntryCollection getContactEntries() { -// return new BaseContactEntryCollection ((DataCollection) get(CONTACT_ENTRIES)); -// } -// -// // Add a contact entry for this contact -// public void addContactEntry(BaseContactEntry contactEntry) { -// Assert.exists(contactEntry, BaseContactEntry.class); -// add(CONTACT_ENTRIES, contactEntry); -// } -// -// // Remove a contect entry for this contact -// public void removeContactEntry(BaseContactEntry contactEntry) { -// Assert.exists(contactEntry, BaseContactEntry.class); -// remove(CONTACT_ENTRIES, contactEntry); -// } -// -// public boolean hasContactEntries() { -// return !this.getContactEntries().isEmpty(); -// } -} diff --git a/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/BaseContactConfig_parameter.properties b/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/BaseContactConfig_parameter.properties deleted file mode 100644 index 2524d4473..000000000 --- a/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/BaseContactConfig_parameter.properties +++ /dev/null @@ -1,29 +0,0 @@ -com.arsdigita.cms.contenttypes.baseContact.hide_person.title=Hide person attachment -com.arsdigita.cms.contenttypes.baseContact.hide_person.purpose=Hide the part to attach a person CT -com.arsdigita.cms.contenttypes.baseContact.hide_person.example=false -com.arsdigita.cms.contenttypes.baseContact.hide_person.format=[boolean] - -com.arsdigita.cms.contenttypes.baseContact.hide_address.title=Hide address attachment -com.arsdigita.cms.contenttypes.baseContact.hide_address.purpose=Hide the part to attach a baseAddress CT -com.arsdigita.cms.contenttypes.baseContact.hide_address.example=false -com.arsdigita.cms.contenttypes.baseContact.hide_address.format=[boolean] - -com.arsdigita.cms.contenttypes.baseContact.address.hide_postal_code.title=Hide postal code for attached adress -com.arsdigita.cms.contenttypes.baseContact.address.hide_postal_code.purpose=Hide the postal code entry field for the attached baseAddress -com.arsdigita.cms.contenttypes.baseContact.address.hide_postal_code.example=false -com.arsdigita.cms.contenttypes.baseContact.address.hide_postal_code.format=[boolean] - -com.arsdigita.cms.contenttypes.baseContact.address.hide_state.title=Hide state for attached adress -com.arsdigita.cms.contenttypes.baseContact.address.hide_state.purpose=Hide the state entry field for the attached baseAddress -com.arsdigita.cms.contenttypes.baseContact.address.hide_state.example=false -com.arsdigita.cms.contenttypes.baseContact.address.hide_state.format=[boolean] - -com.arsdigita.cms.contenttypes.baseContact.address.hide_country.title=Hide country for attached address -com.arsdigita.cms.contenttypes.baseContact.address.hide_country.purpose=Hide the country selection box for the attached baseAddress -com.arsdigita.cms.contenttypes.baseContact.address.hide_country.example=false -com.arsdigita.cms.contenttypes.baseContact.address.hide_country.format=[boolean] - -com.arsdigita.cms.contenttypes.baseContact.contact_entry_keys.title=Select available contact entry types -com.arsdigita.cms.contenttypes.baseContact.contact_entry_keys.purpose=Select available contact entry types and define display order -com.arsdigita.cms.contenttypes.baseContact.contact_entry_keys.example=contact_type,office_hours,phone_office,phone_private,phone_mobile,email,fax,im,www -com.arsdigita.cms.contenttypes.baseContact.contact_entry_keys.format=[string] diff --git a/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/BaseContactEntry.java.old b/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/BaseContactEntry.java.old deleted file mode 100644 index e6fe7753b..000000000 --- a/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/BaseContactEntry.java.old +++ /dev/null @@ -1,114 +0,0 @@ -/* - * BaseContactEntry.java - * - * Created on 13. Mai 2009, 12:31 - * - * This class is part of BaseContact and stores the contact informations. - * These informations is organized by a key, which possible values are set by a config param. - * In addition there is a description field to provide additional information for this entry - * which will be shown along with the entry value, if set. If there is no description set, the - * key will be used as a fallback label. - * - * For example: - * key = "phone" - * description = "office phone" - * value = "1234 / 123456" - * - * would be shown as - * office phone: 1234 / 123456 - */ - -package com.arsdigita.cms.contenttypes; - -import com.arsdigita.cms.ContentItem; -import com.arsdigita.domain.DataObjectNotFoundException; -import com.arsdigita.persistence.DataObject; -import com.arsdigita.persistence.OID; -import java.math.BigDecimal; -import org.apache.log4j.Logger; - -/** - * - * @author quasi - */ -public class BaseContactEntry extends ContentItem { - - public static final String BASE_DATA_OBJECT_TYPE = "com.arsdigita.cms.contenttypes.BaseContactEntry"; - private static final String BASE_DATA_OBJECT_PACKAGE = "com.arsdigita.cms.contenttypes"; - - private static final Logger s_log = Logger.getLogger(BaseContactEntry.class); - - /** PDL property names */ - public static final String KEY = "key"; - public static final String VALUE = "value"; - public static final String DESCRIPTION = "description"; - - - /** - * Creates a new instance of BaseContactEntry - */ - public BaseContactEntry() { - this(BASE_DATA_OBJECT_TYPE); - } - - public BaseContactEntry(String typeName) { - super(typeName); - } - - public BaseContactEntry(OID oid) { - super(oid); - } - - public BaseContactEntry(DataObject object) { - super(object); - } - - /** - * Constructor. Retrieves an object instance with the given id. - * @param id the id of the object to retrieve - */ - public BaseContactEntry(BigDecimal id) throws DataObjectNotFoundException { - this(new OID(BASE_DATA_OBJECT_TYPE, id)); - } - - public BaseContactEntry(BaseContact contact, String key, String value, String description) { - this(); - setName(key + " for " + contact.getName() + "(" + contact.getID() + ")"); - setKey(key); - setValue(value); - setDescription(description); - save(); - } - - ///////////////////////////////////////////////// - // accessors - - // Get key - public String getKey() { - return (String) get(KEY); - } - - // Set key - public void setKey(String key) { - set(KEY, key); - } - - // Get value - public String getValue() { - return (String) get(VALUE); - } - - // Set value - public void setValue(String value) { - set(VALUE, value); - } - - // Get description - public String getDescription() { - return (String) get(DESCRIPTION); - } - - public void setDescription(String description) { - set(DESCRIPTION, description); - } -} diff --git a/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/BaseContactEntryCollection.java.old b/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/BaseContactEntryCollection.java.old deleted file mode 100644 index 5c0d73944..000000000 --- a/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/BaseContactEntryCollection.java.old +++ /dev/null @@ -1,134 +0,0 @@ -/* - * BaseContactEntryCollection.java - * - * Created on 13. Mai 2009, 12:32 - * - * - */ - -package com.arsdigita.cms.contenttypes; - -import com.arsdigita.domain.DomainCollection; -import com.arsdigita.persistence.DataCollection; -import java.util.Comparator; -import java.util.Iterator; -import java.util.TreeSet; - - -/** - * - * @author quasi - */ -public class BaseContactEntryCollection extends DomainCollection { - - private TreeSet m_sortedCollection = new TreeSet(new BaseContactEntryComparator()); - private Iterator m_iterator; - private boolean m_firstElem; - private BaseContactEntry m_currentBaseContactEntry; - - /** - * Creates a new instance of BaseContactEntryCollection - */ - public BaseContactEntryCollection(BaseContact baseContact) { - this((DataCollection) baseContact.getContactEntries()); - } - - public BaseContactEntryCollection(DataCollection dataCollection) { - super(dataCollection); - - // Now copy all objects from m_dataCollection to the sorting TreeSet - this.sortCollection(); - } - - public boolean next() { - boolean retVal = m_iterator.hasNext(); - if(retVal) { - m_currentBaseContactEntry = (BaseContactEntry)m_iterator.next(); - m_firstElem = false; - } - return retVal; - } - - public boolean isBeforeFirst() { - return false; - } - - public boolean isAfterLast() { - return false; - } - - public boolean isFirst() { - return m_firstElem; - } - - public boolean isLast() { - return !m_iterator.hasNext(); - } - - public boolean isEmpty() { - return m_sortedCollection.isEmpty(); - } - - public long size() { - return m_sortedCollection.size(); - } - - public void reset() { - super.reset(); - m_iterator = null; - m_currentBaseContactEntry = null; - m_sortedCollection = new TreeSet(new BaseContactEntryComparator()); - this.sortCollection(); - } - - public void rewind() { - m_iterator = m_sortedCollection.iterator(); - } - - public final String getKey() { - return (String) getBaseContactEntry().getKey(); - } - - public final String getDescription() { - return (String) getBaseContactEntry().getDescription(); - } - - public final String getValue() { - return (String) getBaseContactEntry().getValue(); - } - - public BaseContactEntry getBaseContactEntry() { -// return new BaseContactEntry(m_dataCollection.getDataObject()); - return m_currentBaseContactEntry; - } - - - private void sortCollection() { - - m_dataCollection.rewind(); - - while(m_dataCollection.next()) { - m_sortedCollection.add(new BaseContactEntry(m_dataCollection.getDataObject())); - } - - m_iterator = m_sortedCollection.iterator(); - m_firstElem = true; - } - - - private class BaseContactEntryComparator implements Comparator { - public int compare(Object o1, Object o2) { - int retVal = 0; - if(o1 instanceof BaseContactEntry && o2 instanceof BaseContactEntry) { - BaseContactEntry bc1 = (BaseContactEntry)o1; - BaseContactEntry bc2 = (BaseContactEntry)o2; - retVal = BaseContact.getConfig().getKeyIndex(bc1.getKey()) - - BaseContact.getConfig().getKeyIndex(bc2.getKey()); - if(retVal == 0) { - retVal=-1; - } - } - return retVal; - } - } -} diff --git a/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/BaseContactResources.properties b/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/BaseContactResources.properties deleted file mode 100755 index 220e9dcd3..000000000 --- a/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/BaseContactResources.properties +++ /dev/null @@ -1,50 +0,0 @@ -cms.contenttypes.ui.baseContact.basic_properties=Basic Properties -cms.contenttypes.ui.baseContact.edit_basic_properties=Edit Basic Properties -cms.contenttypes.ui.baseContact.edit_basic_properties.description=Description -cms.contenttypes.ui.baseContact.confirm_delete=Sure? -cms.contenttypes.ui.baseContact.person=Person -cms.contenttypes.ui.baseContact.address=Address - -cms.contenttypes.ui.baseContact.attach_address=Attach Address -cms.contenttypes.ui.baseContact.edit_address=Edit Address -cms.contenttypes.ui.baseContact.reattach_address=Reattach Address -cms.contenttypes.ui.baseContact.delete_address=Delete Address -cms.contenttypes.ui.baseContact.emptyAddress=There is no Address attached -cms.contenttypes.ui.baseContact.select_address=Please select a baseContact content type -cms.contenttypes.ui.baseContact.select_address.add=Add -cms.contenttypes.ui.baseContact.select_address.change=Change -cms.contenttypes.ui.baseContact.select_address.wrong_type=BaseAddress selection is required -cms.contenttypes.ui.baseContact.select_address.cancelled=cancelled -cms.contenttypes.ui.baseContact.delete_address.label=Do you want to delete the link to the baseContact content type? -cms.contenttypes.ui.baseContact.delete_address.button_label=Delete - -cms.contenttypes.ui.baseContact.attach_person=Attach Person -cms.contenttypes.ui.baseContact.edit_person=Edit Person -cms.contenttypes.ui.baseContact.reattach_person=Reattach Person -cms.contenttypes.ui.baseContact.delete_person=Delete Person -cms.contenttypes.ui.baseContact.emptyPerson=There is no Address attached -cms.contenttypes.ui.baseContact.select_person=Please select a Person content type -cms.contenttypes.ui.baseContact.select_person.add=Add -cms.contenttypes.ui.baseContact.select_person.change=Change -cms.contenttypes.ui.baseContact.select_person.wrong_type=Person selection is required -cms.contenttypes.ui.baseContact.select_person.cancelled=cancelled -cms.contenttypes.ui.baseContact.delete_person.label=Do you want to delete the link to the Person content type? -cms.contenttypes.ui.baseContact.delete_person.button_label=Delete - -cms.contenttypes.ui.baseContact.add_contactEntry=Add Contact Entry -cms.contenttypes.ui.baseContact.contactEntry=Contact Entries -cms.contenttypes.ui.baseContact.contactEntry.key=Type -cms.contenttypes.ui.baseContact.contactEntry.value=Value -cms.contenttypes.ui.baseContact.contactEntry.description=Description (internal use only) -cms.contenttypes.ui.baseContact.contactEntry.action=Action - -cms.contenttypes.ui.baseContact.contactEntry.key.contact_type=Type of Contact -cms.contenttypes.ui.baseContact.contactEntry.key.office_hours=Office Hours -cms.contenttypes.ui.baseContact.contactEntry.key.phone_office=Phone (office) -cms.contenttypes.ui.baseContact.contactEntry.key.phone_private=Phone (private) -cms.contenttypes.ui.baseContact.contactEntry.key.phone_mobile=Phone (mobile) -cms.contenttypes.ui.baseContact.contactEntry.key.email=eMail -cms.contenttypes.ui.baseContact.contactEntry.key.fax=Fax -cms.contenttypes.ui.baseContact.contactEntry.key.im=Instant Messenger -cms.contenttypes.ui.baseContact.contactEntry.key.www=Homepage - diff --git a/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/BaseContactResources_de.properties b/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/BaseContactResources_de.properties deleted file mode 100644 index 43e9663a8..000000000 --- a/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/BaseContactResources_de.properties +++ /dev/null @@ -1,52 +0,0 @@ -cms.contenttypes.ui.baseContact.basic_properties=Eigenschaften von Contact -cms.contenttypes.ui.baseContact.edit_basic_properties=Bearbeiten -cms.contenttypes.ui.baseContact.edit_basic_properties.description=Description -cms.contenttypes.ui.baseContact.confirm_delete=Sind Sie sicher? -cms.contenttypes.ui.baseContact.person=Person -cms.contenttypes.ui.baseContact.address=Adresse - -cms.contenttypes.ui.baseContact.attach_address=Adresse verknüpfen -cms.contenttypes.ui.baseContact.edit_address=Adresse bearbeiten -cms.contenttypes.ui.baseContact.reattach_address=Adresse neu verknüpfen -cms.contenttypes.ui.baseContact.delete_address=Adresse löschen -cms.contenttypes.ui.baseContact.emptyAddress=Zur Zeit ist keine Adresse verknüpft -cms.contenttypes.ui.baseContact.select_address=Bitte wählen Sie eine Eintrag vom Typ BaseAddress -cms.contenttypes.ui.baseContact.select_address.add=Verknüpfen -cms.contenttypes.ui.baseContact.select_address.change=Verändern -cms.contenttypes.ui.baseContact.select_address.wrong_type=Der gewählte Eintrag ist nicht vom Typ BaseAddress -cms.contenttypes.ui.baseContact.select_address.cancelled=Abbruch -cms.contenttypes.ui.baseContact.delete_address.label=Wollen Sie die Verknüpfung zur Adresse entfernen? -cms.contenttypes.ui.baseContact.delete_address.button_label=Löschen - -cms.contenttypes.ui.baseContact.attach_person=Person verknüpfen -cms.contenttypes.ui.baseContact.edit_person=Person bearbeiten -cms.contenttypes.ui.baseContact.reattach_person=Person neu verknüpfen -cms.contenttypes.ui.baseContact.delete_person=Person löschen -cms.contenttypes.ui.baseContact.emptyPerson=Zur Zeit ist keine Person verknüft -cms.contenttypes.ui.baseContact.select_person=Bitte wählen Sie einen Eintrag vom Typ Person -cms.contenttypes.ui.baseContact.select_person.add=Verknüpfen -cms.contenttypes.ui.baseContact.select_person.change=Verändern -cms.contenttypes.ui.baseContact.select_person.wrong_type=Der gewählte Eintrag ist nicht vom Typ Person -cms.contenttypes.ui.baseContact.select_person.cancelled=Abbruch -cms.contenttypes.ui.baseContact.delete_person.label=WollenSie die Verknüfung zur Person entfernen? -cms.contenttypes.ui.baseContact.delete_person.button_label=Löschen - -cms.contenttypes.ui.baseContact.add_contactEntry=Kontaktinformation hinzufügen -cms.contenttypes.ui.baseContact.contactEntry=Kontaktinformationen -cms.contenttypes.ui.baseContact.contactEntry.key=Art der Information -cms.contenttypes.ui.baseContact.contactEntry.value=Inhalt -cms.contenttypes.ui.baseContact.contactEntry.description=Beschreibung (wird nicht öffentlich angezeigt) -cms.contenttypes.ui.baseContact.contactEntry.action=Aktionen - -cms.contenttypes.ui.baseContact.contactEntry.key.contact_type=Kontaktart -cms.contenttypes.ui.baseContact.contactEntry.key.office_hours=Öffnungszeiten -cms.contenttypes.ui.baseContact.contactEntry.key.phone_office=Telefon (Büro) -cms.contenttypes.ui.baseContact.contactEntry.key.phone_private=Telefon (Privat) -cms.contenttypes.ui.baseContact.contactEntry.key.phone_mobile=Telefon (Mobil) -cms.contenttypes.ui.baseContact.contactEntry.key.email=E-Mail -cms.contenttypes.ui.baseContact.contactEntry.key.fax=Fax -cms.contenttypes.ui.baseContact.contactEntry.key.im=Instant Messenger -cms.contenttypes.ui.baseContact.contactEntry.key.www=Homepage - - -cms.contenttypes.ui.baseContact.contactEntry.none=Zur Zeit sind keine Kontaktinformatioonen vorhanden diff --git a/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/ui/BaseContactAddressPropertiesStep.java.old b/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/ui/BaseContactAddressPropertiesStep.java.old deleted file mode 100644 index c2e43756e..000000000 --- a/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/ui/BaseContactAddressPropertiesStep.java.old +++ /dev/null @@ -1,111 +0,0 @@ -/* - * BaseContactAddressPropertiesStep.java - * - * Created on 4. Juli 2009, 15:15 - * - * To change this template, choose Tools | Template Manager - * and open the template in the editor. - */ - -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.PageState; -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.domain.DomainObject; -import com.arsdigita.toolbox.ui.DomainObjectPropertySheet; -import com.arsdigita.bebop.Component; -import com.arsdigita.bebop.Label; -import com.arsdigita.cms.contenttypes.BaseAddress; -import com.arsdigita.cms.contenttypes.BaseContact; -import com.arsdigita.cms.contenttypes.util.BaseAddressGlobalizationUtil; -import com.arsdigita.cms.contenttypes.util.BaseContactGlobalizationUtil; -import com.arsdigita.cms.ui.authoring.SimpleEditStep; - -/** - * - * @author quasi - */ -public class BaseContactAddressPropertiesStep extends SimpleEditStep { - - public static final String ADD_ADDRESS_SHEET_NAME = "addAddress"; - public static final String EDIT_ADDRESS_SHEET_NAME = "editAddress"; - public static final String CHANGE_ADDRESS_SHEET_NAME = "changeAddress"; - public static final String DELETE_ADDRESS_SHEET_NAME = "deleteAddress"; - - /** Creates a new instance of BaseContactAddressPropertiesStep */ - public BaseContactAddressPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent) { - this(itemModel, parent, ""); - } - - public BaseContactAddressPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent, String prefix) { - super(itemModel, parent, prefix); - -// BaseContact baseContact = (BaseContact)itemModel.getSelectedObject(state); - -//XXX -// if(/*baseContact.getAddress() == null*/ true) { - BasicPageForm attachAddressSheet = new BaseContactAttachAddressPropertyForm(itemModel, this); - add(ADD_ADDRESS_SHEET_NAME, (String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.attach_address").localize(), new WorkflowLockedComponentAccess(attachAddressSheet, itemModel), attachAddressSheet.getSaveCancelSection().getCancelButton()); - - /* Set the displayComponent for this step */ -// setDisplayComponent(getEmptyBaseAddressPropertySheet(itemModel)); - -// } else { - - // editAddress - BasicPageForm editAddressSheet = new BaseContactEditAddressPropertyForm(itemModel, this); - add(EDIT_ADDRESS_SHEET_NAME, (String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.edit_address").localize(), new WorkflowLockedComponentAccess(editAddressSheet, itemModel), editAddressSheet.getSaveCancelSection().getCancelButton()); - -// BasicPageForm attachAddressSheet = new BaseContactAttachAddressPropertyForm(itemModel, this); -// add(CHANGE_ADDRESS_SHEET_NAME, (String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.reattach_address").localize(), new WorkflowLockedComponentAccess(attachAddressSheet, itemModel), attachAddressSheet.getSaveCancelSection().getCancelButton()); - - BasicPageForm deleteAddressSheet = new BaseContactDeleteAddressForm(itemModel, this); - add(DELETE_ADDRESS_SHEET_NAME, (String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.delete_address").localize(), new WorkflowLockedComponentAccess(deleteAddressSheet, itemModel), deleteAddressSheet.getSaveCancelSection().getCancelButton()); - - /* Set the displayComponent for this step */ - setDisplayComponent(getBaseAddressPropertySheet(itemModel)); -// } - - } - - public static Component getBaseAddressPropertySheet(ItemSelectionModel itemModel) { - - DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(itemModel); - - sheet.add((String)BaseAddressGlobalizationUtil.globalize("cms.contenttypes.ui.baseAddress.address").localize(), "address." + BaseAddress.ADDRESS); - if(!BaseContact.getConfig().getHideAddressPostalCode()) - sheet.add((String)BaseAddressGlobalizationUtil.globalize("cms.contenttypes.ui.baseAddress.postal_code").localize(), "address." + BaseAddress.POSTAL_CODE); - sheet.add((String)BaseAddressGlobalizationUtil.globalize("cms.contenttypes.ui.baseAddress.city").localize(), "address." + BaseAddress.CITY); - if(!BaseContact.getConfig().getHideAddressState()) - sheet.add((String)BaseAddressGlobalizationUtil.globalize("cms.contenttypes.ui.baseAddress.state").localize(), "address." + BaseAddress.STATE); - - if(!BaseContact.getConfig().getHideAddressCountry()) { - sheet.add((String)BaseAddressGlobalizationUtil.globalize("cms.contenttypes.ui.baseAddress.iso_country_code").localize(), - "address." + BaseAddress.ISO_COUNTRY_CODE, - new DomainObjectPropertySheet.AttributeFormatter() { - public String format(DomainObject item, - String attribute, - PageState state) { - BaseAddress baseAddress = ((BaseContact)item).getAddress(); - if(baseAddress != null && baseAddress.getIsoCountryCode() != null) { - return BaseAddress.getCountryNameFromIsoCode(baseAddress.getIsoCountryCode()); - } else { - return (String)BaseAddressGlobalizationUtil.globalize - ("cms.ui.unknown").localize(); - } - } - }); - } - - return sheet; - - } - - public static Component getEmptyBaseAddressPropertySheet(ItemSelectionModel itemModel) { - return new Label(((String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.emptyAddress").localize())); - } - -} diff --git a/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/ui/BaseContactAttachAddressPropertyForm.java.old b/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/ui/BaseContactAttachAddressPropertyForm.java.old deleted file mode 100644 index c84f57927..000000000 --- a/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/ui/BaseContactAttachAddressPropertyForm.java.old +++ /dev/null @@ -1,145 +0,0 @@ -/* - * BaseContactEditAddressPropertyForm.java - * - * Created on 8. Juli 2009, 10:27 - * - * To change this template, choose Tools | Template Manager - * and open the template in the editor. - */ - -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.PageState; -import com.arsdigita.bebop.SaveCancelSection; -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.bebop.event.PrintEvent; -import com.arsdigita.bebop.event.PrintListener; -import com.arsdigita.bebop.form.Submit; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.ui.authoring.BasicPageForm; -import com.arsdigita.cms.contenttypes.BaseAddress; -import com.arsdigita.cms.contenttypes.BaseContact; -import com.arsdigita.cms.ui.ItemSearchWidget; -import com.arsdigita.cms.ContentType; -import com.arsdigita.cms.contenttypes.util.BaseContactGlobalizationUtil; -import com.arsdigita.util.UncheckedWrapperException; - -import org.apache.log4j.Logger; - -/** - * - * @author quasi - */ -public class BaseContactAttachAddressPropertyForm extends BasicPageForm implements FormProcessListener, FormInitListener, FormSubmissionListener { - - private static final Logger logger = Logger.getLogger(BaseContactPropertyForm.class); - - private BaseContactAddressPropertiesStep m_step; - private ItemSearchWidget m_itemSearch; - private SaveCancelSection m_saveCancelSection; - private final String ITEM_SEARCH = "baseContactAddress"; - - /** - * ID of the form - */ - public static final String ID = "BaseContactAttachAddress"; - - /** - * Constrctor taking an ItemSelectionModel - * - * @param itemModel - */ - public BaseContactAttachAddressPropertyForm(ItemSelectionModel itemModel) { - this(itemModel, null); - } - - /** - * Constrctor taking an ItemSelectionModel and an instance of BaseContactPropertiesStep. - * - * @param itemModel - * @param step - */ - public BaseContactAttachAddressPropertyForm(ItemSelectionModel itemModel, BaseContactAddressPropertiesStep step) { - super(ID, itemModel); - addSubmissionListener(this); - - addSaveCancelSection(); - - addInitListener(this); - addSubmissionListener(this); - - } - - @Override - public void addWidgets() { - add(new Label((String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.select_address").localize())); - this.m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.findByAssociatedObjectType("com.arsdigita.cms.contenttypes.BaseAddress")); - add(this.m_itemSearch); - } - - public void init(FormSectionEvent fse) { - FormData data = fse.getFormData(); - PageState state = fse.getPageState(); - BaseContact baseContact = (BaseContact)getItemSelectionModel().getSelectedObject(state); - - setVisible(state, true); - - if (baseContact != null) { - data.put(ITEM_SEARCH, baseContact.getAddress()); - } - } - - public void process(FormSectionEvent fse) { - FormData data = fse.getFormData(); - PageState state = fse.getPageState(); - BaseContact baseContact = (BaseContact)getItemSelectionModel().getSelectedObject(state); - - if (!this.getSaveCancelSection().getCancelButton().isSelected(state)) { - baseContact.setAddress((BaseAddress)data.get(ITEM_SEARCH)); - } - init(fse); - } - - - /** - * Creates the section with the save and the cancel button. - */ - public void addSaveCancelSection() { - try { - getSaveCancelSection().getSaveButton().addPrintListener(new PrintListener() { - - public void prepare(PrintEvent e) { - BaseContact baseContact = (BaseContact)getItemSelectionModel().getSelectedObject(e.getPageState()); - Submit target = (Submit) e.getTarget(); - - if (baseContact.getAddress() != null) { - target.setButtonLabel((String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.select_address.change").localize()); - } else { - target.setButtonLabel((String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.select_address.add").localize()); - } - } - }); - } catch (Exception ex) { - throw new UncheckedWrapperException("this cannot happen", ex); - } - } - - public void validate(FormSectionEvent e) throws FormProcessException { - if (e.getFormData().get(ITEM_SEARCH) == null) { - throw new FormProcessException((String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.select_address.wrong_type").localize()); - } - } - - public void submitted(FormSectionEvent e) throws FormProcessException { - if (getSaveCancelSection().getCancelButton().isSelected(e.getPageState())) { - init(e); - throw new FormProcessException((String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.select_address.cancelled").localize()); - } - } -} \ No newline at end of file diff --git a/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/ui/BaseContactAttachPersonPropertyForm.java.old b/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/ui/BaseContactAttachPersonPropertyForm.java.old deleted file mode 100644 index 3efcbd060..000000000 --- a/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/ui/BaseContactAttachPersonPropertyForm.java.old +++ /dev/null @@ -1,145 +0,0 @@ -/* - * BaseContactEditPersonPropertyForm.java - * - * Created on 8. Juli 2009, 10:27 - * - * To change this template, choose Tools | Template Manager - * and open the template in the editor. - */ - -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.PageState; -import com.arsdigita.bebop.SaveCancelSection; -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.bebop.event.PrintEvent; -import com.arsdigita.bebop.event.PrintListener; -import com.arsdigita.bebop.form.Submit; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.ui.authoring.BasicPageForm; -import com.arsdigita.cms.contenttypes.Member; -import com.arsdigita.cms.contenttypes.BaseContact; -import com.arsdigita.cms.ui.ItemSearchWidget; -import com.arsdigita.cms.ContentType; -import com.arsdigita.cms.contenttypes.util.BaseContactGlobalizationUtil; -import com.arsdigita.util.UncheckedWrapperException; - -import org.apache.log4j.Logger; - -/** - * - * @author quasi - */ -public class BaseContactAttachPersonPropertyForm extends BasicPageForm implements FormProcessListener, FormInitListener, FormSubmissionListener { - - private static final Logger logger = Logger.getLogger(BaseContactPropertyForm.class); - - private BaseContactPersonPropertiesStep m_step; - private ItemSearchWidget m_itemSearch; - private SaveCancelSection m_saveCancelSection; - private final String ITEM_SEARCH = "baseContactPerson"; - - /** - * ID of the form - */ - public static final String ID = "BaseContactAttachPerson"; - - /** - * Constrctor taking an ItemSelectionModel - * - * @param itemModel - */ - public BaseContactAttachPersonPropertyForm(ItemSelectionModel itemModel) { - this(itemModel, null); - } - - /** - * Constrctor taking an ItemSelectionModel and an instance of BaseContactPropertiesStep. - * - * @param itemModel - * @param step - */ - public BaseContactAttachPersonPropertyForm(ItemSelectionModel itemModel, BaseContactPersonPropertiesStep step) { - super(ID, itemModel); - addSubmissionListener(this); - - addSaveCancelSection(); - - addInitListener(this); - addSubmissionListener(this); - - } - - @Override - public void addWidgets() { - add(new Label((String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.select_person").localize())); - this.m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.findByAssociatedObjectType("com.arsdigita.cms.contenttypes.Person")); - add(this.m_itemSearch); - } - - public void init(FormSectionEvent fse) { - FormData data = fse.getFormData(); - PageState state = fse.getPageState(); - BaseContact baseContact = (BaseContact)getItemSelectionModel().getSelectedObject(state); - - setVisible(state, true); - - if (baseContact != null) { - data.put(ITEM_SEARCH, baseContact.getPerson()); - } - } - - public void process(FormSectionEvent fse) { - FormData data = fse.getFormData(); - PageState state = fse.getPageState(); - BaseContact baseContact = (BaseContact)getItemSelectionModel().getSelectedObject(state); - - if (!this.getSaveCancelSection().getCancelButton().isSelected(state)) { - baseContact.setPerson((Member)data.get(ITEM_SEARCH)); - } - init(fse); - } - - - /** - * Creates the section with the save and the cancel button. - */ - public void addSaveCancelSection() { - try { - getSaveCancelSection().getSaveButton().addPrintListener(new PrintListener() { - - public void prepare(PrintEvent e) { - BaseContact baseContact = (BaseContact)getItemSelectionModel().getSelectedObject(e.getPageState()); - Submit target = (Submit) e.getTarget(); - - if (baseContact.getPerson() != null) { - target.setButtonLabel((String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.select_person.change").localize()); - } else { - target.setButtonLabel((String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.select_person.add").localize()); - } - } - }); - } catch (Exception ex) { - throw new UncheckedWrapperException("this cannot happen", ex); - } - } - - public void validate(FormSectionEvent e) throws FormProcessException { - if (e.getFormData().get(ITEM_SEARCH) == null) { - throw new FormProcessException((String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.select_person.wrong_type").localize()); - } - } - - public void submitted(FormSectionEvent e) throws FormProcessException { - if (getSaveCancelSection().getCancelButton().isSelected(e.getPageState())) { - init(e); - throw new FormProcessException((String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.select_person.cancelled").localize()); - } - } -} \ No newline at end of file diff --git a/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/ui/BaseContactDeleteAddressForm.java.old b/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/ui/BaseContactDeleteAddressForm.java.old deleted file mode 100644 index 8ba779c66..000000000 --- a/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/ui/BaseContactDeleteAddressForm.java.old +++ /dev/null @@ -1,78 +0,0 @@ -/* - * BaseContactDeleteAddressForm.java - * - * Created on 17. Juli 2009, 10:10 - * - * To change this template, choose Tools | Template Manager - * and open the template in the editor. - */ - -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.FormProcessException; -import com.arsdigita.bebop.Label; -import com.arsdigita.bebop.PageState; -import com.arsdigita.bebop.event.FormProcessListener; -import com.arsdigita.bebop.event.FormSectionEvent; -import com.arsdigita.bebop.event.PrintEvent; -import com.arsdigita.bebop.event.PrintListener; -import com.arsdigita.bebop.form.Submit; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.contenttypes.BaseContact; -import com.arsdigita.cms.contenttypes.util.BaseContactGlobalizationUtil; -import com.arsdigita.cms.ui.authoring.BasicPageForm; -import com.arsdigita.util.UncheckedWrapperException; - -/** - * - * @author quasi - */ -public class BaseContactDeleteAddressForm extends BasicPageForm implements FormProcessListener { - - /** - * ID of the form - */ - public static final String ID = "BaseContactDeleteAddress"; - - BaseContactDeleteAddressForm(ItemSelectionModel itemModel, BaseContactAddressPropertiesStep step) { - super(ID, itemModel); - addSaveCancelSection(); - } - - public void init(FormSectionEvent fse) { - - } - - public void addWidgets() { - add(new Label((String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.delete_address.label").localize())); - } - - /** - * Creates the section with the save and the cancel button. - */ - public void addSaveCancelSection() { - try { - getSaveCancelSection().getSaveButton().addPrintListener(new PrintListener() { - - public void prepare(PrintEvent e) { - BaseContact baseContact = (BaseContact)getItemSelectionModel().getSelectedObject(e.getPageState()); - Submit target = (Submit) e.getTarget(); - target.setButtonLabel((String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.delete_address.button_label").localize()); - } - }); - } catch (Exception ex) { - throw new UncheckedWrapperException("this cannot happen", ex); - } - } - - public final void process(final FormSectionEvent fse) throws FormProcessException { - - final PageState state = fse.getPageState(); - final BaseContact baseContact = (BaseContact)getItemSelectionModel().getSelectedObject(state); - - if (baseContact != null && baseContact.getAddress() != null) { - baseContact.unsetAddress(); - } - } - -} diff --git a/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/ui/BaseContactDeletePersonForm.java.old b/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/ui/BaseContactDeletePersonForm.java.old deleted file mode 100644 index 123be100d..000000000 --- a/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/ui/BaseContactDeletePersonForm.java.old +++ /dev/null @@ -1,78 +0,0 @@ -/* - * BaseContactDeletePersonForm.java - * - * Created on 17. Juli 2009, 10:10 - * - * To change this template, choose Tools | Template Manager - * and open the template in the editor. - */ - -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.FormProcessException; -import com.arsdigita.bebop.Label; -import com.arsdigita.bebop.PageState; -import com.arsdigita.bebop.event.FormProcessListener; -import com.arsdigita.bebop.event.FormSectionEvent; -import com.arsdigita.bebop.event.PrintEvent; -import com.arsdigita.bebop.event.PrintListener; -import com.arsdigita.bebop.form.Submit; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.contenttypes.BaseContact; -import com.arsdigita.cms.contenttypes.util.BaseContactGlobalizationUtil; -import com.arsdigita.cms.ui.authoring.BasicPageForm; -import com.arsdigita.util.UncheckedWrapperException; - -/** - * - * @author quasi - */ -public class BaseContactDeletePersonForm extends BasicPageForm implements FormProcessListener { - - /** - * ID of the form - */ - public static final String ID = "BaseContactDeletePerson"; - - BaseContactDeletePersonForm(ItemSelectionModel itemModel, BaseContactPersonPropertiesStep step) { - super(ID, itemModel); - addSaveCancelSection(); - } - - public void init(FormSectionEvent fse) { - - } - - public void addWidgets() { - add(new Label((String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.delete_person.label").localize())); - } - - /** - * Creates the section with the save and the cancel button. - */ - public void addSaveCancelSection() { - try { - getSaveCancelSection().getSaveButton().addPrintListener(new PrintListener() { - - public void prepare(PrintEvent e) { - BaseContact baseContact = (BaseContact)getItemSelectionModel().getSelectedObject(e.getPageState()); - Submit target = (Submit) e.getTarget(); - target.setButtonLabel((String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.delete_person").localize()); - } - }); - } catch (Exception ex) { - throw new UncheckedWrapperException("this cannot happen", ex); - } - } - - public final void process(final FormSectionEvent fse) throws FormProcessException { - - final PageState state = fse.getPageState(); - final BaseContact baseContact = (BaseContact)getItemSelectionModel().getSelectedObject(state); - - if (baseContact != null && baseContact.getPerson() != null) { - baseContact.unsetPerson(); - } - } - -} diff --git a/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/ui/BaseContactEditAddressPropertyForm.java.old b/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/ui/BaseContactEditAddressPropertyForm.java.old deleted file mode 100644 index ef2f8ad07..000000000 --- a/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/ui/BaseContactEditAddressPropertyForm.java.old +++ /dev/null @@ -1,189 +0,0 @@ -/* - * BaseContactEditAddressPropertyForm.java - * - * Created on 8. Juli 2009, 10:27 - * - * To change this template, choose Tools | Template Manager - * and open the template in the editor. - */ - -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.PageState; -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.bebop.event.ParameterEvent; -import com.arsdigita.bebop.event.ParameterListener; -import com.arsdigita.bebop.form.Option; -import com.arsdigita.bebop.form.SingleSelect; -import com.arsdigita.bebop.form.TextArea; -import com.arsdigita.bebop.form.TextField; -import com.arsdigita.bebop.parameters.NotNullValidationListener; -import com.arsdigita.bebop.parameters.StringInRangeValidationListener; -import com.arsdigita.bebop.parameters.ParameterModel; -import com.arsdigita.bebop.parameters.StringParameter; -import com.arsdigita.bebop.parameters.ParameterData; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.ui.authoring.BasicPageForm; -import java.util.Iterator; -import java.util.Map; -import com.arsdigita.cms.contenttypes.BaseAddress; -import com.arsdigita.cms.contenttypes.BaseContact; -import com.arsdigita.cms.contenttypes.util.BaseAddressGlobalizationUtil; - -import org.apache.log4j.Logger; - -/** - * - * @author quasi - */ -public class BaseContactEditAddressPropertyForm extends BasicPageForm implements FormProcessListener, FormInitListener, FormSubmissionListener { - - private static final Logger logger = Logger.getLogger(BaseContactPropertyForm.class); - - private BaseContactAddressPropertiesStep m_step; - - public static final String ADDRESS = BaseAddress.ADDRESS; - public static final String POSTAL_CODE = BaseAddress.POSTAL_CODE; - public static final String CITY = BaseAddress.CITY; - public static final String STATE = BaseAddress.STATE; - public static final String ISO_COUNTRY_CODE = BaseAddress.ISO_COUNTRY_CODE; - - /** - * ID of the form - */ - public static final String ID = "BaseContactEditAddress"; - - /** - * Constrctor taking an ItemSelectionModel - * - * @param itemModel - */ - public BaseContactEditAddressPropertyForm(ItemSelectionModel itemModel) { - this(itemModel, null); - } - - /** - * Constrctor taking an ItemSelectionModel and an instance of BaseContactPropertiesStep. - * - * @param itemModel - * @param step - */ - public BaseContactEditAddressPropertyForm(ItemSelectionModel itemModel, BaseContactAddressPropertiesStep step) { - super(ID, itemModel); - m_step = step; - addSubmissionListener(this); - } - - @Override - public void addWidgets() { - add(new Label((String)BaseAddressGlobalizationUtil.globalize("cms.contenttypes.ui.baseAddress.address").localize())); - ParameterModel addressParam = new StringParameter(ADDRESS); - addressParam.addParameterListener( new NotNullValidationListener( ) ); - addressParam.addParameterListener( new StringInRangeValidationListener(0, 1000) ); - TextArea address = new TextArea(addressParam); - address.setRows(5); - address.setCols(30); - add(address); - - if(!BaseContact.getConfig().getHideAddressPostalCode()) { - add(new Label((String)BaseAddressGlobalizationUtil.globalize("cms.contenttypes.ui.baseAddress.postal_code").localize())); - ParameterModel postalCodeParam = new StringParameter(POSTAL_CODE); - TextField postalCode = new TextField(postalCodeParam); - /* XXX NumberListener ?*/ - add(postalCode); - } - - add(new Label((String)BaseAddressGlobalizationUtil.globalize("cms.contenttypes.ui.baseAddress.city").localize())); - ParameterModel cityParam = new StringParameter(CITY); - TextField city = new TextField(cityParam); - add(city); - - if(!BaseContact.getConfig().getHideAddressState()) { - add(new Label((String)BaseAddressGlobalizationUtil.globalize("cms.contenttypes.ui.baseAddress.state").localize())); - ParameterModel stateParam = new StringParameter(STATE); - TextField state = new TextField(stateParam); - add(state); - } - - if (!BaseContact.getConfig().getHideAddressCountry()) { - add(new Label((String)BaseAddressGlobalizationUtil.globalize("cms.contenttypes.ui.baseAddress.iso_country_code").localize())); - ParameterModel countryParam = new StringParameter(ISO_COUNTRY_CODE); - countryParam.addParameterListener(new StringInRangeValidationListener(0, 2)); - - SingleSelect country = new SingleSelect(countryParam); - - country.addOption(new Option("", new Label((String)BaseAddressGlobalizationUtil.globalize("cms.ui.select_one" ).localize()))); - - Iterator countries = BaseAddress.getSortedListOfCountries(null).entrySet().iterator(); - while(countries.hasNext()) { - Map.Entry elem = (Map.Entry)countries.next(); - country.addOption(new Option(elem.getValue().toString(), elem.getKey().toString())); - } - - country.addValidationListener( - new ParameterListener() { - public void validate(ParameterEvent e) throws FormProcessException { - ParameterData data = e.getParameterData(); - String isoCode = (String) data.getValue() ; - if (isoCode == null || isoCode.length() == 0) { - data.addError((String)BaseAddressGlobalizationUtil.globalize("cms.contenttypes.ui.address.error_iso_country").localize()); - } - } - } - ); - - add(country); - } - - } - - public void init(FormSectionEvent fse) { - FormData data = fse.getFormData(); - PageState state = fse.getPageState(); - BaseContact baseContact = (BaseContact)getItemSelectionModel().getSelectedObject(state); - - if(baseContact.getAddress() != null) { - data.put(ADDRESS, baseContact.getAddress().getAddress()); - data.put(POSTAL_CODE, baseContact.getAddress().getPostalCode()); - data.put(CITY, baseContact.getAddress().getCity()); - data.put(STATE, baseContact.getAddress().getState()); - if(!BaseAddress.getConfig().getHideCountryCodeSelection()) { - data.put(ISO_COUNTRY_CODE, baseContact.getAddress().getIsoCountryCode()); - } - } - } - - public void submitted(FormSectionEvent fse) { - if (m_step != null && - getSaveCancelSection().getCancelButton().isSelected(fse.getPageState())) { - m_step.cancelStreamlinedCreation(fse.getPageState()); - } - } - - public void process(FormSectionEvent fse) { - FormData data = fse.getFormData(); - PageState state = fse.getPageState(); - BaseContact baseContact = (BaseContact)getItemSelectionModel().getSelectedObject(state); - - if (baseContact.getAddress() != null && - getSaveCancelSection().getSaveButton().isSelected(fse.getPageState())) { - baseContact.getAddress().setAddress((String)data.get(ADDRESS)); - baseContact.getAddress().setPostalCode((String)data.get(POSTAL_CODE)); - baseContact.getAddress().setCity((String)data.get(CITY)); - baseContact.getAddress().setState((String)data.get(STATE)); - baseContact.getAddress().setIsoCountryCode((String)data.get(ISO_COUNTRY_CODE)); - - baseContact.getAddress().save(); - } - - if (m_step != null) { - m_step.maybeForwardToNextStep(fse.getPageState()); - } - } -} \ No newline at end of file diff --git a/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/ui/BaseContactEditPersonPropertyForm.java.old b/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/ui/BaseContactEditPersonPropertyForm.java.old deleted file mode 100644 index f367b5f23..000000000 --- a/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/ui/BaseContactEditPersonPropertyForm.java.old +++ /dev/null @@ -1,141 +0,0 @@ -/* - * BaseContactEditPersonPropertyForm.java - * - * Created on 8. Juli 2009, 10:27 - * - * To change this template, choose Tools | Template Manager - * and open the template in the editor. - */ - -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.FormData; -import com.arsdigita.bebop.Label; -import com.arsdigita.bebop.PageState; -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.bebop.form.TextField; -import com.arsdigita.bebop.parameters.NotNullValidationListener; -import com.arsdigita.bebop.parameters.StringInRangeValidationListener; -import com.arsdigita.bebop.parameters.ParameterModel; -import com.arsdigita.bebop.parameters.StringParameter; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.ui.authoring.BasicPageForm; -import com.arsdigita.cms.contenttypes.BaseContact; -import com.arsdigita.cms.contenttypes.Member; -import com.arsdigita.cms.contenttypes.util.MemberGlobalizationUtil; - -import org.apache.log4j.Logger; - -/** - * - * @author quasi - */ -public class BaseContactEditPersonPropertyForm extends BasicPageForm implements FormProcessListener, FormInitListener, FormSubmissionListener { - - private static final Logger logger = Logger.getLogger(BaseContactPropertyForm.class); - - private BaseContactPersonPropertiesStep m_step; - - public static final String SURNAME = Member.SURNAME; - public static final String GIVENNAME = Member.GIVENNAME; - public static final String TITLEPRE = Member.TITLEPRE; - public static final String TITLEPOST = Member.TITLEPOST; - - /** - * ID of the form - */ - public static final String ID = "BaseContactEditPerson"; - - /** - * Constrctor taking an ItemSelectionModel - * - * @param itemModel - */ - public BaseContactEditPersonPropertyForm(ItemSelectionModel itemModel) { - this(itemModel, null); - } - - /** - * Constrctor taking an ItemSelectionModel and an instance of BaseContactPropertiesStep. - * - * @param itemModel - * @param step - */ - public BaseContactEditPersonPropertyForm(ItemSelectionModel itemModel, BaseContactPersonPropertiesStep step) { - super(ID, itemModel); - m_step = step; - addSubmissionListener(this); - } - - @Override - public void addWidgets() { - add(new Label((String)MemberGlobalizationUtil.globalize("cms.contenttypes.ui.person.surname").localize())); - ParameterModel surnameParam = new StringParameter(SURNAME); - surnameParam.addParameterListener( new NotNullValidationListener( ) ); - surnameParam.addParameterListener( new StringInRangeValidationListener(0, 1000) ); - TextField surname = new TextField(surnameParam); - add(surname); - - add(new Label((String)MemberGlobalizationUtil.globalize("cms.contenttypes.ui.person.givenname").localize())); - ParameterModel givennameParam = new StringParameter(GIVENNAME); - givennameParam.addParameterListener( new NotNullValidationListener( ) ); - givennameParam.addParameterListener( new StringInRangeValidationListener(0, 1000) ); - TextField givenname = new TextField(givennameParam); - add(givenname); - - add(new Label((String)MemberGlobalizationUtil.globalize("cms.contenttypes.ui.person.titlepre").localize())); - ParameterModel titlepreParam = new StringParameter(TITLEPRE); - titlepreParam.addParameterListener( new StringInRangeValidationListener(0, 1000) ); - TextField titlepre = new TextField(titlepreParam); - add(titlepre); - - add(new Label((String)MemberGlobalizationUtil.globalize("cms.contenttypes.ui.person.titlepost").localize())); - ParameterModel titlepostParam = new StringParameter(TITLEPOST); - titlepostParam.addParameterListener( new StringInRangeValidationListener(0, 1000) ); - TextField titlepost = new TextField(titlepostParam); - add(titlepost); - } - - public void init(FormSectionEvent fse) { - FormData data = fse.getFormData(); - PageState state = fse.getPageState(); - BaseContact baseContact = (BaseContact)getItemSelectionModel().getSelectedObject(state); - - if(baseContact.getPerson() != null) { - data.put(SURNAME, baseContact.getPerson().getSurname()); - data.put(GIVENNAME, baseContact.getPerson().getGivenName()); - data.put(TITLEPRE, baseContact.getPerson().getTitlePre()); - data.put(TITLEPOST, baseContact.getPerson().getTitlePost()); - } - } - - public void submitted(FormSectionEvent fse) { - if (m_step != null && - getSaveCancelSection().getCancelButton().isSelected(fse.getPageState())) { - m_step.cancelStreamlinedCreation(fse.getPageState()); - } - } - - public void process(FormSectionEvent fse) { - FormData data = fse.getFormData(); - PageState state = fse.getPageState(); - BaseContact baseContact = (BaseContact)getItemSelectionModel().getSelectedObject(state); - - if (baseContact.getPerson() != null && - getSaveCancelSection().getSaveButton().isSelected(fse.getPageState())) { - baseContact.getPerson().setSurname((String)data.get(SURNAME)); - baseContact.getPerson().setGivenName((String)data.get(GIVENNAME)); - baseContact.getPerson().setTitlePre((String)data.get(TITLEPRE)); - baseContact.getPerson().setTitlePost((String)data.get(TITLEPOST)); - - baseContact.getPerson().save(); - } - - if (m_step != null) { - m_step.maybeForwardToNextStep(fse.getPageState()); - } - } -} \ No newline at end of file diff --git a/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/ui/BaseContactEntriesPropertiesStep.java.old b/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/ui/BaseContactEntriesPropertiesStep.java.old deleted file mode 100644 index e8b3d5787..000000000 --- a/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/ui/BaseContactEntriesPropertiesStep.java.old +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (C) 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.cms.ItemSelectionModel; -import com.arsdigita.cms.contenttypes.util.BaseContactGlobalizationUtil; -import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; -import com.arsdigita.cms.ui.authoring.BasicItemForm; -import com.arsdigita.cms.ui.authoring.SimpleEditStep; -import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; - -/** - * A UI step to manipulate Phones for the Contact object - * which is retrieved from the ItemSelectionModel. - * - * - * @author Shashin Shinde sshinde@redhat.com - * @version $Id: PhoBaseContactEntriesPropertiesStepva 287 2005-02-22 00:29:02Z sskracic $ - */ -public class BaseContactEntriesPropertiesStep extends SimpleEditStep { - - /** The name of the editing sheet added to this step */ - private static String ADD_CONTACT_ENTRY_SHEET_NAME = "addContactEntry"; - - public BaseContactEntriesPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent) { - this(itemModel, parent, null); - } - - public BaseContactEntriesPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent, String prefix) { - super(itemModel, parent, prefix); - - BasicItemForm addContactEntrySheet = new BaseContactEntryAddForm(itemModel); - add(ADD_CONTACT_ENTRY_SHEET_NAME, (String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.add_contactEntry").localize(), new WorkflowLockedComponentAccess(addContactEntrySheet, itemModel), addContactEntrySheet.getSaveCancelSection().getCancelButton()); - - BaseContactEntriesTable contactEntriesTable = new BaseContactEntriesTable(itemModel); - setDisplayComponent(contactEntriesTable); - - } - -} \ No newline at end of file diff --git a/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/ui/BaseContactEntriesTable.java.old b/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/ui/BaseContactEntriesTable.java.old deleted file mode 100644 index dad4aa864..000000000 --- a/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/ui/BaseContactEntriesTable.java.old +++ /dev/null @@ -1,272 +0,0 @@ -/* - * Copyright (C) 2008 Sören Bernstein 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.ControlLink; -import com.arsdigita.bebop.Label; -import com.arsdigita.bebop.PageState; -import com.arsdigita.bebop.Table; -import com.arsdigita.bebop.event.TableActionEvent; -import com.arsdigita.bebop.event.TableActionListener; -import com.arsdigita.bebop.table.TableCellRenderer; -import com.arsdigita.bebop.table.TableColumn; -import com.arsdigita.bebop.table.TableColumnModel; -import com.arsdigita.bebop.table.TableModel; -import com.arsdigita.bebop.table.TableModelBuilder; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.SecurityManager; -import com.arsdigita.cms.contenttypes.BaseContact; -import com.arsdigita.cms.contenttypes.BaseContactEntry; -import com.arsdigita.cms.contenttypes.BaseContactEntryCollection; -import com.arsdigita.cms.contenttypes.util.BaseContactGlobalizationUtil; -import com.arsdigita.cms.dispatcher.Utilities; -import com.arsdigita.cms.util.GlobalizationUtil; -import com.arsdigita.util.LockableImpl; -import java.math.BigDecimal; - -/** - * Lists all existing contact entries for a selected contact. - * - * @author Sören Bernstein (quasimodo) quasi@barkhof.uni-bremen.de - */ -public class BaseContactEntriesTable extends Table implements TableActionListener{ - - - private final String TABLE_COL_EDIT = "table_col_edit"; - private final String TABLE_COL_DEL = "table_col_del"; - - private ItemSelectionModel m_itemModel; - - /** - * Creates a new instance of BaseContactEntriesTable - */ - public BaseContactEntriesTable(final ItemSelectionModel itemModel) { - - super(); - this.m_itemModel = itemModel; - - // if table is empty: - setEmptyView(new Label(BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.contactEntry.none"))); - TableColumnModel tab_model = getColumnModel(); - - // define columns - tab_model.add(new TableColumn(0, BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.contactEntry.key").localize(), TABLE_COL_EDIT)); - tab_model.add(new TableColumn(1, BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.contactEntry.value").localize())); - tab_model.add(new TableColumn(2, BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.contactEntry.description").localize())); - tab_model.add(new TableColumn(3, BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.contactEntry.action").localize(), TABLE_COL_DEL)); - - setModelBuilder(new BaseContactTableModelBuilder(itemModel)); - - tab_model.get(0).setCellRenderer(new EditCellRenderer()); - tab_model.get(3).setCellRenderer(new DeleteCellRenderer()); - - addTableActionListener(this); - - } - - /** - * XXXX - * - */ - private class BaseContactTableModelBuilder extends LockableImpl implements TableModelBuilder { - - private ItemSelectionModel m_itemModel; - - public BaseContactTableModelBuilder(ItemSelectionModel itemModel) { - m_itemModel = itemModel; - } - - public TableModel makeModel(Table table, PageState state) { - - table.getRowSelectionModel().clearSelection(state); - - BaseContact baseContact = (BaseContact) m_itemModel.getSelectedObject(state); - -// if (baseContact != null && baseContact.hasContactEntries()) { - return new BaseContactTableModel(table, state, baseContact); -// } else { -// return Table.EMPTY_MODEL; -// } - } - } - - /** - * XXX - * - */ - private class BaseContactTableModel implements TableModel { - - final private int MAX_DESC_LENGTH = 25; - - private Table m_table; - private BaseContactEntryCollection m_baseContactEntryCollection; - private BaseContactEntry m_baseContactEntry; - - private BaseContactTableModel(Table t, PageState ps, BaseContact baseContact) { - m_table = t; - m_baseContactEntryCollection = baseContact.getContactEntries(); - } - - public int getColumnCount() { - return m_table.getColumnModel().size(); - } - - /** - * Check collection for the existence of another row. - * - * If exists, fetch the value of current BaseContactEntryCollection object - * into m_baseContactEntry class variable. - */ - public boolean nextRow() { - - if(m_baseContactEntryCollection != null && m_baseContactEntryCollection.next()){ - m_baseContactEntry = m_baseContactEntryCollection.getBaseContactEntry(); - return true; - - } else { - - return false; - - } - } - - /** - * Return the - * @see com.arsdigita.bebop.table.TableModel#getElementAt(int) - */ - public Object getElementAt(int columnIndex) { - switch (columnIndex){ - case 0: - return (String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.contactEntry.key." + m_baseContactEntry.getKey()).localize(); - case 1: - return m_baseContactEntry.getValue(); - case 2: - return (m_baseContactEntry.getDescription() != null && m_baseContactEntry.getDescription().length() > MAX_DESC_LENGTH) - ? m_baseContactEntry.getDescription().substring(0, MAX_DESC_LENGTH) - : m_baseContactEntry.getDescription(); - case 3: - return GlobalizationUtil.globalize("cms.ui.delete").localize(); - default: - return null; - } - } - - /** - * - * @see com.arsdigita.bebop.table.TableModel#getKeyAt(int) - */ - public Object getKeyAt(int columnIndex) { - return m_baseContactEntry.getID(); - } - - } - - /** - * Check for the permissions to edit item and put either a Label or - * a ControlLink accordingly. - */ - private class EditCellRenderer extends LockableImpl implements TableCellRenderer { - - public Component getComponent(Table table, PageState state, Object value, - boolean isSelected, Object key, - int row, int column) { - - SecurityManager sm = Utilities.getSecurityManager(state); - BaseContact baseContact = (BaseContact) m_itemModel.getSelectedObject(state); - - boolean canEdit = sm.canAccess(state.getRequest(), - SecurityManager.EDIT_ITEM, - baseContact); - if(canEdit) { - ControlLink link = new ControlLink(value.toString()); - return link; - } else { - return new Label(value.toString()); - } - } - } - - /** - * Check for the permissions to delete item and put either a Label or - * a ControlLink accordingly. - */ - private class DeleteCellRenderer extends LockableImpl implements TableCellRenderer { - - public Component getComponent(Table table, PageState state, Object value, - boolean isSelected, Object key, - int row, int column) { - - SecurityManager sm = Utilities.getSecurityManager(state); - BaseContact baseContact = (BaseContact) m_itemModel.getSelectedObject(state); - - boolean canDelete = sm.canAccess(state.getRequest(), - SecurityManager.DELETE_ITEM, - baseContact); - if(canDelete) { - ControlLink link = new ControlLink(value.toString()); - link.setConfirmation((String) BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.confirm_delete").localize()); - return link; - } else { - return new Label(value.toString()); - } - } - } - - /** - * Provide implementation to TableActionListener method. - * Code that comes into picture when a link on the table is clicked. - * Handles edit and delete event. - */ - public void cellSelected(TableActionEvent evt) { - - PageState state = evt.getPageState(); - - // Get selected BaseContactEntry - BaseContactEntry baseContactEntry = - new BaseContactEntry(new BigDecimal(evt.getRowKey().toString())); - - // Get BaseContact - BaseContact baseContact = (BaseContact) m_itemModel.getSelectedObject(state); - - // Get selected column - TableColumn col = getColumnModel().get(evt.getColumn().intValue()); - - // Edit - if(col.getHeaderKey().toString().equals(TABLE_COL_EDIT)) { - - } - - // Delete - if(col.getHeaderKey().toString().equals(TABLE_COL_DEL)) { - baseContact.removeContactEntry(baseContactEntry); - } - - } - - /** - * provide Implementation to TableActionListener method. - * Does nothing in our case. - */ - public void headSelected(TableActionEvent e) { - throw new UnsupportedOperationException("Not Implemented"); - } - - -} diff --git a/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/ui/BaseContactEntryAddForm.java.old b/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/ui/BaseContactEntryAddForm.java.old deleted file mode 100644 index 7f1986af6..000000000 --- a/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/ui/BaseContactEntryAddForm.java.old +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright (C) 2008 Sören Bernstein 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.Label; -import com.arsdigita.bebop.event.FormSectionEvent; -import com.arsdigita.bebop.form.Option; -import com.arsdigita.bebop.form.SingleSelect; -import com.arsdigita.bebop.form.TextField; -import com.arsdigita.bebop.parameters.NotNullValidationListener; -import com.arsdigita.bebop.parameters.ParameterModel; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.contenttypes.BaseContact; -import com.arsdigita.cms.contenttypes.BaseContactEntry; -import com.arsdigita.cms.contenttypes.util.BaseContactGlobalizationUtil; -import com.arsdigita.cms.ui.authoring.BasicItemForm; -import com.arsdigita.bebop.parameters.StringParameter; -import java.util.StringTokenizer; - -import org.apache.log4j.Logger; - -/** - * Generates a form for creating new localisations for the given category. - * - * This class is part of the admin GUI of CCM and extends the standard form - * in order to present forms for managing the multi-language categories. - * - * @author Sören Bernstein (quasimodo) quasi@zes.uni-bremen.de - */ -public class BaseContactEntryAddForm extends BasicItemForm { - private static final Logger s_log = Logger.getLogger(BaseContactEntryAddForm.class); - - private ItemSelectionModel m_itemModel; - - /** Creates a new instance of CategoryLocalizationAddForm */ - public BaseContactEntryAddForm(ItemSelectionModel itemModel) { - - super("BaseContactEntryAddForm",itemModel); - m_itemModel = itemModel; - - } - - protected void addWidgets() { - - // Key field - add(new Label(BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.contactEntry.key"))); - ParameterModel contactEntryKeyParam = new StringParameter(BaseContactEntry.KEY); - SingleSelect contactEntryKey = new SingleSelect(contactEntryKeyParam); - contactEntryKey.addValidationListener(new NotNullValidationListener()); - contactEntryKey.addOption(new Option("", new Label((String)BaseContactGlobalizationUtil.globalize("cms.ui.select_one").localize()))); - - // Add the Options to the SingleSelect widget - StringTokenizer keyList = BaseContact.getConfig().getContactEntryKeys(); - while(keyList.hasMoreElements()) { - String currentKey = keyList.nextToken(); - contactEntryKey.addOption(new Option(currentKey, ((String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.contactEntry.key." + currentKey).localize()))); - } - - add(contactEntryKey); - - // Value field - add(new Label(BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.contactEntry.value"))); - ParameterModel contactEntryValueParam = new StringParameter(BaseContactEntry.VALUE); - TextField contactEntryValue = new TextField(contactEntryValueParam); - contactEntryValue.addValidationListener(new NotNullValidationListener()); - add(contactEntryValue); - - // Description field, only for internal usage - add(new Label(BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.contactEntry.description"))); - ParameterModel contactEntryDescriptionParam = new StringParameter(BaseContactEntry.DESCRIPTION); - TextField contactEntryDescription = new TextField(contactEntryDescriptionParam); - add(contactEntryDescription); - - } - - public void init(FormSectionEvent fse) { - - } - - public void process(FormSectionEvent fse) { - FormData data = fse.getFormData(); - BaseContact baseContact = (BaseContact)m_itemModel.getSelectedObject(fse.getPageState()); - - // save only if save button was pressed - if (baseContact != null - && getSaveCancelSection().getSaveButton().isSelected(fse.getPageState())) { - - BaseContactEntry contactEntry = new BaseContactEntry(baseContact, - (String)data.get(BaseContactEntry.KEY), - (String)data.get(BaseContactEntry.VALUE), - (String)data.get(BaseContactEntry.DESCRIPTION)); - - baseContact.addContactEntry(contactEntry); - } - } -} diff --git a/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/ui/BaseContactPersonPropertiesStep.java.old b/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/ui/BaseContactPersonPropertiesStep.java.old deleted file mode 100644 index 8801ed9e4..000000000 --- a/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/ui/BaseContactPersonPropertiesStep.java.old +++ /dev/null @@ -1,85 +0,0 @@ -/* - * BaseContactPersonPropertiesStep.java - * - * Created on 4. Juli 2009, 15:12 - * - * To change this template, choose Tools | Template Manager - * and open the template in the editor. - */ - -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.cms.ItemSelectionModel; -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.toolbox.ui.DomainObjectPropertySheet; -import com.arsdigita.bebop.Component; -import com.arsdigita.bebop.Label; -import com.arsdigita.cms.contenttypes.Member; -import com.arsdigita.cms.contenttypes.util.MemberGlobalizationUtil; -import com.arsdigita.cms.contenttypes.util.BaseContactGlobalizationUtil; - -/** - * - * @author quasi - */ -public class BaseContactPersonPropertiesStep extends SimpleEditStep { - - public static final String ADD_PERSON_SHEET_NAME = "addPerson"; - public static final String EDIT_PERSON_SHEET_NAME = "editPerson"; - public static final String CHANGE_PERSON_SHEET_NAME = "changePerson"; - public static final String DELETE_PERSON_SHEET_NAME = "deletePerson"; - - /** - * Creates a new instance of BaseContactPersonPropertiesStep - */ - public BaseContactPersonPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent) { - this(itemModel, parent, ""); - } - - public BaseContactPersonPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent, String prefix) { - super(itemModel, parent, prefix); - -//XXX -// if(false/*EMPTY*/) { - - BasicPageForm addPersonSheet = new BaseContactAttachPersonPropertyForm(itemModel, this); - add(ADD_PERSON_SHEET_NAME, (String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.attach_person").localize(), new WorkflowLockedComponentAccess(addPersonSheet, itemModel), addPersonSheet.getSaveCancelSection().getCancelButton()); - - /* Set the displayComponent for this step */ -// setDisplayComponent(getEmptyPersonPropertySheet(itemModel)); - -// } else { - - BasicPageForm editPersonSheet = new BaseContactEditPersonPropertyForm(itemModel, this); - add(EDIT_PERSON_SHEET_NAME, (String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.edit_person").localize(), new WorkflowLockedComponentAccess(editPersonSheet, itemModel), editPersonSheet.getSaveCancelSection().getCancelButton()); - -// BasicPageForm changePersonSheet = new BaseContactEditPersonPropertyForm(itemModel, this); -// add(CHANGE_PERSON_SHEET_NAME, (String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.reattach_person").localize(), new WorkflowLockedComponentAccess(changePersonSheet, itemModel), changePersonSheet.getSaveCancelSection().getCancelButton()); - - BasicPageForm deletePersonSheet = new BaseContactDeletePersonForm(itemModel, this); - add(DELETE_PERSON_SHEET_NAME, (String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.delete_person").localize(), new WorkflowLockedComponentAccess(deletePersonSheet, itemModel), deletePersonSheet.getSaveCancelSection().getCancelButton()); - - /* Set the displayComponent for this step */ - setDisplayComponent(getPersonPropertySheet(itemModel)); -// } - - } - - public static Component getPersonPropertySheet(ItemSelectionModel itemModel) { - DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(itemModel); - - sheet.add((String)MemberGlobalizationUtil.globalize("cms.contenttypes.ui.person.surname").localize(), "person." + Member.SURNAME); - sheet.add((String)MemberGlobalizationUtil.globalize("cms.contenttypes.ui.person.givenname").localize(), "person." + Member.GIVENNAME); - sheet.add((String)MemberGlobalizationUtil.globalize("cms.contenttypes.ui.person.titlepre").localize(), "person." + Member.TITLEPRE); - sheet.add((String)MemberGlobalizationUtil.globalize("cms.contenttypes.ui.person.titlepost").localize(), "person." + Member.TITLEPOST); - - return sheet; - } - - public static Component getEmptyPersonPropertySheet(ItemSelectionModel itemModel) { - return new Label(((String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.emptyPerson").localize())); - } -} diff --git a/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/ui/BaseContactPropertiesStep.java b/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/ui/BaseContactPropertiesStep.java deleted file mode 100644 index 791a989ab..000000000 --- a/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/ui/BaseContactPropertiesStep.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; -import com.arsdigita.bebop.Component; - -import org.apache.log4j.Logger; - -/** - * AuthoringStep for the basic properties of a basic contact - */ -public class BaseContactPropertiesStep extends com.arsdigita.cms.basetypes.ui.ContactPropertiesStep { - - private static final Logger logger = Logger.getLogger(BaseContactPropertiesStep.class); - - /** - * Name of the this edit sheet (Don't know if this this really needed. - * It has the same value in almost all PropertiesStep classes) - */ - public static final String EDIT_BASIC_SHEET_NAME = "editBasic"; - - /** - * Constructor for the PropertiesStep. - * - * @param itemModel - * @param parent - */ - public BaseContactPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent) { - super(itemModel, parent); - } - - /** - * Creates and returns the sheet for editing the basic properties - * of an organization. (@see BaseContactPropertyForm). - * - * @param itemModel - * @return The sheet for editing the properties of the organization. - */ - public static Component getBaseContactPropertySheet(ItemSelectionModel itemModel) { - return com.arsdigita.cms.basetypes.ui.ContactPropertiesStep.getContactPropertySheet(itemModel); - } - -} diff --git a/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/ui/BaseContactPropertyForm.java.old b/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/ui/BaseContactPropertyForm.java.old deleted file mode 100644 index f5d9d53d3..000000000 --- a/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/ui/BaseContactPropertyForm.java.old +++ /dev/null @@ -1,97 +0,0 @@ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.FormProcessException; -import com.arsdigita.cms.ui.authoring.BasicPageForm; -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 com.arsdigita.bebop.FormData; -import com.arsdigita.cms.contenttypes.BaseContact; - -import org.apache.log4j.Logger; - -/** - * Form for editing the basic properties of a basic contact. - */ -public class BaseContactPropertyForm extends BasicPageForm implements FormProcessListener, FormInitListener, FormSubmissionListener { - - private static final Logger logger = Logger.getLogger(BaseContactPropertyForm.class); - - private BaseContactPropertiesStep m_step; - - public static final String PERSON = BaseContact.PERSON; - public static final String ADRESS = BaseContact.ADDRESS; - public static final String CONTACT_ENTRIES= BaseContact.CONTACT_ENTRIES; - - /** - * ID of the form - */ - public static final String ID = "BaseContact_edit"; - - /** - * Constrctor taking an ItemSelectionModel - * - * @param itemModel - */ - public BaseContactPropertyForm(ItemSelectionModel itemModel) { - this(itemModel, null); - } - - /** - * Constrctor taking an ItemSelectionModel and an instance of BaseContactPropertiesStep. - * - * @param itemModel - * @param step - */ - public BaseContactPropertyForm(ItemSelectionModel itemModel, BaseContactPropertiesStep step) { - super(ID, itemModel); - m_step = step; - addSubmissionListener(this); - } - - @Override - public void addWidgets() { - super.addWidgets(); - -/* - add(new Label((String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.basic_properties.description").localize()))); - TextArea description = new TextArea(DESCRIPTION); - description.setRows(5); - description.setCols(30); - add(description); -*/ - } - - @Override - public void init(FormSectionEvent e) throws FormProcessException { - FormData data = e.getFormData(); - BaseContact baseContact = (BaseContact)super.initBasicWidgets(e); - -// data.put(DESCRIPTION, baseContact.getDescription()); - } - - @Override - public void process(FormSectionEvent e) throws FormProcessException { - FormData data = e.getFormData(); - - BaseContact baseContact = (BaseContact)super.processBasicWidgets(e); - - if((baseContact != null) && (getSaveCancelSection().getSaveButton().isSelected(e.getPageState()))) { -// baseContact.setDescription((String)data.get(DESCRIPTION)); - - baseContact.save(); - } - - if(m_step != null) { - m_step.maybeForwardToNextStep(e.getPageState()); - } - } - - public void submitted(FormSectionEvent e) throws FormProcessException { - if((m_step != null) && (getSaveCancelSection().getCancelButton().isSelected(e.getPageState()))) { - m_step.cancelStreamlinedCreation(e.getPageState()); - } - } -} \ No newline at end of file diff --git a/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/util/BaseContactGlobalizationUtil.java.old b/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/util/BaseContactGlobalizationUtil.java.old deleted file mode 100755 index 7efceffb3..000000000 --- a/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/util/BaseContactGlobalizationUtil.java.old +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (C) 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.util; - -import com.arsdigita.globalization.GlobalizedMessage; - -/** - *

- * . - * Contains methods to simplify globalizing keys - *

- * - * @author randyg@arsdigita.com - * @version $Revision: #4 $ $Date: 2004/08/17 $ - */ - -public class BaseContactGlobalizationUtil { - - final public static String BUNDLE_NAME = - "com.arsdigita.cms.contenttypes.util.BaseContactResourceBundle"; - - /** - * This returns a globalized message using the type specific bundle, - * BUNDLE_NAME - */ - public static GlobalizedMessage globalize(String key) { - return new GlobalizedMessage(key, BUNDLE_NAME); - } - - /** - * This returns a globalized message using the type specific bundle, - * BUNDLE_NAME - */ - public static GlobalizedMessage globalize(String key, Object[] args) { - return new GlobalizedMessage(key, BUNDLE_NAME, args); - } -} diff --git a/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/util/BaseContactResourceBundle.java.old b/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/util/BaseContactResourceBundle.java.old deleted file mode 100755 index 3fbd9962a..000000000 --- a/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/util/BaseContactResourceBundle.java.old +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) 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.util; - -import java.util.PropertyResourceBundle; -import com.arsdigita.globalization.ChainedResourceBundle; -import com.arsdigita.cms.CMSGlobalized; - -/** - * Form to edit the basic properties of an event. This form can be extended to - * create forms for Event subclasses. - **/ -public class BaseContactResourceBundle extends ChainedResourceBundle implements CMSGlobalized { - - public final static String BASE_CONTACT_BUNDLE_NAME = - "com.arsdigita.cms.contenttypes.BaseContactResources"; - - public BaseContactResourceBundle() { - super(); - addBundle((PropertyResourceBundle)getBundle(BASE_CONTACT_BUNDLE_NAME)); - addBundle((PropertyResourceBundle)getBundle(BUNDLE_NAME)); - } -} diff --git a/ccm-cms-types-baseContact/application.xml b/ccm-cms-types-contact/application.xml similarity index 88% rename from ccm-cms-types-baseContact/application.xml rename to ccm-cms-types-contact/application.xml index 9555c5c79..167200261 100755 --- a/ccm-cms-types-baseContact/application.xml +++ b/ccm-cms-types-contact/application.xml @@ -1,6 +1,6 @@ - The BaseContact Content Type for the Red Hat CCM CMS. + The Contact Content Type for the Red Hat CCM CMS. diff --git a/ccm-cms-types-baseContact/pdl/com/arsdigita/content-types/BaseContact.pdl b/ccm-cms-types-contact/pdl/com/arsdigita/content-types/Contact.pdl similarity index 58% rename from ccm-cms-types-baseContact/pdl/com/arsdigita/content-types/BaseContact.pdl rename to ccm-cms-types-contact/pdl/com/arsdigita/content-types/Contact.pdl index 203a60c29..ff6698864 100644 --- a/ccm-cms-types-baseContact/pdl/com/arsdigita/content-types/BaseContact.pdl +++ b/ccm-cms-types-contact/pdl/com/arsdigita/content-types/Contact.pdl @@ -5,6 +5,6 @@ import com.arsdigita.kernel.ACSObject; import com.arsdigita.cms.*; // Contact Object -object type BaseContact extends com.arsdigita.cms.basetypes.Contact { - reference key ( ct_baseContacts.contact_id ); +object type Contact extends com.arsdigita.cms.basetypes.Contact { + reference key ( ct_contacts.contact_id ); } diff --git a/ccm-cms-types-baseContact/sql/ccm-cms-types-baseContact/postgres-create.sql b/ccm-cms-types-contact/sql/ccm-cms-types-contact/postgres-create.sql similarity index 100% rename from ccm-cms-types-baseContact/sql/ccm-cms-types-baseContact/postgres-create.sql rename to ccm-cms-types-contact/sql/ccm-cms-types-contact/postgres-create.sql diff --git a/ccm-cms-types-baseContact/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/BaseContact.xml b/ccm-cms-types-contact/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Contact.xml similarity index 75% rename from ccm-cms-types-baseContact/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/BaseContact.xml rename to ccm-cms-types-contact/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Contact.xml index 12724d942..9ede18e2c 100644 --- a/ccm-cms-types-baseContact/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/BaseContact.xml +++ b/ccm-cms-types-contact/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Contact.xml @@ -5,10 +5,10 @@ xsi:schemaLocation="http://xmlns.redhat.com/cms/content-types content-types.xsd"> + label="Contact" + description="A Contact type" + objectType="com.arsdigita.cms.contenttypes.Contact" + classname="com.arsdigita.cms.contenttypes.Contact"> @@ -18,7 +18,7 @@ labelBundle="com.arsdigita.cms.ui.CMSResources" descriptionKey="cms.contenttypes.shared.basic_properties.description" descriptionBundle="com.arsdigita.cms.ui.CMSResources" - component="com.arsdigita.cms.contenttypes.ui.BaseContactPropertiesStep" + component="com.arsdigita.cms.basetypes.ui.ContactPropertiesStep" ordering="1"/> diff --git a/ccm-cms-types-baseContact/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/BaseContact.xml b/ccm-cms-types-contact/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/Contact.xml similarity index 95% rename from ccm-cms-types-baseContact/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/BaseContact.xml rename to ccm-cms-types-contact/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/Contact.xml index 14f05788a..48f0872ac 100644 --- a/ccm-cms-types-baseContact/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/BaseContact.xml +++ b/ccm-cms-types-contact/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/Contact.xml @@ -8,7 +8,7 @@ The default properties for BaseContact are left as is and are inherited from ContentPage --> - + diff --git a/ccm-cms-types-contact/src/ccm-cms-types-contact.config b/ccm-cms-types-contact/src/ccm-cms-types-contact.config new file mode 100755 index 000000000..9a10f1073 --- /dev/null +++ b/ccm-cms-types-contact/src/ccm-cms-types-contact.config @@ -0,0 +1,4 @@ + + + + diff --git a/ccm-cms-types-baseContact/src/ccm-cms-types-baseContact.load b/ccm-cms-types-contact/src/ccm-cms-types-contact.load similarity index 50% rename from ccm-cms-types-baseContact/src/ccm-cms-types-baseContact.load rename to ccm-cms-types-contact/src/ccm-cms-types-contact.load index c1a1429dc..dbce608bb 100755 --- a/ccm-cms-types-baseContact/src/ccm-cms-types-baseContact.load +++ b/ccm-cms-types-contact/src/ccm-cms-types-contact.load @@ -6,11 +6,11 @@ - - +
+ - - + + diff --git a/ccm-cms-types-contact/src/com/arsdigita/cms/contenttypes/Contact.java b/ccm-cms-types-contact/src/com/arsdigita/cms/contenttypes/Contact.java new file mode 100755 index 000000000..6f3c940a1 --- /dev/null +++ b/ccm-cms-types-contact/src/com/arsdigita/cms/contenttypes/Contact.java @@ -0,0 +1,78 @@ +/* + * Copyright (C) 2003-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.persistence.OID; +import com.arsdigita.persistence.DataObject; +import com.arsdigita.domain.DataObjectNotFoundException; +import com.arsdigita.cms.ContentType; +import com.arsdigita.util.Assert; +import java.math.BigDecimal; + + +/** + * This content type represents an Contact + * + */ +public class Contact extends com.arsdigita.cms.basetypes.Contact { + + /** Data object type for tihs domain object */ + public static final String BASE_DATA_OBJECT_TYPE + = "com.arsdigita.cms.contenttypes.Contact"; + + public Contact() { + super(BASE_DATA_OBJECT_TYPE); + } + + public Contact(BigDecimal id) + throws DataObjectNotFoundException { + this(new OID(BASE_DATA_OBJECT_TYPE, id)); + } + + public Contact(OID id) + throws DataObjectNotFoundException { + super(id); + } + + public Contact(DataObject obj) { + super(obj); + } + + public Contact(String type) { + super(type); + } + + @Override + public void beforeSave() { + super.beforeSave(); + + Assert.exists(getContentType(), ContentType.class); + } + + /** + * Retrieves the current configuration + */ +// public static final BaseContactConfig getConfig() { +// return s_config; +// } + + + /////////////////////////////////////////////////////////////// + // accessors +} diff --git a/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/BaseContactConfig.java b/ccm-cms-types-contact/src/com/arsdigita/cms/contenttypes/ContactConfig.java similarity index 84% rename from ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/BaseContactConfig.java rename to ccm-cms-types-contact/src/com/arsdigita/cms/contenttypes/ContactConfig.java index 4d39d7822..02a1660f8 100644 --- a/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/BaseContactConfig.java +++ b/ccm-cms-types-contact/src/com/arsdigita/cms/contenttypes/ContactConfig.java @@ -9,13 +9,13 @@ import java.util.StringTokenizer; import org.apache.log4j.Logger; /** - * Stores the configuration record for the baseContact. + * Stores the configuration record for the contact. * * @author Sören Bernstein (quasimodo) quasi@zes.uni-bremen.de */ -public final class BaseContactConfig extends AbstractConfig { +public final class ContactConfig extends AbstractConfig { - private static Logger s_log = Logger.getLogger(BaseContactConfig.class); + private static Logger s_log = Logger.getLogger(ContactConfig.class); private final Parameter m_hidePerson; private final Parameter m_hideAddress; @@ -27,13 +27,13 @@ public final class BaseContactConfig extends AbstractConfig { /** * Public Constructor */ - public BaseContactConfig() { + public ContactConfig() { /** * If set to true disables the possibility to attach a person ct */ m_hidePerson = new BooleanParameter - ("com.arsdigita.cms.contenttypes.baseContact.hide_person", + ("com.arsdigita.cms.contenttypes.contact.hide_person", Parameter.REQUIRED, new Boolean(false)); @@ -41,7 +41,7 @@ public final class BaseContactConfig extends AbstractConfig { * If set to true disables the possibility to attach a baseAddress ct */ m_hideAddress = new BooleanParameter - ("com.arsdigita.cms.contenttypes.baseContact.hide_address", + ("com.arsdigita.cms.contenttypes.contact.hide_address", Parameter.REQUIRED, new Boolean(false)); @@ -49,7 +49,7 @@ public final class BaseContactConfig extends AbstractConfig { * If set to true hides the postal code entry field for the attached address ct */ m_hideAddressPostalCode = new BooleanParameter - ("com.arsdigita.cms.contenttypes.baseContact.address.hide_postal_code", + ("com.arsdigita.cms.contenttypes.contact.address.hide_postal_code", Parameter.REQUIRED, new Boolean(false)); @@ -57,7 +57,7 @@ public final class BaseContactConfig extends AbstractConfig { * If set to true hides the state entry field for the attached address ct */ m_hideAddressState = new BooleanParameter - ("com.arsdigita.cms.contenttypes.baseContact.address.hide_state", + ("com.arsdigita.cms.contenttypes.contact.address.hide_state", Parameter.REQUIRED, new Boolean(false)); @@ -65,14 +65,14 @@ public final class BaseContactConfig extends AbstractConfig { * If set to true hides the country selection for the attaches address ct */ m_hideAddressCountry = new BooleanParameter - ("com.arsdigita.cms.contenttypes.baseContact.address.hide_country", + ("com.arsdigita.cms.contenttypes.contact.address.hide_country", Parameter.REQUIRED, new Boolean(false)); /** */ m_contactEntryKeys = new StringParameter - ("com.arsdigita.cms.contenttypes.baseContact.contact_entry_keys", + ("com.arsdigita.cms.contenttypes.contact.contact_entry_keys", Parameter.REQUIRED, "contact_type,office_hours,phone_office,phone_private,phone_mobile,email,fax,im,www"); diff --git a/ccm-cms-types-contact/src/com/arsdigita/cms/contenttypes/ContactConfig_parameter.properties b/ccm-cms-types-contact/src/com/arsdigita/cms/contenttypes/ContactConfig_parameter.properties new file mode 100644 index 000000000..218882b2f --- /dev/null +++ b/ccm-cms-types-contact/src/com/arsdigita/cms/contenttypes/ContactConfig_parameter.properties @@ -0,0 +1,29 @@ +com.arsdigita.cms.contenttypes.contact.hide_person.title=Hide person attachment +com.arsdigita.cms.contenttypes.contact.hide_person.purpose=Hide the part to attach a person CT +com.arsdigita.cms.contenttypes.contact.hide_person.example=false +com.arsdigita.cms.contenttypes.contact.hide_person.format=[boolean] + +com.arsdigita.cms.contenttypes.contact.hide_address.title=Hide address attachment +com.arsdigita.cms.contenttypes.contact.hide_address.purpose=Hide the part to attach a baseAddress CT +com.arsdigita.cms.contenttypes.contact.hide_address.example=false +com.arsdigita.cms.contenttypes.contact.hide_address.format=[boolean] + +com.arsdigita.cms.contenttypes.contact.address.hide_postal_code.title=Hide postal code for attached adress +com.arsdigita.cms.contenttypes.contact.address.hide_postal_code.purpose=Hide the postal code entry field for the attached baseAddress +com.arsdigita.cms.contenttypes.contact.address.hide_postal_code.example=false +com.arsdigita.cms.contenttypes.contact.address.hide_postal_code.format=[boolean] + +com.arsdigita.cms.contenttypes.contact.address.hide_state.title=Hide state for attached adress +com.arsdigita.cms.contenttypes.contact.address.hide_state.purpose=Hide the state entry field for the attached baseAddress +com.arsdigita.cms.contenttypes.contact.address.hide_state.example=false +com.arsdigita.cms.contenttypes.contact.address.hide_state.format=[boolean] + +com.arsdigita.cms.contenttypes.contact.address.hide_country.title=Hide country for attached address +com.arsdigita.cms.contenttypes.contact.address.hide_country.purpose=Hide the country selection box for the attached baseAddress +com.arsdigita.cms.contenttypes.contact.address.hide_country.example=false +com.arsdigita.cms.contenttypes.contact.address.hide_country.format=[boolean] + +com.arsdigita.cms.contenttypes.contact.contact_entry_keys.title=Select available contact entry types +com.arsdigita.cms.contenttypes.contact.contact_entry_keys.purpose=Select available contact entry types and define display order +com.arsdigita.cms.contenttypes.contact.contact_entry_keys.example=contact_type,office_hours,phone_office,phone_private,phone_mobile,email,fax,im,www +com.arsdigita.cms.contenttypes.contact.contact_entry_keys.format=[string] diff --git a/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/BaseContactInitializer.java b/ccm-cms-types-contact/src/com/arsdigita/cms/contenttypes/ContactInitializer.java similarity index 53% rename from ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/BaseContactInitializer.java rename to ccm-cms-types-contact/src/com/arsdigita/cms/contenttypes/ContactInitializer.java index b7ef6ea81..9f1455152 100755 --- a/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/BaseContactInitializer.java +++ b/ccm-cms-types-contact/src/com/arsdigita/cms/contenttypes/ContactInitializer.java @@ -7,23 +7,23 @@ import org.apache.log4j.Logger; * * @author Sören Bernstein; */ -public class BaseContactInitializer extends ContentTypeInitializer { +public class ContactInitializer extends ContentTypeInitializer { - private static final Logger s_log = Logger.getLogger(BaseContactInitializer.class); + private static final Logger s_log = Logger.getLogger(ContactInitializer.class); - public BaseContactInitializer() { - super("ccm-cms-types-baseContact.pdl.mf", - BaseContact.BASE_DATA_OBJECT_TYPE); + public ContactInitializer() { + super("ccm-cms-types-contact.pdl.mf", + Contact.BASE_DATA_OBJECT_TYPE); } public String[] getStylesheets() { return new String[] { - "/static/content-types/com/arsdigita/cms/contenttypes/BaseContact.xsl" + "/static/content-types/com/arsdigita/cms/contenttypes/Contact.xsl" }; } public String getTraversalXML() { - return "/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/BaseContact.xml"; + return "/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/Contact.xml"; } } diff --git a/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/BaseContactLoader.java b/ccm-cms-types-contact/src/com/arsdigita/cms/contenttypes/ContactLoader.java similarity index 58% rename from ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/BaseContactLoader.java rename to ccm-cms-types-contact/src/com/arsdigita/cms/contenttypes/ContactLoader.java index 6b1a8f1d6..85239378d 100755 --- a/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/BaseContactLoader.java +++ b/ccm-cms-types-contact/src/com/arsdigita/cms/contenttypes/ContactLoader.java @@ -6,10 +6,10 @@ package com.arsdigita.cms.contenttypes; * * @author Sören Bernstein */ -public class BaseContactLoader extends AbstractContentTypeLoader { +public class ContactLoader extends AbstractContentTypeLoader { private static final String[] TYPES = { - "/WEB-INF/content-types/com/arsdigita/cms/contenttypes/BaseContact.xml" + "/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Contact.xml" }; public String[] getTypes() { diff --git a/ccm-cms-types-contact/src/com/arsdigita/cms/contenttypes/ContactResources.properties b/ccm-cms-types-contact/src/com/arsdigita/cms/contenttypes/ContactResources.properties new file mode 100755 index 000000000..a9c9e8ca7 --- /dev/null +++ b/ccm-cms-types-contact/src/com/arsdigita/cms/contenttypes/ContactResources.properties @@ -0,0 +1,50 @@ +cms.contenttypes.ui.contact.basic_properties=Basic Properties +cms.contenttypes.ui.contact.edit_basic_properties=Edit Basic Properties +cms.contenttypes.ui.contact.edit_basic_properties.description=Description +cms.contenttypes.ui.contact.confirm_delete=Sure? +cms.contenttypes.ui.contact.person=Person +cms.contenttypes.ui.contact.address=Address + +cms.contenttypes.ui.contact.attach_address=Attach Address +cms.contenttypes.ui.contact.edit_address=Edit Address +cms.contenttypes.ui.contact.reattach_address=Reattach Address +cms.contenttypes.ui.contact.delete_address=Delete Address +cms.contenttypes.ui.contact.emptyAddress=There is no Address attached +cms.contenttypes.ui.contact.select_address=Please select a contact content type +cms.contenttypes.ui.contact.select_address.add=Add +cms.contenttypes.ui.contact.select_address.change=Change +cms.contenttypes.ui.contact.select_address.wrong_type=BaseAddress selection is required +cms.contenttypes.ui.contact.select_address.cancelled=cancelled +cms.contenttypes.ui.contact.delete_address.label=Do you want to delete the link to the contact content type? +cms.contenttypes.ui.contact.delete_address.button_label=Delete + +cms.contenttypes.ui.contact.attach_person=Attach Person +cms.contenttypes.ui.contact.edit_person=Edit Person +cms.contenttypes.ui.contact.reattach_person=Reattach Person +cms.contenttypes.ui.contact.delete_person=Delete Person +cms.contenttypes.ui.contact.emptyPerson=There is no Address attached +cms.contenttypes.ui.contact.select_person=Please select a Person content type +cms.contenttypes.ui.contact.select_person.add=Add +cms.contenttypes.ui.contact.select_person.change=Change +cms.contenttypes.ui.contact.select_person.wrong_type=Person selection is required +cms.contenttypes.ui.contact.select_person.cancelled=cancelled +cms.contenttypes.ui.contact.delete_person.label=Do you want to delete the link to the Person content type? +cms.contenttypes.ui.contact.delete_person.button_label=Delete + +cms.contenttypes.ui.contact.add_contactEntry=Add Contact Entry +cms.contenttypes.ui.contact.contactEntry=Contact Entries +cms.contenttypes.ui.contact.contactEntry.key=Type +cms.contenttypes.ui.contact.contactEntry.value=Value +cms.contenttypes.ui.contact.contactEntry.description=Description (internal use only) +cms.contenttypes.ui.contact.contactEntry.action=Action + +cms.contenttypes.ui.contact.contactEntry.key.contact_type=Type of Contact +cms.contenttypes.ui.contact.contactEntry.key.office_hours=Office Hours +cms.contenttypes.ui.contact.contactEntry.key.phone_office=Phone (office) +cms.contenttypes.ui.contact.contactEntry.key.phone_private=Phone (private) +cms.contenttypes.ui.contact.contactEntry.key.phone_mobile=Phone (mobile) +cms.contenttypes.ui.contact.contactEntry.key.email=eMail +cms.contenttypes.ui.contact.contactEntry.key.fax=Fax +cms.contenttypes.ui.contact.contactEntry.key.im=Instant Messenger +cms.contenttypes.ui.contact.contactEntry.key.www=Homepage + diff --git a/ccm-cms-types-contact/src/com/arsdigita/cms/contenttypes/ContactResources_de.properties b/ccm-cms-types-contact/src/com/arsdigita/cms/contenttypes/ContactResources_de.properties new file mode 100644 index 000000000..44f461576 --- /dev/null +++ b/ccm-cms-types-contact/src/com/arsdigita/cms/contenttypes/ContactResources_de.properties @@ -0,0 +1,52 @@ +cms.contenttypes.ui.contact.basic_properties=Eigenschaften von Contact +cms.contenttypes.ui.contact.edit_basic_properties=Bearbeiten +cms.contenttypes.ui.contact.edit_basic_properties.description=Description +cms.contenttypes.ui.contact.confirm_delete=Sind Sie sicher? +cms.contenttypes.ui.contact.person=Person +cms.contenttypes.ui.contact.address=Adresse + +cms.contenttypes.ui.contact.attach_address=Adresse verkn\u00FCpfen +cms.contenttypes.ui.contact.edit_address=Adresse bearbeiten +cms.contenttypes.ui.contact.reattach_address=Adresse neu verkn\u00FCpfen +cms.contenttypes.ui.contact.delete_address=Adresse l\u00F6schen +cms.contenttypes.ui.contact.emptyAddress=Zur Zeit ist keine Adresse verkn\u00FCpft +cms.contenttypes.ui.contact.select_address=Bitte w\u00E4hlen Sie eine Eintrag vom Typ BaseAddress +cms.contenttypes.ui.contact.select_address.add=Verkn\u00FCpfen +cms.contenttypes.ui.contact.select_address.change=Ver\u00E4ndern +cms.contenttypes.ui.contact.select_address.wrong_type=Der gew\u00E4hlte Eintrag ist nicht vom Typ BaseAddress +cms.contenttypes.ui.contact.select_address.cancelled=Abbruch +cms.contenttypes.ui.contact.delete_address.label=Wollen Sie die Verkn\u00FCpfung zur Adresse entfernen? +cms.contenttypes.ui.contact.delete_address.button_label=L\u00F6schen + +cms.contenttypes.ui.contact.attach_person=Person verkn\u00FCpfen +cms.contenttypes.ui.contact.edit_person=Person bearbeiten +cms.contenttypes.ui.contact.reattach_person=Person neu verkn\u00FCpfen +cms.contenttypes.ui.contact.delete_person=Person l\u00F6schen +cms.contenttypes.ui.contact.emptyPerson=Zur Zeit ist keine Person verkn\u00FCft +cms.contenttypes.ui.contact.select_person=Bitte w\u00E4hlen Sie einen Eintrag vom Typ Person +cms.contenttypes.ui.contact.select_person.add=Verkn\u00FCpfen +cms.contenttypes.ui.contact.select_person.change=Ver\u00E4ndern +cms.contenttypes.ui.contact.select_person.wrong_type=Der gew\u00E4hlte Eintrag ist nicht vom Typ Person +cms.contenttypes.ui.contact.select_person.cancelled=Abbruch +cms.contenttypes.ui.contact.delete_person.label=WollenSie die Verkn\u00FCfung zur Person entfernen? +cms.contenttypes.ui.contact.delete_person.button_label=L\u00F6schen + +cms.contenttypes.ui.contact.add_contactEntry=Kontaktinformation hinzuf\u00FCgen +cms.contenttypes.ui.contact.contactEntry=Kontaktinformationen +cms.contenttypes.ui.contact.contactEntry.key=Art der Information +cms.contenttypes.ui.contact.contactEntry.value=Inhalt +cms.contenttypes.ui.contact.contactEntry.description=Beschreibung (wird nicht \u00F6ffentlich angezeigt) +cms.contenttypes.ui.contact.contactEntry.action=Aktionen + +cms.contenttypes.ui.contact.contactEntry.key.contact_type=Kontaktart +cms.contenttypes.ui.contact.contactEntry.key.office_hours=\u00D6ffnungszeiten +cms.contenttypes.ui.contact.contactEntry.key.phone_office=Telefon (B\u00FCro) +cms.contenttypes.ui.contact.contactEntry.key.phone_private=Telefon (Privat) +cms.contenttypes.ui.contact.contactEntry.key.phone_mobile=Telefon (Mobil) +cms.contenttypes.ui.contact.contactEntry.key.email=E-Mail +cms.contenttypes.ui.contact.contactEntry.key.fax=Fax +cms.contenttypes.ui.contact.contactEntry.key.im=Instant Messenger +cms.contenttypes.ui.contact.contactEntry.key.www=Homepage + + +cms.contenttypes.ui.contact.contactEntry.none=Zur Zeit sind keine Kontaktinformatioonen vorhanden diff --git a/ccm-cms-types-baseContact/web/static/content-types/com/arsdigita/cms/contenttypes/BaseContact.xsl b/ccm-cms-types-contact/web/static/content-types/com/arsdigita/cms/contenttypes/Contact.xsl similarity index 84% rename from ccm-cms-types-baseContact/web/static/content-types/com/arsdigita/cms/contenttypes/BaseContact.xsl rename to ccm-cms-types-contact/web/static/content-types/com/arsdigita/cms/contenttypes/Contact.xsl index a039f12d5..ef2182168 100644 --- a/ccm-cms-types-baseContact/web/static/content-types/com/arsdigita/cms/contenttypes/BaseContact.xsl +++ b/ccm-cms-types-contact/web/static/content-types/com/arsdigita/cms/contenttypes/Contact.xsl @@ -6,8 +6,8 @@ xmlns:cms="http://www.arsdigita.com/cms/1.0" version="1.0"> - +
@@ -29,8 +29,8 @@
- +

Address diff --git a/ccm-ldn-types-contact/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Contact.xml b/ccm-ldn-types-contact/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Contact.xml index 023aac643..a8b2b8315 100755 --- a/ccm-ldn-types-contact/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Contact.xml +++ b/ccm-ldn-types-contact/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Contact.xml @@ -1,7 +1,7 @@