123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: AGS
- (C) Copyright IBM Corp. 2005, 2008
- 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:agsh="http://developer.cognos.com/schemas/xts/logicsheets/xslt/ags/agsCmHelper/" xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:doc="http://developer.cognos.com/schemas/xts/logicsheets/xslt/ags/doc/" xmlns:out="dummy-uri" xmlns:xtscm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="doc">
- <xsl:output method="html" encoding="UTF-8" indent="no"/>
- <xsl:namespace-alias stylesheet-prefix="out" result-prefix="xsl"/>
- <doc:group prefix="agsad">
- <doc:location>
- <doc:namespace>http://developer.cognos.com/schemas/xts/logicsheets/xslt/ags/agsCmHelper/</doc:namespace>
- <doc:ref>ps/ags/logicsheets/agsCmHelper.xsl</doc:ref>
- </doc:location>
- </doc:group>
- <!-- +++++++++++++++++++++++
- creates the relevent cmPreProcess tags for a url
- +++++++++++++++++++++++++++++-->
- <doc:template type="interpret">
- <doc:name>rssTaskObject</doc:name>
- <doc:desc>This tag creates outputs tags to pass to cmpreprocess that will create the xml to create an rssTask in cm from the env params passed in with the agent task</doc:desc>
- <doc:notes/>
- </doc:template>
- <xsl:template match="agsh:storeIDConverter">
- <out:template name="storeIDConverter">
- <out:param name="storeID"/>
- <out:choose>
- <out:when test="contains($storeID, 'storeID(') or $storeID=''">
- <out:value-of select="$storeID"/>
- </out:when>
- <out:otherwise>
- <out:text>storeID("</out:text>
- <out:value-of select="$storeID"/>
- <out:text>")</out:text>
- </out:otherwise>
- </out:choose>
- </out:template>
- </xsl:template>
- <!-- +++++++++++++++++++++++
- creates the relevent cmPreProcess tags for a url
- +++++++++++++++++++++++++++++-->
- <doc:template type="interpret">
- <doc:name>rssTaskObject</doc:name>
- <doc:desc>This tag creates outputs tags to pass to cmpreprocess that will create the xml to create an rssTask in cm from the env params passed in with the agent task</doc:desc>
- <doc:notes/>
- </doc:template>
- <xsl:template match="agsh:rssTaskObject">
- <out:template name="rssTaskObject">
- <out:param name="task"/>
- <out:param name="path"/>
- <out:param name="name"/>
- <out:choose>
- <!--making a shortcut -->
- <out:when test="$task/param[@name='url_uri'] = 'url_entry'">
- <xtscm:shortcutRSSTask>
- <xtscm:searchPath>
- <out:value-of select="$path"/>
- </xtscm:searchPath>
- <out:call-template name="rssTaskObjectCommon">
- <out:with-param name="name" select="$name"/>
- <out:with-param name="task" select="$task"/>
- </out:call-template>
- <xtscm:link>
- <xtscm:baseClass>
- <xtscm:searchPath>
- <out:value-of select="$task/param[@name='url_entry']"/>
- </xtscm:searchPath>
- </xtscm:baseClass>
- </xtscm:link>
- </xtscm:shortcutRSSTask>
- </out:when>
- <!--making a url -->
- <out:when test="$task/param[@name='url_uri'] = 'url_url'">
- <xtscm:urlRSSTask>
- <xtscm:searchPath>
- <out:value-of select="$path"/>
- </xtscm:searchPath>
- <out:call-template name="rssTaskObjectCommon">
- <out:with-param name="name" select="$name"/>
- <out:with-param name="task" select="$task"/>
- </out:call-template>
- <xtscm:link>
- <out:value-of select="$task/param[@name='url_url']"/>
- </xtscm:link>
- </xtscm:urlRSSTask>
- </out:when>
- <!--making a shortcut to this agents event list only support hotlist-->
- <out:when test="$task/param[@name='url_uri'] = 'url_eventList'">
- <xtscm:shortcutAgentRSSTask>
- <xtscm:searchPath>
- <out:value-of select="$path"/>
- </xtscm:searchPath>
- <out:call-template name="rssTaskObjectCommon">
- <out:with-param name="name" select="$name"/>
- <out:with-param name="task" select="$task"/>
- </out:call-template>
- <xtscm:link>
- <xsl:text>hotList</xsl:text>
- </xtscm:link>
- </xtscm:shortcutAgentRSSTask>
- </out:when>
- <out:otherwise>
- <!--we dont have enough to go on... try and make a url -->
- <xtscm:urlRSSTask>
- <xtscm:searchPath>
- <out:value-of select="$path"/>
- </xtscm:searchPath>
- <out:call-template name="rssTaskObjectCommon">
- <out:with-param name="name" select="$name"/>
- <out:with-param name="task" select="$task"/>
- </out:call-template>
- <xtscm:link>
- <out:value-of select="$task/param[@name='url_url']"/>
- </xtscm:link>
- </xtscm:urlRSSTask>
- </out:otherwise>
- </out:choose>
- </out:template>
- <!-- write out the common properties of the rss object in pre-process format-->
- <out:template name="rssTaskObjectCommon">
- <out:param name="name"/>
- <out:param name="task"/>
- <out:variable name="user_locale">
- <out:choose>
- <out:when test="/root/session/param[@name='contentLocale']">
- <out:value-of select="/root/session/param[@name='contentLocale']"/>
- </out:when>
- <out:otherwise>
- <out:value-of select="/root/system/param[@name='contentLocale']"/>
- </out:otherwise>
- </out:choose>
- </out:variable>
- <!-- here are some properly localised items to introduce when necessary-->
- <!--xtscm:name>
- <xtscm:tokenvalue>
- <out:attribute name="locale">
- <out:value-of select="$user_locale"/>
- </out:attribute>
- <out:value-of select="$task/item/name"/>
- </xtscm:tokenvalue>
- </xtscm:name-->
- <!--xtscm:description>
- <xtscm:value>
- <out:attribute name="locale">
- <out:value-of select="$user_locale"/>
- </out:attribute>
- <out:value-of select="$task/url_name"/>
- </xtscm:value>
- </xtscm:description>
- <xtscm:description>
- <xtscm:value>
- <out:attribute name="locale">
- <out:value-of select="$user_locale"/>
- </out:attribute>
- <out:value-of select="$task/url_screentip"/>
- </xtscm:value>
- </xtscm:description-->
- <xtscm:defaultScreenTip>
- <out:value-of select="$task/param[@name='url_screentip']"/>
- </xtscm:defaultScreenTip>
- <xtscm:defaultName>
- <out:value-of select="$name"/>
- </xtscm:defaultName>
- <xtscm:defaultDescription>
- <out:value-of select="$task/param[@name='url_description']"/>
- </xtscm:defaultDescription>
- <!--the title is destined for the name of the url -->
- <xtscm:title>
- <xtscm:value>
- <out:attribute name="locale">
- <out:value-of select="$user_locale"/>
- </out:attribute>
- <out:value-of select="$task/param[@name='url_name']"/>
- </xtscm:value>
- </xtscm:title>
- <xtscm:channel>
- <xtscm:baseClass>
- <xtscm:searchPath>
- <out:value-of select="$task/param[@name='url_location']"/>
- </xtscm:searchPath>
- </xtscm:baseClass>
- </xtscm:channel>
- </out:template>
- </xsl:template>
- <!--
- * - This next template is required to copy all other elements into the result.
- -->
- <xsl:template match="*">
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- <xsl:apply-templates/>
- </xsl:copy>
- </xsl:template>
- </xsl:stylesheet>
|