123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: Viewer
- (C) Copyright IBM Corp. 2001, 2013
- 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" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" version="1.0" exclude-result-prefixes="xsl rsext bus">
- <xsl:include href="qrsvpCommon.xsl"/>
- <xsl:include href="V5drillthru.xsl"/>
- <xsl:param name="CVDisableSelection" select="''"/>
- <xsl:param name="CVDisableDrill" select="''"/>
- <xsl:param name="genIntermediateXML" select="''"/>
- <xsl:param name="CVObjectRef" select="'window.oCV'"/>
- <xsl:param name="CVSCObjectRef" select="'window.oCVSC'"/>
- <xsl:param name="disableTabs" select="'false'"/>
- <xsl:param name="container" select="''"/>
- <xsl:variable name="CVJSObjectRef" select="concat($CVObjectRef, $CognosViewerID)" />
- <xsl:variable name="CVSCJSObjectRef" select="concat($CVSCObjectRef, $CognosViewerID)" />
- <xsl:variable name="IWidgetEvent">gVWEvent('<xsl:value-of select="$CognosViewerID"/>',event,</xsl:variable>
- <xsl:variable name="webFlexDirectory" select="concat($webRoot,'/flex/')"/>
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
- <!-- only run these in Query Studio -->
- <xsl:template name="startPage"/>
- <xsl:template name="dropIndicators"/>
- <xsl:template name="drillTargetsSetup">
- <xsl:if test="$drillSupport!='no'">
- <xsl:call-template name="addDrillThroughContext">
- <xsl:with-param name="closeScript" select="'no'"/>
- </xsl:call-template>
- <xsl:value-of select="$CVJSObjectRef"/>.addDrillTargets(drillTargets);
- <xsl:text disable-output-escaping="yes"></script></xsl:text>
- </xsl:if>
- </xsl:template>
- <!-- used in selection -->
- <xsl:template name="GenEventHandlers">
- <xsl:if test="./drillTargets or /Document/META-DATA">
- <xsl:if test="@layoutClass='listColumnBody' or @layoutClass='listColumnTitle' or @layoutClass='rowCell' or @layoutClass='crosstabFactCell' or @layoutClass='crosstabNodeMember' or @layoutClass='crosstabCorner' or @layoutClass='repeaterTableCell' or name()='OCHART'">
- <xsl:if test="@cid != ''">
- <xsl:attribute name="cid"><xsl:value-of select="@cid"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@uid != ''">
- <xsl:attribute name="uid"><xsl:value-of select="@uid"/></xsl:attribute>
- <xsl:attribute name="name">c<xsl:value-of select="$CognosViewerID"/><xsl:value-of select="@uid"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@type != ''">
- <xsl:attribute name="type"><xsl:value-of select="@type"/></xsl:attribute>
- <xsl:choose>
- <xsl:when test="@layoutClass='crosstabCorner'">
- <xsl:attribute name="CC">true</xsl:attribute>
- </xsl:when>
- <xsl:when test="@layoutClass='crosstabNodeMember'">
- <xsl:attribute name="CTNM">true</xsl:attribute>
- </xsl:when>
- </xsl:choose>
- </xsl:if>
- <xsl:if test="@ctx != ''">
- <xsl:attribute name="ctx"><xsl:value-of select="@ctx"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="./HA/@rp_name !=''">
- <xsl:attribute name="onmouseover"><xsl:value-of select="$IWidgetEvent"/>'onMouseOverRenamedItem');</xsl:attribute>
- <xsl:attribute name="onmouseout"><xsl:value-of select="$IWidgetEvent"/>'onMouseOutRenamedItem');</xsl:attribute>
- <xsl:variable name="genId"><xsl:value-of select="generate-id()"/></xsl:variable>
- <xsl:variable name="uniqueItemId" select="concat($genId, $CognosViewerID)"/>
- <xsl:attribute name="id"><xsl:value-of select="$uniqueItemId"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@class">
- <xsl:attribute name="class">
- <xsl:if test="$CVDisableSelection != 'true'">
- <xsl:text>c</xsl:text><xsl:value-of select="$CognosViewerID"/><xsl:value-of select="@uid"/><xsl:text> </xsl:text>
- </xsl:if>
- <xsl:value-of select="@class" disable-output-escaping="yes"/>
- </xsl:attribute>
- </xsl:if>
- </xsl:if>
- </xsl:if>
- <xsl:if test="name() = 'OCHART'">
- <xsl:attribute name="rsvpChart">true</xsl:attribute>
- </xsl:if>
- <xsl:if test="$container = 'mobile'">
- <xsl:attribute name="onmouseover"></xsl:attribute>
- </xsl:if>
- </xsl:template>
- <!-- used to add events to the main page for selection -->
- <xsl:template match="*[@layoutClass='page']" priority="1">
- <xsl:if test="/Document/ReportPageSet and $disableTabs != 'true'">
- <script type="text/javascript">
- <xsl:value-of select="$CVJSObjectRef"/><xsl:text>.setTabInfo(</xsl:text>
- <xsl:call-template name="createJsonTabset">
- <xsl:with-param name="node" select="/Document/ReportPageSet"/>
- </xsl:call-template>
- <xsl:text>);</xsl:text>
- </script>
- </xsl:if>
-
- <xsl:if test="$genIntermediateXML = 'true'">####intermediateStart####<xsl:copy-of select="/"/>####intermediateEnd####</xsl:if>
- <xsl:call-template name="preProcess"/>
- <table id="rt{$CognosViewerID}" cellpadding="0" cellspacing="0" border="0">
- <xsl:if test="$accessible='true'">
- <xsl:attribute name="role">presentation</xsl:attribute>
- </xsl:if>
- <xsl:attribute name="onmouseover"><xsl:value-of select="$IWidgetEvent"/>'onMouseOver');</xsl:attribute>
- <xsl:attribute name="onmouseout"><xsl:value-of select="$IWidgetEvent"/>'onMouseOut');</xsl:attribute>
- <xsl:attribute name="ondblclick"><xsl:value-of select="$IWidgetEvent"/>'onDoubleClick');</xsl:attribute>
- <xsl:attribute name="onmousedown"><xsl:value-of select="$IWidgetEvent"/>'onMouseDown');</xsl:attribute>
- <xsl:attribute name="onmouseup"><xsl:value-of select="$IWidgetEvent"/>'onMouseUp');</xsl:attribute>
- <xsl:attribute name="oncontextmenu"><xsl:value-of select="$IWidgetEvent"/>'onContextMenu');</xsl:attribute>
- <xsl:attribute name="onkeydown"><xsl:value-of select="$CVJSObjectRef"/>.onKeyDown(event);</xsl:attribute>
- <xsl:call-template name="GenCommonAttributes"/>
- <xsl:apply-templates select="*"/>
- </table>
- <xsl:call-template name="postProcess">
- <xsl:with-param name="elementID" select="concat('rt', $CognosViewerID)"/>
- </xsl:call-template>
- </xsl:template>
- <xsl:template match="*[local-name()='OCHART' and string(@useFlash) != 'true']" priority="1">
- <xsl:variable name="uniqueId"><xsl:value-of select="concat($CognosViewerID, generate-id(.))"/></xsl:variable>
- <div>
- <xsl:attribute name="role">presentation</xsl:attribute>
- <xsl:attribute name="class">dijitInline</xsl:attribute>
- <xsl:attribute name="style">vertical-align:top;</xsl:attribute>
- <xsl:variable name="tag">
- <xsl:choose>
- <xsl:when test="@layoutClass='viz'">div</xsl:when>
- <xsl:otherwise>span</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:element name="{$tag}">
- <xsl:attribute name="tabIndex">0</xsl:attribute>
- <xsl:attribute name="chartContainer">true</xsl:attribute>
- <xsl:attribute name="style">position:relative; left:0; top:0;</xsl:attribute>
- <xsl:attribute name="class">dijitInline</xsl:attribute>
- <xsl:attribute name="viewerId"><xsl:value-of select="$CognosViewerID"/></xsl:attribute>
- <xsl:if test="@layoutClass='viz'">
- <xsl:attribute name="vizChart">true</xsl:attribute>
- </xsl:if>
- <xsl:if test="$accessible='true'">
- <xsl:attribute name="role">img</xsl:attribute>
- <xsl:if test="@altText != ''">
- <xsl:attribute name="aria-labelledby"><xsl:value-of select="$uniqueId"/></xsl:attribute>
- <span style="visibility:hidden; display:none" id="{$uniqueId}"><xsl:value-of select="@altText"/></span>
- </xsl:if>
- </xsl:if>
- <xsl:call-template name="GenChartImage"/>
- </xsl:element>
- </div>
- </xsl:template>
- <xsl:template match="*[@layoutClass='list'] | *[@layoutClass='crosstab']" priority="1">
- <div>
- <xsl:call-template name="GenReportLayout"/>
- </div>
- </xsl:template>
- <xsl:template match="*[@layoutClass='textItem']" priority="1">
- <span>
- <xsl:call-template name="GenTabIndexAttribute"/>
- <xsl:call-template name="GenCommonAttributes"/>
- <xsl:call-template name="AddAccessibleTagsForSpan"/>
- <!--
- First cell in a list or crosstab has a tabIndex of 0. We need the onfocus for those cells
- to fix up the aria-labelled before JAWS kicks in.
- -->
- <xsl:if test="$accessible='true' and (parent::node()/@layoutClass = 'crosstabCorner' or (parent::node()/@layoutClass = 'listColumnTitle' and count(parent::node()/preceding-sibling::node())=0))">
- <xsl:attribute name="onfocus"><xsl:value-of select="$CVJSObjectRef"/>.onFocus(event);</xsl:attribute>
- </xsl:if>
- <xsl:if test="@ctx != ''">
- <xsl:attribute name="ctx"><xsl:value-of select="@ctx"/></xsl:attribute>
- </xsl:if>
- <xsl:value-of select="rsext:htmlencode(string(.))" disable-output-escaping="yes"/>
- </span>
- </xsl:template>
- <!-- Flash Charts -->
- <xsl:template match="*[@useFlash]">
- <xsl:variable name="uniqueId"><xsl:value-of select="generate-id()"/></xsl:variable>
- <xsl:variable name="genId"><xsl:value-of select="concat(substring-before(string($uniqueId), '.'), substring-after(string($uniqueId), '.'))"/></xsl:variable>
- <xsl:variable name="width">
- <xsl:choose>
- <xsl:when test="number(@width) < 250">
- <xsl:text>250</xsl:text>
- </xsl:when>
- <xsl:otherwise><xsl:value-of select="@width"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="height">
- <xsl:choose>
- <xsl:when test="number(@height) < 175">
- <xsl:text>175</xsl:text>
- </xsl:when>
- <xsl:otherwise><xsl:value-of select="@height"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="a11yuniqueId"><xsl:value-of select="concat($CognosViewerID, generate-id(.))"/></xsl:variable>
- <div flashChartContainer="true">
- <xsl:variable name="errorCallback"><xsl:value-of select="$CVJSObjectRef"/><xsl:text>.flashChartError</xsl:text></xsl:variable>
- <xsl:variable name="ldxString"><cgs><xsl:value-of select="normalize-space(.)" disable-output-escaping="no"/></cgs></xsl:variable>
- <xsl:variable name="flashVarsUrl"><xsl:text>loadpath=</xsl:text><xsl:value-of select="$webFlexDirectory"/><xsl:text>&messageurl=</xsl:text><xsl:value-of select="$webFlexDirectory"/><xsl:text>exdFlex_en.xml&errorCallback=</xsl:text><xsl:value-of select="rsext:urlencode($errorCallback)"/><xsl:text>&ldx=</xsl:text><xsl:value-of select="rsext:urlencode($ldxString)"/></xsl:variable>
- <xsl:choose>
- <xsl:when test="parent::node()/@layoutClass != 'crosstabFactCell'">
- <xsl:attribute name="tabIndex">0</xsl:attribute>
- <xsl:attribute name="onfocus">onFlashChartRightClick(event);</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="tabIndex">-1</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:attribute name="id"><xsl:text>flashContainer</xsl:text><xsl:value-of select="$genId"/></xsl:attribute>
- <xsl:if test="$accessible='true' and string(@altText) != ''">
- <xsl:attribute name="role">presentation</xsl:attribute>
- <xsl:attribute name="aria-labelledby"><xsl:value-of select="$a11yuniqueId"/></xsl:attribute>
- <span style="visibility:hidden; display:none" id="{$a11yuniqueId}"><xsl:value-of select="@altText"/></span>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="$isIE">
- <object flashChart="true" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
- <xsl:attribute name="viewerId"><xsl:value-of select="$CognosViewerID"/></xsl:attribute>
- <xsl:attribute name="lid"><xsl:value-of select="@name"/><xsl:value-of select="$CognosViewerID"/></xsl:attribute>
- <xsl:attribute name="id"><xsl:value-of select="$genId"/></xsl:attribute>
- <xsl:attribute name="width"><xsl:value-of select="$width"/>px</xsl:attribute>
- <xsl:attribute name="height"><xsl:value-of select="$height"/>px</xsl:attribute>
- <param name="quality" value="high"/>
- <param name="bgcolor" value="#869ca7"/>
- <param name="allowScriptAccess" value="sameDomain"/>
- <param name="play" value="true"/>
- <param name="wmode" value="transparent"/>
- <param name="menu" value="false"/>
- <param name="movie">
- <xsl:attribute name="value"><xsl:value-of select="$webFlexDirectory"/><xsl:text>CGSChartLauncher.swf</xsl:text></xsl:attribute>
- </param>
- <param name="FlashVars">
- <xsl:attribute name="value"><xsl:value-of select="$flashVarsUrl"/></xsl:attribute>
- </param>
- </object>
- </xsl:when>
- <xsl:otherwise>
- <embed flashChart="true">
- <xsl:attribute name="viewerId"><xsl:value-of select="$CognosViewerID"/></xsl:attribute>
- <xsl:attribute name="lid"><xsl:value-of select="@name"/><xsl:value-of select="$CognosViewerID"/></xsl:attribute>
- <xsl:attribute name="id"><xsl:value-of select="$genId"/></xsl:attribute>
- <xsl:attribute name="name"><xsl:value-of select="$genId"/></xsl:attribute>
- <xsl:attribute name="width"><xsl:value-of select="$width"/>px</xsl:attribute>
- <xsl:attribute name="height"><xsl:value-of select="$height"/>px</xsl:attribute>
- <xsl:attribute name="src"><xsl:value-of select="$webFlexDirectory"/><xsl:text>CGSChartLauncher.swf</xsl:text></xsl:attribute>
- <xsl:attribute name="quality">high</xsl:attribute>
- <xsl:attribute name="menu">false</xsl:attribute>
- <xsl:attribute name="bgcolor">#869ca7</xsl:attribute>
- <xsl:attribute name="wmode">transparent</xsl:attribute>
- <xsl:attribute name="align">middle</xsl:attribute>
- <xsl:attribute name="play">true</xsl:attribute>
- <xsl:attribute name="loop">false</xsl:attribute>
- <xsl:attribute name="allowScriptAccess">always</xsl:attribute>
- <xsl:attribute name="type">application/x-shockwave-flash</xsl:attribute>
- <xsl:attribute name="pluginspage">http://www.adobe.com/go/getflashplayer</xsl:attribute>
- <xsl:attribute name="FlashVars"><xsl:value-of select="$flashVarsUrl"/></xsl:attribute>
- </embed>
- </xsl:otherwise>
- </xsl:choose>
- </div>
- <xsl:call-template name="startScript"/>
- <xsl:value-of select="$CVJSObjectRef"/><xsl:text>.addFlashChart('</xsl:text><xsl:value-of select="rsext:javascriptencode($genId)"/><xsl:text>');</xsl:text>
- <xsl:call-template name="endScript"/>
- </xsl:template>
- <xsl:template match="OAREA" priority="2">
- <xsl:if test="./MEMBER or ./drillTargets or ./MEASURE">
- <xsl:if test="./MEMBER or ./MEASURE">
- <xsl:attribute name="ctx"><xsl:value-of select="./@ctx"/></xsl:attribute>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="./@type='legendTitle'">
- <xsl:attribute name="isChartTitle">true</xsl:attribute>
- </xsl:when>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="./@type='ordinalAxisTitle'">
- <xsl:attribute name="isChartTitle">true</xsl:attribute>
- </xsl:when>
- </xsl:choose>
- <xsl:if test="./drillTargets">
- <xsl:attribute name="dtTargets">
- <xsl:apply-templates select="./drillTargets/*" mode="drillTargets"/>
- </xsl:attribute>
- </xsl:if>
- </xsl:if>
- </xsl:template>
- </xsl:stylesheet>
|