123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: cogadmin
- (C) Copyright IBM Corp. 2005, 2010
- US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- -->
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:cogadminext="xalan://com.cognos.admin.xts.ext.XTSExt"
- xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
- <xsl:template match="*">
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- <xsl:apply-templates/>
- </xsl:copy>
- </xsl:template>
-
- <xsl:template match="/activityHistory/schedule">
- <xsl:for-each select="./path">
- <xsl:variable name="currentPath" select="."/>
- <xsl:variable name="contentLocale" select="/activityHistory/contentLocale"/>
- <xsl:variable name="histories" select="/activityHistory/cm:queryResponse/cm:queryReply/cm:history[cm:parent/*/cm:searchPath = $currentPath]"/>
- <xsl:variable name="calculatedDuration" >
- <xsl:if test="count($histories) > 0">
- <xsl:variable name="startDate" select="$histories[1]/cm:actualExecutionTime"/>
- <xsl:variable name="endDate" select="$histories[1]/cm:actualCompletionTime"/>
- <!--
- Format the date difference;
- The number 2 represents the style and corresponds to a long format (see the XTSExt.java class for more details)
- -->
- <xsl:value-of select="cogadminext:formatDateDifference($startDate,$endDate,$contentLocale,number('2'))"/>
- </xsl:if>
- </xsl:variable>
- <schedule>
- <path><xsl:value-of select="$currentPath"/></path>
- <xsl:choose>
- <xsl:when test="$calculatedDuration != ''">
- <lastExecutionTime><xsl:value-of select="$calculatedDuration"/></lastExecutionTime>
- </xsl:when>
- <xsl:otherwise>
- <lastExecutionTime><xsl:value-of select="/activityHistory/noHistoryForLastExcutionTime"/></lastExecutionTime>
- </xsl:otherwise>
- </xsl:choose>
- </schedule>
- </xsl:for-each>
- </xsl:template>
-
- </xsl:stylesheet>
|