123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339 |
- <?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).
- -->
- <xts:morphlet xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="messages/portal.xml, messages/portalRL.xml">
- <!--
- ===============================================================================================
- copy-prompts - If we are coming from a prompt page (method = forward) remember the prompt values then drop them from the
- environment parameters. This assumes that all parameters that begin with p_ belong to prompts.
- ===============================================================================================
- -->
- <xts:block id="copy-prompts" mode="interpret" processor="XSLT" type="exec" condition=".[/root/env/param[@name='method'] = 'forward']" mandatory="false">
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
- xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/"
- xmlns:cm="http://developer.cognos.com/schemas/cm/1/"
- xmlns:SOAP-ENV="http://www.w3.org/2001/09/soap-envelope"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="send cml cm SOAP-ENV xtsext">
- <xsl:template match="/">
- <xts:sequence>
- <xts:append>
- <PromptValues>
- <xsl:apply-templates select="/root/env/param[starts-with(@name, 'p_')]" mode="prmtVals"/>
- </PromptValues>
- </xts:append>
- <xsl:if test="/root/env/param[starts-with(@name, 'p_credential')]">
- <xsl:variable name="creds" select="/root/env/param[starts-with(@name, 'p_credential')]"/>
- <xts:delete select="/root/encodedRptSvcParam"/>
- <xts:append>
- <encodedRptSvcParam>
- <xts:function name="web64encode">
- <xts:param name="source">
- <xts:transform name="XMLEncode">
- <rptSvcParam name="{substring-after($creds/@name,'_')}">
- <xsl:if test="string($creds) != ''">
- <xts:transform name="XMLDecode">
- <xsl:value-of select="string($creds)"/>
- </xts:transform>
- </xsl:if>
- </rptSvcParam>
- </xts:transform>
- </xts:param>
- </xts:function>
- </encodedRptSvcParam>
- </xts:append>
- <xts:delete select="/root/env/param[@name='encodedRptSvcParam']"/>
- </xsl:if>
- <xts:delete select="/root/env/param[starts-with(@name, 'p_')]"/>
- </xts:sequence>
- </xsl:template>
- <xsl:template match="/root/env/param" mode="prmtVals">
- <PromptValue name="{substring-after(@name,'_')}">
- <xsl:if test="string(.) != ''">
- <xts:transform name="XMLDecode">
- <xsl:value-of select="string(.)"/>
- </xts:transform>
- </xsl:if>
- </PromptValue>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===============================================================================================
- request - We depend on the caller passing in the form fields from their request header. As a
- result there are no input parameters to the forward request.
- ===============================================================================================
- -->
- <xts:block id="request" dependency="copy-prompts" mode="interpret" processor="XSLT" type="exec">
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
- xmlns:rs="http://developer.cognos.com/schemas/reportService/1"
- xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:xs="http://www.w3.org/2001/XMLSchema"
- xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
- xmlns:SOAP-ENV="http://www.w3.org/2001/09/soap-envelope"
- SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt">
- <xsl:output method="xml" version="1.0" encoding="UTF-8"/>
- <xsl:key name="env-param" match="/root/env/param" use="@name"/>
- <xsl:template match="/">
- <xts:sequence>
- <xts:append>
- <response>
- <send:request provider="warp" option="xml-multipart" outputHeader="true" responseEnvelope="true" affinity=".high">
- <rs:forward xmlns:xs="http://www.w3.org/2001/XMLSchema">
- <conversation xsi:type="bus:asynchRequest">
- <xts:transform name="XMLDecode">
- <xsl:value-of select="xtsext:web64decode(string(xtsext:cafaction('sign_unwrap', string(key('env-param','web64conversation')))), true())"/>
- </xts:transform>
- </conversation>
- <xsl:call-template name="SetParameters"/>
- <xsl:choose>
- <xsl:when test="key('env-param', 'prompt') != ''">
- <bus:options xsi:type="bus:optionArray" SOAP-ENC:arrayType="bus:option[]">
- <!-- prompt will be false with Finish button, true with Next button -->
- <item xsi:type="bus:runOptionBoolean">
- <bus:name xsi:type="bus:runOptionEnum">prompt</bus:name>
- <bus:value xsi:type="xs:boolean">
- <xsl:value-of select="key('env-param', 'prompt')"/>
- </bus:value>
- </item>
- </bus:options>
- </xsl:when>
- <xsl:otherwise>
- <bus:options xsi:type="bus:optionArray" SOAP-ENC:arrayType="bus:option[]"/>
- </xsl:otherwise>
- </xsl:choose>
- </rs:forward>
- </send:request>
- </response>
- </xts:append>
- <xts:append>
- <encodedTracking>
- <xts:function name="web64encode">
- <xts:param name="source">
- <xts:transform name="XMLEncode">
- <xts:queryNode select="/root/response/*[local-name()='Envelope']/*[local-name()='Header']/*[local-name()='biBusHeader']/*[local-name() = 'tracking']"/>
- </xts:transform>
- </xts:param>
- <xts:param name="compress">true</xts:param>
- </xts:function>
- </encodedTracking>
- <encodedUIConversation>
- <xts:function name="web64encode">
- <xts:param name="source">
- <xts:transform name="XMLEncode">
- <xts:queryNode select="/root/response/*[local-name()='Envelope']/*[local-name()='Body']/*/*[local-name()='result']/*[local-name()='primaryRequest']"/>
- </xts:transform>
- </xts:param>
- <xts:param name="compress">true</xts:param>
- </xts:function>
- </encodedUIConversation>
- <encodedConversation>
- <xts:function name="web64encode">
- <xts:param name="source">
- <xts:transform name="XMLEncode">
- <xts:queryNode select="/root/response/*[local-name()='Envelope']/*[local-name()='Body']/*/*[local-name()='result']/*[local-name()='primaryRequest']/*"/>
- </xts:transform>
- </xts:param>
- <xts:param name="compress">true</xts:param>
- </xts:function>
- </encodedConversation>
- <conversationStatus>
- <xts:queryNode select="/root/response/*[local-name()='Envelope']/*[local-name()='Body']/*/*[local-name()='result']/*[local-name()='details']/*[local-name()='item' and contains(@*[local-name()='type'], 'asynchDetailReportStatus')]/*[local-name()='status']"/>
- </conversationStatus>
- <resultStatus>
- <xts:queryNode select="/root/response/*[local-name()='Envelope']/*[local-name()='Body']/*/*[local-name()='result']/*[local-name()='status']"/>
- </resultStatus>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- <xsl:include href="/portal/iPrompting/setParameters.xslt"/>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===============================================================================================
- release conversation -
- ===============================================================================================
- -->
- <xts:block id="release-conversation" dependency="request" type="exec" mode="interpret" processor="XSLT" condition=".[(string(/root/resultStatus)='conversationComplete' or string(/root/resultStatus)='complete') and not(/root/response/*/*/*/*/*[local-name() = 'details']/*/*[local-name()='status'] = 'prompting') and /root/env/param[@name='web64conversation']]" mandatory="false">
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
- xmlns:rs="http://developer.cognos.com/schemas/reportService/1"
- xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:xs="http://www.w3.org/2001/XMLSchema"
- xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
- xmlns:SOAP-ENV="http://www.w3.org/2001/09/soap-envelope"
- SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:key name="env-param" match="/root/env/param" use="@name"/>
- <xsl:template match="/">
- <xts:sequence>
- <xts:append>
- <releaseConversation>
- <send:request provider="warp" option="xml-multipart" outputHeader="true" responseEnvelope="true" affinity=".absolute">
- <xsl:element name="release" namespace="http://developer.cognos.com/schemas/reportService/1">
- <conversation xsi:type="bus:asynchRequest">
- <xts:transform name="XMLDecode">
- <xsl:value-of select="xtsext:web64decode(string(xtsext:cafaction('sign_unwrap', string(key('env-param','web64conversation')))), true())"/>
- </xts:transform>
- </conversation>
- </xsl:element>
- </send:request>
- </releaseConversation>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===============================================================================================
- render-parameters -
- ===============================================================================================
- -->
- <xts:block id="render-parameters" dependency="request release-conversation" type="exec" mode="interpret" processor="XSLT" condition=".[(/root/resultStatus='conversationComplete' or /root/resultStatus='complete') and not(/root/response/*[local-name()='Envelope']/*[local-name()='Body']/*[contains(local-name(), 'Response')]/*[local-name()='result']/*[local-name()='details']/*/*[local-name()='status']='prompting')]" mandatory="false">
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:prompt="http://developer.cognos.com/schemas/xts/portal/iPrompting/1/" xmlns:xos="http://developer.cognos.com/schemas/xts/output/" exclude-result-prefixes="xsl bus">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <!-- Ouptut a response containing the parameter values -->
- <xsl:template match="/root">
- <xsl:variable name="forwardResponse">
- <prompt:forwardResponse>
- <xsl:choose>
- <xsl:when test="/root/command/*/getParametersRequest">
- <xsl:copy-of select="/root/response/*/*/*[local-name()='forwardResponse']/*[local-name()='result']/*[local-name()='details']/*[local-name()='item' and contains(@xsi:type, 'asynchDetailParameters')]/*"/>
- </xsl:when>
- <xsl:when test="/root/command/*/metaDataRequest and string(/root/env/param[@name='execMethod'])='metadata' and /root/response/*/*/*[contains(local-name(),'Response')]/*[local-name()='result']/*[local-name()='details']/*[local-name()='item']/*[local-name()='metadata']">
- <xsl:if test="/root/env/param[@name='startScopeAt'] or /root/env/param[@name='startBMItemAt'] or /root/env/param[starts-with(@name,'startDataItemAt_')]">
- <metadataResponse>
- <xts:transform name="XMLDecode">
- <xsl:value-of select="/root/response/*/*/*[contains(local-name(),'Response')]/*[local-name()='result']/*[local-name()='details']/*[local-name()='item']/*[local-name()='metadata']"/>
- </xts:transform>
- </metadataResponse>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <parameters>
- <xsl:if test="/root/response/*/*/*[local-name()='forwardResponse']/*[local-name()='result']/*[local-name()='details']/*[local-name()='item' and contains(@xsi:type, 'asynchDetailParameterValues')]">
- <xts:transform src="transforms/portal/parameters/post-WARP-process.xslt" processor="XSLT">
- <xsl:copy-of select="/root/response/*/*/*[local-name()='forwardResponse']/*[local-name()='result']/*[local-name()='details']/*[local-name()='item' and contains(@xsi:type, 'asynchDetailParameterValues')]"/>
- </xts:transform>
- </xsl:if>
- </parameters>
- </xsl:otherwise>
- </xsl:choose>
- </prompt:forwardResponse>
- </xsl:variable>
- <xsl:choose>
- <!-- pack the response and unpack it in Finish -->
- <xsl:when test="/root/command/*/*[local-name()='callFinish']='true'">
- <xts:sequence>
- <xts:append>
- <encodedParameters>
- <xts:function name="web64encode">
- <xts:param name="source">
- <xts:transform name="XMLEncode">
- <xsl:copy-of select="$forwardResponse"/>
- </xts:transform>
- </xts:param>
- <xts:param name="compress">true</xts:param>
- </xts:function>
- </encodedParameters>
- </xts:append>
- </xts:sequence>
- </xsl:when>
- <xsl:otherwise>
- <xts:sequence>
- <xts:append select="/root/output">
- <xos:part>
- <xos:entityHeader>
- <xos:param name="Content-Type">text/xml; charset=utf-8</xos:param>
- </xos:entityHeader>
- <xos:entityBody>
- <xsl:copy-of select="$forwardResponse"/>
- </xos:entityBody>
- </xos:part>
- </xts:append>
- </xts:sequence>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
-
- <!--
- ===============================================================================================
- wait - This block generates the contents of the wait page
- ===============================================================================================
- -->
- <xts:block id="waitPage" type="exec" mode="output" processor="XSLT" dependency="request release-conversation"
- mimeType="text/html" contentId="waitPage" partId="1"
- path="/portal/iPrompting/page-parts/wait.xslt"
- condition=".[contains(' working stillWorking ', concat(' ', /root/resultStatus, ' '))]"
- mandatory="false">
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
- </xts:block>
- <!--
- ===============================================================================================
- head - This block generates the HTML <head> tag.
- ===============================================================================================
- -->
- <xts:block id="head" type="exec" mode="output" processor="XSLT" dependency="request release-conversation"
- mimeType="text/html" contentId="head" partId="1"
- path="/portal/iPrompting/page-parts/head.xslt"
- condition=".[/root/conversationStatus='prompting' or (((/root/resultStatus='conversationComplete' or /root/resultStatus='complete') and not(/root/response/*[local-name()='Envelope']/*[local-name()='Body']/*[contains(local-name(), 'Response')]/*[local-name()='result']/*[local-name()='details']/*/*[local-name()='status']='prompting')) and /root/command/*/*[local-name()='callFinish']='true') or contains(' working stillWorking ', concat(' ', /root/resultStatus, ' '))]"
- mandatory="false">
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xts:logicsheet path="portal/iPrompting/logicsheets/common.xslt"/>
- <xts:logicsheet path="logicsheets/presentation/main/presentation.xsl"/>
- </xts:block>
- <!--
- ===============================================================================================
- bottomRow - This block generates the bottom row of the main table.
- ===============================================================================================
- -->
- <xts:block id="bottomRow" type="exec" mode="output" processor="XSLT" dependency="request release-conversation render-parameters"
- mimeType="text/html" contentId="bottomRow" partId="1"
- path="/portal/iPrompting/page-parts/tail.xslt"
- condition=".[/root/conversationStatus='prompting' or (((/root/resultStatus='conversationComplete' or /root/resultStatus='complete') and not(/root/response/*[local-name()='Envelope']/*[local-name()='Body']/*[contains(local-name(), 'Response')]/*[local-name()='result']/*[local-name()='details']/*/*[local-name()='status']='prompting')) and /root/command/*/*[local-name()='callFinish']='true') or contains(' working stillWorking ', concat(' ', /root/resultStatus, ' '))]"
- mandatory="false">
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- </xts:block>
-
- <!--
- ===============================================================================================
- render-page - Main page rendering block. Combines the "content" blocks generated in the blocks
- above with the report itself which is returned in a multi-part message from report server.
- ===============================================================================================
- -->
- <xts:block id="render-page" type="exec" mode="interpret" processor="XSLT"
- dependency="head bottomRow waitPage"
- path="/portal/iPrompting/page-parts/page.xslt"
- condition=".[/root/conversationStatus='prompting' or ((/root/resultStatus='conversationComplete' or /root/resultStatus='complete') and /root/command/*/*[local-name()='callFinish']='true') or contains(' working stillWorking ', concat(' ', /root/resultStatus, ' '))]"
- mandatory="false">
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/main/framework.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/main/presentation.xsl"/>
- </xts:block>
- </xts:morphlet>
|