12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226 |
- <?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.
- -->
- <!--
- ===============================================================================================
- 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="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" xmlns:form="http://developer.cognos.com/schemas/xts/ags/iFrmCmd/1/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" exclude-result-prefixes="xsl bus SOAP-ENV SOAP-ENC xsd form">
- <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/command/*/form:env/form:param[@name='agent_definition_blob']">
- <agent_definition_blob>
- <xsl:value-of select="/root/command/*/form:env/form:param[@name='agent_definition_blob']"/>
- </agent_definition_blob>
- </xsl:if>
- </root>
- </xts:transform>
- <!-- copy in the environment too - don't want it namespaced -->
- <xsl:for-each select="/root/command/*/form:env/form:param">
- <param name="{@name}">
- <xsl:value-of select="."/>
- </param>
- </xsl:for-each>
- </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="decodeReportAndContentOptions" dependency="decodeAgentDefinition" path="/ags/iFrmCmd/common/decodeReportOptions.xslt" processor="XSLT" type="exec" mandatory="false" condition=".[/root/agent_item[@type='report'] or /root/agent_item[@type='content'] or /root/agent_item[@type='index']]">
- <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 for cm
- ===============================================================================================
- -->
- <xts:block id="extractTaskParams" path= "/ags/iFrmCmd/common/extractTaskParams.xslt" dependency="decodeReportAndContentOptions" processor="XSLT" type="exec" mode="interpret"/>
- <!--
- ===============================================================================================
- doOverwriteAgent
- A block which removes(deletes) the old agent - ready for it to be recreated later on
- ===============================================================================================
- -->
- <xts:block id="doOverwriteAgent" dependency="extractTaskParams" processor="XSLT" type="exec">
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:form="http://developer.cognos.com/schemas/xts/ags/iFrmCmd/1/">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <!-- global application variables -->
- <xsl:template match="/">
- <xsl:apply-templates select="root/command/form:create/form:env"/>
- </xsl:template>
- <xsl:template match="form:env">
- <xsl:if test="form:param[@name='overwrite']">
- <xts:sequence>
- <xts:append>
- <send:request provider="xts">
- <xsl:element name="delete" namespace="http://developer.cognos.com/schemas/xts/ags/iFrmCmd/1/">
- <!-- we could pass everything through but we wont - only need the path to the agent -->
- <env xmlns="http://developer.cognos.com/schemas/xts/ags/iFrmCmd/1/">
- <param>
- <xsl:attribute name="name"><xsl:text>agent_path</xsl:text></xsl:attribute>
- <xsl:value-of select="concat(form:param[@name='m_p_path'], '/agentDefinition[@name="', form:param[@name='m_p_defaultName'], '"]')"/>
- </param>
- </env>
- </xsl:element>
- </send:request>
- </xts:append>
- </xts:sequence>
- </xsl:if>
- </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="doOverwriteAgent" 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:form="http://developer.cognos.com/schemas/xts/ags/iFrmCmd/1/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="cms xts send cm pf form xtsext">
- <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">
- <agentDefinition>
- <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
- <send:request provider="cm" requester="AGS:create">
- <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:agentDefinition>
- <!-- 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>
- <!-- set the default retention for the agentDefinition -->
- <!--<cm:retentions>
- <cm:retentionRule>
- <xsl:attribute name="objectClass"><xsl:text>history</xsl:text></xsl:attribute>
- <xsl:attribute name="prop"><xsl:text>creationTime</xsl:text></xsl:attribute>
- <xsl:attribute name="maxObjects"><xsl:text>5</xsl:text></xsl:attribute>
- </cm:retentionRule>
- </cm:retentions>-->
- <!-- create the default agent options -->
- <cm:options>
- <xsl:copy-of select="/root/agent_definition/agentOptions/options/value"/>
- </cm:options>
- </cm:agentDefinition>
- </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>
- </agentDefinition>
- </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>
- <!--
- ===============================================================================================
- 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:form="http://developer.cognos.com/schemas/xts/ags/iFrmCmd/1/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="cms xts send cm pf form xtsext">
- <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">
- <xsl:variable name="env" select="/root/command/form:create/form:env"/>
- <xts:sequence>
- <!-- prepare and send the add request -->
- <xts:append select="/root">
- <agentDefinitionReport>
- <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
- <send:request provider="cm" requester="AGS:create">
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <cm:add>
- <cm:search>
- <!-- attach the schedule onto the anget - not the report -->
- <xsl:value-of select="/root/agentDefinition/cm:addResponse/cm:agentDefinition/cm:searchPath"/>
- </cm:search>
- <cm:objects>
- <cm:report>
- <xsl:call-template name="addDefaultDescription"/>
- <cm:specification>
- <xsl:value-of select="form:param[@name='inlineSpec']"/>
- </cm:specification>
- <cm:metadataModel>
- <cm:model>
- <cm:searchPath>
- <!-- put the path to the model spec in -->
- <xsl:value-of select="form:param[@name='metaModel']"/>
- </cm:searchPath>
- </cm:model>
- </cm:metadataModel>
- <cm:metadataModelPackage>
- <cm:package>
- <cm:searchPath>
- <xsl:value-of select="substring-before(form:param[@name='metaModel'],'/model[')"/>
- </cm:searchPath>
- </cm:package>
- </cm:metadataModelPackage>
- </cm:report>
- </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>
- </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>
- <!--
- ===============================================================================================
- replaceScheduleCredentials - Replace exisitng credentials with current credentials. This is becuase we need to have the
- Credentials correct at save time.
- ===============================================================================================
- -->
- <xts:block id="replaceScheduleCredentials" type="exec" path="/ags/iFrmCmd/common/replaceScheduleCredentials.xslt" mode="interpret" processor="XSLT" dependency="doCreateAgentDefinitionReport" condition=".[/root/scheduleParameters]" mandatory="false">
- <!-- portal specific information-->
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <!-- Dialog specific logicsheets -->
- <xts:logicsheet path="logicsheets/presentation/dialog/templates.xsl"/>
- </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 replaceScheduleCredentials" 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: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/ags/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:key name="params" match="/root/command/*/form:env/form:param" use="@name"/>
- <xsl:template match="/">
- <xsl:if test="key('params','AgentTask-schedule')">
- <xts:sequence>
- <xts:append select="/root">
- <agentSchedule>
- <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
- <send:request provider="cm" requester="AGS:create">
- <bus:add>
- <search xsi:type="xsd:string">
- <!-- attach the schedule onto the anget - not the report -->
- <xsl:value-of select="/root/agentDefinition/cm:addResponse/cm:agentDefinition/cm:searchPath"/>
- </search>
- <!--objects xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:baseClass[1]">
- <xsl:copy-of select="/root/scheduleParameters/*"/>
- </objects-->
- <objects xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:baseClass[1]">
- <item xsi:type="bus:schedule">
- <xsl:copy-of select="/root/scheduleParameters/*[local-name()='item']/*"/>
- </item>
- </objects>
- </bus:add>
- </send:request>
- </xts:transform>
- </agentSchedule>
- </xts:append>
- </xts:sequence>
- </xsl:if>
- </xsl:template>
- <!-- pull in any templates to handle "special" properties on CM objects -->
- <cms:prop-save/>
- <xsl:template match="text()"/>
- </xsl:stylesheet>
- </xts:block>
- <!--
- a block which decodes the information email options
- ==============================================================================================
- -->
- <xts:block id="decodeTaskOptions" path="/ags/iFrmCmd/common/decodeTaskOptions.xslt" dependency="doCreateAgentDefinition" 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>
- <!--
- ================================================================================
- doCreateAgentSubObjects
-
- a block which creates all the subobjects which are allowed to be under the agent - sqlTask/WebTask
- ===============================================================================================
- -->
- <xts:block id="doCreateAgentSubObjects" dependency="decodeTaskOptions" 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: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/ags/iFrmCmd/1/" xmlns:agsh="http://developer.cognos.com/schemas/xts/logicsheets/xslt/ags/agsCmHelper/" exclude-result-prefixes="send xtsext form 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">
- <xsl:variable name="id" select="./id"/>
- <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/post-process.xslt" processor="XSLT">
- <send:request provider="cm" requester="AGS:create">
- <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:storedProcedureTask>
- <cm:searchPath>
- <!-- put the search path which was returned from the creation of the agentDefinition -->
- <xsl:value-of select="/root/agentDefinition/cm:addResponse/cm:agentDefinition/cm:searchPath"/>
- </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>
- <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>
- <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>
- <!-- just copy the options that we've got -->
- <xsl:copy-of select="/root/agent_item[@id = $id]/options"/>
- </cm:storedProcedureTask>
- </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>
- </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/post-process.xslt" processor="XSLT">
- <send:request provider="cm" requester="AGS:create">
- <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:webServiceTask>
- <cm:searchPath>
- <!-- put the search path which was returned from the creation of the agentDefinition -->
- <xsl:value-of select="/root/agentDefinition/cm:addResponse/cm:agentDefinition/cm:searchPath"/>
- </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>
- <cm:options>
- <xsl:attribute name="updateAction"><xsl:text>fail</xsl:text></xsl:attribute>
- </cm:options>
- </cm:add>
- </xts:transform>
- </send:request>
- </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/post-process.xslt" processor="XSLT">
- <send:request provider="cm" requester="AGS:create">
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <cm:add xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
- <cm:objects>
- <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="/root/agentDefinition/cm:addResponse/cm:agentDefinition/cm:searchPath"/>
- <xsl:with-param name="name" select="/root/agent_definition/items/item[./id=$id]/name"/>
- </xsl:call-template>
- </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>
- </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/post-process.xslt" processor="XSLT">
- <send:request provider="cm" requester="AGS:create">
- <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>
- <!-- put the search path which was returned from the creation of the agentDefinition -->
- <xsl:value-of select="/root/agentDefinition/cm:addResponse/cm:agentDefinition/cm:searchPath"/>
- </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>
- <cm:options>
- <xsl:attribute name="updateAction"><xsl:text>fail</xsl:text></xsl:attribute>
- </cm:options>
- </cm:add>
- </xts:transform>
- </send:request>
- </xts:transform>
- </agentTaskTarget>
- </xts:append>
- </xsl:when>
- <xsl:when test="/root/agent_definition/items/item[./id = $id]/type = 'notification' or /root/agent_definition/items/item[./id = $id]/type = 'approval' ">
- <xsl:variable name="taskIconPath"><xsl:value-of select="/root/agent_item[@id =$id]/taskOptions//*[local-name()='manualTask']/*[local-name()='taskIconPath']"/></xsl:variable>
- <xsl:if test="$taskIconPath=''">
- <xts:replace select="/root/agent_item[@id = '{$id}']/taskOptions//*[local-name()='manualTask']/*[local-name()='taskIconPath']">
- <taskIconPath>
- <xsl:call-template name="getHumanTaskIcon">
- <xsl:with-param name="item" select="/root/agent_definition/items/item[./id = $id]"/>
- </xsl:call-template>
- </taskIconPath>
- </xts:replace>
- </xsl:if>
- <!-- only create a url for the url objects -->
- <xts:append select="/root/agent_item[@id = '{$id}']">
- <agentTaskTarget>
- <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
- <send:request provider="cm" requester="AGS:create">
- <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>
- <!-- put the search path which was returned from the creation of the agentDefinition -->
- <xsl:value-of select="/root/agentDefinition/cm:addResponse/cm:agentDefinition/cm:searchPath"/>
- </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 icon URI - this should alter the icon in the portal -->
- <xsl:choose>
- <xsl:when test="/root/agent_definition/items/item[./id = $id]/type = 'notification'">
- <cm:iconURI>./ps/portal/images/icon_notification.gif</cm:iconURI>
- </xsl:when>
- <xsl:when test="/root/agent_definition/items/item[./id = $id]/type = 'approval'">
- <cm:iconURI>./ps/portal/images/icon_approval_task.gif</cm:iconURI>
- </xsl:when>
- </xsl:choose>
- <!-- 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">
- <xsl:copy-of select="/root/agent_item[@id = $id]/taskOptions"/>
- </xts:transform>
- </xts:transform>
- </cm:use>
- </cm:simpleParmValueItem>
- </cm:parameterValue>
- </cm:parameters>
- </cm:humanTask>
- </cm:objects>
- </cm:add>
- </xts:transform>
- </send:request>
- </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:template name="getHumanTaskIcon">
- <xsl:param name="item"/>
- <xsl:choose>
- <xsl:when test="$item/type = 'notification'">
- <xsl:text>ps/portal/images/icon_notification.gif</xsl:text>
- </xsl:when>
- <xsl:when test="$item/type = 'approval'">
- <xsl:text>ps/portal/images/icon_approval_task.gif</xsl:text>
- </xsl:when>
- </xsl:choose>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===============================================================================================
- doCreateAgentTasks
- A block which creates the report steps associated with the report actions
- ===============================================================================================
- -->
- <xts:block id="doCreateAgentTasks" dependency="doCreateAgentDefinitionReport doCreateAgentSchedule 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:form="http://developer.cognos.com/schemas/xts/ags/iFrmCmd/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 form send pf bus x SOAP-ENC 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="/">
- <xsl:variable name="env" select="/root/command/form:create/form:env"/>
- <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/post-process.xslt" processor="XSLT">
- <send:request provider="cm" requester="AGS:create">
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <xtscm:add>
- <xtscm:objects>
- <xtscm:agentTaskDefinition>
- <xtscm:searchPath>
- <!-- put the search path which was returned from the creation of the agentDefinition -->
- <xsl:value-of select="/root/agentDefinition/xtscm:addResponse/xtscm:agentDefinition/xtscm:searchPath"/>
- </xtscm:searchPath>
- <!-- 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='approval' or ./type='notification' ">
- <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:displaySequence>
- <xsl:value-of select="$position"/>
- </xtscm:displaySequence>
- <xtscm:taskObject>
- <xsl:choose>
- <xsl:when test="./type = 'report'">
- <xtscm:report>
- <xtscm:searchPath>
- <!-- put the path into the report that we selected as the action -->
- <xsl:value-of select="/root/agent_item[@id = $id]/param[@name='selected_path']"/>
- </xtscm:searchPath>
- </xtscm:report>
- </xsl:when>
- <xsl:when test="./type='sql'">
- <xtscm:storedProcedureTask>
- <xtscm:searchPath>
- <xsl:value-of select="/root/agent_item[@id = $id]/agentTaskTarget/xtscm:addResponse/xtscm:storedProcedureTask/xtscm:searchPath"/>
- </xtscm:searchPath>
- </xtscm:storedProcedureTask>
- </xsl:when>
- <xsl:when test="./type='web'">
- <xtscm:webServiceTask>
- <xtscm:searchPath>
- <xsl:value-of select="/root/agent_item[@id = $id]/agentTaskTarget/xtscm:addResponse/xtscm:webServiceTask/xtscm:searchPath"/>
- </xtscm:searchPath>
- </xtscm:webServiceTask>
- </xsl:when>
- <xsl:when test="./type = 'url'">
- <xtscm:baseRssTask>
- <xtscm:searchPath>
- <!-- put the path to the saved rss object as the path -->
- <xsl:value-of select="/root/agent_item[@id = $id]/agentTaskTarget/xtscm:addResponse/*/xtscm:searchPath"/>
- </xtscm:searchPath>
- </xtscm:baseRssTask>
- </xsl:when>
- <xsl:when test="./type = 'agent'">
- <xtscm:agentDefinition>
- <xtscm:searchPath>
- <!-- put the path into the report that we selected as the action -->
- <xsl:value-of select="/root/agent_item[@id = $id]/param[@name='selected_path']"/>
- </xtscm:searchPath>
- </xtscm:agentDefinition>
- </xsl:when>
- <xsl:when test="./type = 'job'">
- <xtscm:jobDefinition>
- <xtscm:searchPath>
- <!-- put the path into the report that we selected as the action -->
- <xsl:value-of select="/root/agent_item[@id = $id]/param[@name='selected_path']"/>
- </xtscm:searchPath>
- </xtscm:jobDefinition>
- </xsl:when>
- <xsl:when test="./type = 'import'">
- <xtscm:importDeployment>
- <xtscm:searchPath>
- <!-- put the path into import deployment -->
- <xsl:value-of select="/root/agent_item[@id = $id]/param[@name='selected_path']"/>
- </xtscm:searchPath>
- </xtscm:importDeployment>
- </xsl:when>
- <xsl:when test="./type = 'export'">
- <xtscm:exportDeployment>
- <xtscm:searchPath>
- <!-- put the path into export deployment -->
- <xsl:value-of select="/root/agent_item[@id = $id]/param[@name='selected_path']"/>
- </xtscm:searchPath>
- </xtscm:exportDeployment>
- </xsl:when>
- <xsl:when test="./type = 'index'">
- <xtscm:indexUpdateTask>
- <xtscm:searchPath>
- <!-- put the path into the index update task -->
- <xsl:value-of select="/root/agent_item[@id = $id]/param[@name='selected_path']"/>
- </xtscm:searchPath>
- </xtscm:indexUpdateTask>
- </xsl:when>
- <xsl:when test="./type = 'content'">
- <xtscm:contentTask>
- <xtscm:searchPath>
- <!-- put the path into the content task deployment -->
- <xsl:value-of select="/root/agent_item[@id = $id]/param[@name='selected_path']"/>
- </xtscm:searchPath>
- </xtscm:contentTask>
- </xsl:when>
- <xsl:when test="./type = 'metric'">
- <xtscm:baseDataIntegrationTask>
- <xtscm:searchPath>
- <!-- put the path into the metric task deployment -->
- <xsl:value-of select="/root/agent_item[@id = $id]/param[@name='selected_path']"/>
- </xtscm:searchPath>
- </xtscm:baseDataIntegrationTask>
- </xsl:when>
- <xsl:when test="./type = 'planningMacro'">
- <xtscm:planningMacroTask>
- <xtscm:searchPath>
- <!-- put the path into the metric task deployment -->
- <xsl:value-of select="/root/agent_item[@id = $id]/param[@name='selected_path']"/>
- </xtscm:searchPath>
- </xtscm:planningMacroTask>
- </xsl:when>
- <xsl:when test="./type = 'migration'">
- <xtscm:migrationTask>
- <xtscm:searchPath>
- <!-- put the path into the metric task deployment -->
- <xsl:value-of select="/root/agent_item[@id = $id]/param[@name='selected_path']"/>
- </xtscm:searchPath>
- </xtscm:migrationTask>
- </xsl:when>
- <xsl:when test="./type='notification' or ./type= 'approval'">
- <xtscm:humanTask>
- <xtscm:searchPath>
- <!-- put the path into the metric task deployment -->
- <xsl:value-of select="/root/agent_item[@id = $id]/agentTaskTarget/xtscm:addResponse/xtscm:humanTask/xtscm:searchPath"/>
- </xtscm:searchPath>
- </xtscm:humanTask>
- </xsl:when>
- <xsl:when test="./type='message'">
- <xtscm:memo>
- <xtscm:searchPath>
- <!-- put the path into the report that we selected as the action -->
- <xsl:value-of select="/root/agent_item[@id = $id]/agentTaskTarget/xtscm:addResponse/xtscm:memo/xtscm:searchPath"/>
- </xtscm:searchPath>
- </xtscm:memo>
- </xsl:when>
- </xsl:choose>
- </xtscm:taskObject>
- <!-- build the options - runOptions are normally in the env - the deliveryOptions are in a blob -->
- <xtscm:options>
- <!--xsl:call-template name="build_runOptions">
- <xsl:with-param name="env" select="/root/agent_item[@id = $id]"/>
- </xsl:call-template-->
- <!-- build the agent run options-->
- <xsl:variable name="taskId" select="./id"/>
- <xsl:variable name="agentItem" select="/root/agent_item[@id = $taskId]"/>
- <!--xsl:variable name="agentOptions" select="$agentItem/param[@name=starts-with(@name,'m_ao_')]"/-->
- <runOptions>
- <xsl:if test="$agentItem/options != ''">
- <xsl:copy-of select="$agentItem/options/*[local-name()='value']/*[local-name()='item']"/>
- </xsl:if>
- <!--xsl:for-each select="$agentOptions">
- <xsl:variable name="agentOptionName" select="substring-after(@name, 'm_ao_')"/>
- <xsl:if test="@name='m_ao_availableAsEmailAttachment'">
- <item xsi:type="cm:agentOptionBoolean">
- <name xsi:type="cm:agentOptionEnum">
- <xsl:value-of select="$agentOptionName"/>
- </name>
- <value xsi:type="xsd:boolean">
- <xsl:value-of select="."/>
- </value>
- </item>
- </xsl:if>
- </xsl:for-each-->
- </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 type="cm:parameterAssignmentDataItemArrayProp">
- <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>
- <xtscm:options>
- <xsl:attribute name="updateAction"><xsl:text>fail</xsl:text></xsl:attribute>
- <xtscm:returnProperties>
- <xtscm:property>storeID</xtscm:property>
- <xtscm:property>taskObject</xtscm:property>
- <xtscm:property>defaultName</xtscm:property>
- </xtscm:returnProperties>
- </xtscm:options>
- </xtscm:add>
- </xts:transform>
- </send:request>
- </xts:transform>
- </agentTask>
- </xts:append>
- </xsl:for-each>
- <xts:append>
- <!-- log to IPF-->
- <log>
- <xts:function name="ipflog">
- <xts:param name="indication">Audit.RTUsage</xts:param>
- <xts:param name="level">3</xts:param>
- <xts:param name="logData"><parameters><item name="email"><![CDATA[<xsl:value-of select="xtsext:xmlencode(string(/root/agent_item//item[contains(@*[local-name()='type'],'deliveryOptionAddressSMTPArray')]/value/item))"/>]]></item><item name="user"><![CDATA[<xsl:value-of select="xtsext:xmlencode(string(/root/session/param[@name ='e_user']))"/>]]></item><item name="agentpath"><![CDATA[<xsl:value-of select="xtsext:xmlencode(string(/root/session/param[@name ='e_mrootpath']))"/>]]></item></parameters></xts:param>
- <xts:param name="operation">CREATE</xts:param>
- <xts:param name="objectPath">
- <xsl:value-of select="/root/agentDefinition/xtscm:addResponse/xtscm:agentDefinition/xtscm:searchPath/text()"/>
- </xts:param>
- <xts:param name="objectType">AGENTDEFINITION</xts:param>
- <xts:param name="status">Success</xts:param>
- <xts:param name="errorMessage">N/A</xts:param>
- </xts:function>
- </log>
- </xts:append>
- </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>
- <!--
- ===============================================================================================
- doMemoHumanSubObjectsPostProcess (hack)
-
- a block which searches memo options, and humanTask parameter values and where agentReportTask tab ids are found, replaces with the storeID of
- the offending agentReportTask. WE don't know the dependencies now so we have to save items with task dependencies in 2 steps
- First - save everything - Second - update all tasks with references to other tasks and then update the object in CM
- ===============================================================================================
- -->
- <xts:block id="doMemoHumanSubObjectsPostProcess" dependency="doCreateAgentTasks" processor="XSLT" type="exec" condition="/root/agent_item" mandatory="false">
- <xts:logicsheet path="ags/logicsheets/agsCmHelper.xsl"/>
- <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:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="agsh xtsext">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="/">
- <xts:sequence>
- <!-- post-process all the memos -->
- <xsl:for-each select="/root/descendant::item[ancestor::agent_item[@type='message'] and contains(@*[local-name()='type'],'memoPartAgentObject')]">
- <!-- this is the hack - we need the report tab id, assume it is set in the memoPartObject -->
- <xsl:variable name="position" select="position()"/>
- <xsl:variable name="searchPath" select="searchPath"/>
- <xsl:variable name="agentReportTaskStoreID" select="/root/agent_item[@id=$searchPath]/agentTask/*[local-name()='addResponse']/*[local-name()='agentTaskDefinition']/*[local-name()='defaultName']"/>
- <!-- if we have a mapping - do the replace -->
- <xsl:if test="$agentReportTaskStoreID">
- <xts:replace xmlns:xts="http://developer.cognos.com/schemas/xts/" select="/root/descendant::item[ancestor::agent_item[@type='message'] and contains(@*[local-name()='type'],'memoPartAgentObject')][{position()}]/searchPath" mandatory="true">
- <searchPath>
- <xsl:copy-of select="$searchPath/@*"/>
- <xsl:value-of select="$agentReportTaskStoreID"/>
- </searchPath>
- </xts:replace>
- </xsl:if>
- </xsl:for-each>
- <!-- post-process all the human tasks with taskLinks -->
- <xsl:for-each select="/root/descendant::*[local-name()='taskLink'][ancestor::agent_item[@type='notification' or @type='approval']]">
- <!-- this is the hack - we need the report tab id, assume it is set in the memoPartObject -->
- <xsl:variable name="position" select="position()"/>
- <xsl:variable name="id" select="*[local-name()='id']"/>
- <xsl:variable name="agentReportTaskStoreID" select="/root/agent_item[@id=$id]/agentTask/*[local-name()='addResponse' or local-name()='updateResponse']/*[local-name()='agentTaskDefinition']/*[local-name()='defaultName']"/>
- <!-- if we have a mapping - do the replace -->
- <xsl:if test="$agentReportTaskStoreID">
- <xts:replace xmlns:xts="http://developer.cognos.com/schemas/xts/" select="/root/descendant::*[local-name()='taskLink'][ancestor::agent_item[@type='notification' or @type='approval']][{position()}]/*[local-name()='id']" mandatory="true">
- <impl:id xmlns:impl="http://www.ibm.com/xmlns/prod/cognos/internal/hts/_1">
- <xsl:copy-of select="$id/@*"/>
- <xsl:value-of select="$agentReportTaskStoreID"/>
- </impl:id>
- </xts:replace>
- </xsl:if>
- </xsl:for-each>
- <!-- post-process all the human tasks with futureTasks -->
- <xsl:for-each select="/root/descendant::*[local-name()='futureTask'][ancestor::agent_item[@type='notification' or @type='approval']]">
- <!-- this is the hack - we need the report tab id, assume it is set in the memoPartObject -->
- <xsl:variable name="position" select="position()"/>
- <xsl:variable name="id" select="*[local-name()='id']"/>
- <xsl:variable name="agentReportTaskStoreID" select="/root/agent_item[@id=$id]/agentTask/*[local-name()='addResponse' or local-name()='updateResponse']/*[local-name()='agentTaskDefinition']/*[local-name()='defaultName']"/>
- <!-- if we have a mapping - do the replace -->
- <xsl:if test="$agentReportTaskStoreID">
- <xts:replace xmlns:xts="http://developer.cognos.com/schemas/xts/" select="/root/descendant::*[local-name()='futureTask'][ancestor::agent_item[@type='notification' or @type='approval']][{position()}]/*[local-name()='id']" mandatory="true">
- <impl:id xmlns:impl="http://www.ibm.com/xmlns/prod/cognos/internal/hts/_1">
- <xsl:copy-of select="$id/@*"/>
- <xsl:value-of select="$agentReportTaskStoreID"/>
- </impl:id>
- </xts:replace>
- </xsl:if>
- </xsl:for-each>
- </xts:sequence>
- </xsl:template>
- <!--include template for converting storeID's into search paths -->
- <agsh:storeIDConverter/>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ================================================================================
- doUpdateAgentMemoHumanSubObjects
-
- a block which updates memo and human subobjects which are allowed to be under the agent
- ===============================================================================================
- -->
- <xts:block id="doUpdateAgentMemoHumanSubObjects" dependency="doMemoHumanSubObjectsPostProcess" processor="XSLT" type="exec" condition="/root/agent_item" mandatory="false">
- <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/ags/iFrmCmd/1/" exclude-result-prefixes="send xtsext form">
- <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:choose>
- <xsl:when test="/root/agent_definition/items/item[./id = $id]/type = 'message' ">
- <xts:replace select="/root/agent_item[@id = '{$id}']/agentTaskTarget">
- <agentTaskTarget>
- <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
- <send:request provider="cm" requester="AGS:create">
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <cm:update xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
- <cm:objects>
- <cm:memo>
- <cm:searchPath>
- <!-- put the search path which was returned from the phase(I) save -->
- <xsl:value-of select="/root/agent_item[@id = $id]/agentTaskTarget/cm:addResponse/cm:memo/cm:searchPath"/>
- </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>
- <cm:options>
- <xsl:attribute name="updateAction"><xsl:text>fail</xsl:text></xsl:attribute>
- </cm:options>
- </cm:update>
- </xts:transform>
- </send:request>
- </xts:transform>
- </agentTaskTarget>
- </xts:replace>
- </xsl:when>
- <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:replace select="/root/agent_item[@id = '{$id}']/agentTaskTarget">
- <agentTaskTarget>
- <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
- <send:request provider="cm" requester="AGS:create">
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <cm:update xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
- <cm:objects>
- <cm:humanTask>
- <cm:searchPath>
- <!-- put the search path which was returned from the creation of the agentDefinition -->
- <xsl:value-of select="/root/agent_item[@id = $id]/agentTaskTarget/cm:addResponse/cm:humanTask/cm:searchPath"/>
- </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">
- <xsl:copy-of select="/root/agent_item[@id = $id]/taskOptions"/>
- </xts:transform>
- </xts:transform>
- </cm:use>
- </cm:simpleParmValueItem>
- </cm:parameterValue>
- </cm:parameters>
- </cm:humanTask>
- </cm:objects>
- </cm:update>
- </xts:transform>
- </send:request>
- </xts:transform>
- </agentTaskTarget>
- </xts:replace>
- </xsl:when>
- </xsl:choose>
- </xsl:for-each>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===============================================================================================
- doSavePaths
- A block which saves all the search paths of the objects that we've created into the agent definition block
- ===============================================================================================
- -->
- <xts:block id="doSavePaths" dependency="doUpdateAgentMemoHumanSubObjects" processor="XSLT" type="exec">
- <xts:logicsheet path="ags/logicsheets/agsCmHelper.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:form="http://developer.cognos.com/schemas/xts/ags/iFrmCmd/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:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:agsh="http://developer.cognos.com/schemas/xts/logicsheets/xslt/ags/agsCmHelper/" xmlns:x="x" 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="form send cm pf bus agsh x SOAP-ENC xtsext xsi xts">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="/">
- <xsl:variable name="env" select="/root/command/form:create/form:env"/>
- <xts:sequence>
- <xsl:if test="/root/agentDefinition/cm:addResponse/cm:agentDefinition/cm:storeID">
- <!-- get rid of the path to start with -->
- <xts:delete select="/root/agent_definition/agentDefinition"/>
- <xts:append select="/root/agent_definition">
- <agentDefinition>
- <xsl:call-template name="storeIDConverter">
- <xsl:with-param name="storeID">
- <xsl:value-of select="/root/agentDefinition/cm:addResponse/cm:agentDefinition/cm:storeID"/>
- </xsl:with-param>
- </xsl:call-template>
- </agentDefinition>
- </xts:append>
- </xsl:if>
- <xsl:if test="/root/agentDefinitionReport/cm:addResponse/cm:report/cm:storeID">
- <!-- get rid of the path to start with -->
- <xts:delete select="/root/agent_definition/agentDefinitionReport"/>
- <xts:append select="/root/agent_definition">
- <agentDefinitionReport>
- <xsl:call-template name="storeIDConverter">
- <xsl:with-param name="storeID">
- <xsl:value-of select="/root/agentDefinitionReport/cm:addResponse/cm:report/cm:storeID"/>
- </xsl:with-param>
- </xsl:call-template>
- </agentDefinitionReport>
- </xts:append>
- </xsl:if>
- <xsl:if test="/root/agentSchedule/cm:addResponse/cm:schedule/cm:storeID">
- <xts:delete select="/root/agent_definition/agentSchedule"/>
- <xts:append select="/root/agent_definition">
- <agentSchedule>
- <xsl:call-template name="storeIDConverter">
- <xsl:with-param name="storeID">
- <xsl:value-of select="/root/agentSchedule/cm:addResponse/cm:schedule/cm:storeID"/>
- </xsl:with-param>
- </xsl:call-template>
- </agentSchedule>
- </xts:append>
- </xsl:if>
- <xsl:for-each select="/root/agent_item">
- <xsl:variable name="id" select="./@id"/>
- <!-- delete any previous task and target store ID's -->
- <xts:delete select="/root/agent_definition/items/item[id='{$id}']/taskStoreID"/>
- <xts:delete select="/root/agent_definition/items/item[id='{$id}']/targetStoreID"/>
- <!-- put the new ones in place -->
- <xts:append select="/root/agent_definition/items/item[id='{$id}']">
- <taskStoreID>
- <xsl:call-template name="storeIDConverter">
- <xsl:with-param name="storeID">
- <xsl:value-of select="./agentTask/cm:addResponse/cm:agentTaskDefinition/cm:storeID"/>
- </xsl:with-param>
- </xsl:call-template>
- </taskStoreID>
- <targetStoreID>
- <xsl:call-template name="storeIDConverter">
- <xsl:with-param name="storeID">
- <xsl:value-of select="./agentTask/cm:addResponse/cm:agentTaskDefinition/cm:taskObject/*/cm:storeID"/>
- </xsl:with-param>
- </xsl:call-template>
- </targetStoreID>
- </xts:append>
- </xsl:for-each>
- <!-- also don't want any deletedItems to remain -->
- <xts:delete select="/root/agent_definition/deletedItems"/>
- <xts:append select="/root/agent_definition">
- <deletedItems>
- </deletedItems>
- <!-- log to IPF-->
- <log>
- <xts:function name="ipflog">
- <xts:param name="indication">Audit.RTUsage</xts:param>
- <xts:param name="level">3</xts:param>
- <xts:param name="logData"><parameters><item name="email"><![CDATA[<xsl:value-of select="xtsext:xmlencode(string(/root/agent_item//item[contains(@*[local-name()='type'],'deliveryOptionAddressSMTPArray')]/value/item))"/>]]></item><item name="user"><![CDATA[<xsl:value-of select="xtsext:xmlencode(string(/root/session/param[@name ='e_user']))"/>]]></item><item name="agentpath"><![CDATA[<xsl:value-of select="xtsext:xmlencode(string(/root/session/param[@name ='e_mrootpath']))"/>]]></item></parameters></xts:param>
- <xts:param name="operation">CREATE</xts:param>
- <xts:param name="objectPath">
- <xsl:value-of select="/root/agentDefinition/cm:addResponse/cm:agentDefinition/cm:searchPath/text()"/>
- </xts:param>
- <xts:param name="objectType">AGENTDEFINITION</xts:param>
- <xts:param name="status">Success</xts:param>
- <xts:param name="errorMessage">N/A</xts:param>
- </xts:function>
- </log>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- <!--include template for converting storeID's into search paths -->
- <agsh:storeIDConverter/>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ================================================================================
- do the commandResults ???
- ================================================================================
- -->
- <xts:block id="commandResults" processor="XSLT" type="exec" mode="output" mimeType="text/xml" dependency="doSavePaths">
- <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/" exclude-result-prefixes="cm" version="1.0">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="/root">
- <response>
- <xsl:copy-of select="agent_definition"/>
- </response>
- </xsl:template>
- <xsl:template match="text()"/>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===============================================================================================
- faultHandler
- ===============================================================================================
- -->
- <xts:block id="faultHandler" 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">
- <error>
- <xsl:value-of select="//*[local-name() = 'messageString']"/>
- </error>
- </xsl:template>
- <xsl:template match="text()"/>
- </xsl:stylesheet>
- </xts:block>
- </xts:morphlet>
|