123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: cogadmin
- (C) Copyright IBM Corp. 2005, 2016
- 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).
- -->
- <!--
- Input elements
- <provider></provider> eventManagementService or monitorService (more will be added when needed)
- <request></request>
- <specification></specification>
- <parameters></parameters>
- <options></options>
- <releaseConversation></releaseConversation> true = release conversation with monitor service
- -->
- <xts:morphlet xmlns:xts="http://developer.cognos.com/schemas/xts/">
- <!--
- releaseConversation - special case were we have a conversation but we're execution a runSpecification request. This
- happens when the user changes filters or the sort order.
- -->
- <xts:block id="releaseConversation" mode="interpret" processor="XSLT" type="exec" condition=".[(/root/command/*[local-name()='asyncRequest']/conversation != '' and /root/command/*[local-name()='asyncRequest']/request = 'runSpecification') or (/root/command/*[local-name()='asyncRequest']/conversation != '' and /root/command/*[local-name()='asyncRequest']/releaseConversation = 'true')]" 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:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
- xmlns:async="http://developer.cognos.com/schemas/xts/cogadmin/iAsyncRequest/1/"
- xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
- exclude-result-prefixes="bus xsi xsd xtsext SOAP-ENV SOAP-ENC async">
-
- <xsl:output method="xml" version="1.0" encoding="UTF-8"/>
- <xsl:key name="env-param" match="/root/env/param" use="@name"/>
- <xsl:variable name="provider" select="/root/command/async:asyncRequest/provider"/>
- <xsl:variable name="providerNamespace">
- <xsl:choose>
- <xsl:when test="$provider = 'eventManagementService'">http://www.ibm.com/xmlns/prod/cognos/eventManagementService/201101/</xsl:when>
- <xsl:when test="$provider = 'monitorService'">http://www.ibm.com/xmlns/prod/cognos/monitorService/201101/</xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="soapAction">
- <xsl:choose>
- <xsl:when test="$provider = 'eventManagementService'">http://www.ibm.com/xmlns/prod/cognos/eventManagementService/201610/.absolute</xsl:when>
- <xsl:when test="$provider = 'monitorService'">http://www.ibm.com/xmlns/prod/cognos/monitorService/201610/.absolute</xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:template match="/">
- <xts:sequence>
- <xts:append>
- <response>
- <xts:request href="bus://dispatcher" faultBlock="eatFault" protocol="BUS" soapAction="{$soapAction}" responseEnvelope="false" outputHeader="false">
- <SOAP-ENV:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" 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: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/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <xsl:if test="/root/command/async:asyncRequest/tracking != ''">
- <!-- use the round-tripped tracking information -->
- <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap', string(/root/command/async:asyncRequest/tracking)), true())" disable-output-escaping="yes"/>
- </xsl:if>
- <!-- We don't want to copy the tracking info in this case because we want a separate conversation for the metadata -->
- <xsl:apply-templates select="/root/header/bus:biBusHeader/*[local-name()!='tracking']"/>
- </bus:biBusHeader>
- </SOAP-ENV:Header>
- <SOAP-ENV:Body>
- <xsl:element name="release" namespace="{$providerNamespace}">
- <conversation xsi:type="bus:asynchRequest">
- <xts:transform name="XMLDecode">
- <xsl:value-of select="xtsext:web64decode(string(xtsext:cafaction('sign_unwrap', string(/root/command/async:asyncRequest/conversation))), true())"/>
- </xts:transform>
- </conversation>
- </xsl:element>
- </SOAP-ENV:Body>
- </SOAP-ENV:Envelope>
- </xts:request>
- </response>
- </xts:append>
-
- <!-- delete the conversation and tracking info from the DOM -->
- <xts:delete select="/root/command/*[local-name()='asyncRequest']/tracking | /root/command/*[local-name()='asyncRequest']/conversation"/>
- </xts:sequence>
- </xsl:template>
- <!-- used to copy the bus header stuff - see "apply-templates" above. -->
- <xsl:template match="*">
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- <xsl:apply-templates/>
- </xsl:copy>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- eatFault - eat up the fault and continue on
- -->
- <xts:block id="eatFault" type="fault" processor="XSLT">
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
- <xsl:output method="xml"/>
- <xsl:template match="/">
- <eatFault/>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- runSpecification
- -->
- <xts:block id="doRequest" dependency="releaseConversation" mode="interpret" processor="XSLT" type="exec" condition=".[not(/root/command/*[local-name()='asyncRequest']/releaseConversation)]" 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:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
- xmlns:async="http://developer.cognos.com/schemas/xts/cogadmin/iAsyncRequest/1/"
- xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
- exclude-result-prefixes="bus xsi xsd xtsext SOAP-ENV SOAP-ENC async">
-
- <xsl:output method="xml" version="1.0" encoding="UTF-8"/>
- <xsl:key name="env-param" match="/root/env/param" use="@name"/>
- <xsl:variable name="request" select="/root/command/async:asyncRequest/request"/>
-
- <!-- figure out what the affinity should be -->
- <xsl:variable name="affinity">
- <xsl:choose>
- <xsl:when test="$request='firstPage'">high</xsl:when>
- <xsl:when test="$request='lastPage'">high</xsl:when>
- <xsl:when test="$request='nextPage'">high</xsl:when>
- <xsl:when test="$request='previousPage'">high</xsl:when>
- <xsl:when test="$request='release'">absolute</xsl:when>
- <xsl:when test="$request='wait'">absolute</xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="provider" select="/root/command/async:asyncRequest/provider"/>
- <xsl:variable name="providerNamespace">
- <xsl:choose>
- <xsl:when test="$provider = 'eventManagementService'">http://www.ibm.com/xmlns/prod/cognos/eventManagementService/201101/</xsl:when>
- <xsl:when test="$provider = 'monitorService'">http://www.ibm.com/xmlns/prod/cognos/monitorService/201101/</xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="soapActionBase">
- <xsl:choose>
- <xsl:when test="$provider = 'eventManagementService'">http://www.ibm.com/xmlns/prod/cognos/eventManagementService/201610/</xsl:when>
- <xsl:when test="$provider = 'monitorService'">http://www.ibm.com/xmlns/prod/cognos/monitorService/201610/</xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="soapAction">
- <xsl:value-of select="$soapActionBase"/>
- <xsl:if test="$affinity != ''"><xsl:value-of select="concat('.', $affinity)"/></xsl:if>
- </xsl:variable>
-
- <xsl:template match="/">
- <xts:sequence>
- <xts:append>
- <response>
- <xts:request href="bus://dispatcher" protocol="BUS" soapAction="{$soapAction}" responseEnvelope="true" outputHeader="true">
- <SOAP-ENV:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" 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: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/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <xsl:if test="/root/command/async:asyncRequest/tracking != ''">
- <!-- use the round-tripped tracking information -->
- <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap', string(/root/command/async:asyncRequest/tracking)), true())" disable-output-escaping="yes"/>
- </xsl:if>
- <!-- We don't want to copy the tracking info in this case because we want a separate conversation for the metadata -->
- <xsl:apply-templates select="/root/header/bus:biBusHeader/*[local-name()!='tracking']"/>
- </bus:biBusHeader>
- </SOAP-ENV:Header>
- <SOAP-ENV:Body>
- <xsl:element name="{$request}" namespace="{$providerNamespace}">
- <xsl:choose>
- <xsl:when test="$request = 'runSpecification'">
- <xsl:copy-of select="/root/command/async:asyncRequest/specification/*"/>
- </xsl:when>
- <!-- must be doing a secondary request, use the conversation -->
- <xsl:otherwise>
- <conversation xsi:type="bus:asynchRequest">
- <xts:transform name="XMLDecode">
- <xsl:value-of select="xtsext:web64decode(string(xtsext:cafaction('sign_unwrap', string(/root/command/async:asyncRequest/conversation))), true())"/>
- </xts:transform>
- </conversation>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test="$request != 'release'">
- <xsl:copy-of select="/root/command/async:asyncRequest/parameters/*"/>
- <xsl:copy-of select="/root/command/async:asyncRequest/options/*"/>
- </xsl:if>
- </xsl:element>
- </SOAP-ENV:Body>
- </SOAP-ENV:Envelope>
- </xts:request>
- </response>
- </xts:append>
- <xts:append>
- <xmlEncodedTracking>
- <xts:transform name="XMLEncode">
- <xts:queryNode select="/root/response/*[local-name()='Envelope']/*[local-name()='Header']/*[local-name()='biBusHeader']/*[local-name() = 'tracking']"/>
- </xts:transform>
- </xmlEncodedTracking>
- <xmlEncodedConversation>
- <xts:transform name="XMLEncode">
- <xts:queryNode select="/root/response/*[local-name()='Envelope']/*[local-name()='Body']/*/*[local-name()='result']/*[local-name()='primaryRequest']/*"/>
- </xts:transform>
- </xmlEncodedConversation>
- <!-- get the status of the conversation -->
- <status>
- <xts:queryNode select="/root/response/*[local-name()='Envelope']/*[local-name()='Body']/*[contains(local-name(), 'Response')]/*[local-name()='result']/*[local-name()='status']"/>
- </status>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- <!-- used to copy the bus header stuff - see "apply-templates" above. -->
- <xsl:template match="*">
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- <xsl:apply-templates/>
- </xsl:copy>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
-
- <!--
- getOutput - only done if the status of the request is 'responseReady' (i.e. we've just done a wait)
- -->
- <xts:block id="getOutput" mode="interpret" processor="XSLT" type="exec" dependency="doRequest" condition=".[/root/status='responseReady' and not(/root/command/*[local-name()='asyncRequest']/releaseConversation)]" 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:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:xs="http://www.w3.org/2001/XMLSchema"
- xmlns:async="http://developer.cognos.com/schemas/xts/cogadmin/iAsyncRequest/1/"
- xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
- xmlns:SOAP-ENV="http://www.w3.org/2001/09/soap-envelope"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- exclude-result-prefixes="send xsi xs async SOAP-ENC SOAP-ENV xtsext">
- <xsl:output method="xml" version="1.0" encoding="UTF-8"/>
- <xsl:key name="env-param" match="/root/env/param" use="@name"/>
- <xsl:variable name="provider" select="/root/command/async:asyncRequest/provider"/>
-
- <xsl:variable name="providerNamespace">
- <xsl:choose>
- <xsl:when test="$provider = 'eventManagementService'">http://www.ibm.com/xmlns/prod/cognos/eventManagementService/201101/</xsl:when>
- <xsl:when test="$provider = 'monitorService'">http://www.ibm.com/xmlns/prod/cognos/monitorService/201101/</xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="soapAction">
- <xsl:choose>
- <xsl:when test="$provider = 'eventManagementService'">http://www.ibm.com/xmlns/prod/cognos/eventManagementService/201610/.absolute</xsl:when>
- <xsl:when test="$provider = 'monitorService'">http://www.ibm.com/xmlns/prod/cognos/monitorService/201610/.absolute</xsl:when>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:template match="/">
- <xts:sequence>
- <xts:replace select="/root/response">
- <response>
- <xts:request href="bus://dispatcher" protocol="BUS" soapAction="{$soapAction}" responseEnvelope="true" outputHeader="true">
- <SOAP-ENV:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" 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: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/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <xsl:if test="/root/command/async:asyncRequest/tracking != ''">
- <!-- use the round-tripped tracking information -->
- <bus:tracking>
- <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap', string(/root/command/async:asyncRequest/tracking)), true())" disable-output-escaping="yes"/>
- </bus:tracking>
- </xsl:if>
- <!-- We don't want to copy the tracking info in this case because we want a separate conversation for the metadata -->
- <xsl:apply-templates select="/root/header/bus:biBusHeader/*[local-name()!='tracking']"/>
- </bus:biBusHeader>
- </SOAP-ENV:Header>
- <SOAP-ENV:Body>
- <xsl:element name="getOutput" namespace="{$providerNamespace}">
- <conversation xsi:type="bus:asynchRequest">
- <xts:transform name="XMLDecode">
- <xsl:value-of select="xtsext:web64decode(string(xtsext:cafaction('sign_unwrap', string(/root/command/async:asyncRequest/conversation))), true())"/>
- </xts:transform>
- </conversation>
- <parameterValues xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:parameterValue[]"/>
- <options xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:option[]"/>
- </xsl:element>
- </SOAP-ENV:Body>
- </SOAP-ENV:Envelope>
- </xts:request>
- </response>
- </xts:replace>
-
- <xts:delete select="/root/status | /root/xmlEncodedTracking | /root/xmlEncodedConversation"/>
- <xts:append>
- <xmlEncodedTracking>
- <xts:transform name="XMLEncode">
- <xts:queryNode select="/root/response/*[local-name()='Envelope']/*[local-name()='Header']/*[local-name()='biBusHeader']/*[local-name() = 'tracking']"/>
- </xts:transform>
- </xmlEncodedTracking>
- <xmlEncodedConversation>
- <xts:transform name="XMLEncode">
- <xts:queryNode select="/root/response/*[local-name()='Envelope']/*[local-name()='Body']/*[local-name()='getOutputResponse']/*[local-name()='result']/*[local-name()='primaryRequest']/*"/>
- </xts:transform>
- </xmlEncodedConversation>
- <status>
- <xts:queryNode select="/root/response/*/*/*[local-name()='getOutputResponse']/*[local-name()='result']/*[local-name()='status']"/>
- </status>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- <!-- used to copy the bus header stuff - see "apply-templates" above. -->
- <xsl:template match="*">
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- <xsl:apply-templates/>
- </xsl:copy>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- response block - add the results of the requests into the right place
- -->
- <xts:block id="response" dependency="getOutput doRequest" condition=".[not(/root/command/*[local-name()='asyncRequest']/releaseConversation)]" mode="output" mimeType="text/xml" 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"
- xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
- xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:xos="http://developer.cognos.com/schemas/xts/output/"
- exclude-result-prefixes="xtsext SOAP-ENV bus xsi xos">
-
- <xsl:output method="xml" version="1.0" encoding="UTF-8"/>
- <xsl:template match="/root">
- <!-- get the passport -->
- <xsl:variable name="passport">
- <xsl:choose>
- <!-- pull the passport out of the bus header -->
- <xsl:when test="string(/root/credential/param[@name='CAM']/*[local-name() = 'CAM']/*[local-name() = 'CAMPassport']/*[local-name() = 'id']) != ''">
- <xsl:value-of select="/root/credential/param[@name='CAM']/*[local-name() = 'CAM']/*[local-name() = 'CAMPassport']/*[local-name() = 'id']"/>
- </xsl:when>
- <!-- if it's not there, see if it is still in the cookie -->
- <xsl:otherwise>
- <xsl:value-of select="/root/cookies/cookie[@name='cam_passport']"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:variable name="status" select="/root/status"/>
- <asyncRequestResponse>
- <response>
- <xsl:copy-of select="/root/response/SOAP-ENV:Envelope/SOAP-ENV:Body/*"/>
- </response>
- <status><xsl:value-of select="$status"/></status>
- <tracking>
- <xsl:if test="string(/root/xmlEncodedTracking) != ''">
- <xsl:value-of select="xtsext:cafaction( concat('sign_wrap_setpassportid_', $passport), xtsext:web64encode(string(/root/xmlEncodedTracking), true()))"/>
- </xsl:if>
- </tracking>
- <conversation>
- <xsl:if test="string(/root/xmlEncodedConversation) != ''">
- <xsl:value-of select="xtsext:cafaction( concat('sign_wrap_setpassportid_', $passport), xtsext:web64encode(string(/root/xmlEncodedConversation), true()))"/>
- </xsl:if>
- </conversation>
- <!-- a copy of all the allowed secondary requests if the conversation is complete -->
- <xsl:if test="$status = 'conversationComplete' or $status = 'complete'">
- <secondaryRequests>
- <xsl:for-each select="/root/response/SOAP-ENV:Envelope/SOAP-ENV:Body/*/*[local-name()='result']/*[local-name()='secondaryRequests']/*[local-name()='item']">
- <secondaryRequest>
- <xsl:value-of select="./*[local-name()='name']"/>
- </secondaryRequest>
- </xsl:for-each>
- </secondaryRequests>
- </xsl:if>
- </asyncRequestResponse>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- </xts:morphlet>
|