123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: ps
- (C) Copyright IBM Corp. 2005, 2014
- 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).
- -->
- <!--
- Transform to remove any unwanted params from the env that gets passed to the buildOptionItems.xslt transform.
- -->
- <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="xts">
-
- <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="/root" priority="3">
- <env>
- <xsl:apply-templates select="/root/env"/>
- </env>
- </xsl:template>
-
- <xsl:variable name="overrideOptions" select="key('env-param','override_default_reportOptions')='true' or key('env-param','override_outputFormat_option')='true' or not(key('env-param','changed_override_default_reportOptions'))"/>
- <!--
- **************
- RUN OPTIONS
- **************
- -->
- <!-- only keep m_ro_outputFormat if we are not using formats from the advanced options page -->
- <xsl:template match="*[local-name()='param' and @name='m_ro_outputFormat']" priority="2">
- <xsl:if test="(not(/root/env/param[starts-with(@name, 'm_ro_outputFormat_')]))">
- <param name="{@name}"><xsl:value-of select="."/></param>
- </xsl:if>
- </xsl:template>
- <!-- only keep m_ro_outputFormat_HTML, selectionBasedFeatures and m_ro_verticalElements if the HTML checkbox was checked -->
- <xsl:template match="*[local-name()='param' and (@name='m_ro_outputFormat_HTML' or @name='m_ro_selectionBasedFeatures' or @name='m_ro_verticalElements')]" priority="2">
- <xsl:if test="(not(key('env-param','changed_m_ro_outputF_HTML_Type')) or key('env-param','m_ro_outputF_HTML_Type')='true') and $overrideOptions">
- <param name="{@name}"><xsl:value-of select="."/></param>
- </xsl:if>
- </xsl:template>
-
- <!-- only keep m_ro_outputFormat_XLS2000 if the XLS checkbox was checked -->
- <xsl:template match="*[local-name()='param' and @name='m_ro_outputFormat_XLS2000']" priority="2">
- <xsl:if test="key('env-param','m_ro_outputF_XLS2000_Type') = 'true' and $overrideOptions">
- <param name="{@name}"><xsl:value-of select="."/></param>
- </xsl:if>
- </xsl:template>
- <!-- only keep the printer address if the print checkbox was checked -->
- <xsl:template match="*[local-name()='param' and (@name='m_ro_printerAddress' or @name='m_ro_printer')]" priority="2">
- <xsl:if test="key('env-param','m_ro_print') = 'true' and $overrideOptions">
- <param name="{@name}"><xsl:value-of select="."/></param>
- </xsl:if>
- </xsl:template>
- <!-- only keep the outputFormats if the specify checkbox is checked or there wasn't a specify checkbox -->
- <xsl:template match="*[local-name()='param' and starts-with(@name, 'm_ro_outputFormat')]" priority="1">
- <xsl:if test="(not(key('env-param','changed_specify_format')) or key('env-param','specify_format')='checked') and $overrideOptions">
- <param name="{@name}"><xsl:value-of select="."/></param>
- </xsl:if>
- </xsl:template>
- <!-- only keep the outputLocale if the specify checkbox is checked or there wasn't a specify checkbox -->
- <xsl:template match="*[local-name()='param' and @name='m_ro_outputLocale']" priority="1">
- <xsl:if test="(not(key('env-param','changed_specify_language')) or key('env-param','specify_language')='checked') and $overrideOptions">
- <param name="{@name}"><xsl:value-of select="."/></param>
- </xsl:if>
- </xsl:template>
-
- <!-- only keep the PDF options if PDF is checked and they're not set to default -->
- <xsl:template match="*[local-name()='param' and (@name='m_ro_outputPageDefinition' or @name='m_ro_outputPageOrientation' or starts-with(@name, 'm_pdf_'))]" priority="1">
- <xsl:if test="(key('env-param','visited_run_options_property')='true' or /root/env/param[starts-with(@name, 'm_ro_outputFormat')] = 'PDF') and . != 'default' and $overrideOptions">
- <param name="{@name}"><xsl:value-of select="."/></param>
- </xsl:if>
- </xsl:template>
- <!-- only keep the PDF options if PDF is checked and they're not set to default -->
- <xsl:template match="*[local-name()='param' and starts-with(@name, 'm_arc_')]" priority="1">
- <xsl:if test="key('env-param','m_ro_archive') = 'true' and $overrideOptions">
- <param name="{@name}"><xsl:value-of select="."/></param>
- </xsl:if>
- </xsl:template>
- <xsl:template match="*[local-name()='param' and (starts-with(@name,'m_ro_') or @name='ro_printer_kw' or @name='save_how')]">
- <!-- if the override checkbox is present, and it's checked then keep the runOptions. The prompt runOptions isn't contained in the
- the same dynamic div, so always include it -->
- <xsl:if test="$overrideOptions or @name='m_ro_prompt'">
- <param name="{@name}"><xsl:value-of select="."/></param>
- </xsl:if>
- </xsl:template>
-
- <!--
- **************
- DEPLOYMENT OPTIONS
- **************
- -->
- <xsl:template match="*[local-name()='param' and @name='deploymentro_upgradeClasses']" priority="2">
- <xsl:if test="key('env-param','deploymentro_upgrade')='upgrade'">
- <param name="{@name}"><xsl:value-of select="."/></param>
- </xsl:if>
- </xsl:template>
- <!--
- **************
- POWERPLAY OPTIONS
- **************
- -->
- <xsl:template match="*[local-name()='param' and @name='m_ppro_outputFormat']" priority="1">
- <param name="{@name}"><xsl:value-of select="."/></param>
- </xsl:template>
- <xsl:template match="*[local-name()='param']" priority="0">
- <param name="{@name}"><xsl:value-of select="."/></param>
- </xsl:template>
- </xsl:stylesheet>
|