123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: ASV
- (C) Copyright IBM Corp. 2005, 2010
- US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- -->
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xts="http://developer.cognos.com/schemas/xts/"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- exclude-result-prefixes="xsl xts xtsext">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:key name="prev-recipient-to" match="/root/*[local-name()='previouslyAdded']/item[./*[local-name()='type' and (string(.)='to' or string(.)='toGroup')]]/*[local-name()='searchPath']" use="."/>
- <xsl:key name="prev-recipient-cc" match="/root/*[local-name()='previouslyAdded']/item[./*[local-name()='type' and (string(.)='cc' or string(.)='ccGroup')]]/*[local-name()='searchPath']" use="."/>
- <xsl:key name="prev-recipient-bcc" match="/root/*[local-name()='previouslyAdded']/item[./*[local-name()='type' and (string(.)='bcc' or string(.)='bccGroup')]]/*[local-name()='searchPath']" use="."/>
-
- <xsl:template match="/root" priority="2">
- <!-- email to -->
- <xsl:variable name="new_email_to">
- <xsl:for-each select="/root/*[local-name()='selectedEntries']/*[*[local-name()='type'] = 'to' or *[local-name()='type'] = 'toGroup']">
- <xsl:variable name="searchPath" select="*[local-name()='searchPath']"/>
- <xsl:if test="not(key('prev-recipient-to', $searchPath))">
- <xsl:variable name="displayName">
- <xsl:text/>
- <xsl:call-template name="createDisplayName">
- <xsl:with-param name="defaultName" select="*[local-name()='defaultName']"/>
- <xsl:with-param name="userName" select="*[local-name()='userName']"/>
- </xsl:call-template>
- <xsl:text/>
- </xsl:variable>
- <xsl:value-of select="concat($displayName,';')"/>
- </xsl:if>
- </xsl:for-each>
- </xsl:variable>
-
- <!-- email cc -->
- <xsl:variable name="new_email_cc">
- <xsl:for-each select="/root/*[local-name()='selectedEntries']/*[*[local-name()='type'] = 'cc' or *[local-name()='type'] = 'ccGroup']">
-
- <xsl:variable name="searchPath" select="*[local-name()='searchPath']"/>
-
- <xsl:if test="not(key('prev-recipient-cc', $searchPath))">
- <xsl:variable name="displayName">
- <xsl:text/>
- <xsl:call-template name="createDisplayName">
- <xsl:with-param name="defaultName" select="*[local-name()='defaultName']"/>
- <xsl:with-param name="userName" select="*[local-name()='userName']"/>
- </xsl:call-template>
- <xsl:text/>
- </xsl:variable>
-
- <xsl:value-of select="concat($displayName,';')"/>
- </xsl:if>
- </xsl:for-each>
- </xsl:variable>
- <!-- email bcc -->
- <xsl:variable name="new_email_bcc">
- <xsl:for-each select="/root/*[local-name()='selectedEntries']/*[*[local-name()='type'] = 'bcc' or *[local-name()='type'] = 'bccGroup']">
-
- <xsl:variable name="searchPath" select="*[local-name()='searchPath']"/>
-
- <xsl:if test="not(key('prev-recipient-bcc', $searchPath))">
- <xsl:variable name="displayName">
- <xsl:text/>
- <xsl:call-template name="createDisplayName">
- <xsl:with-param name="defaultName" select="*[local-name()='defaultName']"/>
- <xsl:with-param name="userName" select="*[local-name()='userName']"/>
- </xsl:call-template>
- <xsl:text/>
- </xsl:variable>
-
- <xsl:value-of select="concat($displayName,';')"/>
- </xsl:if>
- </xsl:for-each>
- </xsl:variable>
-
- <param name="email_to">
- <xsl:value-of select="concat($new_email_to, /root/env/param[@name='email_to'])"/>
- </param>
- <param name="email_cc">
- <xsl:value-of select="concat($new_email_cc, /root/env/param[@name='email_cc'])"/>
- </param>
- <param name="email_bcc">
- <xsl:value-of select="concat($new_email_bcc, /root/env/param[@name='email_bcc'])"/>
- </param>
-
- <xsl:if test="key('prev-recipient-to', /root/*[local-name()='selectedEntries']/*[*[local-name()='type'] = 'to']/*[local-name()='searchPath']) or
- key('prev-recipient-cc', /root/*[local-name()='selectedEntries']/*[*[local-name()='type'] = 'cc']/*[local-name()='searchPath']) or
- key('prev-recipient-bcc', /root/*[local-name()='selectedEntries']/*[*[local-name()='type'] = 'bcc']/*[local-name()='searchPath'])">
- <param name="duplicateEntryAdded">true</param>
- </xsl:if>
- </xsl:template>
-
- <!-- build the value for the input field. Has the format of -->
- <xsl:template name="createDisplayName">
- <xsl:param name="userName" select="''"/>
- <xsl:param name="defaultName" select="''"/>
-
- <xsl:choose>
- <xsl:when test="$userName !=''">
- <xsl:text/>
- <xts:string id="IDS_EMAIL_DISPLAY_USER">
- <xts:param name="defaultName"><xsl:value-of select="$defaultName"/></xts:param>
- <xts:param name="userName"><xsl:value-of select="$userName"/></xts:param>
- </xts:string><xsl:text/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$defaultName"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template match="text()" priority="0"/>
- </xsl:stylesheet>
|