123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152 |
- <?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.
- -->
- <!-- written 14-07-2004 -->
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:xtscm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/" exclude-result-prefixes="xsl xts utml">
- <xsl:output method="xml" indent="no" encoding="UTF-8"/>
- <xsl:template match="/">
- <xts:sequence>
- <xts:append>
- <modelItemFields>
- <modelItemField id="AgentTask-condition">
- <name>detailExpression</name>
- <value>
- <xsl:value-of select="/root/agentDefinitionCondition/detailExpression"/>
- </value>
- </modelItemField>
- <modelItemField id="AgentTask-condition">
- <name>summaryExpression</name>
- <value>
- <xsl:value-of select="/root/agentDefinitionCondition/summaryExpression"/>
- </value>
- </modelItemField>
- <modelItemField id="SummaryEventKey">
- <name>Summary_event_key</name>
- <value>
- <xsl:value-of select="/root/agent_definition/summaryEventKey"/>
- </value>
- </modelItemField>
- <xsl:for-each select="/root/agentTasks/item">
- <xsl:variable name="pos" select="position()"/>
- <xsl:variable name="id" select="/root/agent_definition/items/item[position() = $pos]/id"/>
- <xsl:choose>
- <xsl:when test="@type='url'">
- <modelItemField id="{$id}">
- <name>url_description</name>
- <value>
- <xsl:value-of select="./param[@name='url_description']"/>
- </value>
- </modelItemField>
- <modelItemField id="{$id}">
- <name>url_screentip</name>
- <value>
- <xsl:value-of select="./param[@name='url_screentip']"/>
- </value>
- </modelItemField>
- <modelItemField id="{$id}">
- <name>url_name</name>
- <value>
- <xsl:value-of select="./param[@name='url_name']"/>
- </value>
- </modelItemField>
- </xsl:when>
- <xsl:when test="@type='message'">
- <xsl:variable name="option-items" select="/root/agentTaskDefinitions/*[local-name() ='queryResponse']/*[local-name()='agentTaskDefinition' and position()=$pos]/*[local-name()='taskObject']/*/*[local-name() ='memo']/*[local-name()='options']/*[local-name()='value']"/>
- <!--xsl:message>
- bud subject item value = <xsl:value-of select="$option-items/*[local-name()='item' and ./*[local-name()='name'] = 'subject']/*[local-name() = 'value']"/>
- bud toaddress item value = <xsl:value-of select="$option-items/*[local-name()='item' and ./*[local-name()='toAddress'] = 'subject']/*[local-name() = 'value']"/>
- budlocal subject item value = <xsl:value-of select="$option-items/item[./name='subject']/value"/>
- bud item = <xsl:value-of select="$option-items/*[local-name()='item']"/>
- </xsl:message-->
- <modelItemField id="{$id}">
- <name>email_to</name>
- <value>
- <xsl:for-each select="$option-items/item[./name='toAddress']/*[local-name()='value']/*[local-name()='item']">
- <xsl:value-of select="text()"/>
- </xsl:for-each>
- </value>
- </modelItemField>
- <modelItemField id="{$id}">
- <name>email_cc</name>
- <value>
- <xsl:for-each select="$option-items/item[./name='ccAddress']/*[local-name()='value']/*[local-name()='item']">
- <xsl:value-of select="text()"/>
- </xsl:for-each>
- </value>
- </modelItemField>
- <modelItemField id="{$id}">
- <name>email_bcc</name>
- <value>
- <xsl:for-each select="$option-items/item[./name='bccAddress']/*[local-name()='value']/*[local-name()='item']">
- <xsl:value-of select="text()"/>
- </xsl:for-each>
- </value>
- </modelItemField>
- <modelItemField id="{$id}">
- <name>email_subject</name>
- <value>
- <xsl:value-of select="$option-items/item[./name='subject']/*[local-name()='value']"/>
- </value>
- </modelItemField>
- <modelItemFieldGroup>
- <modelItemField id="{$id}">
- <name>email_body</name>
- <value>
- <xsl:value-of select="$option-items/*[local-name()='item'][./*[local-name()='name']='memoPart']/*[local-name()='value']/*[local-name()='parts']/*[local-name()='item']//*[local-name()='text']"/>
- </value>
- </modelItemField>
- <!--modelItemField id="{$id}">
- <name>editbody</name>
- <value>
- <xsl:value-of select="$option-items/item[./name='memoPart']/value/parts/item/text"/>
- </value>
- </modelItemField-->
- </modelItemFieldGroup>
- </xsl:when>
-
- <xsl:when test="@type='sql' or @type='web' or @type='agent' or @type='report'">
- <modelItemFieldGroup id="{$id}">
- <xsl:if test="@type='agent' or @type='report'">
- <xsl:attribute name="promptablePath">
- <xsl:text>storeID('</xsl:text>
- <xsl:value-of select="@targetStoreID"/>
- <xsl:text>')</xsl:text>
- </xsl:attribute>
- <xsl:attribute name="promptableName">
- <xsl:value-of select="./param[@name='taskName']"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:for-each select="/root/transformedParams/parameterData[position() = $pos]/parameterAssignments/parameterAssignment">
- <modelItemField id="{$id}">
- <name>pv_dz_<xsl:value-of select="./parameterName"/>_pv_dz</name>
- <value>
- <xsl:value-of select="./dataItemName"/>
- </value>
- </modelItemField>
- </xsl:for-each>
- </modelItemFieldGroup>
- </xsl:when>
-
- </xsl:choose>
- <modelItemField id="{$id}">
- <name>Action_topic_filter</name>
- <value>
- <xsl:value-of select="/root/agent_definition/items/item[position() = $pos]/suppression/param[@name='Action_topic_filter']"/>
- </value>
- </modelItemField>
-
- </xsl:for-each>
-
- </modelItemFields>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
|