123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397 |
- <?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.
- -->
- <xts:morphlet xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="messages/viewer.xml" requiredCapability="canUseCognosViewer">
- <xts:block id="parseURL" path="rv/logicsheets/parseURL.xslt" type="exec" processor="XSLT" mandatory="false"/>
- <xts:block id="drillTargets" mode="interpret" processor="XSLT" type="exec" dependency="parseURL" condition=".[/root/env/param[@name='drillTargets'] != '']" nodelist="env" mandatory="false">
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <xsl:template match="/">
- <xts:sequence>
- <xts:append select="/root">
- <drillTargets xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <xsl:value-of select="string(/root/env/param[@name='drillTargets'])" disable-output-escaping="yes"/>
- </drillTargets>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <xts:block id="get-objects" type="exec" mode="interpret" processor="XSLT" condition=".[not(/root/env/param[@name='permitRequest']='true')]" dependency="parseURL drillTargets" mandatory="false">
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/">
- <xsl:template match="/root">
- <xts:sequence>
- <xsl:choose>
- <xsl:when test="/root/drillTargets">
- <xts:replace select="/root/drillTargets">
- <drillTargets>
- <xts:transform src="portal/drillthrough.xslt" processor="XSLT">
- <getTargets>
- <drillTargets>
- <xsl:copy-of select="/root/*[local-name()='drillTargets']/*/*"/>
- </drillTargets>
- <xsl:for-each select="/root/*[local-name()='drillTargets']/*[local-name()='rvDrillTargets']/*[local-name()='drillTarget'][@path!='']">
- <cmResponseNode>
- <xsl:attribute name="refId"><xsl:value-of select="./@path"/></xsl:attribute>
- <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
- <send:request provider="cm">
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
- <cm:requests>
- <xsl:call-template name="cmQueryRequest">
- <xsl:with-param name="path" select="./@path"/>
- </xsl:call-template>
- <xsl:variable name="reportVersion">
- <xsl:value-of select="./@path"/>
- <xsl:text>/reportVersion/*[permission('read')]</xsl:text>
- </xsl:variable>
- <xsl:call-template name="cmQueryRequest">
- <xsl:with-param name="path" select="$reportVersion"/>
- </xsl:call-template>
- </cm:requests>
- </cm:query>
- </xts:transform>
- </send:request>
- </xts:transform>
- </cmResponseNode>
- </xsl:for-each>
- </getTargets>
- </xts:transform>
- </drillTargets>
- </xts:replace>
- </xsl:when>
- <xsl:when test="/root/env/param[@name='ui.object']!=''">
- <xts:replace select="/root/env">
- <xts:transform src="portal/drillthrough.xslt" processor="XSLT">
- <getAction>
- <drillAction>
- <xsl:copy-of select="/root/env/*"/>
- </drillAction>
- <cmResponseNode>
- <xsl:attribute name="refId"><xsl:value-of select="/root/env/param[@name='ui.object']"/></xsl:attribute>
- <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
- <send:request provider="cm">
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
- <cm:requests>
- <xsl:call-template name="cmQueryRequest">
- <xsl:with-param name="path" select="/root/env/param[@name='ui.object']"/>
- </xsl:call-template>
- <xsl:variable name="reportVersion">
- <xsl:value-of select="/root/env/param[@name='ui.object']"/>
- <xsl:text>/reportVersion/*[permission('read')]</xsl:text>
- </xsl:variable>
- <xsl:call-template name="cmQueryRequest">
- <xsl:with-param name="path" select="$reportVersion"/>
- </xsl:call-template>
- </cm:requests>
- </cm:query>
- </xts:transform>
- </send:request>
- </xts:transform>
- </cmResponseNode>
- </getAction>
- </xts:transform>
- </xts:replace>
- </xsl:when>
- </xsl:choose>
- </xts:sequence>
- </xsl:template>
- <xsl:template name="cmQueryRequest">
- <xsl:param name="path"/>
- <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
- <cm:search>
- <xsl:value-of select="$path"/>
- </cm:search>
- <cm:properties>
- <cm:property name="searchPath"/>
- <cm:property name="permissions"/>
- <cm:property name="executionFormat"/>
- <cm:property name="defaultOutputFormat"/>
- <cm:property name="format"/>
- <cm:property name="defaultPortalAction"/>
- </cm:properties>
- </cm:query>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <xts:block id="build-drill-context" type="exec" mode="interpret" processor="XSLT" condition=".[/root/drillTargets and count(/root/drillTargets/*) > 0]" dependency="get-objects" nodelist="drillTargets, env" mandatory="false">
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xts:logicsheet path="rv/logicsheets/rvlogic.xsl"/>
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:rvl="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/rv/rvlogic/">
- <xsl:template match="/root">
- <xts:sequence>
- <xts:append select="/root/env">
- <param name="authoredDrillthru">
- <xsl:text><context></xsl:text>
- <xsl:for-each select="/*[local-name()='root']/*[local-name()='drillTargets']/*[local-name()='drillTarget']">
- <xsl:text><member></xsl:text>
- <xsl:text><name></xsl:text>
- <xsl:value-of select="xtsext:xmlencode(string(./@label))"/>
- <xsl:text></name></xsl:text>
- <xsl:text><drillThroughSearchPath></xsl:text>
- <xsl:value-of select="xtsext:xmlencode(string(./@path))"/>
- <xsl:text></drillThroughSearchPath></xsl:text>
- <xsl:text><drillThroughAction></xsl:text>
- <xsl:value-of select="xtsext:xmlencode(string(./@method))"/>
- <xsl:text></drillThroughAction></xsl:text>
- <xsl:text><drillThroughFormat></xsl:text>
- <xsl:value-of select="xtsext:xmlencode(string(./@outputFormat))"/>
- <xsl:text></drillThroughFormat></xsl:text>
- <xsl:text><data></xsl:text>
- <xsl:text>?</xsl:text>
- <xsl:text>&amp;b_action=cognosViewer</xsl:text>
- <xsl:text>&amp;ui.action=authoredDrillThrough2</xsl:text>
- <xsl:text>&amp;ui.routingServerGroup=</xsl:text><xsl:value-of select="string(/root/env/param[@name='ui.routingServerGroup'])"/>
- <xsl:text>&amp;authoredDrill.request=</xsl:text>
- <xsl:variable name="authoredDrillRequest">
- <xsl:call-template name="buildDrillRequest"/>
- </xsl:variable>
- <xsl:value-of select="xtsext:urlencode(string($authoredDrillRequest))"/>
- <xsl:text></data></xsl:text>
- <xsl:text></member></xsl:text>
- </xsl:for-each>
- <xsl:text></context></xsl:text>
- </param>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- <xsl:template name="buildDrillRequest">
- <xsl:text><authoredDrillRequest></xsl:text>
- <xsl:text><param name="action"></xsl:text>
- <xsl:choose>
- <xsl:when test="string(./@method)='execute'">
- <xsl:text>run</xsl:text>
- </xsl:when>
- <xsl:otherwise><xsl:value-of select="xtsext:xmlencode(string(./@method))"/></xsl:otherwise>
- </xsl:choose>
- <xsl:text></param></xsl:text>
- <xsl:text><param name="target"></xsl:text><xsl:value-of select="xtsext:xmlencode(string(./@path))"/><xsl:text></param></xsl:text>
- <xsl:text><param name="format"></xsl:text><xsl:value-of select="xtsext:xmlencode(string(./@outputFormat))"/><xsl:text></param></xsl:text>
- <xsl:text><param name="locale"></xsl:text><xsl:value-of select="xtsext:xmlencode(string(./@outputLocale))"/><xsl:text></param></xsl:text>
- <xsl:text><param name="prompt"></xsl:text><xsl:value-of select="xtsext:xmlencode(string(./@prompt))"/><xsl:text></param></xsl:text>
- <xsl:text><param name="dynamicDrill"></xsl:text><xsl:value-of select="xtsext:xmlencode(string(./@dynamicDrill))"/><xsl:text></param></xsl:text>
- <xsl:text><param name="showInNewWindow"></xsl:text><xsl:value-of select="xtsext:xmlencode(string(./@showInNewWindow))"/><xsl:text></param></xsl:text>
- <xsl:if test="./@bookmarkRef!=''">
- <xsl:text><param name="bookmark"></xsl:text><xsl:value-of select="xtsext:xmlencode(string(./@bookmarkRef))"/><xsl:text></param></xsl:text>
- </xsl:if>
- <xsl:if test="string(./@method) != 'view'">
- <xsl:text><param name="sourceContext"></xsl:text>
- <xsl:variable name="markup-sourceContext">
- <xsl:call-template name="serialize-xml">
- <xsl:with-param name="node-set" select="./*[local-name()='parameters']"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:value-of select="xtsext:xmlencode(string($markup-sourceContext))"/>
- <xsl:text></param></xsl:text>
- <xsl:text><param name="objectPaths"></xsl:text>
- <xsl:variable name="markup-objectPaths">
- <xsl:call-template name="serialize-xml">
- <xsl:with-param name="node-set" select="./*[local-name()='objectPaths']"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:value-of select="xtsext:xmlencode(string($markup-objectPaths))"/>
- <xsl:text></param></xsl:text>
- </xsl:if>
- <xsl:text><drillParameters></xsl:text>
- <xsl:for-each select="./drillParameter">
- <xsl:text><param name="p_</xsl:text><xsl:value-of select="xtsext:xmlencode(string(./@name))"/><xsl:text>"></xsl:text>
- <xsl:if test="./@value!=''">
- <xsl:variable name="selectChoices">
- <rvl:selectChoices/>
- </xsl:variable>
- <xsl:value-of select="xtsext:xmlencode(string($selectChoices))"/>
- </xsl:if>
- <xsl:if test="./@nil!=''">
- <xsl:variable name="selectChoicesNil">
- <rvl:selectChoicesNil/>
- </xsl:variable>
- <xsl:value-of select="xtsext:xmlencode(string($selectChoicesNil))"/>
- </xsl:if>
- <xsl:text></param></xsl:text>
- </xsl:for-each>
- <xsl:text></drillParameters></xsl:text>
- <xsl:text><param name="executionParameters"></xsl:text>
- <xsl:value-of select="string(/root/env/param[@name='encExecutionParameters'])"/>
- <xsl:text></param></xsl:text>
- <xsl:text><param name="metadataModel"></xsl:text>
- <xsl:value-of select="xtsext:xmlencode(string(/root/env/param[@name='modelPath']))"/>
- <xsl:text></param></xsl:text>
- <xsl:text><param name="selectionContext"></xsl:text>
- <xsl:choose>
- <xsl:when test="string(/root/env/param[@name='drillContext']) != ''">
- <xsl:value-of select="xtsext:xmlencode(string(/root/env/param[@name='drillContext']))"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="xtsext:xmlencode(string(/root/env/param[@name='selectionContext']))"/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text></param></xsl:text>
- <xsl:text><param name="source"></xsl:text>
- <xsl:value-of select="xtsext:xmlencode(string(/root/env/param[@name='drillSource']))"/>
- <xsl:text></param></xsl:text>
- <xsl:text><param name="sourceSpecification"></xsl:text>
- <xsl:value-of select="xtsext:xmlencode(string(/root/env/param[@name='sourceSpecification']))"/>
- <xsl:text></param></xsl:text>
- <xsl:text></authoredDrillRequest></xsl:text>
- </xsl:template>
- <pf:serialize-xml/>
- </xsl:stylesheet>
- </xts:block>
- <xts:block id="tranformRequest" mode="interpret" processor="XSLT" type="exec" dependency="parseURL get-objects build-drill-context" condition=".[not(/root/drillTargets) or (/root/env/param[@name='invokeGotoPage'])]" nodelist="env" mandatory="false">
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="xts xtsext">
- <xsl:template match="/">
- <xts:sequence>
- <xsl:variable name="method">
- <xsl:value-of select="/root/env/param[@name='ui.action']"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="/root/env/param[@name='invokeGotoPage']='true'">
- <xts:replace select="/root/env/param[@name='m']">
- <param name="m">portal/goto2.xts</param>
- </xts:replace>
- </xsl:when>
- <xsl:when test="$method='editQuery' or $method='edit'">
- <xts:replace select="/root/env/param[@name='m']">
- <param name="m">qs/qs.xts</param>
- </xts:replace>
- </xsl:when>
- <xsl:when test="$method='editAnalysis'">
- </xsl:when>
- <xsl:otherwise>
- <xts:delete select="/root/env/param[@name='m']"/>
- <xts:replace select="/root/env/param[@name='b_action']">
- <param name="b_action">cognosViewer</param>
- </xts:replace>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test="contains($method, 'edit')">
- <xts:delete select="/root/env/param[@name='run.outputFormat' or @name='outputFormat']"/>
- </xsl:if>
- <!--
- In the case we couldn't determine the default action from our cm request, set the
- default action to execute. This should only happen of the drill target no longer exists. This will allow
- us to run the report, and present the user with an error page, so they know the target is gone.
- marcel - test
- -->
- <xsl:if test="/root/env/param[@name='ui.action']='default'">
- <xts:replace select="/root/env/param[@name='ui.action']">
- <param name="ui.action">run</param>
- </xts:replace>
- </xsl:if>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <xts:block id="do-single-drill" processor="XSLT" condition=".[not(/root/env/param[@name='invokeGotoPage'])]" dependency="parseURL tranformRequest" type="exec" mode="output" mimeType="text/html" mandatory="false">
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:xos="http://developer.cognos.com/schemas/xts/output/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="xsl xos">
- <xsl:output method="html" encoding="utf-8" indent="no"/>
- <xsl:key name="env-param" match="/root/env/param" use="@name"/>
- <pf:variables/>
- <xsl:template match="/">
- <html>
- <head>
- <script language="javascript" src="{$webRoot}/rv/common.js"/>
- <script language="javascript" src="{$webRoot}/common/framework/util/XMLParser.js"/>
- <script language="javascript" src="{$webRoot}/cr1/drill.js"/>
- <script language="javascript">
- function executeDrillThrough()
- {
- var args = new Array();
- var objPathArgument = new Array();
- objPathArgument.push("obj");
- objPathArgument.push("<xsl:value-of select="xtsext:javascriptencode(string(key('env-param','ui.object')))"/>");
- args.push(objPathArgument);
- var parametersArgument;
- <xsl:for-each select="/root/env/param[starts-with(@name, 'p_')]">
- parametersArgument = new Array();
- parametersArgument.push("<xsl:value-of select="xtsext:javascriptencode(string(@name))"/>");
- parametersArgument.push("<xsl:value-of select="xtsext:javascriptencode(string(.))"/>");
- args.push(parametersArgument);
- </xsl:for-each>
- <xsl:if test="string(key('env-param','dfemail')) != ''">
- window.g_dfEmail = <xsl:value-of select="xtsext:javascriptencode(string(key('env-param','dfemail')))"/>;
- </xsl:if>
- if (parent != this && parent.Application && typeof parent.Application.LaunchDrillTargetFromPdf == 'function')
- {
- //Handle drill-through in authoring perspective
- parent.Application.LaunchDrillTargetFromPdf(
- "",
- args,
- "<xsl:value-of select="xtsext:javascriptencode(string(key('env-param','ui.action')))"/>",
- "<xsl:value-of select="xtsext:javascriptencode(string(key('env-param','run.outputFormat')))"/>",
- "<xsl:value-of select="xtsext:javascriptencode(string(key('env-param','run.outputLocale')))"/>",
- "<xsl:value-of select="xtsext:javascriptencode(string(key('env-param','ui.bookmark')))"/>",
- "<xsl:value-of select="xtsext:javascriptencode(string(key('env-param','sourceContext')))"/>",
- "<xsl:value-of select="xtsext:javascriptencode(string(key('env-param','objectPaths')))"/>",
- "",
- "<xsl:value-of select="xtsext:javascriptencode(string(key('env-param','run.prompt')))"/>",
- "<xsl:value-of select="xtsext:javascriptencode(string(key('env-param','dynamicDrill')))"/>");
- }
- else
- {
- doSingleDrill("",
- args,
- "<xsl:value-of select="xtsext:javascriptencode(string(key('env-param','ui.action')))"/>",
- "<xsl:value-of select="xtsext:javascriptencode(string(key('env-param','run.outputFormat')))"/>",
- "<xsl:value-of select="xtsext:javascriptencode(string(key('env-param','run.outputLocale')))"/>",
- "<xsl:value-of select="xtsext:javascriptencode(string(key('env-param','ui.bookmark')))"/>",
- "<xsl:value-of select="xtsext:javascriptencode(string(key('env-param','sourceContext')))"/>",
- "<xsl:value-of select="xtsext:javascriptencode(string(key('env-param','objectPaths')))"/>",
- "",
- "<xsl:value-of select="xtsext:javascriptencode(string(key('env-param','run.prompt')))"/>",
- "<xsl:value-of select="xtsext:javascriptencode(string(key('env-param','dynamicDrill')))"/>");
- }
- };
- </script>
- </head>
- <body onload="executeDrillThrough();"/>
- </html>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <xts:block id="launch-goto-page" processor="XSLT" condition=".[/root/env/param[@name='invokeGotoPage']]" dependency="parseURL tranformRequest" type="exec" mode="output" mimeType="text/html" mandatory="false">
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xos="http://developer.cognos.com/schemas/xts/output/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="xsl xos">
- <xsl:output method="html" encoding="utf-8" indent="no"/>
- <xsl:template match="/">
- <html>
- <body onload="document.drillThroughForm.submit();">
- <form action="{/root/http/param[@name='SCRIPT_NAME']}" name="drillThroughForm" id="drillThroughForm" method="post" style="height:100%;margin:0px">
- <input type="hidden" name="m" value="portal/goto2.xts"/>
- <input type="hidden" name="b_action" value="xts.run"/>
- <input type="hidden" name="authoredDrillthru" value="{/root/env/param[@name='authoredDrillthru']}"/>
- <xsl:if test="/root/env/param[@name='modelDrillEnabled']='true'">
- <input type="hidden" name="drillContext" value="{/root/env/param[@name='drillContext']}"/>
- </xsl:if>
- <xsl:for-each select="/root/env/param[@name != 'm' and @name != 'b_action' and @name != 'authoredDrillthru' and @name != 'drillTargets' and @name != 'drillContext' and @name != 'modelDrillEnabled']">
- <xsl:element name="input">
- <xsl:attribute name="type">hidden</xsl:attribute>
- <xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute>
- <xsl:attribute name="value"><xsl:value-of select="."/></xsl:attribute>
- </xsl:element>
- </xsl:for-each>
- </form>
- </body>
- </html>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- </xts:morphlet>
|