Add a New Zealand folder under the geodata folder
Before you begin
About this task
In this step, you create a folder for New Zealand under the geodata folder and add configuration files for country, address, and zone.
Procedure
- Navigate in the Project window to .
-
Right-click geodata and choose . Name the new package
NZ. - Copy the three files under the geodata/AU folder to this new folder. The three files are address-config.xml, country.xml, and zone-config.xml.
- Double-click the copied country.xml file to open it in the editor.
-
Add
Suburbto thevisibleFieldsdefinition and removeState:visibleFields= "Country,AddressLine1,AddressLine2,AddressLine3,Suburb,City,PostalCode" - Double-click the copied address-config.xml file to open it in the editor.
-
Set the file up to use
NZas the country and the name, and to useSuburbinstead ofState:<AddressConfig xmlns="http://guidewire.com/address-config"> <AddressDef name="NZ"> <Match> <Field name="Country" value="NZ"/> </Match> <Fields> <Field name="City" zonecode="city"> <AutoFillFromZone code="suburb"/> <AutoFillFromZone code="postalcode"/> </Field> <Field name="Suburb" zonecode="suburb"> <!-- Do not autofill from the city because a definitive match to suburb from the city isn't possible--> <AutoFillFromZone code="postalcode"/> </Field> <Field name="PostalCode" zonecode="postalcode"> <!-- Autofill first from suburb, because most people use suburb and postcode is a new concept. --> <!-- Postcodes are not unique by city. For example, 0420 maps to the following cities: Cable Bay, Coopers Beach, Mangonui, Taipa --> <AutoFillFromZone code="suburb"/> <AutoFillFromZone code="city"/> <ValidatorDef value="[0-9]{4}" description="Validator.PostalCode.NZ" input-mask="####"/> </Field> </Fields> </AddressDef> </AddressConfig> - Double-click the copied zone-config.xml file to open it in the editor.
-
Change the country code to
NZ:countryCode="NZ" -
Add
Suburbto the zone definitions, change its relationship to postal code and city, and removeState.This file defines the CSV file order for each zone data entry to be postal code, suburb, city.
<Zones countryCode="NZ"> <!-- The uniqueness of the postcode is based on the containing zone. The postcode's container is the country and the deciding factor is whether or not the postcode is unique within the country. and not the fact that the same postal code is shared by multiple cities. For example, 0420 maps to the following cities: Cable Bay, Coopers Beach, Mangonui, Taipa --> <Zone code="postalcode" fileColumn="1" granularity="1" regionMatchOrder="1"> <AddressZoneValue>Address.PostalCode.substring(0,4)</AddressZoneValue> <Links> <Link toZone="suburb" lookupOrder="1"/> <Link toZone="city" lookupOrder="2"/> </Links> </Zone> <Zone code="suburb" fileColumn="2" granularity="2" regionMatchOrder="2"> <!-- As described for the postcode, the containing zone for the suburb is the city and therefore the suburb is not unique per city. Some examples: HillCrest is a suburb of both Hamilton and Rotorua. Avondale is a suburb of Auckland and Christchurch --> <ZoneCode> city + ":" + suburb </ZoneCode> <AddressZoneValue> Address.City + ":" + Address.Suburb </AddressZoneValue> <Links> <Link toZone="postalcode" lookupOrder="1"/> <Link toZone="city" lookupOrder="2"/> </Links> </Zone> <Zone code="city" fileColumn="3" granularity="3" regionMatchOrder="3"> <!-- City (and town) names are unique in the country. They might have similar names such as Palmerston North, which is in the North Island, and Palmerston, which is in the South Island, but there is always a distinction. --> <AddressZoneValue> Address.City </AddressZoneValue> <Links> <Link toZone="postalcode" lookupOrder="1"/> <Link toZone="suburb" lookupOrder="2"/> </Links> </Zone> </Zones>
What to do next
The next step is Add a New Zealand field validator file.
