12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: cogadmin
- (C) Copyright IBM Corp. 2012, 2014
- 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:uic="http://developer.cognos.com/schemas/uic/presentation/markup/"
- xmlns:xts="http://developer.cognos.com/schemas/xts/"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- exclude-result-prefixes="xsl uic xts">
-
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
- <!--
- contextMenu
- -->
- <xsl:template match="uic:contextMenu">
- <script type="text/javascript">
- <xsl:variable name="menu_items">
- <xsl:apply-templates/>
- </xsl:variable>
- <xsl:variable name="normalized" select="normalize-space($menu_items)"/>
- var <xsl:value-of select="@menuName"/>=new ui_menu ({id: "actions_<xsl:value-of select="@menuName"/>", title: "<xsl:value-of select="xtsext:javascriptencode(@menuTitle)"/>", items:[
- <xsl:choose>
- <xsl:when test="$normalized = ''">
- {
- title: "<xsl:value-of select="$menuNoActions"/>"
- }
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="substring($normalized,1,string-length($normalized)-1)"/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text>]});</xsl:text>
- </script>
- </xsl:template>
- <xsl:template match="uic:menuItem">
- <xsl:text>{</xsl:text>
- <xsl:apply-templates/>
- <xsl:text>}</xsl:text>
- <xsl:text>,</xsl:text>
- </xsl:template>
- <xsl:template match="uic:menuItemTitle">
- <xsl:text>title:"</xsl:text>
- <xsl:value-of select="."/>
- <xsl:text>",</xsl:text>
- </xsl:template>
- <xsl:template match="uic:menuItemImage">
- <xsl:text>image:"</xsl:text>
- <xsl:value-of select="."/>
- <xsl:text>",</xsl:text>
- </xsl:template>
- <xsl:template match="uic:menuItemGroup">
- <xsl:variable name="prevGroup" select="ancestor::uic:menuItem/preceding-sibling::uic:menuItem[1]//uic:menuItemGroup"/>
- <xsl:text>separatorBefore:</xsl:text>
- <xsl:value-of select="$prevGroup != ."/>
- <xsl:text>,</xsl:text>
- </xsl:template>
- <xsl:template match="uic:haspopup">
- <xsl:text>haspopup:</xsl:text>
- <xsl:value-of select="."/>
- <xsl:text>,</xsl:text>
- </xsl:template>
- <xsl:template match="uic:menuItemAction">
- <xsl:text>action:</xsl:text>
- <xsl:copy-of select="./node()"/>
- </xsl:template>
- </xsl:stylesheet>
|