Mail Archive Home | byline-commits List | January 2005 Index
| Date Index --> | Thread Index --> |
Author: richardl
Date: 2005-01-20 22:08:06 +0100 (Thu, 20 Jan 2005)
New Revision: 33
Added:
trunk/
trunk/application.xml
trunk/doc/
trunk/doc/iso-country.txt
trunk/doc/make-insert.pl
trunk/pdl/
trunk/pdl/com/
trunk/pdl/com/arsdigita/
trunk/pdl/com/arsdigita/content-types/
trunk/pdl/com/arsdigita/content-types/Address.pdl
trunk/sql/
trunk/sql/ccm-cms-types-address/
trunk/sql/ccm-cms-types-address/default/
trunk/sql/ccm-cms-types-address/default/insert-iso-countries.sql
trunk/sql/ccm-cms-types-address/default/upgrade/
trunk/sql/ccm-cms-types-address/default/upgrade/address-upgrade-1.sql
trunk/sql/ccm-cms-types-address/oracle-se-create.sql
trunk/sql/ccm-cms-types-address/oracle-se/
trunk/sql/ccm-cms-types-address/oracle-se/upgrade/
trunk/sql/ccm-cms-types-address/oracle-se/upgrade/address-upgrade-2.sql
trunk/sql/ccm-cms-types-address/postgres-create.sql
trunk/sql/ccm-cms-types-address/postgres/
trunk/sql/ccm-cms-types-address/postgres/upgrade/
trunk/sql/ccm-cms-types-address/postgres/upgrade/address-upgrade-2.sql
trunk/sql/ccm-cms-types-address/upgrade/
trunk/sql/ccm-cms-types-address/upgrade/oracle-se-1.sql
trunk/sql/ccm-cms-types-address/upgrade/oracle-se-2.sql
trunk/sql/ccm-cms-types-address/upgrade/postgres-1.sql
trunk/sql/ccm-cms-types-address/upgrade/postgres-2.sql
trunk/src/
trunk/src/WEB-INF/
trunk/src/WEB-INF/content-types/
trunk/src/WEB-INF/content-types/com/
trunk/src/WEB-INF/content-types/com/arsdigita/
trunk/src/WEB-INF/content-types/com/arsdigita/cms/
trunk/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/
trunk/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Address.xml
trunk/src/ccm-cms-types-address.config
trunk/src/ccm-cms-types-address.load
trunk/src/com/
trunk/src/com/arsdigita/
trunk/src/com/arsdigita/cms/
trunk/src/com/arsdigita/cms/contenttypes/
trunk/src/com/arsdigita/cms/contenttypes/Address.java
trunk/src/com/arsdigita/cms/contenttypes/AddressInitializer.java
trunk/src/com/arsdigita/cms/contenttypes/AddressLoader.java
trunk/src/com/arsdigita/cms/contenttypes/AddressResources.properties
trunk/src/com/arsdigita/cms/contenttypes/IsoCountry.java
trunk/src/com/arsdigita/cms/contenttypes/ui/
trunk/src/com/arsdigita/cms/contenttypes/ui/AddressPropertiesStep.java
trunk/src/com/arsdigita/cms/contenttypes/ui/AddressPropertyForm.java
trunk/src/com/arsdigita/cms/contenttypes/util/
trunk/src/com/arsdigita/cms/contenttypes/util/AddressGlobalizationUtil.java
trunk/src/com/arsdigita/cms/contenttypes/util/AddressResourceBundle.java
trunk/web/
trunk/web/static/
trunk/web/static/content-types/
trunk/web/static/content-types/com/
trunk/web/static/content-types/com/arsdigita/
trunk/web/static/content-types/com/arsdigita/cms/
trunk/web/static/content-types/com/arsdigita/cms/contenttypes/
trunk/web/static/content-types/com/arsdigita/cms/contenttypes/Address.xsl
Log:
import content types
Added: trunk/application.xml
===================================================================
--- trunk/application.xml 2004-11-30 17:01:48 UTC (rev 32)
+++ trunk/application.xml 2005-01-20 21:08:06 UTC (rev 33)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<ccm:application name="ccm-cms-types-address"
+ prettyName="Red Hat CCM Content Types"
+ version="6.1.0"
+ release="7"
+ webapp="ROOT"
+ xmlns:ccm="http://ccm.redhat.com/ccm-project">
+
+ <ccm:dependencies>
+ <ccm:requires name="ccm-core" version="6.1.0"/>
+ <ccm:requires name="ccm-cms" version="6.1.0"/>
+ </ccm:dependencies>
+
+ <ccm:directories>
+ <ccm:directory name="pdl"/>
+ <ccm:directory name="sql"/>
+ <ccm:directory name="src"/>
+ </ccm:directories>
+
+ <ccm:contacts>
+ <ccm:contact uri="http://www.redhat.com/software/rhea" type="website"/>
+ <ccm:contact uri="mailto:rhea@xxxxxxxxxx" type="support"/>
+ </ccm:contacts>
+
+ <ccm:description>
+ The Address Content Type for the Red Hat CCM CMS.
+ </ccm:description>
+
+</ccm:application>
Added: trunk/doc/iso-country.txt
===================================================================
--- trunk/doc/iso-country.txt 2004-11-30 17:01:48 UTC (rev 32)
+++ trunk/doc/iso-country.txt 2005-01-20 21:08:06 UTC (rev 33)
@@ -0,0 +1,241 @@
+This list states the country names (official short names in English) in
alphabetical order as given in ISO 3166-1 and the corresponding ISO
3166-1-alpha-2 code elements. The list is updated whenever a change to the
official code list in ISO 3166-1 is effected by the ISO 3166/MA. It lists 239
official short names and code elements. One line of text contains one entry.
A country name and its code element are separated by a semicolon (;).
+
+AFGHANISTAN;AF
+ALBANIA;AL
+ALGERIA;DZ
+AMERICAN SAMOA;AS
+ANDORRA;AD
+ANGOLA;AO
+ANGUILLA;AI
+ANTARCTICA;AQ
+ANTIGUA AND BARBUDA;AG
+ARGENTINA;AR
+ARMENIA;AM
+ARUBA;AW
+AUSTRALIA;AU
+AUSTRIA;AT
+AZERBAIJAN;AZ
+BAHAMAS;BS
+BAHRAIN;BH
+BANGLADESH;BD
+BARBADOS;BB
+BELARUS;BY
+BELGIUM;BE
+BELIZE;BZ
+BENIN;BJ
+BERMUDA;BM
+BHUTAN;BT
+BOLIVIA;BO
+BOSNIA AND HERZEGOVINA;BA
+BOTSWANA;BW
+BOUVET ISLAND;BV
+BRAZIL;BR
+BRITISH INDIAN OCEAN TERRITORY;IO
+BRUNEI DARUSSALAM;BN
+BULGARIA;BG
+BURKINA FASO;BF
+BURUNDI;BI
+CAMBODIA;KH
+CAMEROON;CM
+CANADA;CA
+CAPE VERDE;CV
+CAYMAN ISLANDS;KY
+CENTRAL AFRICAN REPUBLIC;CF
+CHAD;TD
+CHILE;CL
+CHINA;CN
+CHRISTMAS ISLAND;CX
+COCOS (KEELING) ISLANDS;CC
+COLOMBIA;CO
+COMOROS;KM
+CONGO;CG
+CONGO, THE DEMOCRATIC REPUBLIC OF THE;CD
+COOK ISLANDS;CK
+COSTA RICA;CR
+COTE D'IVOIRE;CI
+CROATIA;HR
+CUBA;CU
+CYPRUS;CY
+CZECH REPUBLIC;CZ
+DENMARK;DK
+DJIBOUTI;DJ
+DOMINICA;DM
+DOMINICAN REPUBLIC;DO
+ECUADOR;EC
+EGYPT;EG
+EL SALVADOR;SV
+EQUATORIAL GUINEA;GQ
+ERITREA;ER
+ESTONIA;EE
+ETHIOPIA;ET
+FALKLAND ISLANDS (MALVINAS);FK
+FAROE ISLANDS;FO
+FIJI;FJ
+FINLAND;FI
+FRANCE;FR
+FRENCH GUIANA;GF
+FRENCH POLYNESIA;PF
+FRENCH SOUTHERN TERRITORIES;TF
+GABON;GA
+GAMBIA;GM
+GEORGIA;GE
+GERMANY;DE
+GHANA;GH
+GIBRALTAR;GI
+GREECE;GR
+GREENLAND;GL
+GRENADA;GD
+GUADELOUPE;GP
+GUAM;GU
+GUATEMALA;GT
+GUINEA;GN
+GUINEA-BISSAU;GW
+GUYANA;GY
+HAITI;HT
+HEARD ISLAND AND MCDONALD ISLANDS;HM
+HOLY SEE (VATICAN CITY STATE);VA
+HONDURAS;HN
+HONG KONG;HK
+HUNGARY;HU
+ICELAND;IS
+INDIA;IN
+INDONESIA;ID
+IRAN, ISLAMIC REPUBLIC OF;IR
+IRAQ;IQ
+IRELAND;IE
+ISRAEL;IL
+ITALY;IT
+JAMAICA;JM
+JAPAN;JP
+JORDAN;JO
+KAZAKHSTAN;KZ
+KENYA;KE
+KIRIBATI;KI
+KOREA, DEMOCRATIC PEOPLE'S REPUBLIC OF;KP
+KOREA, REPUBLIC OF;KR
+KUWAIT;KW
+KYRGYZSTAN;KG
+LAO PEOPLE'S DEMOCRATIC REPUBLIC;LA
+LATVIA;LV
+LEBANON;LB
+LESOTHO;LS
+LIBERIA;LR
+LIBYAN ARAB JAMAHIRIYA;LY
+LIECHTENSTEIN;LI
+LITHUANIA;LT
+LUXEMBOURG;LU
+MACAO;MO
+MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF;MK
+MADAGASCAR;MG
+MALAWI;MW
+MALAYSIA;MY
+MALDIVES;MV
+MALI;ML
+MALTA;MT
+MARSHALL ISLANDS;MH
+MARTINIQUE;MQ
+MAURITANIA;MR
+MAURITIUS;MU
+MAYOTTE;YT
+MEXICO;MX
+MICRONESIA, FEDERATED STATES OF;FM
+MOLDOVA, REPUBLIC OF;MD
+MONACO;MC
+MONGOLIA;MN
+MONTSERRAT;MS
+MOROCCO;MA
+MOZAMBIQUE;MZ
+MYANMAR;MM
+NAMIBIA;NA
+NAURU;NR
+NEPAL;NP
+NETHERLANDS;NL
+NETHERLANDS ANTILLES;AN
+NEW CALEDONIA;NC
+NEW ZEALAND;NZ
+NICARAGUA;NI
+NIGER;NE
+NIGERIA;NG
+NIUE;NU
+NORFOLK ISLAND;NF
+NORTHERN MARIANA ISLANDS;MP
+NORWAY;NO
+OMAN;OM
+PAKISTAN;PK
+PALAU;PW
+PALESTINIAN TERRITORY, OCCUPIED;PS
+PANAMA;PA
+PAPUA NEW GUINEA;PG
+PARAGUAY;PY
+PERU;PE
+PHILIPPINES;PH
+PITCAIRN;PN
+POLAND;PL
+PORTUGAL;PT
+PUERTO RICO;PR
+QATAR;QA
+REUNION;RE
+ROMANIA;RO
+RUSSIAN FEDERATION;RU
+RWANDA;RW
+SAINT HELENA;SH
+SAINT KITTS AND NEVIS;KN
+SAINT LUCIA;LC
+SAINT PIERRE AND MIQUELON;PM
+SAINT VINCENT AND THE GRENADINES;VC
+SAMOA;WS
+SAN MARINO;SM
+SAO TOME AND PRINCIPE;ST
+SAUDI ARABIA;SA
+SENEGAL;SN
+SEYCHELLES;SC
+SIERRA LEONE;SL
+SINGAPORE;SG
+SLOVAKIA;SK
+SLOVENIA;SI
+SOLOMON ISLANDS;SB
+SOMALIA;SO
+SOUTH AFRICA;ZA
+SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS;GS
+SPAIN;ES
+SRI LANKA;LK
+SUDAN;SD
+SURINAME;SR
+SVALBARD AND JAN MAYEN;SJ
+SWAZILAND;SZ
+SWEDEN;SE
+SWITZERLAND;CH
+SYRIAN ARAB REPUBLIC;SY
+TAIWAN, PROVINCE OF CHINA;TW
+TAJIKISTAN;TJ
+TANZANIA, UNITED REPUBLIC OF;TZ
+THAILAND;TH
+TIMOR-LESTE;TL
+TOGO;TG
+TOKELAU;TK
+TONGA;TO
+TRINIDAD AND TOBAGO;TT
+TUNISIA;TN
+TURKEY;TR
+TURKMENISTAN;TM
+TURKS AND CAICOS ISLANDS;TC
+TUVALU;TV
+UGANDA;UG
+UKRAINE;UA
+UNITED ARAB EMIRATES;AE
+UNITED KINGDOM;GB
+UNITED STATES;US
+UNITED STATES MINOR OUTLYING ISLANDS;UM
+URUGUAY;UY
+UZBEKISTAN;UZ
+VANUATU;VU
+VENEZUELA;VE
+VIET NAM;VN
+VIRGIN ISLANDS, BRITISH;VG
+VIRGIN ISLANDS, U.S.;VI
+WALLIS AND FUTUNA;WF
+WESTERN SAHARA;EH
+YEMEN;YE
+YUGOSLAVIA;YU
+ZAMBIA;ZM
+ZIMBABWE;ZW
Added: trunk/doc/make-insert.pl
===================================================================
--- trunk/doc/make-insert.pl 2004-11-30 17:01:48 UTC (rev 32)
+++ trunk/doc/make-insert.pl 2005-01-20 21:08:06 UTC (rev 33)
@@ -0,0 +1,18 @@
+#!/usr/bin/perl -wT
+
+print "-- Autogenerated by content-types/doc/make-insert.pl\n";
+
+while (<STDIN>) {
+ if (/(.*);(\w\w)/) {
+ my $code = $2;
+ my $name = lc($1);
+ $name =~ s/\b(\w)/uc($1)/gex;
+ $name =~ s/The/the/gx;
+ $name =~ s/Of/of/gx;
+ $name =~ s/And/and/gx;
+ $name =~ s/'/''/gx;
+ print "insert into iso_countries (iso_code, country_name) values
('$code', '$name');\n";
+ }
+}
+
+print "-- End\n";
Property changes on: trunk/doc/make-insert.pl
___________________________________________________________________
Name: svn:executable
+
Added: trunk/pdl/com/arsdigita/content-types/Address.pdl
===================================================================
--- trunk/pdl/com/arsdigita/content-types/Address.pdl 2004-11-30 17:01:48
UTC (rev 32)
+++ trunk/pdl/com/arsdigita/content-types/Address.pdl 2005-01-20 21:08:06
UTC (rev 33)
@@ -0,0 +1,57 @@
+//
+// Copyright (C) 2002-2004 Red Hat Inc. All Rights Reserved.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public License
+// as published by the Free Software Foundation; either version 2.1 of
+// the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// $Id:
//cms/content-types/address/dev/pdl/com/arsdigita/content-types/Address.pdl#4
$
+// $DateTime: 2004/08/17 23:15:09 $
+model com.arsdigita.cms.contenttypes;
+
+import com.arsdigita.cms.ContentPage;
+
+// mapping table for mapping iso country code to country name
+object type IsoCountry {
+ // The country iso code
+ String[1..1] isoCode = iso_countries.iso_code CHAR(2);
+ // The country name
+ String[1..1] countryName = iso_countries.country_name VARCHAR(100);
+
+ object key (isoCode);
+}
+
+// a simple content type to hold generic address information
+object type Address extends ContentPage {
+ // The street address, flexible enough to handle different formats
+ String[0..1] address = ct_addresses.address VARCHAR(1000);
+ // The country iso code
+ IsoCountry[0..1] isoCountryCode = join ct_addresses.iso_country_code
+ to iso_countries.iso_code;
+ // The postal code
+ String[0..1] postalCode = ct_addresses.postal_code VARCHAR(20);
+ // The phone number
+ String[0..1] phone = ct_addresses.phone VARCHAR(20);
+ // The mobile phone number
+ String[0..1] mobile = ct_addresses.mobile VARCHAR(20);
+ // The fax phone number
+ String[0..1] fax = ct_addresses.fax VARCHAR(20);
+ // The email address
+ String[0..1] email = ct_addresses.email VARCHAR(75);
+ // Notes about the address and address owner
+ String[0..1] notes = ct_addresses.notes CLOB;
+ // URI for the address
+ String[0..1] uri = ct_addresses.uri VARCHAR(250);
+
+ reference key (ct_addresses.address_id);
+}
Added: trunk/sql/ccm-cms-types-address/default/insert-iso-countries.sql
===================================================================
--- trunk/sql/ccm-cms-types-address/default/insert-iso-countries.sql
2004-11-30 17:01:48 UTC (rev 32)
+++ trunk/sql/ccm-cms-types-address/default/insert-iso-countries.sql
2005-01-20 21:08:06 UTC (rev 33)
@@ -0,0 +1,259 @@
+--
+-- Copyright (C) 2003-2004 Red Hat Inc. All Rights Reserved.
+--
+-- This library is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU Lesser General Public License
+-- as published by the Free Software Foundation; either version 2.1 of
+-- the License, or (at your option) any later version.
+--
+-- This library is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+-- Lesser General Public License for more details.
+--
+-- You should have received a copy of the GNU Lesser General Public
+-- License along with this library; if not, write to the Free Software
+-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+--
+-- $Id:
//cms/content-types/address/dev/sql/ccm-cms-types-address/default/insert-iso-countries.sql#4
$
+-- $DateTime: 2004/08/17 23:15:09 $
+insert into iso_countries (iso_code, country_name) values ('AF',
'Afghanistan');
+insert into iso_countries (iso_code, country_name) values ('AL', 'Albania');
+insert into iso_countries (iso_code, country_name) values ('DZ', 'Algeria');
+insert into iso_countries (iso_code, country_name) values ('AS', 'American
Samoa');
+insert into iso_countries (iso_code, country_name) values ('AD', 'andorra');
+insert into iso_countries (iso_code, country_name) values ('AO', 'Angola');
+insert into iso_countries (iso_code, country_name) values ('AI', 'Anguilla');
+insert into iso_countries (iso_code, country_name) values ('AQ',
'Antarctica');
+insert into iso_countries (iso_code, country_name) values ('AG', 'Antigua
and Barbuda');
+insert into iso_countries (iso_code, country_name) values ('AR',
'Argentina');
+insert into iso_countries (iso_code, country_name) values ('AM', 'Armenia');
+insert into iso_countries (iso_code, country_name) values ('AW', 'Aruba');
+insert into iso_countries (iso_code, country_name) values ('AU',
'Australia');
+insert into iso_countries (iso_code, country_name) values ('AT', 'Austria');
+insert into iso_countries (iso_code, country_name) values ('AZ',
'Azerbaijan');
+insert into iso_countries (iso_code, country_name) values ('BS', 'Bahamas');
+insert into iso_countries (iso_code, country_name) values ('BH', 'Bahrain');
+insert into iso_countries (iso_code, country_name) values ('BD',
'Bangladesh');
+insert into iso_countries (iso_code, country_name) values ('BB', 'Barbados');
+insert into iso_countries (iso_code, country_name) values ('BY', 'Belarus');
+insert into iso_countries (iso_code, country_name) values ('BE', 'Belgium');
+insert into iso_countries (iso_code, country_name) values ('BZ', 'Belize');
+insert into iso_countries (iso_code, country_name) values ('BJ', 'Benin');
+insert into iso_countries (iso_code, country_name) values ('BM', 'Bermuda');
+insert into iso_countries (iso_code, country_name) values ('BT', 'Bhutan');
+insert into iso_countries (iso_code, country_name) values ('BO', 'Bolivia');
+insert into iso_countries (iso_code, country_name) values ('BA', 'Bosnia and
Herzegovina');
+insert into iso_countries (iso_code, country_name) values ('BW', 'Botswana');
+insert into iso_countries (iso_code, country_name) values ('BV', 'Bouvet
Island');
+insert into iso_countries (iso_code, country_name) values ('BR', 'Brazil');
+insert into iso_countries (iso_code, country_name) values ('IO', 'British
Indian Ocean Territory');
+insert into iso_countries (iso_code, country_name) values ('BN', 'Brunei
Darussalam');
+insert into iso_countries (iso_code, country_name) values ('BG', 'Bulgaria');
+insert into iso_countries (iso_code, country_name) values ('BF', 'Burkina
Faso');
+insert into iso_countries (iso_code, country_name) values ('BI', 'Burundi');
+insert into iso_countries (iso_code, country_name) values ('KH', 'Cambodia');
+insert into iso_countries (iso_code, country_name) values ('CM', 'Cameroon');
+insert into iso_countries (iso_code, country_name) values ('CA', 'Canada');
+insert into iso_countries (iso_code, country_name) values ('CV', 'Cape
Verde');
+insert into iso_countries (iso_code, country_name) values ('KY', 'Cayman
Islands');
+insert into iso_countries (iso_code, country_name) values ('CF', 'Central
African Republic');
+insert into iso_countries (iso_code, country_name) values ('TD', 'Chad');
+insert into iso_countries (iso_code, country_name) values ('CL', 'Chile');
+insert into iso_countries (iso_code, country_name) values ('CN', 'China');
+insert into iso_countries (iso_code, country_name) values ('CX', 'Christmas
Island');
+insert into iso_countries (iso_code, country_name) values ('CC', 'Cocos
(Keeling) Islands');
+insert into iso_countries (iso_code, country_name) values ('CO', 'Colombia');
+insert into iso_countries (iso_code, country_name) values ('KM', 'Comoros');
+insert into iso_countries (iso_code, country_name) values ('CG', 'Congo');
+insert into iso_countries (iso_code, country_name) values ('CD', 'Congo, the
Democratic Republic of the');
+insert into iso_countries (iso_code, country_name) values ('CK', 'Cook
Islands');
+insert into iso_countries (iso_code, country_name) values ('CR', 'Costa
Rica');
+insert into iso_countries (iso_code, country_name) values ('CI', 'Cote
D''Ivoire');
+insert into iso_countries (iso_code, country_name) values ('HR', 'Croatia');
+insert into iso_countries (iso_code, country_name) values ('CU', 'Cuba');
+insert into iso_countries (iso_code, country_name) values ('CY', 'Cyprus');
+insert into iso_countries (iso_code, country_name) values ('CZ', 'Czech
Republic');
+insert into iso_countries (iso_code, country_name) values ('DK', 'Denmark');
+insert into iso_countries (iso_code, country_name) values ('DJ', 'Djibouti');
+insert into iso_countries (iso_code, country_name) values ('DM', 'Dominica');
+insert into iso_countries (iso_code, country_name) values ('DO', 'Dominican
Republic');
+insert into iso_countries (iso_code, country_name) values ('EC', 'Ecuador');
+insert into iso_countries (iso_code, country_name) values ('EG', 'Egypt');
+insert into iso_countries (iso_code, country_name) values ('SV', 'El
Salvador');
+insert into iso_countries (iso_code, country_name) values ('GQ', 'Equatorial
Guinea');
+insert into iso_countries (iso_code, country_name) values ('ER', 'Eritrea');
+insert into iso_countries (iso_code, country_name) values ('EE', 'Estonia');
+insert into iso_countries (iso_code, country_name) values ('ET', 'Ethiopia');
+insert into iso_countries (iso_code, country_name) values ('FK', 'Falkland
Islands (Malvinas)');
+insert into iso_countries (iso_code, country_name) values ('FO', 'Faroe
Islands');
+insert into iso_countries (iso_code, country_name) values ('FJ', 'Fiji');
+insert into iso_countries (iso_code, country_name) values ('FI', 'Finland');
+insert into iso_countries (iso_code, country_name) values ('FR', 'France');
+insert into iso_countries (iso_code, country_name) values ('GF', 'French
Guiana');
+insert into iso_countries (iso_code, country_name) values ('PF', 'French
Polynesia');
+insert into iso_countries (iso_code, country_name) values ('TF', 'French
Southern Territories');
+insert into iso_countries (iso_code, country_name) values ('GA', 'Gabon');
+insert into iso_countries (iso_code, country_name) values ('GM', 'Gambia');
+insert into iso_countries (iso_code, country_name) values ('GE', 'Georgia');
+insert into iso_countries (iso_code, country_name) values ('DE', 'Germany');
+insert into iso_countries (iso_code, country_name) values ('GH', 'Ghana');
+insert into iso_countries (iso_code, country_name) values ('GI',
'Gibraltar');
+insert into iso_countries (iso_code, country_name) values ('GR', 'Greece');
+insert into iso_countries (iso_code, country_name) values ('GL',
'Greenland');
+insert into iso_countries (iso_code, country_name) values ('GD', 'Grenada');
+insert into iso_countries (iso_code, country_name) values ('GP',
'Guadeloupe');
+insert into iso_countries (iso_code, country_name) values ('GU', 'Guam');
+insert into iso_countries (iso_code, country_name) values ('GT',
'Guatemala');
+insert into iso_countries (iso_code, country_name) values ('GN', 'Guinea');
+insert into iso_countries (iso_code, country_name) values ('GW',
'Guinea-Bissau');
+insert into iso_countries (iso_code, country_name) values ('GY', 'Guyana');
+insert into iso_countries (iso_code, country_name) values ('HT', 'Haiti');
+insert into iso_countries (iso_code, country_name) values ('HM', 'Heard
Island and Mcdonald Islands');
+insert into iso_countries (iso_code, country_name) values ('VA', 'Holy See
(Vatican City State)');
+insert into iso_countries (iso_code, country_name) values ('HN', 'Honduras');
+insert into iso_countries (iso_code, country_name) values ('HK', 'Hong
Kong');
+insert into iso_countries (iso_code, country_name) values ('HU', 'Hungary');
+insert into iso_countries (iso_code, country_name) values ('IS', 'Iceland');
+insert into iso_countries (iso_code, country_name) values ('IN', 'India');
+insert into iso_countries (iso_code, country_name) values ('ID',
'Indonesia');
+insert into iso_countries (iso_code, country_name) values ('IR', 'Iran,
Islamic Republic of');
+insert into iso_countries (iso_code, country_name) values ('IQ', 'Iraq');
+insert into iso_countries (iso_code, country_name) values ('IE', 'Ireland');
+insert into iso_countries (iso_code, country_name) values ('IL', 'Israel');
+insert into iso_countries (iso_code, country_name) values ('IT', 'Italy');
+insert into iso_countries (iso_code, country_name) values ('JM', 'Jamaica');
+insert into iso_countries (iso_code, country_name) values ('JP', 'Japan');
+insert into iso_countries (iso_code, country_name) values ('JO', 'Jordan');
+insert into iso_countries (iso_code, country_name) values ('KZ',
'Kazakhstan');
+insert into iso_countries (iso_code, country_name) values ('KE', 'Kenya');
+insert into iso_countries (iso_code, country_name) values ('KI', 'Kiribati');
+insert into iso_countries (iso_code, country_name) values ('KP', 'Korea,
Democratic People''S Republic of');
+insert into iso_countries (iso_code, country_name) values ('KR', 'Korea,
Republic of');
+insert into iso_countries (iso_code, country_name) values ('KW', 'Kuwait');
+insert into iso_countries (iso_code, country_name) values ('KG',
'Kyrgyzstan');
+insert into iso_countries (iso_code, country_name) values ('LA', 'Lao
People''S Democratic Republic');
+insert into iso_countries (iso_code, country_name) values ('LV', 'Latvia');
+insert into iso_countries (iso_code, country_name) values ('LB', 'Lebanon');
+insert into iso_countries (iso_code, country_name) values ('LS', 'Lesotho');
+insert into iso_countries (iso_code, country_name) values ('LR', 'Liberia');
+insert into iso_countries (iso_code, country_name) values ('LY', 'Libyan
Arab Jamahiriya');
+insert into iso_countries (iso_code, country_name) values ('LI',
'Liechtenstein');
+insert into iso_countries (iso_code, country_name) values ('LT',
'Lithuania');
+insert into iso_countries (iso_code, country_name) values ('LU',
'Luxembourg');
+insert into iso_countries (iso_code, country_name) values ('MO', 'Macao');
+insert into iso_countries (iso_code, country_name) values ('MK', 'Macedonia,
the Former Yugoslav Republic of');
+insert into iso_countries (iso_code, country_name) values ('MG',
'Madagascar');
+insert into iso_countries (iso_code, country_name) values ('MW', 'Malawi');
+insert into iso_countries (iso_code, country_name) values ('MY', 'Malaysia');
+insert into iso_countries (iso_code, country_name) values ('MV', 'Maldives');
+insert into iso_countries (iso_code, country_name) values ('ML', 'Mali');
+insert into iso_countries (iso_code, country_name) values ('MT', 'Malta');
+insert into iso_countries (iso_code, country_name) values ('MH', 'Marshall
Islands');
+insert into iso_countries (iso_code, country_name) values ('MQ',
'Martinique');
+insert into iso_countries (iso_code, country_name) values ('MR',
'Mauritania');
+insert into iso_countries (iso_code, country_name) values ('MU',
'Mauritius');
+insert into iso_countries (iso_code, country_name) values ('YT', 'Mayotte');
+insert into iso_countries (iso_code, country_name) values ('MX', 'Mexico');
+insert into iso_countries (iso_code, country_name) values ('FM',
'Micronesia, Federated States of');
+insert into iso_countries (iso_code, country_name) values ('MD', 'Moldova,
Republic of');
+insert into iso_countries (iso_code, country_name) values ('MC', 'Monaco');
+insert into iso_countries (iso_code, country_name) values ('MN', 'Mongolia');
+insert into iso_countries (iso_code, country_name) values ('MS',
'Montserrat');
+insert into iso_countries (iso_code, country_name) values ('MA', 'Morocco');
+insert into iso_countries (iso_code, country_name) values ('MZ',
'Mozambique');
+insert into iso_countries (iso_code, country_name) values ('MM', 'Myanmar');
+insert into iso_countries (iso_code, country_name) values ('NA', 'Namibia');
+insert into iso_countries (iso_code, country_name) values ('NR', 'Nauru');
+insert into iso_countries (iso_code, country_name) values ('NP', 'Nepal');
+insert into iso_countries (iso_code, country_name) values ('NL',
'Netherlands');
+insert into iso_countries (iso_code, country_name) values ('AN',
'Netherlands Antilles');
+insert into iso_countries (iso_code, country_name) values ('NC', 'New
Caledonia');
+insert into iso_countries (iso_code, country_name) values ('NZ', 'New
Zealand');
+insert into iso_countries (iso_code, country_name) values ('NI',
'Nicaragua');
+insert into iso_countries (iso_code, country_name) values ('NE', 'Niger');
+insert into iso_countries (iso_code, country_name) values ('NG', 'Nigeria');
+insert into iso_countries (iso_code, country_name) values ('NU', 'Niue');
+insert into iso_countries (iso_code, country_name) values ('NF', 'Norfolk
Island');
+insert into iso_countries (iso_code, country_name) values ('MP', 'Northern
Mariana Islands');
+insert into iso_countries (iso_code, country_name) values ('NO', 'Norway');
+insert into iso_countries (iso_code, country_name) values ('OM', 'Oman');
+insert into iso_countries (iso_code, country_name) values ('PK', 'Pakistan');
+insert into iso_countries (iso_code, country_name) values ('PW', 'Palau');
+insert into iso_countries (iso_code, country_name) values ('PS',
'Palestinian Territory, Occupied');
+insert into iso_countries (iso_code, country_name) values ('PA', 'Panama');
+insert into iso_countries (iso_code, country_name) values ('PG', 'Papua New
Guinea');
+insert into iso_countries (iso_code, country_name) values ('PY', 'Paraguay');
+insert into iso_countries (iso_code, country_name) values ('PE', 'Peru');
+insert into iso_countries (iso_code, country_name) values ('PH',
'Philippines');
+insert into iso_countries (iso_code, country_name) values ('PN', 'Pitcairn');
+insert into iso_countries (iso_code, country_name) values ('PL', 'Poland');
+insert into iso_countries (iso_code, country_name) values ('PT', 'Portugal');
+insert into iso_countries (iso_code, country_name) values ('PR', 'Puerto
Rico');
+insert into iso_countries (iso_code, country_name) values ('QA', 'Qatar');
+insert into iso_countries (iso_code, country_name) values ('RE', 'Reunion');
+insert into iso_countries (iso_code, country_name) values ('RO', 'Romania');
+insert into iso_countries (iso_code, country_name) values ('RU', 'Russian
Federation');
+insert into iso_countries (iso_code, country_name) values ('RW', 'Rwanda');
+insert into iso_countries (iso_code, country_name) values ('SH', 'Saint
Helena');
+insert into iso_countries (iso_code, country_name) values ('KN', 'Saint
Kitts and Nevis');
+insert into iso_countries (iso_code, country_name) values ('LC', 'Saint
Lucia');
+insert into iso_countries (iso_code, country_name) values ('PM', 'Saint
Pierre and Miquelon');
+insert into iso_countries (iso_code, country_name) values ('VC', 'Saint
Vincent and the Grenadines');
+insert into iso_countries (iso_code, country_name) values ('WS', 'Samoa');
+insert into iso_countries (iso_code, country_name) values ('SM', 'San
Marino');
+insert into iso_countries (iso_code, country_name) values ('ST', 'Sao Tome
and Principe');
+insert into iso_countries (iso_code, country_name) values ('SA', 'Saudi
Arabia');
+insert into iso_countries (iso_code, country_name) values ('SN', 'Senegal');
+insert into iso_countries (iso_code, country_name) values ('SC',
'Seychelles');
+insert into iso_countries (iso_code, country_name) values ('SL', 'Sierra
Leone');
+insert into iso_countries (iso_code, country_name) values ('SG',
'Singapore');
+insert into iso_countries (iso_code, country_name) values ('SK', 'Slovakia');
+insert into iso_countries (iso_code, country_name) values ('SI', 'Slovenia');
+insert into iso_countries (iso_code, country_name) values ('SB', 'Solomon
Islands');
+insert into iso_countries (iso_code, country_name) values ('SO', 'Somalia');
+insert into iso_countries (iso_code, country_name) values ('ZA', 'South
Africa');
+insert into iso_countries (iso_code, country_name) values ('GS', 'South
Georgia and the South Sandwich Islands');
+insert into iso_countries (iso_code, country_name) values ('ES', 'Spain');
+insert into iso_countries (iso_code, country_name) values ('LK', 'Sri
Lanka');
+insert into iso_countries (iso_code, country_name) values ('SD', 'Sudan');
+insert into iso_countries (iso_code, country_name) values ('SR', 'Suriname');
+insert into iso_countries (iso_code, country_name) values ('SJ', 'Svalbard
and Jan Mayen');
+insert into iso_countries (iso_code, country_name) values ('SZ',
'Swaziland');
+insert into iso_countries (iso_code, country_name) values ('SE', 'Sweden');
+insert into iso_countries (iso_code, country_name) values ('CH',
'Switzerland');
+insert into iso_countries (iso_code, country_name) values ('SY', 'Syrian
Arab Republic');
+insert into iso_countries (iso_code, country_name) values ('TW', 'Taiwan,
Province of China');
+insert into iso_countries (iso_code, country_name) values ('TJ',
'Tajikistan');
+insert into iso_countries (iso_code, country_name) values ('TZ', 'Tanzania,
United Republic of');
+insert into iso_countries (iso_code, country_name) values ('TH', 'Thailand');
+insert into iso_countries (iso_code, country_name) values ('TL',
'Timor-Leste');
+insert into iso_countries (iso_code, country_name) values ('TG', 'Togo');
+insert into iso_countries (iso_code, country_name) values ('TK', 'Tokelau');
+insert into iso_countries (iso_code, country_name) values ('TO', 'Tonga');
+insert into iso_countries (iso_code, country_name) values ('TT', 'Trinidad
and Tobago');
+insert into iso_countries (iso_code, country_name) values ('TN', 'Tunisia');
+insert into iso_countries (iso_code, country_name) values ('TR', 'Turkey');
+insert into iso_countries (iso_code, country_name) values ('TM',
'Turkmenistan');
+insert into iso_countries (iso_code, country_name) values ('TC', 'Turks and
Caicos Islands');
+insert into iso_countries (iso_code, country_name) values ('TV', 'Tuvalu');
+insert into iso_countries (iso_code, country_name) values ('UG', 'Uganda');
+insert into iso_countries (iso_code, country_name) values ('UA', 'Ukraine');
+insert into iso_countries (iso_code, country_name) values ('AE', 'United
Arab Emirates');
+insert into iso_countries (iso_code, country_name) values ('GB', 'United
Kingdom');
+insert into iso_countries (iso_code, country_name) values ('US', 'United
States');
+insert into iso_countries (iso_code, country_name) values ('UM', 'United
States Minor Outlying Islands');
+insert into iso_countries (iso_code, country_name) values ('UY', 'Uruguay');
+insert into iso_countries (iso_code, country_name) values ('UZ',
'Uzbekistan');
+insert into iso_countries (iso_code, country_name) values ('VU', 'Vanuatu');
+insert into iso_countries (iso_code, country_name) values ('VE',
'Venezuela');
+insert into iso_countries (iso_code, country_name) values ('VN', 'Viet Nam');
+insert into iso_countries (iso_code, country_name) values ('VG', 'Virgin
Islands, British');
+insert into iso_countries (iso_code, country_name) values ('VI', 'Virgin
Islands, U.S.');
+insert into iso_countries (iso_code, country_name) values ('WF', 'Wallis and
Futuna');
+insert into iso_countries (iso_code, country_name) values ('EH', 'Western
Sahara');
+insert into iso_countries (iso_code, country_name) values ('YE', 'Yemen');
+insert into iso_countries (iso_code, country_name) values ('YU',
'Yugoslavia');
+insert into iso_countries (iso_code, country_name) values ('ZM', 'Zambia');
+insert into iso_countries (iso_code, country_name) values ('ZW', 'Zimbabwe');
+-- End
Added: trunk/sql/ccm-cms-types-address/default/upgrade/address-upgrade-1.sql
===================================================================
--- trunk/sql/ccm-cms-types-address/default/upgrade/address-upgrade-1.sql
2004-11-30 17:01:48 UTC (rev 32)
+++ trunk/sql/ccm-cms-types-address/default/upgrade/address-upgrade-1.sql
2005-01-20 21:08:06 UTC (rev 33)
@@ -0,0 +1,20 @@
+--
+-- Copyright (C) 2003-2004 Red Hat Inc. All Rights Reserved.
+--
+-- This library is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU Lesser General Public License
+-- as published by the Free Software Foundation; either version 2.1 of
+-- the License, or (at your option) any later version.
+--
+-- This library is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+-- Lesser General Public License for more details.
+--
+-- You should have received a copy of the GNU Lesser General Public
+-- License along with this library; if not, write to the Free Software
+-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+--
+-- $Id:
//cms/content-types/address/dev/sql/ccm-cms-types-address/default/upgrade/address-upgrade-1.sql#4
$
+-- $DateTime: 2004/08/17 23:15:09 $
+alter table ct_addresses add uri VARCHAR(250);
\ No newline at end of file
Added: trunk/sql/ccm-cms-types-address/oracle-se/upgrade/address-upgrade-2.sql
===================================================================
--- trunk/sql/ccm-cms-types-address/oracle-se/upgrade/address-upgrade-2.sql
2004-11-30 17:01:48 UTC (rev 32)
+++ trunk/sql/ccm-cms-types-address/oracle-se/upgrade/address-upgrade-2.sql
2005-01-20 21:08:06 UTC (rev 33)
@@ -0,0 +1,24 @@
+--
+-- Copyright (C) 2003-2004 Red Hat Inc. All Rights Reserved.
+--
+-- This library is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU Lesser General Public License
+-- as published by the Free Software Foundation; either version 2.1 of
+-- the License, or (at your option) any later version.
+--
+-- This library is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+-- Lesser General Public License for more details.
+--
+-- You should have received a copy of the GNU Lesser General Public
+-- License along with this library; if not, write to the Free Software
+-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+--
+-- $Id:
//cms/content-types/address/dev/sql/ccm-cms-types-address/oracle-se/upgrade/address-upgrade-2.sql#4
$
+-- $DateTime: 2004/08/17 23:15:09 $
+
+alter table ct_addresses modify email varchar(75);
+alter table ct_addresses drop column notes;
+alter table ct_addresses add notes clob;
+
Added: trunk/sql/ccm-cms-types-address/oracle-se-create.sql
===================================================================
--- trunk/sql/ccm-cms-types-address/oracle-se-create.sql 2004-11-30
17:01:48 UTC (rev 32)
+++ trunk/sql/ccm-cms-types-address/oracle-se-create.sql 2005-01-20
21:08:06 UTC (rev 33)
@@ -0,0 +1,22 @@
+--
+-- Copyright (C) 2003-2004 Red Hat Inc. All Rights Reserved.
+--
+-- This library is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU Lesser General Public License
+-- as published by the Free Software Foundation; either version 2.1 of
+-- the License, or (at your option) any later version.
+--
+-- This library is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+-- Lesser General Public License for more details.
+--
+-- You should have received a copy of the GNU Lesser General Public
+-- License along with this library; if not, write to the Free Software
+-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+--
+-- $Id:
//cms/content-types/address/dev/sql/ccm-cms-types-address/oracle-se-create.sql#4
$
+-- $DateTime: 2004/08/17 23:15:09 $
+@ ddl/oracle-se/create.sql
+@ ddl/oracle-se/deferred.sql
+@ default/insert-iso-countries.sql
Added: trunk/sql/ccm-cms-types-address/postgres/upgrade/address-upgrade-2.sql
===================================================================
--- trunk/sql/ccm-cms-types-address/postgres/upgrade/address-upgrade-2.sql
2004-11-30 17:01:48 UTC (rev 32)
+++ trunk/sql/ccm-cms-types-address/postgres/upgrade/address-upgrade-2.sql
2005-01-20 21:08:06 UTC (rev 33)
@@ -0,0 +1,50 @@
+--
+-- Copyright (C) 2003-2004 Red Hat Inc. All Rights Reserved.
+--
+-- This library is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU Lesser General Public License
+-- as published by the Free Software Foundation; either version 2.1 of
+-- the License, or (at your option) any later version.
+--
+-- This library is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+-- Lesser General Public License for more details.
+--
+-- You should have received a copy of the GNU Lesser General Public
+-- License along with this library; if not, write to the Free Software
+-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+--
+-- $Id:
//cms/content-types/address/dev/sql/ccm-cms-types-address/postgres/upgrade/address-upgrade-2.sql#4
$
+-- $DateTime: 2004/08/17 23:15:09 $
+
+create table temp as select * from ct_addresses;
+drop table ct_addresses;
+
+create table ct_addresses (
+ address_id INTEGER not null
+ constraint ct_addresse_address_id_p_y1u3b
+ primary key,
+ -- referential constraint for address_id deferred due to circular
dependencies
+ address VARCHAR(1000),
+ email VARCHAR(75),
+ fax VARCHAR(20),
+ iso_country_code CHAR(2),
+ -- referential constraint for iso_country_code deferred due to
circular dependencies
+ mobile VARCHAR(20),
+ notes TEXT,
+ phone VARCHAR(20),
+ postal_code VARCHAR(20),
+ uri VARCHAR(250)
+);
+alter table ct_addresses add
+ constraint ct_addre_iso_coun_code_f_o8h8a foreign key (iso_country_code)
+ references iso_countries(iso_code);
+alter table ct_addresses add
+ constraint ct_addresse_address_id_f__qv8u foreign key (address_id)
+ references cms_pages(item_id) on delete cascade;
+
+insert into ct_addresses (address_id, address, email, fax, iso_country_code,
mobile, notes, phone, postal_code, uri)
+ select address_id, address, email, fax, iso_country_code, mobile,
encode(notes, 'escape'), phone, postal_code, uri
+ from temp;
+drop table temp;
Added: trunk/sql/ccm-cms-types-address/postgres-create.sql
===================================================================
--- trunk/sql/ccm-cms-types-address/postgres-create.sql 2004-11-30 17:01:48
UTC (rev 32)
+++ trunk/sql/ccm-cms-types-address/postgres-create.sql 2005-01-20 21:08:06
UTC (rev 33)
@@ -0,0 +1,24 @@
+--
+-- Copyright (C) 2003-2004 Red Hat Inc. All Rights Reserved.
+--
+-- This library is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU Lesser General Public License
+-- as published by the Free Software Foundation; either version 2.1 of
+-- the License, or (at your option) any later version.
+--
+-- This library is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+-- Lesser General Public License for more details.
+--
+-- You should have received a copy of the GNU Lesser General Public
+-- License along with this library; if not, write to the Free Software
+-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+--
+-- $Id:
//cms/content-types/address/dev/sql/ccm-cms-types-address/postgres-create.sql#4
$
+-- $DateTime: 2004/08/17 23:15:09 $
+begin;
+\i ddl/postgres/create.sql
+\i ddl/postgres/deferred.sql
+\i default/insert-iso-countries.sql
+end;
Added: trunk/sql/ccm-cms-types-address/upgrade/oracle-se-1.sql
===================================================================
--- trunk/sql/ccm-cms-types-address/upgrade/oracle-se-1.sql 2004-11-30
17:01:48 UTC (rev 32)
+++ trunk/sql/ccm-cms-types-address/upgrade/oracle-se-1.sql 2005-01-20
21:08:06 UTC (rev 33)
@@ -0,0 +1,20 @@
+--
+-- Copyright (C) 2003-2004 Red Hat Inc. All Rights Reserved.
+--
+-- This library is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU Lesser General Public License
+-- as published by the Free Software Foundation; either version 2.1 of
+-- the License, or (at your option) any later version.
+--
+-- This library is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+-- Lesser General Public License for more details.
+--
+-- You should have received a copy of the GNU Lesser General Public
+-- License along with this library; if not, write to the Free Software
+-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+--
+-- $Id:
//cms/content-types/address/dev/sql/ccm-cms-types-address/upgrade/oracle-se-1.sql#4
$
+-- $DateTime: 2004/08/17 23:15:09 $
+@@ ../default/upgrade/address-upgrade-1.sql
Added: trunk/sql/ccm-cms-types-address/upgrade/oracle-se-2.sql
===================================================================
--- trunk/sql/ccm-cms-types-address/upgrade/oracle-se-2.sql 2004-11-30
17:01:48 UTC (rev 32)
+++ trunk/sql/ccm-cms-types-address/upgrade/oracle-se-2.sql 2005-01-20
21:08:06 UTC (rev 33)
@@ -0,0 +1,20 @@
+--
+-- Copyright (C) 2003-2004 Red Hat Inc. All Rights Reserved.
+--
+-- This library is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU Lesser General Public License
+-- as published by the Free Software Foundation; either version 2.1 of
+-- the License, or (at your option) any later version.
+--
+-- This library is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+-- Lesser General Public License for more details.
+--
+-- You should have received a copy of the GNU Lesser General Public
+-- License along with this library; if not, write to the Free Software
+-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+--
+-- $Id:
//cms/content-types/address/dev/sql/ccm-cms-types-address/upgrade/oracle-se-2.sql#4
$
+-- $DateTime: 2004/08/17 23:15:09 $
+@@ ../oracle-se/upgrade/address-upgrade-2.sql
Added: trunk/sql/ccm-cms-types-address/upgrade/postgres-1.sql
===================================================================
--- trunk/sql/ccm-cms-types-address/upgrade/postgres-1.sql 2004-11-30
17:01:48 UTC (rev 32)
+++ trunk/sql/ccm-cms-types-address/upgrade/postgres-1.sql 2005-01-20
21:08:06 UTC (rev 33)
@@ -0,0 +1,22 @@
+--
+-- Copyright (C) 2003-2004 Red Hat Inc. All Rights Reserved.
+--
+-- This library is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU Lesser General Public License
+-- as published by the Free Software Foundation; either version 2.1 of
+-- the License, or (at your option) any later version.
+--
+-- This library is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+-- Lesser General Public License for more details.
+--
+-- You should have received a copy of the GNU Lesser General Public
+-- License along with this library; if not, write to the Free Software
+-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+--
+-- $Id:
//cms/content-types/address/dev/sql/ccm-cms-types-address/upgrade/postgres-1.sql#4
$
+-- $DateTime: 2004/08/17 23:15:09 $
+begin;
+\i ../default/upgrade/address-upgrade-1.sql
+end;
Added: trunk/sql/ccm-cms-types-address/upgrade/postgres-2.sql
===================================================================
--- trunk/sql/ccm-cms-types-address/upgrade/postgres-2.sql 2004-11-30
17:01:48 UTC (rev 32)
+++ trunk/sql/ccm-cms-types-address/upgrade/postgres-2.sql 2005-01-20
21:08:06 UTC (rev 33)
@@ -0,0 +1,22 @@
+--
+-- Copyright (C) 2003-2004 Red Hat Inc. All Rights Reserved.
+--
+-- This library is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU Lesser General Public License
+-- as published by the Free Software Foundation; either version 2.1 of
+-- the License, or (at your option) any later version.
+--
+-- This library is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+-- Lesser General Public License for more details.
+--
+-- You should have received a copy of the GNU Lesser General Public
+-- License along with this library; if not, write to the Free Software
+-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+--
+-- $Id:
//cms/content-types/address/dev/sql/ccm-cms-types-address/upgrade/postgres-2.sql#4
$
+-- $DateTime: 2004/08/17 23:15:09 $
+begin;
+\i ../postgres/upgrade/address-upgrade-2.sql
+end;
Added:
trunk/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Address.xml
===================================================================
---
trunk/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Address.xml
2004-11-30 17:01:48 UTC (rev 32)
+++
trunk/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Address.xml
2005-01-20 21:08:06 UTC (rev 33)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<ctd:content-types xmlns:ctd="http://xmlns.redhat.com/cms/content-types"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.redhat.com/cms/content-types
content-types.xsd">
+ <ctd:content-type label="Address"
+ description="A generic, non-country specific Address"
+ objectType="com.arsdigita.cms.contenttypes.Address"
+ classname="com.arsdigita.cms.contenttypes.Address">
+
+ <ctd:authoring-kit
createComponent="com.arsdigita.cms.ui.authoring.PageCreate">
+
+ <ctd:authoring-step
+ labelKey="address.authoring.basic_properties.title"
+ labelBundle="com.arsdigita.cms.contenttypes.AddressResources"
+ descriptionKey="address.authoring.basic_properties.description"
+ descriptionBundle="com.arsdigita.cms.contenttypes.AddressResources"
+ component="com.arsdigita.cms.contenttypes.ui.AddressPropertiesStep"
+ ordering="1"/>
+
+ <ctd:include
href="/WEB-INF/content-types/assign-categories-step.xml"/>
+ </ctd:authoring-kit>
+ </ctd:content-type>
+</ctd:content-types>
+
Added: trunk/src/ccm-cms-types-address.config
===================================================================
--- trunk/src/ccm-cms-types-address.config 2004-11-30 17:01:48 UTC (rev
32)
+++ trunk/src/ccm-cms-types-address.config 2005-01-20 21:08:06 UTC (rev
33)
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<registry>
+ <!-- nothing yet -->
+</registry>
Added: trunk/src/ccm-cms-types-address.load
===================================================================
--- trunk/src/ccm-cms-types-address.load 2004-11-30 17:01:48 UTC (rev
32)
+++ trunk/src/ccm-cms-types-address.load 2005-01-20 21:08:06 UTC (rev
33)
@@ -0,0 +1,16 @@
+<load>
+ <requires>
+ <table name="inits"/>
+ <table name="acs_objects"/>
+ <table name="cms_items"/>
+ <initializer class="com.arsdigita.cms.Initializer"/>
+ </requires>
+ <provides>
+ <table name="ct_addresses"/>
+ <initializer class="com.arsdigita.cms.contenttypes.AddressInitializer"/>
+ </provides>
+ <scripts>
+ <schema directory="ccm-cms-types-address"/>
+ <data class="com.arsdigita.cms.contenttypes.AddressLoader"/>
+ </scripts>
+</load>
Added: trunk/src/com/arsdigita/cms/contenttypes/Address.java
===================================================================
--- trunk/src/com/arsdigita/cms/contenttypes/Address.java 2004-11-30
17:01:48 UTC (rev 32)
+++ trunk/src/com/arsdigita/cms/contenttypes/Address.java 2005-01-20
21:08:06 UTC (rev 33)
@@ -0,0 +1,178 @@
+/*
+ * Copyright (C) 2002-2004 Red Hat Inc. All Rights Reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+package com.arsdigita.cms.contenttypes;
+
+import com.arsdigita.cms.util.GlobalizationUtil;
+
+import com.arsdigita.cms.ContentType;
+import com.arsdigita.cms.ContentPage;
+import com.arsdigita.domain.DataObjectNotFoundException;
+import com.arsdigita.persistence.DataObject;
+import com.arsdigita.persistence.OID;
+import com.arsdigita.util.UncheckedWrapperException;
+import com.arsdigita.util.Assert;
+import java.math.BigDecimal;
+
+/**
+ * This content type represents a generic address which is not country
specific.
+ *
+ * @author <a href="mailto:dominik@xxxxxxxxxx">Dominik Kacprzak</a>
+ * @version $Revision: #6 $ $Date: 2004/08/17 $
+ **/
+public class Address extends ContentPage {
+
+ /** PDL property name for address */
+ public static final String ADDRESS = "address";
+ /** PDL property name for country iso code */
+ public static final String ISO_COUNTRY_CODE = "isoCountryCode";
+ /** PDL property name for postal code */
+ public static final String POSTAL_CODE = "postalCode";
+ /** PDL property name for phone number */
+ public static final String PHONE = "phone";
+ /** PDL property name for mobile phone number */
+ public static final String MOBILE = "mobile";
+ /** PDL property name for fax number */
+ public static final String FAX = "fax";
+ /** PDL property name for email address */
+ public static final String EMAIL = "email";
+ /** PDL property name for notes */
+ public static final String NOTES = "notes";
+ /** PDL property name for URI*/
+ public static final String URI = "uri";
+
+ /** Data object type for this domain object */
+ public static final String BASE_DATA_OBJECT_TYPE
+ = "com.arsdigita.cms.contenttypes.Address";
+
+ public Address() {
+ this(BASE_DATA_OBJECT_TYPE);
+ }
+
+ public Address(BigDecimal id) throws DataObjectNotFoundException {
+ this(new OID(BASE_DATA_OBJECT_TYPE, id));
+ }
+
+ public Address(OID id) throws DataObjectNotFoundException {
+ super(id);
+ }
+
+ public Address(DataObject obj) {
+ super(obj);
+ }
+
+ public Address(String type) {
+ super(type);
+ }
+
+ public void beforeSave() {
+ super.beforeSave();
+
+ Assert.exists(getContentType(), ContentType.class);
+ }
+
+ /* accessors *****************************************************/
+ public String getAddress( ) {
+ return ( String ) get( ADDRESS );
+ }
+
+ public void setAddress( String address ) {
+ set( ADDRESS, address );
+ }
+
+ public String getCountryIsoCode( ) {
+ DataObject obj = ( DataObject ) get( ISO_COUNTRY_CODE );
+ if ( obj != null ) {
+ IsoCountry country = new IsoCountry( obj );
+ return country.getIsoCode( );
+ }
+ return null;
+ }
+
+ public void setCountryIsoCode( String isoCode ) {
+ IsoCountry assn = null;
+ try {
+ OID oid = new OID( IsoCountry.BASE_DATA_OBJECT_TYPE );
+ oid.set( IsoCountry.ISO_CODE, isoCode );
+
+ assn = new IsoCountry( oid );
+ } catch (DataObjectNotFoundException e) {
+ assn = new IsoCountry( );
+ assn.setIsoCode( isoCode );
+ assn.save();
+ }
+ setAssociation( ISO_COUNTRY_CODE, assn );
+ }
+
+ public String getPostalCode( ) {
+ return ( String ) get( POSTAL_CODE );
+ }
+
+ public void setPostalCode( String postalCode ) {
+ set( POSTAL_CODE, postalCode );
+ }
+
+ public String getPhone( ) {
+ return ( String ) get( PHONE );
+ }
+
+ public void setPhone( String phone ) {
+ set( PHONE, phone );
+ }
+
+ public String getMobile( ) {
+ return ( String ) get( MOBILE );
+ }
+
+ public void setMobile( String mobile ) {
+ set( MOBILE, mobile );
+ }
+
+ public String getFax( ) {
+ return ( String ) get( FAX );
+ }
+
+ public void setFax( String fax ) {
+ set( FAX, fax );
+ }
+
+ public String getEmail( ) {
+ return ( String ) get( EMAIL );
+ }
+
+ public void setEmail( String email ) {
+ set( EMAIL, email );
+ }
+
+ public String getNotes( ) {
+ return ( String ) get( NOTES );
+ }
+
+ public void setNotes( String notes ) {
+ set( NOTES, notes );
+ }
+
+ public void setURI( String uri) {
+ set(URI, uri);
+ }
+
+ public String getURI() {
+ return (String)get(URI);
+ }
+
+}
Added: trunk/src/com/arsdigita/cms/contenttypes/AddressInitializer.java
===================================================================
--- trunk/src/com/arsdigita/cms/contenttypes/AddressInitializer.java
2004-11-30 17:01:48 UTC (rev 32)
+++ trunk/src/com/arsdigita/cms/contenttypes/AddressInitializer.java
2005-01-20 21:08:06 UTC (rev 33)
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2003-2004 Red Hat Inc. All Rights Reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+package com.arsdigita.cms.contenttypes;
+
+import com.arsdigita.cms.ContentType;
+
+import com.arsdigita.db.*;
+import com.arsdigita.persistence.pdl.*;
+import com.arsdigita.runtime.*;
+import com.arsdigita.domain.DomainObject;
+import com.arsdigita.domain.DomainObjectFactory;
+import com.arsdigita.domain.DomainObjectInstantiator;
+import com.arsdigita.persistence.DataObject;
+
+import org.apache.log4j.Logger;
+
+/**
+ * The CMS initializer.
+ *
+ * @author Justin Ross <jross@xxxxxxxxxx>
+ * @version $Id:
//cms/content-types/address/dev/src/com/arsdigita/cms/contenttypes/AddressInitializer.java#6
$
+ */
+public class AddressInitializer extends ContentTypeInitializer {
+ public final static String versionId =
+ "$Id:
//cms/content-types/address/dev/src/com/arsdigita/cms/contenttypes/AddressInitializer.java#6
$" +
+ "$Author: dennis $" +
+ "$DateTime: 2004/08/17 23:15:09 $";
+
+ private static final Logger s_log =
Logger.getLogger(AddressInitializer.class);
+
+ public AddressInitializer() {
+ super("ccm-cms-types-address.pdl.mf",
+ Address.BASE_DATA_OBJECT_TYPE);
+ }
+
+ public void init(DomainInitEvent evt) {
+ super.init(evt);
+
+ // register the DomainObjectInstantiator from ISO Country
+ DomainObjectInstantiator instIsocountry =
+ new DomainObjectInstantiator() {
+ public DomainObject doNewInstance(DataObject dataObject) {
+ return new IsoCountry(dataObject);
+ }
+ public DomainObjectInstantiator
resolveInstantiator(DataObject obj) {
+ return this;
+ }
+ };
+ DomainObjectFactory.registerInstantiator(
+ IsoCountry.BASE_DATA_OBJECT_TYPE,
+ instIsocountry
+ );
+ }
+
+ public String[] getStylesheets() {
+ return new String[] {
"/static/content-types/com/arsdigita/cms/contenttypes/Address.xsl" };
+ }
+}
Added: trunk/src/com/arsdigita/cms/contenttypes/AddressLoader.java
===================================================================
--- trunk/src/com/arsdigita/cms/contenttypes/AddressLoader.java 2004-11-30
17:01:48 UTC (rev 32)
+++ trunk/src/com/arsdigita/cms/contenttypes/AddressLoader.java 2005-01-20
21:08:06 UTC (rev 33)
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2003-2004 Red Hat Inc. All Rights Reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+package com.arsdigita.cms.contenttypes;
+
+
+import com.arsdigita.cms.contenttypes.AbstractContentTypeLoader;
+
+import org.apache.log4j.Logger;
+
+/**
+ * Loader.
+ *
+ * @author Justin Ross <jross@xxxxxxxxxx>
+ * @version $Id:
//cms/content-types/address/dev/src/com/arsdigita/cms/contenttypes/AddressLoader.java#7
$
+ */
+public class AddressLoader extends AbstractContentTypeLoader {
+ public final static String versionId =
+ "$Id:
//cms/content-types/address/dev/src/com/arsdigita/cms/contenttypes/AddressLoader.java#7
$" +
+ "$Author: dennis $" +
+ "$DateTime: 2004/08/17 23:15:09 $";
+
+ private static final Logger s_log =
Logger.getLogger(AddressLoader.class);
+
+ private static final String[] TYPES = {
+ "/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Address.xml"
+ };
+
+ public String[] getTypes() {
+ return TYPES;
+ }
+}
Added: trunk/src/com/arsdigita/cms/contenttypes/AddressResources.properties
===================================================================
--- trunk/src/com/arsdigita/cms/contenttypes/AddressResources.properties
2004-11-30 17:01:48 UTC (rev 32)
+++ trunk/src/com/arsdigita/cms/contenttypes/AddressResources.properties
2005-01-20 21:08:06 UTC (rev 33)
@@ -0,0 +1,18 @@
+address.authoring.basic_properties.title=Address Properties
+address.authoring.basic_properties.description=Edit the basic address
properties
+address.authoring.categories.title=Assign categories
+address.authoring.categories.description=Assign categories
+cms.contenttypes.ui.address.address=Address
+cms.contenttypes.ui.address.email=Email
+cms.contenttypes.ui.address.fax=Fax
+cms.contenttypes.ui.address.iso_country_code=Country
+cms.contenttypes.ui.address.mobile=Mobile
+cms.contenttypes.ui.address.phone=Phone
+cms.contenttypes.ui.address.postal_code=Postal Code
+cms.contenttypes.ui.address.email.desc=Means of contacting someone at this
address
+cms.contenttypes.ui.address.email.hint=Means of contacting someone at this
address
+cms.contenttypes.ui.address.notes=Notes
+cms.contenttypes.ui.address.uri=URL
+cms.contenttypes.ui.address.uri.desc=A URL to find more information about
this Address
+cms.contenttypes.ui.address.uri.hint=A URL to find more information about
this Address
+cms.contenttypes.ui.address.error_iso_country=You must select a country
Added: trunk/src/com/arsdigita/cms/contenttypes/IsoCountry.java
===================================================================
--- trunk/src/com/arsdigita/cms/contenttypes/IsoCountry.java 2004-11-30
17:01:48 UTC (rev 32)
+++ trunk/src/com/arsdigita/cms/contenttypes/IsoCountry.java 2005-01-20
21:08:06 UTC (rev 33)
@@ -0,0 +1,114 @@
+/*
+ * Copyright (C) 2002-2004 Red Hat Inc. All Rights Reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+package com.arsdigita.cms.contenttypes;
+
+import com.arsdigita.domain.DataObjectNotFoundException;
+import com.arsdigita.domain.DomainObject;
+import com.arsdigita.domain.DomainCollection;
+import com.arsdigita.kernel.ACSObject;
+import com.arsdigita.persistence.DataCollection;
+import com.arsdigita.persistence.DataObject;
+import com.arsdigita.persistence.OID;
+import com.arsdigita.persistence.SessionManager;
+
+import java.util.Iterator;
+import java.util.LinkedList;
+
+/**
+ * This class represents country information, iso code and name. The country
+ * information is being used by {@link
com.arsdigita.cms.contenttypes.Address}.
+ *
+ * @author <a href="mailto:dominik@xxxxxxxxxx">Dominik Kacprzak</a>
+ * @version $Revision: #4 $ $Date: 2004/08/17 $
+ **/
+public class IsoCountry extends DomainObject {
+
+ /** Data object type for this domain object */
+ public static final String BASE_DATA_OBJECT_TYPE
+ = "com.arsdigita.cms.contenttypes.IsoCountry";
+
+ /** PDL property name for country iso code */
+ public static final String ISO_CODE = "isoCode";
+ /** PDL property name for country name */
+ public static final String COUNTRY_NAME = "countryName";
+
+ public IsoCountry( ) {
+ super( BASE_DATA_OBJECT_TYPE );
+ }
+
+ public IsoCountry( OID oid ) throws DataObjectNotFoundException {
+ super( oid );
+ }
+
+ public IsoCountry( DataObject obj ) {
+ super(obj);
+ }
+
+ public String getIsoCode( ) {
+ return ( String ) get( ISO_CODE );
+ }
+
+ public void setIsoCode( String isoCode ) {
+ set( ISO_CODE, isoCode );
+ }
+
+ /**
+ *
+ */
+ public String getCountryName( ) {
+ return ( String ) get( COUNTRY_NAME );
+ }
+
+ /**
+ * Sets country name
+ *
+ * @param countryName
+ */
+ public void setCountryName( String countryName ) {
+ set( COUNTRY_NAME, countryName );
+ }
+
+ public static DomainCollection retrieveAll() {
+ DataCollection isoCodes = SessionManager.getSession()
+ .retrieve( IsoCountry.BASE_DATA_OBJECT_TYPE );
+ isoCodes.addOrder(COUNTRY_NAME);
+ return new DomainCollection(isoCodes) {};
+ }
+
+ /**
+ * Returns iterator of all available iso country codes as strings.
+ *
+ * @return iterator or <code>null</code> if there is no country codes
+ * available
+ */
+ public static Iterator getIsoCodes( ) {
+ LinkedList list = new LinkedList();
+ // get all iso codes
+ DataCollection isoCodes = SessionManager.getSession()
+ .retrieve( IsoCountry.BASE_DATA_OBJECT_TYPE );
+ while ( isoCodes.next() ) {
+ IsoCountry country = new IsoCountry( isoCodes.getDataObject( ) );
+ list.addLast( country.getIsoCode() );
+ }
+ if ( list.size() != 0 ) {
+ return list.iterator();
+ }
+ return null;
+ }
+}
Added: trunk/src/com/arsdigita/cms/contenttypes/ui/AddressPropertiesStep.java
===================================================================
--- trunk/src/com/arsdigita/cms/contenttypes/ui/AddressPropertiesStep.java
2004-11-30 17:01:48 UTC (rev 32)
+++ trunk/src/com/arsdigita/cms/contenttypes/ui/AddressPropertiesStep.java
2005-01-20 21:08:06 UTC (rev 33)
@@ -0,0 +1,146 @@
+/*
+ * Copyright (C) 2002-2004 Red Hat Inc. All Rights Reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+package com.arsdigita.cms.contenttypes.ui;
+
+import com.arsdigita.bebop.Component;
+import com.arsdigita.bebop.PageState;
+import com.arsdigita.cms.contenttypes.util.AddressGlobalizationUtil;
+import com.arsdigita.cms.contenttypes.Address;
+import com.arsdigita.cms.ContentItem;
+import com.arsdigita.cms.ContentPage;
+import com.arsdigita.cms.ItemSelectionModel;
+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 java.text.DateFormat;
+
+/**
+ * Authoring step to edit the simple attributes of the Address content type
(and
+ * its subclasses). This authoring step replaces the
+ * <code>com.arsdigita.ui.authoring.PageEdit</code> step for this type.
+ *
+ * @author <a href="mailto:dominik@xxxxxxxxxx">Dominik Kacprzak</a>
+ * @version $Revision: #6 $ $Date: 2004/08/17 $
+ *
+ **/
+public class AddressPropertiesStep extends SimpleEditStep {
+
+ /** The name of the editing sheet added to this step */
+ public static final String EDIT_SHEET_NAME = "edit";
+
+ public AddressPropertiesStep(ItemSelectionModel itemModel,
+ AuthoringKitWizard parent ) {
+ super(itemModel, parent );
+
+ setDefaultEditKey(EDIT_SHEET_NAME);
+ BasicPageForm editSheet;
+
+ editSheet = new AddressPropertyForm(itemModel, this);
+ add(EDIT_SHEET_NAME, "Edit",
+ new WorkflowLockedComponentAccess(editSheet, itemModel),
+ editSheet.getSaveCancelSection().getCancelButton() );
+
+ setDisplayComponent(getAddressPropertySheet(itemModel));
+ }
+
+ /**
+ * Returns a component that displays the properties of the Address
specified
+ * by the ItemSelectionModel passed in.
+ *
+ * @param itemModel The ItemSelectionModel to use
+ * @pre itemModel != null
+ * @return A component to display the state of the basic properties
+ * of the address content type.
+ **/
+ public static Component getAddressPropertySheet(ItemSelectionModel
+ itemModel ) {
+ DomainObjectPropertySheet sheet = new
DomainObjectPropertySheet(itemModel);
+
+ sheet.add((String) AddressGlobalizationUtil
+ .globalize("cms.contenttypes.ui.name").localize(),
+ Address.NAME );
+ sheet.add((String) AddressGlobalizationUtil
+ .globalize("cms.contenttypes.ui.title").localize(),
+ Address.TITLE);
+ sheet.add((String) AddressGlobalizationUtil
+ .globalize("cms.ui.authoring.page_launch_date").localize(),
+ ContentPage.LAUNCH_DATE,
+ new DomainObjectPropertySheet.AttributeFormatter() {
+ public String format(DomainObject item,
+ String attribute,
+ PageState state) {
+ ContentPage page = (ContentPage) item;
+ if (page.getLaunchDate() != null) {
+ return
DateFormat.getDateInstance(DateFormat.LONG)
+ .format(page.getLaunchDate());
+ } else {
+ return
(String)AddressGlobalizationUtil.globalize("cms.ui.unknown").localize();
+ }
+ }
+ });
+ sheet.add((String) AddressGlobalizationUtil
+
.globalize("cms.contenttypes.ui.address.address").localize(),
+ Address.ADDRESS);
+ sheet.add((String) AddressGlobalizationUtil
+ .globalize("cms.contenttypes.ui.address.iso_country_code")
+ .localize(),
+ Address.ISO_COUNTRY_CODE,
+ new DomainObjectPropertySheet.AttributeFormatter() {
+ public String format( DomainObject item,
+ String attribute,
+ PageState state ) {
+ Address address = ( Address ) item;
+ if ( address.getCountryIsoCode() != null ) {
+ return address.getCountryIsoCode();
+ } else {
+ return
(String)AddressGlobalizationUtil.globalize("cms.ui.unknown").localize();
+ }
+ }
+ });
+ sheet.add((String) AddressGlobalizationUtil
+
.globalize("cms.contenttypes.ui.address.postal_code").localize(),
+ Address.POSTAL_CODE);
+ sheet.add((String) AddressGlobalizationUtil
+
.globalize("cms.contenttypes.ui.address.phone").localize(),
+ Address.PHONE);
+ sheet.add((String) AddressGlobalizationUtil
+
.globalize("cms.contenttypes.ui.address.mobile").localize(),
+ Address.MOBILE);
+ sheet.add((String) AddressGlobalizationUtil
+ .globalize("cms.contenttypes.ui.address.fax").localize(),
+ Address.FAX);
+ sheet.add((String) AddressGlobalizationUtil
+
.globalize("cms.contenttypes.ui.address.email").localize(),
+ Address.EMAIL);
+
+ sheet.add((String) AddressGlobalizationUtil
+ .globalize("cms.contenttypes.ui.address.uri").localize(),
+ Address.URI);
+
+ sheet.add((String) AddressGlobalizationUtil
+
.globalize("cms.contenttypes.ui.address.notes").localize(),
+ Address.NOTES);
+
+ return sheet;
+ }
+}
Added: trunk/src/com/arsdigita/cms/contenttypes/ui/AddressPropertyForm.java
===================================================================
--- trunk/src/com/arsdigita/cms/contenttypes/ui/AddressPropertyForm.java
2004-11-30 17:01:48 UTC (rev 32)
+++ trunk/src/com/arsdigita/cms/contenttypes/ui/AddressPropertyForm.java
2005-01-20 21:08:06 UTC (rev 33)
@@ -0,0 +1,267 @@
+/*
+ * Copyright (C) 2002-2004 Red Hat Inc. All Rights Reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+package com.arsdigita.cms.contenttypes.ui;
+
+import com.arsdigita.bebop.FormData;
+import com.arsdigita.bebop.FormProcessException;
+import com.arsdigita.bebop.Label;
+import com.arsdigita.bebop.event.FormInitListener;
+import com.arsdigita.bebop.event.FormProcessListener;
+import com.arsdigita.bebop.event.FormSectionEvent;
+import com.arsdigita.bebop.event.FormSubmissionListener;
+import com.arsdigita.bebop.event.ParameterEvent;
+import com.arsdigita.bebop.event.ParameterListener;
+import com.arsdigita.bebop.event.ParameterListener;
+import com.arsdigita.bebop.form.Option;
+import com.arsdigita.bebop.form.SingleSelect;
+import com.arsdigita.bebop.form.TextArea;
+import com.arsdigita.bebop.form.TextField;
+import com.arsdigita.bebop.parameters.NotNullValidationListener;
+import com.arsdigita.bebop.parameters.ParameterModel;
+import com.arsdigita.bebop.parameters.StringParameter;
+import com.arsdigita.bebop.parameters.URLValidationListener;
+import com.arsdigita.bebop.parameters.ParameterData;
+import com.arsdigita.cms.ItemSelectionModel;
+import com.arsdigita.cms.contenttypes.Address;
+import com.arsdigita.cms.contenttypes.util.AddressGlobalizationUtil;
+import com.arsdigita.cms.contenttypes.IsoCountry;
+import com.arsdigita.cms.ui.authoring.BasicPageForm;
+import com.arsdigita.domain.DomainCollection;
+import org.apache.log4j.Logger;
+
+/**
+ * Form to edit the basic properties of an address. These are address body,
+ * country, postal code, phone, mobile phone, fax, email address, and notes.
+ * This form can be extended to create forms for Address subclasses.
+ *
+ * @author <a href="mailto:dominik@xxxxxxxxxx">Dominik Kacprzak</a>
+ * @version $Revision: #5 $ $Date: 2004/08/17 $
+ **/
+public class AddressPropertyForm extends BasicPageForm
+ implements FormProcessListener, FormInitListener, FormSubmissionListener
{
+
+ private static final Logger s_log =
Logger.getLogger(AddressPropertyForm.class);
+
+ private AddressPropertiesStep m_step;
+
+ /** Address body parameter name */
+ public static final String ADDRESS = Address.ADDRESS;
+ /** Country iso code parameter name */
+ public static final String ISO_COUNTRY_CODE = Address.ISO_COUNTRY_CODE;
+ /** Postal code parameter name */
+ public static final String POSTAL_CODE = Address.POSTAL_CODE;
+ /** Phone number parameter name */
+ public static final String PHONE = Address.PHONE;
+ /** Mobile phone number parameter name */
+ public static final String MOBILE = Address.MOBILE;
+ /** Fax number parameter name */
+ public static final String FAX = Address.FAX;
+ /** Email address parameter name */
+ public static final String EMAIL = Address.EMAIL;
+ /** Address notes parameter name */
+ public static final String NOTES = Address.NOTES;
+ /** Address URI parameter name*/
+ public static final String URI = Address.URI;
+
+ /** Name of this form */
+ public static final String ID = "Address_edit";
+
+ /**
+ * Creates a new form to edit the Address object specified by the item
+ * selection model passed in.
+ *
+ * @param itemModel The ItemSelectionModel to use to obtain the Address
to
+ * work on
+ **/
+ public AddressPropertyForm( ItemSelectionModel itemModel ) {
+ this(itemModel,null);
+ }
+ /**
+ * Creates a new form to edit the Address object specified by the item
+ * selection model passed in.
+ *
+ * @param itemModel The ItemSelectionModel to use to obtain the Address
to
+ * work on
+ * @param step The AddressPropertiesStep which controls this form.
+ **/
+ public AddressPropertyForm( ItemSelectionModel itemModel,
AddressPropertiesStep step ) {
+ super( ID, itemModel );
+ m_step = step;
+ addSubmissionListener(this);
+ }
+
+ /**
+ * Adds widgets to the form.
+ **/
+ protected void addWidgets() {
+ super.addWidgets();
+
+ add( new Label( AddressGlobalizationUtil.globalize(
"cms.contenttypes.ui.address.address" ) ) );
+ ParameterModel addressBodyParam = new StringParameter( ADDRESS );
+ addressBodyParam.addParameterListener( new
NotNullValidationListener( ) );
+ TextArea addressBody = new TextArea( addressBodyParam );
+ addressBody.setRows(5);
+ addressBody.setCols(30);
+ add( addressBody );
+
+ add( new Label( AddressGlobalizationUtil.globalize(
"cms.contenttypes.ui.address.iso_country_code" ) ) );
+ ParameterModel isoCountryCodeParam = new StringParameter(
ISO_COUNTRY_CODE );
+ //isoCountryCodeParam.addParameterListener( new
NotNullValidationListener( ) );
+ SingleSelect isoCountryCode = new SingleSelect( isoCountryCodeParam
);
+
+ isoCountryCode.addOption( new Option( "", new
Label(AddressGlobalizationUtil.globalize("cms.ui.select_one" ) )));
+
+
+ // retrieve country iso codes
+ DomainCollection countries = IsoCountry.retrieveAll();
+ while (countries.next()) {
+ IsoCountry country = (IsoCountry)countries.getDomainObject();
+ isoCountryCode.addOption( new Option( country.getIsoCode(),
+ country.getCountryName()));
+ }
+
+ isoCountryCode.addValidationListener(
+ new ParameterListener() {
+ public void validate(ParameterEvent e) throws
FormProcessException {
+ // the --select one-- option is not allowed
+ ParameterData data = e.getParameterData();
+ String isoCode = (String) data.getValue() ;
+ s_log.debug("ISO code is : " + isoCode);
+ if (isoCode == null || isoCode.length() == 0) {
+ data.addError(
+ (String)AddressGlobalizationUtil.globalize(
+
"cms.contenttypes.ui.address.error_iso_country").localize());
+ }
+ }});
+
+ add( isoCountryCode );
+
+ add( new Label( AddressGlobalizationUtil.globalize(
"cms.contenttypes.ui.address.postal_code" ) ) );
+ ParameterModel postalCodeParam = new StringParameter( POSTAL_CODE );
+ //postalCodeParam.addParameterListener( new
NotNullValidationListener( ) );
+ TextField postalCode = new TextField( postalCodeParam );
+ postalCode.setMaxLength( 20 );
+ add( postalCode );
+
+ add( new Label( AddressGlobalizationUtil.globalize(
"cms.contenttypes.ui.address.phone" ) ) );
+ ParameterModel phoneParam = new StringParameter( PHONE );
+ TextField phone = new TextField( phoneParam );
+ phone.setSize(20);
+ phone.setMaxLength( 20 );
+ add( phone );
+
+ add( new Label( AddressGlobalizationUtil.globalize(
"cms.contenttypes.ui.address.mobile" ) ) );
+ ParameterModel mobileParam = new StringParameter( MOBILE );
+ TextField mobile = new TextField( mobileParam );
+ mobile.setSize(20);
+ mobile.setMaxLength( 20 );
+ add( mobile );
+
+ add( new Label( AddressGlobalizationUtil.globalize(
"cms.contenttypes.ui.address.fax" ) ) );
+ ParameterModel faxParam = new StringParameter( FAX );
+ TextField fax = new TextField( faxParam );
+ fax.setSize(20);
+ fax.setMaxLength( 20 );
+ add( fax );
+
+ add( new Label( AddressGlobalizationUtil.globalize(
"cms.contenttypes.ui.address.email" ) ) );
+ ParameterModel emailParam = new StringParameter( EMAIL );
+ TextField email = new TextField( emailParam );
+ email.setSize(25);
+ email.setMaxLength( 75 );
+ email.setHint(AddressGlobalizationUtil.globalize(
"cms.contenttypes.ui.address.email.hint").localize().toString());
+ add( email );
+ add(new Label(""));
+ add(new Label(AddressGlobalizationUtil.globalize(
"cms.contenttypes.ui.address.email.desc" ) ) );
+
+ add( new Label( AddressGlobalizationUtil.globalize(
"cms.contenttypes.ui.address.uri" ) ) );
+ ParameterModel uriParam = new StringParameter( URI );
+ TextField uri = new TextField( uriParam );
+ uri.addValidationListener(new URLValidationListener());
+ uri.setSize(30);
+ uri.setMaxLength( 250 );
+ uri.setHint(AddressGlobalizationUtil.globalize(
"cms.contenttypes.ui.address.uri.hint").localize().toString());
+ add( uri );
+ add(new Label(""));
+ add(new Label(AddressGlobalizationUtil.globalize(
"cms.contenttypes.ui.address.uri.desc" ) ) );
+
+ add( new Label( AddressGlobalizationUtil.globalize(
"cms.contenttypes.ui.address.notes" ) ) );
+ ParameterModel notesParam = new StringParameter( NOTES );
+ TextArea notes = new TextArea( notesParam );
+ notes.setRows(8);
+ notes.setCols(30);
+ add( notes );
+ }
+
+ /**
+ * Form initialization hook. Fills widgets with data.
+ **/
+ public void init(FormSectionEvent fse) {
+ FormData data = fse.getFormData();
+ Address address = ( Address ) super.initBasicWidgets(fse);
+
+ data.put( ADDRESS, address.getAddress() );
+ data.put( ISO_COUNTRY_CODE, address.getCountryIsoCode() );
+ data.put( POSTAL_CODE, address.getPostalCode() );
+ data.put( PHONE, address.getPhone() );
+ data.put( MOBILE, address.getMobile() );
+ data.put( FAX, address.getFax() );
+ data.put( EMAIL, address.getEmail() );
+ data.put( URI, address.getURI() );
+ data.put( NOTES, address.getNotes() );
+
+ }
+
+ /** Cancels streamlined editing. */
+ public void submitted( FormSectionEvent fse ) {
+ if (m_step != null &&
+ getSaveCancelSection().getCancelButton()
+ .isSelected( fse.getPageState())) {
+ m_step.cancelStreamlinedCreation(fse.getPageState());
+ }
+ }
+
+ /**
+ * Form processing hook. Saves Address object.
+ **/
+ public void process(FormSectionEvent fse) {
+ FormData data = fse.getFormData();
+
+ Address address = ( Address ) super.processBasicWidgets( fse );
+
+ // save only if save button was pressed
+ if ( address != null &&
+
getSaveCancelSection().getSaveButton().isSelected(fse.getPageState())) {
+
+ address.setAddress( ( String ) data.get( ADDRESS ) );
+ address.setCountryIsoCode( ( String ) data.get( ISO_COUNTRY_CODE
) );
+ address.setPostalCode( ( String ) data.get( POSTAL_CODE ) );
+ address.setPhone( ( String ) data.get( PHONE ) );
+ address.setMobile( ( String ) data.get( MOBILE ) );
+ address.setFax( ( String ) data.get( FAX ) );
+ address.setEmail( ( String ) data.get( EMAIL ) );
+ address.setURI( ( String ) data.get( URI ) );
+ address.setNotes( ( String ) data.get( NOTES ) );
+ address.save();
+ }
+ if (m_step != null) {
+ m_step.maybeForwardToNextStep(fse.getPageState());
+ }
+ }
+}
Added:
trunk/src/com/arsdigita/cms/contenttypes/util/AddressGlobalizationUtil.java
===================================================================
---
trunk/src/com/arsdigita/cms/contenttypes/util/AddressGlobalizationUtil.java
2004-11-30 17:01:48 UTC (rev 32)
+++
trunk/src/com/arsdigita/cms/contenttypes/util/AddressGlobalizationUtil.java
2005-01-20 21:08:06 UTC (rev 33)
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2004 Red Hat Inc. All Rights Reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+package com.arsdigita.cms.contenttypes.util;
+
+import com.arsdigita.globalization.GlobalizedMessage;
+
+/**
+ * <p>
+ * .
+ * Contains methods to simplify globalizing keys
+ * </p>
+ *
+ * @author <a href="mailto:randyg@xxxxxxxxxxxxx">randyg@xxxxxxxxxxxxx</a>
+ * @version $Revision: #4 $ $Date: 2004/08/17 $
+ */
+
+public class AddressGlobalizationUtil {
+
+ final public static String BUNDLE_NAME =
+ "com.arsdigita.cms.contenttypes.util.AddressResourceBundle";
+
+ /**
+ * This returns a globalized message using the type specific bundle,
+ * BUNDLE_NAME
+ */
+ public static GlobalizedMessage globalize(String key) {
+ return new GlobalizedMessage(key, BUNDLE_NAME);
+ }
+
+ /**
+ * This returns a globalized message using the type specific bundle,
+ * BUNDLE_NAME
+ */
+ public static GlobalizedMessage globalize(String key, Object[] args) {
+ return new GlobalizedMessage(key, BUNDLE_NAME, args);
+ }
+}
Added:
trunk/src/com/arsdigita/cms/contenttypes/util/AddressResourceBundle.java
===================================================================
--- trunk/src/com/arsdigita/cms/contenttypes/util/AddressResourceBundle.java
2004-11-30 17:01:48 UTC (rev 32)
+++ trunk/src/com/arsdigita/cms/contenttypes/util/AddressResourceBundle.java
2005-01-20 21:08:06 UTC (rev 33)
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2004 Red Hat Inc. All Rights Reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+package com.arsdigita.cms.contenttypes.util;
+
+import java.util.PropertyResourceBundle;
+import java.util.ResourceBundle;
+import java.util.Enumeration;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import com.arsdigita.globalization.ChainedResourceBundle;
+import com.arsdigita.cms.CMSGlobalized;
+
+/**
+ * Form to edit the basic properties of an event. This form can be extended
to
+ * create forms for Event subclasses.
+ **/
+public class AddressResourceBundle extends ChainedResourceBundle implements
CMSGlobalized {
+
+ public final static String ADDRESS_BUNDLE_NAME =
+ "com.arsdigita.cms.contenttypes.AddressResources";
+
+ public AddressResourceBundle() {
+ super();
+ addBundle((PropertyResourceBundle)getBundle(ADDRESS_BUNDLE_NAME));
+ addBundle((PropertyResourceBundle)getBundle(BUNDLE_NAME));
+ }
+}
Added:
trunk/web/static/content-types/com/arsdigita/cms/contenttypes/Address.xsl
===================================================================
--- trunk/web/static/content-types/com/arsdigita/cms/contenttypes/Address.xsl
2004-11-30 17:01:48 UTC (rev 32)
+++ trunk/web/static/content-types/com/arsdigita/cms/contenttypes/Address.xsl
2005-01-20 21:08:06 UTC (rev 33)
@@ -0,0 +1,111 @@
+<!DOCTYPE stylesheet [
+<!ENTITY nbsp " " ><!-- no-break space = non-breaking space, U+00A0
ISOnum -->
+]>
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:cms="http://www.arsdigita.com/cms/1.0"
+ version="1.0">
+
+ <xsl:template
match="cms:item[objectType='com.arsdigita.cms.contenttypes.Address']"
mode="cms:CT_graphics"
+ name="cms:CT_graphics_com_arsdigita_cms_contenttypes_Address">
+ <table width="435" border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td class="contentTitle" align="left" valign="top">
+ <xsl:value-of select="./title"/>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <table width="100%" border="0" cellspacing="0" cellpadding="0">
+ <xsl:if test="./address">
+ <tr>
+ <th>Address:</th>
+ <td class="contentText" valign="top"
align="left"><xsl:value-of select="./address"/></td>
+ </tr>
+ </xsl:if>
+ <xsl:if test="./postalCode">
+ <tr>
+ <th>Postal Code:</th>
+ <td class="contentText" valign="top"
align="left"><xsl:value-of select="./postalCode"/></td>
+ </tr>
+ </xsl:if>
+ <xsl:if test="./isoCountryCode/countryName">
+ <tr>
+ <th>Country:</th>
+ <td class="contentText" valign="top"
align="left"><xsl:value-of select="./isoCountryCode/countryName"/></td>
+ </tr>
+ </xsl:if>
+ <xsl:if test="./phone">
+ <tr>
+ <th>Phone:</th>
+ <td class="contentText" valign="top"
align="left"><xsl:value-of select="./phone"/></td>
+ </tr>
+ </xsl:if>
+ <xsl:if test="./mobile">
+ <tr>
+ <th>Mobile:</th>
+ <td class="contentText" valign="top"
align="left"><xsl:value-of select="./mobile"/></td>
+ </tr>
+ </xsl:if>
+ <xsl:if test="./fax">
+ <tr>
+ <th>Fax:</th>
+ <td class="contentText" valign="top"
align="left"><xsl:value-of select="./fax"/></td>
+ </tr>
+ </xsl:if>
+ <xsl:if test="./email">
+ <tr>
+ <th>E-Mail:</th>
+ <td class="contentText" valign="top"
align="left"><xsl:value-of select="./email"/></td>
+ </tr>
+ </xsl:if>
+ <xsl:if test="./notes">
+ <tr>
+ <th>Notes:</th>
+ <td class="contentText" valign="top"
align="left"><xsl:value-of select="./notes"/></td>
+ </tr>
+ </xsl:if>
+ </table>
+ </td>
+ </tr>
+ </table>
+ </xsl:template>
+
+ <xsl:template
match="cms:item[objectType='com.arsdigita.cms.contenttypes.Address']"
mode="cms:CT_text"
+ name="cms:CT_text_com_arsdigita_cms_contenttypes_Address">
+ <h1 class="title"><xsl:value-of select="./title"/></h1>
+ <xsl:if test="./address">
+ <span class="subtitle">Address</span>
+ <span class="text"><xsl:value-of select="./address"/></span><br/>
+ </xsl:if>
+ <xsl:if test="./postalCode">
+ <span class="subtitle">Postal Code</span>
+ <span class="text"><xsl:value-of select="./postalCode"/></span><br/>
+ </xsl:if>
+ <xsl:if test="./isoCountryCode/countryName">
+ <span class="subtitle">Country</span>
+ <span class="text"><xsl:value-of select="./country"/></span><br/>
+ </xsl:if>
+ <xsl:if test="./phone">
+ <span class="subtitle">Phone</span>
+ <span class="text"><xsl:value-of select="./phone"/></span><br/>
+ </xsl:if>
+ <xsl:if test="./mobile">
+ <span class="subtitle">Mobile</span>
+ <span class="text"><xsl:value-of select="./mobile"/></span><br/>
+ </xsl:if>
+ <xsl:if test="./fax">
+ <span class="subtitle">Fax</span>
+ <span class="text"><xsl:value-of select="./fax"/></span><br/>
+ </xsl:if>
+ <xsl:if test="./email">
+ <span class="subtitle">E-Mail</span>
+ <span class="text"><xsl:value-of select="./email"/></span><br/>
+ </xsl:if>
+ <xsl:if test="./notes">
+ <span class="subtitle">Notes</span>
+ <span class="text"><xsl:value-of select="./notes"/></span><br/>
+ </xsl:if>
+ </xsl:template>
+
+</xsl:stylesheet>
\ No newline at end of file
| Date Index --> | Thread Index --> |
Powered by MHonArc.
Copyright © 1999-2005, ObjectWeb Consortium | contact | webmaster.