12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: AGS
- (C) Copyright IBM Corp. 2005, 2008
- US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- -->
- <!--
- Transform to convert the runOptions for a report into request parameters for attaching the report to an email
- -->
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xts="http://developer.cognos.com/schemas/xts/" exclude-result-prefixes="xsl xts">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="/root">
- <!-- is the report available for attachment to an email -->
- <report>
- <!-- set the properties for the attachment - set the path (AgentTaskID) - taskName -->
- <searchPath>
- <xsl:value-of select="./id"/>
- </searchPath>
- <defaultName>
- <xsl:value-of select="./taskName"/>
- </defaultName>
- <!-- set the locale - either the value of the outputLocale runOption - or if that isn't there - use the contentLocale from the user -->
- <xsl:for-each select="reportOptions/*[local-name()='options']/*[local-name()='value']/*[local-name()='item' and ./*[local-name()='name']='outputLocale']/*[local-name()='value']/*[local-name()='item']">
- <locale>
- <xsl:value-of select="."/>
- </locale>
- </xsl:for-each>
- <!-- set the formats as well from the outputFormat runOption -->
- <xsl:for-each select="reportOptions/*[local-name()='options']/*[local-name()='value']/*[local-name()='item' and ./*[local-name()='name']='outputFormat']/*[local-name()='value']/*[local-name()='item']">
- <format>
- <xsl:value-of select="."/>
- </format>
- </xsl:for-each>
- <!-- also have to cater for powerplay report option format - which isn't an array -->
- <xsl:for-each select="reportOptions/*[local-name()='options']/*[local-name()='value']/*[local-name()='item' and contains(./@*[local-name()='type'], 'powerPlay8OptionOutputFormat')]/*[local-name()='value']">
- <format>
- <xsl:value-of select="."/>
- </format>
- </xsl:for-each>
- <!-- if we don't have a format - the email page will display the format based on the default user format. For PP we don't want this - we want to force it to be PDF -->
- <xsl:if test="starts-with(./m_class, 'powerPlay') and not(reportOptions/*[local-name()='options']/*[local-name()='value']/*[local-name()='item' and contains(./@*[local-name()='type'], 'powerPlay8OptionOutputFormat')])">
- <format>
- <xsl:text>PDF</xsl:text>
- </format>
- </xsl:if>
- </report>
- </xsl:template>
- </xsl:stylesheet>
|