123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: ASV
- (C) Copyright IBM Corp. 2005, 2010
- US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- -->
- <!--
- ===============================================================================================
- Creates an agent in CM based on parameters passed in.
- Structure:
- AgentDefinition (createAgentDefinition) _______ agentTaskDefinition(createAgentTaskDefinitions) _______ N x AgentActions
-
- Agent(AgentDefinition) is what takes the schedule - and also holds the condition for the agent
- AgentTaskDefinition is the definition of the actions for the agent
-
- ===============================================================================================
- -->
- <xts:morphlet xmlns:xts="http://developer.cognos.com/schemas/xts/" requiredCapability="canUseConditionalSubscriptions">
- <!--
- ===============================================================================================
- doCreateAgent
- A block to take care of the creation of the Agent - this is an agentDefinition Object in CM
- ===============================================================================================
- -->
- <xts:block id="doCreateAgentDefinition" processor="XSLT" type="exec">
- <xts:logicsheet path="portal/iFrmCmd/logicsheets/cm-save.xsl"/>
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:cms="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cms/1/" xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:form="http://developer.cognos.com/schemas/xts/subscribe/iFrmCmd/1/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="cms xts send cm pf form xtsext bus">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <pf:variables/>
- <!-- global application variables -->
- <xsl:template match="/">
- <xsl:apply-templates select="root/command/form:create/form:env"/>
- </xsl:template>
- <xsl:template match="form:env">
- <!-- this is the class of the new object -->
- <xts:sequence>
- <!-- prepare and send the add request -->
- <xts:append select="/root">
- <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
- <send:request provider="cm" faultBlock="createFault">
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <cm:add>
- <cm:search>
- <xsl:value-of select="form:param[@name='m_p_path']"/>
- </cm:search>
- <cm:objects>
- <cm:reportDataServiceAgentDefinition>
- <!-- apply templates to define the screen tips and descriptions -->
- <xsl:apply-templates/>
- <!-- create the report property -->
- <cm:report>
- <xts:transform name="XMLEncode">
- <xts:transform src="subscribe/transforms/assembleSelectionSpec.xslt" processor="XSLT">
- <root>
- <env>
- <xsl:copy-of select="/root/env/param[starts-with(@name, 'm_sub')]"/>
- </env>
- <xts:transform name="XMLDecode">
- <xsl:value-of select="/root/env/param[@name='m_subData_report']"/>
- </xts:transform>
- </root>
- </xts:transform>
- </xts:transform>
- </cm:report>
- <!-- set the sequencing - this is part of the agent_definition -->
- </cm:reportDataServiceAgentDefinition>
- </cm:objects>
- <cm:options>
- <xsl:attribute name="updateAction"><xsl:text>fail</xsl:text></xsl:attribute>
- </cm:options>
- </cm:add>
- </xts:transform>
- </send:request>
- </xts:transform>
- </xts:append>
- <xts:append select="/root/env">
- <param name="m_schedule_owner_reset">
- <xsl:text>true</xsl:text>
- </param>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- <!-- template to create an item - and alter the name of the object -->
- <xsl:template match="form:param[starts-with(@name,'m_p_')]">
- <!-- create an element for each property passed in -->
- <xsl:element name="{substring-after(@name, 'm_p_')}" xmlns="http://developer.cognos.com/schemas/xts-cm/1/">
- <!-- name is the on CM property that must be encoded *before* giving to CM -->
- <xsl:value-of select="."/>
- </xsl:element>
- </xsl:template>
- <cms:prop-save/>
- <xsl:template match="text()"/>
- <!-- template to make the key items into something which pre-process can make -->
- <cms:build_keyItems/>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===============================================================================================
- doCreateAgentSchedule
- A block to take care of the creation of the schedule which needs to be added to the Agent
- ===============================================================================================
- -->
- <xts:block id="doCreateAgentSchedule" dependency="doCreateAgentDefinition" condition=".[not(root/copyFault) and not(root/fault)]" processor="XSLT" type="exec" mandatory="false">
- <xts:logicsheet path="portal/iFrmCmd/logicsheets/cm-save.xsl"/>
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:cms="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cms/1/" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:form="http://developer.cognos.com/schemas/xts/subscribe/iFrmCmd/1/" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" exclude-result-prefixes="xsl SOAP-ENC xsi cms send cm form bus xtsext pf">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <pf:variables/>
- <xsl:template match="/">
- <xsl:apply-templates select="root/command/form:create/form:env"/>
- </xsl:template>
- <xsl:template match="form:env">
- <xts:sequence>
- <xts:append select="/root">
- <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
- <send:request provider="cm" faultBlock="createFault">
- <bus:add>
- <search xsi:type="xsd:string">
- <!-- attach the schedule onto the anget - not the report -->
- <xsl:value-of select="/root/cm:addResponse/cm:reportDataServiceAgentDefinition/cm:searchPath"/>
- </search>
- <objects xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:baseClass[1]">
- <item xsi:type="bus:schedule">
- <!-- build the normal schedule params -->
- <xsl:call-template name="build_jsm_schedule">
- <xsl:with-param name="env" select="."/>
- </xsl:call-template>
- <periodicalProducer xsi:type="cm:baseClassArrayProp">
- <value xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="cm:baseClass[1]">
- <item xsi:type="cm:report">
- <searchPath xsi:type="cm:stringProp">
- <value xsi:type="xsd:string">
- <xsl:value-of select="form:param[@name='m_sp_periodicalProducer']"/>
- </value>
- </searchPath>
- </item>
- </value>
- </periodicalProducer>
- </item>
- </objects>
- </bus:add>
- </send:request>
- </xts:transform>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- <!-- pull in any templates to handle "special" properties on CM objects -->
- <cms:prop-save/>
- <xsl:template match="text()"/>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ================================================================================
- doCreateAgentMemoSubObjects
-
- a block which creates memo subobjects which are allowed to be under the agent
- ===============================================================================================
- -->
- <xts:block id="doCreateAgentMemoSubObjects" dependency="doCreateAgentSchedule" processor="XSLT" type="exec" mandatory="false" condition=".[not(root/copyFault) and not(root/fault) and ((/root/command/*[local-name()='create']/*[local-name()='env']/*[local-name()='param' and @name='m_sub_type']='nonMetric' and /root/command/*[local-name()='create']/*[local-name()='env']/*[local-name()='param' and @name = 'm_subData_emailCB']) or (/root/command/*[local-name()='create']/*[local-name()='env']/*[local-name()='param' and @name='m_sub_type']='metric' and /root/command/*[local-name()='create']/*[local-name()='env']/*[local-name()='param' and starts-with(@name, 'm_subData_emailCB_')])) ]">
- <xts:logicsheet path="logicsheets/presentation/dialog/templates.xsl"/>
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:form="http://developer.cognos.com/schemas/xts/subscribe/iFrmCmd/1/" exclude-result-prefixes="send xtsext form">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="/">
- <xsl:apply-templates select="root/command/form:create/form:env"/>
- </xsl:template>
- <xsl:template match="form:env">
- <xts:sequence>
- <xts:append select="/root">
- <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
- <send:request provider="cm" faultBlock="createFault">
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <cm:add xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
- <cm:objects>
- <cm:memo>
- <cm:searchPath>
- <!-- attach the memo to the agent - not the report -->
- <xsl:value-of select="/root/cm:addResponse/cm:reportDataServiceAgentDefinition/cm:searchPath"/>
- </cm:searchPath>
- <cm:defaultName>
- <xsl:value-of select="form:param[@name='taskName']"/>
- </cm:defaultName>
- <!-- just copy the options that we've got -->
- <xts:transform name="XMLDecode">
- <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(form:param[@name='deliveryOptions'])), true())"/>
- </xts:transform>
- </cm:memo>
- </cm:objects>
- </cm:add>
- </xts:transform>
- </send:request>
- </xts:transform>
- </xts:append>
- <xts:append select="/root">
- <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
- <send:request provider="cm" faultBlock="createFault">
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <cm:add xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
- <cm:objects>
- <cm:agentTaskDefinition>
- <cm:searchPath>
- <!-- attach the memo to the agent - not the report -->
- <xsl:value-of select="/root/cm:addResponse/cm:reportDataServiceAgentDefinition/cm:searchPath"/>
- </cm:searchPath>
- <!-- we can save the taskName too -->
- <cm:taskObject>
- <cm:memo>
- <cm:searchPath>
- <!-- put the path into the report that we selected as the action,
- queryValue decodes the search path so we must explicitly encode it -->
- <xts:function name="xmlencode">
- <xts:param name="source">
- <xts:queryValue select="/root/*[local-name()='addResponse']/*[local-name()='memo']/*[local-name()='searchPath']"/>
- </xts:param>
- </xts:function>
- </cm:searchPath>
- </cm:memo>
- </cm:taskObject>
- <!-- define the filter data item name -->
- <cm:filterDataItemName>
- <xsl:if test="/root/env/param[starts-with(@name,'m_subData_emailCB_')]">
- <xsl:variable name="max" select="count(/root/env/param[starts-with(@name,'m_subData_emailCB_')])"/>
- <xsl:text>[</xsl:text>
- <xsl:for-each select="/root/env/param[starts-with(@name,'m_subData_emailCB_')]">
- <xsl:sort select="@name"/>
- <xsl:value-of select="substring-after(@name,'m_subData_emailCB_')"/>
- <xsl:if test="position() < $max">
- <xsl:text>OR</xsl:text>
- </xsl:if>
- </xsl:for-each>
- <xsl:text>]</xsl:text>
- </xsl:if>
- </cm:filterDataItemName>
- </cm:agentTaskDefinition>
- </cm:objects>
- </cm:add>
- </xts:transform>
- </send:request>
- </xts:transform>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ================================================================================
- doCreateNewsItemSubObject
-
- a block which creates newsitem for
- ===============================================================================================
- -->
- <xts:block id="doCreateNewsItemSubObject" dependency="doCreateAgentMemoSubObjects" processor="XSLT" type="exec" mandatory="false" condition=".[not(root/copyFault) and not(root/fault) and ((/root/command/*[local-name()='create']/*[local-name()='env']/*[local-name()='param' and @name='m_sub_type']='nonMetric' and /root/command/*[local-name()='create']/*[local-name()='env']/*[local-name()='param' and @name = 'm_subData_newsitemCB']) or (/root/command/*[local-name()='create']/*[local-name()='env']/*[local-name()='param' and @name='m_sub_type']='metric' and /root/command/*[local-name()='create']/*[local-name()='env']/*[local-name()='param' and starts-with(@name, 'm_subData_newsitemCB_')])) ]">
- <xts:logicsheet path="logicsheets/presentation/dialog/templates.xsl"/>
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:form="http://developer.cognos.com/schemas/xts/subscribe/iFrmCmd/1/" exclude-result-prefixes="send xtsext form">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="/">
- <xsl:apply-templates select="root/command/form:create/form:env"/>
- </xsl:template>
- <xsl:template match="form:env">
- <xsl:variable name="user_locale">
- <xsl:choose>
- <xsl:when test="/root/session/param[@name='contentLocale']">
- <xsl:value-of select="/root/session/param[@name='contentLocale']"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="/root/system/param[@name='contentLocale']"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xts:sequence>
- <xts:append select="/root">
- <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
- <send:request provider="cm" faultBlock="createFault">
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <cm:add xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
- <cm:objects>
- <cm:shortcutRSSTask>
- <cm:searchPath>
- <!-- attach the memo to the agent - not the report -->
- <xsl:value-of select="/root/cm:addResponse/cm:reportDataServiceAgentDefinition/cm:searchPath"/>
- </cm:searchPath>
- <cm:defaultName>
- <xsl:value-of select="form:param[@name='m_subData_newsitem_taskName']"/>
- </cm:defaultName>
- <cm:defaultScreenTip>
- <xsl:value-of select="form:param[@name='m_subData_newsitem_screentip']"/>
- </cm:defaultScreenTip>
- <cm:defaultDescription>
- <xsl:value-of select="form:param[@name='m_subData_newsitem_text']"/>
- </cm:defaultDescription>
- <!--the title is destined for the name of the url -->
- <cm:title>
- <cm:value>
- <xsl:attribute name="locale"><xsl:value-of select="$user_locale"/></xsl:attribute>
- <xsl:value-of select="form:param[@name='m_subData_newsitem_headline']"/>
- </cm:value>
- </cm:title>
- <cm:channel>
- <cm:baseClass>
- <cm:searchPath>
- <xsl:value-of select="form:param[@name='m_subData_newsitem_path']"/>
- </cm:searchPath>
- </cm:baseClass>
- </cm:channel>
- </cm:shortcutRSSTask>
- </cm:objects>
- </cm:add>
- </xts:transform>
- </send:request>
- </xts:transform>
- </xts:append>
- <xts:append select="/root">
- <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
- <send:request provider="cm" faultBlock="createFault">
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <cm:add xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
- <cm:objects>
- <cm:agentTaskDefinition>
- <cm:searchPath>
- <!-- attach the memo to the agent - not the report -->
- <xsl:value-of select="/root/cm:addResponse/cm:reportDataServiceAgentDefinition/cm:searchPath"/>
- </cm:searchPath>
- <!-- we can save the taskName too -->
- <cm:taskObject>
- <cm:shortcutRSSTask>
- <cm:searchPath>
- <!-- put the path into the report that we selected as the action -->
- <xts:function name="xmlencode">
- <xts:param name="source">
- <xts:queryValue select="/root/*[local-name()='addResponse']/*[local-name()='shortcutRSSTask']/*[local-name()='searchPath']"/>
- </xts:param>
- </xts:function>
- </cm:searchPath>
- </cm:shortcutRSSTask>
- </cm:taskObject>
- <!-- define the filter data item name -->
- <cm:filterDataItemName>
- <xsl:if test="/root/env/param[starts-with(@name,'m_subData_newsitemCB_')]">
- <xsl:variable name="max" select="count(/root/env/param[starts-with(@name,'m_subData_newsitemCB_')])"/>
- <xsl:text>[</xsl:text>
- <xsl:for-each select="/root/env/param[starts-with(@name,'m_subData_newsitemCB_')]">
- <xsl:sort select="@name"/>
- <xsl:value-of select="substring-after(@name,'m_subData_newsitemCB_')"/>
- <xsl:if test="position() < $max">
- <xsl:text>OR</xsl:text>
- </xsl:if>
- </xsl:for-each>
- <xsl:text>]</xsl:text>
- </xsl:if>
- </cm:filterDataItemName>
- </cm:agentTaskDefinition>
- </cm:objects>
- </cm:add>
- </xts:transform>
- </send:request>
- </xts:transform>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ================================================================================
- doCreateNotificationTaskSubObject
-
- a block which creates newsitem for
- ===============================================================================================
- -->
- <xts:block id="doCreateNotificationTaskSubObject" dependency="doCreateNewsItemSubObject" processor="XSLT" type="exec" mandatory="false" condition=".[not(root/copyFault) and not(root/fault) and ((/root/command/*[local-name()='create']/*[local-name()='env']/*[local-name()='param' and @name='m_sub_type']='nonMetric' and /root/command/*[local-name()='create']/*[local-name()='env']/*[local-name()='param' and @name = 'm_subData_taskCB']) or (/root/command/*[local-name()='create']/*[local-name()='env']/*[local-name()='param' and @name='m_sub_type']='metric' and /root/command/*[local-name()='create']/*[local-name()='env']/*[local-name()='param' and starts-with(@name, 'm_subData_taskCB_')])) ]">
- <xts:logicsheet path="logicsheets/presentation/dialog/templates.xsl"/>
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:form="http://developer.cognos.com/schemas/xts/subscribe/iFrmCmd/1/" exclude-result-prefixes="send xtsext form">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="/">
- <xsl:apply-templates select="root/command/form:create/form:env"/>
- </xsl:template>
- <xsl:template match="form:env">
- <xsl:variable name="user_locale">
- <xsl:choose>
- <xsl:when test="/root/session/param[@name='contentLocale']">
- <xsl:value-of select="/root/session/param[@name='contentLocale']"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="/root/system/param[@name='contentLocale']"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xts:sequence>
- <xts:append select="/root">
- <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
- <send:request provider="cm" faultBlock="createFault">
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <cm:add xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
- <cm:objects>
- <cm:humanTask>
- <cm:searchPath>
- <!-- attach the human task to the agent - not the report -->
- <xsl:value-of select="/root/cm:addResponse/cm:reportDataServiceAgentDefinition/cm:searchPath"/>
- </cm:searchPath>
- <cm:defaultName>
- <xsl:value-of select="form:param[@name='humanTaskName']"/>
- </cm:defaultName>
- <cm:parameters>
- <cm:parameterValue>
- <cm:name>hts</cm:name>
- <cm:simpleParmValueItem>
- <cm:inclusive>false</cm:inclusive>
- <cm:display>hts</cm:display>
- <cm:use>
- <xts:transform name="XMLEncode">
- <xts:transform src="subscribe/transforms/getChildren.xslt" processor="XSLT">
- <xts:transform name="XMLDecode">
- <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(form:param[@name='taskOptions'])), true())"/>
- </xts:transform>
- </xts:transform>
- </xts:transform>
- </cm:use>
- </cm:simpleParmValueItem>
- </cm:parameterValue>
- </cm:parameters>
- <cm:iconURI>./ps/portal/images/icon_notification.gif</cm:iconURI>
- </cm:humanTask>
- </cm:objects>
- </cm:add>
- </xts:transform>
- </send:request>
- </xts:transform>
- </xts:append>
- <xts:append select="/root">
- <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
- <send:request provider="cm" faultBlock="createFault">
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <cm:add xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
- <cm:objects>
- <cm:agentTaskDefinition>
- <cm:searchPath>
- <!-- attach the memo to the agent - not the report -->
- <xsl:value-of select="/root/cm:addResponse/cm:reportDataServiceAgentDefinition/cm:searchPath"/>
- </cm:searchPath>
- <!-- we can save the taskName too -->
- <cm:taskObject>
- <cm:humanTask>
- <cm:searchPath>
- <!-- put the path into the report that we selected as the action -->
- <xts:function name="xmlencode">
- <xts:param name="source">
- <xts:queryValue select="/root/*[local-name()='addResponse']/*[local-name()='humanTask']/*[local-name()='searchPath']"/>
- </xts:param>
- </xts:function>
- </cm:searchPath>
- </cm:humanTask>
- </cm:taskObject>
- <!-- define the filter data item name -->
- <cm:filterDataItemName>
- <xsl:if test="/root/env/param[starts-with(@name,'m_subData_taskCB_')]">
- <xsl:variable name="max" select="count(/root/env/param[starts-with(@name,'m_subData_taskCB_')])"/>
- <xsl:text>[</xsl:text>
- <xsl:for-each select="/root/env/param[starts-with(@name,'m_subData_taskCB_')]">
- <xsl:sort select="@name"/>
- <xsl:value-of select="substring-after(@name,'m_subData_taskCB_')"/>
- <xsl:if test="position() < $max">
- <xsl:text>OR</xsl:text>
- </xsl:if>
- </xsl:for-each>
- <xsl:text>]</xsl:text>
- </xsl:if>
- </cm:filterDataItemName>
- </cm:agentTaskDefinition>
- </cm:objects>
- </cm:add>
- </xts:transform>
- </send:request>
- </xts:transform>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ================================================================================
- do the commandResults ???
- ================================================================================
- -->
- <xts:block id="commandResults" processor="XSLT" type="exec" mode="output" mimeType="text/xml" dependency="doCreateNotificationTaskSubObject">
- <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" version="1.0">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="/root">
- <response xmlns="http://developer.cognos.com/schemas/xts/subscribe/iFrmCmd/1/">
- <xsl:choose>
- <xsl:when test="cm:addResponse/cm:reportDataServiceAgentDefinition">
- <xsl:copy-of select="cm:addResponse/cm:reportDataServiceAgentDefinition"/>
- </xsl:when>
- <xsl:when test="./copyFault or ./fault">
- <error>
- <errorCode>
- <xsl:value-of select="./copyFault/fault/*[local-name()='exception']/*[local-name()='exceptionDetail']/*[local-name()='exception']/*[local-name()='errorCode']"/>
- </errorCode>
- <errorMessage>
- <xsl:value-of select="./copyFault/fault/*[local-name()='exception']/*[local-name()='exceptionDetail']/*[local-name()='exception']/*[local-name()='message']/*[local-name()='messageString']"/>
- </errorMessage>
- <!-- copy the whole of the fault detail out too -->
- <xsl:copy-of select="*[local-name()='copyFault' or local-name()='fault']"/>
- </error>
- </xsl:when>
- </xsl:choose>
- </response>
- </xsl:template>
- <xsl:template match="text()"/>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===============================================================================================
- faultHandler
- ===============================================================================================
- -->
- <xts:block id="createFault" type="fault" processor="XSLT">
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
- <xsl:output method="xml"/>
- <xsl:template match="/root/fault">
- <xsl:choose>
- <xsl:when test="./*[local-name() = 'exception']/*[local-name() = 'exceptionDetail']/*[local-name() = 'exception']/*[local-name()='errorCode'] = 'cmDuplicateName'">
- <copyFault>
- <xsl:copy-of select="."/>
- </copyFault>
- </xsl:when>
- <xsl:otherwise>
- <xsl:copy-of select="."/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="text()"/>
- </xsl:stylesheet>
- </xts:block>
- </xts:morphlet>
|