123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: AGS
- (C) Copyright IBM Corp. 2005, 2009
- US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- -->
- <xts:morphlet xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="messages/AGS.xml,messages/portal.xml" includeConfig="true" requiredCapability="canUseEventStudio">
- <!--
- ================================================================================
- decodeAgentDefinition
-
- a block which takes all the saved actions in the index and expands them into individual blocks
- ===============================================================================================
- -->
- <xts:block id="decodeAgentDefinition" processor="XSLT" type="exec">
- <xts:logicsheet path="logicsheets/presentation/dialog/templates.xsl"/>
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:SOAP-ENV="http://www.w3.org/2001/09/soap-envelope" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
- <xsl:template match="/root">
- <xts:sequence>
- <xts:append>
- <xts:transform src="ags/iFrmCmd/common/decodeAgentDefinition.xslt" processor="XSLT">
- <root>
- <xts:transform src="ags/iFrmCmd/common/decodeAgentDefinitionBlob.xslt" processor="XSLT">
- <root>
- <xsl:if test="/root/env/param[@name='agent_definition_blob']">
- <agent_definition_blob>
- <xsl:value-of select="/root/env/param[@name='agent_definition_blob']"/>
- </agent_definition_blob>
- </xsl:if>
- </root>
- </xts:transform>
- <!-- copy the environment in there too -->
- <xsl:copy-of select="/root/env/param"/>
- </root>
- </xts:transform>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ================================================================================
- decodeReportOptions
- A helper block to expand the report options and place them under /root/agent_item
- The reportOptions node is stripped out to make '/root/agent_item/options' which can then be saved to CM
- ================================================================================
- -->
- <xts:block id="decodeReportOptions" dependency="decodeAgentDefinition" path="/ags/iFrmCmd/common/decodeReportOptions.xslt" processor="XSLT" type="exec" mandatory="false" condition=".[/root/agent_item[@type='report'] and /root/agent_item/param[@name='reportOptions']]">
- <xts:logicsheet path="logicsheets/presentation/dialog/templates.xsl"/>
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- </xts:block>
- <!--
- ================================================================================
- extract and clean up the parameters
- ===============================================================================================
- -->
- <xts:block id="extractTaskParams" path="/ags/iFrmCmd/common/extractTaskParams.xslt" dependency="decodeReportOptions" processor="XSLT" type="exec" mode="interpret">
- </xts:block>
- <!--
- a block which decodes the information email options
- ==============================================================================================
- -->
- <xts:block id="decodeTaskOptions" path="/ags/iFrmCmd/common/decodeTaskOptions.xslt" dependency="extractTaskParams" processor="XSLT" type="exec" condition="/root/agent_item" mandatory="false">
- <xts:logicsheet path="logicsheets/presentation/dialog/templates.xsl"/>
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- </xts:block>
- <!--
- ================================================================================
- take all the saved parameter data and whip it out
- ===============================================================================================
- -->
- <xts:block id="extractSavedParameters" mode="interpret" processor="XSLT" type="exec" dependency="decodeTaskOptions">
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:SOAP-ENV="http://www.w3.org/2001/09/soap-envelope" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
- <xsl:template match="/root">
- <xts:sequence>
- <xsl:for-each select="/root/agent_item">
- <xsl:if test="./param[@name='taskParameters']">
- <xts:append select="/root/agent_item[@id = '{@id}']">
- <xsl:value-of select="xtsext:web64decode( string(./param[@name='taskParameters']), true() )" disable-output-escaping="yes"/>
- </xts:append>
- </xsl:if>
- </xsl:for-each>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===============================================================================================
- doCreateAgent
- A block to take care of the creation of the Agent - this is an agentDefinition Object in CM
- ===============================================================================================
- -->
- <xts:block id="doCreateAgentDefinition" dependency="extractSavedParameters" processor="XSLT" type="exec">
- <xts:logicsheet path="ags/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: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:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="cms xts send cm pf xtsext">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <pf:variables/>
- <xsl:template match="/root/env">
- <!-- this is the class of the new object -->
- <xts:sequence>
- <!-- prepare and send the add request -->
- <xts:append select="/root">
- <agentDefinition>
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <cm:objects xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
- <cm:agentDefinition>
- <cm:searchPath>
- <xsl:value-of select="/root/agent_definition/agentDefinition"/>
- </cm:searchPath>
- <!-- apply templates to define the screen tips and descriptions -->
- <xsl:apply-templates/>
- <!-- set the sequencing - this is part of the agent_definition -->
- <cm:sequencing>
- <xsl:value-of select="/root/agent_definition/sequencing"/>
- </cm:sequencing>
- <cm:allowNotification>
- <xsl:value-of select="/root/agent_definition/allowNotification"/>
- </cm:allowNotification>
- <!-- have to store the event key items -->
- <cm:eventKey>
- <xsl:call-template name="build_keyItems">
- <xsl:with-param name="keyItems">
- <xsl:value-of select="/root/agent_definition/summaryEventKey"/>
- </xsl:with-param>
- </xsl:call-template>
- </cm:eventKey>
- <!-- create the default agent options -->
- <cm:options>
- <xsl:copy-of select="/root/agent_definition/agentOptions/options/value"/>
- </cm:options>
- </cm:agentDefinition>
- </cm:objects>
- </xts:transform>
- </agentDefinition>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- <!-- template to create an item - and alter the name of the object -->
- <xsl:template match="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>
- <!--
- ===============================================================================================
- doCreateAgentDefinitionReport
-
- A block which creates the report which provides the datasource for the agent. This is a subObject of the agentDefinition
- ===============================================================================================
- -->
- <xts:block id="doCreateAgentDefinitionReport" dependency="doCreateAgentDefinition" processor="XSLT" type="exec">
- <xts:logicsheet path="ags/logicsheets/cm-save.xsl"/>
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <xts:logicsheet path="ags/logicsheets/agentDefinition.xsl"/>
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:agsad="http://developer.cognos.com/schemas/xts/logicsheets/xslt/ags/agentDefinition/" 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:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="agsad cms xts send cm pf xtsext">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <pf:variables/>
- <!-- global application variables -->
- <xsl:template match="/root/env">
- <xts:sequence>
- <!-- prepare and send the add request -->
- <xts:append select="/root">
-
- <agentDefinitionReport xmlns:xts="http://developer.cognos.com/schemas/xts/">
- <objects xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:cm="http://developer.cognos.com/schemas/contentManagerService/1" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="cm:baseClass[1]">
- <item xsi:type="bus:report">
- <defaultDescription xsi:type="bus:stringProp">
- <value xsi:type="xsd:string">
- <xsl:call-template name="conditionDisplayLogic">
- <xsl:with-param name="p1">
- <xsl:value-of select="/root/agent_definition/condition/text()"/>
- </xsl:with-param>
- </xsl:call-template>
- </value>
- </defaultDescription>
- <specification xsi:type="bus:anyTypeProp">
- <value xsi:type="xsd:string">
- <xsl:value-of select="param[@name='inlineSpec']"/>
- </value>
- </specification>
- <metadataModel xsi:type="bus:baseClassArrayProp">
- <value xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:baseClass[1]">
- <item xsi:type="bus:nil">
- <searchPath xsi:type="bus:stringProp">
- <value xsi:type="xsd:string">
- <!-- put the path to the model spec in -->
- <xsl:value-of select="param[@name='model']"/>
- </value>
- </searchPath>
- </item>
- </value>
- </metadataModel>
- <metadataModelPackage xsi:type="bus:baseClassArrayProp">
- <value xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:baseClass[1]">
- <item xsi:type="bus:nil">
- <searchPath xsi:type="bus:stringProp">
- <value xsi:type="xsd:string">
- <xsl:value-of select="substring-before(param[@name='model'],'/model[')"/>
- </value>
- </searchPath>
- </item>
- </value>
- </metadataModelPackage>
- <xsl:choose>
- <xsl:when test="/root/env/param[@name='parameterValues']">
- <xsl:value-of select="string(/root/env/param[@name='parameterValues'])" disable-output-escaping="yes"/>
- </xsl:when>
- <xsl:otherwise>
- <parameters xsi:type="bus:parameterValueArrayProp">
- <value xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:parameterValue[0]"/>
- </parameters>
- </xsl:otherwise>
- </xsl:choose>
- </item>
- </objects>
- </agentDefinitionReport>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- <!-- template to create the default description for the agent condition report-->
- <xsl:template name="addDefaultDescription">
- <!-- create an element for each property passed in -->
- <xsl:element name="defaultDescription" namespace="http://developer.cognos.com/schemas/xts-cm/1/">
- <!-- transform the condition -->
- <xsl:call-template name="conditionDisplayLogic">
- <xsl:with-param name="p1">
- <xsl:value-of select="/root/agent_definition/condition/text()"/>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:element>
- </xsl:template>
- <cms:prop-save/>
- <agsad:conditionDisplayLogic/>
- <xsl:template match="text()"/>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ================================================================================
- doCreateAgentSubObjects
-
- a block which creates all the subobjects which are allowed to be under the agent - sqlTask/WebTask
- ===============================================================================================
- -->
- <xts:block id="doCreateAgentSubObjects" dependency="doCreateAgentDefinition" processor="XSLT" type="exec" condition="/root/agent_item" mandatory="false">
- <xts:logicsheet path="logicsheets/presentation/dialog/templates.xsl"/>
- <xts:logicsheet path="ags/logicsheets/agsCmHelper.xsl"/>
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <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:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:agsh="http://developer.cognos.com/schemas/xts/logicsheets/xslt/ags/agsCmHelper/" exclude-result-prefixes="cm send xtsext agsh">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="/">
- <xts:sequence>
- <xsl:for-each select="/root/agent_definition/items/item">
- <!--give a dummy id if there is no real one -->
- <xsl:variable name="id" select="./id"/>
- <!--use the real search path for newsitems if there is one
- to determine the state of the generated newsitems-->
- <xsl:variable name="search_path">
- <xsl:choose>
- <xsl:when test="./targetStoreID and ./targetStoreID != ''">
- <xsl:value-of select="./targetStoreID"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat($id, '-', position())"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="/root/agent_definition/items/item[./id = $id]/type = 'sql'">
- <xts:append select="/root/agent_item[@id = '{$id}']">
- <agentTaskTarget>
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <cm:objects xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
- <cm:storedProcedureTask>
- <cm:searchPath>
- <!--these are internal to the agent..... so we dont validate the sub object existence
- give them a dummy sp-->
- <xsl:value-of select="concat($id, '-', position())"/>
- </cm:searchPath>
- <!-- give the memo the name of the task -->
- <cm:defaultName>
- <xsl:value-of select="/root/agent_definition/items/item[./id=$id]/name"/>
- </cm:defaultName>
- <cm:storedProcedureName>
- <xsl:value-of select="/root/agent_item[@id = $id]/param[@name='sql_procedure_name']"/>
- </cm:storedProcedureName>
- <xsl:if test="/root/agent_item[@id = $id]/param[@name='sql_model']!=''">
- <cm:metadataModel>
- <cm:model>
- <cm:searchPath>
- <!-- put the path to the model spec in -->
- <xsl:value-of select="/root/agent_item[@id = $id]/param[@name='sql_model']"/>
- </cm:searchPath>
- </cm:model>
- </cm:metadataModel>
- </xsl:if>
- <xsl:if test="/root/agent_item[@id = $id]/param[@name='sql_package']!=''">
- <cm:metadataModelPackage>
- <cm:package>
- <cm:searchPath>
- <!-- put the path to the model spec in -->
- <xsl:value-of select="/root/agent_item[@id = $id]/param[@name='sql_package']"/>
- </cm:searchPath>
- </cm:package>
- </cm:metadataModelPackage>
- </xsl:if>
- <!-- just copy the options that we've got -->
- <xsl:copy-of select="/root/agent_item[@id = $id]/options"/>
- </cm:storedProcedureTask>
- </cm:objects>
- </xts:transform>
- </agentTaskTarget>
- </xts:append>
- </xsl:when>
- <xsl:when test="/root/agent_definition/items/item[./id = $id]/type = 'web'">
- <xts:append select="/root/agent_item[@id = '{$id}']">
- <agentTaskTarget>
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <cm:objects xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
- <cm:webServiceTask>
- <cm:searchPath>
- <!--these are internal to the agent..... so we dont validate the sub object existence
- give them a dummy sp-->
- <xsl:value-of select="concat($id, '-', position())"/>
- </cm:searchPath>
- <!-- give the memo the name of the task -->
- <cm:defaultName>
- <xsl:value-of select="/root/agent_definition/items/item[./id=$id]/name"/>
- </cm:defaultName>
- <cm:uri>
- <xsl:value-of select="/root/agent_item[@id = $id]/param[@name='url_wsdl']"/>
- </cm:uri>
- <cm:operationName>
- <xsl:value-of select="/root/agent_item[@id = $id]/param[@name='url_operation']"/>
- </cm:operationName>
- <cm:serviceName>
- <xsl:value-of select="/root/agent_item[@id = $id]/param[@name='url_serviceName']"/>
- </cm:serviceName>
- <cm:inputMessageName/>
- <cm:outputMessageName/>
- <cm:bindingName>
- <xsl:value-of select="/root/agent_item[@id = $id]/param[@name='url_port']"/>
- </cm:bindingName>
- <!-- just copy the options that we've got -->
- <xsl:copy-of select="/root/agent_item[@id = $id]/options"/>
- </cm:webServiceTask>
- </cm:objects>
- </xts:transform>
- </agentTaskTarget>
- </xts:append>
- </xsl:when>
- <xsl:when test="/root/agent_definition/items/item[./id = $id]/type = 'url'">
- <!-- only create a url for the url objects -->
- <xts:append select="/root/agent_item[@id = '{$id}']">
- <agentTaskTarget>
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <cm:objects xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
- <xsl:call-template name="rssTaskObject">
- <xsl:with-param name="task" select="/root/agent_item[@id = $id]"/>
- <!-- put the search path which was returned from the creation of the agentDefinition -->
- <xsl:with-param name="path" select="$search_path"/>
- <xsl:with-param name="name" select="/root/agent_definition/items/item[./id=$id]/name"/>
- </xsl:call-template>
- </cm:objects>
- </xts:transform>
- </agentTaskTarget>
- </xts:append>
- </xsl:when>
- <xsl:when test="/root/agent_definition/items/item[./id = $id]/type = 'message' ">
- <xts:append select="/root/agent_item[@id = '{$id}']">
- <agentTaskTarget>
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <cm:objects xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
- <cm:memo>
- <cm:searchPath>
- <!--these are internal to the agent..... so we dont validate the sub object existence
- give them a dummy sp-->
- <xsl:value-of select="concat($id, '-', position())"/>
- </cm:searchPath>
- <!-- give the memo the name of the task -->
- <cm:defaultName>
- <xsl:value-of select="/root/agent_definition/items/item[./id=$id]/name"/>
- </cm:defaultName>
- <!-- just copy the options that we've got -->
- <xsl:copy-of select="/root/agent_item[@id=$id]/options"/>
- </cm:memo>
- </cm:objects>
- </xts:transform>
- </agentTaskTarget>
- </xts:append>
- </xsl:when>
- <!-- handle a human task -->
- <xsl:when test="/root/agent_definition/items/item[./id = $id]/type = 'notification' or /root/agent_definition/items/item[./id = $id]/type = 'approval' ">
- <!-- only create a url for the url objects -->
- <xts:append select="/root/agent_item[@id = '{$id}']">
- <agentTaskTarget>
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <cm:objects>
- <cm:humanTask>
- <cm:searchPath>
- <!--these are internal to the agent..... so we dont validate the sub object existence
- give them a dummy sp-->
- <xsl:value-of select="concat($id, '-', position())"/>
- </cm:searchPath>
- <!-- give the memo the name of the task -->
- <cm:defaultName>
- <xsl:value-of select="/root/agent_definition/items/item[./id=$id]/name"/>
- </cm:defaultName>
- <!-- set the type of the task into the object - we need to know what type to resurrect it -->
- <cm:operationName>
- <xsl:value-of select="/root/agent_definition/items/item[./id = $id]/type"/>
- </cm:operationName>
- <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="ags/transforms/getChildren.xslt" processor="XSLT">
- <xts:transform name="XMLDecode">
- <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(/root/agent_item[@id = $id]/param[@name='taskOptions'])), true())"/>
- </xts:transform>
- </xts:transform>
- </xts:transform>
- </cm:use>
- </cm:simpleParmValueItem>
- </cm:parameterValue>
- <!-- this parameter holds the task count -->
- <cm:parameterValue>
- <cm:name>taskCount</cm:name>
- <cm:simpleParmValueItem>
- <cm:inclusive>false</cm:inclusive>
- <cm:display>taskCount</cm:display>
- <cm:use><xsl:value-of select="count(/root/agent_definition/items/item)"/></cm:use>
- </cm:simpleParmValueItem>
- </cm:parameterValue>
- </cm:parameters>
- </cm:humanTask>
- </cm:objects>
- </xts:transform>
- </agentTaskTarget>
- </xts:append>
- </xsl:when>
- </xsl:choose>
- </xsl:for-each>
- </xts:sequence>
- </xsl:template>
- <!--write a template to create the rss objects -->
- <agsh:rssTaskObject/>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===============================================================================================
- doCreateAgentTasks
- A block which creates the report steps associated with the report actions
- ===============================================================================================
- -->
- <xts:block id="doCreateAgentTasks" dependency="doCreateAgentDefinitionReport doCreateAgentSubObjects" processor="XSLT" type="exec" condition="/root/agent_item" mandatory="false">
- <xts:logicsheet path="ags/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:xtscm="http://developer.cognos.com/schemas/xts-cm/1/" 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:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:x="x" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="xtscm cms send pf bus x SOAP-ENC xsi xts xtsext">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <!-- Handle any agentTaskDefinition adds that are required -->
- <pf:variables/>
- <xsl:template match="/">
- <xts:sequence>
- <xsl:for-each select="/root/agent_definition/items/item">
- <xsl:variable name="id" select="./id"/>
- <xsl:variable name="position" select="position()"/>
- <xts:append select="/root/agent_item[@id = '{$id}']">
- <agentTask>
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <xtscm:objects>
- <xtscm:agentTaskDefinition>
- <!-- we can save the taskName too -->
- <xtscm:defaultName>
- <xsl:choose>
- <xsl:when test="./type='sql' or ./type='web' or ./type='url' or ./type='message' or ./type='notification' or ./type= 'approval'">
- <xsl:value-of select="concat('Task-' , /root/agent_definition/items/item[./id=$id]/name)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="/root/agent_definition/items/item[./id=$id]/name"/>
- </xsl:otherwise>
- </xsl:choose>
- </xtscm:defaultName>
- <xtscm:searchPath>
- <!-- give the internal id of the agent which identifies the task to ES -->
- <xsl:value-of select="$id"/>
- </xtscm:searchPath>
- <xtscm:displaySequence>
- <xsl:value-of select="$position"/>
- </xtscm:displaySequence>
- <xtscm:taskObject>
- <!-- we already have the object..... just add a place holder-->
- </xtscm:taskObject>
- <!-- build the options - runOptions are normally in the env - the deliveryOptions are in a blob -->
- <xtscm:options>
- <!-- build the agent run options-->
- <xsl:variable name="taskId" select="./id"/>
- <xsl:variable name="agentItem" select="/root/agent_item[@id = $taskId]"/>
- <runOptions>
- <xsl:if test="$agentItem/options != ''">
- <xsl:copy-of select="$agentItem/options/*[local-name()='value']/*[local-name()='item']"/>
- </xsl:if>
- </runOptions>
- </xtscm:options>
- <!-- can save the filter values in a real place now -->
- <xtscm:eventTypes>
- <xsl:for-each select="./suppression/param[starts-with(@name, 'Filter_')]">
- <xtscm:item>
- <xsl:value-of select="."/>
- </xtscm:item>
- </xsl:for-each>
- </xtscm:eventTypes>
- <!-- this is the query item list that filters in conjunction with Filter_changed
- or Filter_unchanged not well named as event key -->
- <xtscm:eventKey>
- <xsl:call-template name="build_keyItems">
- <xsl:with-param name="keyItems">
- <xsl:value-of select="./suppression/param[@name='Action_topic_filter']"/>
- </xsl:with-param>
- </xsl:call-template>
- </xtscm:eventKey>
- <xtscm:filterDataItemName>
- <xsl:value-of select="./taskLevelFilter"/>
- </xtscm:filterDataItemName>
- <xtscm:runCondition>
- <xsl:value-of select="./runCondition"/>
- </xtscm:runCondition>
- <!-- build the parameters -->
- <xsl:call-template name="build_parameters">
- <xsl:with-param name="id" select="$id"/>
- </xsl:call-template>
- <!--build the assignments prop for the agent task by id this is a bit roundabout... specially to a form used by preprocess.xslt-->
- <xsl:if test="/root/agent_items_params/agent_item_params[@id = $id]/parameterData/parameterAssignments">
- <xtscm:parameterAssignments>
- <xsl:for-each select="/root/agent_items_params/agent_item_params[@id = $id]/parameterData/parameterAssignments/parameterAssignment">
- <xtscm:parameterAssignmentDataItem>
- <xtscm:parameterName>
- <xsl:value-of select="./parameterName"/>
- </xtscm:parameterName>
- <xtscm:dataItemName>
- <xsl:value-of select="./dataItemName"/>
- </xtscm:dataItemName>
- </xtscm:parameterAssignmentDataItem>
- </xsl:for-each>
- </xtscm:parameterAssignments>
- </xsl:if>
- </xtscm:agentTaskDefinition>
- </xtscm:objects>
- </xts:transform>
- </agentTask>
- </xts:append>
- </xsl:for-each>
- </xts:sequence>
- </xsl:template>
- <!-- Single template to make the parameters instead of just copying it -->
- <xsl:template name="build_parameters">
- <xsl:param name="id"/>
- <parameters xmlns="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:cm="http://developer.cognos.com/schemas/bibus/3/" xmlns:xs="http://www.w3.org/2001/XMLSchema">
- <xsl:for-each select="/root/agent_items_params/agent_item_params[@id = $id]/parameterData/parameterValues/item">
- <xsl:variable name="parameterName" select="./name"/>
- <!-- only copy the item if there's not a corresponding assignment -->
- <xsl:if test="not(/root/agent_items_params/agent_item_params[@id = $id]/parameterData/parameterAssignments/parameterAssignment[./parameterName=$parameterName])">
- <xsl:copy-of select="."/>
- </xsl:if>
- </xsl:for-each>
- </parameters>
- </xsl:template>
- <!-- pull in any templates to handle "special" properties on CM objects -->
- <cms:prop-save/>
- <xsl:template match="text()"/>
- <cms:build_keyItems/>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===============================================================================================
- add the pre built task objects where the current empty value of taskObject is
- ===============================================================================================
- -->
- <xts:block id="mergeTaskObjects" dependency="doCreateAgentTasks" processor="XSLT" type="exec" mandatory="false">
- <xts:logicsheet path="ags/logicsheets/cm-save.xsl"/>
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:cm="http://developer.cognos.com/schemas/bibus/3/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="cm SOAP-ENC xsi xtsext">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="/">
- <xts:sequence>
- <xsl:for-each select="/root/agent_definition/items/item">
- <xsl:variable name="id" select="./id"/>
- <xsl:variable name="objectClass" select="/root/agent_item[@id = $id]/param[@name='objectClass']"/>
- <xts:replace select="/root/agent_item[@id = '{$id}']/agentTask /objects/item/taskObject/value">
- <xsl:choose>
- <xsl:when test="/root/agent_item[@id = $id]/agentTaskTarget/objects/item">
- <!-- currently only one target per task -->
- <value xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="cm:baseClass[1]">
- <xsl:copy-of select="/root/agent_item[@id = $id]/agentTaskTarget/objects/item"/>
- </value>
- </xsl:when>
- <xsl:otherwise>
- <!--we dont own the object, just the path -->
- <value xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="cm:baseClass[1]">
- <item>
- <xsl:attribute name="xsi:type"><xsl:call-template name="getCMType"><xsl:with-param name="type" select="./type"/><xsl:with-param name="objectClass" select="$objectClass"/></xsl:call-template></xsl:attribute>
- <searchPath xsi:type="cm:stringProp">
- <value xsi:type="xsd:string">
- <xsl:value-of select="./targetStoreID"/>
- </value>
- </searchPath>
- </item>
- </value>
- </xsl:otherwise>
- </xsl:choose>
- </xts:replace>
- </xsl:for-each>
- </xts:sequence>
- </xsl:template>
- <xsl:template name="getCMType">
- <xsl:param name="type"/>
- <xsl:param name="objectClass"/>
- <xsl:choose>
- <xsl:when test="type = 'report'">
- <xsl:value-of select="'cm:report'"/>
- </xsl:when>
- <xsl:when test="type = 'agent'">
- <xsl:value-of select="'cm:agentDefinition'"/>
- </xsl:when>
- <xsl:when test="type = 'job'">
- <xsl:value-of select="'cm:jobDefinition'"/>
- </xsl:when>
- <xsl:when test="type = 'import'">
- <xsl:value-of select="'cm:importDeployment'"/>
- </xsl:when>
- <xsl:when test="type = 'export'">
- <xsl:value-of select="'cm:exportDeployment'"/>
- </xsl:when>
- <xsl:when test="type = 'content'">
- <xsl:value-of select="'cm:contentTask'"/>
- </xsl:when>
- <xsl:when test="type = 'index'">
- <xsl:value-of select="'cm:indexUpdateTask'"/>
- </xsl:when>
- <xsl:when test="type = 'metric'">
- <xsl:value-of select="concat('cm:',$objectClass)"/>
- </xsl:when>
- <xsl:when test="type = 'planningMacro'">
- <xsl:value-of select="'cm:planningMacroTask'"/>
- </xsl:when>
- <xsl:when test="type = 'migration'">
- <xsl:value-of select="'cm:migrationTask'"/>
- </xsl:when>
- </xsl:choose>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===============================================================================================
- build the request xml for the validate to be sent to the server
- using cm to prefix bus namespace as were borrowing cm-preprocess.xslt to convert our agent for the validate and pre process turns
- out cm prefixed stuff
- ===============================================================================================
- -->
- <xts:block id="doBuildRequest" dependency="mergeTaskObjects" processor="XSLT" type="exec" mode="output" mimeType="text/xml">
- <xts:logicsheet path="ags/logicsheets/cm-save.xsl"/>
- <xsl:stylesheet version="1.0" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:cm="http://developer.cognos.com/schemas/bibus/3/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="SOAP-ENV SOAP-ENC xsd xs xsi bus xsl cm xtsext">
- <xsl:output method="xml" version="1.0" encoding="UTF-8"/>
- <xsl:variable name="ifrmcmd" select="/root/env/param[@name='ifrmcmd']"/>
- <xsl:variable name="tabSelected" select="/root/env/param[@name='tabSelectedID']"/>
- <xsl:attribute-set name="cm">
- <xsl:attribute name="xmlns:cm">http://developer.cognos.com/schemas/bibus/3/</xsl:attribute>
- </xsl:attribute-set>
- <xsl:template match="/">
- <!-- save search path values of the attachments of memo objects -->
- <!-- the value of this variable will be used to add the report tasks which output are attachments of an email or memo -->
- <xsl:variable name="attachedReportSearchPaths">
- <xsl:for-each select="/root/agent_item[@type='message'][./@id = $tabSelected]/agentTask/objects/item/taskObject/value/item/options/value/item/value/parts/item/searchPath">
- <xsl:value-of select="concat(., ' ')"/>
- </xsl:for-each>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="contains($ifrmcmd, 'validate')">
- <cm:root xmlns:cm="http://developer.cognos.com/schemas/bibus/3/">
- <agent xsi:type="cm:agentDefinition">
- <xsl:copy-of select="/root/agentDefinition/objects/item/*"/>
- </agent>
- <report xsi:type="cm:report">
- <xsl:copy-of select="/root/agentDefinitionReport/objects/item/*"/>
- </report>
- <agentTasks xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="cm:agentTaskDefinition[]">
- <!-- validating attachments of email tasks requires corresponding report tasks -->
- <xsl:for-each select="/root/agent_item">
- <xsl:choose>
- <xsl:when test="not($ifrmcmd = 'validate_task')">
- <item xsi:type="cm:agentTaskDefinition">
- <xsl:copy-of select="./agentTask/objects/item/*"/>
- </item>
- </xsl:when>
- <xsl:when test="$ifrmcmd = 'validate_task' and ./@id = $tabSelected">
- <item xsi:type="cm:agentTaskDefinition">
- <xsl:copy-of select="./agentTask/objects/item/*"/>
- </item>
- </xsl:when>
- <xsl:when test="./@type = 'report' and contains($attachedReportSearchPaths, ./@id)">
- <item xsi:type="cm:agentTaskDefinition">
- <xsl:copy-of select="./agentTask/objects/item/*"/>
- </item>
- </xsl:when>
- </xsl:choose>
- </xsl:for-each>
- </agentTasks>
- </cm:root>
- </xsl:when>
- <xsl:when test="contains($ifrmcmd, 'preview')">
- <cm:root xmlns:cm="http://developer.cognos.com/schemas/bibus/3/">
- <agent xsi:type="cm:agentDefinition">
- <xsl:copy-of select="/root/agentDefinition/objects/item/*"/>
- </agent>
- <report xsi:type="cm:report">
- <xsl:copy-of select="/root/agentDefinitionReport/objects/item/*"/>
- </report>
- <agentTasks xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="cm:agentTaskDefinition[]">
- <!-- preview attachments of email tasks requires corresponding report tasks -->
- <xsl:for-each select="/root/agent_item">
- <xsl:choose>
- <xsl:when test="not($ifrmcmd = 'preview_task')">
- <item xsi:type="cm:agentTaskDefinition">
- <xsl:copy-of select="./agentTask/objects/item/*"/>
- </item>
- </xsl:when>
- <xsl:when test="$ifrmcmd = 'preview_task' and ./@id = $tabSelected">
- <item xsi:type="cm:agentTaskDefinition">
- <xsl:copy-of select="./agentTask/objects/item/*"/>
- </item>
- </xsl:when>
- <xsl:when test="./@type = 'report' and contains($attachedReportSearchPaths, ./@id)">
- <item xsi:type="cm:agentTaskDefinition">
- <xsl:copy-of select="./agentTask/objects/item/*"/>
- </item>
- </xsl:when>
- </xsl:choose>
- </xsl:for-each>
- </agentTasks>
- </cm:root>
- </xsl:when>
- </xsl:choose>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- </xts:morphlet>
|