diff --git a/ccm-ldn-types-contact/.svnignore b/ccm-ldn-types-contact/.svnignore new file mode 100755 index 000000000..378eac25d --- /dev/null +++ b/ccm-ldn-types-contact/.svnignore @@ -0,0 +1 @@ +build diff --git a/ccm-ldn-types-contact/application.xml b/ccm-ldn-types-contact/application.xml new file mode 100755 index 000000000..ceaf74bad --- /dev/null +++ b/ccm-ldn-types-contact/application.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + The London Contact Content Type for the Red Hat CCM CMS. + + diff --git a/ccm-ldn-types-contact/pdl/com/arsdigita/content-types/Contact.pdl b/ccm-ldn-types-contact/pdl/com/arsdigita/content-types/Contact.pdl new file mode 100755 index 000000000..973f73dbe --- /dev/null +++ b/ccm-ldn-types-contact/pdl/com/arsdigita/content-types/Contact.pdl @@ -0,0 +1,88 @@ +// +// Copyright (C) 2004 Red Hat Inc. All Rights Reserved. +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation; either version 2.1 of +// the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// $Id: Contact.pdl 1689 2007-10-26 11:06:23Z chrisg23 $ +// $DateTime: 2004/08/17 23:15:09 $ +model com.arsdigita.cms.contenttypes; + +import com.arsdigita.cms.ContentPage; +import com.arsdigita.cms.ContentItem; + +// object type to hold Contact content type +object type Contact extends ContentPage { + + String [0..1] givenName = ct_contacts.given_name VARCHAR(1000); + String [0..1] familyName = ct_contacts.family_name VARCHAR(1000); + String [0..1] suffix = ct_contacts.suffix VARCHAR(100); + String [0..1] emails = ct_contacts.emails VARCHAR(500); + String [0..1] description = ct_contacts.description VARCHAR(2000); + String [0..1] orgName = ct_contacts.orgname VARCHAR(2000); + String [0..1] deptName = ct_contacts.deptname VARCHAR(2000); + String [0..1] role = ct_contacts.role VARCHAR(2000); + // type of contact e.g. Enquiry,Complaint etc... + ContactType [0..1] contactType = join ct_contacts.type_id + to ct_contact_types.type_id; + component ContactAddress [0..1] contactAddress = join ct_contacts.address_id + to ct_contact_address.address_id; + + component ContactPhone [0..n] phones = join ct_contacts.contact_id + to ct_contact_phones.contact_id; + + reference key ( ct_contacts.contact_id ); +} + +association { + Contact[0..1] associatedContactForItem = + join cms_items.item_id to contact_content_item_map.item_id, + join contact_content_item_map.contact_id to ct_contacts.contact_id; + ContentItem[0..n] associatedContentItemsForContact = + join ct_contacts.contact_id to contact_content_item_map.contact_id, + join contact_content_item_map.item_id to cms_items.item_id; + + } + +// the above association works fine for adding but for some strange reason when +// you try to remove an item from the association it also tries to delete it +// so instead you have to use a data operation + +data operation removeContactFromContentItemAssociation { + do { + delete from contact_content_item_map where item_id = :itemID + } +} + +data operation removeContactFromAllAssociations { + do { + delete from contact_content_item_map where contact_id = :contactID + } +} + +query getContactForItem { + BigDecimal contactID; + BigDecimal itemID; + do { + select contact_id, item_id + from + contact_content_item_map + where + item_id = :itemID + } map { + contactID = contact_id; + itemID = item_id; + } +} + diff --git a/ccm-ldn-types-contact/pdl/com/arsdigita/content-types/ContactAddress.pdl b/ccm-ldn-types-contact/pdl/com/arsdigita/content-types/ContactAddress.pdl new file mode 100755 index 000000000..e88e2b573 --- /dev/null +++ b/ccm-ldn-types-contact/pdl/com/arsdigita/content-types/ContactAddress.pdl @@ -0,0 +1,42 @@ +// +// Copyright (C) 2004 Red Hat Inc. All Rights Reserved. +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation; either version 2.1 of +// the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// $Id: ContactAddress.pdl 287 2005-02-22 00:29:02Z sskracic $ +// $DateTime: 2004/08/17 23:15:09 $ +model com.arsdigita.cms.contenttypes; + +import com.arsdigita.cms.ContentItem; + +// object type to hold ContactAddress domain object type + +object type ContactAddress extends ContentItem { + String [0..1] saon = ct_contact_address.saon VARCHAR(2000); + String [1..1] paon = ct_contact_address.paon VARCHAR(2000); + String [1..1] streetDesc = ct_contact_address.street_desc VARCHAR(2000); + String [0..1] streetRefNo = + ct_contact_address.unique_street_ref_no VARCHAR(2000); + String [0..1] locality = ct_contact_address.locality VARCHAR(2000); + String [0..1] town = ct_contact_address.town VARCHAR(1000); + String [0..1] administrativeArea = + ct_contact_address.administrativeArea VARCHAR(2000); + String [0..1] postTown = ct_contact_address.post_town VARCHAR(1000); + String [0..1] postCode = ct_contact_address.post_code VARCHAR(1000); + String [0..1] referenceNo = + ct_contact_address.unique_prop_ref_no VARCHAR(2000); + + reference key ( ct_contact_address.address_id ); +} diff --git a/ccm-ldn-types-contact/pdl/com/arsdigita/content-types/ContactPhone.pdl b/ccm-ldn-types-contact/pdl/com/arsdigita/content-types/ContactPhone.pdl new file mode 100755 index 000000000..465fb0c5c --- /dev/null +++ b/ccm-ldn-types-contact/pdl/com/arsdigita/content-types/ContactPhone.pdl @@ -0,0 +1,31 @@ +// +// Copyright (C) 2004 Red Hat Inc. All Rights Reserved. +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation; either version 2.1 of +// the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// $Id: ContactPhone.pdl 287 2005-02-22 00:29:02Z sskracic $ +// $DateTime: 2004/08/17 23:15:09 $ +model com.arsdigita.cms.contenttypes; + +import com.arsdigita.cms.ContentItem; + +object type ContactPhone extends ContentItem{ + + String [1..1] phoneType = ct_contact_phones.phoneType VARCHAR(100); + String [1..1] phoneNumber = ct_contact_phones.phoneNumber VARCHAR(100); + + reference key ( ct_contact_phones.phone_id ); + +} \ No newline at end of file diff --git a/ccm-ldn-types-contact/pdl/com/arsdigita/content-types/ContactType.pdl b/ccm-ldn-types-contact/pdl/com/arsdigita/content-types/ContactType.pdl new file mode 100755 index 000000000..24e1da3db --- /dev/null +++ b/ccm-ldn-types-contact/pdl/com/arsdigita/content-types/ContactType.pdl @@ -0,0 +1,32 @@ +// +// Copyright (C) 2004 Red Hat Inc. All Rights Reserved. +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation; either version 2.1 of +// the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// $Id: ContactType.pdl 287 2005-02-22 00:29:02Z sskracic $ +// $DateTime: 2004/08/17 23:15:09 $ +model com.arsdigita.cms.contenttypes; + +import com.arsdigita.cms.ContentItem; + +// object type to hold ContactType object type +object type ContactType extends ContentItem { + + String [1..1] typeName = ct_contact_types.type_name VARCHAR(1000); + + reference key ( ct_contact_types.type_id ); + +} + diff --git a/ccm-ldn-types-contact/sql/ccm-ldn-types-contact/default/upgrade/6.5.0-6.5.1/contact_content_item_map_table.sql b/ccm-ldn-types-contact/sql/ccm-ldn-types-contact/default/upgrade/6.5.0-6.5.1/contact_content_item_map_table.sql new file mode 100644 index 000000000..2a50893a4 --- /dev/null +++ b/ccm-ldn-types-contact/sql/ccm-ldn-types-contact/default/upgrade/6.5.0-6.5.1/contact_content_item_map_table.sql @@ -0,0 +1,16 @@ +create table contact_content_item_map ( + item_id INTEGER not null + constraint cont_con_ite_map_ite_i_p_scqe9 + primary key, + -- referential constraint for item_id deferred due to circular dependencies + contact_id INTEGER not null + -- referential constraint for contact_id deferred due to circular dependencies +); + + +alter table contact_content_item_map add + constraint cont_con_ite_map_con_i_f_lanid foreign key (contact_id) + references ct_contacts(contact_id); +alter table contact_content_item_map add + constraint cont_con_ite_map_ite_i_f_fr0po foreign key (item_id) + references cms_items(item_id); diff --git a/ccm-ldn-types-contact/sql/ccm-ldn-types-contact/oracle-se-create.sql b/ccm-ldn-types-contact/sql/ccm-ldn-types-contact/oracle-se-create.sql new file mode 100755 index 000000000..99bc069fa --- /dev/null +++ b/ccm-ldn-types-contact/sql/ccm-ldn-types-contact/oracle-se-create.sql @@ -0,0 +1,22 @@ +-- +-- Copyright (C) 2004 Red Hat Inc. All Rights Reserved. +-- +-- This library is free software; you can redistribute it and/or +-- modify it under the terms of the GNU Lesser General Public License +-- as published by the Free Software Foundation; either version 2.1 of +-- the License, or (at your option) any later version. +-- +-- This library is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +-- Lesser General Public License for more details. +-- +-- You should have received a copy of the GNU Lesser General Public +-- License along with this library; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +-- +-- $Id: oracle-se-create.sql 287 2005-02-22 00:29:02Z sskracic $ +-- $DateTime: 2004/08/17 23:15:09 $ + +@@ ddl/oracle-se/create.sql +@@ ddl/oracle-se/deferred.sql diff --git a/ccm-ldn-types-contact/sql/ccm-ldn-types-contact/postgres-create.sql b/ccm-ldn-types-contact/sql/ccm-ldn-types-contact/postgres-create.sql new file mode 100755 index 000000000..f2689cdf6 --- /dev/null +++ b/ccm-ldn-types-contact/sql/ccm-ldn-types-contact/postgres-create.sql @@ -0,0 +1,23 @@ +-- +-- Copyright (C) 2004 Red Hat Inc. All Rights Reserved. +-- +-- This library is free software; you can redistribute it and/or +-- modify it under the terms of the GNU Lesser General Public License +-- as published by the Free Software Foundation; either version 2.1 of +-- the License, or (at your option) any later version. +-- +-- This library is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +-- Lesser General Public License for more details. +-- +-- You should have received a copy of the GNU Lesser General Public +-- License along with this library; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +-- +-- $Id: postgres-create.sql 287 2005-02-22 00:29:02Z sskracic $ +-- $DateTime: 2004/08/17 23:15:09 $ + +\i ddl/postgres/create.sql +\i ddl/postgres/deferred.sql + diff --git a/ccm-ldn-types-contact/sql/ccm-ldn-types-contact/upgrade/oracle-se-6.5.0-6.5.1.sql b/ccm-ldn-types-contact/sql/ccm-ldn-types-contact/upgrade/oracle-se-6.5.0-6.5.1.sql new file mode 100644 index 000000000..7e67195c5 --- /dev/null +++ b/ccm-ldn-types-contact/sql/ccm-ldn-types-contact/upgrade/oracle-se-6.5.0-6.5.1.sql @@ -0,0 +1,19 @@ +-- +-- Copyright (C) 2007 Magpie. All Rights Reserved. +-- +-- This library is free software; you can redistribute it and/or +-- modify it under the terms of the GNU Lesser General Public License +-- as published by the Free Software Foundation; either version 2.1 of +-- the License, or (at your option) any later version. +-- +-- This library is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +-- Lesser General Public License for more details. +-- +-- You should have received a copy of the GNU Lesser General Public +-- License along with this library; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +-- + +@@ ../default/upgrade/6.5.0-6.5.1/contact_content_item_map_table.sql \ No newline at end of file diff --git a/ccm-ldn-types-contact/sql/ccm-ldn-types-contact/upgrade/postgres-6.5.0-6.5.1.sql b/ccm-ldn-types-contact/sql/ccm-ldn-types-contact/upgrade/postgres-6.5.0-6.5.1.sql new file mode 100644 index 000000000..0081706fd --- /dev/null +++ b/ccm-ldn-types-contact/sql/ccm-ldn-types-contact/upgrade/postgres-6.5.0-6.5.1.sql @@ -0,0 +1,21 @@ +-- +-- Copyright (C) 2007 Magpie. All Rights Reserved. +-- +-- The contents of this file are subject to the CCM Public +-- License (the "License"); you may not use this file except in +-- compliance with the License. You may obtain a copy of the +-- License at http://www.redhat.com/licenses/ccmpl.html. +-- +-- Software distributed under the License is distributed on an +-- "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express +-- or implied. See the License for the specific language governing +-- rights and limitations under the License. +-- + +\echo Red Hat Enterprise CMS 6.5.0 -> 6.5.1 Upgrade Script (PostgreSQL) + +begin; + +\i ../default/upgrade/6.5.0-6.5.1/contact_content_item_map_table.sql + +commit; diff --git a/ccm-ldn-types-contact/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Contact.xml b/ccm-ldn-types-contact/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Contact.xml new file mode 100755 index 000000000..023aac643 --- /dev/null +++ b/ccm-ldn-types-contact/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Contact.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + diff --git a/ccm-ldn-types-contact/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/Contact.xml b/ccm-ldn-types-contact/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/Contact.xml new file mode 100755 index 000000000..a7d2f7d76 --- /dev/null +++ b/ccm-ldn-types-contact/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/Contact.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + diff --git a/ccm-ldn-types-contact/src/ccm-ldn-types-contact.config b/ccm-ldn-types-contact/src/ccm-ldn-types-contact.config new file mode 100755 index 000000000..adfdba100 --- /dev/null +++ b/ccm-ldn-types-contact/src/ccm-ldn-types-contact.config @@ -0,0 +1,4 @@ + + + + diff --git a/ccm-ldn-types-contact/src/ccm-ldn-types-contact.load b/ccm-ldn-types-contact/src/ccm-ldn-types-contact.load new file mode 100755 index 000000000..2d38e77cb --- /dev/null +++ b/ccm-ldn-types-contact/src/ccm-ldn-types-contact.load @@ -0,0 +1,20 @@ + + + +
+
+ + + +
+
+
+
+ + + + + + + + diff --git a/ccm-ldn-types-contact/src/ccm-ldn-types-contact.upgrade b/ccm-ldn-types-contact/src/ccm-ldn-types-contact.upgrade new file mode 100644 index 000000000..ea7a901b2 --- /dev/null +++ b/ccm-ldn-types-contact/src/ccm-ldn-types-contact.upgrade @@ -0,0 +1,5 @@ + + +