The files pertaining to the new contact or edit contact window are:
New contact - addcontact.xsl
Edit contact - editcontact.xsl
Common code shared among new and edit window can be accessed from common-editcontact.xsl
Table 7–2 lists the templates that are defined for the sections in New Contact or Edit Contact Window
Table 7–2 Templates Applicable for New/Edit Contact Window
Sections |
Template Name |
File |
---|---|---|
Skip Links |
- |
addcontact.xsl and editcontact.xsl |
Name and Company |
nameAndCompany |
common-editcontact.xsl |
Phone |
phone |
common-editcontact.xsl |
|
|
common-editcontact.xsl |
Addresses |
address |
common-editcontact.xsl |
IM Nicknames |
IM |
common-editcontact.xsl |
Web Addresses |
onlineInfos |
common-editcontact.xsl |
Notes |
notes |
common-editcontact.xsl |
You can customize the window by changing labels or reordering the listed sections in any desired order.
In addcontact.xsl, the `edit-abperson' template calls the templates.
Example 7–11 shows the code that displays Address before Online information.
<xsl:call-template name="address"> <xsl:with-param name="abperson" select="$abperson"/> </xsl:call-template> <xsl:call-template name="onlineInfos"> <xsl:with-param name="abperson" select="$abperson"/> </xsl:call-template> |
Example 7–12 shows how to display Online information before Address.
<xsl:call-template name="onlineInfos"> <xsl:with-param name="abperson" select="$abperson"/> </xsl:call-template> <xsl:call-template name="address"> <xsl:with-param name="abperson" select="$abperson"/> </xsl:call-template> |
Address Book allows you to set five types of phones that are defined in phoneEmailAndIM. The five definitions of `phone' template are called and the priority value is passed to them when the values are displayed in the drop-down list. You can change the priority orders.
Example 7–13 displays the default code where Work phone is displayed as priority 1 and Home phone is displayed as priority 2.
<option value="work"> <xsl:choose> <xsl:when test="$abperson"> <xsl:choose> <xsl:when test= "$abperson/phone[@priority = $priority]"> <xsl:if test= "$abperson/phone[@priority = $priority]/@type = 'work'"> <xsl:attribute name="selected"/> </xsl:if> </xsl:when> <xsl:otherwise> <xsl:if test="$priority = '1'"> <xsl:attribute name="selected"/> </xsl:if> </xsl:otherwise> </xsl:choose> </xsl:when> <xsl:otherwise> <xsl:if test="$priority = '1'"> <xsl:attribute name="selected"/> </xsl:if> </xsl:otherwise> </xsl:choose> <xsl:text>_Work</xsl:text> </option> <option value="home"> <xsl:choose> <xsl:when test="$abperson"> <xsl:choose> <xsl:when test= "$abperson/phone[@priority = $priority]"> <xsl:if test= "$abperson/phone[@priority = $priority]/@type = 'home'"> <xsl:attribute name="selected"/> </xsl:if> </xsl:when> <xsl:otherwise> <xsl:if test="$priority = '2'"> <xsl:attribute name="selected"/> </xsl:if> </xsl:otherwise> </xsl:choose> </xsl:when> <xsl:otherwise> <xsl:if test="$priority = '2'"> <xsl:attribute name="selected"/> </xsl:if> </xsl:otherwise> </xsl:choose> <xsl:text>_Home</xsl:text> </option> |
Example 7–14 shows how to change the code so that it displays Home phone as priority 1 and Work phone as priority 2.
<option value="work"> <xsl:choose> <xsl:when test="$abperson"> <xsl:choose> <xsl:when test="$abperson/phone[@priority = $priority]"> <xsl:if test= "$abperson/phone[@priority = $priority]/@type = 'work'"> <xsl:attribute name="selected"/> </xsl:if> </xsl:when> <xsl:otherwise> <xsl:if test="$priority = '2'"> <xsl:attribute name="selected"/> </xsl:if> </xsl:otherwise> </xsl:choose> </xsl:when> <xsl:otherwise> <xsl:if test="$priority = '2'"> <xsl:attribute name="selected"/> </xsl:if> </xsl:otherwise> </xsl:choose> <xsl:text>_Work</xsl:text> </option> <option value="home"> <xsl:choose> <xsl:when test="$abperson"> <xsl:choose> <xsl:when test="$abperson/phone[@priority = $priority]"> <xsl:if test="$abperson/phone[@priority = $priority]/@type = 'home'"> <xsl:attribute name="selected"/> </xsl:if> </xsl:when> <xsl:otherwise> <xsl:if test="$priority = '1'"> <xsl:attribute name="selected"/> </xsl:if> </xsl:otherwise> </xsl:choose> </xsl:when> <xsl:otherwise> <xsl:if test="$priority = '1'"> <xsl:attribute name="selected"/> </xsl:if> </xsl:otherwise> </xsl:choose> <xsl:text>_Home</xsl:text> </option> |
Address Book allows you to set three types of email that are defined in phoneEmailAndIM. The three definitions of email templates are called and the priority values are passed to them. You can change the priority orders.
Address Book allows you to set Birthday and Anniversary dates. These two dates are defined in the `importantDates' template. This template passes all relevant information to the `date' template.
You can customize the labels, change layout such as size of fields for the dates or their respective positions.
<tr> <xsl:call-template name="date"> <xsl:with-param name="abperson" select="$abperson"/> <xsl:with-param name="type" select="'birthday'"/> <xsl:with-param name="index" select="'1'"/> <xsl:with-param name="dateFormat" select="$dateFormat"/> <xsl:with-param name="width" select="40"/> <xsl:with-param name="fieldName" > <xsl:value-of select="$fieldPrefix" /> <xsl:text>dateOfBirth</xsl:text> </xsl:with-param> <xsl:with-param name="label"> <xsl:text>_Birthday</xsl:text> </xsl:with-param> <xsl:with-param name="tabindex" select="'52'"/> </xsl:call-template> <xsl:call-template name="date"> <xsl:with-param name="abperson" select="$abperson"/> <xsl:with-param name="type" select="'anniversary'"/> <xsl:with-param name="index" select="'2'"/> <xsl:with-param name="dateFormat" select="$dateFormat"/> <xsl:with-param name="width" select="65"/> <xsl:with-param name="fieldName" > <xsl:value-of select="$fieldPrefix" /> <xsl:text>anniversary</xsl:text> </xsl:with-param> <xsl:with-param name="label"> <xsl:text>_Anniversary</xsl:text> </xsl:with-param> <xsl:with-param name="tabindex" select="'55'"/> </xsl:call-template> </tr> |
Example 7–16 shows how to display the fields in a vertical layout and also rearranges Anniversary as the first date and Birthday as second
<tr> <xsl:call-template name="date"> <xsl:with-param name="abperson" select="$abperson"/> <xsl:with-param name="type" select="'anniversary'"/> <xsl:with-param name="index" select="'1'"/> <xsl:with-param name="dateFormat" select="$dateFormat"/> <xsl:with-param name="width" select="65"/> <xsl:with-param name="fieldName" > <xsl:value-of select="$fieldPrefix" /> <xsl:text>anniversary</xsl:text> </xsl:with-param> <xsl:with-param name="label"> <xsl:text>_Anniversary</xsl:text> </xsl:with-param> <xsl:with-param name="tabindex" select="'52'"/> </xsl:call-template> </tr> <tr> <xsl:call-template name="date"> <xsl:with-param name="abperson" select="$abperson"/> <xsl:with-param name="type" select="'birthday'"/> <xsl:with-param name="index" select="'2'"/> <xsl:with-param name="dateFormat" select="$dateFormat"/> <xsl:with-param name="width" select="40"/> <xsl:with-param name="fieldName" > <xsl:value-of select="$fieldPrefix" /> <xsl:text>dateOfBirth</xsl:text> </xsl:with-param> <xsl:with-param name="label"> <xsl:text>_Birthday</xsl:text> </xsl:with-param> <xsl:with-param name="tabindex" select="'55'"/> </xsl:call-template> |
Address Book allows you to set four web addresses for work, home, calendar, and freebusy. These addresses are defined in the `onlineInfos' template.
The `onlineInfos' template calls the following:
`weburl' that passes the priority for ordered display
`calendar' with type=”calendar” for calendar URL and type=”freebusy” for freebusyurl ”
You can change the order in which these addresses appear in a way similar to the examples illustrated above.
Address Book allows you to set two IM nicknames. The list of IM services that is supported by Address Book are listed in the drop-down menus. These two IM options are defined in `phoneEmailAndIM' template which calls the `im' template passing the relevant information.
You may change the order of IMs by changing their priorities as illustrated in previous examples.
You may also change the default selected services. The default services available in the drop down list are `SunONE' and `AIM'. The code checks for the passed priority and marks the appropriate option in the drop down as selected. You may shuffle the priority value in the code to select a different service. This code exists in the `im' template.
Example 7–17 shows the default code that displays SunONE as the default selected service
<option value="SunONE"> <xsl:choose> <xsl:when test= "$abperson and $abperson/im[@priority=$priority]"> <xsl:if test= "$abperson/im[@priority=$priority]/@service = 'SunONE'"> <xsl:attribute name="selected"/> </xsl:if> </xsl:when> <xsl:otherwise> <xsl:if test="$priority= '1'"> ---- This value is passed by 'phoneEmailAndIM' ---template to have this option default selected <xsl:attribute name="selected"/> </xsl:if> </xsl:otherwise> </xsl:choose> <xsl:text>iPlanet</xsl:text> </option> ..... <option value="Yahoo"> <xsl:choose> <xsl:when test="$abperson and $abperson/im[@priority=$priority]"> <xsl:if test="$abperson/im[@priority=$priority]/@service = 'Yahoo'"> <xsl:attribute name="selected"/> </xsl:if> </xsl:when> <xsl:otherwise> <xsl:if test="$priority = '3'"> <xsl:attribute name="selected"/> </xsl:if> </xsl:otherwise> </xsl:choose> <xsl:text>Yahoo</xsl:text> </option> |
Example 7–18 shows the modified code that displays Yahoo as the default Service
<option value="SunONE"> <xsl:choose> <xsl:when test="$abperson and $abperson/im[@priority=$priority]"> <xsl:if test="$abperson/im[@priority=$priority]/@service = 'SunONE'"> <xsl:attribute name="selected"/> </xsl:if> </xsl:when> <xsl:otherwise> <xsl:if test="$priority= '3'"> ---- This value is passed by 'phoneEmailAndIM' ----template to have this option default selected <xsl:attribute name="selected"/> </xsl:if> </xsl:otherwise> </xsl:choose> <xsl:text>iPlanet</xsl:text> </option> ..... <option value="Yahoo"> <xsl:choose> <xsl:when test="$abperson and $abperson/im[@priority=$priority]"> <xsl:if test="$abperson/im[@priority=$priority]/@service = 'Yahoo'"> <xsl:attribute name="selected"/> </xsl:if> </xsl:when> <xsl:otherwise> <xsl:if test="$priority = '1'"> <xsl:attribute name="selected"/> </xsl:if> </xsl:otherwise> </xsl:choose> <xsl:text>Yahoo</xsl:text> </option> |