123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- <?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.
- -->
- <!--
- 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:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:xts="http://developer.cognos.com/schemas/xts/"
- xmlns:nox="http://developer.cognos.com/schemas/navomx/1/"
- exclude-result-prefixes="xtsext xts xsl">
-
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:key name="uiExtensions-class" match="/xts:block/nox:uiMetadata/nox:classes/nox:class" use="nox:name"/>
- <!--
- TODO: In order to remove all this special case logic we need to move icon generation to runtime.
- -->
- <xsl:variable name="viewMap">
- <map>
- <mapEntry>
- <key>reportView</key>
- <value>report</value>
- </mapEntry>
- <mapEntry>
- <key>dataMovementTaskAlias</key>
- <value>dataMovementTask</value>
- </mapEntry>
- <mapEntry>
- <key>powerPlay8ReportView</key>
- <value>powerPlay8Report</value>
- </mapEntry>
- <mapEntry>
- <key>agentDefinitionView</key>
- <value>agentDefinition</value>
- </mapEntry>
- </map>
- </xsl:variable>
- <xsl:template match="/">
- <xsl:element name="xts:block">
- <xsl:copy-of select="xts:block/@*"/>
- <xsl:element name="runnables">
- <xsl:for-each select="xts:block/nox:uiMetadata/nox:classes/nox:class[nox:runnable = 'true']">
- <xsl:sort select="nox:name" order="ascending"/>
- <xsl:variable name="className"><xsl:value-of select="nox:name"/></xsl:variable>
- <xsl:element name="class">
- <xsl:attribute name="name"><xsl:value-of select="$className"/></xsl:attribute>
- <xsl:if test="nox:canRunInteractive != ''">
- <xsl:attribute name="isInteractive"><xsl:value-of select="nox:canRunInteractive"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="nox:canRunBatch != ''">
- <xsl:attribute name="isBackground"><xsl:value-of select="nox:canRunBatch"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="nox:idsString and nox:idsString!=''">
- <xsl:element name="displayName">
- <xsl:element name="xts:string">
- <xsl:attribute name="id"><xsl:value-of select="nox:idsString"/></xsl:attribute>
- </xsl:element>
- </xsl:element>
- </xsl:if>
- <xsl:variable name="mapEntry" select="$viewMap/map/mapEntry[key=$className]"/>
- <xsl:variable name="resolvedClass">
- <xsl:choose>
- <xsl:when test="$mapEntry != ''">
- <xsl:value-of select="$mapEntry/value"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$className"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="baseIcon">
- <xsl:choose>
- <xsl:when test="key('uiExtensions-class', string($resolvedClass))/nox:icon != ''"><xsl:value-of select="key('uiExtensions-class', string($resolvedClass))/nox:icon"/></xsl:when>
- <xsl:otherwise><xsl:value-of select="key('uiExtensions-class', string($resolvedClass))/nox:imgTool/nox:param[nox:name='icon']/nox:value"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="suffix">
- <xsl:value-of select="nox:imgTool/nox:param[nox:name='suffix']/nox:value"/>
- </xsl:variable>
- <xsl:element name="icon">
- <xsl:value-of select="concat('icon_',$baseIcon, $suffix,'.gif')"/>
- </xsl:element>
- <xsl:element name="root">
- <xsl:value-of select="nox:root/nox:path"/>
- </xsl:element>
- </xsl:element>
- </xsl:for-each>
- </xsl:element>
- </xsl:element>
- </xsl:template>
- </xsl:stylesheet>
|