123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359 |
- <xts:morphlet xmlns:xts="http://developer.cognos.com/schemas/xts/" requiredCapability="canUseQueryStudio">
- <!--
- Licensed Materials - Property of IBM
- BI and PM: qs
- (C) Copyright IBM Corp. 2001, 2019
- 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).
- -->
- <xts:block id="queryCM" mode="interpret" processor="XSLT" type="exec" condition=".[/root/env/param[@name='xxRetrievePrompt']='true']" mandatory="false">
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:cm="http://developer.cognos.com/schemas/bibus/3/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt">
- <xsl:key name="env-param" match="/root/env/param" use="@name"/>
- <xsl:template match="/">
- <xts:sequence>
- <xts:append>
- <xts:request asText="true" href="bus://dispatcher" protocol="BUS" responseEnvelope="false" soapAction="http://www.ibm.com/xmlns/prod/cognos/contentManagerService/201404/">
- <SOAP-ENV:Envelope xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <SOAP-ENV:Header>
- <bus:biBusHeader xsi:type="bus:biBusHeader" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/">
- <!--<xsl:choose>
- <xsl:when test="/root/env/param[@name='ui.routingServerGroup']!=''">
- <bus:routing>
- <routingServerGroup>
- <xsl:value-of select="/root/env/param[@name='ui.routingServerGroup']"/>
- </routingServerGroup>
- </bus:routing>
- <xsl:apply-templates select="/root/header/bus:biBusHeader/*[local-name()!='routing']"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="/root/header/bus:biBusHeader/*"/>
- </xsl:otherwise>
- </xsl:choose>-->
- <xsl:if test="/root/env/param[@name='markup_track']!=''">
- <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap', string(key('env-param','markup_track'))), true())" disable-output-escaping="yes"/>
- </xsl:if>
- <xsl:apply-templates select="/root/header/*[local-name() = 'biBusHeader']/*[local-name() != 'tracking' and local-name() != 'dispatcherTransportVars']"/>
- <xsl:if test="string(/root/env/param[@name='ui.routingServerGroup'])!=''">
- <bus:routing xsi:type="bus:routingInfo">
- <routingServerGroup>
- <xsl:value-of select="/root/env/param[@name='ui.routingServerGroup']"/>
- </routingServerGroup>
- </bus:routing>
- </xsl:if>
- </bus:biBusHeader>
- </SOAP-ENV:Header>
- <SOAP-ENV:Body>
- <cm:query xmlns:cm="http://developer.cognos.com/schemas/bibus/3/">
- <search>
- <xsl:value-of select="xtsext:urldecode(string(/root/env/param[@name='xxSearchPath']))"/>
- </search>
- <properties xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="cm:propEnum[1]">
- <item xsi:type="">parameters</item>
- </properties>
- </cm:query>
- </SOAP-ENV:Body>
- </SOAP-ENV:Envelope>
- </xts:request>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- <xsl:template match="*">
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- <xsl:apply-templates/>
- </xsl:copy>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <xts:block id="convertParameters" condition=".[/root/env/param[@name='xxExecutionParameters']!='']" mode="interpret" processor="XSLT" type="exec" mandatory="false">
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt">
- <xsl:template match="/">
- <xts:sequence>
- <xts:append select="/root">
- <executionParameters>
- <xsl:choose>
- <xsl:when test="starts-with(/root/env/param[@name='xxExecutionParameters'], 'CAF')">
- <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap_settemplatename_filterpicklist_settemplateid_01', string(/root/env/param[@name='xxExecutionParameters'])), true())" disable-output-escaping="yes"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="xtsext:web64decode(string(/root/env/param[@name='xxExecutionParameters']), true())" disable-output-escaping="yes"/>
- </xsl:otherwise>
- </xsl:choose>
- </executionParameters>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <xts:block id="getContent" mode="interpret" processor="XSLT" type="exec" dependency="queryCM convertParameters">
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:SOAP-ENV="http://www.w3.org/2001/09/soap-envelope" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/">
- <xsl:key name="env-param" match="/root/env/param" use="@name"/>
- <xsl:output method="xml" version="1.0" encoding="UTF-8"/>
- <xsl:template match="/">
-
- <xsl:variable name="QSRunSpecification">
- <xsl:text/><metadataRequest connection="<xsl:value-of select="xtsext:xmlencode(xtsext:urldecode(string(/root/env/param[@name='xxModelName'])))"/>"><xsl:text/>
- <xsl:text/><Metadata authoringLocale="<xsl:value-of select="xtsext:xmlencode(string(/root/env/param[@name='xxExprLocale']))"/>" xml:lang="<xsl:value-of select="xtsext:xmlencode(string(/root/user/param[@name='productLocale']))"/>" start_atRef="<xsl:value-of select="xtsext:xmlencode(string(/root/env/param[@name='xxFullColExpression']))"/>" Depth="<xsl:value-of select="/root/env/param[@name='depth']"/>" no_collections="1"><xsl:text/>
- <xsl:text/><Properties><xsl:text/>
- <xsl:text/><Property name="./member"/><xsl:text/>
- <xsl:text/><Property name="./level"/><xsl:text/>
- <xsl:text/><Property name="./dimension"/><xsl:text/>
- <xsl:text/><Property name="./hierarchy"/><xsl:text/>
- <xsl:text/><Property name="*/@memberUniqueName"/><xsl:text/>
- <xsl:text/><Property name="*/@memberCaption"/><xsl:text/>
- <xsl:text/><Property name="*/@name"/><xsl:text/>
- <xsl:text/><Property name="*/@_ref"/><xsl:text/>
- <xsl:text/><Property name="*/@hierarchyUniqueName"/><xsl:text/>
- <xsl:text/><Property name="*/@parentUniqueName"/><xsl:text/>
- <xsl:text/><Property name="*/@levelUniqueName"/><xsl:text/>
- <xsl:text/><Property name="*/@levelNumber"/><xsl:text/>
- <xsl:text/></Properties><xsl:text/>
- <xsl:text/></Metadata><xsl:text/>
- <xsl:text/></metadataRequest>
- </xsl:variable>
- <xts:sequence>
- <xts:append select="/root/env">
- <param name="QSRunSpecification"><xsl:value-of select="$QSRunSpecification"/></param>
- </xts:append>
- <xts:append>
- <xts:request asText="true" href="bus://dispatcher" protocol="BUS" soapAction="http://www.ibm.com/xmlns/prod/cognos/reportService/201404/" faultBlock="faultHandler" responseEnvelope="true" outputHeader="true">
- <SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema">
- <SOAP-ENV:Header>
- <bus:biBusHeader xsi:type="bus:biBusHeader" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/">
- <!--<xsl:choose>
- <xsl:when test="/root/env/param[@name='ui.routingServerGroup']!=''">
- <bus:routing>
- <routingServerGroup>
- <xsl:value-of select="/root/env/param[@name='ui.routingServerGroup']"/>
- </routingServerGroup>
- </bus:routing>
- <xsl:apply-templates select="/root/header/bus:biBusHeader/*[local-name()!='routing' and local-name() != 'dispatcherTransportVars']"/>
- </xsl:when>
- <xsl:otherwise>
- --><!-- For bug 611371. Don't copy the dispatcherTransportVars since these are copied directly from
- the browser. This can cause permission problems due to a 'front' = 'true' variable signifying
- this as an external request, even though it's internal. --><!--
- <xsl:apply-templates select="/root/header/bus:biBusHeader/*[local-name() != 'dispatcherTransportVars']"/>
- </xsl:otherwise>
- </xsl:choose>-->
- <xsl:if test="/root/env/param[@name='markup_track']!=''">
- <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap', string(key('env-param','markup_track'))), true())" disable-output-escaping="yes"/>
- </xsl:if>
- <xsl:apply-templates select="/root/header/*[local-name() = 'biBusHeader']/*[local-name() != 'tracking' and local-name() != 'dispatcherTransportVars']"/>
- <xsl:if test="string(/root/env/param[@name='ui.routingServerGroup'])!=''">
- <bus:routing xsi:type="bus:routingInfo">
- <routingServerGroup>
- <xsl:value-of select="/root/env/param[@name='ui.routingServerGroup']"/>
- </routingServerGroup>
- </bus:routing>
- </xsl:if>
- </bus:biBusHeader>
- </SOAP-ENV:Header>
- <SOAP-ENV:Body>
- <runSpecification xmlns="http://developer.cognos.com/schemas/reportService/1">
- <bus:specification xsi:type="bus:reportServiceMetadataSpecification" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <bus:value xsi:type="bus:specification">
- <xsl:value-of select="$QSRunSpecification"/>
- </bus:value>
- </bus:specification>
- <bus:parameterValues xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:parameterValue[]" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/">
- <xsl:for-each select="/root/env/param[@name='xxCreds']">
- <xsl:value-of select="." disable-output-escaping="yes"/>
- </xsl:for-each>
- <xsl:for-each select="/root/env/param[@name='xxPromptValues']">
- <xsl:value-of select="." disable-output-escaping="yes"/>
- </xsl:for-each>
- <xsl:if test="/root/executionParameters">
- <xsl:copy-of select="/root/executionParameters/*[local-name()='parameters']/*"/>
- </xsl:if>
- </bus:parameterValues>
- <bus:options xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:option[]" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/">
- <item xsi:type="bus:runOptionString">
- <bus:name xsi:type="bus:runOptionEnum">promptFormat</bus:name>
- <bus:value xsi:type="xsd:string">HTML</bus:value>
- </item>
- <item xsi:type="bus:asynchOptionInt">
- <bus:name xsi:type="bus:asynchOptionEnum">primaryWaitThreshold</bus:name>
- <bus:value xsi:type="xsd:int">0</bus:value>
- </item>
- <item xsi:type="bus:runOptionBoolean">
- <bus:name xsi:type="bus:runOptionEnum">prompt</bus:name>
- <bus:value xsi:type="xsd:boolean">false</bus:value>
- </item>
- </bus:options>
- </runSpecification>
- </SOAP-ENV:Body>
- </SOAP-ENV:Envelope>
- </xts:request>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- <xsl:template match="*">
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- <xsl:apply-templates/>
- </xsl:copy>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <xts:block id="appendDocument" mode="interpret" processor="XSLT" type="exec" dependency="getContent">
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:cm="http://developer.cognos.com/schemas/cm/1/" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="xsl xts cm bus xtsext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <xsl:output method="xml" version="1.0" encoding="UTF-8"/>
- <xsl:template match="/root">
- <xts:sequence>
- <xts:append select="/root">
- <xsl:value-of select="./*[local-name()='Envelope']/*[local-name()='Body']/*[local-name()='runSpecificationResponse']/*[local-name()='result']/*[local-name()='details']/*[local-name()='item']/*[local-name()='outputPages']/*[local-name()='item']" disable-output-escaping="yes"/>
- <xsl:value-of select="substring-after(./*[local-name()='Envelope']/*[local-name()='Body']/*[local-name()='runSpecificationResponse']/*[local-name()='result']/*[local-name()='details']/*[local-name()='item']/*[local-name()='metadata'], '?>')" disable-output-escaping="yes"/>
- </xts:append>
- <xts:append select="/root/env">
- <param name="promptSelections"><selectChoices><xsl:for-each select="/root/*[local-name() = 'queryResponse']/queryResult/item/parameters/value/item"><xsl:if test="/root/env/param[@name='xxPromptParam']=./name"><xsl:for-each select="./value/item"><selectOption><xsl:attribute name="displayValue"><xsl:value-of select="./display" disable-output-escaping="yes"/></xsl:attribute><xsl:attribute name="useValue"><xsl:value-of select="./use" disable-output-escaping="yes"/></xsl:attribute></selectOption></xsl:for-each></xsl:if></xsl:for-each></selectChoices></param>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
-
- <!-- A block to handle a prompt response. This usually doesn't happen because all our prompts are already defined via xxPromptParams
- or in executionParameters. However, in the case of prompt macros, they may not be defined when in nodata mode. (See bug 613217).
- Simply creates javascript that contains the report spec we're going to round-trip to promptDataSource.xts.
- -->
- <xts:block id="handlePrompt" mode="output" processor="XSLT" type="exec" mimeType="application/x-javascript" dependency="appendDocument" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" condition=".[/root/*[local-name() = 'Envelope']/*[local-name() = 'Body']/*/*[local-name() = 'result']/*[local-name() = 'details']/item/*[local-name() = 'status'] = 'prompting']" mandatory="false">
-
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" version="1.0">
- <xsl:output method="text" version="1.0" encoding="UTF-8" indent="no"/>
- <pf:variables/>
-
- <!-- Set the run Specification we've already created. This will be passed along to promptDataSource.xts -->
- <xsl:variable name="runSpecification">
- <xsl:value-of select="/root/env/param[@name='QSRunSpecification']"/>
- </xsl:variable>
- <xsl:template match="/root">
- var bPrompting = true;
- var sReportSpecification = "<xsl:text/><xsl:value-of select="xtsext:javascriptencode($runSpecification)"/><xsl:text/>";
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
-
- <xts:block id="parseContent" mode="output" processor="XSLT" type="exec" mimeType="application/x-javascript" dependency="appendDocument">
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" version="1.0">
- <xsl:output method="text" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="/root">
- <xsl:choose>
- <xsl:when test="ResponseRoot/hierarchy/member[string(@parentUniqueName)='']">
- <xsl:text/>if (typeof _treenodes!="object"){_treenodes = new Array();}<xsl:text/>
- <xsl:text/>var bDrawAll = 'true';<xsl:text/>
- <xsl:apply-templates select="ResponseRoot/hierarchy/member[string(@parentUniqueName)='']"/>
- </xsl:when>
- <xsl:when test="ResponseRoot/level/member">
- <xsl:text/>if (typeof _treenodes!="object"){_treenodes = new Array();}<xsl:text/>
- <xsl:text/>var bDrawAll = 'true';<xsl:text/>
- <xsl:apply-templates select="ResponseRoot/level/member" mode="NoRoot"/>
- </xsl:when>
- <xsl:when test="ResponseRoot/member/member">
- <xsl:text/>if (typeof _treenodes!="object"){_treenodes = new Array();} <xsl:text/>
- <xsl:text/>var bDrawAll = 'false';<xsl:text/>
- <xsl:apply-templates select="ResponseRoot/member/member"/>
- <xsl:call-template name="addChildrenToNode">
- <xsl:with-param name="parent"><xsl:value-of select="xtsext:javascriptencode(ResponseRoot/member/@memberUniqueName)"/></xsl:with-param>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="/root/logonFault">
- <xsl:text/>FAULT;timeout<xsl:text/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text/>if (typeof _treenodes!="object"){_treenodes = new Array();}<xsl:text/>
- <xsl:text/>var bDrawAll = 'false';<xsl:text/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="hierarchy">
- <xsl:variable name="hun">
- <xsl:value-of select="@_ref"/>
- </xsl:variable>
- <xsl:for-each select="../*[@parentUniqueName=$hun]">
- <xsl:apply-templates/>
- </xsl:for-each>
- </xsl:template>
- <xsl:template match="member">
- <xsl:call-template name="createTreeNode">
- <xsl:with-param name="node" select="."/>
- <xsl:with-param name="parent">
- <xsl:choose>
- <xsl:when test="string(@parentUniqueName)=''"><xsl:call-template name="getTreeName"/>.getRootNode()</xsl:when>
- <xsl:otherwise>_treenodes['<xsl:value-of select="xtsext:javascriptencode(./@parentUniqueName)"/>']</xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:template>
- <xsl:template match="member" mode="NoRoot">
- <xsl:call-template name="createTreeNode">
- <xsl:with-param name="node" select="."/>
- <xsl:with-param name="parent"><xsl:call-template name="getTreeName"/>.getRootNode()</xsl:with-param>
- </xsl:call-template>
- </xsl:template>
-
- <xsl:template name="addChildrenToNode">
- <xsl:param name="parent"/>
- var addToNode = '<xsl:value-of select="$parent"/>';
- </xsl:template>
- <xsl:template name="createTreeNode">
- <xsl:param name="node"/>
- <xsl:param name="parent"/>
- <xsl:variable name="mun">
- <xsl:value-of select="$node/@memberUniqueName"/>
- </xsl:variable>
- <xsl:variable name="nodeObj">
- <xsl:text/>_treenodes['<xsl:value-of select="xtsext:javascriptencode($mun)"/>']<xsl:text/>
- </xsl:variable>
- <xsl:value-of select="$nodeObj"/>= new CTreeNode(<xsl:text/>
- <xsl:value-of select="$parent"/>,tntMember,false,<xsl:text/>
- <xsl:text/>'<xsl:value-of select="xtsext:javascriptencode($node/@memberCaption)"/>',<xsl:text/>
- <xsl:text/>'<xsl:value-of select="xtsext:javascriptencode($mun)"/>',<xsl:text/>
- <xsl:text/>false);<xsl:text/>
- <xsl:choose>
- <xsl:when test="$node/../*[@parentUniqueName=$mun]">
- <xsl:apply-templates select="$node/../*[@parentUniqueName=$mun]"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$nodeObj"/>.setCanHaveChildren(true);<xsl:text/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="getTreeName">
- <xsl:choose>
- <xsl:when test="/root/env/param[@name='textBoxControl']='searchpSearch'">searchpSearch</xsl:when>
- <xsl:when test="/root/env/param[@name='textBoxControl']='checkBoxListpList'">checkBoxListpList</xsl:when>
- <xsl:otherwise>treepList</xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <xts:block id="faultHandler" path="qs/logicsheets/faultHandler.xsl" type="fault" processor="XSLT"/>
- </xts:morphlet>
|