123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: ps
- (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).
- -->
- <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:cm="http://developer.cognos.com/schemas/xts-cm/1/"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- 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:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
- xmlns:xts="http://developer.cognos.com/schemas/xts/"
- xmlns:ms="http://developer.cognos.com/schemas/monitorService/1"
- exclude-result-prefixes="xsl xts send cm xtsext SOAP-ENV SOAP-ENC ms bus xsi">
-
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="/">
- <xts:sequence>
- <xts:append>
- <xsl:variable name="eventID">
- <xsl:choose>
- <xsl:when test="string(/root/env/param[@name='restartEventID']) != ''">
- <xsl:value-of select="/root/env/param[@name='restartEventID']"/>
- </xsl:when>
- <xsl:when test="string(/root/env/param[@name='eventID']) != ''">
- <xsl:value-of select="/root/env/param[@name='eventID']"/>
- </xsl:when>
- <xsl:when test="string(/root/cm:queryResponse/cm:queryReply[1]/cm:history/cm:restartEventID) != ''">
- <xsl:value-of select="/root/cm:queryResponse/cm:queryReply[1]/cm:history/cm:restartEventID"/>
- </xsl:when>
- <xsl:when test="string(/root/cm:queryResponse/cm:queryReply[1]/cm:history/cm:ownerEventID) != ''">
- <xsl:value-of select="/root/cm:queryResponse/cm:queryReply[1]/cm:history/cm:ownerEventID"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="/root/cm:queryResponse/cm:queryReply[1]/cm:history/cm:eventID"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <rerunList>
- <xsl:if test="$eventID!=''">
- <send:request provider="monitorService" responseEnvelope="true">
- <ms:runSpecification>
- <bus:specification xsi:type="bus:monitorServiceSpecification">
- <bus:value xsi:type="bus:specification">
- <xts:transform name="XMLEncode">
- <queryEventSpecification>
- <scope>
- <xsl:choose>
- <!-- for agents and jobs we need to the information about the steps -->
- <xsl:when test="contains(' jobDefinition agentDefinition agentDefinitionView ',concat(' ',/root/env/param[@name='m_class'],' '))">
- <restartParentEventID>
- <xsl:value-of select="$eventID"/>
- </restartParentEventID>
- </xsl:when>
- <xsl:otherwise>
- <restartEventID>
- <xsl:value-of select="$eventID"/>
- </restartEventID>
- </xsl:otherwise>
- </xsl:choose>
- </scope>
- <filters/>
- </queryEventSpecification>
- </xts:transform>
- </bus:value>
- </bus:specification>
- <bus:parameterValues xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:parameterValue[]"/>
- <bus:options SOAP-ENC:arrayType="bus:option[]" xsi:type="SOAP-ENC:Array">
- <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:pagingOptionInt">
- <bus:name xsi:type="bus:pagingOptionEnum">maximumObjects</bus:name>
- <bus:value xsi:type="xsd:int">0</bus:value>
- </item>
- </bus:options>
- </ms:runSpecification>
- </send:request>
- </xsl:if>
- </rerunList>
- </xts:append>
-
- <!--
- release the conversation we just started since the UI doesn't support paging so
- there's no need to keep the conversation alive.
- -->
- <xts:append>
- <releasedConversation>
- <xts:request href="bus://dispatcher" faultBlock="eatFault" protocol="BUS" soapAction="http://www.ibm.com/xmlns/prod/cognos/monitorService/201610/.absolute" 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">
- <!-- copy in the tracking info from the runSpecification response -->
- <xts:queryNode select="/root/rerunList/*[local-name()='Envelope']/*[local-name()='Header']/*[local-name()='biBusHeader']/*[local-name() = 'tracking']"/>
- <xsl:apply-templates select="/root/header/bus:biBusHeader/*[local-name()!='tracking']"/>
- </bus:biBusHeader>
- </SOAP-ENV:Header>
- <SOAP-ENV:Body>
- <xsl:element name="release" namespace="http://developer.cognos.com/schemas/monitorService/1">
- <conversation xsi:type="bus:asynchRequest">
- <!-- copy the primaryRequest returned in the runSpecification response -->
- <xts:queryNode select="/root/rerunList/*[local-name()='Envelope']/*[local-name()='Body']/*/*[local-name()='result']/*[local-name()='primaryRequest']/*"/>
- </conversation>
- </xsl:element>
- </SOAP-ENV:Body>
- </SOAP-ENV:Envelope>
- </xts:request>
- </releasedConversation>
- </xts:append>
-
- <xts:delete select="/root/rerunList/*[local-name()='Envelope']/*[local-name()='Header']"/>
- </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>
|