123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: ps
- (C) Copyright IBM Corp. 2005, 2015
- US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- -->
- <!--
- Copyright (C) 2008 Cognos ULC, an IBM Company. All rights reserved.
- Cognos (R) is a trademark of Cognos ULC, (formerly Cognos Incorporated).
- -->
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
- xmlns:dlgctrl="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/controller-templates/"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:xts="http://developer.cognos.com/schemas/xts/"
- xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
- xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
- exclude-result-prefixes="xsl dlgctrl xtsext pf send">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:key name="env-param" match="/root/env/param" use="@name"/>
- <xsl:template match="/">
-
- <xsl:variable name="passport" select="/root/credential/param[@name='CAM']/*[local-name() ='CAM']/*[local-name() = 'CAMPassport']/*[local-name() = 'id']"/>
- <xts:sequence>
- <xsl:choose>
- <!-- construct the new mobileDescription parameter -->
- <!-- this is also processed when the page first loads to process the mobile options -->
- <xsl:when test="((/root/*[local-name()='morphletResponse']/*[local-name()='selectedEntries'] or /root/*[local-name()='selectedEntries'] ) and (not(key('env-param','m_ro_burst')) or key('env-param','m_ro_burst')='false' or key('env-param','run_options_visited')='true' or key('env-param','visited_run_with_options')='true' or key('env-param','visited_schedule_properties')='true'))">
- <xsl:variable name="mobileRecipients" select="/root/*[local-name()='selectedEntries']/*[local-name()='account' or local-name()='group' or local-name()='role' or local-name()='contact' or local-name()='distributionList']"/>
- <xsl:variable name="mobileRecipientCount" select="count($mobileRecipients)"/>
- <!-- delete the old mobileSummary and mobileDescription and create new ones with the reponse received from the add entries -->
- <xts:delete select="/root/env/param[@name='mobileRecipientsCount' or @name='mobileDescription' or @name='mobileSummary' or @name='hasMobileRecipients']"/>
- <xsl:choose>
- <!-- recipient count of 0 -->
- <xsl:when test="$mobileRecipientCount='0'">
- <xts:delete select="/root/env/param[@name='m_ro_mobile']"/>
- <xts:append select="/root/env">
- <param name="mobileDescription"><xts:string id="IDS_OTHERRUN_MOBILE_NO_RECIPIENTS"/></param>
- <param name="hasMobileRecipients">false</param>
- <param name="m_ro_mobile">false</param>
- </xts:append>
- </xsl:when>
- <!-- more then 1 recipient -->
- <xsl:when test="$mobileRecipientCount > 1">
- <xts:append select="/root/env">
- <param name="mobileDescription"><xts:string id="IDS_OTHERRUN_MOBILE_RECIPIENT_COUNT"><xts:param name="numPeople"><xsl:value-of select="$mobileRecipientCount"/></xts:param>
- </xts:string>
- </param>
- <param name="hasMobileRecipients">true</param>
- <param name="mobileRecipientsCount">
- <xsl:value-of select="$mobileRecipientCount"/>
- </param>
- </xts:append>
- </xsl:when>
- <!-- only one recipient -->
- <xsl:otherwise>
- <xsl:choose>
- <!-- select only 1 recipient, so we must query CM for the information on the recipient -->
- <xsl:when test="$mobileRecipientCount = '1'">
- <xts:append select="/root/env">
- <param name="mobileDescription">
- <xsl:choose>
- <xsl:when test="/root/*[local-name()='selectedEntries']/*/*[local-name()='userName'] != ''">
- <xts:string id="IDS_OTHERRUN_DISPLAY_MOBILE_USER">
- <xts:param name="defaultName">
- <xsl:value-of select="/root/*[local-name()='selectedEntries']/*/*[local-name()='defaultName']"/>
- </xts:param>
- <xts:param name="userName">
- <xsl:value-of select="/root/*[local-name()='selectedEntries']/*/*[local-name()='userName']"/>
- </xts:param>
- </xts:string>
- </xsl:when>
- <xsl:when test="/root/*[local-name()='selectedEntries']/*/*[local-name()='defaultName'] != ''">
- <xsl:value-of select="/root/*[local-name()='selectedEntries']/*/*[local-name()='defaultName']"/>
- </xsl:when>
- <xsl:otherwise>
- <xts:string id="IDS_OTHERRUN_UNKNOWN_MOBILE_RECIPIENT"/>
- </xsl:otherwise>
- </xsl:choose>
- </param>
- <param name="hasMobileRecipients">true</param>
- <param name="mobileRecipientsCount"><xsl:value-of select="$mobileRecipientCount"/></param>
- </xts:append>
- </xsl:when>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- <!-- handle the addresses that were added via the add entries dialog -->
- <xsl:if test="$mobileRecipientCount > 0">
- <xts:delete select="/root/env/param[@name='mobileOptions']"/>
- <xts:append select="/root/env">
- <xts:transform src="portal/controls/create_web64_param.xslt" processor="XSLT">
- <param name="mobileOptions">
- <passport><xsl:value-of select="$passport"/></passport>
- <markup>
- <xts:transform name="XMLEncode">
- <options xsi:type="bus:optionArrayProp">
- <value xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:option[1]">
- <item xsi:type="bus:mobileOptionSearchPathMultipleObjectArray">
- <name xsi:type="bus:mobileOptionEnum">to</name>
- <value xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:searchPathMultipleObject[{$mobileRecipientCount}]">
- <xsl:for-each select="$mobileRecipients">
- <item xsi:type="bus:searchPathMultipleObject">
- <xsl:value-of select="./*[local-name()='searchPath']"/>
- </item>
- </xsl:for-each>
- </value>
- </item>
- </value>
- </options>
- </xts:transform>
- </markup>
- </param>
- </xts:transform>
- </xts:append>
- </xsl:if>
- </xsl:when>
- <xsl:when test="/root/*[local-name()='morphletResponse']/*[local-name()='mobileOptions'] != '' and (key('env-param','run_options_visited')='true' or key('env-param','visited_schedule_properties')='true')">
- <xsl:variable name="mobileRecipients" select="/root/*[local-name()='morphletResponse']/*[local-name()='mobileOptions']/*[local-name()='value']/*[local-name()='item' and ./*[local-name()='name' and (.='to' or .='cc' or .='bcc')]]/*[local-name()='value']/*[local-name()='item']"/>
- <xsl:variable name="mobileRecipientCount" select="count($mobileRecipients)"/>
- <!-- delete the old mobileSummary and mobileDescription and create new ones with the reponse received from the add entries -->
- <xts:delete select="/root/env/param[@name='mobileRecipientsCount' or @name='mobileDescription' or @name='mobileSummary' or @name='hasMobileRecipients']"/>
- <xsl:choose>
- <!-- recipient count of 0 -->
- <xsl:when test="$mobileRecipientCount='0'">
- <xts:append select="/root/env">
- <param name="mobileDescription"><xts:string id="IDS_OTHERRUN_MOBILE_NO_RECIPIENTS"/></param>
- <param name="hasMobileRecipients">false</param>
- </xts:append>
- </xsl:when>
- <!-- more then 1 recipient -->
- <xsl:when test="$mobileRecipientCount > 1">
- <xts:append select="/root/env">
- <param name="mobileDescription"><xts:string id="IDS_OTHERRUN_MOBILE_RECIPIENT_COUNT"><xts:param name="numPeople"><xsl:value-of select="$mobileRecipientCount"/></xts:param>
- </xts:string>
- </param>
- <param name="hasMobileRecipients">true</param>
- <param name="mobileRecipientsCount">
- <xsl:value-of select="$mobileRecipientCount"/>
- </param>
- </xts:append>
- </xsl:when>
- <!-- only one recipient -->
- <xsl:otherwise>
- <xsl:choose>
- <!-- select only 1 recipient, so we must query CM for the information on the recipient -->
- <xsl:when test="$mobileRecipientCount = '1'">
- <xts:append select="/root/env">
- <xts:transform src="transforms/portal/mobileOptions/generateRecipientsSummary.xslt" processor="XSLT">
- <xts:param name="messageBase">/messages/portal.xml</xts:param>
- <xts:param name="messageBase">/messages/portalRL.xml</xts:param>
- <root>
- <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
- <send:request provider="cm">
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
- <cm:requests>
- <cm:query>
- <cm:search><xsl:value-of select="$mobileRecipients"/></cm:search>
- <cm:properties>
- <cm:property name="searchPath"/>
- <cm:property name="defaultName"/>
- <cm:property name="userName"/>
- <cm:property name="email"/>
- </cm:properties>
- </cm:query>
- </cm:requests>
- </cm:query>
- </xts:transform>
- </send:request>
- </xts:transform>
- <asParam>true</asParam>
- </root>
- </xts:transform>
- <param name="hasMobileRecipients">true</param>
- <param name="mobileRecipientsCount"><xsl:value-of select="$mobileRecipientCount"/></param>
- </xts:append>
- </xsl:when>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- <!-- also have to build the selectedEntries blob -->
- <xts:append select="/root/env">
- <xts:transform src="portal/controls/create_web64_param.xslt" processor="XSLT">
- <param name="selectedEntries">
- <passport><xsl:value-of select="$passport"/></passport>
- <markup>
- <xts:transform name="XMLEncode">
- <xts:transform src="ags/transforms/updateSelectedEntries.xslt" processor="XSLT">
- <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
- <send:request provider="cm">
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
- <cm:requests>
- <!-- get info on all the mobile recipients -->
- <xsl:for-each select="$mobileRecipients">
- <cm:query>
- <cm:search><xsl:value-of select="."/></cm:search>
- <cm:properties>
- <cm:property name="defaultName"/>
- <cm:property name="hidden"/>
- <cm:property name="searchPath"/>
- <cm:property name="permissions"/>
- <cm:property name="position"/>
- <cm:property name="searchPathForURL"/>
- <cm:property name="storeID"/>
- <cm:property name="ancestors"/>
- <cm:property name="hasChildren"/>
- <cm:property name="base"/>
- <cm:property name="userName"/>
- </cm:properties>
- </cm:query>
- </xsl:for-each>
- </cm:requests>
- </cm:query>
- </xts:transform>
- </send:request>
- </xts:transform>
- </xts:transform>
- </xts:transform>
- </markup>
- </param>
- </xts:transform>
- </xts:append>
- </xsl:when>
- <xsl:otherwise/>
- </xsl:choose>
- <!-- construct the mobile summary -->
- <xts:append select="/root/env">
- <param name="mobileSummary"><xts:string id="IDS_OTHERRUN_DELIVERY_MOBILE_REPORT"/></param>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
|