123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- <?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.
- -->
- <!--
- ================================================================================
- decodeReportOptions
- A helper block to expand the content or report options and place them under /root/agent_item
- The node is stripped out to make '/root/agent_item/options' which can then be saved to CM
- ================================================================================
- -->
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="xsl xtsext">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="/">
- <xts:sequence>
- <!-- expand each of the report options and add to its agent item -->
- <xsl:for-each select="/root/agent_item[@type='report' or @type='content' or @type='index']">
- <xsl:variable name="taskType" select="@type"/>
- <xsl:variable name="pos" select="position()"/>
- <xsl:variable name="id" select="./@id"/>
- <xsl:variable name="inputBlob">
- <xsl:choose>
- <xsl:when test="@type='report'">reportOptions</xsl:when>
- <xsl:when test="@type='content'">cmOptions</xsl:when>
- <xsl:when test="@type='index'">cmOptions</xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="options" select="/root/agent_item[@id=$id]/param[@name=$inputBlob]"/>
- <!--xsl:message>options:<xsl:value-of select="$options"/></xsl:message>
- <xsl:message>inputBlob:<xsl:value-of select="$inputBlob"/></xsl:message>
- <xsl:message>taskType:<xsl:value-of select="$taskType"/></xsl:message-->
- /root/agent_item/options
- <xsl:if test="$options!=''">
- <!-- decode the report options and append to the DOM -->
- <xts:append select="/root/agent_item[@id='{$id}'][@type='{$taskType}']">
- <xts:transform name="XMLDecode">
- <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap_settemplatename_decodereportoptions_settemplateid_decodereportoptions001',string($options)), true() )"/>
- </xts:transform>
- </xts:append>
- <!-- replace /root/agent_item/<inputBlob>/options with /root/agent_item/options-->
- <xts:replace select="/root/agent_item[@id='{$id}'][@type='{$taskType}']/{$inputBlob}">
- <xts:queryNode select="/root/agent_item[@id='{$id}'][@type='{$taskType}']/{$inputBlob}/*[local-name()='options']"/>
- </xts:replace>
- </xsl:if>
- </xsl:for-each>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
|