Sun Java System Communications Express 6.3 Customization Guide

IM Nicknames

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.

Example 7–17 shows the default code that displays SunONE as the default selected service


Example 7–17 Default Code that Displays SunONE 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= '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


Example 7–18 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>