123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- <?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).
- -->
- <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:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:xts="http://developer.cognos.com/schemas/xts/"
- exclude-result-prefixes="xsl send cm xtsext xts">
-
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:variable name="query-values" select="/root/env/param"/>
- <xsl:template match="/">
- <xts:sequence>
- <!-- if we have a restartEventID then we need to use it instead of the eventID -->
- <xsl:variable name="eventIDToUse">
- <xsl:choose>
- <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:otherwise>
- <xsl:value-of select="/root/cm:queryResponse/cm:queryReply[1]/cm:history/cm:eventID"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xts:append>
- <relatedHistories>
- <!-- make sure we will run at least one of the following 2 queries -->
- <xsl:if test="$eventIDToUse != '' or string(/root/cm:queryResponse/cm:queryReply[1]/cm:history/cm:ownerEventID) != ''">
- <!-- get the owner information -->
- <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>
- <!-- get the owner information -->
- <xsl:if test="string(/root/cm:queryResponse/cm:queryReply[1]/cm:history/cm:ownerEventID) != ''">
- <cm:query>
- <cm:search>//history[@eventID='<xsl:value-of select="/root/cm:queryResponse/cm:queryReply[1]/cm:history/cm:ownerEventID"/>']</cm:search>
- <cm:properties>
- <cm:property name="eventID"/>
- <cm:property name="parent"/>
- </cm:properties>
- <cm:options>
- <cm:refProps>
- <cm:refProp refPropName="parent">
- <cm:properties>
- <cm:property name="objectClass"/>
- <cm:property name="defaultName"/>
- </cm:properties>
- </cm:refProp>
- </cm:refProps>
- </cm:options>
- </cm:query>
- </xsl:if>
-
- <!-- get the related histories -->
- <xsl:if test="$eventIDToUse != ''">
- <cm:query>
- <cm:search>//history[@restartEventID='<xsl:value-of select="$eventIDToUse"/>' or @eventID='<xsl:value-of select="$eventIDToUse"/>']</cm:search>
- <cm:properties>
- <cm:property name="eventID"/>
- <cm:property name="status"/>
- <cm:property name="status"/>
- <cm:property name="actualExecutionTime"/>
- <cm:property name="actualCompletionTime"/>
- <cm:property name="requestedExecutionTime"/>
- <cm:property name="parent"/>
- </cm:properties>
- <cm:options>
- <cm:refProps>
- <cm:refProp refPropName="parent">
- <cm:properties>
- <cm:property name="defaultName"/>
- </cm:properties>
- </cm:refProp>
- </cm:refProps>
- </cm:options>
- <cm:sortBy>
- <cm:sort name="requestedExecutionTime" order="descending"/>
- </cm:sortBy>
- </cm:query>
- </xsl:if>
- </cm:requests>
- </cm:query>
- </xts:transform>
- </send:request>
- </xts:transform>
- </xsl:if>
- </relatedHistories>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
|