123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: Viewer
- (C) Copyright IBM Corp. 2001, 2017
- US Government Users Restricted Rights - Use, duplication or
- disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- -->
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:rsext="xalan://com.cognos.reportserver.ext.RSExt" version="1.0" exclude-result-prefixes="xsl rsext">
- <xsl:include href="V5environment.xsl"/>
- <xsl:include href="V5ReportEngine.xsl"/>
- <!-- Include needed for prompting -->
- <xsl:include href="../../ps/prompting/p_include_V5ParamSafe.xsl"/>
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:param name="RSIncludeAlias" select="''"/>
- <xsl:param name="UseCDATASections" select="'true'"/>
- <xsl:variable name="promptLocale" select="$contentLocale"/>
- <xsl:variable name="promptFormName" select="'formWarpRequest'"/>
- <xsl:variable name="CDATABegin">
- <xsl:choose>
- <xsl:when test="$UseCDATASections = 'true'">
- <xsl:text>//<![CDATA[</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text></xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="CDATAEnd">
- <xsl:choose>
- <xsl:when test="$UseCDATASections = 'true'">
- <xsl:text>//]]></xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text></xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:template name="startScript">
- <xsl:text disable-output-escaping="yes"><script type="text/javascript"></xsl:text>
- <xsl:value-of disable-output-escaping="yes" select="$CDATABegin" />
- <!-- Note: The newline between the opening and closing xsl:text tags is important!
- You want just the CDATA to be commented out, not the entire content of the script -->
- <xsl:text>
- </xsl:text>
- </xsl:template>
- <xsl:template name="endScript">
- <xsl:value-of disable-output-escaping="yes" select="$CDATAEnd" />
- <xsl:text disable-output-escaping="yes"></script></xsl:text>
- <!-- Note: The newline between the opening and closing xsl:text tags is important!
- You want just the CDATA to be commented out, not the entire content of the script -->
- <xsl:text>
- </xsl:text>
- </xsl:template>
- <xsl:template match="/Document">
- <!-- Copyright (C) 2008 Cognos ULC, an IBM Company. All rights reserved. -->
- <!-- Cognos (R) is a trademark of Cognos ULC, (formerly Cognos Incorporated). -->
- <xsl:call-template name="chartConfig"/>
- <!-- Add prompt control javascript and style sheets -->
- <xsl:call-template name="getPromptHeadIncludes">
- <xsl:with-param name="promptLocale" select="$promptLocale"/>
- <xsl:with-param name="promptContentLocale" select="$contentLocale"/>
- </xsl:call-template>
- <xsl:apply-templates select="/Document/styleOptions"/>
- <xsl:if test=" $RSIncludeAlias != '' ">
- <xsl:variable name="RSAliasDoc" select=" document( 'rs_alias.xml' ) "/>
- <xsl:call-template name="LoadRSAlias">
- <xsl:with-param name="doc" select="$RSAliasDoc"/>
- <xsl:with-param name="alias" select="$RSIncludeAlias"/>
- </xsl:call-template>
- </xsl:if>
- <xsl:call-template name="drillTargetsSetup"/>
- <xsl:call-template name="addSelectionController"/>
- <xsl:apply-templates select="META-DATA"/>
- <xsl:apply-templates select="CONTEXT-DATA"/>
- <xsl:apply-templates select="DATA"/>
- <xsl:call-template name="dropIndicators"/>
- </xsl:template>
- <xsl:template name="LoadRSAlias">
- <xsl:param name="doc"/>
- <xsl:param name="alias"/>
- <xsl:choose>
- <xsl:when test=" contains( $alias, ',' ) ">
- <xsl:call-template name="LoadRSAlias">
- <xsl:with-param name="doc" select="$doc"/>
- <xsl:with-param name="alias" select=" substring-before( $alias, ',' ) "/>
- </xsl:call-template>
- <xsl:call-template name="LoadRSAlias">
- <xsl:with-param name="doc" select="$doc"/>
- <xsl:with-param name="alias" select=" substring-after( $alias, ',' ) "/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test=" $alias != '' ">
- <xsl:value-of select=" $doc/aliases/alias[ @name = $alias ] " disable-output-escaping="yes"/>
- </xsl:when>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="addSelectionController">
- <xsl:call-template name="startScript" />
- <xsl:choose>
- <xsl:when test="/Document/META-DATA or /Document/CONTEXT-DATA">
- <xsl:value-of select="$CVSCJSObjectRef"/><xsl:text>.setSelectionBasedFeaturesEnabled(true);</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$CVSCJSObjectRef"/><xsl:text>.setSelectionBasedFeaturesEnabled(false);</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
-
- <xsl:choose>
- <xsl:when test="/Document/META-DATA/@drillUpDown='true'">
- <xsl:value-of select="$CVSCJSObjectRef"/><xsl:text>.setDrillUpDownEnabled(true);</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$CVSCJSObjectRef"/><xsl:text>.setDrillUpDownEnabled(false);</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
-
- <xsl:choose>
- <xsl:when test="/Document/META-DATA/@modelBasedDrillThru='true'">
- <xsl:value-of select="$CVSCJSObjectRef"/><xsl:text>.setModelDrillThroughEnabled(true);</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$CVSCJSObjectRef"/><xsl:text>.setModelDrillThroughEnabled(false);</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:call-template name="endScript" />
- </xsl:template>
- <xsl:template match="META-DATA">
- <xsl:call-template name="startScript" />
- <xsl:for-each select="Block">
- <xsl:value-of select="$CVSCJSObjectRef"/>
- <xsl:text>.addMetaData(</xsl:text>
- <xsl:value-of select="." disable-output-escaping="yes"/>
- <xsl:text>);</xsl:text>
- </xsl:for-each>
- <xsl:call-template name="endScript" />
- </xsl:template>
- <xsl:template match="CONTEXT-DATA">
- <xsl:call-template name="startScript" />
- <xsl:for-each select="*[local-name()=$contextBlock]">
- <xsl:value-of select="$CVSCJSObjectRef"/>
- <xsl:text>.addContextData(</xsl:text>
- <xsl:value-of select="." disable-output-escaping="yes"/>
- <xsl:text>);</xsl:text>
- </xsl:for-each>
- <xsl:call-template name="endScript" />
- </xsl:template>
- </xsl:stylesheet>
|