From 2b74a1ab21fc4c7aebd9073d515c684deb19b73e Mon Sep 17 00:00:00 2001 From: quasi Date: Mon, 31 May 2010 12:01:44 +0000 Subject: [PATCH] Basetypes umbenannt nach GenericXXX und in cms.contenttypes verschoben git-svn-id: https://svn.libreccm.org/ccm/trunk@448 8810af33-2d31-482b-a856-94f89814c4df --- .../ItemImageAttachmentInitializer.java | 10 +- .../com/arsdigita/content-types/Address.pdl | 3 +- .../arsdigita/cms/contenttypes/Address.xml | 6 +- .../arsdigita/cms/contenttypes/Address.java | 6 +- .../com/arsdigita/content-types/Article.pdl | 4 +- .../arsdigita/cms/contenttypes/Article.xml | 40 ++++--- .../arsdigita/cms/contenttypes/Article.java | 4 +- .../cms/contenttypes/ArticleInitializer.java | 4 +- .../com/arsdigita/content-types/Contact.pdl | 3 +- .../arsdigita/cms/contenttypes/Contact.xml | 2 +- .../arsdigita/cms/contenttypes/Contact.java | 4 +- .../content-types/OrganizationRole.pdl | 4 +- .../cms/contenttypes/OrganizationRole.java | 10 +- .../ui/OrganizationRolePropertyForm.java | 14 +-- .../content-types/HealthCareFacility.pdl | 8 +- .../cms/contenttypes/HealthCareFacility.java | 14 +-- .../HealthCareFacilityContactCollection.java | 4 +- ...althCareFacilityAddressPropertiesStep.java | 20 ++-- ...CareFacilityAttachAddressPropertyForm.java | 4 +- .../ui/HealthCareFacilityContactAddForm.java | 12 +- .../ui/HealthCareFacilityContactTable.java | 8 +- ...thCareFacilityEditAddressPropertyForm.java | 30 ++--- .../com/arsdigita/content-types/Member.pdl | 9 +- .../com/arsdigita/cms/contenttypes/Member.xml | 4 +- .../arsdigita/cms/contenttypes/Member.java | 3 +- .../contenttypes/ui/MemberPropertiesStep.java | 6 +- .../contenttypes/ui/MemberPropertyForm.java | 5 +- .../com/arsdigita/content-types/NewsItem.pdl | 4 +- .../arsdigita/cms/contenttypes/NewsItem.xml | 2 +- .../arsdigita/cms/contenttypes/NewsItem.java | 2 +- .../arsdigita/content-types/Membership.pdl | 4 +- .../content-types/OrganizationalUnit.pdl | 6 +- .../cms/contenttypes/Membership.java | 14 +-- .../cms/contenttypes/OrganizationalUnit.java | 18 +-- .../MembershipPropertyForm.java | 6 +- .../organizationalunit/MembershipTable.java | 4 +- ...ionalUnitChooseAssistentDirectorTable.java | 10 +- ...OrganizationalUnitChooseDirectorTable.java | 10 +- .../GenericAddress.pdl} | 4 +- .../GenericArticle.pdl} | 10 +- .../GenericContact.pdl} | 14 +-- .../GenericPerson.pdl} | 4 +- ccm-cms/src/WEB-INF/basetypes/Person.xml | 29 ----- .../GenericAddress.xml} | 10 +- .../GenericArticle.xml} | 8 +- .../WEB-INF/content-types/GenericContact.xml | 29 +++++ .../GenericPerson.xml} | 10 +- .../WEB-INF/resources/cms-item-adapters.xml | 6 +- ccm-cms/src/ccm-cms.config | 8 +- .../AddressConfig_parameter.properties | 9 -- .../basetypes/BasetypesResources.properties | 64 ---------- .../BasetypesResources_de.properties | 66 ----------- .../ContactConfig_parameter.properties | 29 ----- .../ui/ContactAddressPropertiesStep.java | 110 ------------------ .../ui/ContactPersonPropertiesStep.java | 84 ------------- .../BasetypesResources.properties | 64 ++++++++++ .../BasetypesResources_de.properties | 66 +++++++++++ .../GenericAddress.java} | 24 ++-- .../GenericAddressConfig.java} | 10 +- .../GenericAddressConfig_parameter.properties | 9 ++ .../GenericArticle.java} | 36 +++--- .../GenericArticleImageAssnCollection.java} | 16 +-- .../GenericArticleImageAssociation.java} | 40 ++++--- .../GenericContact.java} | 44 +++---- .../GenericContactConfig.java} | 24 ++-- .../GenericContactConfig_parameter.properties | 29 +++++ .../GenericContactEntry.java} | 24 ++-- .../GenericContactEntryCollection.java} | 34 +++--- .../GenericPerson.java} | 20 ++-- .../ui/GenericAddressPropertiesStep.java} | 32 ++--- .../ui/GenericAddressPropertyForm.java} | 50 ++++---- .../GenericContactAddressPropertiesStep.java | 110 ++++++++++++++++++ ...ericContactAttachAddressPropertyForm.java} | 38 +++--- ...nericContactAttachPersonPropertyForm.java} | 38 +++--- .../ui/GenericContactDeleteAddressForm.java} | 20 ++-- .../ui/GenericContactDeletePersonForm.java} | 20 ++-- ...enericContactEditAddressPropertyForm.java} | 60 +++++----- ...GenericContactEditPersonPropertyForm.java} | 42 +++---- .../GenericContactEntriesPropertiesStep.java} | 16 +-- .../ui/GenericContactEntriesTable.java} | 54 ++++----- .../ui/GenericContactEntryAddForm.java} | 42 +++---- .../GenericContactPersonPropertiesStep.java | 84 +++++++++++++ .../ui/GenericContactPropertiesStep.java} | 36 +++--- .../ui/GenericContactPropertyForm.java} | 26 ++--- .../ui/GenericPersonPropertiesStep.java} | 24 ++-- .../ui/GenericPersonPropertyForm.java} | 38 +++--- .../util/ContenttypesGlobalizationUtil.java} | 6 +- .../util/ContenttypesResourceBundle.java} | 8 +- .../arsdigita/cms/dispatcher/StreamImage.java | 6 +- ccm-cms/src/com/arsdigita/cms/enterprise.init | 8 +- .../arsdigita/cms/ui/ArticleImageDisplay.java | 14 +-- .../com/arsdigita/cms/ui/ImageBrowser.java | 4 +- .../cms/ui/SingleImageSelectionModel.java | 6 +- .../cms/ui/authoring/ArticleImage.java | 12 +- .../cms/ui/authoring/ArticleImageChooser.java | 4 +- .../cms/ui/authoring/BasicImageForm.java | 10 +- .../cms/ui/authoring/ImagePropertiesForm.java | 6 +- .../cms/ui/authoring/ImageSelectionForm.java | 4 +- .../cms/ui/authoring/ImageUploadForm.java | 4 +- .../persistence/CompoundFilterImpl.java | 2 +- 100 files changed, 1038 insertions(+), 1041 deletions(-) rename ccm-cms/pdl/com/arsdigita/{basetypes/Address.pdl => content-types/GenericAddress.pdl} (83%) rename ccm-cms/pdl/com/arsdigita/{basetypes/Article.pdl => content-types/GenericArticle.pdl} (81%) mode change 100755 => 100644 rename ccm-cms/pdl/com/arsdigita/{basetypes/Contact.pdl => content-types/GenericContact.pdl} (56%) rename ccm-cms/pdl/com/arsdigita/{basetypes/Person.pdl => content-types/GenericPerson.pdl} (93%) delete mode 100644 ccm-cms/src/WEB-INF/basetypes/Person.xml rename ccm-cms/src/WEB-INF/{basetypes/Contact.xml => content-types/GenericAddress.xml} (76%) rename ccm-cms/src/WEB-INF/{basetypes/Article.xml => content-types/GenericArticle.xml} (64%) create mode 100644 ccm-cms/src/WEB-INF/content-types/GenericContact.xml rename ccm-cms/src/WEB-INF/{basetypes/Address.xml => content-types/GenericPerson.xml} (76%) delete mode 100644 ccm-cms/src/com/arsdigita/cms/basetypes/AddressConfig_parameter.properties delete mode 100644 ccm-cms/src/com/arsdigita/cms/basetypes/BasetypesResources.properties delete mode 100644 ccm-cms/src/com/arsdigita/cms/basetypes/BasetypesResources_de.properties delete mode 100644 ccm-cms/src/com/arsdigita/cms/basetypes/ContactConfig_parameter.properties delete mode 100644 ccm-cms/src/com/arsdigita/cms/basetypes/ui/ContactAddressPropertiesStep.java delete mode 100644 ccm-cms/src/com/arsdigita/cms/basetypes/ui/ContactPersonPropertiesStep.java create mode 100644 ccm-cms/src/com/arsdigita/cms/contenttypes/BasetypesResources.properties create mode 100644 ccm-cms/src/com/arsdigita/cms/contenttypes/BasetypesResources_de.properties rename ccm-cms/src/com/arsdigita/cms/{basetypes/Address.java => contenttypes/GenericAddress.java} (89%) rename ccm-cms/src/com/arsdigita/cms/{basetypes/AddressConfig.java => contenttypes/GenericAddressConfig.java} (84%) create mode 100644 ccm-cms/src/com/arsdigita/cms/contenttypes/GenericAddressConfig_parameter.properties rename ccm-cms/src/com/arsdigita/cms/{basetypes/Article.java => contenttypes/GenericArticle.java} (83%) mode change 100755 => 100644 rename ccm-cms/src/com/arsdigita/cms/{basetypes/ArticleImageAssnCollection.java => contenttypes/GenericArticleImageAssnCollection.java} (80%) mode change 100755 => 100644 rename ccm-cms/src/com/arsdigita/cms/{basetypes/ArticleImageAssociation.java => contenttypes/GenericArticleImageAssociation.java} (87%) mode change 100755 => 100644 rename ccm-cms/src/com/arsdigita/cms/{basetypes/Contact.java => contenttypes/GenericContact.java} (71%) rename ccm-cms/src/com/arsdigita/cms/{basetypes/ContactConfig.java => contenttypes/GenericContactConfig.java} (82%) create mode 100644 ccm-cms/src/com/arsdigita/cms/contenttypes/GenericContactConfig_parameter.properties rename ccm-cms/src/com/arsdigita/cms/{basetypes/ContactEntry.java => contenttypes/GenericContactEntry.java} (78%) rename ccm-cms/src/com/arsdigita/cms/{basetypes/ContactEntryCollection.java => contenttypes/GenericContactEntryCollection.java} (67%) rename ccm-cms/src/com/arsdigita/cms/{basetypes/Person.java => contenttypes/GenericPerson.java} (84%) rename ccm-cms/src/com/arsdigita/cms/{basetypes/ui/AddressPropertiesStep.java => contenttypes/ui/GenericAddressPropertiesStep.java} (72%) rename ccm-cms/src/com/arsdigita/cms/{basetypes/ui/AddressPropertyForm.java => contenttypes/ui/GenericAddressPropertyForm.java} (71%) create mode 100644 ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactAddressPropertiesStep.java rename ccm-cms/src/com/arsdigita/cms/{basetypes/ui/ContactAttachAddressPropertyForm.java => contenttypes/ui/GenericContactAttachAddressPropertyForm.java} (63%) rename ccm-cms/src/com/arsdigita/cms/{basetypes/ui/ContactAttachPersonPropertyForm.java => contenttypes/ui/GenericContactAttachPersonPropertyForm.java} (63%) rename ccm-cms/src/com/arsdigita/cms/{basetypes/ui/ContactDeleteAddressForm.java => contenttypes/ui/GenericContactDeleteAddressForm.java} (64%) rename ccm-cms/src/com/arsdigita/cms/{basetypes/ui/ContactDeletePersonForm.java => contenttypes/ui/GenericContactDeletePersonForm.java} (65%) rename ccm-cms/src/com/arsdigita/cms/{basetypes/ui/ContactEditAddressPropertyForm.java => contenttypes/ui/GenericContactEditAddressPropertyForm.java} (68%) rename ccm-cms/src/com/arsdigita/cms/{basetypes/ui/ContactEditPersonPropertyForm.java => contenttypes/ui/GenericContactEditPersonPropertyForm.java} (70%) rename ccm-cms/src/com/arsdigita/cms/{basetypes/ui/ContactEntriesPropertiesStep.java => contenttypes/ui/GenericContactEntriesPropertiesStep.java} (65%) rename ccm-cms/src/com/arsdigita/cms/{basetypes/ui/ContactEntriesTable.java => contenttypes/ui/GenericContactEntriesTable.java} (76%) rename ccm-cms/src/com/arsdigita/cms/{basetypes/ui/ContactEntryAddForm.java => contenttypes/ui/GenericContactEntryAddForm.java} (67%) create mode 100644 ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactPersonPropertiesStep.java rename ccm-cms/src/com/arsdigita/cms/{basetypes/ui/ContactPropertiesStep.java => contenttypes/ui/GenericContactPropertiesStep.java} (64%) rename ccm-cms/src/com/arsdigita/cms/{basetypes/ui/ContactPropertyForm.java => contenttypes/ui/GenericContactPropertyForm.java} (68%) rename ccm-cms/src/com/arsdigita/cms/{basetypes/ui/PersonPropertiesStep.java => contenttypes/ui/GenericPersonPropertiesStep.java} (70%) rename ccm-cms/src/com/arsdigita/cms/{basetypes/ui/PersonPropertyForm.java => contenttypes/ui/GenericPersonPropertyForm.java} (68%) rename ccm-cms/src/com/arsdigita/cms/{basetypes/util/BasetypesGlobalizationUtil.java => contenttypes/util/ContenttypesGlobalizationUtil.java} (88%) rename ccm-cms/src/com/arsdigita/cms/{basetypes/util/BasetypesResourceBundle.java => contenttypes/util/ContenttypesResourceBundle.java} (83%) diff --git a/ccm-cms-assets-imagestep/src/com/arsdigita/cms/contentassets/ItemImageAttachmentInitializer.java b/ccm-cms-assets-imagestep/src/com/arsdigita/cms/contentassets/ItemImageAttachmentInitializer.java index bdaf83b35..8340eb078 100755 --- a/ccm-cms-assets-imagestep/src/com/arsdigita/cms/contentassets/ItemImageAttachmentInitializer.java +++ b/ccm-cms-assets-imagestep/src/com/arsdigita/cms/contentassets/ItemImageAttachmentInitializer.java @@ -22,7 +22,7 @@ import com.arsdigita.cms.AuthoringKit; import com.arsdigita.cms.AuthoringKitStepAssociation; import com.arsdigita.cms.AuthoringStep; import com.arsdigita.cms.ContentPage; -import com.arsdigita.cms.basetypes.Article; +import com.arsdigita.cms.contenttypes.GenericArticle; import com.arsdigita.cms.contenttypes.ContentAssetInitializer; // import com.arsdigita.cms.contentassets.ItemImageAttachment; import com.arsdigita.cms.contentassets.ui.ImageStep; @@ -75,7 +75,7 @@ public class ItemImageAttachmentInitializer extends ContentAssetInitializer { DataCollection steps = SessionManager.getSession().retrieve ( AuthoringStep.BASE_DATA_OBJECT_TYPE ); - // Don't use defined constant to reduce dependency on Article + // Don't use defined constant to reduce dependency on GenericArticle steps.addEqualsFilter( "component", "com.arsdigita.cms.ui.authoring.ArticleImage" ); @@ -90,14 +90,14 @@ public class ItemImageAttachmentInitializer extends ContentAssetInitializer { DataObject kitStep = kits.getDataObject(); AuthoringKitStepAssociation kitStepAsso = new AuthoringKitStepAssociation(kitStep); // Check whether the content type is (persistence-wise) subtype - // of com.ad.cms.Article. This is lame, but I couldn't find a better API to do this: + // of com.ad.cms.GenericArticle. This is lame, but I couldn't find a better API to do this: AuthoringKit kit = new AuthoringKit (kitStepAsso.getKitID()); try { - ObjectType.verifySubtype(Article.BASE_DATA_OBJECT_TYPE, + ObjectType.verifySubtype(GenericArticle.BASE_DATA_OBJECT_TYPE, kit.getContentType().getAssociatedObjectType()); kitStepAsso.delete(); } catch (PersistenceException pe) { - // Do nothing, the content type is not subtyping com.arsdigita.cms.Article + // Do nothing, the content type is not subtyping com.arsdigita.cms.GenericArticle } } diff --git a/ccm-cms-types-address/pdl/com/arsdigita/content-types/Address.pdl b/ccm-cms-types-address/pdl/com/arsdigita/content-types/Address.pdl index c6d33b988..88f459f09 100644 --- a/ccm-cms-types-address/pdl/com/arsdigita/content-types/Address.pdl +++ b/ccm-cms-types-address/pdl/com/arsdigita/content-types/Address.pdl @@ -1,10 +1,9 @@ model com.arsdigita.cms.contenttypes; -import com.arsdigita.cms.basetypes.Address; import com.arsdigita.cms.ContentPage; // Address object -object type Address extends com.arsdigita.cms.basetypes.Address { +object type Address extends GenericAddress { reference key ( ct_addresses.address_id ); } diff --git a/ccm-cms-types-address/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Address.xml b/ccm-cms-types-address/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Address.xml index c66a475cb..14208b3ec 100644 --- a/ccm-cms-types-address/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Address.xml +++ b/ccm-cms-types-address/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Address.xml @@ -15,10 +15,10 @@ diff --git a/ccm-cms-types-address/src/com/arsdigita/cms/contenttypes/Address.java b/ccm-cms-types-address/src/com/arsdigita/cms/contenttypes/Address.java index 50f280a58..52eaf81ab 100755 --- a/ccm-cms-types-address/src/com/arsdigita/cms/contenttypes/Address.java +++ b/ccm-cms-types-address/src/com/arsdigita/cms/contenttypes/Address.java @@ -37,13 +37,13 @@ import java.math.BigDecimal; * * @author Sören Bernstein **/ -public class Address extends com.arsdigita.cms.basetypes.Address { +public class Address extends GenericAddress { /** Data object type for this domain object */ public static final String BASE_DATA_OBJECT_TYPE = "com.arsdigita.cms.contenttypes.Address"; /** - * Default constructor. This creates a new (empty) Address. + * Default constructor. This creates a new (empty) GenericAddress. **/ public Address() { this(BASE_DATA_OBJECT_TYPE); @@ -53,7 +53,7 @@ public class Address extends com.arsdigita.cms.basetypes.Address { * Constructor. The contained DataObject is retrieved * from the persistent storage mechanism with an OID * specified by id and - * Address.BASE_DATA_OBJECT_TYPE. + * GenericAddress.BASE_DATA_OBJECT_TYPE. * * @param id The id for the retrieved * DataObject. diff --git a/ccm-cms-types-article/pdl/com/arsdigita/content-types/Article.pdl b/ccm-cms-types-article/pdl/com/arsdigita/content-types/Article.pdl index 00aa019b6..197842a76 100755 --- a/ccm-cms-types-article/pdl/com/arsdigita/content-types/Article.pdl +++ b/ccm-cms-types-article/pdl/com/arsdigita/content-types/Article.pdl @@ -19,9 +19,7 @@ // $DateTime: 2004/08/17 23:15:09 $ model com.arsdigita.cms.contenttypes; -import com.arsdigita.cms.basetypes.*; - -object type Article extends com.arsdigita.cms.basetypes.Article { +object type Article extends GenericArticle { String [0..1] lead = ct_articles.lead VARCHAR(1000); reference key (ct_articles.item_id); diff --git a/ccm-cms-types-article/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Article.xml b/ccm-cms-types-article/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Article.xml index 2782085b9..a30814203 100755 --- a/ccm-cms-types-article/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Article.xml +++ b/ccm-cms-types-article/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Article.xml @@ -1,24 +1,28 @@ - - - + - + + + - + - - - + + + + + diff --git a/ccm-cms-types-article/src/com/arsdigita/cms/contenttypes/Article.java b/ccm-cms-types-article/src/com/arsdigita/cms/contenttypes/Article.java index 81cda9b8e..dfe3120c7 100755 --- a/ccm-cms-types-article/src/com/arsdigita/cms/contenttypes/Article.java +++ b/ccm-cms-types-article/src/com/arsdigita/cms/contenttypes/Article.java @@ -32,11 +32,11 @@ import java.math.BigDecimal; * * @version $Revision: #6 $ $Date: 2004/08/17 $ */ -public class Article extends com.arsdigita.cms.basetypes.Article { +public class Article extends GenericArticle { private final static org.apache.log4j.Logger s_log = - org.apache.log4j.Logger.getLogger(Article.class); + org.apache.log4j.Logger.getLogger(GenericArticle.class); /** PDL property name for lead */ public static final String LEAD = "lead"; diff --git a/ccm-cms-types-article/src/com/arsdigita/cms/contenttypes/ArticleInitializer.java b/ccm-cms-types-article/src/com/arsdigita/cms/contenttypes/ArticleInitializer.java index 5d9b87406..7dcae2b74 100755 --- a/ccm-cms-types-article/src/com/arsdigita/cms/contenttypes/ArticleInitializer.java +++ b/ccm-cms-types-article/src/com/arsdigita/cms/contenttypes/ArticleInitializer.java @@ -21,7 +21,7 @@ package com.arsdigita.cms.contenttypes; import org.apache.log4j.Logger; /** - * Initializes the Article content type. + * Initializes the GenericArticle content type. * Defines the content type specific properties and just uses the super class * methods to register the content type with the (transient) content type store * (map). @@ -34,7 +34,7 @@ public class ArticleInitializer extends ContentTypeInitializer { private static final Logger s_log = Logger.getLogger(ArticleInitializer.class); public ArticleInitializer() { - super("ccm-cms-types-article.pdl.mf", Article.BASE_DATA_OBJECT_TYPE); + super("ccm-cms-types-article.pdl.mf", GenericArticle.BASE_DATA_OBJECT_TYPE); } diff --git a/ccm-cms-types-contact/pdl/com/arsdigita/content-types/Contact.pdl b/ccm-cms-types-contact/pdl/com/arsdigita/content-types/Contact.pdl index ff6698864..d9eb22abd 100644 --- a/ccm-cms-types-contact/pdl/com/arsdigita/content-types/Contact.pdl +++ b/ccm-cms-types-contact/pdl/com/arsdigita/content-types/Contact.pdl @@ -1,10 +1,9 @@ model com.arsdigita.cms.contenttypes; -import com.arsdigita.cms.basetypes.Contact; import com.arsdigita.kernel.ACSObject; import com.arsdigita.cms.*; // Contact Object -object type Contact extends com.arsdigita.cms.basetypes.Contact { +object type Contact extends GenericContact { reference key ( ct_contacts.contact_id ); } diff --git a/ccm-cms-types-contact/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Contact.xml b/ccm-cms-types-contact/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Contact.xml index 9ede18e2c..f2723004a 100644 --- a/ccm-cms-types-contact/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Contact.xml +++ b/ccm-cms-types-contact/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Contact.xml @@ -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.basetypes.ui.ContactPropertiesStep" + component="com.arsdigita.cms.contenttypes.ui.GenericContactPropertiesStep" ordering="1"/> 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 index 6f3c940a1..474a14275 100755 --- a/ccm-cms-types-contact/src/com/arsdigita/cms/contenttypes/Contact.java +++ b/ccm-cms-types-contact/src/com/arsdigita/cms/contenttypes/Contact.java @@ -27,10 +27,10 @@ import java.math.BigDecimal; /** - * This content type represents an Contact + * This content type represents an GenericContact * */ -public class Contact extends com.arsdigita.cms.basetypes.Contact { +public class Contact extends GenericContact { /** Data object type for tihs domain object */ public static final String BASE_DATA_OBJECT_TYPE diff --git a/ccm-cms-types-genericorganization/pdl/com/arsdigita/content-types/OrganizationRole.pdl b/ccm-cms-types-genericorganization/pdl/com/arsdigita/content-types/OrganizationRole.pdl index 3ed548118..5b0c12663 100644 --- a/ccm-cms-types-genericorganization/pdl/com/arsdigita/content-types/OrganizationRole.pdl +++ b/ccm-cms-types-genericorganization/pdl/com/arsdigita/content-types/OrganizationRole.pdl @@ -19,11 +19,11 @@ model com.arsdigita.cms.contenttypes; import com.arsdigita.cms.ContentItem; import com.arsdigita.kernel.ACSObject; -import com.arsdigita.cms.basetypes.Person; +import com.arsdigita.cms.contenttypes.GenericPerson; object type OrganizationRole extends ACSObject { String[1..1] roleName = ct_organizationroles.rolename VARCHAR(150); - Person[0..1] targetItem = join ct_organizationroles.target_item_id to cms_persons.person_id; + GenericPerson[0..1] targetItem = join ct_organizationroles.target_item_id to cms_persons.person_id; Integer[0..1] roleOrder = ct_organizationroles.role_order INTEGER; diff --git a/ccm-cms-types-genericorganization/src/com/arsdigita/cms/contenttypes/OrganizationRole.java b/ccm-cms-types-genericorganization/src/com/arsdigita/cms/contenttypes/OrganizationRole.java index 8c3c4c709..6e2702d50 100644 --- a/ccm-cms-types-genericorganization/src/com/arsdigita/cms/contenttypes/OrganizationRole.java +++ b/ccm-cms-types-genericorganization/src/com/arsdigita/cms/contenttypes/OrganizationRole.java @@ -139,9 +139,9 @@ public class OrganizationRole extends ACSObject { * * @return The person associated with the role. */ - public com.arsdigita.cms.basetypes.Person getTargetItem() { + public com.arsdigita.cms.contenttypes.GenericPerson getTargetItem() { DataObject object = (DataObject) get(TARGETITEM); - return (com.arsdigita.cms.basetypes.Person) DomainObjectFactory.newInstance(object); + return (com.arsdigita.cms.contenttypes.GenericPerson) DomainObjectFactory.newInstance(object); } /** @@ -149,7 +149,7 @@ public class OrganizationRole extends ACSObject { * * @param item */ - public void setTargetItem(com.arsdigita.cms.basetypes.Person item) { + public void setTargetItem(com.arsdigita.cms.contenttypes.GenericPerson item) { setAssociation(TARGETITEM, item); } @@ -177,7 +177,7 @@ public class OrganizationRole extends ACSObject { * @return The URI of the target item. */ public String getURI(PageState s) { - com.arsdigita.cms.basetypes.Person item = getTargetItem(); + com.arsdigita.cms.contenttypes.GenericPerson item = getTargetItem(); if (item == null) { logger.error(getOID() + " is a link between an organization and a person, but the associated person is null"); @@ -196,7 +196,7 @@ public class OrganizationRole extends ACSObject { * @param person * @return All roles a person is associated with. */ - public static DataCollection getReferingRoles(com.arsdigita.cms.basetypes.Person person) { + public static DataCollection getReferingRoles(com.arsdigita.cms.contenttypes.GenericPerson person) { Session session = SessionManager.getSession(); DataCollection roles = session.retrieve(BASE_DATA_OBJECT_TYPE); Filter filter = roles.addInSubqueryFilter("id", "com.arsdigita.cms.contenttypes.getRefferingRoles"); diff --git a/ccm-cms-types-genericorganization/src/com/arsdigita/cms/contenttypes/ui/OrganizationRolePropertyForm.java b/ccm-cms-types-genericorganization/src/com/arsdigita/cms/contenttypes/ui/OrganizationRolePropertyForm.java index 72eef6e5a..8c85b40af 100644 --- a/ccm-cms-types-genericorganization/src/com/arsdigita/cms/contenttypes/ui/OrganizationRolePropertyForm.java +++ b/ccm-cms-types-genericorganization/src/com/arsdigita/cms/contenttypes/ui/OrganizationRolePropertyForm.java @@ -83,11 +83,11 @@ public class OrganizationRolePropertyForm extends FormSection implements FormIni add(new Label(GenericOrganizationGlobalizationUtil.globalize("cms.contenttypes.ui.genericorganization.person"))); /* Create the ItemSearchWidget. The ContentType.findByAssociatedObjecType - * gets the ContentType of com.arsdigita.cms.contenttypes.Person and passes + * gets the ContentType of com.arsdigita.cms.contenttypes.GenericPerson and passes * it to the constructor of the ItemSearchWidget. The ItemSearchWidget will only - * display object of type Person or derivated types. + * display object of type GenericPerson or derivated types. */ - this.m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.findByAssociatedObjectType("com.arsdigita.cms.basetypes.Person")); + this.m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.findByAssociatedObjectType("com.arsdigita.cms.contenttypes.GenericPerson")); add(this.m_itemSearch); } @@ -142,8 +142,8 @@ public class OrganizationRolePropertyForm extends FormSection implements FormIni return this.m_roleModel; } - /*protected Person getPerson(PageState s) { - return (Person) m_itemModel.getSelectedObject(s); + /*protected GenericPerson getPerson(PageState s) { + return (GenericPerson) m_itemModel.getSelectedObject(s); }*/ /** * @@ -161,7 +161,7 @@ public class OrganizationRolePropertyForm extends FormSection implements FormIni * @return Newly created OrganizationRole. */ protected OrganizationRole createOrganizationRole(PageState s) { - //Person person = this.getPerson(s); + //GenericPerson person = this.getPerson(s); //Assert.exists(person); GenericOrganization orga = this.getOrganization(s); Assert.exists(orga); @@ -181,7 +181,7 @@ public class OrganizationRolePropertyForm extends FormSection implements FormIni FormData data = e.getFormData(); role.setRolename((String) m_rolename.getValue(state)); - role.setTargetItem((com.arsdigita.cms.basetypes.Person) data.get(ITEM_SEARCH)); + role.setTargetItem((com.arsdigita.cms.contenttypes.GenericPerson) data.get(ITEM_SEARCH)); role.save(); } diff --git a/ccm-cms-types-healthCareFacility/pdl/com/arsdigita/content-types/HealthCareFacility.pdl b/ccm-cms-types-healthCareFacility/pdl/com/arsdigita/content-types/HealthCareFacility.pdl index f526374b4..1f624016a 100644 --- a/ccm-cms-types-healthCareFacility/pdl/com/arsdigita/content-types/HealthCareFacility.pdl +++ b/ccm-cms-types-healthCareFacility/pdl/com/arsdigita/content-types/HealthCareFacility.pdl @@ -1,8 +1,8 @@ model com.arsdigita.cms.contenttypes; import com.arsdigita.cms.contenttypes.GenricOrganization; -import com.arsdigita.cms.basetypes.Address; -import com.arsdigita.cms.basetypes.Contact; +import com.arsdigita.cms.contenttypes.GenericAddress; +import com.arsdigita.cms.contenttypes.GenericContact; import com.arsdigita.kernel.ACSObject; import com.arsdigita.cms.*; @@ -10,7 +10,7 @@ import com.arsdigita.cms.*; // HealthCareFacility Object object type HealthCareFacility extends GenericOrganization { - com.arsdigita.cms.basetypes.Address[0..1] address = join ct_healthCareFacilities.address_id + GenericAddress[0..1] address = join ct_healthCareFacilities.address_id to cms_addresses.address_id; reference key ( ct_healthCareFacilities.hcf_id ); @@ -18,7 +18,7 @@ object type HealthCareFacility extends GenericOrganization { association { - com.arsdigita.cms.basetypes.Contact[0..n] contacts = join ct_healthCareFacilities.hcf_id + GenericContact[0..n] contacts = join ct_healthCareFacilities.hcf_id to ct_healthCareFacility_contact_map.hcf_id, join ct_healthCareFacility_contact_map.contact_id to cms_contacts.contact_id; diff --git a/ccm-cms-types-healthCareFacility/src/com/arsdigita/cms/contenttypes/HealthCareFacility.java b/ccm-cms-types-healthCareFacility/src/com/arsdigita/cms/contenttypes/HealthCareFacility.java index a86587909..1f78ec9af 100644 --- a/ccm-cms-types-healthCareFacility/src/com/arsdigita/cms/contenttypes/HealthCareFacility.java +++ b/ccm-cms-types-healthCareFacility/src/com/arsdigita/cms/contenttypes/HealthCareFacility.java @@ -123,12 +123,12 @@ public class HealthCareFacility extends GenericOrganization { /* accessors *************************************************/ // Get the address for this contact - public com.arsdigita.cms.basetypes.Address getAddress() { - return (com.arsdigita.cms.basetypes.Address)DomainObjectFactory.newInstance((DataObject)get(ADDRESS)); + public com.arsdigita.cms.contenttypes.GenericAddress getAddress() { + return (com.arsdigita.cms.contenttypes.GenericAddress)DomainObjectFactory.newInstance((DataObject)get(ADDRESS)); } // Set the address for this contact - public void setAddress(com.arsdigita.cms.basetypes.Address address) { + public void setAddress(com.arsdigita.cms.contenttypes.GenericAddress address) { set(ADDRESS, address); } @@ -143,8 +143,8 @@ public class HealthCareFacility extends GenericOrganization { } // Add a contact for this health care facility - public void addContact(com.arsdigita.cms.basetypes.Contact contact, String contactType) { - Assert.exists(contact, com.arsdigita.cms.basetypes.Contact.class); + public void addContact(com.arsdigita.cms.contenttypes.GenericContact contact, String contactType) { + Assert.exists(contact, com.arsdigita.cms.contenttypes.GenericContact.class); DataObject link = add(CONTACTS, contact); @@ -156,8 +156,8 @@ public class HealthCareFacility extends GenericOrganization { } // Remove a contect for this health care facility - public void removeContactEntry(com.arsdigita.cms.basetypes.Contact contact) { - Assert.exists(contact, com.arsdigita.cms.basetypes.Contact.class); + public void removeContactEntry(com.arsdigita.cms.contenttypes.GenericContact contact) { + Assert.exists(contact, com.arsdigita.cms.contenttypes.GenericContact.class); remove(CONTACTS, contact); } diff --git a/ccm-cms-types-healthCareFacility/src/com/arsdigita/cms/contenttypes/HealthCareFacilityContactCollection.java b/ccm-cms-types-healthCareFacility/src/com/arsdigita/cms/contenttypes/HealthCareFacilityContactCollection.java index 159ca6a53..f363ceca0 100644 --- a/ccm-cms-types-healthCareFacility/src/com/arsdigita/cms/contenttypes/HealthCareFacilityContactCollection.java +++ b/ccm-cms-types-healthCareFacility/src/com/arsdigita/cms/contenttypes/HealthCareFacilityContactCollection.java @@ -58,8 +58,8 @@ public class HealthCareFacilityContactCollection extends DomainCollection { // getContact().set(CONTACT_ORDER, String.valueOf(contactOrder)); // } - public com.arsdigita.cms.basetypes.Contact getContact() { - return new com.arsdigita.cms.basetypes.Contact(m_dataCollection.getDataObject()); + public com.arsdigita.cms.contenttypes.GenericContact getContact() { + return new com.arsdigita.cms.contenttypes.GenericContact(m_dataCollection.getDataObject()); } } diff --git a/ccm-cms-types-healthCareFacility/src/com/arsdigita/cms/contenttypes/ui/HealthCareFacilityAddressPropertiesStep.java b/ccm-cms-types-healthCareFacility/src/com/arsdigita/cms/contenttypes/ui/HealthCareFacilityAddressPropertiesStep.java index 1ed17ecf6..b75a3bd73 100644 --- a/ccm-cms-types-healthCareFacility/src/com/arsdigita/cms/contenttypes/ui/HealthCareFacilityAddressPropertiesStep.java +++ b/ccm-cms-types-healthCareFacility/src/com/arsdigita/cms/contenttypes/ui/HealthCareFacilityAddressPropertiesStep.java @@ -18,7 +18,7 @@ import com.arsdigita.toolbox.ui.DomainObjectPropertySheet; import com.arsdigita.bebop.Component; import com.arsdigita.bebop.Label; import com.arsdigita.cms.contenttypes.HealthCareFacility; -import com.arsdigita.cms.basetypes.util.BasetypesGlobalizationUtil; +import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil; import com.arsdigita.cms.contenttypes.util.HealthCareFacilityGlobalizationUtil; import com.arsdigita.cms.ui.authoring.SimpleEditStep; @@ -75,28 +75,28 @@ public class HealthCareFacilityAddressPropertiesStep extends SimpleEditStep { DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(itemModel); - sheet.add((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.address").localize(), "address." + com.arsdigita.cms.basetypes.Address.ADDRESS); + sheet.add((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.address").localize(), "address." + com.arsdigita.cms.contenttypes.GenericAddress.ADDRESS); if (!HealthCareFacility.getConfig().getHideAddressPostalCode()) { - sheet.add((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.postal_code").localize(), "address." + com.arsdigita.cms.basetypes.Address.POSTAL_CODE); + sheet.add((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.postal_code").localize(), "address." + com.arsdigita.cms.contenttypes.GenericAddress.POSTAL_CODE); } - sheet.add((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.city").localize(), "address." + com.arsdigita.cms.basetypes.Address.CITY); + sheet.add((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.city").localize(), "address." + com.arsdigita.cms.contenttypes.GenericAddress.CITY); if (!HealthCareFacility.getConfig().getHideAddressState()) { - sheet.add((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.state").localize(), "address." + com.arsdigita.cms.basetypes.Address.STATE); + sheet.add((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.state").localize(), "address." + com.arsdigita.cms.contenttypes.GenericAddress.STATE); } if (!HealthCareFacility.getConfig().getHideAddressCountry()) { - sheet.add((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.iso_country_code").localize(), - "address." + com.arsdigita.cms.basetypes.Address.ISO_COUNTRY_CODE, + sheet.add((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.iso_country_code").localize(), + "address." + com.arsdigita.cms.contenttypes.GenericAddress.ISO_COUNTRY_CODE, new DomainObjectPropertySheet.AttributeFormatter() { public String format(DomainObject item, String attribute, PageState state) { - com.arsdigita.cms.basetypes.Address address = ((HealthCareFacility) item).getAddress(); + com.arsdigita.cms.contenttypes.GenericAddress address = ((HealthCareFacility) item).getAddress(); if (address != null && address.getIsoCountryCode() != null) { - return com.arsdigita.cms.basetypes.Address.getCountryNameFromIsoCode(address.getIsoCountryCode()); + return com.arsdigita.cms.contenttypes.GenericAddress.getCountryNameFromIsoCode(address.getIsoCountryCode()); } else { - return (String) BasetypesGlobalizationUtil.globalize("cms.ui.unknown").localize(); + return (String) ContenttypesGlobalizationUtil.globalize("cms.ui.unknown").localize(); } } }); diff --git a/ccm-cms-types-healthCareFacility/src/com/arsdigita/cms/contenttypes/ui/HealthCareFacilityAttachAddressPropertyForm.java b/ccm-cms-types-healthCareFacility/src/com/arsdigita/cms/contenttypes/ui/HealthCareFacilityAttachAddressPropertyForm.java index 5f17b3a3c..00e00e7f8 100644 --- a/ccm-cms-types-healthCareFacility/src/com/arsdigita/cms/contenttypes/ui/HealthCareFacilityAttachAddressPropertyForm.java +++ b/ccm-cms-types-healthCareFacility/src/com/arsdigita/cms/contenttypes/ui/HealthCareFacilityAttachAddressPropertyForm.java @@ -75,7 +75,7 @@ public class HealthCareFacilityAttachAddressPropertyForm extends BasicPageForm i @Override public void addWidgets() { add(new Label((String) HealthCareFacilityGlobalizationUtil.globalize("cms.contenttypes.ui.healthCareFacility.select_address").localize())); - this.m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.findByAssociatedObjectType("com.arsdigita.cms.basetypes.Address")); + this.m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.findByAssociatedObjectType("com.arsdigita.cms.contenttypes.GenericAddress")); add(this.m_itemSearch); } @@ -97,7 +97,7 @@ public class HealthCareFacilityAttachAddressPropertyForm extends BasicPageForm i HealthCareFacility healthCareFacility = (HealthCareFacility) getItemSelectionModel().getSelectedObject(state); if (!this.getSaveCancelSection().getCancelButton().isSelected(state)) { - healthCareFacility.setAddress((com.arsdigita.cms.basetypes.Address) data.get(ITEM_SEARCH)); + healthCareFacility.setAddress((com.arsdigita.cms.contenttypes.GenericAddress) data.get(ITEM_SEARCH)); } init(fse); } diff --git a/ccm-cms-types-healthCareFacility/src/com/arsdigita/cms/contenttypes/ui/HealthCareFacilityContactAddForm.java b/ccm-cms-types-healthCareFacility/src/com/arsdigita/cms/contenttypes/ui/HealthCareFacilityContactAddForm.java index 8f884043d..973bb4f94 100644 --- a/ccm-cms-types-healthCareFacility/src/com/arsdigita/cms/contenttypes/ui/HealthCareFacilityContactAddForm.java +++ b/ccm-cms-types-healthCareFacility/src/com/arsdigita/cms/contenttypes/ui/HealthCareFacilityContactAddForm.java @@ -28,7 +28,7 @@ import com.arsdigita.bebop.form.SingleSelect; import com.arsdigita.bebop.parameters.NotNullValidationListener; import com.arsdigita.bebop.parameters.ParameterModel; import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.basetypes.util.BasetypesGlobalizationUtil; +import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil; import com.arsdigita.cms.ui.authoring.BasicItemForm; import com.arsdigita.bebop.parameters.StringParameter; import com.arsdigita.cms.ContentType; @@ -68,17 +68,17 @@ public class HealthCareFacilityContactAddForm extends BasicItemForm { @Override protected void addWidgets() { - // Attach a Contact object + // Attach a GenericContact object add(new Label((String) HealthCareFacilityGlobalizationUtil.globalize("cms.contenttypes.ui.healthCareFacility.select_contact").localize())); - this.m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.findByAssociatedObjectType("com.arsdigita.cms.contenttypes.Contact")); + this.m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.findByAssociatedObjectType("com.arsdigita.cms.contenttypes.GenericContact")); add(this.m_itemSearch); - // Contact type field + // GenericContact type field add(new Label(HealthCareFacilityGlobalizationUtil.globalize("cms.contenttypes.ui.healthCareFacility.contact.type"))); ParameterModel contactTypeParam = new StringParameter(HealthCareFacilityContactCollection.CONTACT_TYPE); SingleSelect contactType = new SingleSelect(contactTypeParam); contactType.addValidationListener(new NotNullValidationListener()); - contactType.addOption(new Option("", new Label((String) BasetypesGlobalizationUtil.globalize("cms.ui.select_one").localize()))); + contactType.addOption(new Option("", new Label((String) ContenttypesGlobalizationUtil.globalize("cms.ui.select_one").localize()))); // Add the Options to the SingleSelect widget StringTokenizer keyList = HealthCareFacility.getConfig().getContactTypeKeys(); @@ -105,7 +105,7 @@ public class HealthCareFacilityContactAddForm extends BasicItemForm { // if (!this.getSaveCancelSection().getCancelButton().isSelected(state)) { - healthCareFacility.addContact((com.arsdigita.cms.basetypes.Contact) data.get(ITEM_SEARCH), + healthCareFacility.addContact((com.arsdigita.cms.contenttypes.GenericContact) data.get(ITEM_SEARCH), (String) data.get(HealthCareFacilityContactCollection.CONTACT_TYPE)); } diff --git a/ccm-cms-types-healthCareFacility/src/com/arsdigita/cms/contenttypes/ui/HealthCareFacilityContactTable.java b/ccm-cms-types-healthCareFacility/src/com/arsdigita/cms/contenttypes/ui/HealthCareFacilityContactTable.java index cf2fb2e87..9f786aa19 100644 --- a/ccm-cms-types-healthCareFacility/src/com/arsdigita/cms/contenttypes/ui/HealthCareFacilityContactTable.java +++ b/ccm-cms-types-healthCareFacility/src/com/arsdigita/cms/contenttypes/ui/HealthCareFacilityContactTable.java @@ -106,7 +106,7 @@ public class HealthCareFacilityContactTable extends Table implements TableAction final private int MAX_DESC_LENGTH = 25; private Table m_table; private HealthCareFacilityContactCollection m_contactCollection; - private com.arsdigita.cms.basetypes.Contact m_contact; + private com.arsdigita.cms.contenttypes.GenericContact m_contact; private HealthCareFacilityTableModel(Table t, PageState ps, HealthCareFacility healthCareFacility) { m_table = t; @@ -228,9 +228,9 @@ public class HealthCareFacilityContactTable extends Table implements TableAction PageState state = evt.getPageState(); - // Get selected Contact - com.arsdigita.cms.basetypes.Contact contact = - new com.arsdigita.cms.basetypes.Contact(new BigDecimal(evt.getRowKey().toString())); + // Get selected GenericContact + com.arsdigita.cms.contenttypes.GenericContact contact = + new com.arsdigita.cms.contenttypes.GenericContact(new BigDecimal(evt.getRowKey().toString())); // Get HealthCareFacility HealthCareFacility healthCareFacility = (HealthCareFacility) m_itemModel.getSelectedObject(state); diff --git a/ccm-cms-types-healthCareFacility/src/com/arsdigita/cms/contenttypes/ui/HealthCareFacilityEditAddressPropertyForm.java b/ccm-cms-types-healthCareFacility/src/com/arsdigita/cms/contenttypes/ui/HealthCareFacilityEditAddressPropertyForm.java index b4e9992a0..cc4b3f500 100644 --- a/ccm-cms-types-healthCareFacility/src/com/arsdigita/cms/contenttypes/ui/HealthCareFacilityEditAddressPropertyForm.java +++ b/ccm-cms-types-healthCareFacility/src/com/arsdigita/cms/contenttypes/ui/HealthCareFacilityEditAddressPropertyForm.java @@ -32,7 +32,7 @@ import com.arsdigita.cms.ui.authoring.BasicPageForm; import java.util.Iterator; import java.util.Map; import com.arsdigita.cms.contenttypes.HealthCareFacility; -import com.arsdigita.cms.basetypes.util.BasetypesGlobalizationUtil; +import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil; import org.apache.log4j.Logger; @@ -44,11 +44,11 @@ public class HealthCareFacilityEditAddressPropertyForm extends BasicPageForm imp private static final Logger logger = Logger.getLogger(HealthCareFacilityPropertyForm.class); private HealthCareFacilityAddressPropertiesStep m_step; - public static final String ADDRESS = com.arsdigita.cms.basetypes.Address.ADDRESS; - public static final String POSTAL_CODE = com.arsdigita.cms.basetypes.Address.POSTAL_CODE; - public static final String CITY = com.arsdigita.cms.basetypes.Address.CITY; - public static final String STATE = com.arsdigita.cms.basetypes.Address.STATE; - public static final String ISO_COUNTRY_CODE = com.arsdigita.cms.basetypes.Address.ISO_COUNTRY_CODE; + public static final String ADDRESS = com.arsdigita.cms.contenttypes.GenericAddress.ADDRESS; + public static final String POSTAL_CODE = com.arsdigita.cms.contenttypes.GenericAddress.POSTAL_CODE; + public static final String CITY = com.arsdigita.cms.contenttypes.GenericAddress.CITY; + public static final String STATE = com.arsdigita.cms.contenttypes.GenericAddress.STATE; + public static final String ISO_COUNTRY_CODE = com.arsdigita.cms.contenttypes.GenericAddress.ISO_COUNTRY_CODE; /** * ID of the form */ @@ -77,7 +77,7 @@ public class HealthCareFacilityEditAddressPropertyForm extends BasicPageForm imp @Override public void addWidgets() { - add(new Label((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.address").localize())); + add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.address").localize())); ParameterModel addressParam = new StringParameter(ADDRESS); addressParam.addParameterListener(new NotNullValidationListener()); addressParam.addParameterListener(new StringInRangeValidationListener(0, 1000)); @@ -87,35 +87,35 @@ public class HealthCareFacilityEditAddressPropertyForm extends BasicPageForm imp add(address); if (!HealthCareFacility.getConfig().getHideAddressPostalCode()) { - add(new Label((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.postal_code").localize())); + add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.postal_code").localize())); ParameterModel postalCodeParam = new StringParameter(POSTAL_CODE); TextField postalCode = new TextField(postalCodeParam); /* XXX NumberListener ?*/ add(postalCode); } - add(new Label((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.city").localize())); + add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.city").localize())); ParameterModel cityParam = new StringParameter(CITY); TextField city = new TextField(cityParam); add(city); if (!HealthCareFacility.getConfig().getHideAddressState()) { - add(new Label((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.state").localize())); + add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.state").localize())); ParameterModel stateParam = new StringParameter(STATE); TextField state = new TextField(stateParam); add(state); } if (!HealthCareFacility.getConfig().getHideAddressCountry()) { - add(new Label((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.iso_country_code").localize())); + add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.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) BasetypesGlobalizationUtil.globalize("cms.ui.select_one").localize()))); + country.addOption(new Option("", new Label((String) ContenttypesGlobalizationUtil.globalize("cms.ui.select_one").localize()))); - Iterator countries = com.arsdigita.cms.basetypes.Address.getSortedListOfCountries(null).entrySet().iterator(); + Iterator countries = com.arsdigita.cms.contenttypes.GenericAddress.getSortedListOfCountries(null).entrySet().iterator(); while (countries.hasNext()) { Map.Entry elem = (Map.Entry) countries.next(); country.addOption(new Option(elem.getValue().toString(), elem.getKey().toString())); @@ -128,7 +128,7 @@ public class HealthCareFacilityEditAddressPropertyForm extends BasicPageForm imp ParameterData data = e.getParameterData(); String isoCode = (String) data.getValue(); if (isoCode == null || isoCode.length() == 0) { - data.addError((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.error_iso_country").localize()); + data.addError((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.error_iso_country").localize()); } } }); @@ -148,7 +148,7 @@ public class HealthCareFacilityEditAddressPropertyForm extends BasicPageForm imp data.put(POSTAL_CODE, healthCareFacility.getAddress().getPostalCode()); data.put(CITY, healthCareFacility.getAddress().getCity()); data.put(STATE, healthCareFacility.getAddress().getState()); - if (!com.arsdigita.cms.basetypes.Address.getConfig().getHideCountryCodeSelection()) { + if (!com.arsdigita.cms.contenttypes.GenericAddress.getConfig().getHideCountryCodeSelection()) { data.put(ISO_COUNTRY_CODE, healthCareFacility.getAddress().getIsoCountryCode()); } } diff --git a/ccm-cms-types-member/pdl/com/arsdigita/content-types/Member.pdl b/ccm-cms-types-member/pdl/com/arsdigita/content-types/Member.pdl index 85ca1edda..756fd5bc4 100644 --- a/ccm-cms-types-member/pdl/com/arsdigita/content-types/Member.pdl +++ b/ccm-cms-types-member/pdl/com/arsdigita/content-types/Member.pdl @@ -19,13 +19,12 @@ model com.arsdigita.cms.contenttypes; -import com.arsdigita.cms.basetypes.*; import com.arsdigita.cms.ContentPage; -object type Member extends Person { +object type Member extends GenericPerson { -// Address address [0..1] = join Address ct_members.address_id -// to cms_addresses.address_id; +// GenericContact contact [0..1] = join ct_members.contact_id +// to cms_contacts.contact_id; reference key (ct_members.member_id); -} \ No newline at end of file +} diff --git a/ccm-cms-types-member/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Member.xml b/ccm-cms-types-member/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Member.xml index 8052d86f9..f63800e80 100644 --- a/ccm-cms-types-member/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Member.xml +++ b/ccm-cms-types-member/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Member.xml @@ -15,9 +15,9 @@ diff --git a/ccm-cms-types-member/src/com/arsdigita/cms/contenttypes/Member.java b/ccm-cms-types-member/src/com/arsdigita/cms/contenttypes/Member.java index ed9501d15..8ed751e70 100644 --- a/ccm-cms-types-member/src/com/arsdigita/cms/contenttypes/Member.java +++ b/ccm-cms-types-member/src/com/arsdigita/cms/contenttypes/Member.java @@ -19,7 +19,6 @@ package com.arsdigita.cms.contenttypes; import com.arsdigita.cms.ContentType; -import com.arsdigita.cms.basetypes.Person; import com.arsdigita.domain.DataObjectNotFoundException; import com.arsdigita.persistence.DataObject; import com.arsdigita.persistence.OID; @@ -31,7 +30,7 @@ import java.math.BigDecimal; * * @author Jens Pelzetter */ -public class Member extends Person { +public class Member extends GenericPerson { /** Data object type for this domain object */ public static final String BASE_DATA_OBJECT_TYPE = "com.arsdigita.cms.contenttypes.Member"; diff --git a/ccm-cms-types-member/src/com/arsdigita/cms/contenttypes/ui/MemberPropertiesStep.java b/ccm-cms-types-member/src/com/arsdigita/cms/contenttypes/ui/MemberPropertiesStep.java index 817298043..b56b2e26f 100644 --- a/ccm-cms-types-member/src/com/arsdigita/cms/contenttypes/ui/MemberPropertiesStep.java +++ b/ccm-cms-types-member/src/com/arsdigita/cms/contenttypes/ui/MemberPropertiesStep.java @@ -20,13 +20,11 @@ package com.arsdigita.cms.contenttypes.ui; import com.arsdigita.bebop.Component; import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.basetypes.Person; -import com.arsdigita.cms.basetypes.ui.PersonPropertiesStep; import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; import com.arsdigita.cms.ui.authoring.BasicPageForm; import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; -public class MemberPropertiesStep extends PersonPropertiesStep { +public class MemberPropertiesStep extends GenericPersonPropertiesStep { public static final String EDIT_SHEET_NAME = "edit"; @@ -41,7 +39,7 @@ public class MemberPropertiesStep extends PersonPropertiesStep { } public static Component getMemberPropertySheet(ItemSelectionModel itemModel) { - Component sheet = PersonPropertiesStep.getPersonPropertySheet(itemModel); + Component sheet = GenericPersonPropertiesStep.getPersonPropertySheet(itemModel); return sheet; } diff --git a/ccm-cms-types-member/src/com/arsdigita/cms/contenttypes/ui/MemberPropertyForm.java b/ccm-cms-types-member/src/com/arsdigita/cms/contenttypes/ui/MemberPropertyForm.java index ca62f09bb..8271c61ff 100644 --- a/ccm-cms-types-member/src/com/arsdigita/cms/contenttypes/ui/MemberPropertyForm.java +++ b/ccm-cms-types-member/src/com/arsdigita/cms/contenttypes/ui/MemberPropertyForm.java @@ -28,7 +28,6 @@ import com.arsdigita.bebop.form.TextField; import com.arsdigita.bebop.parameters.ParameterModel; import com.arsdigita.bebop.parameters.StringParameter; import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.basetypes.ui.PersonPropertyForm; import com.arsdigita.cms.contenttypes.Member; import com.arsdigita.cms.contenttypes.util.MemberGlobalizationUtil; import com.arsdigita.cms.ui.authoring.BasicPageForm; @@ -39,7 +38,7 @@ import org.apache.log4j.Logger; * * @author: Jens Pelzetter */ -public class MemberPropertyForm extends PersonPropertyForm implements FormProcessListener, FormInitListener, FormSubmissionListener { +public class MemberPropertyForm extends GenericPersonPropertyForm implements FormProcessListener, FormInitListener, FormSubmissionListener { private static final Logger s_log = Logger.getLogger(MemberPropertyForm.class); private MemberPropertiesStep m_step; @@ -72,4 +71,4 @@ public class MemberPropertyForm extends PersonPropertyForm implements FormProces } } - \ No newline at end of file + diff --git a/ccm-cms-types-newsitem/pdl/com/arsdigita/content-types/NewsItem.pdl b/ccm-cms-types-newsitem/pdl/com/arsdigita/content-types/NewsItem.pdl index 3c019fc8d..147ff4ab8 100755 --- a/ccm-cms-types-newsitem/pdl/com/arsdigita/content-types/NewsItem.pdl +++ b/ccm-cms-types-newsitem/pdl/com/arsdigita/content-types/NewsItem.pdl @@ -19,11 +19,9 @@ // $DateTime: 2004/08/17 23:15:09 $ model com.arsdigita.cms.contenttypes; -import com.arsdigita.cms.basetypes.*; - // object type to hold extended attributes of news content type -object type NewsItem extends com.arsdigita.cms.basetypes.Article { +object type NewsItem extends GenericArticle { // The tease/lead paragraph for the news item String [0..1] lead = ct_news.tease_lead VARCHAR(4000); // The date for the news item diff --git a/ccm-cms-types-newsitem/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/NewsItem.xml b/ccm-cms-types-newsitem/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/NewsItem.xml index c829a59a2..d7708fc76 100755 --- a/ccm-cms-types-newsitem/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/NewsItem.xml +++ b/ccm-cms-types-newsitem/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/NewsItem.xml @@ -10,7 +10,7 @@ diff --git a/ccm-cms-types-newsitem/src/com/arsdigita/cms/contenttypes/NewsItem.java b/ccm-cms-types-newsitem/src/com/arsdigita/cms/contenttypes/NewsItem.java index 77326cc00..a05dd00aa 100755 --- a/ccm-cms-types-newsitem/src/com/arsdigita/cms/contenttypes/NewsItem.java +++ b/ccm-cms-types-newsitem/src/com/arsdigita/cms/contenttypes/NewsItem.java @@ -55,7 +55,7 @@ import java.util.Date; * @author Shashin Shinde sshinde@redhat.com * @version $Revision: #7 $ $Date: 2004/08/17 $ **/ -public class NewsItem extends com.arsdigita.cms.basetypes.Article { +public class NewsItem extends GenericArticle { /** PDL property name for lead */ public static final String LEAD = "lead"; diff --git a/ccm-cms-types-organizationalunit/pdl/com/arsdigita/content-types/Membership.pdl b/ccm-cms-types-organizationalunit/pdl/com/arsdigita/content-types/Membership.pdl index 35c921ba8..63e855c9c 100644 --- a/ccm-cms-types-organizationalunit/pdl/com/arsdigita/content-types/Membership.pdl +++ b/ccm-cms-types-organizationalunit/pdl/com/arsdigita/content-types/Membership.pdl @@ -19,13 +19,13 @@ model com.arsdigita.cms.contenttypes; import com.arsdigita.cms.ContentItem; import com.arsdigita.kernel.ACSObject; -import com.arsdigita.cms.basetypes.Person; +import com.arsdigita.cms.contenttypes.GenericPerson; object type Membership extends ACSObject { MembershipStatus[1..1] status = join ct_memberships.status_id to ct_membershipstatus.status_id; Date[0..1] memberFrom = ct_memberships.member_from DATE; Date[0..1] memberTo = ct_memberships.member_to DATE; - Person[0..1] targetItem = join ct_memberships.target_item_id to cms_persons.person_id; + GenericPerson[0..1] targetItem = join ct_memberships.target_item_id to cms_persons.person_id; reference key(ct_memberships.membership_id); aggressive load (membershipOwner.id); diff --git a/ccm-cms-types-organizationalunit/pdl/com/arsdigita/content-types/OrganizationalUnit.pdl b/ccm-cms-types-organizationalunit/pdl/com/arsdigita/content-types/OrganizationalUnit.pdl index bab74a3e9..1b0cc7b15 100644 --- a/ccm-cms-types-organizationalunit/pdl/com/arsdigita/content-types/OrganizationalUnit.pdl +++ b/ccm-cms-types-organizationalunit/pdl/com/arsdigita/content-types/OrganizationalUnit.pdl @@ -22,7 +22,7 @@ model com.arsdigita.cms.contenttypes; import com.arsdigita.cms.ContentItem; import com.arsdigita.cms.ContentPage; import com.arsdigita.cms.DomainObject; -import com.arsdigita.cms.basetypes.Person; +import com.arsdigita.cms.contenttypes.GenericPerson; object type OrganizationalUnit extends ContentPage { String[0..1] organizationalunitName = ct_organizationalunits.organizationalunit_name VARCHAR(512); @@ -38,12 +38,12 @@ object type OrganizationalUnit extends ContentPage { association { - Person[0..1] direction = join ct_organizationalunits.direction_id to cms_persons.person_id; + GenericPerson[0..1] direction = join ct_organizationalunits.direction_id to cms_persons.person_id; OrganizationalUnit[0..n] directedUnit = join cms_persons.person_id to ct_organizationalunits.direction_id; } association { - Person[0..1] assistentDirection = join ct_organizationalunits.assistantDirection_id to cms_persons.person_id; + GenericPerson[0..1] assistentDirection = join ct_organizationalunits.assistantDirection_id to cms_persons.person_id; OrganizationalUnit[0..n] assistenedDirectedUnit = join cms_persons.person_id to ct_organizationalunits.assistantDirection_id; } diff --git a/ccm-cms-types-organizationalunit/src/com/arsdigita/cms/contenttypes/Membership.java b/ccm-cms-types-organizationalunit/src/com/arsdigita/cms/contenttypes/Membership.java index f571fc6bc..b61fe1a94 100644 --- a/ccm-cms-types-organizationalunit/src/com/arsdigita/cms/contenttypes/Membership.java +++ b/ccm-cms-types-organizationalunit/src/com/arsdigita/cms/contenttypes/Membership.java @@ -2,7 +2,7 @@ package com.arsdigita.cms.contenttypes; import com.arsdigita.bebop.PageState; import com.arsdigita.cms.ContentSection; -import com.arsdigita.cms.basetypes.Person; +import com.arsdigita.cms.contenttypes.GenericPerson; import com.arsdigita.cms.dispatcher.ItemResolver; import com.arsdigita.domain.DomainObjectFactory; import com.arsdigita.kernel.ACSObject; @@ -121,18 +121,18 @@ public class Membership extends ACSObject { setAssociation(MEMBERSHIP_OWNER, ou); } - public Person getTargetItem() { + public GenericPerson getTargetItem() { DataObject obj = (DataObject) get(TARGET_ITEM); - return (Person) DomainObjectFactory.newInstance(obj); + return (GenericPerson) DomainObjectFactory.newInstance(obj); } - public void setTargetItem(Person person) { - Assert.exists(person, Person.class); + public void setTargetItem(GenericPerson person) { + Assert.exists(person, GenericPerson.class); setAssociation(TARGET_ITEM, person); } public String getURI(PageState state) { - Person person = this.getTargetItem(); + GenericPerson person = this.getTargetItem(); if (person == null) { logger.error(getOID() + " is a link between a OrganizationalUnit and a Person, but the associated Person is null"); @@ -146,7 +146,7 @@ public class Membership extends ACSObject { return URL.there(state.getRequest(), url).toString(); } - public static DataCollection getReferingPersons(Person person) { + public static DataCollection getReferingPersons(GenericPerson person) { Session session = SessionManager.getSession(); DataCollection memberships = session.retrieve(BASE_DATA_OBJECT_TYPE); Filter filter = memberships.addInSubqueryFilter("id", "com.arsdigita.cms.contenttypes.getReferingPersons"); diff --git a/ccm-cms-types-organizationalunit/src/com/arsdigita/cms/contenttypes/OrganizationalUnit.java b/ccm-cms-types-organizationalunit/src/com/arsdigita/cms/contenttypes/OrganizationalUnit.java index 0fc91d859..b3810d0e8 100644 --- a/ccm-cms-types-organizationalunit/src/com/arsdigita/cms/contenttypes/OrganizationalUnit.java +++ b/ccm-cms-types-organizationalunit/src/com/arsdigita/cms/contenttypes/OrganizationalUnit.java @@ -19,7 +19,7 @@ package com.arsdigita.cms.contenttypes; import com.arsdigita.cms.ContentPage; -import com.arsdigita.cms.basetypes.Person; +import com.arsdigita.cms.contenttypes.GenericPerson; import com.arsdigita.domain.DataObjectNotFoundException; import com.arsdigita.domain.DomainObjectFactory; import com.arsdigita.persistence.DataCollection; @@ -84,32 +84,32 @@ public class OrganizationalUnit extends ContentPage{ set(ORGANIZATIONALUNIT_DESCRIPTION, description); } - public Person getDirection() { + public GenericPerson getDirection() { DataObject dobj = (DataObject) get(DIRECTION); if (dobj != null) { - return (Person) DomainObjectFactory.newInstance(dobj); + return (GenericPerson) DomainObjectFactory.newInstance(dobj); } else { return null; } } - public void setDirection(Person person) { + public void setDirection(GenericPerson person) { logger.debug("Setting direction..."); - Assert.exists(person, Person.class); + Assert.exists(person, GenericPerson.class); setAssociation(DIRECTION, person); } - public Person getAssistentDirection() { + public GenericPerson getAssistentDirection() { DataObject dobj = (DataObject) get(ASSISTENT_DIRECTION); if (dobj != null) { - return (Person) DomainObjectFactory.newInstance(dobj); + return (GenericPerson) DomainObjectFactory.newInstance(dobj); } else { return null; } } - public void setAssistentDirection(Person person) { - Assert.exists(person, Person.class); + public void setAssistentDirection(GenericPerson person) { + Assert.exists(person, GenericPerson.class); setAssociation(ASSISTENT_DIRECTION, person); } diff --git a/ccm-cms-types-organizationalunit/src/com/arsdigita/cms/contenttypes/ui/organizationalunit/MembershipPropertyForm.java b/ccm-cms-types-organizationalunit/src/com/arsdigita/cms/contenttypes/ui/organizationalunit/MembershipPropertyForm.java index 8cb9128ad..6ff49aa36 100644 --- a/ccm-cms-types-organizationalunit/src/com/arsdigita/cms/contenttypes/ui/organizationalunit/MembershipPropertyForm.java +++ b/ccm-cms-types-organizationalunit/src/com/arsdigita/cms/contenttypes/ui/organizationalunit/MembershipPropertyForm.java @@ -22,7 +22,7 @@ import com.arsdigita.bebop.parameters.StringParameter; import com.arsdigita.bebop.util.GlobalizationUtil; import com.arsdigita.cms.ContentType; import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.basetypes.Person; +import com.arsdigita.cms.contenttypes.GenericPerson; import com.arsdigita.cms.contenttypes.Membership; import com.arsdigita.cms.contenttypes.MembershipStatus; import com.arsdigita.cms.contenttypes.OrganizationalUnit; @@ -77,7 +77,7 @@ public class MembershipPropertyForm extends FormSection implements FormInitListe logger.debug("adding widgets..."); add(new Label(OrganizationalUnitGlobalizationUtil.globalize("cms.contenttypes.ui.orgnizationalunit.membership.Person"))); - this.m_personSearch = new ItemSearchWidget(PERSON_SEARCH, ContentType.findByAssociatedObjectType("com.arsdigita.cms.basetypes.Person")); + this.m_personSearch = new ItemSearchWidget(PERSON_SEARCH, ContentType.findByAssociatedObjectType("com.arsdigita.cms.contenttypes.GenericPerson")); add(this.m_personSearch); add(new Label(OrganizationalUnitGlobalizationUtil.globalize("cms.contenttypes.ui.orgnizationalunit.membership.Status"))); @@ -166,7 +166,7 @@ public class MembershipPropertyForm extends FormSection implements FormInitListe PageState state = event.getPageState(); FormData data = event.getFormData(); - membership.setTargetItem((Person) data.get(PERSON_SEARCH)); + membership.setTargetItem((GenericPerson) data.get(PERSON_SEARCH)); MembershipStatus status = new MembershipStatus(new BigDecimal((String) this.m_status.getValue(state))); logger.debug("this.m_status.getValues() = " + this.m_status.getValue(state)); diff --git a/ccm-cms-types-organizationalunit/src/com/arsdigita/cms/contenttypes/ui/organizationalunit/MembershipTable.java b/ccm-cms-types-organizationalunit/src/com/arsdigita/cms/contenttypes/ui/organizationalunit/MembershipTable.java index e5c08431a..8e58f6e75 100644 --- a/ccm-cms-types-organizationalunit/src/com/arsdigita/cms/contenttypes/ui/organizationalunit/MembershipTable.java +++ b/ccm-cms-types-organizationalunit/src/com/arsdigita/cms/contenttypes/ui/organizationalunit/MembershipTable.java @@ -16,7 +16,7 @@ import com.arsdigita.cms.ContentItem; import com.arsdigita.cms.SecurityManager; import org.apache.log4j.Logger; import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.basetypes.Person; +import com.arsdigita.cms.contenttypes.GenericPerson; import com.arsdigita.cms.contenttypes.Membership; import com.arsdigita.cms.contenttypes.MembershipStatus; import com.arsdigita.cms.contenttypes.OrganizationalUnitGlobalizationUtil; @@ -96,7 +96,7 @@ public class MembershipTable extends Table { String url = membership.getURI(state); if (column == m_personCol.getModelIndex()) { - Person person = membership.getTargetItem(); + GenericPerson person = membership.getTargetItem(); StringBuilder fullNameBuilder = new StringBuilder(); if(person.getTitlePre() != null) { diff --git a/ccm-cms-types-organizationalunit/src/com/arsdigita/cms/contenttypes/ui/organizationalunit/OrganizationalUnitChooseAssistentDirectorTable.java b/ccm-cms-types-organizationalunit/src/com/arsdigita/cms/contenttypes/ui/organizationalunit/OrganizationalUnitChooseAssistentDirectorTable.java index 6243ac9ee..af06237bf 100644 --- a/ccm-cms-types-organizationalunit/src/com/arsdigita/cms/contenttypes/ui/organizationalunit/OrganizationalUnitChooseAssistentDirectorTable.java +++ b/ccm-cms-types-organizationalunit/src/com/arsdigita/cms/contenttypes/ui/organizationalunit/OrganizationalUnitChooseAssistentDirectorTable.java @@ -32,7 +32,7 @@ import com.arsdigita.bebop.table.TableModel; import com.arsdigita.bebop.table.TableModelBuilder; import com.arsdigita.cms.ContentItem; import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.basetypes.Person; +import com.arsdigita.cms.contenttypes.GenericPerson; import com.arsdigita.cms.contenttypes.OrganizationalUnit; import com.arsdigita.cms.contenttypes.OrganizationalUnitGlobalizationUtil; import com.arsdigita.domain.DomainObjectFactory; @@ -78,7 +78,7 @@ public class OrganizationalUnitChooseAssistentDirectorTable extends Table implem public TableModel makeModel(Table t, PageState s) { t.getRowSelectionModel().clearSelection(s); - DataCollection m_persons = SessionManager.getSession().retrieve(Person.BASE_DATA_OBJECT_TYPE); + DataCollection m_persons = SessionManager.getSession().retrieve(GenericPerson.BASE_DATA_OBJECT_TYPE); m_persons.addEqualsFilter(ContentItem.VERSION, ContentItem.DRAFT); return new OrganizationalUnitChooseAssistentDirectorTableModel(t, m_persons); } @@ -88,7 +88,7 @@ public class OrganizationalUnitChooseAssistentDirectorTable extends Table implem private Table m_table; private DataCollection m_persons; - private Person m_person; + private GenericPerson m_person; private OrganizationalUnitChooseAssistentDirectorTableModel(Table t, DataCollection persons) { m_table = t; @@ -101,7 +101,7 @@ public class OrganizationalUnitChooseAssistentDirectorTable extends Table implem public boolean nextRow() { if (m_persons.next()) { - m_person = (Person) DomainObjectFactory.newInstance(m_persons.getDataObject()); + m_person = (GenericPerson) DomainObjectFactory.newInstance(m_persons.getDataObject()); return true; } else { return false; @@ -163,7 +163,7 @@ public class OrganizationalUnitChooseAssistentDirectorTable extends Table implem m_parent.showDisplayPane(state); BigDecimal personID = new BigDecimal (e.getRowKey().toString()); OrganizationalUnit orgaunit = (OrganizationalUnit) this.m_selOrgaUnit.getSelectedObject(state); - Person person = (Person) DomainObjectFactory.newInstance(new OID(Person.BASE_DATA_OBJECT_TYPE, personID)); + GenericPerson person = (GenericPerson) DomainObjectFactory.newInstance(new OID(GenericPerson.BASE_DATA_OBJECT_TYPE, personID)); orgaunit.setAssistentDirection(person); } } diff --git a/ccm-cms-types-organizationalunit/src/com/arsdigita/cms/contenttypes/ui/organizationalunit/OrganizationalUnitChooseDirectorTable.java b/ccm-cms-types-organizationalunit/src/com/arsdigita/cms/contenttypes/ui/organizationalunit/OrganizationalUnitChooseDirectorTable.java index 379182d51..9d91b588d 100644 --- a/ccm-cms-types-organizationalunit/src/com/arsdigita/cms/contenttypes/ui/organizationalunit/OrganizationalUnitChooseDirectorTable.java +++ b/ccm-cms-types-organizationalunit/src/com/arsdigita/cms/contenttypes/ui/organizationalunit/OrganizationalUnitChooseDirectorTable.java @@ -32,7 +32,7 @@ import com.arsdigita.bebop.table.TableModel; import com.arsdigita.bebop.table.TableModelBuilder; import com.arsdigita.cms.ContentItem; import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.basetypes.Person; +import com.arsdigita.cms.contenttypes.GenericPerson; import com.arsdigita.cms.contenttypes.OrganizationalUnit; import com.arsdigita.domain.DomainObjectFactory; import com.arsdigita.persistence.DataCollection; @@ -79,7 +79,7 @@ public class OrganizationalUnitChooseDirectorTable extends Table implements Tabl public TableModel makeModel(Table t, PageState s) { t.getRowSelectionModel().clearSelection(s); - DataCollection m_persons = SessionManager.getSession().retrieve(Person.BASE_DATA_OBJECT_TYPE); + DataCollection m_persons = SessionManager.getSession().retrieve(GenericPerson.BASE_DATA_OBJECT_TYPE); m_persons.addEqualsFilter(ContentItem.VERSION, ContentItem.DRAFT); return new OrganizationalUnitChooseDirectorTableModel(t, m_persons); } @@ -89,7 +89,7 @@ public class OrganizationalUnitChooseDirectorTable extends Table implements Tabl private Table m_table; private DataCollection m_persons; - private Person m_person; + private GenericPerson m_person; private OrganizationalUnitChooseDirectorTableModel(Table t, DataCollection persons) { m_table = t; @@ -102,7 +102,7 @@ public class OrganizationalUnitChooseDirectorTable extends Table implements Tabl public boolean nextRow() { if (m_persons.next()) { - m_person = (Person) DomainObjectFactory.newInstance(m_persons.getDataObject()); + m_person = (GenericPerson) DomainObjectFactory.newInstance(m_persons.getDataObject()); return true; } else { return false; @@ -167,7 +167,7 @@ public class OrganizationalUnitChooseDirectorTable extends Table implements Tabl m_parent.showDisplayPane(state); BigDecimal personID = new BigDecimal (e.getRowKey().toString()); OrganizationalUnit orgaunit = (OrganizationalUnit) this.m_selOrgaUnit.getSelectedObject(state); - Person person = (Person) DomainObjectFactory.newInstance(new OID(Person.BASE_DATA_OBJECT_TYPE, personID)); + GenericPerson person = (GenericPerson) DomainObjectFactory.newInstance(new OID(GenericPerson.BASE_DATA_OBJECT_TYPE, personID)); orgaunit.setDirection(person); } } diff --git a/ccm-cms/pdl/com/arsdigita/basetypes/Address.pdl b/ccm-cms/pdl/com/arsdigita/content-types/GenericAddress.pdl similarity index 83% rename from ccm-cms/pdl/com/arsdigita/basetypes/Address.pdl rename to ccm-cms/pdl/com/arsdigita/content-types/GenericAddress.pdl index 365daba69..6811e2fbc 100644 --- a/ccm-cms/pdl/com/arsdigita/basetypes/Address.pdl +++ b/ccm-cms/pdl/com/arsdigita/content-types/GenericAddress.pdl @@ -1,9 +1,9 @@ -model com.arsdigita.cms.basetypes; +model com.arsdigita.cms.contenttypes; import com.arsdigita.cms.ContentPage; // Address object -object type Address extends ContentPage { +object type GenericAddress extends ContentPage { String [0..1] address = cms_addresses.address VARCHAR(1000); String [0..1] postalCode = cms_addresses.postalCode VARCHAR(20); diff --git a/ccm-cms/pdl/com/arsdigita/basetypes/Article.pdl b/ccm-cms/pdl/com/arsdigita/content-types/GenericArticle.pdl old mode 100755 new mode 100644 similarity index 81% rename from ccm-cms/pdl/com/arsdigita/basetypes/Article.pdl rename to ccm-cms/pdl/com/arsdigita/content-types/GenericArticle.pdl index 247293466..cf41c974c --- a/ccm-cms/pdl/com/arsdigita/basetypes/Article.pdl +++ b/ccm-cms/pdl/com/arsdigita/content-types/GenericArticle.pdl @@ -17,12 +17,12 @@ // // $Id: Article.pdl 287 2005-02-22 00:29:02Z sskracic $ // $DateTime: 2004/08/17 23:15:09 $ -model com.arsdigita.cms.basetypes; +model com.arsdigita.cms.contenttypes; import com.arsdigita.cms.*; import com.arsdigita.kernel.*; -object type Article extends TextPage { +object type GenericArticle extends TextPage { reference key (cms_articles.article_id); @@ -30,14 +30,14 @@ object type Article extends TextPage { association { - component ArticleImageAssociation[0..n] imageCaptions = join cms_articles.article_id + component GenericArticleImageAssociation[0..n] imageCaptions = join cms_articles.article_id to cms_article_image_map.article_id; - Article[1..1] captionArticle = join cms_article_image_map.article_id to cms_articles.article_id; + GenericArticle[1..1] captionArticle = join cms_article_image_map.article_id to cms_articles.article_id; } -object type ArticleImageAssociation extends ContentItem { +object type GenericArticleImageAssociation extends ContentItem { String[0..1] caption = cms_article_image_map.caption VARCHAR(4000); // Only including these ID attributes for legacy purposes diff --git a/ccm-cms/pdl/com/arsdigita/basetypes/Contact.pdl b/ccm-cms/pdl/com/arsdigita/content-types/GenericContact.pdl similarity index 56% rename from ccm-cms/pdl/com/arsdigita/basetypes/Contact.pdl rename to ccm-cms/pdl/com/arsdigita/content-types/GenericContact.pdl index 9a37b06d9..03215545f 100644 --- a/ccm-cms/pdl/com/arsdigita/basetypes/Contact.pdl +++ b/ccm-cms/pdl/com/arsdigita/content-types/GenericContact.pdl @@ -1,24 +1,24 @@ -model com.arsdigita.cms.basetypes; +model com.arsdigita.cms.contenttypes; import com.arsdigita.kernel.ACSObject; import com.arsdigita.cms.*; // Contact Object -object type Contact extends ContentPage { +object type GenericContact extends ContentPage { - Person [0..1] person = join cms_contacts.person_id + GenericPerson [0..1] person = join cms_contacts.person_id to cms_persons.person_id; - Address [0..1] address = join cms_contacts.address_id - to cms_addresses.address_id; + GenericAddress [0..1] address = join cms_contacts.address_id + to cms_addresses.address_id; - component ContactEntry [0..n] contactentries = join cms_contacts.contact_id + component GenericContactEntry [0..n] contactentries = join cms_contacts.contact_id to cms_contactEntries.contact_id; reference key ( cms_contacts.contact_id ); } -object type ContactEntry extends ContentItem { +object type GenericContactEntry extends ContentItem { String [1..1] key = cms_contactEntries.key VARCHAR(100); String [0..1] description = cms_contactEntries.description VARCHAR(100); diff --git a/ccm-cms/pdl/com/arsdigita/basetypes/Person.pdl b/ccm-cms/pdl/com/arsdigita/content-types/GenericPerson.pdl similarity index 93% rename from ccm-cms/pdl/com/arsdigita/basetypes/Person.pdl rename to ccm-cms/pdl/com/arsdigita/content-types/GenericPerson.pdl index ede7af649..47293819a 100644 --- a/ccm-cms/pdl/com/arsdigita/basetypes/Person.pdl +++ b/ccm-cms/pdl/com/arsdigita/content-types/GenericPerson.pdl @@ -17,11 +17,11 @@ // // -model com.arsdigita.cms.basetypes; +model com.arsdigita.cms.contenttypes; import com.arsdigita.cms.ContentPage; -object type Person extends ContentPage { +object type GenericPerson extends ContentPage { String[0..1] surname = cms_persons.surname VARCHAR(512); String[0..1] givenname = cms_persons.givenname VARCHAR(512); String[0..1] titlepre = cms_persons.titlepre VARCHAR(256); diff --git a/ccm-cms/src/WEB-INF/basetypes/Person.xml b/ccm-cms/src/WEB-INF/basetypes/Person.xml deleted file mode 100644 index d63c27553..000000000 --- a/ccm-cms/src/WEB-INF/basetypes/Person.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/ccm-cms/src/WEB-INF/basetypes/Contact.xml b/ccm-cms/src/WEB-INF/content-types/GenericAddress.xml similarity index 76% rename from ccm-cms/src/WEB-INF/basetypes/Contact.xml rename to ccm-cms/src/WEB-INF/content-types/GenericAddress.xml index 8467b8a66..805e40127 100644 --- a/ccm-cms/src/WEB-INF/basetypes/Contact.xml +++ b/ccm-cms/src/WEB-INF/content-types/GenericAddress.xml @@ -5,10 +5,10 @@ xsi:schemaLocation="http://xmlns.redhat.com/cms/content-types content-types.xsd"> diff --git a/ccm-cms/src/WEB-INF/basetypes/Article.xml b/ccm-cms/src/WEB-INF/content-types/GenericArticle.xml similarity index 64% rename from ccm-cms/src/WEB-INF/basetypes/Article.xml rename to ccm-cms/src/WEB-INF/content-types/GenericArticle.xml index f84a382eb..fc01210a0 100644 --- a/ccm-cms/src/WEB-INF/basetypes/Article.xml +++ b/ccm-cms/src/WEB-INF/content-types/GenericArticle.xml @@ -5,10 +5,10 @@ xsi:schemaLocation="http://xmlns.redhat.com/cms/content-types content-types.xsd"> diff --git a/ccm-cms/src/WEB-INF/content-types/GenericContact.xml b/ccm-cms/src/WEB-INF/content-types/GenericContact.xml new file mode 100644 index 000000000..4d56ea725 --- /dev/null +++ b/ccm-cms/src/WEB-INF/content-types/GenericContact.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + diff --git a/ccm-cms/src/WEB-INF/basetypes/Address.xml b/ccm-cms/src/WEB-INF/content-types/GenericPerson.xml similarity index 76% rename from ccm-cms/src/WEB-INF/basetypes/Address.xml rename to ccm-cms/src/WEB-INF/content-types/GenericPerson.xml index 6f7a301f0..8f56e9771 100644 --- a/ccm-cms/src/WEB-INF/basetypes/Address.xml +++ b/ccm-cms/src/WEB-INF/content-types/GenericPerson.xml @@ -5,10 +5,10 @@ xsi:schemaLocation="http://xmlns.redhat.com/cms/content-types content-types.xsd"> diff --git a/ccm-cms/src/WEB-INF/resources/cms-item-adapters.xml b/ccm-cms/src/WEB-INF/resources/cms-item-adapters.xml index 1a3920aeb..eae113b18 100755 --- a/ccm-cms/src/WEB-INF/resources/cms-item-adapters.xml +++ b/ccm-cms/src/WEB-INF/resources/cms-item-adapters.xml @@ -85,7 +85,7 @@ - + @@ -166,7 +166,7 @@ - + @@ -232,4 +232,4 @@ - \ No newline at end of file + diff --git a/ccm-cms/src/ccm-cms.config b/ccm-cms/src/ccm-cms.config index 1cd1ccd04..ac4b7438b 100755 --- a/ccm-cms/src/ccm-cms.config +++ b/ccm-cms/src/ccm-cms.config @@ -6,8 +6,8 @@ storage="ccm-cms/lifecycle.properties"/> - - + + diff --git a/ccm-cms/src/com/arsdigita/cms/basetypes/AddressConfig_parameter.properties b/ccm-cms/src/com/arsdigita/cms/basetypes/AddressConfig_parameter.properties deleted file mode 100644 index 9a6874520..000000000 --- a/ccm-cms/src/com/arsdigita/cms/basetypes/AddressConfig_parameter.properties +++ /dev/null @@ -1,9 +0,0 @@ -com.arsdigita.cms.basetypes.address.hide_country_code_selection.title=Hide ISO Country Code -com.arsdigita.cms.basetypes.address.hide_country_code_selection.purpose=Hide the ISO country code selection box -com.arsdigita.cms.basetypes.address.hide_country_code_selection.example=false -com.arsdigita.cms.basetypes.address.hide_country_code_selection.format=[boolean] - -com.arsdigita.cms.basetypes.address.hide_postal_code.title=Hide Postal Code -com.arsdigita.cms.basetypes.address.hide_postal_code.purpose=Hide the the postal code entry field -com.arsdigita.cms.basetypes.address.hide_postal_code.example=false -com.arsdigita.cms.basetypes.address.hide_postal_code.format=[boolean] diff --git a/ccm-cms/src/com/arsdigita/cms/basetypes/BasetypesResources.properties b/ccm-cms/src/com/arsdigita/cms/basetypes/BasetypesResources.properties deleted file mode 100644 index c767de988..000000000 --- a/ccm-cms/src/com/arsdigita/cms/basetypes/BasetypesResources.properties +++ /dev/null @@ -1,64 +0,0 @@ -cms.basetypes.ui.address.address=Address -cms.basetypes.ui.address.postal_code=Postal Code -cms.basetypes.ui.address.city=City -cms.basetypes.ui.address.state=State -cms.basetypes.ui.address.iso_country_code=Country -cms.basetypes.ui.address.error_iso_country=You must select a country - -cms.basetypes.ui.person.surname=Surname -cms.basetypes.ui.person.givenname=Given name -cms.basetypes.ui.person.titlepre=Title -cms.basetypes.ui.person.titlepost=Name appendix - -address.authoring.basic_properties.title=Basic Properties - -cms.basetypes.ui.contact.basic_properties=Basic Properties -cms.basetypes.ui.contact.edit_basic_properties=Edit Basic Properties -cms.basetypes.ui.contact.edit_basic_properties.description=Description -cms.basetypes.ui.contact.confirm_delete=Sure? -cms.basetypes.ui.contact.person=Person -cms.basetypes.ui.contact.address=Address - -cms.basetypes.ui.contact.attach_address=Attach Address -cms.basetypes.ui.contact.edit_address=Edit Address -cms.basetypes.ui.contact.reattach_address=Reattach Address -cms.basetypes.ui.contact.delete_address=Delete Address -cms.basetypes.ui.contact.emptyAddress=There is no Address attached -cms.basetypes.ui.contact.select_address=Please select a contact content type -cms.basetypes.ui.contact.select_address.add=Add -cms.basetypes.ui.contact.select_address.change=Change -cms.basetypes.ui.contact.select_address.wrong_type=BaseAddress selection is required -cms.basetypes.ui.contact.select_address.cancelled=cancelled -cms.basetypes.ui.contact.delete_address.label=Do you want to delete the link to the contact content type? -cms.basetypes.ui.contact.delete_address.button_label=Delete - -cms.basetypes.ui.contact.attach_person=Attach Person -cms.basetypes.ui.contact.edit_person=Edit Person -cms.basetypes.ui.contact.reattach_person=Reattach Person -cms.basetypes.ui.contact.delete_person=Delete Person -cms.basetypes.ui.contact.emptyPerson=There is no Address attached -cms.basetypes.ui.contact.select_person=Please select a Person content type -cms.basetypes.ui.contact.select_person.add=Add -cms.basetypes.ui.contact.select_person.change=Change -cms.basetypes.ui.contact.select_person.wrong_type=Person selection is required -cms.basetypes.ui.contact.select_person.cancelled=cancelled -cms.basetypes.ui.contact.delete_person.label=Do you want to delete the link to the Person content type? -cms.basetypes.ui.contact.delete_person.button_label=Delete - -cms.basetypes.ui.contact.add_contactEntry=Add Contact Entry -cms.basetypes.ui.contact.contactEntry=Contact Entries -cms.basetypes.ui.contact.contactEntry.key=Type -cms.basetypes.ui.contact.contactEntry.value=Value -cms.basetypes.ui.contact.contactEntry.description=Description (internal use only) -cms.basetypes.ui.contact.contactEntry.action=Action - -cms.basetypes.ui.contact.contactEntry.key.contact_type=Type of Contact -cms.basetypes.ui.contact.contactEntry.key.office_hours=Office Hours -cms.basetypes.ui.contact.contactEntry.key.phone_office=Phone (office) -cms.basetypes.ui.contact.contactEntry.key.phone_private=Phone (private) -cms.basetypes.ui.contact.contactEntry.key.phone_mobile=Phone (mobile) -cms.basetypes.ui.contact.contactEntry.key.email=eMail -cms.basetypes.ui.contact.contactEntry.key.fax=Fax -cms.basetypes.ui.contact.contactEntry.key.im=Instant Messenger -cms.basetypes.ui.contact.contactEntry.key.www=Homepage - diff --git a/ccm-cms/src/com/arsdigita/cms/basetypes/BasetypesResources_de.properties b/ccm-cms/src/com/arsdigita/cms/basetypes/BasetypesResources_de.properties deleted file mode 100644 index ea063d37b..000000000 --- a/ccm-cms/src/com/arsdigita/cms/basetypes/BasetypesResources_de.properties +++ /dev/null @@ -1,66 +0,0 @@ -cms.basetypes.ui.address.address=Anschrift -cms.basetypes.ui.address.postal_code=Postleitzahl -cms.basetypes.ui.address.city=Stadt -cms.basetypes.ui.address.state=Bundesland -cms.basetypes.ui.address.iso_country_code=Land -cms.basetypes.ui.address.error_iso_country=Bitte w\u00E4hlen Sie ein Land aus - -cms.basetypes.ui.person.surname=Nachname -cms.basetypes.ui.person.givenname=Vorname -cms.basetypes.ui.person.titlepre=Titel -cms.basetypes.ui.person.titlepost=Namesanhang - -address.authoring.basic_properties.title=Eigenschaften von Adresse - -cms.basetypes.ui.contact.basic_properties=Eigenschaften von Contact -cms.basetypes.ui.contact.edit_basic_properties=Bearbeiten -cms.basetypes.ui.contact.edit_basic_properties.description=Description -cms.basetypes.ui.contact.confirm_delete=Sind Sie sicher? -cms.basetypes.ui.contact.person=Person -cms.basetypes.ui.contact.address=Adresse - -cms.basetypes.ui.contact.attach_address=Adresse verkn\u00FCpfen -cms.basetypes.ui.contact.edit_address=Adresse bearbeiten -cms.basetypes.ui.contact.reattach_address=Adresse neu verkn\u00FCpfen -cms.basetypes.ui.contact.delete_address=Adresse l\u00F6schen -cms.basetypes.ui.contact.emptyAddress=Zur Zeit ist keine Adresse verkn\u00FCpft -cms.basetypes.ui.contact.select_address=Bitte w\u00E4hlen Sie eine Eintrag vom Typ BaseAddress -cms.basetypes.ui.contact.select_address.add=Verkn\u00FCpfen -cms.basetypes.ui.contact.select_address.change=Ver\u00E4ndern -cms.basetypes.ui.contact.select_address.wrong_type=Der gew\u00E4hlte Eintrag ist nicht vom Typ BaseAddress -cms.basetypes.ui.contact.select_address.cancelled=Abbruch -cms.basetypes.ui.contact.delete_address.label=Wollen Sie die Verkn\u00FCpfung zur Adresse entfernen? -cms.basetypes.ui.contact.delete_address.button_label=L\u00F6schen - -cms.basetypes.ui.contact.attach_person=Person verkn\u00FCpfen -cms.basetypes.ui.contact.edit_person=Person bearbeiten -cms.basetypes.ui.contact.reattach_person=Person neu verkn\u00FCpfen -cms.basetypes.ui.contact.delete_person=Person l\u00F6schen -cms.basetypes.ui.contact.emptyPerson=Zur Zeit ist keine Person verkn\u00FCft -cms.basetypes.ui.contact.select_person=Bitte w\u00E4hlen Sie einen Eintrag vom Typ Person -cms.basetypes.ui.contact.select_person.add=Verkn\u00FCpfen -cms.basetypes.ui.contact.select_person.change=Ver\u00E4ndern -cms.basetypes.ui.contact.select_person.wrong_type=Der gew\u00E4hlte Eintrag ist nicht vom Typ Person -cms.basetypes.ui.contact.select_person.cancelled=Abbruch -cms.basetypes.ui.contact.delete_person.label=WollenSie die Verkn\u00FCfung zur Person entfernen? -cms.basetypes.ui.contact.delete_person.button_label=L\u00F6schen - -cms.basetypes.ui.contact.add_contactEntry=Kontaktinformation hinzuf\u00FCgen -cms.basetypes.ui.contact.contactEntry=Kontaktinformationen -cms.basetypes.ui.contact.contactEntry.key=Art der Information -cms.basetypes.ui.contact.contactEntry.value=Inhalt -cms.basetypes.ui.contact.contactEntry.description=Beschreibung (wird nicht \u00F6ffentlich angezeigt) -cms.basetypes.ui.contact.contactEntry.action=Aktionen - -cms.basetypes.ui.contact.contactEntry.key.contact_type=Kontaktart -cms.basetypes.ui.contact.contactEntry.key.office_hours=\u00D6ffnungszeiten -cms.basetypes.ui.contact.contactEntry.key.phone_office=Telefon (B\u00FCro) -cms.basetypes.ui.contact.contactEntry.key.phone_private=Telefon (Privat) -cms.basetypes.ui.contact.contactEntry.key.phone_mobile=Telefon (Mobil) -cms.basetypes.ui.contact.contactEntry.key.email=E-Mail -cms.basetypes.ui.contact.contactEntry.key.fax=Fax -cms.basetypes.ui.contact.contactEntry.key.im=Instant Messenger -cms.basetypes.ui.contact.contactEntry.key.www=Homepage - - -cms.basetypes.ui.contact.contactEntry.none=Zur Zeit sind keine Kontaktinformatioonen vorhanden diff --git a/ccm-cms/src/com/arsdigita/cms/basetypes/ContactConfig_parameter.properties b/ccm-cms/src/com/arsdigita/cms/basetypes/ContactConfig_parameter.properties deleted file mode 100644 index f1bd576f6..000000000 --- a/ccm-cms/src/com/arsdigita/cms/basetypes/ContactConfig_parameter.properties +++ /dev/null @@ -1,29 +0,0 @@ -com.arsdigita.cms.basetypes.contact.hide_person.title=Hide person attachment -com.arsdigita.cms.basetypes.contact.hide_person.purpose=Hide the part to attach a person CT -com.arsdigita.cms.basetypes.contact.hide_person.example=false -com.arsdigita.cms.basetypes.contact.hide_person.format=[boolean] - -com.arsdigita.cms.basetypes.contact.hide_address.title=Hide address attachment -com.arsdigita.cms.basetypes.contact.hide_address.purpose=Hide the part to attach a baseAddress CT -com.arsdigita.cms.basetypes.contact.hide_address.example=false -com.arsdigita.cms.basetypes.contact.hide_address.format=[boolean] - -com.arsdigita.cms.basetypes.contact.address.hide_postal_code.title=Hide postal code for attached adress -com.arsdigita.cms.basetypes.contact.address.hide_postal_code.purpose=Hide the postal code entry field for the attached baseAddress -com.arsdigita.cms.basetypes.contact.address.hide_postal_code.example=false -com.arsdigita.cms.basetypes.contact.address.hide_postal_code.format=[boolean] - -com.arsdigita.cms.basetypes.contact.address.hide_state.title=Hide state for attached adress -com.arsdigita.cms.basetypes.contact.address.hide_state.purpose=Hide the state entry field for the attached baseAddress -com.arsdigita.cms.basetypes.contact.address.hide_state.example=false -com.arsdigita.cms.basetypes.contact.address.hide_state.format=[boolean] - -com.arsdigita.cms.basetypes.contact.address.hide_country.title=Hide country for attached address -com.arsdigita.cms.basetypes.contact.address.hide_country.purpose=Hide the country selection box for the attached baseAddress -com.arsdigita.cms.basetypes.contact.address.hide_country.example=false -com.arsdigita.cms.basetypes.contact.address.hide_country.format=[boolean] - -com.arsdigita.cms.basetypes.contact.contact_entry_keys.title=Select available contact entry types -com.arsdigita.cms.basetypes.contact.contact_entry_keys.purpose=Select available contact entry types and define display order -com.arsdigita.cms.basetypes.contact.contact_entry_keys.example=contact_type,office_hours,phone_office,phone_private,phone_mobile,email,fax,im,www -com.arsdigita.cms.basetypes.contact.contact_entry_keys.format=[string] diff --git a/ccm-cms/src/com/arsdigita/cms/basetypes/ui/ContactAddressPropertiesStep.java b/ccm-cms/src/com/arsdigita/cms/basetypes/ui/ContactAddressPropertiesStep.java deleted file mode 100644 index 94cad95e3..000000000 --- a/ccm-cms/src/com/arsdigita/cms/basetypes/ui/ContactAddressPropertiesStep.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * ContactAddressPropertiesStep.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.basetypes.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.basetypes.Address; -import com.arsdigita.cms.basetypes.Contact; -import com.arsdigita.cms.basetypes.util.BasetypesGlobalizationUtil; -import com.arsdigita.cms.ui.authoring.SimpleEditStep; - -/** - * - * @author quasi - */ -public class ContactAddressPropertiesStep 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 ContactAddressPropertiesStep */ - public ContactAddressPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent) { - this(itemModel, parent, ""); - } - - public ContactAddressPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent, String prefix) { - super(itemModel, parent, prefix); - -// Contact contact = (Contact)itemModel.getSelectedObject(state); - -//XXX -// if(/*contact.getAddress() == null*/ true) { - BasicPageForm attachAddressSheet = new ContactAttachAddressPropertyForm(itemModel, this); - add(ADD_ADDRESS_SHEET_NAME, (String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.attach_address").localize(), new WorkflowLockedComponentAccess(attachAddressSheet, itemModel), attachAddressSheet.getSaveCancelSection().getCancelButton()); - - /* Set the displayComponent for this step */ -// setDisplayComponent(getEmptyBaseAddressPropertySheet(itemModel)); - -// } else { - - // editAddress - BasicPageForm editAddressSheet = new ContactEditAddressPropertyForm(itemModel, this); - add(EDIT_ADDRESS_SHEET_NAME, (String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.edit_address").localize(), new WorkflowLockedComponentAccess(editAddressSheet, itemModel), editAddressSheet.getSaveCancelSection().getCancelButton()); - -// BasicPageForm attachAddressSheet = new ContactAttachAddressPropertyForm(itemModel, this); -// add(CHANGE_ADDRESS_SHEET_NAME, (String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.reattach_address").localize(), new WorkflowLockedComponentAccess(attachAddressSheet, itemModel), attachAddressSheet.getSaveCancelSection().getCancelButton()); - - BasicPageForm deleteAddressSheet = new ContactDeleteAddressForm(itemModel, this); - add(DELETE_ADDRESS_SHEET_NAME, (String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.delete_address").localize(), new WorkflowLockedComponentAccess(deleteAddressSheet, itemModel), deleteAddressSheet.getSaveCancelSection().getCancelButton()); - - /* Set the displayComponent for this step */ - setDisplayComponent(getAddressPropertySheet(itemModel)); -// } - - } - - public static Component getAddressPropertySheet(ItemSelectionModel itemModel) { - - DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(itemModel); - - sheet.add((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.address").localize(), "address." + Address.ADDRESS); - if (!Contact.getConfig().getHideAddressPostalCode()) { - sheet.add((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.postal_code").localize(), "address." + Address.POSTAL_CODE); - } - sheet.add((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.city").localize(), "address." + Address.CITY); - if (!Contact.getConfig().getHideAddressState()) { - sheet.add((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.state").localize(), "address." + Address.STATE); - } - - if (!Contact.getConfig().getHideAddressCountry()) { - sheet.add((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.iso_country_code").localize(), - "address." + Address.ISO_COUNTRY_CODE, - new DomainObjectPropertySheet.AttributeFormatter() { - - public String format(DomainObject item, - String attribute, - PageState state) { - Address Address = ((Contact) item).getAddress(); - if (Address != null && Address.getIsoCountryCode() != null) { - return Address.getCountryNameFromIsoCode(Address.getIsoCountryCode()); - } else { - return (String) BasetypesGlobalizationUtil.globalize("cms.ui.unknown").localize(); - } - } - }); - } - - return sheet; - - } - - public static Component getEmptyBaseAddressPropertySheet(ItemSelectionModel itemModel) { - return new Label(((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.emptyAddress").localize())); - } -} diff --git a/ccm-cms/src/com/arsdigita/cms/basetypes/ui/ContactPersonPropertiesStep.java b/ccm-cms/src/com/arsdigita/cms/basetypes/ui/ContactPersonPropertiesStep.java deleted file mode 100644 index 05bb5d386..000000000 --- a/ccm-cms/src/com/arsdigita/cms/basetypes/ui/ContactPersonPropertiesStep.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * ContactPersonPropertiesStep.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.basetypes.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.basetypes.Person; -import com.arsdigita.cms.basetypes.util.BasetypesGlobalizationUtil; - -/** - * - * @author quasi - */ -public class ContactPersonPropertiesStep 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 ContactPersonPropertiesStep - */ - public ContactPersonPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent) { - this(itemModel, parent, ""); - } - - public ContactPersonPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent, String prefix) { - super(itemModel, parent, prefix); - -//XXX -// if(false/*EMPTY*/) { - - BasicPageForm addPersonSheet = new ContactAttachPersonPropertyForm(itemModel, this); - add(ADD_PERSON_SHEET_NAME, (String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.attach_person").localize(), new WorkflowLockedComponentAccess(addPersonSheet, itemModel), addPersonSheet.getSaveCancelSection().getCancelButton()); - - /* Set the displayComponent for this step */ -// setDisplayComponent(getEmptyPersonPropertySheet(itemModel)); - -// } else { - - BasicPageForm editPersonSheet = new ContactEditPersonPropertyForm(itemModel, this); - add(EDIT_PERSON_SHEET_NAME, (String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.edit_person").localize(), new WorkflowLockedComponentAccess(editPersonSheet, itemModel), editPersonSheet.getSaveCancelSection().getCancelButton()); - -// BasicPageForm changePersonSheet = new ContactEditPersonPropertyForm(itemModel, this); -// add(CHANGE_PERSON_SHEET_NAME, (String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.reattach_person").localize(), new WorkflowLockedComponentAccess(changePersonSheet, itemModel), changePersonSheet.getSaveCancelSection().getCancelButton()); - - BasicPageForm deletePersonSheet = new ContactDeletePersonForm(itemModel, this); - add(DELETE_PERSON_SHEET_NAME, (String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.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)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.person.surname").localize(), "person." + Person.SURNAME); - sheet.add((String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.person.givenname").localize(), "person." + Person.GIVENNAME); - sheet.add((String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.person.titlepre").localize(), "person." + Person.TITLEPRE); - sheet.add((String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.person.titlepost").localize(), "person." + Person.TITLEPOST); - - return sheet; - } - - public static Component getEmptyPersonPropertySheet(ItemSelectionModel itemModel) { - return new Label(((String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.emptyPerson").localize())); - } -} diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/BasetypesResources.properties b/ccm-cms/src/com/arsdigita/cms/contenttypes/BasetypesResources.properties new file mode 100644 index 000000000..fffa51c3e --- /dev/null +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/BasetypesResources.properties @@ -0,0 +1,64 @@ +cms.contenttypes.ui.address.address=Address +cms.contenttypes.ui.address.postal_code=Postal Code +cms.contenttypes.ui.address.city=City +cms.contenttypes.ui.address.state=State +cms.contenttypes.ui.address.iso_country_code=Country +cms.contenttypes.ui.address.error_iso_country=You must select a country + +cms.contenttypes.ui.person.surname=Surname +cms.contenttypes.ui.person.givenname=Given name +cms.contenttypes.ui.person.titlepre=Title +cms.contenttypes.ui.person.titlepost=Name appendix + +address.authoring.basic_properties.title=Basic Properties + +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/src/com/arsdigita/cms/contenttypes/BasetypesResources_de.properties b/ccm-cms/src/com/arsdigita/cms/contenttypes/BasetypesResources_de.properties new file mode 100644 index 000000000..c2eeea359 --- /dev/null +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/BasetypesResources_de.properties @@ -0,0 +1,66 @@ +cms.contenttypes.ui.address.address=Anschrift +cms.contenttypes.ui.address.postal_code=Postleitzahl +cms.contenttypes.ui.address.city=Stadt +cms.contenttypes.ui.address.state=Bundesland +cms.contenttypes.ui.address.iso_country_code=Land +cms.contenttypes.ui.address.error_iso_country=Bitte w\u00E4hlen Sie ein Land aus + +cms.contenttypes.ui.person.surname=Nachname +cms.contenttypes.ui.person.givenname=Vorname +cms.contenttypes.ui.person.titlepre=Titel +cms.contenttypes.ui.person.titlepost=Namesanhang + +address.authoring.basic_properties.title=Eigenschaften von Adresse + +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/src/com/arsdigita/cms/basetypes/Address.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericAddress.java similarity index 89% rename from ccm-cms/src/com/arsdigita/cms/basetypes/Address.java rename to ccm-cms/src/com/arsdigita/cms/contenttypes/GenericAddress.java index 344a0d284..5f721e19c 100644 --- a/ccm-cms/src/com/arsdigita/cms/basetypes/Address.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericAddress.java @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ -package com.arsdigita.cms.basetypes; +package com.arsdigita.cms.contenttypes; import com.arsdigita.globalization.LocaleNegotiator; @@ -42,7 +42,7 @@ import java.util.TreeMap; * * @author Sören Bernstein **/ -public class Address extends ContentPage { +public class GenericAddress extends ContentPage { /** PDL property name for address */ public static final String ADDRESS = "address"; @@ -57,21 +57,21 @@ public class Address extends ContentPage { /** Data object type for this domain object */ public static final String BASE_DATA_OBJECT_TYPE - = "com.arsdigita.cms.basetypes.Address"; + = "com.arsdigita.cms.contenttypes.GenericAddress"; - private static AddressConfig s_config = new AddressConfig(); + private static GenericAddressConfig s_config = new GenericAddressConfig(); static { s_config.load(); } - public static AddressConfig getConfig() + public static GenericAddressConfig getConfig() { return s_config; } /** - * Default constructor. This creates a new (empty) Address. + * Default constructor. This creates a new (empty) GenericAddress. **/ - public Address() { + public GenericAddress() { this(BASE_DATA_OBJECT_TYPE); } @@ -79,12 +79,12 @@ public class Address extends ContentPage { * Constructor. The contained DataObject is retrieved * from the persistent storage mechanism with an OID * specified by id and - * Address.BASE_DATA_OBJECT_TYPE. + * GenericAddress.BASE_DATA_OBJECT_TYPE. * * @param id The id for the retrieved * DataObject. **/ - public Address(BigDecimal id) throws DataObjectNotFoundException { + public GenericAddress(BigDecimal id) throws DataObjectNotFoundException { this(new OID(BASE_DATA_OBJECT_TYPE, id)); } @@ -96,7 +96,7 @@ public class Address extends ContentPage { * @param id The OID for the retrieved * DataObject. **/ - public Address(OID id) throws DataObjectNotFoundException { + public GenericAddress(OID id) throws DataObjectNotFoundException { super(id); } @@ -107,7 +107,7 @@ public class Address extends ContentPage { * @param obj The DataObject with which to create or * load a content item */ - public Address(DataObject obj) { + public GenericAddress(DataObject obj) { super(obj); } @@ -118,7 +118,7 @@ public class Address extends ContentPage { * @param type The String data object type of the * item to create */ - public Address(String type) { + public GenericAddress(String type) { super(type); } diff --git a/ccm-cms/src/com/arsdigita/cms/basetypes/AddressConfig.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericAddressConfig.java similarity index 84% rename from ccm-cms/src/com/arsdigita/cms/basetypes/AddressConfig.java rename to ccm-cms/src/com/arsdigita/cms/contenttypes/GenericAddressConfig.java index bcabe197a..06a7a6559 100644 --- a/ccm-cms/src/com/arsdigita/cms/basetypes/AddressConfig.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericAddressConfig.java @@ -16,25 +16,25 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ -package com.arsdigita.cms.basetypes; +package com.arsdigita.cms.contenttypes; import com.arsdigita.runtime.AbstractConfig; import com.arsdigita.util.parameter.Parameter; import com.arsdigita.util.parameter.BooleanParameter; -public class AddressConfig extends AbstractConfig { +public class GenericAddressConfig extends AbstractConfig { private final Parameter m_hideCountryCodeSelection; private final Parameter m_hidePostalCode; - public AddressConfig() { + public GenericAddressConfig() { m_hideCountryCodeSelection = new BooleanParameter( - "com.arsdigita.cms.basetypes.ddress.hide_country_code_selection", + "com.arsdigita.cms.contenttypes.generic_address.hide_country_code_selection", Parameter.REQUIRED, new Boolean(false)); m_hidePostalCode = new BooleanParameter( - "com.arsdigita.cms.basetypes.address.hide_postal_code", + "com.arsdigita.cms.contenttypes.generic_address.hide_postal_code", Parameter.REQUIRED, new Boolean(false)); diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericAddressConfig_parameter.properties b/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericAddressConfig_parameter.properties new file mode 100644 index 000000000..0f7455125 --- /dev/null +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericAddressConfig_parameter.properties @@ -0,0 +1,9 @@ +com.arsdigita.cms.contenttypes.generic_address.hide_country_code_selection.title=Hide ISO Country Code +com.arsdigita.cms.contenttypes.generic_address.hide_country_code_selection.purpose=Hide the ISO country code selection box +com.arsdigita.cms.contenttypes.generic_address.hide_country_code_selection.example=false +com.arsdigita.cms.contenttypes.generic_address.hide_country_code_selection.format=[boolean] + +com.arsdigita.cms.contenttypes.generic_address.hide_postal_code.title=Hide Postal Code +com.arsdigita.cms.contenttypes.generic_address.hide_postal_code.purpose=Hide the the postal code entry field +com.arsdigita.cms.contenttypes.generic_address.hide_postal_code.example=false +com.arsdigita.cms.contenttypes.generic_address.hide_postal_code.format=[boolean] diff --git a/ccm-cms/src/com/arsdigita/cms/basetypes/Article.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericArticle.java old mode 100755 new mode 100644 similarity index 83% rename from ccm-cms/src/com/arsdigita/cms/basetypes/Article.java rename to ccm-cms/src/com/arsdigita/cms/contenttypes/GenericArticle.java index 3357417a0..78ec304a8 --- a/ccm-cms/src/com/arsdigita/cms/basetypes/Article.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericArticle.java @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ -package com.arsdigita.cms.basetypes; +package com.arsdigita.cms.contenttypes; import com.arsdigita.cms.ImageAsset; import com.arsdigita.cms.ImageAssetCollection; @@ -38,22 +38,22 @@ import java.math.BigDecimal; * @version $Revision: #28 $ $Date: 2004/08/17 $ * @version $Id: Article.java 2070 2010-01-28 08:47:41Z pboy $ */ -public class Article extends TextPage { +public class GenericArticle extends TextPage { public static final String BASE_DATA_OBJECT_TYPE = - "com.arsdigita.cms.basetypes.Article"; + "com.arsdigita.cms.contenttypes.GenericArticle"; protected static final String IMAGES = "imageAssets"; private static final String IMAGE_CAPTIONS = "imageCaptions"; private static org.apache.log4j.Logger s_log = - org.apache.log4j.Logger.getLogger(Article.class); + org.apache.log4j.Logger.getLogger(GenericArticle.class); /** * Default constructor. This creates a new article. **/ - public Article() { + public GenericArticle() { super(BASE_DATA_OBJECT_TYPE); } @@ -65,11 +65,11 @@ public class Article extends TextPage { * @param oid The OID for the retrieved * DataObject. **/ - public Article(OID oid) throws DataObjectNotFoundException { + public GenericArticle(OID oid) throws DataObjectNotFoundException { super(oid); } - public Article(String type) { + public GenericArticle(String type) { super(type); } @@ -82,11 +82,11 @@ public class Article extends TextPage { * @param id The id for the retrieved * DataObject. **/ - public Article(BigDecimal id) throws DataObjectNotFoundException { + public GenericArticle(BigDecimal id) throws DataObjectNotFoundException { this(new OID(BASE_DATA_OBJECT_TYPE, id)); } - public Article(DataObject obj) { + public GenericArticle(DataObject obj) { super(obj); } @@ -109,14 +109,14 @@ public class Article extends TextPage { */ public boolean addImage(ImageAsset image, String caption) { ImageAssetCollection col = getImages(); - col.addEqualsFilter(ArticleImageAssociation.IMAGE_ID,image.getID()); + col.addEqualsFilter(GenericArticleImageAssociation.IMAGE_ID,image.getID()); boolean toReturn = false; - ArticleImageAssociation assn = null; + GenericArticleImageAssociation assn = null; if (col.next()) { - assn = (ArticleImageAssociation)(col.getDomainObject()); + assn = (GenericArticleImageAssociation)(col.getDomainObject()); col.close(); } else { - assn = new ArticleImageAssociation(); + assn = new GenericArticleImageAssociation(); String name = this.getName(); Assert.exists(name, String.class); String imgName = image.getName(); @@ -136,8 +136,8 @@ public class Article extends TextPage { * Get the caption of the image * @deprecated Do not use this method, it will always return the * first available caption regardless of what image is in use. Use - * ArticleImageAssnCollection.getCaption() or - * ArticleImageAssociation.getCaption(). + * GenericArticleImageAssnCollection.getCaption() or + * GenericArticleImageAssociation.getCaption(). * @return the caption, or null if the image is not associated to this * article */ @@ -156,7 +156,7 @@ public class Article extends TextPage { * @return true is the image is removed, false otherwise. */ public boolean removeImage(ImageAsset image) { - ArticleImageAssociation assn = ArticleImageAssociation + GenericArticleImageAssociation assn = GenericArticleImageAssociation .retrieveAssociation(getID(), image.getID()); if (assn != null) { assn.delete(); @@ -171,7 +171,7 @@ public class Article extends TextPage { */ public ImageAssetCollection getImages() { DataAssociationCursor dac = ((DataAssociation) get(IMAGE_CAPTIONS)).cursor(); - ImageAssetCollection images = new ArticleImageAssnCollection(dac); + ImageAssetCollection images = new GenericArticleImageAssnCollection(dac); return images; } @@ -190,7 +190,7 @@ public class Article extends TextPage { super.propagateMaster(master); ImageAssetCollection collection = getImages(); while (collection.next()) { - ArticleImageAssociation assn = (ArticleImageAssociation)(collection.getDomainObject()); + GenericArticleImageAssociation assn = (GenericArticleImageAssociation)(collection.getDomainObject()); assn.setMaster(master); assn.save(); } diff --git a/ccm-cms/src/com/arsdigita/cms/basetypes/ArticleImageAssnCollection.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericArticleImageAssnCollection.java old mode 100755 new mode 100644 similarity index 80% rename from ccm-cms/src/com/arsdigita/cms/basetypes/ArticleImageAssnCollection.java rename to ccm-cms/src/com/arsdigita/cms/contenttypes/GenericArticleImageAssnCollection.java index 849ece4f2..31820c65d --- a/ccm-cms/src/com/arsdigita/cms/basetypes/ArticleImageAssnCollection.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericArticleImageAssnCollection.java @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ -package com.arsdigita.cms.basetypes; +package com.arsdigita.cms.contenttypes; import com.arsdigita.cms.ImageAsset; import com.arsdigita.cms.ImageAssetCollection; @@ -37,26 +37,26 @@ import com.arsdigita.persistence.Filter; * * * @author Hugh Brock . - * @version $Id: ArticleImageAssnCollection.java 287 2005-02-22 00:29:02Z sskracic $ + * @version $Id: GenericArticleImageAssnCollection.java 287 2005-02-22 00:29:02Z sskracic $ */ -public class ArticleImageAssnCollection extends ImageAssetCollection { +public class GenericArticleImageAssnCollection extends ImageAssetCollection { /** * Constructor. Should only be called from Article.getImages() * **/ - protected ArticleImageAssnCollection(DataCollection dataCollection) { + protected GenericArticleImageAssnCollection(DataCollection dataCollection) { super(dataCollection); } /** * Returns a DomainObject (the - * ArticleImageAssociation for the current position in the + * GenericArticleImageAssociation for the current position in the * collection. * **/ public DomainObject getDomainObject() { - return new ArticleImageAssociation + return new GenericArticleImageAssociation (m_dataCollection.getDataObject()); } @@ -66,11 +66,11 @@ public class ArticleImageAssnCollection extends ImageAssetCollection { * **/ public ImageAsset getImage() { - return ((ArticleImageAssociation)getDomainObject()).getImage(); + return ((GenericArticleImageAssociation)getDomainObject()).getImage(); } public String getCaption() { - return ((ArticleImageAssociation)getDomainObject()).getCaption(); + return ((GenericArticleImageAssociation)getDomainObject()).getCaption(); } // Exposed methods diff --git a/ccm-cms/src/com/arsdigita/cms/basetypes/ArticleImageAssociation.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericArticleImageAssociation.java old mode 100755 new mode 100644 similarity index 87% rename from ccm-cms/src/com/arsdigita/cms/basetypes/ArticleImageAssociation.java rename to ccm-cms/src/com/arsdigita/cms/contenttypes/GenericArticleImageAssociation.java index be2a84850..2104fa5f1 --- a/ccm-cms/src/com/arsdigita/cms/basetypes/ArticleImageAssociation.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericArticleImageAssociation.java @@ -16,14 +16,13 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ -package com.arsdigita.cms.basetypes; +package com.arsdigita.cms.contenttypes; import com.arsdigita.cms.ContentItem; import com.arsdigita.cms.CustomCopy; import com.arsdigita.cms.ImageAsset; import com.arsdigita.cms.ItemCollection; import com.arsdigita.cms.ItemCopier; -import com.arsdigita.cms.basetypes.Article; import com.arsdigita.domain.DataObjectNotFoundException; import com.arsdigita.domain.DomainObjectFactory; import com.arsdigita.persistence.DataCollection; @@ -37,17 +36,17 @@ import com.arsdigita.versioning.VersionedACSObject; import java.math.BigDecimal; /** - * This class associates an Article and an Image with a particular + * This class associates an GenericArticle and an Image with a particular * caption. * * @author Jack Chung (flattop@arsdigita.com) * @version $Revision: #17 $ $Date: 2004/08/17 $ - * @version $Id: ArticleImageAssociation.java 287 2005-02-22 00:29:02Z sskracic $ + * @version $Id: GenericArticleImageAssociation.java 287 2005-02-22 00:29:02Z sskracic $ */ -public class ArticleImageAssociation extends ContentItem { +public class GenericArticleImageAssociation extends ContentItem { public static final String BASE_DATA_OBJECT_TYPE = - "com.arsdigita.cms.ArticleImageAssociation"; + "com.arsdigita.cms.GenericArticleImageAssociation"; protected static final String ARTICLE = "captionArticle"; protected static final String IMAGE = "imageAsset"; @@ -59,7 +58,7 @@ public class ArticleImageAssociation extends ContentItem { /** * Default constructor. **/ - public ArticleImageAssociation() { + public GenericArticleImageAssociation() { super(BASE_DATA_OBJECT_TYPE); } @@ -71,15 +70,15 @@ public class ArticleImageAssociation extends ContentItem { * @param oid The OID for the retrieved * DataObject. **/ - public ArticleImageAssociation(OID oid) throws DataObjectNotFoundException { + public GenericArticleImageAssociation(OID oid) throws DataObjectNotFoundException { super(oid); } - public ArticleImageAssociation(DataObject obj) { + public GenericArticleImageAssociation(DataObject obj) { super(obj); } - public ArticleImageAssociation(String type) { + public GenericArticleImageAssociation(String type) { super(type); } @@ -87,7 +86,7 @@ public class ArticleImageAssociation extends ContentItem { * This returns the association object that is specified by * the passed in IDs or it returns null if no such association exists */ - public static ArticleImageAssociation retrieveAssociation + public static GenericArticleImageAssociation retrieveAssociation (BigDecimal articleID, BigDecimal imageID) { DataCollection collection = SessionManager.getSession().retrieve (BASE_DATA_OBJECT_TYPE); @@ -96,8 +95,8 @@ public class ArticleImageAssociation extends ContentItem { // no deleted associations, please collection.addEqualsFilter(VersionedACSObject.IS_DELETED, new BigDecimal(0)); if (collection.next()) { - ArticleImageAssociation association = - new ArticleImageAssociation(collection.getDataObject()); + GenericArticleImageAssociation association = + new GenericArticleImageAssociation(collection.getDataObject()); collection.close(); return association; } @@ -146,8 +145,9 @@ public class ArticleImageAssociation extends ContentItem { if (!returnValue) { if (!image.getVersion().equals(ContentItem.DRAFT)) { ContentItem item = image.getWorkingVersion(); - if (item != null) + if (item != null) { returnValue = imageHasDirectAssociation(item.getID()); + } } } if (!returnValue) { @@ -162,8 +162,9 @@ public class ArticleImageAssociation extends ContentItem { if (!returnValue) { if (!image.getVersion().equals(ContentItem.LIVE)) { ContentItem item = image.getLiveVersion(); - if (item != null) + if (item != null) { returnValue = imageHasDirectAssociation(item.getID()); + } } } @@ -183,17 +184,17 @@ public class ArticleImageAssociation extends ContentItem { return (BigDecimal) get(ARTICLE_ID); } - public Article getArticle() { + public GenericArticle getArticle() { DataCollection col = SessionManager.getSession().retrieve(ARTICLE); if (col.next()) { - Article art = new Article(col.getDataObject()); + GenericArticle art = new GenericArticle(col.getDataObject()); col.close(); return art; } return null; } - public void setArticle(Article article) { + public void setArticle(GenericArticle article) { setAssociation(ARTICLE, article); } @@ -229,6 +230,7 @@ public class ArticleImageAssociation extends ContentItem { * that regular metadata-driven methods should be used * to copy the property. */ + @Override public boolean copyProperty(final CustomCopy source, final Property property, final ItemCopier copier) { @@ -240,7 +242,7 @@ public class ArticleImageAssociation extends ContentItem { if (copier.getCopyType() == ItemCopier.VERSION_COPY && IMAGE.equals(attribute)) { - ImageAsset image = ((ArticleImageAssociation)source).getImage(); + ImageAsset image = ((GenericArticleImageAssociation)source).getImage(); if (image != null) { ImageAsset liveImage = (ImageAsset) image.getLiveVersion(); if (liveImage == null) { diff --git a/ccm-cms/src/com/arsdigita/cms/basetypes/Contact.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericContact.java similarity index 71% rename from ccm-cms/src/com/arsdigita/cms/basetypes/Contact.java rename to ccm-cms/src/com/arsdigita/cms/contenttypes/GenericContact.java index 6610bcd6b..a86496900 100644 --- a/ccm-cms/src/com/arsdigita/cms/basetypes/Contact.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericContact.java @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ -package com.arsdigita.cms.basetypes; +package com.arsdigita.cms.contenttypes; import com.arsdigita.persistence.OID; import com.arsdigita.persistence.DataObject; @@ -33,7 +33,7 @@ import java.math.BigDecimal; * This content type represents an basic contact * */ -public class Contact extends ContentPage { +public class GenericContact extends ContentPage { /** PDL property names */ public static final String PERSON = "person"; @@ -41,34 +41,34 @@ public class Contact extends ContentPage { public static final String CONTACT_ENTRIES = "contactentries"; // Config - private static final ContactConfig s_config = new ContactConfig(); + private static final GenericContactConfig s_config = new GenericContactConfig(); static { s_config.load(); } /** Data object type for tihs domain object */ public static final String BASE_DATA_OBJECT_TYPE - = "com.arsdigita.cms.basetypes.Contact"; + = "com.arsdigita.cms.contenttypes.GenericContact"; - public Contact() { + public GenericContact() { super(BASE_DATA_OBJECT_TYPE); } - public Contact(BigDecimal id) + public GenericContact(BigDecimal id) throws DataObjectNotFoundException { this(new OID(BASE_DATA_OBJECT_TYPE, id)); } - public Contact(OID id) + public GenericContact(OID id) throws DataObjectNotFoundException { super(id); } - public Contact(DataObject obj) { + public GenericContact(DataObject obj) { super(obj); } - public Contact(String type) { + public GenericContact(String type) { super(type); } @@ -82,7 +82,7 @@ public class Contact extends ContentPage { /** * Retrieves the current configuration */ - public static final ContactConfig getConfig() { + public static final GenericContactConfig getConfig() { return s_config; } @@ -91,12 +91,12 @@ public class Contact extends ContentPage { // accessors // Get the person for this contact - public Person getPerson() { - return (Person) DomainObjectFactory.newInstance((DataObject)get(PERSON)); + public GenericPerson getPerson() { + return (GenericPerson) DomainObjectFactory.newInstance((DataObject)get(PERSON)); } // Set the person for this contact - public void setPerson(Person person) { + public void setPerson(GenericPerson person) { set(PERSON, person); } @@ -106,12 +106,12 @@ public class Contact extends ContentPage { } // Get the address for this contact - public Address getAddress() { - return (Address)DomainObjectFactory.newInstance((DataObject)get(ADDRESS)); + public GenericAddress getAddress() { + return (GenericAddress)DomainObjectFactory.newInstance((DataObject)get(ADDRESS)); } // Set the address for this contact - public void setAddress(Address address) { + public void setAddress(GenericAddress address) { set(ADDRESS, address); } @@ -121,19 +121,19 @@ public class Contact extends ContentPage { } // Get all contact entries for this contact, p. ex. phone number, type of contact etc. - public ContactEntryCollection getContactEntries() { - return new ContactEntryCollection ((DataCollection) get(CONTACT_ENTRIES)); + public GenericContactEntryCollection getContactEntries() { + return new GenericContactEntryCollection ((DataCollection) get(CONTACT_ENTRIES)); } // Add a contact entry for this contact - public void addContactEntry(ContactEntry contactEntry) { - Assert.exists(contactEntry, ContactEntry.class); + public void addContactEntry(GenericContactEntry contactEntry) { + Assert.exists(contactEntry, GenericContactEntry.class); add(CONTACT_ENTRIES, contactEntry); } // Remove a contect entry for this contact - public void removeContactEntry(ContactEntry contactEntry) { - Assert.exists(contactEntry, ContactEntry.class); + public void removeContactEntry(GenericContactEntry contactEntry) { + Assert.exists(contactEntry, GenericContactEntry.class); remove(CONTACT_ENTRIES, contactEntry); } diff --git a/ccm-cms/src/com/arsdigita/cms/basetypes/ContactConfig.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericContactConfig.java similarity index 82% rename from ccm-cms/src/com/arsdigita/cms/basetypes/ContactConfig.java rename to ccm-cms/src/com/arsdigita/cms/contenttypes/GenericContactConfig.java index c99c8a22c..e838baed1 100644 --- a/ccm-cms/src/com/arsdigita/cms/basetypes/ContactConfig.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericContactConfig.java @@ -1,5 +1,5 @@ -package com.arsdigita.cms.basetypes; +package com.arsdigita.cms.contenttypes; import com.arsdigita.runtime.AbstractConfig; import com.arsdigita.util.parameter.Parameter; @@ -9,13 +9,13 @@ import java.util.StringTokenizer; import org.apache.log4j.Logger; /** - * Stores the configuration record for the contact. + * Stores the configuration record for the generic contact. * * @author Sören Bernstein (quasimodo) quasi@zes.uni-bremen.de */ -public final class ContactConfig extends AbstractConfig { +public final class GenericContactConfig extends AbstractConfig { - private static Logger s_log = Logger.getLogger(ContactConfig.class); + private static Logger s_log = Logger.getLogger(GenericContactConfig.class); private final Parameter m_hidePerson; private final Parameter m_hideAddress; @@ -27,13 +27,13 @@ public final class ContactConfig extends AbstractConfig { /** * Public Constructor */ - public ContactConfig() { + public GenericContactConfig() { /** * If set to true disables the possibility to attach a person ct */ m_hidePerson = new BooleanParameter - ("com.arsdigita.cms.basetypes.contact.hide_person", + ("com.arsdigita.cms.contenttypes.generic_contact.hide_person", Parameter.REQUIRED, new Boolean(false)); @@ -41,7 +41,7 @@ public final class ContactConfig extends AbstractConfig { * If set to true disables the possibility to attach a baseAddress ct */ m_hideAddress = new BooleanParameter - ("com.arsdigita.cms.basetypes.contact.hide_address", + ("com.arsdigita.cms.contenttypes.generic_contact.hide_address", Parameter.REQUIRED, new Boolean(false)); @@ -49,7 +49,7 @@ public final class ContactConfig extends AbstractConfig { * If set to true hides the postal code entry field for the attached address ct */ m_hideAddressPostalCode = new BooleanParameter - ("com.arsdigita.cms.basetypes.contact.address.hide_postal_code", + ("com.arsdigita.cms.contenttypes.generic_contact.address.hide_postal_code", Parameter.REQUIRED, new Boolean(false)); @@ -57,7 +57,7 @@ public final class ContactConfig extends AbstractConfig { * If set to true hides the state entry field for the attached address ct */ m_hideAddressState = new BooleanParameter - ("com.arsdigita.cms.basetypes.contact.address.hide_state", + ("com.arsdigita.cms.contenttypes.generic_contact.address.hide_state", Parameter.REQUIRED, new Boolean(false)); @@ -65,14 +65,14 @@ public final class ContactConfig extends AbstractConfig { * If set to true hides the country selection for the attaches address ct */ m_hideAddressCountry = new BooleanParameter - ("com.arsdigita.cms.basetypes.contact.address.hide_country", + ("com.arsdigita.cms.contenttypes.generic_contact.address.hide_country", Parameter.REQUIRED, new Boolean(false)); /** */ m_contactEntryKeys = new StringParameter - ("com.arsdigita.cms.basetypes.contact.contact_entry_keys", + ("com.arsdigita.cms.contenttypes.generic_contact.contact_entry_keys", Parameter.REQUIRED, "contact_type,office_hours,phone_office,phone_private,phone_mobile,email,fax,im,www"); @@ -117,7 +117,7 @@ public final class ContactConfig extends AbstractConfig { } /** - * Returns the contactEntryKeys as StringTokenizer. + * Returns the generic_contactEntryKeys as StringTokenizer. */ public final StringTokenizer getContactEntryKeys() { return new StringTokenizer((((String) get(m_contactEntryKeys)).replace(" ","")), ",", false); diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericContactConfig_parameter.properties b/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericContactConfig_parameter.properties new file mode 100644 index 000000000..e0b2a2bd3 --- /dev/null +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericContactConfig_parameter.properties @@ -0,0 +1,29 @@ +com.arsdigita.cms.contenttypes.generic_contact.hide_person.title=Hide person attachment +com.arsdigita.cms.contenttypes.generic_contact.hide_person.purpose=Hide the part to attach a person CT +com.arsdigita.cms.contenttypes.generic_contact.hide_person.example=false +com.arsdigita.cms.contenttypes.generic_contact.hide_person.format=[boolean] + +com.arsdigita.cms.contenttypes.generic_contact.hide_address.title=Hide address attachment +com.arsdigita.cms.contenttypes.generic_contact.hide_address.purpose=Hide the part to attach a baseAddress CT +com.arsdigita.cms.contenttypes.generic_contact.hide_address.example=false +com.arsdigita.cms.contenttypes.generic_contact.hide_address.format=[boolean] + +com.arsdigita.cms.contenttypes.generic_contact.address.hide_postal_code.title=Hide postal code for attached adress +com.arsdigita.cms.contenttypes.generic_contact.address.hide_postal_code.purpose=Hide the postal code entry field for the attached baseAddress +com.arsdigita.cms.contenttypes.generic_contact.address.hide_postal_code.example=false +com.arsdigita.cms.contenttypes.generic_contact.address.hide_postal_code.format=[boolean] + +com.arsdigita.cms.contenttypes.generic_contact.address.hide_state.title=Hide state for attached adress +com.arsdigita.cms.contenttypes.generic_contact.address.hide_state.purpose=Hide the state entry field for the attached baseAddress +com.arsdigita.cms.contenttypes.generic_contact.address.hide_state.example=false +com.arsdigita.cms.contenttypes.generic_contact.address.hide_state.format=[boolean] + +com.arsdigita.cms.contenttypes.generic_contact.address.hide_country.title=Hide country for attached address +com.arsdigita.cms.contenttypes.generic_contact.address.hide_country.purpose=Hide the country selection box for the attached baseAddress +com.arsdigita.cms.contenttypes.generic_contact.address.hide_country.example=false +com.arsdigita.cms.contenttypes.generic_contact.address.hide_country.format=[boolean] + +com.arsdigita.cms.contenttypes.generic_contact.contact_entry_keys.title=Select available contact entry types +com.arsdigita.cms.contenttypes.generic_contact.contact_entry_keys.purpose=Select available contact entry types and define display order +com.arsdigita.cms.contenttypes.generic_contact.contact_entry_keys.example=contact_type,office_hours,phone_office,phone_private,phone_mobile,email,fax,im,www +com.arsdigita.cms.contenttypes.generic_contact.contact_entry_keys.format=[string] diff --git a/ccm-cms/src/com/arsdigita/cms/basetypes/ContactEntry.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericContactEntry.java similarity index 78% rename from ccm-cms/src/com/arsdigita/cms/basetypes/ContactEntry.java rename to ccm-cms/src/com/arsdigita/cms/contenttypes/GenericContactEntry.java index be83a843a..13fe089cb 100644 --- a/ccm-cms/src/com/arsdigita/cms/basetypes/ContactEntry.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericContactEntry.java @@ -18,7 +18,7 @@ * office phone: 1234 / 123456 */ -package com.arsdigita.cms.basetypes; +package com.arsdigita.cms.contenttypes; import com.arsdigita.cms.ContentItem; import com.arsdigita.domain.DataObjectNotFoundException; @@ -31,12 +31,12 @@ import org.apache.log4j.Logger; * * @author quasi */ -public class ContactEntry extends ContentItem { +public class GenericContactEntry extends ContentItem { - public static final String BASE_DATA_OBJECT_TYPE = "com.arsdigita.cms.basetypes.ContactEntry"; - private static final String BASE_DATA_OBJECT_PACKAGE = "com.arsdigita.cms.basetypes"; + public static final String BASE_DATA_OBJECT_TYPE = "com.arsdigita.cms.contenttypes.ContactEntry"; + private static final String BASE_DATA_OBJECT_PACKAGE = "com.arsdigita.cms.contenttypes"; - private static final Logger s_log = Logger.getLogger(ContactEntry.class); + private static final Logger s_log = Logger.getLogger(GenericContactEntry.class); /** PDL property names */ public static final String KEY = "key"; @@ -45,21 +45,21 @@ public class ContactEntry extends ContentItem { /** - * Creates a new instance of ContactEntry + * Creates a new instance of GenericContactEntry */ - public ContactEntry() { + public GenericContactEntry() { this(BASE_DATA_OBJECT_TYPE); } - public ContactEntry(String typeName) { + public GenericContactEntry(String typeName) { super(typeName); } - public ContactEntry(OID oid) { + public GenericContactEntry(OID oid) { super(oid); } - public ContactEntry(DataObject object) { + public GenericContactEntry(DataObject object) { super(object); } @@ -67,11 +67,11 @@ public class ContactEntry extends ContentItem { * Constructor. Retrieves an object instance with the given id. * @param id the id of the object to retrieve */ - public ContactEntry(BigDecimal id) throws DataObjectNotFoundException { + public GenericContactEntry(BigDecimal id) throws DataObjectNotFoundException { this(new OID(BASE_DATA_OBJECT_TYPE, id)); } - public ContactEntry(Contact contact, String key, String value, String description) { + public GenericContactEntry(GenericContact contact, String key, String value, String description) { this(); setName(key + " for " + contact.getName() + "(" + contact.getID() + ")"); setKey(key); diff --git a/ccm-cms/src/com/arsdigita/cms/basetypes/ContactEntryCollection.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericContactEntryCollection.java similarity index 67% rename from ccm-cms/src/com/arsdigita/cms/basetypes/ContactEntryCollection.java rename to ccm-cms/src/com/arsdigita/cms/contenttypes/GenericContactEntryCollection.java index ee59c3c67..2802d4646 100644 --- a/ccm-cms/src/com/arsdigita/cms/basetypes/ContactEntryCollection.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericContactEntryCollection.java @@ -1,12 +1,14 @@ /* - * ContactEntryCollection.java + * GenericContactEntryCollection.java * * Created on 13. Mai 2009, 12:32 * * */ -package com.arsdigita.cms.basetypes; +package com.arsdigita.cms.contenttypes; +import com.arsdigita.cms.contenttypes.GenericContact; +import com.arsdigita.cms.contenttypes.GenericContactEntry; import com.arsdigita.domain.DomainCollection; import com.arsdigita.persistence.DataCollection; import java.util.Comparator; @@ -17,21 +19,21 @@ import java.util.TreeSet; * * @author quasi */ -public class ContactEntryCollection extends DomainCollection { +public class GenericContactEntryCollection extends DomainCollection { private TreeSet m_sortedCollection = new TreeSet(new ContactEntryComparator()); private Iterator m_iterator; private boolean m_firstElem; - private ContactEntry m_currentContactEntry; + private GenericContactEntry m_currentContactEntry; /** - * Creates a new instance of ContactEntryCollection + * Creates a new instance of GenericContactEntryCollection */ - public ContactEntryCollection(Contact contact) { + public GenericContactEntryCollection(GenericContact contact) { this((DataCollection) contact.getContactEntries()); } - public ContactEntryCollection(DataCollection dataCollection) { + public GenericContactEntryCollection(DataCollection dataCollection) { super(dataCollection); // Now copy all objects from m_dataCollection to the sorting TreeSet @@ -42,7 +44,7 @@ public class ContactEntryCollection extends DomainCollection { public boolean next() { boolean retVal = m_iterator.hasNext(); if (retVal) { - m_currentContactEntry = (ContactEntry) m_iterator.next(); + m_currentContactEntry = (GenericContactEntry) m_iterator.next(); m_firstElem = false; } return retVal; @@ -104,8 +106,8 @@ public class ContactEntryCollection extends DomainCollection { return (String) getContactEntry().getValue(); } - public ContactEntry getContactEntry() { -// return new ContactEntry(m_dataCollection.getDataObject()); + public GenericContactEntry getContactEntry() { +// return new GenericContactEntry(m_dataCollection.getDataObject()); return m_currentContactEntry; } @@ -114,7 +116,7 @@ public class ContactEntryCollection extends DomainCollection { m_dataCollection.rewind(); while (m_dataCollection.next()) { - m_sortedCollection.add(new ContactEntry(m_dataCollection.getDataObject())); + m_sortedCollection.add(new GenericContactEntry(m_dataCollection.getDataObject())); } m_iterator = m_sortedCollection.iterator(); @@ -125,11 +127,11 @@ public class ContactEntryCollection extends DomainCollection { public int compare(Object o1, Object o2) { int retVal = 0; - if (o1 instanceof ContactEntry && o2 instanceof ContactEntry) { - ContactEntry bc1 = (ContactEntry) o1; - ContactEntry bc2 = (ContactEntry) o2; - retVal = Contact.getConfig().getKeyIndex(bc1.getKey()) - - Contact.getConfig().getKeyIndex(bc2.getKey()); + if (o1 instanceof GenericContactEntry && o2 instanceof GenericContactEntry) { + GenericContactEntry bc1 = (GenericContactEntry) o1; + GenericContactEntry bc2 = (GenericContactEntry) o2; + retVal = GenericContact.getConfig().getKeyIndex(bc1.getKey()) + - GenericContact.getConfig().getKeyIndex(bc2.getKey()); if (retVal == 0) { retVal = -1; } diff --git a/ccm-cms/src/com/arsdigita/cms/basetypes/Person.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericPerson.java similarity index 84% rename from ccm-cms/src/com/arsdigita/cms/basetypes/Person.java rename to ccm-cms/src/com/arsdigita/cms/contenttypes/GenericPerson.java index 91d53187e..c211f5b13 100644 --- a/ccm-cms/src/com/arsdigita/cms/basetypes/Person.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericPerson.java @@ -17,7 +17,7 @@ * */ -package com.arsdigita.cms.basetypes; +package com.arsdigita.cms.contenttypes; import com.arsdigita.cms.contenttypes.*; import com.arsdigita.cms.ContentType; @@ -29,11 +29,11 @@ import com.arsdigita.util.Assert; import java.math.BigDecimal; /** - * Basic Person Contenttype for OpenCCM. + * Basic GenericPerson Contenttype for OpenCCM. * * @author Jens Pelzetter */ -public class Person extends ContentPage { +public class GenericPerson extends ContentPage { public static final String PERSON = "person"; public static final String SURNAME = "surname"; @@ -41,29 +41,29 @@ public class Person extends ContentPage { public static final String TITLEPRE = "titlepre"; public static final String TITLEPOST = "titlepost"; /** Data object type for this domain object */ - public static final String BASE_DATA_OBJECT_TYPE = "com.arsdigita.cms.basetypes.Person"; + public static final String BASE_DATA_OBJECT_TYPE = "com.arsdigita.cms.contenttypes.GenericPerson"; /** - * Default constructor. This creates a new (empty) Person. + * Default constructor. This creates a new (empty) GenericPerson. **/ - public Person() { + public GenericPerson() { this(BASE_DATA_OBJECT_TYPE); } - public Person(BigDecimal id) throws DataObjectNotFoundException { + public GenericPerson(BigDecimal id) throws DataObjectNotFoundException { this(new OID(BASE_DATA_OBJECT_TYPE, id)); } - public Person(OID id) throws DataObjectNotFoundException { + public GenericPerson(OID id) throws DataObjectNotFoundException { super(id); } - public Person(DataObject obj) { + public GenericPerson(DataObject obj) { super(obj); } - public Person(String type) { + public GenericPerson(String type) { super(type); } diff --git a/ccm-cms/src/com/arsdigita/cms/basetypes/ui/AddressPropertiesStep.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericAddressPropertiesStep.java similarity index 72% rename from ccm-cms/src/com/arsdigita/cms/basetypes/ui/AddressPropertiesStep.java rename to ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericAddressPropertiesStep.java index 64cc0f8cd..ceb889417 100644 --- a/ccm-cms/src/com/arsdigita/cms/basetypes/ui/AddressPropertiesStep.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericAddressPropertiesStep.java @@ -16,30 +16,30 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ -package com.arsdigita.cms.basetypes.ui; +package com.arsdigita.cms.contenttypes.ui; import com.arsdigita.bebop.Component; import com.arsdigita.bebop.PageState; import com.arsdigita.cms.ContentPage; import com.arsdigita.cms.ContentSection; import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.basetypes.Address; +import com.arsdigita.cms.contenttypes.GenericAddress; import com.arsdigita.domain.DomainObject; import com.arsdigita.toolbox.ui.DomainObjectPropertySheet; import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; import com.arsdigita.cms.ui.authoring.BasicPageForm; import com.arsdigita.cms.ui.authoring.SimpleEditStep; import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; -import com.arsdigita.cms.basetypes.util.BasetypesGlobalizationUtil; +import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil; import com.arsdigita.cms.util.GlobalizationUtil; import java.text.DateFormat; -public class AddressPropertiesStep extends SimpleEditStep { +public class GenericAddressPropertiesStep extends SimpleEditStep { public static final String EDIT_SHEET_NAME = "edit"; - public AddressPropertiesStep(ItemSelectionModel itemModel, + public GenericAddressPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent) { super(itemModel, parent); @@ -51,30 +51,30 @@ public class AddressPropertiesStep extends SimpleEditStep { protected void createEditSheet(ItemSelectionModel itemModel) { BasicPageForm editSheet; - editSheet = new AddressPropertyForm(itemModel, this); + editSheet = new GenericAddressPropertyForm(itemModel, this); add(EDIT_SHEET_NAME, "Edit", new WorkflowLockedComponentAccess(editSheet, itemModel), editSheet.getSaveCancelSection().getCancelButton()); } public static Component getAddressPropertySheet(ItemSelectionModel itemModel) { DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(itemModel); - sheet.add((String) GlobalizationUtil.globalize("cms.contenttypes.ui.name").localize(), Address.NAME); - sheet.add((String) GlobalizationUtil.globalize("cms.contenttypes.ui.title").localize(), Address.TITLE); - sheet.add((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.address").localize(), Address.ADDRESS); - sheet.add((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.postal_code").localize(), Address.POSTAL_CODE); - sheet.add((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.city").localize(), Address.CITY); - sheet.add((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.state").localize(), Address.STATE); + sheet.add((String) GlobalizationUtil.globalize("cms.contenttypes.ui.name").localize(), GenericAddress.NAME); + sheet.add((String) GlobalizationUtil.globalize("cms.contenttypes.ui.title").localize(), GenericAddress.TITLE); + sheet.add((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.address").localize(), GenericAddress.ADDRESS); + sheet.add((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.postal_code").localize(), GenericAddress.POSTAL_CODE); + sheet.add((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.city").localize(), GenericAddress.CITY); + sheet.add((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.state").localize(), GenericAddress.STATE); - sheet.add((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.iso_country_code").localize(), - Address.ISO_COUNTRY_CODE, + sheet.add((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.iso_country_code").localize(), + GenericAddress.ISO_COUNTRY_CODE, new DomainObjectPropertySheet.AttributeFormatter() { public String format(DomainObject item, String attribute, PageState state) { - Address address = (Address) item; + GenericAddress address = (GenericAddress) item; if (address != null && address.getIsoCountryCode() != null) { - return Address.getCountryNameFromIsoCode(address.getIsoCountryCode()); + return GenericAddress.getCountryNameFromIsoCode(address.getIsoCountryCode()); } else { return (String) GlobalizationUtil.globalize("cms.ui.unknown").localize(); } diff --git a/ccm-cms/src/com/arsdigita/cms/basetypes/ui/AddressPropertyForm.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericAddressPropertyForm.java similarity index 71% rename from ccm-cms/src/com/arsdigita/cms/basetypes/ui/AddressPropertyForm.java rename to ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericAddressPropertyForm.java index 922c30db8..812dc116c 100644 --- a/ccm-cms/src/com/arsdigita/cms/basetypes/ui/AddressPropertyForm.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericAddressPropertyForm.java @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ -package com.arsdigita.cms.basetypes.ui; +package com.arsdigita.cms.contenttypes.ui; import com.arsdigita.bebop.FormData; import com.arsdigita.bebop.FormProcessException; @@ -37,8 +37,8 @@ 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.basetypes.Address; -import com.arsdigita.cms.basetypes.util.BasetypesGlobalizationUtil; +import com.arsdigita.cms.contenttypes.GenericAddress; +import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil; import com.arsdigita.cms.ui.authoring.BasicPageForm; import java.util.Iterator; import java.util.Map; @@ -50,22 +50,22 @@ import org.apache.log4j.Logger; * @author: Jens Pelzetter * @author: Sören Bernstein */ -public class AddressPropertyForm extends BasicPageForm implements FormProcessListener, FormInitListener, FormSubmissionListener { +public class GenericAddressPropertyForm extends BasicPageForm implements FormProcessListener, FormInitListener, FormSubmissionListener { - private static final Logger s_log = Logger.getLogger(AddressPropertyForm.class); - private AddressPropertiesStep m_step; - public static final String ADDRESS = Address.ADDRESS; - public static final String POSTAL_CODE = Address.POSTAL_CODE; - public static final String CITY = Address.CITY; - public static final String STATE = Address.STATE; - public static final String ISO_COUNTRY_CODE = Address.ISO_COUNTRY_CODE; + private static final Logger s_log = Logger.getLogger(GenericAddressPropertyForm.class); + private GenericAddressPropertiesStep m_step; + public static final String ADDRESS = GenericAddress.ADDRESS; + public static final String POSTAL_CODE = GenericAddress.POSTAL_CODE; + public static final String CITY = GenericAddress.CITY; + public static final String STATE = GenericAddress.STATE; + public static final String ISO_COUNTRY_CODE = GenericAddress.ISO_COUNTRY_CODE; public static final String ID = "Address_edit"; - public AddressPropertyForm(ItemSelectionModel itemModel) { + public GenericAddressPropertyForm(ItemSelectionModel itemModel) { this(itemModel, null); } - public AddressPropertyForm(ItemSelectionModel itemModel, AddressPropertiesStep step) { + public GenericAddressPropertyForm(ItemSelectionModel itemModel, GenericAddressPropertiesStep step) { super(ID, itemModel); m_step = step; addSubmissionListener(this); @@ -75,7 +75,7 @@ public class AddressPropertyForm extends BasicPageForm implements FormProcessLis protected void addWidgets() { super.addWidgets(); - add(new Label((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.address").localize())); + add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.address").localize())); ParameterModel addressParam = new StringParameter(ADDRESS); addressParam.addParameterListener(new NotNullValidationListener()); addressParam.addParameterListener(new StringInRangeValidationListener(0, 1000)); @@ -84,32 +84,32 @@ public class AddressPropertyForm extends BasicPageForm implements FormProcessLis address.setCols(30); add(address); - add(new Label((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.postal_code").localize())); + add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.postal_code").localize())); ParameterModel postalCodeParam = new StringParameter(POSTAL_CODE); TextField postalCode = new TextField(postalCodeParam); /* XXX NumberListener ?*/ add(postalCode); - add(new Label((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.city").localize())); + add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.city").localize())); ParameterModel cityParam = new StringParameter(CITY); TextField city = new TextField(cityParam); add(city); - add(new Label((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.state").localize())); + add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.state").localize())); ParameterModel stateParam = new StringParameter(STATE); TextField state = new TextField(stateParam); add(state); - if (!Address.getConfig().getHideCountryCodeSelection()) { - add(new Label((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.iso_country_code").localize())); + if (!GenericAddress.getConfig().getHideCountryCodeSelection()) { + add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.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) BasetypesGlobalizationUtil.globalize("cms.ui.select_one").localize()))); + country.addOption(new Option("", new Label((String) ContenttypesGlobalizationUtil.globalize("cms.ui.select_one").localize()))); - Iterator countries = Address.getSortedListOfCountries(null).entrySet().iterator(); + Iterator countries = GenericAddress.getSortedListOfCountries(null).entrySet().iterator(); while (countries.hasNext()) { Map.Entry elem = (Map.Entry) countries.next(); country.addOption(new Option(elem.getValue().toString(), elem.getKey().toString())); @@ -123,7 +123,7 @@ public class AddressPropertyForm extends BasicPageForm implements FormProcessLis String isoCode = (String) data.getValue(); s_log.debug("ISO code is : " + isoCode); if (isoCode == null || isoCode.length() == 0) { - data.addError((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.error_iso_country").localize()); + data.addError((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.error_iso_country").localize()); } } }); @@ -135,13 +135,13 @@ public class AddressPropertyForm extends BasicPageForm implements FormProcessLis public void init(FormSectionEvent fse) { FormData data = fse.getFormData(); - Address address = (Address) super.initBasicWidgets(fse); + GenericAddress address = (GenericAddress) super.initBasicWidgets(fse); data.put(ADDRESS, address.getAddress()); data.put(POSTAL_CODE, address.getPostalCode()); data.put(CITY, address.getCity()); data.put(STATE, address.getState()); - if (!Address.getConfig().getHideCountryCodeSelection()) { + if (!GenericAddress.getConfig().getHideCountryCodeSelection()) { data.put(ISO_COUNTRY_CODE, address.getIsoCountryCode()); } } @@ -156,7 +156,7 @@ public class AddressPropertyForm extends BasicPageForm implements FormProcessLis public void process(FormSectionEvent fse) { FormData data = fse.getFormData(); - Address address = (Address) super.processBasicWidgets(fse); + GenericAddress address = (GenericAddress) super.processBasicWidgets(fse); if (address != null && getSaveCancelSection().getSaveButton().isSelected(fse.getPageState())) { diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactAddressPropertiesStep.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactAddressPropertiesStep.java new file mode 100644 index 000000000..5372fafe8 --- /dev/null +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactAddressPropertiesStep.java @@ -0,0 +1,110 @@ +/* + * GenericContactAddressPropertiesStep.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.GenericAddress; +import com.arsdigita.cms.contenttypes.GenericContact; +import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil; +import com.arsdigita.cms.ui.authoring.SimpleEditStep; + +/** + * + * @author quasi + */ +public class GenericContactAddressPropertiesStep 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 GenericContactAddressPropertiesStep */ + public GenericContactAddressPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent) { + this(itemModel, parent, ""); + } + + public GenericContactAddressPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent, String prefix) { + super(itemModel, parent, prefix); + +// GenericContact contact = (GenericContact)itemModel.getSelectedObject(state); + +//XXX +// if(/*contact.getAddress() == null*/ true) { + BasicPageForm attachAddressSheet = new GenericContactAttachAddressPropertyForm(itemModel, this); + add(ADD_ADDRESS_SHEET_NAME, (String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.attach_address").localize(), new WorkflowLockedComponentAccess(attachAddressSheet, itemModel), attachAddressSheet.getSaveCancelSection().getCancelButton()); + + /* Set the displayComponent for this step */ +// setDisplayComponent(getEmptyBaseAddressPropertySheet(itemModel)); + +// } else { + + // editAddress + BasicPageForm editAddressSheet = new GenericContactEditAddressPropertyForm(itemModel, this); + add(EDIT_ADDRESS_SHEET_NAME, (String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.edit_address").localize(), new WorkflowLockedComponentAccess(editAddressSheet, itemModel), editAddressSheet.getSaveCancelSection().getCancelButton()); + +// BasicPageForm attachAddressSheet = new GenericContactAttachAddressPropertyForm(itemModel, this); +// add(CHANGE_ADDRESS_SHEET_NAME, (String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.reattach_address").localize(), new WorkflowLockedComponentAccess(attachAddressSheet, itemModel), attachAddressSheet.getSaveCancelSection().getCancelButton()); + + BasicPageForm deleteAddressSheet = new GenericContactDeleteAddressForm(itemModel, this); + add(DELETE_ADDRESS_SHEET_NAME, (String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.delete_address").localize(), new WorkflowLockedComponentAccess(deleteAddressSheet, itemModel), deleteAddressSheet.getSaveCancelSection().getCancelButton()); + + /* Set the displayComponent for this step */ + setDisplayComponent(getAddressPropertySheet(itemModel)); +// } + + } + + public static Component getAddressPropertySheet(ItemSelectionModel itemModel) { + + DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(itemModel); + + sheet.add((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.address").localize(), "address." + GenericAddress.ADDRESS); + if (!GenericContact.getConfig().getHideAddressPostalCode()) { + sheet.add((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.postal_code").localize(), "address." + GenericAddress.POSTAL_CODE); + } + sheet.add((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.city").localize(), "address." + GenericAddress.CITY); + if (!GenericContact.getConfig().getHideAddressState()) { + sheet.add((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.state").localize(), "address." + GenericAddress.STATE); + } + + if (!GenericContact.getConfig().getHideAddressCountry()) { + sheet.add((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.iso_country_code").localize(), + "address." + GenericAddress.ISO_COUNTRY_CODE, + new DomainObjectPropertySheet.AttributeFormatter() { + + public String format(DomainObject item, + String attribute, + PageState state) { + GenericAddress Address = ((GenericContact) item).getAddress(); + if (Address != null && Address.getIsoCountryCode() != null) { + return Address.getCountryNameFromIsoCode(Address.getIsoCountryCode()); + } else { + return (String) ContenttypesGlobalizationUtil.globalize("cms.ui.unknown").localize(); + } + } + }); + } + + return sheet; + + } + + public static Component getEmptyBaseAddressPropertySheet(ItemSelectionModel itemModel) { + return new Label(((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.emptyAddress").localize())); + } +} diff --git a/ccm-cms/src/com/arsdigita/cms/basetypes/ui/ContactAttachAddressPropertyForm.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactAttachAddressPropertyForm.java similarity index 63% rename from ccm-cms/src/com/arsdigita/cms/basetypes/ui/ContactAttachAddressPropertyForm.java rename to ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactAttachAddressPropertyForm.java index 4e66a130d..1cc535fb9 100644 --- a/ccm-cms/src/com/arsdigita/cms/basetypes/ui/ContactAttachAddressPropertyForm.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactAttachAddressPropertyForm.java @@ -7,7 +7,7 @@ * and open the template in the editor. */ -package com.arsdigita.cms.basetypes.ui; +package com.arsdigita.cms.contenttypes.ui; import com.arsdigita.bebop.FormData; import com.arsdigita.bebop.FormProcessException; @@ -23,11 +23,11 @@ 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.basetypes.Address; -import com.arsdigita.cms.basetypes.Contact; +import com.arsdigita.cms.contenttypes.GenericAddress; +import com.arsdigita.cms.contenttypes.GenericContact; import com.arsdigita.cms.ui.ItemSearchWidget; import com.arsdigita.cms.ContentType; -import com.arsdigita.cms.basetypes.util.BasetypesGlobalizationUtil; +import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil; import com.arsdigita.util.UncheckedWrapperException; import org.apache.log4j.Logger; @@ -36,11 +36,11 @@ import org.apache.log4j.Logger; * * @author quasi */ -public class ContactAttachAddressPropertyForm extends BasicPageForm implements FormProcessListener, FormInitListener, FormSubmissionListener { +public class GenericContactAttachAddressPropertyForm extends BasicPageForm implements FormProcessListener, FormInitListener, FormSubmissionListener { - private static final Logger logger = Logger.getLogger(ContactPropertyForm.class); + private static final Logger logger = Logger.getLogger(GenericContactPropertyForm.class); - private ContactAddressPropertiesStep m_step; + private GenericContactAddressPropertiesStep m_step; private ItemSearchWidget m_itemSearch; private SaveCancelSection m_saveCancelSection; private final String ITEM_SEARCH = "contactAddress"; @@ -55,7 +55,7 @@ public class ContactAttachAddressPropertyForm extends BasicPageForm implements F * * @param itemModel */ - public ContactAttachAddressPropertyForm(ItemSelectionModel itemModel) { + public GenericContactAttachAddressPropertyForm(ItemSelectionModel itemModel) { this(itemModel, null); } @@ -65,7 +65,7 @@ public class ContactAttachAddressPropertyForm extends BasicPageForm implements F * @param itemModel * @param step */ - public ContactAttachAddressPropertyForm(ItemSelectionModel itemModel, ContactAddressPropertiesStep step) { + public GenericContactAttachAddressPropertyForm(ItemSelectionModel itemModel, GenericContactAddressPropertiesStep step) { super(ID, itemModel); addSubmissionListener(this); @@ -78,15 +78,15 @@ public class ContactAttachAddressPropertyForm extends BasicPageForm implements F @Override public void addWidgets() { - add(new Label((String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.select_address").localize())); - this.m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.findByAssociatedObjectType("com.arsdigita.cms.basetypes.Address")); + add(new Label((String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.select_address").localize())); + this.m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.findByAssociatedObjectType("com.arsdigita.cms.contenttypes.GenericAddress")); add(this.m_itemSearch); } public void init(FormSectionEvent fse) { FormData data = fse.getFormData(); PageState state = fse.getPageState(); - Contact contact = (Contact)getItemSelectionModel().getSelectedObject(state); + GenericContact contact = (GenericContact)getItemSelectionModel().getSelectedObject(state); setVisible(state, true); @@ -98,10 +98,10 @@ public class ContactAttachAddressPropertyForm extends BasicPageForm implements F public void process(FormSectionEvent fse) { FormData data = fse.getFormData(); PageState state = fse.getPageState(); - Contact contact = (Contact)getItemSelectionModel().getSelectedObject(state); + GenericContact contact = (GenericContact)getItemSelectionModel().getSelectedObject(state); if (!this.getSaveCancelSection().getCancelButton().isSelected(state)) { - contact.setAddress((Address)data.get(ITEM_SEARCH)); + contact.setAddress((GenericAddress)data.get(ITEM_SEARCH)); } init(fse); } @@ -116,13 +116,13 @@ public class ContactAttachAddressPropertyForm extends BasicPageForm implements F getSaveCancelSection().getSaveButton().addPrintListener(new PrintListener() { public void prepare(PrintEvent e) { - Contact contact = (Contact)getItemSelectionModel().getSelectedObject(e.getPageState()); + GenericContact contact = (GenericContact)getItemSelectionModel().getSelectedObject(e.getPageState()); Submit target = (Submit) e.getTarget(); if (contact.getAddress() != null) { - target.setButtonLabel((String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.select_address.change").localize()); + target.setButtonLabel((String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.select_address.change").localize()); } else { - target.setButtonLabel((String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.select_address.add").localize()); + target.setButtonLabel((String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.select_address.add").localize()); } } }); @@ -134,14 +134,14 @@ public class ContactAttachAddressPropertyForm extends BasicPageForm implements F @Override public void validate(FormSectionEvent e) throws FormProcessException { if (e.getFormData().get(ITEM_SEARCH) == null) { - throw new FormProcessException((String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.select_address.wrong_type").localize()); + throw new FormProcessException((String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.select_address.wrong_type").localize()); } } public void submitted(FormSectionEvent e) throws FormProcessException { if (getSaveCancelSection().getCancelButton().isSelected(e.getPageState())) { init(e); - throw new FormProcessException((String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.select_address.cancelled").localize()); + throw new FormProcessException((String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.select_address.cancelled").localize()); } } } \ No newline at end of file diff --git a/ccm-cms/src/com/arsdigita/cms/basetypes/ui/ContactAttachPersonPropertyForm.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactAttachPersonPropertyForm.java similarity index 63% rename from ccm-cms/src/com/arsdigita/cms/basetypes/ui/ContactAttachPersonPropertyForm.java rename to ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactAttachPersonPropertyForm.java index f959084d3..764e68c18 100644 --- a/ccm-cms/src/com/arsdigita/cms/basetypes/ui/ContactAttachPersonPropertyForm.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactAttachPersonPropertyForm.java @@ -7,7 +7,7 @@ * and open the template in the editor. */ -package com.arsdigita.cms.basetypes.ui; +package com.arsdigita.cms.contenttypes.ui; import com.arsdigita.bebop.FormData; import com.arsdigita.bebop.FormProcessException; @@ -23,11 +23,11 @@ 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.basetypes.Person; -import com.arsdigita.cms.basetypes.Contact; +import com.arsdigita.cms.contenttypes.GenericPerson; +import com.arsdigita.cms.contenttypes.GenericContact; import com.arsdigita.cms.ui.ItemSearchWidget; import com.arsdigita.cms.ContentType; -import com.arsdigita.cms.basetypes.util.BasetypesGlobalizationUtil; +import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil; import com.arsdigita.util.UncheckedWrapperException; import org.apache.log4j.Logger; @@ -36,11 +36,11 @@ import org.apache.log4j.Logger; * * @author quasi */ -public class ContactAttachPersonPropertyForm extends BasicPageForm implements FormProcessListener, FormInitListener, FormSubmissionListener { +public class GenericContactAttachPersonPropertyForm extends BasicPageForm implements FormProcessListener, FormInitListener, FormSubmissionListener { - private static final Logger logger = Logger.getLogger(ContactPropertyForm.class); + private static final Logger logger = Logger.getLogger(GenericContactPropertyForm.class); - private ContactPersonPropertiesStep m_step; + private GenericContactPersonPropertiesStep m_step; private ItemSearchWidget m_itemSearch; private SaveCancelSection m_saveCancelSection; private final String ITEM_SEARCH = "contactPerson"; @@ -55,7 +55,7 @@ public class ContactAttachPersonPropertyForm extends BasicPageForm implements Fo * * @param itemModel */ - public ContactAttachPersonPropertyForm(ItemSelectionModel itemModel) { + public GenericContactAttachPersonPropertyForm(ItemSelectionModel itemModel) { this(itemModel, null); } @@ -65,7 +65,7 @@ public class ContactAttachPersonPropertyForm extends BasicPageForm implements Fo * @param itemModel * @param step */ - public ContactAttachPersonPropertyForm(ItemSelectionModel itemModel, ContactPersonPropertiesStep step) { + public GenericContactAttachPersonPropertyForm(ItemSelectionModel itemModel, GenericContactPersonPropertiesStep step) { super(ID, itemModel); addSubmissionListener(this); @@ -78,15 +78,15 @@ public class ContactAttachPersonPropertyForm extends BasicPageForm implements Fo @Override public void addWidgets() { - add(new Label((String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.select_person").localize())); - this.m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.findByAssociatedObjectType("com.arsdigita.cms.basetypes.Person")); + add(new Label((String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.select_person").localize())); + this.m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.findByAssociatedObjectType("com.arsdigita.cms.contenttypes.GenericPerson")); add(this.m_itemSearch); } public void init(FormSectionEvent fse) { FormData data = fse.getFormData(); PageState state = fse.getPageState(); - Contact contact = (Contact)getItemSelectionModel().getSelectedObject(state); + GenericContact contact = (GenericContact)getItemSelectionModel().getSelectedObject(state); setVisible(state, true); @@ -98,10 +98,10 @@ public class ContactAttachPersonPropertyForm extends BasicPageForm implements Fo public void process(FormSectionEvent fse) { FormData data = fse.getFormData(); PageState state = fse.getPageState(); - Contact contact = (Contact)getItemSelectionModel().getSelectedObject(state); + GenericContact contact = (GenericContact)getItemSelectionModel().getSelectedObject(state); if (!this.getSaveCancelSection().getCancelButton().isSelected(state)) { - contact.setPerson((Person)data.get(ITEM_SEARCH)); + contact.setPerson((GenericPerson)data.get(ITEM_SEARCH)); } init(fse); } @@ -116,13 +116,13 @@ public class ContactAttachPersonPropertyForm extends BasicPageForm implements Fo getSaveCancelSection().getSaveButton().addPrintListener(new PrintListener() { public void prepare(PrintEvent e) { - Contact contact = (Contact)getItemSelectionModel().getSelectedObject(e.getPageState()); + GenericContact contact = (GenericContact)getItemSelectionModel().getSelectedObject(e.getPageState()); Submit target = (Submit) e.getTarget(); if (contact.getPerson() != null) { - target.setButtonLabel((String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.select_person.change").localize()); + target.setButtonLabel((String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.select_person.change").localize()); } else { - target.setButtonLabel((String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.select_person.add").localize()); + target.setButtonLabel((String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.select_person.add").localize()); } } }); @@ -134,14 +134,14 @@ public class ContactAttachPersonPropertyForm extends BasicPageForm implements Fo @Override public void validate(FormSectionEvent e) throws FormProcessException { if (e.getFormData().get(ITEM_SEARCH) == null) { - throw new FormProcessException((String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.select_person.wrong_type").localize()); + throw new FormProcessException((String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.select_person.wrong_type").localize()); } } public void submitted(FormSectionEvent e) throws FormProcessException { if (getSaveCancelSection().getCancelButton().isSelected(e.getPageState())) { init(e); - throw new FormProcessException((String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.select_person.cancelled").localize()); + throw new FormProcessException((String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.select_person.cancelled").localize()); } } } \ No newline at end of file diff --git a/ccm-cms/src/com/arsdigita/cms/basetypes/ui/ContactDeleteAddressForm.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactDeleteAddressForm.java similarity index 64% rename from ccm-cms/src/com/arsdigita/cms/basetypes/ui/ContactDeleteAddressForm.java rename to ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactDeleteAddressForm.java index fd4145935..8cc3398f9 100644 --- a/ccm-cms/src/com/arsdigita/cms/basetypes/ui/ContactDeleteAddressForm.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactDeleteAddressForm.java @@ -1,12 +1,12 @@ /* - * ContactDeleteAddressForm.java + * GenericContactDeleteAddressForm.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.basetypes.ui; +package com.arsdigita.cms.contenttypes.ui; import com.arsdigita.bebop.FormProcessException; import com.arsdigita.bebop.Label; @@ -17,8 +17,8 @@ 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.basetypes.Contact; -import com.arsdigita.cms.basetypes.util.BasetypesGlobalizationUtil; +import com.arsdigita.cms.contenttypes.GenericContact; +import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil; import com.arsdigita.cms.ui.authoring.BasicPageForm; import com.arsdigita.util.UncheckedWrapperException; @@ -26,14 +26,14 @@ import com.arsdigita.util.UncheckedWrapperException; * * @author quasi */ -public class ContactDeleteAddressForm extends BasicPageForm implements FormProcessListener { +public class GenericContactDeleteAddressForm extends BasicPageForm implements FormProcessListener { /** * ID of the form */ public static final String ID = "BaseContactDeleteAddress"; - ContactDeleteAddressForm(ItemSelectionModel itemModel, ContactAddressPropertiesStep step) { + GenericContactDeleteAddressForm(ItemSelectionModel itemModel, GenericContactAddressPropertiesStep step) { super(ID, itemModel); addSaveCancelSection(); } @@ -43,7 +43,7 @@ public class ContactDeleteAddressForm extends BasicPageForm implements FormProce @Override public void addWidgets() { - add(new Label((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.delete_address.label").localize())); + add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.delete_address.label").localize())); } /** @@ -55,9 +55,9 @@ public class ContactDeleteAddressForm extends BasicPageForm implements FormProce getSaveCancelSection().getSaveButton().addPrintListener(new PrintListener() { public void prepare(PrintEvent e) { - Contact contact = (Contact) getItemSelectionModel().getSelectedObject(e.getPageState()); + GenericContact contact = (GenericContact) getItemSelectionModel().getSelectedObject(e.getPageState()); Submit target = (Submit) e.getTarget(); - target.setButtonLabel((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.delete_address.button_label").localize()); + target.setButtonLabel((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.delete_address.button_label").localize()); } }); } catch (Exception ex) { @@ -68,7 +68,7 @@ public class ContactDeleteAddressForm extends BasicPageForm implements FormProce public final void process(final FormSectionEvent fse) throws FormProcessException { final PageState state = fse.getPageState(); - final Contact contact = (Contact) getItemSelectionModel().getSelectedObject(state); + final GenericContact contact = (GenericContact) getItemSelectionModel().getSelectedObject(state); if (contact != null && contact.getAddress() != null) { contact.unsetAddress(); diff --git a/ccm-cms/src/com/arsdigita/cms/basetypes/ui/ContactDeletePersonForm.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactDeletePersonForm.java similarity index 65% rename from ccm-cms/src/com/arsdigita/cms/basetypes/ui/ContactDeletePersonForm.java rename to ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactDeletePersonForm.java index 0442d802c..6e7b7b933 100644 --- a/ccm-cms/src/com/arsdigita/cms/basetypes/ui/ContactDeletePersonForm.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactDeletePersonForm.java @@ -1,5 +1,5 @@ /* - * ContactDeletePersonForm.java + * GenericContactDeletePersonForm.java * * Created on 17. Juli 2009, 10:10 * @@ -7,7 +7,7 @@ * and open the template in the editor. */ -package com.arsdigita.cms.basetypes.ui; +package com.arsdigita.cms.contenttypes.ui; import com.arsdigita.bebop.FormProcessException; import com.arsdigita.bebop.Label; @@ -18,8 +18,8 @@ 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.basetypes.Contact; -import com.arsdigita.cms.basetypes.util.BasetypesGlobalizationUtil; +import com.arsdigita.cms.contenttypes.GenericContact; +import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil; import com.arsdigita.cms.ui.authoring.BasicPageForm; import com.arsdigita.util.UncheckedWrapperException; @@ -27,14 +27,14 @@ import com.arsdigita.util.UncheckedWrapperException; * * @author quasi */ -public class ContactDeletePersonForm extends BasicPageForm implements FormProcessListener { +public class GenericContactDeletePersonForm extends BasicPageForm implements FormProcessListener { /** * ID of the form */ public static final String ID = "ContactDeletePerson"; - ContactDeletePersonForm(ItemSelectionModel itemModel, ContactPersonPropertiesStep step) { + GenericContactDeletePersonForm(ItemSelectionModel itemModel, GenericContactPersonPropertiesStep step) { super(ID, itemModel); addSaveCancelSection(); } @@ -45,7 +45,7 @@ public class ContactDeletePersonForm extends BasicPageForm implements FormProces @Override public void addWidgets() { - add(new Label((String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.delete_person.label").localize())); + add(new Label((String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.delete_person.label").localize())); } /** @@ -57,9 +57,9 @@ public class ContactDeletePersonForm extends BasicPageForm implements FormProces getSaveCancelSection().getSaveButton().addPrintListener(new PrintListener() { public void prepare(PrintEvent e) { - Contact contact = (Contact)getItemSelectionModel().getSelectedObject(e.getPageState()); + GenericContact contact = (GenericContact)getItemSelectionModel().getSelectedObject(e.getPageState()); Submit target = (Submit) e.getTarget(); - target.setButtonLabel((String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.delete_person").localize()); + target.setButtonLabel((String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.delete_person").localize()); } }); } catch (Exception ex) { @@ -70,7 +70,7 @@ public class ContactDeletePersonForm extends BasicPageForm implements FormProces public final void process(final FormSectionEvent fse) throws FormProcessException { final PageState state = fse.getPageState(); - final Contact contact = (Contact)getItemSelectionModel().getSelectedObject(state); + final GenericContact contact = (GenericContact)getItemSelectionModel().getSelectedObject(state); if (contact != null && contact.getPerson() != null) { contact.unsetPerson(); diff --git a/ccm-cms/src/com/arsdigita/cms/basetypes/ui/ContactEditAddressPropertyForm.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactEditAddressPropertyForm.java similarity index 68% rename from ccm-cms/src/com/arsdigita/cms/basetypes/ui/ContactEditAddressPropertyForm.java rename to ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactEditAddressPropertyForm.java index f25c3e305..b5d36ac24 100644 --- a/ccm-cms/src/com/arsdigita/cms/basetypes/ui/ContactEditAddressPropertyForm.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactEditAddressPropertyForm.java @@ -1,12 +1,12 @@ /* - * ContactEditAddressPropertyForm.java + * GenericContactEditAddressPropertyForm.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.basetypes.ui; +package com.arsdigita.cms.contenttypes.ui; import com.arsdigita.bebop.FormData; import com.arsdigita.bebop.FormProcessException; @@ -31,9 +31,9 @@ import com.arsdigita.cms.ItemSelectionModel; import com.arsdigita.cms.ui.authoring.BasicPageForm; import java.util.Iterator; import java.util.Map; -import com.arsdigita.cms.basetypes.Address; -import com.arsdigita.cms.basetypes.Contact; -import com.arsdigita.cms.basetypes.util.BasetypesGlobalizationUtil; +import com.arsdigita.cms.contenttypes.GenericAddress; +import com.arsdigita.cms.contenttypes.GenericContact; +import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil; import org.apache.log4j.Logger; @@ -41,15 +41,15 @@ import org.apache.log4j.Logger; * * @author quasi */ -public class ContactEditAddressPropertyForm extends BasicPageForm implements FormProcessListener, FormInitListener, FormSubmissionListener { +public class GenericContactEditAddressPropertyForm extends BasicPageForm implements FormProcessListener, FormInitListener, FormSubmissionListener { - private static final Logger logger = Logger.getLogger(ContactPropertyForm.class); - private ContactAddressPropertiesStep m_step; - public static final String ADDRESS = Address.ADDRESS; - public static final String POSTAL_CODE = Address.POSTAL_CODE; - public static final String CITY = Address.CITY; - public static final String STATE = Address.STATE; - public static final String ISO_COUNTRY_CODE = Address.ISO_COUNTRY_CODE; + private static final Logger logger = Logger.getLogger(GenericContactPropertyForm.class); + private GenericContactAddressPropertiesStep m_step; + public static final String ADDRESS = GenericAddress.ADDRESS; + public static final String POSTAL_CODE = GenericAddress.POSTAL_CODE; + public static final String CITY = GenericAddress.CITY; + public static final String STATE = GenericAddress.STATE; + public static final String ISO_COUNTRY_CODE = GenericAddress.ISO_COUNTRY_CODE; /** * ID of the form */ @@ -60,7 +60,7 @@ public class ContactEditAddressPropertyForm extends BasicPageForm implements For * * @param itemModel */ - public ContactEditAddressPropertyForm(ItemSelectionModel itemModel) { + public GenericContactEditAddressPropertyForm(ItemSelectionModel itemModel) { this(itemModel, null); } @@ -70,7 +70,7 @@ public class ContactEditAddressPropertyForm extends BasicPageForm implements For * @param itemModel * @param step */ - public ContactEditAddressPropertyForm(ItemSelectionModel itemModel, ContactAddressPropertiesStep step) { + public GenericContactEditAddressPropertyForm(ItemSelectionModel itemModel, GenericContactAddressPropertiesStep step) { super(ID, itemModel); m_step = step; addSubmissionListener(this); @@ -78,7 +78,7 @@ public class ContactEditAddressPropertyForm extends BasicPageForm implements For @Override public void addWidgets() { - add(new Label((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.baseAddress.address").localize())); + add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.baseAddress.address").localize())); ParameterModel addressParam = new StringParameter(ADDRESS); addressParam.addParameterListener(new NotNullValidationListener()); addressParam.addParameterListener(new StringInRangeValidationListener(0, 1000)); @@ -87,36 +87,36 @@ public class ContactEditAddressPropertyForm extends BasicPageForm implements For address.setCols(30); add(address); - if (!Contact.getConfig().getHideAddressPostalCode()) { - add(new Label((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.baseAddress.postal_code").localize())); + if (!GenericContact.getConfig().getHideAddressPostalCode()) { + add(new Label((String) ContenttypesGlobalizationUtil.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) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.baseAddress.city").localize())); + add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.baseAddress.city").localize())); ParameterModel cityParam = new StringParameter(CITY); TextField city = new TextField(cityParam); add(city); - if (!Contact.getConfig().getHideAddressState()) { - add(new Label((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.baseAddress.state").localize())); + if (!GenericContact.getConfig().getHideAddressState()) { + add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.baseAddress.state").localize())); ParameterModel stateParam = new StringParameter(STATE); TextField state = new TextField(stateParam); add(state); } - if (!Contact.getConfig().getHideAddressCountry()) { - add(new Label((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.baseAddress.iso_country_code").localize())); + if (!GenericContact.getConfig().getHideAddressCountry()) { + add(new Label((String) ContenttypesGlobalizationUtil.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) BasetypesGlobalizationUtil.globalize("cms.ui.select_one").localize()))); + country.addOption(new Option("", new Label((String) ContenttypesGlobalizationUtil.globalize("cms.ui.select_one").localize()))); - Iterator countries = Address.getSortedListOfCountries(null).entrySet().iterator(); + Iterator countries = GenericAddress.getSortedListOfCountries(null).entrySet().iterator(); while (countries.hasNext()) { Map.Entry elem = (Map.Entry) countries.next(); country.addOption(new Option(elem.getValue().toString(), elem.getKey().toString())); @@ -129,7 +129,7 @@ public class ContactEditAddressPropertyForm extends BasicPageForm implements For ParameterData data = e.getParameterData(); String isoCode = (String) data.getValue(); if (isoCode == null || isoCode.length() == 0) { - data.addError((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.error_iso_country").localize()); + data.addError((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.error_iso_country").localize()); } } }); @@ -142,14 +142,14 @@ public class ContactEditAddressPropertyForm extends BasicPageForm implements For public void init(FormSectionEvent fse) { FormData data = fse.getFormData(); PageState state = fse.getPageState(); - Contact contact = (Contact) getItemSelectionModel().getSelectedObject(state); + GenericContact contact = (GenericContact) getItemSelectionModel().getSelectedObject(state); if (contact.getAddress() != null) { data.put(ADDRESS, contact.getAddress().getAddress()); data.put(POSTAL_CODE, contact.getAddress().getPostalCode()); data.put(CITY, contact.getAddress().getCity()); data.put(STATE, contact.getAddress().getState()); - if (!Address.getConfig().getHideCountryCodeSelection()) { + if (!GenericAddress.getConfig().getHideCountryCodeSelection()) { data.put(ISO_COUNTRY_CODE, contact.getAddress().getIsoCountryCode()); } } @@ -165,11 +165,11 @@ public class ContactEditAddressPropertyForm extends BasicPageForm implements For public void process(FormSectionEvent fse) { FormData data = fse.getFormData(); PageState state = fse.getPageState(); - Contact contact = (Contact) getItemSelectionModel().getSelectedObject(state); + GenericContact contact = (GenericContact) getItemSelectionModel().getSelectedObject(state); if (getSaveCancelSection().getSaveButton().isSelected(fse.getPageState())) { if (contact.getAddress() == null) { - contact.setAddress(new Address()); + contact.setAddress(new GenericAddress()); contact.getAddress().setName("Address for " + contact.getName() + "(" + contact.getID() + ")"); contact.getAddress().setTitle("Address for " + contact.getName() + "(" + contact.getID() + ")"); } diff --git a/ccm-cms/src/com/arsdigita/cms/basetypes/ui/ContactEditPersonPropertyForm.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactEditPersonPropertyForm.java similarity index 70% rename from ccm-cms/src/com/arsdigita/cms/basetypes/ui/ContactEditPersonPropertyForm.java rename to ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactEditPersonPropertyForm.java index 81bad7f3a..b9bb7e5a4 100644 --- a/ccm-cms/src/com/arsdigita/cms/basetypes/ui/ContactEditPersonPropertyForm.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactEditPersonPropertyForm.java @@ -1,12 +1,12 @@ /* - * ContactEditPersonPropertyForm.java + * GenericContactEditPersonPropertyForm.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.basetypes.ui; +package com.arsdigita.cms.contenttypes.ui; import com.arsdigita.bebop.FormData; import com.arsdigita.bebop.Label; @@ -22,9 +22,9 @@ 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.basetypes.Contact; -import com.arsdigita.cms.basetypes.Person; -import com.arsdigita.cms.basetypes.util.BasetypesGlobalizationUtil; +import com.arsdigita.cms.contenttypes.GenericContact; +import com.arsdigita.cms.contenttypes.GenericPerson; +import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil; import org.apache.log4j.Logger; @@ -32,14 +32,14 @@ import org.apache.log4j.Logger; * * @author quasi */ -public class ContactEditPersonPropertyForm extends BasicPageForm implements FormProcessListener, FormInitListener, FormSubmissionListener { +public class GenericContactEditPersonPropertyForm extends BasicPageForm implements FormProcessListener, FormInitListener, FormSubmissionListener { - private static final Logger logger = Logger.getLogger(ContactPropertyForm.class); - private ContactPersonPropertiesStep m_step; - public static final String SURNAME = Person.SURNAME; - public static final String GIVENNAME = Person.GIVENNAME; - public static final String TITLEPRE = Person.TITLEPRE; - public static final String TITLEPOST = Person.TITLEPOST; + private static final Logger logger = Logger.getLogger(GenericContactPropertyForm.class); + private GenericContactPersonPropertiesStep m_step; + public static final String SURNAME = GenericPerson.SURNAME; + public static final String GIVENNAME = GenericPerson.GIVENNAME; + public static final String TITLEPRE = GenericPerson.TITLEPRE; + public static final String TITLEPOST = GenericPerson.TITLEPOST; /** * ID of the form */ @@ -50,7 +50,7 @@ public class ContactEditPersonPropertyForm extends BasicPageForm implements Form * * @param itemModel */ - public ContactEditPersonPropertyForm(ItemSelectionModel itemModel) { + public GenericContactEditPersonPropertyForm(ItemSelectionModel itemModel) { this(itemModel, null); } @@ -60,7 +60,7 @@ public class ContactEditPersonPropertyForm extends BasicPageForm implements Form * @param itemModel * @param step */ - public ContactEditPersonPropertyForm(ItemSelectionModel itemModel, ContactPersonPropertiesStep step) { + public GenericContactEditPersonPropertyForm(ItemSelectionModel itemModel, GenericContactPersonPropertiesStep step) { super(ID, itemModel); m_step = step; addSubmissionListener(this); @@ -68,27 +68,27 @@ public class ContactEditPersonPropertyForm extends BasicPageForm implements Form @Override public void addWidgets() { - add(new Label((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.person.surname").localize())); + add(new Label((String) ContenttypesGlobalizationUtil.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) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.person.givenname").localize())); + add(new Label((String) ContenttypesGlobalizationUtil.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) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.person.titlepre").localize())); + add(new Label((String) ContenttypesGlobalizationUtil.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) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.person.titlepost").localize())); + add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.titlepost").localize())); ParameterModel titlepostParam = new StringParameter(TITLEPOST); titlepostParam.addParameterListener(new StringInRangeValidationListener(0, 1000)); TextField titlepost = new TextField(titlepostParam); @@ -98,7 +98,7 @@ public class ContactEditPersonPropertyForm extends BasicPageForm implements Form public void init(FormSectionEvent fse) { FormData data = fse.getFormData(); PageState state = fse.getPageState(); - Contact contact = (Contact) getItemSelectionModel().getSelectedObject(state); + GenericContact contact = (GenericContact) getItemSelectionModel().getSelectedObject(state); if (contact.getPerson() != null) { data.put(SURNAME, contact.getPerson().getSurname()); @@ -118,12 +118,12 @@ public class ContactEditPersonPropertyForm extends BasicPageForm implements Form public void process(FormSectionEvent fse) { FormData data = fse.getFormData(); PageState state = fse.getPageState(); - Contact contact = (Contact) getItemSelectionModel().getSelectedObject(state); + GenericContact contact = (GenericContact) getItemSelectionModel().getSelectedObject(state); if (getSaveCancelSection().getSaveButton().isSelected(fse.getPageState())) { if (contact.getPerson() == null) { - contact.setPerson(new Person()); + contact.setPerson(new GenericPerson()); contact.getPerson().setName("Person for " + contact.getName() + "(" + contact.getID() + ")"); contact.getPerson().setTitle("Person for " + contact.getName() + "(" + contact.getID() + ")"); } diff --git a/ccm-cms/src/com/arsdigita/cms/basetypes/ui/ContactEntriesPropertiesStep.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactEntriesPropertiesStep.java similarity index 65% rename from ccm-cms/src/com/arsdigita/cms/basetypes/ui/ContactEntriesPropertiesStep.java rename to ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactEntriesPropertiesStep.java index 8dbd99a36..f3f124643 100644 --- a/ccm-cms/src/com/arsdigita/cms/basetypes/ui/ContactEntriesPropertiesStep.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactEntriesPropertiesStep.java @@ -16,10 +16,10 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ -package com.arsdigita.cms.basetypes.ui; +package com.arsdigita.cms.contenttypes.ui; import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.basetypes.util.BasetypesGlobalizationUtil; +import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil; import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; import com.arsdigita.cms.ui.authoring.BasicItemForm; import com.arsdigita.cms.ui.authoring.SimpleEditStep; @@ -33,22 +33,22 @@ import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; * @author Shashin Shinde sshinde@redhat.com * @version $Id: PhoBaseContactEntriesPropertiesStepva 287 2005-02-22 00:29:02Z sskracic $ */ -public class ContactEntriesPropertiesStep extends SimpleEditStep { +public class GenericContactEntriesPropertiesStep extends SimpleEditStep { /** The name of the editing sheet added to this step */ private static String ADD_CONTACT_ENTRY_SHEET_NAME = "addContactEntry"; - public ContactEntriesPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent) { + public GenericContactEntriesPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent) { this(itemModel, parent, null); } - public ContactEntriesPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent, String prefix) { + public GenericContactEntriesPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent, String prefix) { super(itemModel, parent, prefix); - BasicItemForm addContactEntrySheet = new ContactEntryAddForm(itemModel); - add(ADD_CONTACT_ENTRY_SHEET_NAME, (String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.add_contactEntry").localize(), new WorkflowLockedComponentAccess(addContactEntrySheet, itemModel), addContactEntrySheet.getSaveCancelSection().getCancelButton()); + BasicItemForm addContactEntrySheet = new GenericContactEntryAddForm(itemModel); + add(ADD_CONTACT_ENTRY_SHEET_NAME, (String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.add_contactEntry").localize(), new WorkflowLockedComponentAccess(addContactEntrySheet, itemModel), addContactEntrySheet.getSaveCancelSection().getCancelButton()); - ContactEntriesTable contactEntriesTable = new ContactEntriesTable(itemModel); + GenericContactEntriesTable contactEntriesTable = new GenericContactEntriesTable(itemModel); setDisplayComponent(contactEntriesTable); } diff --git a/ccm-cms/src/com/arsdigita/cms/basetypes/ui/ContactEntriesTable.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactEntriesTable.java similarity index 76% rename from ccm-cms/src/com/arsdigita/cms/basetypes/ui/ContactEntriesTable.java rename to ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactEntriesTable.java index 76c9cb72a..f9885714e 100644 --- a/ccm-cms/src/com/arsdigita/cms/basetypes/ui/ContactEntriesTable.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactEntriesTable.java @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ -package com.arsdigita.cms.basetypes.ui; +package com.arsdigita.cms.contenttypes.ui; import com.arsdigita.bebop.Component; import com.arsdigita.bebop.ControlLink; @@ -32,10 +32,10 @@ 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.basetypes.Contact; -import com.arsdigita.cms.basetypes.ContactEntry; -import com.arsdigita.cms.basetypes.ContactEntryCollection; -import com.arsdigita.cms.basetypes.util.BasetypesGlobalizationUtil; +import com.arsdigita.cms.contenttypes.GenericContact; +import com.arsdigita.cms.contenttypes.GenericContactEntry; +import com.arsdigita.cms.contenttypes.GenericContactEntryCollection; +import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil; import com.arsdigita.cms.dispatcher.Utilities; import com.arsdigita.cms.util.GlobalizationUtil; import com.arsdigita.util.LockableImpl; @@ -46,7 +46,7 @@ import java.math.BigDecimal; * * @author Sören Bernstein (quasimodo) quasi@barkhof.uni-bremen.de */ -public class ContactEntriesTable extends Table implements TableActionListener{ +public class GenericContactEntriesTable extends Table implements TableActionListener{ private final String TABLE_COL_EDIT = "table_col_edit"; @@ -55,22 +55,22 @@ public class ContactEntriesTable extends Table implements TableActionListener{ private ItemSelectionModel m_itemModel; /** - * Creates a new instance of ContactEntriesTable + * Creates a new instance of GenericContactEntriesTable */ - public ContactEntriesTable(final ItemSelectionModel itemModel) { + public GenericContactEntriesTable(final ItemSelectionModel itemModel) { super(); this.m_itemModel = itemModel; // if table is empty: - setEmptyView(new Label(BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.contactEntry.none"))); + setEmptyView(new Label(ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.contactEntry.none"))); TableColumnModel tab_model = getColumnModel(); // define columns - tab_model.add(new TableColumn(0, BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.contactEntry.key").localize(), TABLE_COL_EDIT)); - tab_model.add(new TableColumn(1, BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.contactEntry.value").localize())); - tab_model.add(new TableColumn(2, BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.contactEntry.description").localize())); - tab_model.add(new TableColumn(3, BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.contactEntry.action").localize(), TABLE_COL_DEL)); + tab_model.add(new TableColumn(0, ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.contactEntry.key").localize(), TABLE_COL_EDIT)); + tab_model.add(new TableColumn(1, ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.contactEntry.value").localize())); + tab_model.add(new TableColumn(2, ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.contactEntry.description").localize())); + tab_model.add(new TableColumn(3, ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.contactEntry.action").localize(), TABLE_COL_DEL)); setModelBuilder(new ContactTableModelBuilder(itemModel)); @@ -97,7 +97,7 @@ public class ContactEntriesTable extends Table implements TableActionListener{ table.getRowSelectionModel().clearSelection(state); - Contact contact = (Contact) m_itemModel.getSelectedObject(state); + GenericContact contact = (GenericContact) m_itemModel.getSelectedObject(state); // if (contact != null && contact.hasContactEntries()) { return new ContactTableModel(table, state, contact); @@ -116,10 +116,10 @@ public class ContactEntriesTable extends Table implements TableActionListener{ final private int MAX_DESC_LENGTH = 25; private Table m_table; - private ContactEntryCollection m_contactEntryCollection; - private ContactEntry m_contactEntry; + private GenericContactEntryCollection m_contactEntryCollection; + private GenericContactEntry m_contactEntry; - private ContactTableModel(Table t, PageState ps, Contact contact) { + private ContactTableModel(Table t, PageState ps, GenericContact contact) { m_table = t; m_contactEntryCollection = contact.getContactEntries(); } @@ -131,7 +131,7 @@ public class ContactEntriesTable extends Table implements TableActionListener{ /** * Check collection for the existence of another row. * - * If exists, fetch the value of current ContactEntryCollection object + * If exists, fetch the value of current GenericContactEntryCollection object * into m_contactEntry class variable. */ public boolean nextRow() { @@ -154,7 +154,7 @@ public class ContactEntriesTable extends Table implements TableActionListener{ public Object getElementAt(int columnIndex) { switch (columnIndex){ case 0: - return (String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.contactEntry.key." + m_contactEntry.getKey()).localize(); + return (String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.contactEntry.key." + m_contactEntry.getKey()).localize(); case 1: return m_contactEntry.getValue(); case 2: @@ -189,7 +189,7 @@ public class ContactEntriesTable extends Table implements TableActionListener{ int row, int column) { SecurityManager sm = Utilities.getSecurityManager(state); - Contact contact = (Contact) m_itemModel.getSelectedObject(state); + GenericContact contact = (GenericContact) m_itemModel.getSelectedObject(state); boolean canEdit = sm.canAccess(state.getRequest(), SecurityManager.EDIT_ITEM, @@ -214,14 +214,14 @@ public class ContactEntriesTable extends Table implements TableActionListener{ int row, int column) { SecurityManager sm = Utilities.getSecurityManager(state); - Contact contact = (Contact) m_itemModel.getSelectedObject(state); + GenericContact contact = (GenericContact) m_itemModel.getSelectedObject(state); boolean canDelete = sm.canAccess(state.getRequest(), SecurityManager.DELETE_ITEM, contact); if(canDelete) { ControlLink link = new ControlLink(value.toString()); - link.setConfirmation((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.confirm_delete").localize()); + link.setConfirmation((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.confirm_delete").localize()); return link; } else { return new Label(value.toString()); @@ -238,12 +238,12 @@ public class ContactEntriesTable extends Table implements TableActionListener{ PageState state = evt.getPageState(); - // Get selected ContactEntry - ContactEntry contactEntry = - new ContactEntry(new BigDecimal(evt.getRowKey().toString())); + // Get selected GenericContactEntry + GenericContactEntry contactEntry = + new GenericContactEntry(new BigDecimal(evt.getRowKey().toString())); - // Get Contact - Contact contact = (Contact) m_itemModel.getSelectedObject(state); + // Get GenericContact + GenericContact contact = (GenericContact) m_itemModel.getSelectedObject(state); // Get selected column TableColumn col = getColumnModel().get(evt.getColumn().intValue()); diff --git a/ccm-cms/src/com/arsdigita/cms/basetypes/ui/ContactEntryAddForm.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactEntryAddForm.java similarity index 67% rename from ccm-cms/src/com/arsdigita/cms/basetypes/ui/ContactEntryAddForm.java rename to ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactEntryAddForm.java index 56ec0f0ac..e92022022 100644 --- a/ccm-cms/src/com/arsdigita/cms/basetypes/ui/ContactEntryAddForm.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactEntryAddForm.java @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ -package com.arsdigita.cms.basetypes.ui; +package com.arsdigita.cms.contenttypes.ui; import com.arsdigita.bebop.FormData; import com.arsdigita.bebop.Label; @@ -27,9 +27,9 @@ 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.basetypes.Contact; -import com.arsdigita.cms.basetypes.ContactEntry; -import com.arsdigita.cms.basetypes.util.BasetypesGlobalizationUtil; +import com.arsdigita.cms.contenttypes.GenericContact; +import com.arsdigita.cms.contenttypes.GenericContactEntry; +import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil; import com.arsdigita.cms.ui.authoring.BasicItemForm; import com.arsdigita.bebop.parameters.StringParameter; import java.util.StringTokenizer; @@ -39,13 +39,13 @@ import org.apache.log4j.Logger; /** * @author Sören Bernstein (quasimodo) quasi@barkhof.uni-bremen.de */ -public class ContactEntryAddForm extends BasicItemForm { - private static final Logger s_log = Logger.getLogger(ContactEntryAddForm.class); +public class GenericContactEntryAddForm extends BasicItemForm { + private static final Logger s_log = Logger.getLogger(GenericContactEntryAddForm.class); private ItemSelectionModel m_itemModel; /** Creates a new instance of CategoryLocalizationAddForm */ - public ContactEntryAddForm(ItemSelectionModel itemModel) { + public GenericContactEntryAddForm(ItemSelectionModel itemModel) { super("ContactEntryAddForm",itemModel); m_itemModel = itemModel; @@ -56,31 +56,31 @@ public class ContactEntryAddForm extends BasicItemForm { protected void addWidgets() { // Key field - add(new Label(BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.contactEntry.key"))); - ParameterModel contactEntryKeyParam = new StringParameter(ContactEntry.KEY); + add(new Label(ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.contactEntry.key"))); + ParameterModel contactEntryKeyParam = new StringParameter(GenericContactEntry.KEY); SingleSelect contactEntryKey = new SingleSelect(contactEntryKeyParam); contactEntryKey.addValidationListener(new NotNullValidationListener()); - contactEntryKey.addOption(new Option("", new Label((String)BasetypesGlobalizationUtil.globalize("cms.ui.select_one").localize()))); + contactEntryKey.addOption(new Option("", new Label((String)ContenttypesGlobalizationUtil.globalize("cms.ui.select_one").localize()))); // Add the Options to the SingleSelect widget - StringTokenizer keyList = Contact.getConfig().getContactEntryKeys(); + StringTokenizer keyList = GenericContact.getConfig().getContactEntryKeys(); while(keyList.hasMoreElements()) { String currentKey = keyList.nextToken(); - contactEntryKey.addOption(new Option(currentKey, ((String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.contactEntry.key." + currentKey).localize()))); + contactEntryKey.addOption(new Option(currentKey, ((String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.contactEntry.key." + currentKey).localize()))); } add(contactEntryKey); // Value field - add(new Label(BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.contactEntry.value"))); - ParameterModel contactEntryValueParam = new StringParameter(ContactEntry.VALUE); + add(new Label(ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.contactEntry.value"))); + ParameterModel contactEntryValueParam = new StringParameter(GenericContactEntry.VALUE); TextField contactEntryValue = new TextField(contactEntryValueParam); contactEntryValue.addValidationListener(new NotNullValidationListener()); add(contactEntryValue); // Description field, only for internal usage - add(new Label(BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.contactEntry.description"))); - ParameterModel contactEntryDescriptionParam = new StringParameter(ContactEntry.DESCRIPTION); + add(new Label(ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.contactEntry.description"))); + ParameterModel contactEntryDescriptionParam = new StringParameter(GenericContactEntry.DESCRIPTION); TextField contactEntryDescription = new TextField(contactEntryDescriptionParam); add(contactEntryDescription); @@ -92,16 +92,16 @@ public class ContactEntryAddForm extends BasicItemForm { public void process(FormSectionEvent fse) { FormData data = fse.getFormData(); - Contact contact = (Contact)m_itemModel.getSelectedObject(fse.getPageState()); + GenericContact contact = (GenericContact)m_itemModel.getSelectedObject(fse.getPageState()); // save only if save button was pressed if (contact != null && getSaveCancelSection().getSaveButton().isSelected(fse.getPageState())) { - ContactEntry contactEntry = new ContactEntry(contact, - (String)data.get(ContactEntry.KEY), - (String)data.get(ContactEntry.VALUE), - (String)data.get(ContactEntry.DESCRIPTION)); + GenericContactEntry contactEntry = new GenericContactEntry(contact, + (String)data.get(GenericContactEntry.KEY), + (String)data.get(GenericContactEntry.VALUE), + (String)data.get(GenericContactEntry.DESCRIPTION)); contact.addContactEntry(contactEntry); } diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactPersonPropertiesStep.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactPersonPropertiesStep.java new file mode 100644 index 000000000..c50a75d00 --- /dev/null +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactPersonPropertiesStep.java @@ -0,0 +1,84 @@ +/* + * GenericContactPersonPropertiesStep.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.GenericPerson; +import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil; + +/** + * + * @author quasi + */ +public class GenericContactPersonPropertiesStep 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 GenericContactPersonPropertiesStep + */ + public GenericContactPersonPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent) { + this(itemModel, parent, ""); + } + + public GenericContactPersonPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent, String prefix) { + super(itemModel, parent, prefix); + +//XXX +// if(false/*EMPTY*/) { + + BasicPageForm addPersonSheet = new GenericContactAttachPersonPropertyForm(itemModel, this); + add(ADD_PERSON_SHEET_NAME, (String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.attach_person").localize(), new WorkflowLockedComponentAccess(addPersonSheet, itemModel), addPersonSheet.getSaveCancelSection().getCancelButton()); + + /* Set the displayComponent for this step */ +// setDisplayComponent(getEmptyPersonPropertySheet(itemModel)); + +// } else { + + BasicPageForm editPersonSheet = new GenericContactEditPersonPropertyForm(itemModel, this); + add(EDIT_PERSON_SHEET_NAME, (String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.edit_person").localize(), new WorkflowLockedComponentAccess(editPersonSheet, itemModel), editPersonSheet.getSaveCancelSection().getCancelButton()); + +// BasicPageForm changePersonSheet = new GenericContactEditPersonPropertyForm(itemModel, this); +// add(CHANGE_PERSON_SHEET_NAME, (String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.reattach_person").localize(), new WorkflowLockedComponentAccess(changePersonSheet, itemModel), changePersonSheet.getSaveCancelSection().getCancelButton()); + + BasicPageForm deletePersonSheet = new GenericContactDeletePersonForm(itemModel, this); + add(DELETE_PERSON_SHEET_NAME, (String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.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)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.surname").localize(), "person." + GenericPerson.SURNAME); + sheet.add((String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.givenname").localize(), "person." + GenericPerson.GIVENNAME); + sheet.add((String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.titlepre").localize(), "person." + GenericPerson.TITLEPRE); + sheet.add((String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.titlepost").localize(), "person." + GenericPerson.TITLEPOST); + + return sheet; + } + + public static Component getEmptyPersonPropertySheet(ItemSelectionModel itemModel) { + return new Label(((String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.emptyPerson").localize())); + } +} diff --git a/ccm-cms/src/com/arsdigita/cms/basetypes/ui/ContactPropertiesStep.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactPropertiesStep.java similarity index 64% rename from ccm-cms/src/com/arsdigita/cms/basetypes/ui/ContactPropertiesStep.java rename to ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactPropertiesStep.java index e42a82025..f13a7795d 100644 --- a/ccm-cms/src/com/arsdigita/cms/basetypes/ui/ContactPropertiesStep.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactPropertiesStep.java @@ -1,4 +1,4 @@ -package com.arsdigita.cms.basetypes.ui; +package com.arsdigita.cms.contenttypes.ui; import com.arsdigita.bebop.PageState; import com.arsdigita.cms.ContentPage; @@ -14,8 +14,8 @@ import com.arsdigita.cms.util.GlobalizationUtil; import com.arsdigita.bebop.Component; import com.arsdigita.bebop.Label; import com.arsdigita.bebop.SegmentedPanel; -import com.arsdigita.cms.basetypes.Contact; -import com.arsdigita.cms.basetypes.util.BasetypesGlobalizationUtil; +import com.arsdigita.cms.contenttypes.GenericContact; +import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil; import java.text.DateFormat; import org.apache.log4j.Logger; @@ -23,9 +23,9 @@ import org.apache.log4j.Logger; /** * AuthoringStep for the basic properties of a basic contact */ -public class ContactPropertiesStep extends SimpleEditStep { +public class GenericContactPropertiesStep extends SimpleEditStep { - private static final Logger logger = Logger.getLogger(ContactPropertiesStep.class); + private static final Logger logger = Logger.getLogger(GenericContactPropertiesStep.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) @@ -38,7 +38,7 @@ public class ContactPropertiesStep extends SimpleEditStep { * @param itemModel * @param parent */ - public ContactPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent) { + public GenericContactPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent) { super(itemModel, parent); setDefaultEditKey(EDIT_BASIC_SHEET_NAME); @@ -58,39 +58,39 @@ public class ContactPropertiesStep extends SimpleEditStep { SimpleEditStep basicProperties = new SimpleEditStep(itemModel, parent, EDIT_BASIC_SHEET_NAME); /* Create the edit component for this SimpleEditStep and the corresponding link */ - BasicPageForm editBasicSheet = new ContactPropertyForm(itemModel, this); - basicProperties.add(EDIT_BASIC_SHEET_NAME, (String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.edit_basic_properties").localize(), new WorkflowLockedComponentAccess(editBasicSheet, itemModel), editBasicSheet.getSaveCancelSection().getCancelButton()); + BasicPageForm editBasicSheet = new GenericContactPropertyForm(itemModel, this); + basicProperties.add(EDIT_BASIC_SHEET_NAME, (String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.edit_basic_properties").localize(), new WorkflowLockedComponentAccess(editBasicSheet, itemModel), editBasicSheet.getSaveCancelSection().getCancelButton()); /* Set the displayComponent for this step */ basicProperties.setDisplayComponent(getContactPropertySheet(itemModel)); /* Add the SimpleEditStep to the segmented panel */ - segmentedPanel.addSegment(new Label((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.basic_properties").localize()), basicProperties); + segmentedPanel.addSegment(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.basic_properties").localize()), basicProperties); // If not disabled via registry, add the ui for attaching a person - if (!Contact.getConfig().getHidePerson()) { + if (!GenericContact.getConfig().getHidePerson()) { - ContactPersonPropertiesStep personProperties = new ContactPersonPropertiesStep(itemModel, parent); - segmentedPanel.addSegment(new Label((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.person").localize()), personProperties); + GenericContactPersonPropertiesStep personProperties = new GenericContactPersonPropertiesStep(itemModel, parent); + segmentedPanel.addSegment(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.person").localize()), personProperties); } - if (!Contact.getConfig().getHideAddress()) { + if (!GenericContact.getConfig().getHideAddress()) { - ContactAddressPropertiesStep addressProperties = new ContactAddressPropertiesStep(itemModel, parent); - segmentedPanel.addSegment(new Label((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.address").localize()), addressProperties); + GenericContactAddressPropertiesStep addressProperties = new GenericContactAddressPropertiesStep(itemModel, parent); + segmentedPanel.addSegment(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.address").localize()), addressProperties); } - ContactEntriesPropertiesStep contactEntries = new ContactEntriesPropertiesStep(itemModel, parent); - segmentedPanel.addSegment(new Label((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.contactEntry").localize()), contactEntries); + GenericContactEntriesPropertiesStep contactEntries = new GenericContactEntriesPropertiesStep(itemModel, parent); + segmentedPanel.addSegment(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.contactEntry").localize()), contactEntries); return segmentedPanel; } /** * Creates and returns the sheet for editing the basic properties - * of a contact. (@see ContactPropertyForm). + * of a contact. (@see GenericContactPropertyForm). * * @param itemModel * @return The sheet for editing the properties of the contact. diff --git a/ccm-cms/src/com/arsdigita/cms/basetypes/ui/ContactPropertyForm.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactPropertyForm.java similarity index 68% rename from ccm-cms/src/com/arsdigita/cms/basetypes/ui/ContactPropertyForm.java rename to ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactPropertyForm.java index fee7f34b2..0e4cc8475 100644 --- a/ccm-cms/src/com/arsdigita/cms/basetypes/ui/ContactPropertyForm.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactPropertyForm.java @@ -1,4 +1,4 @@ -package com.arsdigita.cms.basetypes.ui; +package com.arsdigita.cms.contenttypes.ui; import com.arsdigita.bebop.FormProcessException; import com.arsdigita.cms.ui.authoring.BasicPageForm; @@ -8,22 +8,22 @@ 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.basetypes.Contact; +import com.arsdigita.cms.contenttypes.GenericContact; import org.apache.log4j.Logger; /** * Form for editing the basic properties of a basic contact. */ -public class ContactPropertyForm extends BasicPageForm implements FormProcessListener, FormInitListener, FormSubmissionListener { +public class GenericContactPropertyForm extends BasicPageForm implements FormProcessListener, FormInitListener, FormSubmissionListener { - private static final Logger logger = Logger.getLogger(ContactPropertyForm.class); + private static final Logger logger = Logger.getLogger(GenericContactPropertyForm.class); - private ContactPropertiesStep m_step; + private GenericContactPropertiesStep m_step; - public static final String PERSON = Contact.PERSON; - public static final String ADRESS = Contact.ADDRESS; - public static final String CONTACT_ENTRIES= Contact.CONTACT_ENTRIES; + public static final String PERSON = GenericContact.PERSON; + public static final String ADRESS = GenericContact.ADDRESS; + public static final String CONTACT_ENTRIES= GenericContact.CONTACT_ENTRIES; /** * ID of the form @@ -35,7 +35,7 @@ public class ContactPropertyForm extends BasicPageForm implements FormProcessLis * * @param itemModel */ - public ContactPropertyForm(ItemSelectionModel itemModel) { + public GenericContactPropertyForm(ItemSelectionModel itemModel) { this(itemModel, null); } @@ -45,7 +45,7 @@ public class ContactPropertyForm extends BasicPageForm implements FormProcessLis * @param itemModel * @param step */ - public ContactPropertyForm(ItemSelectionModel itemModel, ContactPropertiesStep step) { + public GenericContactPropertyForm(ItemSelectionModel itemModel, GenericContactPropertiesStep step) { super(ID, itemModel); m_step = step; addSubmissionListener(this); @@ -56,7 +56,7 @@ public class ContactPropertyForm extends BasicPageForm implements FormProcessLis super.addWidgets(); /* - add(new Label((String)BaseContactGlobalizationUtil.globalize("cms.basetypes.ui.contact.basic_properties.description").localize()))); + add(new Label((String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.contact.basic_properties.description").localize()))); TextArea description = new TextArea(DESCRIPTION); description.setRows(5); description.setCols(30); @@ -67,7 +67,7 @@ public class ContactPropertyForm extends BasicPageForm implements FormProcessLis @Override public void init(FormSectionEvent e) throws FormProcessException { FormData data = e.getFormData(); - Contact contact = (Contact)super.initBasicWidgets(e); + GenericContact contact = (GenericContact)super.initBasicWidgets(e); // data.put(DESCRIPTION, contact.getDescription()); } @@ -76,7 +76,7 @@ public class ContactPropertyForm extends BasicPageForm implements FormProcessLis public void process(FormSectionEvent e) throws FormProcessException { FormData data = e.getFormData(); - Contact contact = (Contact)super.processBasicWidgets(e); + GenericContact contact = (GenericContact)super.processBasicWidgets(e); if((contact != null) && (getSaveCancelSection().getSaveButton().isSelected(e.getPageState()))) { // contact.setDescription((String)data.get(DESCRIPTION)); diff --git a/ccm-cms/src/com/arsdigita/cms/basetypes/ui/PersonPropertiesStep.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonPropertiesStep.java similarity index 70% rename from ccm-cms/src/com/arsdigita/cms/basetypes/ui/PersonPropertiesStep.java rename to ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonPropertiesStep.java index 2ddbb4517..a32b0ee51 100644 --- a/ccm-cms/src/com/arsdigita/cms/basetypes/ui/PersonPropertiesStep.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonPropertiesStep.java @@ -16,14 +16,14 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ -package com.arsdigita.cms.basetypes.ui; +package com.arsdigita.cms.contenttypes.ui; import com.arsdigita.bebop.Component; import com.arsdigita.bebop.PageState; import com.arsdigita.cms.ContentPage; import com.arsdigita.cms.ContentSection; import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.basetypes.Person; +import com.arsdigita.cms.contenttypes.GenericPerson; import com.arsdigita.domain.DomainObject; import com.arsdigita.toolbox.ui.DomainObjectPropertySheet; import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; @@ -31,14 +31,14 @@ import com.arsdigita.cms.ui.authoring.BasicPageForm; import com.arsdigita.cms.ui.authoring.SimpleEditStep; import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; -import com.arsdigita.cms.basetypes.util.BasetypesGlobalizationUtil; +import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil; import java.text.DateFormat; -public class PersonPropertiesStep extends SimpleEditStep { +public class GenericPersonPropertiesStep extends SimpleEditStep { public static final String EDIT_SHEET_NAME = "edit"; - public PersonPropertiesStep(ItemSelectionModel itemModel, + public GenericPersonPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent) { super(itemModel, parent); @@ -50,20 +50,20 @@ public class PersonPropertiesStep extends SimpleEditStep { protected void createEditSheet(ItemSelectionModel itemModel) { BasicPageForm editSheet; - editSheet = new PersonPropertyForm(itemModel, this); + editSheet = new GenericPersonPropertyForm(itemModel, this); add(EDIT_SHEET_NAME, "Edit", new WorkflowLockedComponentAccess(editSheet, itemModel), editSheet.getSaveCancelSection().getCancelButton()); } public static Component getPersonPropertySheet(ItemSelectionModel itemModel) { DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(itemModel); - sheet.add((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.person.surname").localize(), Person.SURNAME); - sheet.add((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.person.givenname").localize(), Person.GIVENNAME); - sheet.add((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.person.titlepre").localize(), Person.TITLEPRE); - sheet.add((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.person.titlepost").localize(), Person.TITLEPOST); + sheet.add((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.surname").localize(), GenericPerson.SURNAME); + sheet.add((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.givenname").localize(), GenericPerson.GIVENNAME); + sheet.add((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.titlepre").localize(), GenericPerson.TITLEPRE); + sheet.add((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.titlepost").localize(), GenericPerson.TITLEPOST); if (!ContentSection.getConfig().getHideLaunchDate()) { - sheet.add((String) BasetypesGlobalizationUtil.globalize("cms.ui.authoring.page_launch_date").localize(), + sheet.add((String) ContenttypesGlobalizationUtil.globalize("cms.ui.authoring.page_launch_date").localize(), ContentPage.LAUNCH_DATE, new DomainObjectPropertySheet.AttributeFormatter() { @@ -74,7 +74,7 @@ public class PersonPropertiesStep extends SimpleEditStep { if (page.getLaunchDate() != null) { return DateFormat.getDateInstance(DateFormat.LONG).format(page.getLaunchDate()); } else { - return (String) BasetypesGlobalizationUtil.globalize("cms.ui.unknown").localize(); + return (String) ContenttypesGlobalizationUtil.globalize("cms.ui.unknown").localize(); } } }); diff --git a/ccm-cms/src/com/arsdigita/cms/basetypes/ui/PersonPropertyForm.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonPropertyForm.java similarity index 68% rename from ccm-cms/src/com/arsdigita/cms/basetypes/ui/PersonPropertyForm.java rename to ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonPropertyForm.java index 9b088f966..a5cd31e87 100644 --- a/ccm-cms/src/com/arsdigita/cms/basetypes/ui/PersonPropertyForm.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonPropertyForm.java @@ -17,7 +17,7 @@ * */ -package com.arsdigita.cms.basetypes.ui; +package com.arsdigita.cms.contenttypes.ui; import com.arsdigita.bebop.FormData; import com.arsdigita.bebop.Label; @@ -29,8 +29,8 @@ import com.arsdigita.bebop.form.TextField; import com.arsdigita.bebop.parameters.ParameterModel; import com.arsdigita.bebop.parameters.StringParameter; import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.basetypes.Person; -import com.arsdigita.cms.basetypes.util.BasetypesGlobalizationUtil; +import com.arsdigita.cms.contenttypes.GenericPerson; +import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil; import com.arsdigita.cms.ui.authoring.BasicPageForm; import org.apache.log4j.Logger; @@ -39,24 +39,24 @@ import org.apache.log4j.Logger; * * @author: Jens Pelzetter */ -public class PersonPropertyForm extends BasicPageForm implements FormProcessListener, FormInitListener, FormSubmissionListener { - private static final Logger s_log = Logger.getLogger(PersonPropertyForm.class); +public class GenericPersonPropertyForm extends BasicPageForm implements FormProcessListener, FormInitListener, FormSubmissionListener { + private static final Logger s_log = Logger.getLogger(GenericPersonPropertyForm.class); - private PersonPropertiesStep m_step; + private GenericPersonPropertiesStep m_step; - public static final String PERSON = Person.PERSON; - public static final String SURNAME = Person.SURNAME; - public static final String GIVENNAME = Person.GIVENNAME; - public static final String TITLEPRE = Person.TITLEPRE; - public static final String TITLEPOST = Person.TITLEPOST; + public static final String PERSON = GenericPerson.PERSON; + public static final String SURNAME = GenericPerson.SURNAME; + public static final String GIVENNAME = GenericPerson.GIVENNAME; + public static final String TITLEPRE = GenericPerson.TITLEPRE; + public static final String TITLEPOST = GenericPerson.TITLEPOST; public static final String ID = "Person_edit"; - public PersonPropertyForm(ItemSelectionModel itemModel) { + public GenericPersonPropertyForm(ItemSelectionModel itemModel) { this(itemModel,null); } - public PersonPropertyForm(ItemSelectionModel itemModel, PersonPropertiesStep step) { + public GenericPersonPropertyForm(ItemSelectionModel itemModel, GenericPersonPropertiesStep step) { super(ID, itemModel); m_step = step; addSubmissionListener (this); @@ -66,22 +66,22 @@ public class PersonPropertyForm extends BasicPageForm implements FormProcessList protected void addWidgets() { super.addWidgets (); - add(new Label((String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.person.surname").localize())); + add(new Label((String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.surname").localize())); ParameterModel surnameParam = new StringParameter(SURNAME); TextField surname = new TextField (surnameParam); add(surname); - add(new Label((String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.person.givenname").localize())); + add(new Label((String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.givenname").localize())); ParameterModel givennameParam = new StringParameter(GIVENNAME); TextField givenname = new TextField (givennameParam); add(givenname); - add(new Label((String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.person.titlepre").localize())); + add(new Label((String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.titlepre").localize())); ParameterModel titlepreParam = new StringParameter(TITLEPRE); TextField titlepre = new TextField (titlepreParam); add(titlepre); - add(new Label((String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.person.titlepost").localize())); + add(new Label((String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.titlepost").localize())); ParameterModel titlepostParam = new StringParameter(TITLEPOST); TextField titlepost = new TextField (titlepostParam); add(titlepost); @@ -89,7 +89,7 @@ public class PersonPropertyForm extends BasicPageForm implements FormProcessList public void init(FormSectionEvent fse) { FormData data = fse.getFormData(); - Person person = (Person)super.initBasicWidgets(fse); + GenericPerson person = (GenericPerson)super.initBasicWidgets(fse); data.put(SURNAME,person.getSurname()); data.put(GIVENNAME, person.getGivenName()); @@ -107,7 +107,7 @@ public class PersonPropertyForm extends BasicPageForm implements FormProcessList public void process(FormSectionEvent fse) { FormData data = fse.getFormData(); - Person person = (Person)super.processBasicWidgets(fse); + GenericPerson person = (GenericPerson)super.processBasicWidgets(fse); if (person != null && getSaveCancelSection().getSaveButton().isSelected(fse.getPageState())) { diff --git a/ccm-cms/src/com/arsdigita/cms/basetypes/util/BasetypesGlobalizationUtil.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/util/ContenttypesGlobalizationUtil.java similarity index 88% rename from ccm-cms/src/com/arsdigita/cms/basetypes/util/BasetypesGlobalizationUtil.java rename to ccm-cms/src/com/arsdigita/cms/contenttypes/util/ContenttypesGlobalizationUtil.java index 3cd5fe277..f9173e754 100644 --- a/ccm-cms/src/com/arsdigita/cms/basetypes/util/BasetypesGlobalizationUtil.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/util/ContenttypesGlobalizationUtil.java @@ -17,13 +17,13 @@ * */ -package com.arsdigita.cms.basetypes.util; +package com.arsdigita.cms.contenttypes.util; import com.arsdigita.globalization.GlobalizedMessage; -public class BasetypesGlobalizationUtil { +public class ContenttypesGlobalizationUtil { final public static String BUNDLE_NAME = - "com.arsdigita.cms.basetypes.util.BasetypesResourceBundle"; + "com.arsdigita.cms.contenttypes.util.BasetypesResourceBundle"; public static GlobalizedMessage globalize (String key) { return new GlobalizedMessage(key, BUNDLE_NAME); diff --git a/ccm-cms/src/com/arsdigita/cms/basetypes/util/BasetypesResourceBundle.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/util/ContenttypesResourceBundle.java similarity index 83% rename from ccm-cms/src/com/arsdigita/cms/basetypes/util/BasetypesResourceBundle.java rename to ccm-cms/src/com/arsdigita/cms/contenttypes/util/ContenttypesResourceBundle.java index 60d8af180..ee244baec 100644 --- a/ccm-cms/src/com/arsdigita/cms/basetypes/util/BasetypesResourceBundle.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/util/ContenttypesResourceBundle.java @@ -17,17 +17,17 @@ * */ -package com.arsdigita.cms.basetypes.util; +package com.arsdigita.cms.contenttypes.util; import java.util.PropertyResourceBundle; import com.arsdigita.globalization.ChainedResourceBundle; import com.arsdigita.cms.CMSGlobalized; -public class BasetypesResourceBundle extends ChainedResourceBundle implements CMSGlobalized { +public class ContenttypesResourceBundle extends ChainedResourceBundle implements CMSGlobalized { public static final String MEMBER_BUNDLE_NAME = - "com.arsdigita.cms.basetypes.BasetypesResources"; + "com.arsdigita.cms.contenttypes.BasetypesResources"; - public BasetypesResourceBundle() { + public ContenttypesResourceBundle() { super(); addBundle((PropertyResourceBundle)getBundle(MEMBER_BUNDLE_NAME)); addBundle((PropertyResourceBundle)getBundle(BUNDLE_NAME)); diff --git a/ccm-cms/src/com/arsdigita/cms/dispatcher/StreamImage.java b/ccm-cms/src/com/arsdigita/cms/dispatcher/StreamImage.java index a7a4a6205..e98911b3f 100755 --- a/ccm-cms/src/com/arsdigita/cms/dispatcher/StreamImage.java +++ b/ccm-cms/src/com/arsdigita/cms/dispatcher/StreamImage.java @@ -19,7 +19,7 @@ package com.arsdigita.cms.dispatcher; import com.arsdigita.bebop.parameters.BigDecimalParameter; -import com.arsdigita.cms.basetypes.Article; +import com.arsdigita.cms.contenttypes.GenericArticle; import com.arsdigita.cms.ImageAsset; import com.arsdigita.cms.ImageAssetCollection; import com.arsdigita.cms.util.GlobalizationUtil; @@ -121,7 +121,7 @@ public class StreamImage extends ResourceHandlerImpl { oid = new OID(ImageAsset.BASE_DATA_OBJECT_TYPE, imageId); } Transaction transaction = null; - Article article = null; + GenericArticle article = null; // XXX: add back rollback /*if (transactionID != null) { try { @@ -129,7 +129,7 @@ public class StreamImage extends ResourceHandlerImpl { new Transaction(transactionID); // we have a transaction so let's see if we have an article if (objectID != null) { - article = new Article(objectID); + article = new GenericArticle(objectID); article.rollBackTo(transaction); } } catch (DataObjectNotFoundException e) { diff --git a/ccm-cms/src/com/arsdigita/cms/enterprise.init b/ccm-cms/src/com/arsdigita/cms/enterprise.init index 2e5547336..dec46a07d 100755 --- a/ccm-cms/src/com/arsdigita/cms/enterprise.init +++ b/ccm-cms/src/com/arsdigita/cms/enterprise.init @@ -11,10 +11,10 @@ init com.arsdigita.cms.installer.Initializer { init com.arsdigita.cms.installer.xml.ContentTypeInitializer { contentTypes = { - "/WEB-INF/basetypes/Address.xml", - "/WEB-INF/basetypes/Article.xml", - "/WEB-INF/basetypes/Contact.xml", - "/WEB-INF/basetypes/Person.xml", + "/WEB-INF/content-types/GenericAddress.xml", + "/WEB-INF/content-types/GenericArticle.xml", + "/WEB-INF/content-types/GenericContact.xml", + "/WEB-INF/content-types/GenericPerson.xml", "/WEB-INF/content-types/Template.xml" }; } diff --git a/ccm-cms/src/com/arsdigita/cms/ui/ArticleImageDisplay.java b/ccm-cms/src/com/arsdigita/cms/ui/ArticleImageDisplay.java index 2c8a57999..dddbbe383 100755 --- a/ccm-cms/src/com/arsdigita/cms/ui/ArticleImageDisplay.java +++ b/ccm-cms/src/com/arsdigita/cms/ui/ArticleImageDisplay.java @@ -19,7 +19,7 @@ package com.arsdigita.cms.ui; import com.arsdigita.bebop.PageState; -import com.arsdigita.cms.basetypes.Article; +import com.arsdigita.cms.contenttypes.GenericArticle; import com.arsdigita.cms.ImageAsset; import com.arsdigita.cms.ItemSelectionModel; import com.arsdigita.util.Assert; @@ -28,7 +28,7 @@ import com.arsdigita.xml.Element; /** * Extends {@link ImageDisplay} to display the first - * (according to the order attribute) image associated with an {@link Article} + * (according to the order attribute) image associated with an {@link GenericArticle} * The typical usage for this component is *
ArticleImageDisplay d = new ArticleImageDisplay(myItemSelectionModel, false);
*

@@ -47,7 +47,7 @@ public class ArticleImageDisplay extends ImageDisplay { * Construct a new ArticleImageDisplay * * @param article the {@link ItemSelectionModel} which - * supplies the {@link Article} + * supplies the {@link GenericArticle} * * @param assets the {@link ItemSelectionModel} which * supplies the {@link ImageAsset} for the article; it is @@ -74,9 +74,9 @@ public class ArticleImageDisplay extends ImageDisplay { * @return the currently selected article * @post ( return != null ) */ - protected Article getArticle(PageState state) { - Article article = (Article) m_article.getSelectedObject(state); - Assert.exists(article, "Article"); + protected GenericArticle getArticle(PageState state) { + GenericArticle article = (GenericArticle) m_article.getSelectedObject(state); + Assert.exists(article, "GenericArticle"); return article; } @@ -89,7 +89,7 @@ public class ArticleImageDisplay extends ImageDisplay { super.generateImagePropertiesXML(image, state, element); - Article article = getArticle(state); + GenericArticle article = getArticle(state); String caption = article.getCaption(image); if ( caption != null ) { element.addAttribute("caption", caption); diff --git a/ccm-cms/src/com/arsdigita/cms/ui/ImageBrowser.java b/ccm-cms/src/com/arsdigita/cms/ui/ImageBrowser.java index f114765e8..d84cc3af7 100755 --- a/ccm-cms/src/com/arsdigita/cms/ui/ImageBrowser.java +++ b/ccm-cms/src/com/arsdigita/cms/ui/ImageBrowser.java @@ -30,7 +30,7 @@ import com.arsdigita.bebop.table.DefaultTableCellRenderer; import com.arsdigita.bebop.table.TableCellRenderer; import com.arsdigita.bebop.table.TableModel; import com.arsdigita.bebop.table.TableModelBuilder; -import com.arsdigita.cms.basetypes.ArticleImageAssociation; +import com.arsdigita.cms.contenttypes.GenericArticleImageAssociation; import com.arsdigita.cms.ImageAsset; import com.arsdigita.cms.SecurityManager; import com.arsdigita.cms.dispatcher.Utilities; @@ -208,7 +208,7 @@ public class ImageBrowser extends Table { try { ImageAsset asset = (ImageAsset) DomainObjectFactory.newInstance (new OID(ImageAsset.BASE_DATA_OBJECT_TYPE,(BigDecimal) key)); - if (!ArticleImageAssociation.imageHasAssociation(asset)) { + if (!GenericArticleImageAssociation.imageHasAssociation(asset)) { canDelete = true; } } catch (DataObjectNotFoundException e) { diff --git a/ccm-cms/src/com/arsdigita/cms/ui/SingleImageSelectionModel.java b/ccm-cms/src/com/arsdigita/cms/ui/SingleImageSelectionModel.java index a9bf693bb..a1218a34d 100755 --- a/ccm-cms/src/com/arsdigita/cms/ui/SingleImageSelectionModel.java +++ b/ccm-cms/src/com/arsdigita/cms/ui/SingleImageSelectionModel.java @@ -22,7 +22,7 @@ import com.arsdigita.bebop.PageState; import com.arsdigita.bebop.ParameterSingleSelectionModel; import com.arsdigita.bebop.SingleSelectionModel; import com.arsdigita.bebop.parameters.BigDecimalParameter; -import com.arsdigita.cms.basetypes.Article; +import com.arsdigita.cms.contenttypes.GenericArticle; import com.arsdigita.cms.ImageAsset; import com.arsdigita.cms.ImageAssetCollection; import com.arsdigita.cms.ItemSelectionModel; @@ -120,10 +120,10 @@ public class SingleImageSelectionModel extends ItemSelectionModel { // Load the object from the item. com.arsdigita.cms.ContentItem temp = (com.arsdigita.cms.ContentItem)m_articleModel.getSelectedObject(state); - Article item = null; + GenericArticle item = null; if ( temp != null ) { item = - (Article) com.arsdigita.cms.ACSObjectFactory.castContentItem(temp); + (GenericArticle) com.arsdigita.cms.ACSObjectFactory.castContentItem(temp); } if ( item != null ) { ImageAssetCollection images = item.getImages(); diff --git a/ccm-cms/src/com/arsdigita/cms/ui/authoring/ArticleImage.java b/ccm-cms/src/com/arsdigita/cms/ui/authoring/ArticleImage.java index 18d41cd7d..8768bbe1a 100755 --- a/ccm-cms/src/com/arsdigita/cms/ui/authoring/ArticleImage.java +++ b/ccm-cms/src/com/arsdigita/cms/ui/authoring/ArticleImage.java @@ -32,7 +32,7 @@ import com.arsdigita.bebop.event.FormSectionEvent; import com.arsdigita.bebop.event.FormSubmissionListener; import com.arsdigita.bebop.parameters.BigDecimalParameter; import com.arsdigita.bebop.parameters.StringParameter; -import com.arsdigita.cms.basetypes.Article; +import com.arsdigita.cms.contenttypes.GenericArticle; import com.arsdigita.cms.ImageAsset; import com.arsdigita.cms.ImageAssetCollection; import com.arsdigita.cms.ItemSelectionModel; @@ -180,7 +180,7 @@ public class ArticleImage extends SimpleContainer implements AuthoringStepCompon PageState state = event.getPageState(); // get the image fresh from the db each time this component displays; // otherwise rollback doesn't appear to work on this pane - Article art = (Article)(m_article.getSelectedObject(state)); + GenericArticle art = (GenericArticle)(m_article.getSelectedObject(state)); ImageAssetCollection col = art.getImages(); ImageAsset img = null; if (col.next()) { @@ -366,7 +366,7 @@ public class ArticleImage extends SimpleContainer implements AuthoringStepCompon public void actionPerformed(ActionEvent event) { PageState state = event.getPageState(); ImageAsset img = getImageAsset(state); - Article articleTarget = getArticle(state); + GenericArticle articleTarget = getArticle(state); articleTarget.removeImage(img); articleTarget.save(); m_assetsWithImage.setSelectedObject(state, null); @@ -419,9 +419,9 @@ public class ArticleImage extends SimpleContainer implements AuthoringStepCompon return image; } - private Article getArticle(PageState state) { - Article article = (Article) m_articleWithImage.getSelectedObject(state); - Assert.exists(article, "Article"); + private GenericArticle getArticle(PageState state) { + GenericArticle article = (GenericArticle) m_articleWithImage.getSelectedObject(state); + Assert.exists(article, "GenericArticle"); return article; } diff --git a/ccm-cms/src/com/arsdigita/cms/ui/authoring/ArticleImageChooser.java b/ccm-cms/src/com/arsdigita/cms/ui/authoring/ArticleImageChooser.java index b881a6898..674dc93a2 100755 --- a/ccm-cms/src/com/arsdigita/cms/ui/authoring/ArticleImageChooser.java +++ b/ccm-cms/src/com/arsdigita/cms/ui/authoring/ArticleImageChooser.java @@ -27,7 +27,7 @@ import com.arsdigita.bebop.event.FormProcessListener; import com.arsdigita.bebop.event.FormSectionEvent; import com.arsdigita.bebop.event.FormSubmissionListener; import com.arsdigita.bebop.parameters.BigDecimalParameter; -import com.arsdigita.cms.basetypes.ArticleImageAssociation; +import com.arsdigita.cms.contenttypes.GenericArticleImageAssociation; import com.arsdigita.cms.ContentItem; import com.arsdigita.cms.ContentType; import com.arsdigita.cms.ImageAsset; @@ -172,7 +172,7 @@ public class ArticleImageChooser extends SimpleContainer { try { ImageAsset asset = (ImageAsset) DomainObjectFactory.newInstance (new OID(ImageAsset.BASE_DATA_OBJECT_TYPE,imageId)); - if (!ArticleImageAssociation.imageHasAssociation(asset)) { + if (!GenericArticleImageAssociation.imageHasAssociation(asset)) { asset.setLive(null); ItemCollection pendingVersions = asset.getPendingVersions(); while(pendingVersions.next()) { diff --git a/ccm-cms/src/com/arsdigita/cms/ui/authoring/BasicImageForm.java b/ccm-cms/src/com/arsdigita/cms/ui/authoring/BasicImageForm.java index d212b9976..3d31de768 100755 --- a/ccm-cms/src/com/arsdigita/cms/ui/authoring/BasicImageForm.java +++ b/ccm-cms/src/com/arsdigita/cms/ui/authoring/BasicImageForm.java @@ -32,7 +32,7 @@ import com.arsdigita.bebop.event.FormSectionEvent; import com.arsdigita.bebop.form.TextField; import com.arsdigita.bebop.parameters.NotNullValidationListener; import com.arsdigita.bebop.parameters.StringParameter; -import com.arsdigita.cms.basetypes.Article; +import com.arsdigita.cms.contenttypes.GenericArticle; import com.arsdigita.cms.ImageAsset; import com.arsdigita.cms.ItemSelectionModel; import com.arsdigita.cms.util.GlobalizationUtil; @@ -125,7 +125,7 @@ public abstract class BasicImageForm extends Form FormData data = e.getFormData(); PageState state = e.getPageState(); - Article item = getArticle(state); + GenericArticle item = getArticle(state); ImageAsset asset = getImageAsset(state); if(item != null && asset != null) { @@ -145,7 +145,7 @@ public abstract class BasicImageForm extends Form FormData data = e.getFormData(); PageState state = e.getPageState(); - Article item = getArticle(state); + GenericArticle item = getArticle(state); ImageAsset asset = getImageAsset(state); if(item != null && asset != null) { @@ -178,8 +178,8 @@ public abstract class BasicImageForm extends Form * @param state The page state * @return the currently selected item */ - public Article getArticle(PageState state) { - return (Article)m_itemModel.getSelectedObject(state); + public GenericArticle getArticle(PageState state) { + return (GenericArticle)m_itemModel.getSelectedObject(state); } /** diff --git a/ccm-cms/src/com/arsdigita/cms/ui/authoring/ImagePropertiesForm.java b/ccm-cms/src/com/arsdigita/cms/ui/authoring/ImagePropertiesForm.java index 146bed8a9..e1eb8a6c4 100755 --- a/ccm-cms/src/com/arsdigita/cms/ui/authoring/ImagePropertiesForm.java +++ b/ccm-cms/src/com/arsdigita/cms/ui/authoring/ImagePropertiesForm.java @@ -23,7 +23,7 @@ import com.arsdigita.bebop.FormData; import com.arsdigita.bebop.FormProcessException; import com.arsdigita.bebop.PageState; import com.arsdigita.bebop.event.FormSectionEvent; -import com.arsdigita.cms.basetypes.Article; +import com.arsdigita.cms.contenttypes.GenericArticle; import com.arsdigita.cms.ImageAsset; import com.arsdigita.cms.ItemSelectionModel; import com.arsdigita.cms.util.GlobalizationUtil; @@ -56,7 +56,7 @@ public class ImagePropertiesForm extends BasicImageForm { public void init(FormSectionEvent e) throws FormProcessException { FormData data = e.getFormData(); PageState state = e.getPageState(); - Article item = this.getArticle(state); + GenericArticle item = this.getArticle(state); ImageAsset asset = this.getImageAsset(state); if ( asset == null ) { @@ -70,7 +70,7 @@ public class ImagePropertiesForm extends BasicImageForm { public void process(FormSectionEvent e) throws FormProcessException { FormData data = e.getFormData(); PageState state = e.getPageState(); - Article item = this.getArticle(state); + GenericArticle item = this.getArticle(state); ImageAsset asset = this.getImageAsset(state); if ( asset == null ) { diff --git a/ccm-cms/src/com/arsdigita/cms/ui/authoring/ImageSelectionForm.java b/ccm-cms/src/com/arsdigita/cms/ui/authoring/ImageSelectionForm.java index 5b193bf61..0344b0cac 100755 --- a/ccm-cms/src/com/arsdigita/cms/ui/authoring/ImageSelectionForm.java +++ b/ccm-cms/src/com/arsdigita/cms/ui/authoring/ImageSelectionForm.java @@ -23,7 +23,7 @@ import com.arsdigita.bebop.FormData; import com.arsdigita.bebop.FormProcessException; import com.arsdigita.bebop.PageState; import com.arsdigita.bebop.event.FormSectionEvent; -import com.arsdigita.cms.basetypes.Article; +import com.arsdigita.cms.contenttypes.GenericArticle; import com.arsdigita.cms.ImageAsset; import com.arsdigita.cms.ItemSelectionModel; import com.arsdigita.cms.ui.ImageDisplay; @@ -73,7 +73,7 @@ public class ImageSelectionForm extends BasicImageForm { s_log.debug("Selecting Image"); FormData data = e.getFormData(); PageState state = e.getPageState(); - Article item = this.getArticle(state); + GenericArticle item = this.getArticle(state); ImageAsset a = this.getImageAsset(state); if(a != null) { diff --git a/ccm-cms/src/com/arsdigita/cms/ui/authoring/ImageUploadForm.java b/ccm-cms/src/com/arsdigita/cms/ui/authoring/ImageUploadForm.java index a5e125590..0322dba1e 100755 --- a/ccm-cms/src/com/arsdigita/cms/ui/authoring/ImageUploadForm.java +++ b/ccm-cms/src/com/arsdigita/cms/ui/authoring/ImageUploadForm.java @@ -26,7 +26,7 @@ import com.arsdigita.bebop.PageState; import com.arsdigita.bebop.event.FormSectionEvent; import com.arsdigita.bebop.event.FormSubmissionListener; import com.arsdigita.bebop.parameters.NotNullValidationListener; -import com.arsdigita.cms.basetypes.Article; +import com.arsdigita.cms.contenttypes.GenericArticle; import com.arsdigita.cms.ImageAsset; import com.arsdigita.cms.ItemSelectionModel; import com.arsdigita.cms.ReusableImageAsset; @@ -117,7 +117,7 @@ public class ImageUploadForm extends BasicImageForm implements FormSubmissionLis FormData data = event.getFormData(); PageState state = event.getPageState(); - Article item = this.getArticle(state); + GenericArticle item = this.getArticle(state); ImageAsset a = null; try { diff --git a/ccm-core/src/com/arsdigita/persistence/CompoundFilterImpl.java b/ccm-core/src/com/arsdigita/persistence/CompoundFilterImpl.java index 50119bf74..1ddb8db6a 100755 --- a/ccm-core/src/com/arsdigita/persistence/CompoundFilterImpl.java +++ b/ccm-core/src/com/arsdigita/persistence/CompoundFilterImpl.java @@ -67,7 +67,7 @@ class CompoundFilterImpl extends FilterImpl implements CompoundFilter { /** - * Creates a filter that will AND together all filters passed in to it + * Creates a filter that will OR together all filters passed in to it * For instance, if developers want to combine two filters in to one, * they can write *