123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302 |
- <?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:cm="http://developer.cognos.com/schemas/xts-cm/1/"
- xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
- xmlns:pm="http://developer.cognos.com/schemas/xts/pm"
- xmlns:mt="http://developer.cognos.com/schemas/xts/logicsheets/presentation/main/mt"
- xmlns:mf="http://developer.cognos.com/schemas/xts/logicsheets/presentation/main/mf"
- xmlns:xts="http://developer.cognos.com/schemas/xts/"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
- xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
- xmlns:nav="http://developer.cognos.com/schemas/cps/navigation/1/"
- xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
- xmlns:rss="http://developer.cognos.com/schemas/xts/rss/"
- xmlns:out="dummy-uri"
- xmlns:cps="http://developer.cognos.com/schemas/cps/asm/objects/1/"
- xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
- exclude-result-prefixes="xsl cps cm pf pm mt mf xts xtsext cf cp rss out bus xts SOAP-ENV">
-
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <pf:variables/>
- <mf:variables mode="main"/>
- <mf:main-variables/>
- <rss:variables/>
- <xsl:variable name="source-url">
- <!-- link back to the actual CC page -->
- <xsl:value-of select="$abs-gateway"/>
- <xsl:for-each select="/root/env/param[@name != 'feed']">
- <xsl:choose>
- <xsl:when test="position() = 1">?</xsl:when>
- <xsl:otherwise>&</xsl:otherwise>
- </xsl:choose>
- <xsl:value-of select="@name"/>=<xsl:value-of select="xtsext:protect(xtsext:urlencode(string(.)),'url', concat('NAME',@name),'getdata')"/>
- </xsl:for-each>
- </xsl:variable>
- <!-- start the output -->
- <xsl:template match="/root">
- <xsl:processing-instruction name="xml-stylesheet">
- <xsl:text/>type="text/xsl" href="<xsl:value-of select="$gateway"/>?b_action=xts.run<xsl:text/>
- <xsl:choose>
- <xsl:when test="$browser = 'ie'">&amp;</xsl:when> <!-- ie seems to need this double encoded -->
- <xsl:otherwise>&</xsl:otherwise>
- </xsl:choose>
- <xsl:text/>m=portal/rssxsl.xts"<xsl:text/>
- </xsl:processing-instruction>
- <xsl:variable name="linesPerPage">
- <xsl:value-of select="/root/session/param[@name='linesPerPage']"/>
- </xsl:variable>
- <rss version="2.0">
- <channel>
- <title><xsl:value-of select="title"/></title>
- <link><xsl:value-of select="$source-url"/></link>
- <description><xsl:value-of select="description"/></description>
- <language><xsl:value-of select="$contentLocale"/></language>
- <xsl:for-each select="objs/*">
- <xsl:if test="position() <= $linesPerPage">
- <xsl:apply-templates select="."/>
- </xsl:if>
- </xsl:for-each>
- </channel>
- </rss>
- </xsl:template>
- <xsl:template match="nav:item">
- <xsl:if test="nav:defaultAction">
- <item>
- <xsl:call-template name="common-stuff">
- <xsl:with-param name="isNavContent" select="true()"/>
- </xsl:call-template>
- <link>
- <xsl:value-of select="$abs-gateway"/>?<xsl:text/>
- <xsl:for-each select="nav:defaultAction/nav:urlParts/nav:param">
- <xsl:text/>&<xsl:value-of select="@name"/>=<xsl:text/>
- <xsl:choose>
- <xsl:when test="@name='m_path' or @name='m_obj'">
- <xsl:value-of select="xtsext:protect(xtsext:urlencode(string(.)),'url','searchPath','getdata')"/>
- </xsl:when>
- <xsl:when test="@name='@m_name'">
- <xsl:value-of select="xtsext:protect(xtsext:urlencode(string(.)),'url','userData','getdata')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="xtsext:urlencode(string(.))"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </link>
- </item>
- </xsl:if>
- </xsl:template>
- <xsl:template match="cm:query | cm:report | cm:analysis | cm:reportView">
- <xsl:if test="cm:defaultOutputFormat/* or contains(cm:permissions, 'execute')">
- <item>
- <xsl:call-template name="common-stuff"/>
- <link>
- <xsl:value-of select="$abs-gateway"/>?<xsl:text/>
- <xsl:text/>b_action=xts.run&m=portal/launch.xts<xsl:text/>
- <xsl:text/>&ui.tool=CognosViewer<xsl:text/>
- <xsl:choose>
- <xsl:when test="cm:defaultOutputFormat/*">
- <xsl:text/>&ui.action=view<xsl:text/>
- <xsl:text/>&ui.object=<xsl:value-of select="xtsext:protect(xtsext:urlencode( concat('defaultOutput(', cm:searchPath, ')' ) ),'url','searchPath','getdata')"/><xsl:text/>
- </xsl:when>
- <xsl:when test="contains(cm:permissions, 'execute')">
- <xsl:text/>&ui.action=run<xsl:text/>
- <xsl:text/>&ui.object=<xsl:value-of select="xtsext:protect(xtsext:urlencode( string( cm:searchPath ) ),'url','searchPath','getdata')"/>
- </xsl:when>
- </xsl:choose>
- </link>
- </item>
- </xsl:if>
- </xsl:template>
- <xsl:template match="cm:output">
- <item>
- <xsl:call-template name="common-stuff"/>
- <link>
- <xsl:value-of select="$abs-gateway"/>?<xsl:text/>
- <xsl:text/>b_action=xts.run&m=portal/launch.xts<xsl:text/>
- <xsl:text/>&ui.tool=CognosViewer<xsl:text/>
- <xsl:text/>&ui.action=view<xsl:text/>
- <xsl:text/>&ui.object=<xsl:value-of select="xtsext:protect(xtsext:urlencode( string( cm:searchPath ) ),'url','searchPath','getdata')"/>
- <xsl:if test="contains(string(../../cm:target/*/*[local-name()='searchPath']),'agentOutputHotList')">
- <xsl:text/>&cv.toolbar=false<xsl:text/>
- </xsl:if>
- </link>
- </item>
- </xsl:template>
- <xsl:template match="cm:folder | cm:package">
- <xsl:choose>
- <xsl:when test="cm:userInterfaces[cm:uiComponentEnum = 'metricStudio'] and cm:defaultPortalAction = 'run'">
- <item>
- <xsl:call-template name="common-stuff"/>
- <link>
- <xsl:value-of select="$abs-gateway"/>?<xsl:text/>
- <xsl:text/>b_action=xts.run&m=portal/launch.xts<xsl:text/>
- <xsl:text/>&ui.tool=MetricStudio<xsl:text/>
- <xsl:text/>&ui.object=<xsl:value-of select="xtsext:protect(xtsext:urlencode( string( cm:searchPath ) ),'url','searchPath','getdata')"/>
- <xsl:text/>&ui.action=run<xsl:text/>
- </link>
- </item>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="contains(cm:permissions, 'traverse')">
- <item>
- <xsl:call-template name="common-stuff"/>
- <link>
- <xsl:value-of select="$abs-gateway"/>?<xsl:text/>
- <xsl:text/>b_action=xts.run&m=portal/cc.xts<xsl:text/>
- <xsl:text/>&m_path=<xsl:value-of select="xtsext:protect(xtsext:urlencode( string( cm:searchPath ) ),'url','searchPath','getdata')"/>
- </link>
- </item>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="*[cm:uri]">
- <item>
- <xsl:call-template name="common-stuff"/>
- <link><xsl:value-of select="cm:uri"/></link>
- </item>
- </xsl:template>
-
- <xsl:template match="cm:powerPlayCube | cm:powerPlayReport | cm:powerPlay8Report">
- <xsl:if test="contains(cm:permissions, 'read') or contains(cm:permissions, 'execute')">
- <item>
- <xsl:call-template name="common-stuff"/>
- <link>
- <xsl:choose>
- <xsl:when test="cm:objectClass = 'powerPlay8Report'">
- <xsl:call-template name="buildpp8">
- <xsl:with-param name="thisnode" select="."/>
- <xsl:with-param name="target-path" select="cm:searchPath"/>
- <xsl:with-param name="action" select="'run'"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="buildpp">
- <xsl:with-param name="thisnode" select="."/>
- <xsl:with-param name="target-path" select="cm:searchPath"/>
- <xsl:with-param name="action" select="'run'"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </link>
- </item>
- </xsl:if>
- </xsl:template>
- <xsl:template match="cm:shortcut">
- <xsl:apply-templates select="cm:target/*"/>
- </xsl:template>
-
- <xsl:template match="cm:history">
- <item>
- <title><xsl:value-of select="cm:parent/*/cm:defaultName"/></title>
- <description>
- <xsl:choose>
- <xsl:when test="cm:parent/*/cm:defaultDescription != ''"><xsl:value-of select="cm:parent/*/cm:defaultDescription"/></xsl:when>
- <xsl:when test="cm:parent/*/cm:defaultScreenTip != ''"><xsl:value-of select="cm:parent/*/cm:defaultScreenTip"/></xsl:when>
- <xsl:otherwise><xsl:value-of select="cm:parent/*/cm:defaultName"/></xsl:otherwise>
- </xsl:choose>
- </description>
- <pubDate>
- <xsl:value-of select="xtsext:formatDateFromUTC( string( cm:actualCompletionTime ), 'E, d MMM yyyy HH:mm:ss zz', string( $timeZone ), string( $contentLocale ) )"/>
- </pubDate>
- <link>
- <xsl:value-of select="$abs-gateway"/>?<xsl:text/>
- <xsl:text/>b_action=xts.run&m=portal/history/view_details.xts<xsl:text/>
- <xsl:text/>&m_class=<xsl:value-of select="cm:parent/*/cm:objectClass"/>
- <xsl:text/>&m_obj=<xsl:value-of select="xtsext:protect(xtsext:urlencode( string( cm:searchPath ) ),'url','searchPath','getdata')"/>
- </link>
- </item>
- </xsl:template>
-
- <xsl:template match="cm:pagelet">
- <item>
- <xsl:call-template name="common-stuff"/>
- <link>
- <xsl:value-of select="$abs-gateway"/>?<xsl:text/>
- <xsl:text/>b_action=dashboard&pathinfo=/cm<xsl:text/>
- <xsl:text/>&path=storeID("<xsl:value-of select="cm:storeID"/>")<xsl:text/>
- </link>
- </item>
- </xsl:template>
-
- <xsl:template match="*"/>
-
- <xsl:template name="common-stuff">
- <xsl:param name="isNavContent" select="false()"/>
- <xsl:variable name="is-shortcut-tgt" select="ancestor::*[1][name() = 'cm:target']"/>
- <xsl:choose>
- <xsl:when test="$is-shortcut-tgt">
- <xsl:for-each select="ancestor::*[2]">
- <xsl:call-template name="common-stuff">
- <xsl:with-param name="isNavContent" select="$isNavContent"/>
- </xsl:call-template>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <title>
- <xsl:choose>
- <xsl:when test="$isNavContent"><xsl:value-of select="nav:name"/></xsl:when>
- <xsl:otherwise><xsl:value-of select="cm:defaultName"/></xsl:otherwise>
- </xsl:choose>
- </title>
- <description>
- <xsl:choose>
- <xsl:when test="$isNavContent">
- <xsl:choose>
- <xsl:when test="nav:description != ''"><xsl:value-of select="nav:description"/></xsl:when>
- <xsl:when test="nav:screenTip != ''"><xsl:value-of select="nav:screenTip"/></xsl:when>
- <xsl:otherwise><xsl:value-of select="nav:name"/></xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="cm:defaultDescription != ''"><xsl:value-of select="cm:defaultDescription"/></xsl:when>
- <xsl:when test="cm:defaultScreenTip != ''"><xsl:value-of select="cm:defaultScreenTip"/></xsl:when>
- <xsl:otherwise><xsl:value-of select="cm:defaultName"/></xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </description>
- <pubDate>
- <xsl:choose>
- <xsl:when test="$isNavContent"><xsl:value-of select="nav:lastModifiedDate"/></xsl:when>
- <xsl:otherwise><xsl:value-of select="xtsext:formatDateFromUTC( string( cm:modificationTime ), 'E, d MMM yyyy HH:mm:ss zz', string( $timeZone ), string( $contentLocale ) )"/></xsl:otherwise>
- </xsl:choose>
- </pubDate>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <pf:gen-action/>
- <pf:gen-url/>
-
- </xsl:stylesheet>
|