123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: ps
- (C) Copyright IBM Corp. 2005, 2011
- 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:xts="http://developer.cognos.com/schemas/xts/"
- xmlns:prt="http://developer.cognos.com/schemas/xts/iPrompting/logicsheets/common"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
- xmlns:out="dummy-uri"
- exclude-result-prefixes="xsl xts prt xtsext">
-
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:namespace-alias stylesheet-prefix="out" result-prefix="xsl"/>
-
- <xsl:template match="prt:javascripts">
- function cancel() {
- if ( document.formWarpRequest ) {
- if( window.timerID ) {
- clearTimeout(window.timerID);
- window.timerID=0;
- }
- document.formWarpRequest.method.value = 'cancel';
- document.formWarpRequest.submit();
- }
- }
- </xsl:template>
-
- <!--
- ===============================================================================================
- ut:renderValuePrompts
- ===============================================================================================
- -->
- <xsl:template match="prt:renderValuePrompts">
- <out:template match="*[local-name()='simpleParmValueItem']" mode="render-values">
- <out:choose>
- <out:when test="*[local-name()='display'] != ''">
-  '<out:value-of select="*[local-name()='display']"/>',
- </out:when>
- <out:when test="*[local-name()='use'] != ''">
-  '<out:value-of select="*[local-name()='use']"/>',
- </out:when>
- <out:otherwise>
-  <xts:string id="IDS_VIEW_PROMPTS_NO_VALUE"/><xts:string id="IDS_LIST_SEPARATOR"/>
- </out:otherwise>
- </out:choose>
- </out:template>
- <out:template match="*[local-name()='simpleParmValueItem'][last()]" mode="render-values">
- <out:choose>
- <out:when test="*[local-name()='display'] != ''">
-  '<out:value-of select="*[local-name()='display']"/>'<out:text/>
- </out:when>
- <out:when test="*[local-name()='use'] != ''">
-  '<out:value-of select="*[local-name()='use']"/>'<out:text/>
- </out:when>
- <out:otherwise>
-  <xts:string id="IDS_VIEW_PROMPTS_NO_VALUE"/><out:text/>
- </out:otherwise>
- </out:choose>
- <out:if test="not(position() = last())"><xts:string id="IDS_LIST_SEPARATOR"/></out:if>
- </out:template>
- <out:template match="*[local-name()='boundRangeParmValueItem' or local-name()='unboundedEndRangeParmValueItem' or local-name()='unboundedStartRangeParmValueItem']" mode="render-values">
- <out:variable name="startDisplay">
- <out:choose>
- <out:when test="*[local-name()='start']/*[local-name()='display'] != ''">
- <out:value-of select="*[local-name()='start']/*[local-name()='display']"/>
- </out:when>
- <out:otherwise>
- <out:value-of select="*[local-name()='start']/*[local-name()='use']"/>
- </out:otherwise>
- </out:choose>
- </out:variable>
- <out:variable name="endDisplay">
- <out:choose>
- <out:when test="*[local-name()='end']/*[local-name()='display'] != ''">
- <out:value-of select="*[local-name()='end']/*[local-name()='display']"/>
- </out:when>
- <out:otherwise>
- <out:value-of select="*[local-name()='end']/*[local-name()='use']"/>
- </out:otherwise>
- </out:choose>
- </out:variable>
- <out:choose>
- <out:when test="$startDisplay != '' and $endDisplay!=''">
- <out:choose>
- <out:when test="string($startDisplay) != string($endDisplay)">
-  '<xts:string id="IDS_OTHERRUN_BOUNDED_RANGE_VALUE">
- <xts:param name="startValue"><out:value-of select="$startDisplay"/></xts:param>
- <xts:param name="endValue"><out:value-of select="$endDisplay"/></xts:param>
- </xts:string>'<out:text/>
- </out:when>
- <out:otherwise>
-  '<out:value-of select="$endDisplay"/>'<out:text/>
- </out:otherwise>
- </out:choose>
- </out:when>
- <out:when test="$startDisplay != ''">
-  '<xts:string id="IDS_OTHERRUN_RANGED_START_PARAM_VALUE">
- <xts:param name="startValue"><out:value-of select="$startDisplay"/></xts:param>
- </xts:string>'<out:text/>
- </out:when>
- <out:when test="$endDisplay != ''">
-  '<xts:string id="IDS_OTHERRUN_RANGED_END_PARAM_VALUE">
- <xts:param name="endValue"><out:value-of select="$endDisplay"/></xts:param>
- </xts:string>'<out:text/>
- </out:when>
- <out:otherwise>
-  <xts:string id="IDS_VIEW_PROMPTS_NO_VALUE"/>
- </out:otherwise>
- </out:choose>
- <out:if test="not(position() = last())"><xts:string id="IDS_LIST_SEPARATOR"/></out:if>
- </out:template>
- <out:template match="*[local-name()='hierarchicalParmValueItem']" mode="render-values">
- <out:param name="ancestorText" select="./*[local-name()='value']/*[local-name()='display']"/>
- <out:param name="position" select="'first'"/>
-
- <out:choose>
- <out:when test="*[local-name()='hierarchicalParmValueItem']">
- <out:for-each select="./*[local-name()='hierarchicalParmValueItem']">
- <out:variable name="pos">
- <out:choose>
- <out:when test="$position = 'first' and position() = '1'">first</out:when>
- <out:otherwise>not_first</out:otherwise>
- </out:choose>
- </out:variable>
- <out:apply-templates select="." mode="render-values">
- <out:with-param name="ancestorText" select="concat($ancestorText, ' > ' ,*[local-name()='value']/*[local-name()='display'])"/>
- <out:with-param name="position" select="$pos"/>
- </out:apply-templates>
- </out:for-each>
- </out:when>
- <out:otherwise>
- <out:choose>
- <out:when test="$position='not_first'"><br/></out:when>
- <out:otherwise> </out:otherwise>
- </out:choose>
- <out:text>'</out:text>
- <out:value-of select="$ancestorText"/>
- <out:text>'</out:text>
- </out:otherwise>
- </out:choose>
- </out:template>
- <out:template match="text()" mode="render-values"/>
- </xsl:template>
- <!--
- ===============================================================================================
- ut:render-credential
- ===============================================================================================
- -->
- <xsl:template match="prt:renderCredentialPrompts">
- <out:template name="render-credential">
- <out:param name="credential" select="."/>
- <out:param name="pos"/>
- <out:variable name="dsConnections" select="/root/dataSources/cm:queryResponse/cm:queryReply/cm:dataSourceConnection"/>
- <xts:string id="IDS_VIEW_PROMPTS_DATASOUCE_CONNECTION">
- <xts:param name="datasource_name">
- <out:value-of select="$dsConnections[$pos]/cm:parent/cm:dataSource/cm:defaultName"/>
- </xts:param>
- <xts:param name="connection_name">
- <out:value-of select="$dsConnections[$pos]/cm:defaultName"/>
- </xts:param>
- </xts:string>
- <out:choose>
- <out:when test="$credential/dataSourceSignon != ''">
- <xsl:value-of select="' '"/>
- <xts:string id="IDS_VIEW_PROMPTS_DATASOURCE_SIGNON">
- <xts:param name="signon_name">
- <out:value-of select="$dsConnections[$pos]/../following-sibling::*[1]/cm:dataSourceSignon/cm:defaultName"/>
- </xts:param>
- </xts:string>
- </out:when>
- <out:when test="$credential/username != '' and $credential/password != ''">
- <out:variable name="signon_name">
- <xts:string id="IDS_VIEW_PROMPTS_USERID_PASSWORD"/>
- </out:variable>
- <xsl:value-of select="' '"/>
- <xts:string id="IDS_VIEW_PROMPTS_DATASOURCE_SIGNON">
- <xts:param name="signon_name">
- <out:value-of select="$signon_name"/>
- </xts:param>
- </xts:string>
- </out:when>
- <out:when test="$credential/username != ''">
- <out:variable name="signon_name">
- <xts:string id="IDS_VIEW_PROMPTS_USERID_ONLY"/>
- </out:variable>
- <xsl:value-of select="' '"/>
- <xts:string id="IDS_VIEW_PROMPTS_DATASOURCE_SIGNON">
- <xts:param name="signon_name">
- <out:value-of select="$signon_name"/>
- </xts:param>
- </xts:string>
- </out:when>
- <out:when test="$credential/password != ''">
- <out:variable name="signon_name">
- <xts:string id="IDS_VIEW_PROMPTS_PASSWORD_ONLY"/>
- </out:variable>
- <xsl:value-of select="' '"/>
- <xts:string id="IDS_VIEW_PROMPTS_DATASOURCE_SIGNON">
- <xts:param name="signon_name">
- <out:value-of select="$signon_name"/>
- </xts:param>
- </xts:string>
- </out:when>
- </out:choose>
- </out:template>
- </xsl:template>
-
- <xsl:template match="*">
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- <xsl:apply-templates/>
- </xsl:copy>
- </xsl:template>
-
- </xsl:stylesheet>
|