Sun Java System Communications Express 6.3 Customization Guide

Phone

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.

Figure 7–1 Customizing Phone

Figure showing the five types of phone entries along
with a drop-down list of the priority order.

Example 7–13 displays the default code where Work phone is displayed as priority 1 and Home phone is displayed as priority 2.


Example 7–13 Default Code that Displays Work Phone as Priority 1 and Home 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 = '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.


Example 7–14 Code that Displays Home Phone as Priority 1 and Work Phoneas 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>