Address Sets Feature

Address sets is a new feature that we have introduced in newer versions of Directory Update and Directory Manager. Essentially, address sets allow the administrator to associate a field (such as an office location) with a street address, city, state, postal code, post office box, and country. When the use selects that specific office location and have the address information automatically filled in. Figure 1shows the address information after the user has selected and office from the drop-down list.


Image

Figure 1: Implementing an address set


In Figure 1, we have made all of the address fields non-editable so that once the user selects an office, they cannot edit the fields individually.


Configuring Address Sets

The address information and the field that matches up with the correct drop-down list are stored in the configuration XML files. For Directory Manager, the address information is stored in the AddressSets.xml file and the main configuration file for the user interface is the DirectorySettings.XML file

To enable Address Sets, edit the AddressSets.xml file and set the enabled option to enabled="true" in the <addressSettings…> tag.

<addressSettings controField="office" enabled="true" clearOnNoMatch="false">
  <addressSetting value="Office 1">
    <streetAddress>Street Address 1 </streetAddress>
        

Next, in the DirectorySettings.xml file file, choose the field you want to use, configure the type to be type=”dropdown” and then put in values for each address set you want to use. For example, if you are using the Office field, you must have offices for each address set you want to use.

<field id="office" label="Office" attribute="physicalDeliveryOfficename" visible="true" editable="true" type="dropdown" maxLength="128">
  <value>Office 1</value>
  <value>Office 2/</value>
  <value>Office 3/</value>
  <value>Office 4/</value>
</field>
        

Next, in the DirectorySettings.xml file, you will probably want to set each of the address fields so that it is visible, but it is set so that it is NOT editable. This will ensure that the selection that the user makes from the address set is visible to the user, but so they cannot try and edit it.

<!-- ADDRESS SECTION -->
<section id="address" label="Address" visible="true">
  <field id="streetAddress" label="Street Address" attribute="streetAddress" visible="true" editable="false" type="text" maxLength="1024" multiLine="true">
  <field id="roomNumber" label="Room #" attribute="roomNumber" visible="false" editable="false" type="text" maxLength="64">
  <field id="postOfficeBox" label="P.O. Box" attribute="postOfficeBox" visible="false" editable="false" type="text" maxLength="40">
  <field id="city" label="City" attribute="l" visible="true" editable="false" type="dropdown" maxLength="128">
    <value>City 1</value>
    <value>City 2</value>
    <value>City 3</value>
    <value>City 4</value>
  </field>
  <field id="stateOrProvince" label="State/Province" attribute="st" visible="true" editable="true" type="dropdown" maxLength="128">
        

Finally, for each value in the drop-down list (such as office), you must enter valid address information for that selection in the AddressSets.xml file. Below is an example for Office 1 (where the Office field is the control field).

<addressSettings controField="office" enabled="true" clearOnNoMatch="false">
  <addressSetting value="Office 1">
    <streetAddress>Street Address 1 </streetAddress>
    <city>City 1</city>
    <stateOrProvince>Alaska</stateOrProvince>
    <zipOrPostalCode>11111</zipOrPostalCode>
    <country>US</country>
    <officePhone>office phone 1</officePhone>
    <fax>fax 1</fax>
    <extensionAttribute1>extAtt 1</extensionAttribute1>
  </addressSetting>
  <addressSetting value="Office 2">
    <streetAddress>Street Address 2 </streetAddress>
        

Note that even if you do not use the Room Number or Post Office Box fields, the tags must be inside of each address setting tag.


Telephone Numbers in an Address Set

In the newest versions, we introduced the Address Sets feature; this means that you can populate the AddressSettings.XML file with the street, city, state, postal code, and country information and then when a user selects a field such as Office, that information will automatically be populated. The information is read from the AddressSetting.XML and automatically populated in the user interface for the user.

Here is an example of a user section from the AddressSettings.XML file. Notice that there are <officePhone>, <fax>, and <extensionAttribute1> attributes inside of the Address Set.

<addressSetting value="Office 1">
 <streetAddress>Street Address 1 </streetAddress>
 <city>City 1</city>
 <stateOrProvince>Alaska</stateOrProvince>
 <zipOrPostalCode>11111</zipOrPostalCode>
 <country>US</country>
 <officePhone>office phone 1</officePhone>
 <fax>fax 1</fax>
 <extensionAttribute1>extAtt 1</extensionAttribute1>
</addressSetting>
        

Technically, any attribute from the DirectorySettings.XML file can be added to an Address Set. However, if you add the attribute to a set, you must populate it with data; otherwise it will clear the data in the field.