123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: AGS
- (C) Copyright IBM Corp. 2005, 2019
- 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"/>
- <!--
- 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>
- <!--
- ===============================================================================================
- doUpdateAgentDefinition
- A block to update the agent definition if there is a change to condition spec or the eventKeys
- ===============================================================================================
- -->
- <xts:block id="doUpdateAgentDefinition" dependency="decodeTaskOptions" 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:xtscm="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 xtscm 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:save/form:env"/>
- </xsl:template>
- <xsl:template match="form:env">
- <!-- this is the class of the new object -->
- <xts:sequence>
- <xts:append select="/root">
- <agentDefinition>
- <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
- <send:request provider="cm" requester="AGS:save">
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <update xmlns="http://developer.cognos.com/schemas/xts-cm/1/">
- <xtscm:objects>
- <xtscm:agentDefinition>
- <xtscm:searchPath>
- <!-- put the search path for the agent definition -->
- <xsl:value-of select="/root/agent_definition/agentDefinition"/>
- </xtscm:searchPath>
- <!-- set the sequencing - this is part of the agent_definition -->
- <xtscm:sequencing>
- <xsl:value-of select="/root/agent_definition/sequencing"/>
- </xtscm:sequencing>
- <xtscm:allowNotification>
- <xsl:value-of select="/root/agent_definition/allowNotification"/>
- </xtscm:allowNotification>
- <!-- have to store the event key items -->
- <xtscm: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>
- </xtscm:eventKey>
- <!-- set the default retention for the agentDefinition -->
- <!--<xtscm:retentions>
- <xtscm:retentionRule>
- <xsl:attribute name="objectClass"><xsl:value-of select="'history'"/></xsl:attribute>
- <xsl:attribute name="prop"><xsl:value-of select="'creationTime'"/></xsl:attribute>
- <xsl:attribute name="maxObjects"><xsl:value-of select="'5'"/></xsl:attribute>
- </xtscm:retentionRule>
- </xtscm:retentions>-->
- <!-- not sure if this is needed at the moment - but the agentDefinition does have options -->
- <!-- 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="."/>
- <xsl:with-param name="jobStep" select="false()"/>
- </xsl:call-template-->
- <xsl:copy-of select="/root/agent_definition/agentOptions/options/value"/>
- </xtscm:options>
- </xtscm:agentDefinition>
- </xtscm:objects>
- <xtscm:options>
- <xsl:attribute name="updateAction"><xsl:text>fail</xsl:text></xsl:attribute>
- </xtscm:options>
- </update>
- </xts:transform>
- </send:request>
- </xts:transform>
- </agentDefinition>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- <cms:build_keyItems/>
- <cms:prop-save/>
- <xsl:template match="text()"/>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===========================================================================
- doRemoveNotificationList
- ===========================================================================
- -->
- <xts:block id="doRemoveNotificationList" dependency="doUpdateAgentDefinition" processor="XSLT" type="exec">
- <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:xtscm="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:x="x" 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:xts="http://developer.cognos.com/schemas/xts/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="form send xtscm pf bus x SOAP-ENC SOAP-ENV xsi xts xtsext">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="/">
- <xts:sequence>
- <xts:append>
- <testConnection>
- <xsl:if test="/root/agent_definition/removeNotificationList">
- <xts:request href="bus://dispatcher" protocol="BUS" responseEnvelope="true" option="xml-multipart" outputHeader="true">
- <xsl:attribute name="soapAction"><xsl:text>http://developer.cognos.com/schemas/deliveryService/1</xsl:text></xsl:attribute>
- <SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
- <SOAP-ENV:Header>
- <bus:biBusHeader xsi:type="bus:biBusHeader">
- <xsl:copy-of select="/root/header/bus:biBusHeader/*"/>
- </bus:biBusHeader>
- </SOAP-ENV:Header>
- <SOAP-ENV:Body>
- <bus:clearNotifications xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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">
- <objectPath xsi:type="bus:searchPathSingleObject">
- <xsl:value-of select="/root/agent_definition/agentDefinition"/>
- </objectPath>
- </bus:clearNotifications>
- </SOAP-ENV:Body>
- </SOAP-ENV:Envelope>
- </xts:request>
- </xsl:if>
- </testConnection>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===============================================================================================
- doUpdateAgentDefinitionReport
-
- A block which creates the report which provides the datasource for the agent. This is a subObject of the agentDefinition
- ===============================================================================================
- -->
- <xts:block id="doUpdateAgentDefinitionReport" dependency="doRemoveNotificationList" 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:xtscm="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="agsad cms xts send xtscm 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:save/form:env"/>
- </xsl:template>
- <xsl:template match="form:env">
- <xsl:variable name="env" select="/root/command/form:save/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:save">
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <xtscm:update>
- <xtscm:objects>
- <xtscm:report>
- <xtscm:searchPath>
- <!-- attach the schedule onto the anget - not the report -->
- <xsl:value-of select="/root/agent_definition/agentDefinitionReport"/>
- </xtscm:searchPath>
- <xsl:call-template name="addDefaultDescription"/>
- <xtscm:specification>
- <xsl:value-of select="form:param[@name='inlineSpec']"/>
- </xtscm:specification>
- <xtscm:metadataModel>
- <xtscm:model>
- <xtscm:searchPath>
- <!-- put the path to the model spec in -->
- <xsl:value-of select="form:param[@name='metaModel']"/>
- </xtscm:searchPath>
- </xtscm:model>
- </xtscm:metadataModel>
- <xtscm:metadataModelPackage>
- <xtscm:package>
- <xtscm:searchPath>
- <xsl:value-of select="substring-before(form:param[@name='metaModel'],'/model[')"/>
- </xtscm:searchPath>
- </xtscm:package>
- </xtscm:metadataModelPackage>
- </xtscm:report>
- </xtscm:objects>
- <xtscm:options>
- <xsl:attribute name="updateAction"><xsl:text>fail</xsl:text></xsl:attribute>
- </xtscm:options>
- </xtscm:update>
- </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>
- <agsad:conditionDisplayLogic/>
- <cms:prop-save/>
- <xsl:template match="text()"/>
- </xsl:stylesheet>
- </xts:block>
-
-
- <xts:block id="decodeScheduleParameters" type="exec" mode="interpret" processor="XSLT" dependency="doUpdateAgentDefinitionReport" mandatory="false">
- <!-- portal specific information-->
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <!-- Dialog specific logicsheets -->
- <xts:logicsheet path="logicsheets/presentation/dialog/templates.xsl"/>
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xts="http://developer.cognos.com/schemas/xts/"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" exclude-result-prefixes="xtsext cm">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="/">
- <xsl:variable name="scheduleStoreId"><xsl:value-of select="/root/scheduleParameters/item/storeID"/></xsl:variable>
-
- <xts:sequence>
- <xsl:if test="/root/scheduleParameters">
- <xts:replace select="/root/scheduleParameters">
- <xts:transform name="XMLDecode">
- <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap_settemplatename_scheduleController_settemplateid_save001',string(/root/env/param[@name='AgentTask-schedule'][last()])), true())"/>
- </xts:transform>
- </xts:replace>
-
- <xts:append select="/root/scheduleParameters/item">
- <storeID xsi:type="cm:guidProp" xmlns:xos="http://developer.cognos.com/schemas/xts/output/">
- <value xsi:type="cm:guid"><xsl:value-of select="$scheduleStoreId"/></value>
- </storeID>
- </xts:append>
- </xsl:if>
- </xts:sequence>
- </xsl:template>
- </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="decodeScheduleParameters" 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>
-
- <!--
- ===============================================================================================
- replaceScheduleCredentials - Replace exisitng credentials with current credentials. This is becuase we need to have the
- Credentials correct at save time.
- ===============================================================================================
- -->
- <xts:block id="removeScheduleOptions" dependency="replaceScheduleCredentials" processor="XSLT" type="exec">
- <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:delete select="/root/scheduleParameters/*[local-name()='item']/*[local-name()='options']"/>
- </xts:sequence>
- </xsl:if>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===============================================================================================
- doUpdateAgentSchedule
- A block to update the schedule for the agent
- ===============================================================================================
- -->
- <xts:block id="doUpdateAgentSchedule" dependency="doUpdateAgentDefinition removeScheduleOptions" 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:save">
- <bus:add>
- <search xsi:type="xsd:string">
- <!-- attach the schedule onto the agent -->
- <xsl:value-of select="/root/agent_definition/agentDefinition"/>
- </search>
- <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>
- <options xsi:type="bus:addOptions">
- <updateAction xsi:type="bus:updateActionEnum">update</updateAction>
- </options>
- </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>
- <!--
- ===============================================================================================
- doDeleteAgentTasks
- A block which deletes tasks and target objects
- ===============================================================================================
- -->
- <xts:block id="doDeleteAgentTasks" dependency="doUpdateAgentSchedule" processor="XSLT" type="exec" mandatory="false" condition="/root/agent_definition/deletedItems/item">
- <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:xtscm="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: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 xtscm pf bus x SOAP-ENC 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:save/form:env"/>
- <xts:sequence>
- <!-- do all the deletions of the step objects -->
- <xsl:if test="/root/agent_definition/deletedItems/item">
- <!-- Handle any deletes that are required -->
- <xts:append>
- <deletedSteps>
- <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
- <send:request provider="cm" requester="AGS:save">
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <delete xmlns="http://developer.cognos.com/schemas/xts-cm/1/">
- <xtscm:objects>
- <xsl:for-each select="/root/agent_definition/deletedItems/item">
- <xsl:if test="./taskStoreID != ''">
- <xtscm:agentTaskDefinition>
- <xtscm:searchPath>
- <xsl:value-of select="./taskStoreID"/>
- </xtscm:searchPath>
- </xtscm:agentTaskDefinition>
- </xsl:if>
- <xsl:if test="./targetStoreID !=''">
- <xsl:if test="./type = 'message' ">
- <xtscm:memo>
- <xtscm:searchPath>
- <xsl:value-of select="./targetStoreID"/>
- </xtscm:searchPath>
- </xtscm:memo>
- </xsl:if>
- <xsl:if test="./type = 'sql' ">
- <xtscm:storedProcedureTask>
- <xtscm:searchPath>
- <xsl:value-of select="./targetStoreID"/>
- </xtscm:searchPath>
- </xtscm:storedProcedureTask>
- </xsl:if>
- <xsl:if test="./type = 'url' ">
- <xtscm:baseRSSTask>
- <xtscm:searchPath>
- <xsl:value-of select="./targetStoreID"/>
- </xtscm:searchPath>
- </xtscm:baseRSSTask>
- </xsl:if>
- <xsl:if test="./type = 'web' ">
- <xtscm:webServiceTask>
- <xtscm:searchPath>
- <xsl:value-of select="./targetStoreID"/>
- </xtscm:searchPath>
- </xtscm:webServiceTask>
- </xsl:if>
- <xsl:if test="./type = 'notification' or ./type = 'approval' ">
- <xtscm:humanTask>
- <xtscm:searchPath>
- <xsl:value-of select="./targetStoreID"/>
- </xtscm:searchPath>
- </xtscm:humanTask>
- </xsl:if>
- </xsl:if>
- </xsl:for-each>
- </xtscm:objects>
- <xtscm:options>
- <xsl:attribute name="recursive"><xsl:text>true</xsl:text></xsl:attribute>
- <xsl:attribute name="force"><xsl:text>true</xsl:text></xsl:attribute>
- </xtscm:options>
- </delete>
- </xts:transform>
- </send:request>
- </xts:transform>
- </deletedSteps>
- </xts:append>
- <!-- delete the paths -->
- <xts:delete select="/root/agent_definition/deletedItems/item"/>
- </xsl:if>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ================================================================================
- doLoadCurrentTargets
- a block which loads information about the targets for objects which are being updated
- ===============================================================================================
- -->
- <xts:block id="doLoadCurrentTargets" dependency="doDeleteAgentTasks" 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:xtscm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:form="http://developer.cognos.com/schemas/xts/ags/iFrmCmd/1/" exclude-result-prefixes="send xtsext xtscm 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:if test="./targetStoreID != ''">
- <xts:append select="/root/agent_item[@id = '{$id}']">
- <currentTaskTarget>
- <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
- <send:request provider="cm" requester="AGS:save">
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <xtscm:query xmlns:xtscm="http://developer.cognos.com/schemas/xts-cm/1/">
- <xtscm:search>
- <xsl:value-of select="./targetStoreID"/>
- </xtscm:search>
- <xtscm:properties>
- <xtscm:property name="searchPath"/>
- <xtscm:property name="storeID"/>
- <xtscm:property name="objectClass"/>
- </xtscm:properties>
- </xtscm:query>
- </xts:transform>
- </send:request>
- </xts:transform>
- </currentTaskTarget>
- </xts:append>
- </xsl:if>
- </xsl:for-each>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ================================================================================
- doUpdateAgentSubObjects
-
- a block which updates the agentSubObject which are already in existance.
- ===============================================================================================
- -->
- <xts:block id="doUpdateAgentSubObjects" dependency="doLoadCurrentTargets" processor="XSLT" type="exec" condition="/root/agent_item" mandatory="false">
- <xts:logicsheet path="ags/logicsheets/agsCmHelper.xsl"/>
- <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:xtscm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:agsh="http://developer.cognos.com/schemas/xts/logicsheets/xslt/ags/agsCmHelper/" xmlns:form="http://developer.cognos.com/schemas/xts/ags/iFrmCmd/1/" exclude-result-prefixes="send xtsext xtscm agsh 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:variable name="operation">
- <xsl:choose>
- <xsl:when test="./taskStoreID">
- <xsl:text>update</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>add</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="searchPath">
- <xsl:choose>
- <xsl:when test="./taskStoreID">
- <xsl:value-of select="/root/agent_definition/items/item[./id=$id]/targetStoreID"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="/root/agent_definition/agentDefinition"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="./type='sql'">
- <!-- we should have got the search path for this item in the block above - so we have to run an update on this now -->
- <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:save">
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <xsl:element name="{$operation}" namespace="http://developer.cognos.com/schemas/xts-cm/1/">
- <xtscm:objects>
- <xtscm:storedProcedureTask>
- <xtscm:searchPath>
- <!-- put either the search path to the task (update) or search path the agent (add) -->
- <xsl:value-of select="$searchPath"/>
- </xtscm:searchPath>
- <!-- give the memo the name of the task -->
- <xtscm:defaultName>
- <xsl:value-of select="/root/agent_definition/items/item[./id=$id]/name"/>
- </xtscm:defaultName>
- <xtscm:storedProcedureName>
- <xsl:value-of select="/root/agent_item[@id = $id]/param[@name='sql_procedure_name']"/>
- </xtscm:storedProcedureName>
- <xsl:if test="/root/agent_item[@id = $id]/param[@name='sql_model']!=''">
- <xtscm:metadataModel>
- <xtscm:model>
- <xtscm:searchPath>
- <!-- put the path to the model spec in -->
- <xsl:value-of select="/root/agent_item[@id = $id]/param[@name='sql_model']"/>
- </xtscm:searchPath>
- </xtscm:model>
- </xtscm:metadataModel>
- </xsl:if>
- <xtscm:metadataModelPackage>
- <xtscm:package>
- <xtscm:searchPath>
- <!-- put the path to the model spec in -->
- <xsl:value-of select="/root/agent_item[@id = $id]/param[@name='sql_package']"/>
- </xtscm:searchPath>
- </xtscm:package>
- </xtscm:metadataModelPackage>
- <!-- just copy the options that we've got -->
- <xsl:copy-of select="/root/agent_item[@id = $id]/options"/>
- </xtscm:storedProcedureTask>
- </xtscm:objects>
- <xtscm:options>
- <xsl:attribute name="updateAction"><xsl:text>fail</xsl:text></xsl:attribute>
- </xtscm:options>
- </xsl:element>
- </xts:transform>
- </send:request>
- </xts:transform>
- </agentTaskTarget>
- </xts:append>
- </xsl:when>
- <xsl:when test="./type='url'">
- <xsl:variable name="task" select="/root/agent_item[@id=$id]"/>
- <xsl:variable name="replaceObject2">
- <xsl:choose>
- <xsl:when test="not(./taskStoreID)">
- <xsl:text>false</xsl:text>
- </xsl:when>
- <xsl:when test="$task/param[@name='url_uri'] = 'url_url'">
- <!-- check the object class in the returned target -->
- <xsl:if test="/root/agent_item[@id=$id]/currentTaskTarget/xtscm:queryResponse/*/xtscm:objectClass='urlRSSTask'">
- <xsl:text>false</xsl:text>
- </xsl:if>
- </xsl:when>
- <xsl:when test="$task/param[@name='url_uri'] = 'url_entry' or $task/param[@name='url_uri'] = 'url_eventList' ">
- <!-- check the object class in the returned target -->
- <xsl:if test="/root/agent_item[@id=$id]/currentTaskTarget/xtscm:queryResponse/*/xtscm:objectClass='shortcutRSSTask'">
- <xsl:text>false</xsl:text>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>true</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <!-- determine if we're replaceing or updating -->
- <xsl:variable name="replaceObject">
- <xsl:choose>
- <xsl:when test="not(./taskStoreID)">
- <xsl:text>false</xsl:text>
- </xsl:when>
- <xsl:when test="$task/param[@name='url_uri'] = 'url_url'">
- <!-- check the object class in the returned target -->
- <xsl:if test="/root/agent_item[@id=$id]/currentTaskTarget/xtscm:queryResponse/*/xtscm:objectClass='urlRSSTask'">
- <xsl:text>false</xsl:text>
- </xsl:if>
- </xsl:when>
- <xsl:when test="$task/param[@name='url_uri'] = 'url_entry'">
- <!-- check the object class in the returned target -->
- <xsl:if test="/root/agent_item[@id=$id]/currentTaskTarget/xtscm:queryResponse/*/xtscm:objectClass='shortcutRSSTask'">
- <xsl:text>false</xsl:text>
- </xsl:if>
- </xsl:when>
- <xsl:when test="$task/param[@name='url_uri'] = 'url_eventList'">
- <!-- check the object class in the returned target -->
- <xsl:if test="/root/agent_item[@id=$id]/currentTaskTarget/xtscm:queryResponse/*/xtscm:objectClass='shortcutAgentRSSTask'">
- <xsl:text>false</xsl:text>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>true</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <!-- either replace or create/update the object -->
- <xsl:choose>
- <xsl:when test="$replaceObject != 'false'">
- <send:request provider="cm" requester="AGS:save">
- <bus:delete xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <search xsi:type="xsd:string">
- <xsl:value-of select="/root/agent_definition/items/item[./id=$id]/targetStoreID"/>
- </search>
- <options xsi:type="bus:deleteOptions">
- <recursive xsi:type="xsd:boolean">true</recursive>
- <force xsi:type="xsd:boolean">true</force>
- </options>
- </bus:delete>
- </send:request>
- <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:save">
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <add xmlns="http://developer.cognos.com/schemas/xts-cm/1/">
- <xtscm:objects>
- <xsl:call-template name="rssTaskObject">
- <xsl:with-param name="task" select="$task"/>
- <xsl:with-param name="path" select="/root/agent_definition/agentDefinition"/>
- <xsl:with-param name="name" select="/root/agent_definition/items/item[./id = $id]/name"/>
- </xsl:call-template>
- </xtscm:objects>
- <xtscm:options>
- <xsl:attribute name="updateAction"><xsl:text>fail</xsl:text></xsl:attribute>
- </xtscm:options>
- </add>
- </xts:transform>
- </send:request>
- </xts:transform>
- </agentTaskTarget>
- </xts:append>
- </xsl:when>
- <xsl:otherwise>
- <!-- we should have got the search path for this item in the block above - so we have to run an update on this now -->
- <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:save">
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <xsl:element name="{$operation}" namespace="http://developer.cognos.com/schemas/xts-cm/1/">
- <xtscm:objects>
- <xsl:call-template name="rssTaskObject">
- <xsl:with-param name="task" select="$task"/>
- <!-- put either the search path to the task (update) or search path the agent (add) -->
- <xsl:with-param name="path" select="$searchPath"/>
- <xsl:with-param name="name" select="/root/agent_definition/items/item[./id = $id]/name"/>
- </xsl:call-template>
- </xtscm:objects>
- <xtscm:options>
- <xsl:attribute name="updateAction"><xsl:text>fail</xsl:text></xsl:attribute>
- </xtscm:options>
- </xsl:element>
- </xts:transform>
- </send:request>
- </xts:transform>
- </agentTaskTarget>
- </xts:append>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="./type='web'">
- <!-- we should have got the search path for this item in the block above - so we have to run an update on this now -->
- <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:save">
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <xsl:element name="{$operation}" namespace="http://developer.cognos.com/schemas/xts-cm/1/">
- <xtscm:objects>
- <xtscm:webServiceTask>
- <xtscm:searchPath>
- <!-- put either the search path to the task (update) or search path the agent (add) -->
- <xsl:value-of select="$searchPath"/>
- </xtscm:searchPath>
- <!-- give the memo the name of the task -->
- <xtscm:defaultName>
- <xsl:value-of select="/root/agent_definition/items/item[./id=$id]/name"/>
- </xtscm:defaultName>
- <xtscm:uri>
- <xsl:value-of select="/root/agent_item[@id = $id]/param[@name='url_wsdl']"/>
- </xtscm:uri>
- <xtscm:operationName>
- <xsl:value-of select="/root/agent_item[@id = $id]/param[@name='url_operation']"/>
- </xtscm:operationName>
- <xtscm:serviceName>
- <xsl:value-of select="/root/agent_item[@id = $id]/param[@name='url_serviceName']"/>
- </xtscm:serviceName>
- <xtscm:inputMessageName/>
- <xtscm:outputMessageName/>
- <xtscm:bindingName>
- <xsl:value-of select="/root/agent_item[@id = $id]/param[@name='url_port']"/>
- </xtscm:bindingName>
- <!-- just copy the options that we've got -->
- <xsl:copy-of select="/root/agent_item[@id = $id]/options"/>
- </xtscm:webServiceTask>
- </xtscm:objects>
- <xtscm:options>
- <xsl:attribute name="updateAction"><xsl:text>fail</xsl:text></xsl:attribute>
- </xtscm:options>
- </xsl:element>
- </xts:transform>
- </send:request>
- </xts:transform>
- </agentTaskTarget>
- </xts:append>
- </xsl:when>
- <xsl:when test="./type='message'">
- <!-- we should have got the search path for this item in the block above - so we have to run an update on this now -->
- <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:save">
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <xsl:element name="{$operation}" namespace="http://developer.cognos.com/schemas/xts-cm/1/">
- <xtscm:objects>
- <xtscm:memo>
- <xtscm:searchPath>
- <!-- put either the search path to the target (update) or search path the agent (add) -->
- <xsl:value-of select="$searchPath"/>
- </xtscm:searchPath>
- <!-- give the memo object the taskName of the object -->
- <xtscm:defaultName>
- <xsl:value-of select="/root/agent_definition/items/item[./id = $id]/name"/>
- </xtscm:defaultName>
- <!-- build the options - runOptions are normally in the env - the deliveryOptions are in a blob -->
- <!-- copy the options from the message step -->
- <xsl:copy-of select="/root/agent_item[@id=$id]/options"/>
- </xtscm:memo>
- </xtscm:objects>
- <xtscm:options>
- <xsl:attribute name="updateAction"><xsl:text>fail</xsl:text></xsl:attribute>
- </xtscm:options>
- </xsl:element>
- </xts:transform>
- </send:request>
- </xts:transform>
- </agentTaskTarget>
- </xts:append>
- </xsl:when>
- <xsl:when test="./type='notification' or ./type='approval'">
- <xsl:variable name="taskIconPath"><xsl:value-of select="/root/agent_item[@id=$id]/*[local-name()='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>
- <!-- we should have got the search path for this item in the block above - so we have to run an update on this now -->
- <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:save">
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <xsl:element name="{$operation}" namespace="http://developer.cognos.com/schemas/xts-cm/1/">
- <xtscm:objects>
- <xtscm:humanTask>
- <xtscm:searchPath>
- <!-- put either the search path to the target (update) or search path the agent (add) -->
- <xsl:value-of select="$searchPath"/>
- </xtscm:searchPath>
- <!-- give the memo the name of the task -->
- <xtscm:defaultName>
- <xsl:value-of select="/root/agent_definition/items/item[./id=$id]/name"/>
- </xtscm: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'">
- <xtscm:iconURI>./ps/portal/images/icon_notification.gif</xtscm:iconURI>
- </xsl:when>
- <xsl:when test="/root/agent_definition/items/item[./id = $id]/type = 'approval'">
- <xtscm:iconURI>./ps/portal/images/icon_approval_task.gif</xtscm:iconURI>
- </xsl:when>
- </xsl:choose>
- <!-- set the type of the task into the object - we need to know what type to resurrect it -->
- <xtscm:operationName>
- <xsl:value-of select="/root/agent_definition/items/item[./id = $id]/type"/>
- </xtscm:operationName>
- <xtscm:parameters>
- <xtscm:parameterValue>
- <xtscm:name>hts</xtscm:name>
- <xtscm:simpleParmValueItem>
- <xtscm:inclusive>false</xtscm:inclusive>
- <xtscm:display>hts</xtscm:display>
- <xtscm: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>
- </xtscm:use>
- </xtscm:simpleParmValueItem>
- </xtscm:parameterValue>
- </xtscm:parameters>
- </xtscm:humanTask>
- </xtscm:objects>
- <xtscm:options>
- <xsl:attribute name="updateAction"><xsl:text>fail</xsl:text></xsl:attribute>
- </xtscm:options>
- </xsl:element>
- </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>
- <!--
- ===============================================================================================
- doUpdateAgentTasks
- A block which updates the action steps
- ===============================================================================================
- -->
- <xts:block id="doUpdateAgentTasks" dependency="doUpdateAgentSubObjects" processor="XSLT" type="exec" mandatory="false" condition="/root/agent_item">
- <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:form="http://developer.cognos.com/schemas/xts/ags/iFrmCmd/1/" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/" xmlns:xtscm="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: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="cms form send xtscm pf bus x SOAP-ENC 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:save/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()"/>
- <xsl:variable name="operation">
- <xsl:choose>
- <xsl:when test="./taskStoreID != ''">
- <xsl:text>update</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>add</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="searchPath">
- <xsl:choose>
- <xsl:when test="./taskStoreID != ''">
- <xsl:value-of select="./taskStoreID"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="/root/agent_definition/agentDefinition"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <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:save">
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <xsl:element name="{$operation}" namespace="http://developer.cognos.com/schemas/xts-cm/1/">
- <xtscm:objects>
- <xtscm:agentTaskDefinition>
- <xtscm:searchPath>
- <!-- put either the search path to the task (update) or search path the agent (add) -->
- <xsl:value-of select="$searchPath"/>
- </xtscm:searchPath>
- <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 to either the object being updated - or the parent agentDefinition object if added -->
- <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>
- <!-- put the path into the sql proc that we selected as the action -->
- <xsl:value-of select="/root/agent_item[@id = $id]/agentTaskTarget//xtscm:searchPath"/>
- </xtscm:searchPath>
- </xtscm:storedProcedureTask>
- </xsl:when>
- <xsl:when test="./type = 'web'">
- <xtscm:webServiceTask>
- <xtscm:searchPath>
- <!-- put the path into the web service that we selected as the action -->
- <xsl:value-of select="/root/agent_item[@id = $id]/agentTaskTarget//xtscm:searchPath"/>
- </xtscm:searchPath>
- </xtscm:webServiceTask>
- </xsl:when>
- <xsl:when test="./type = 'url'">
- <xtscm:baseRSSTask>
- <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:searchPath"/>
- </xtscm:searchPath>
- </xtscm:baseRSSTask>
- </xsl:when>
- <xsl:when test="./type = 'agent'">
- <xtscm:agent>
- <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:agent>
- </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 = 'index'">
- <xtscm:indexUpdateTask>
- <xtscm:searchPath>
- <!-- put the path into import deployment -->
- <xsl:value-of select="/root/agent_item[@id = $id]/param[@name='selected_path']"/>
- </xtscm:searchPath>
- </xtscm:indexUpdateTask>
- </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 = '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>
- <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>
- <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>
- <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 report that we selected as the action -->
- <xsl:value-of select="/root/agent_item[@id = $id]/agentTaskTarget//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: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:with-param name="jobStep" select="true()"/>
- </xsl:call-template-->
- <!-- build the agent run options-->
- <xsl:variable name="agentItem" select="/root/agent_item[@id = $id]"/>
- <!--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 and assignments-->
- <xsl:call-template name="build_parameters">
- <xsl:with-param name="id" select="$id"/>
- </xsl:call-template>
- <xsl:call-template name="build_assignments">
- <xsl:with-param name="id" select="$id"/>
- </xsl:call-template>
- </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>
- </xsl:element>
- </xts:transform>
- </send:request>
- </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>
- <!--build the assignments prop for the agent task by id this is a bit roundabout... specially to a form used by preprocess.xslt-->
- <xsl:template name="build_assignments">
- <xsl:param name="id"/>
- <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>
- </xsl:template>
- <!--
- pull in any templates to handle "special" properties on CM objects
- -->
- <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>
- <!--
- ===============================================================================================
- 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="doUpdateAgentTasks" 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>
- <!-- pre-process all the memo tasks -->
- <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' 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::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>
- <!-- pre-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/human objects which are already there.
- ===============================================================================================
- -->
- <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:xtscm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:form="http://developer.cognos.com/schemas/xts/ags/iFrmCmd/1/" exclude-result-prefixes="send xtsext xtscm 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:if test="./type='message' or ./type='notification' or ./type='approval' ">
- <xsl:variable name="operation">
- <xsl:text>update</xsl:text>
- </xsl:variable>
- <xsl:variable name="searchPath">
- <xsl:value-of select="/root/agent_definition/items/item[./id=$id]/targetStoreID"/>
- </xsl:variable>
- <!-- we should have got the search path for this item in the block above - so we have to run an update on this now -->
- <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:save">
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <xsl:element name="{$operation}" namespace="http://developer.cognos.com/schemas/xts-cm/1/">
- <xtscm:objects>
- <xsl:choose>
- <xsl:when test="./type='message'">
- <!-- we should have got the search path for this item in the block above - so we have to run an update on this now -->
- <xtscm:memo>
- <xtscm:searchPath>
- <!-- put the search path which was returned from the phase(I) save -->
- <xsl:value-of select="/root/agent_item[@id = $id]/agentTaskTarget//xtscm:memo/xtscm:searchPath"/>
- </xtscm:searchPath>
- <!-- copy the options from the message step -->
- <xsl:copy-of select="/root/agent_item[@id=$id]/options"/>
- </xtscm:memo>
- </xsl:when>
- <xsl:when test="./type='notification' or ./type='approval'">
- <!-- we should have got the search path for this item in the block above - so we have to run an update on this now -->
- <xtscm:humanTask>
- <xtscm:searchPath>
- <!-- put the search path which was returned from the phase(I) save -->
- <xsl:value-of select="/root/agent_item[@id = $id]/agentTaskTarget//xtscm:humanTask/xtscm:searchPath"/>
- </xtscm:searchPath>
- <!-- update the parameters which might have changed -->
- <xtscm:parameters>
- <xtscm:parameterValue>
- <xtscm:name>hts</xtscm:name>
- <xtscm:simpleParmValueItem>
- <xtscm:inclusive>false</xtscm:inclusive>
- <xtscm:display>hts</xtscm:display>
- <xtscm: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>
- </xtscm:use>
- </xtscm:simpleParmValueItem>
- </xtscm:parameterValue>
- </xtscm:parameters>
- </xtscm:humanTask>
- </xsl:when>
- </xsl:choose>
- </xtscm:objects>
- <xtscm:options>
- <xsl:attribute name="updateAction"><xsl:text>fail</xsl:text></xsl:attribute>
- </xtscm:options>
- </xsl:element>
- </xts:transform>
- </send:request>
- </xts:transform>
- </agentTaskTarget>
- </xts:replace>
- </xsl:if>
- </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:xtscm="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 xtscm pf bus agsh x SOAP-ENC xtsext xsi">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <!-- Handle any agentTaskDefinitions adds that are required -->
- <xsl:template match="/">
- <xsl:variable name="env" select="/root/command/form:save/form:env"/>
- <xts:sequence>
- <!-- need to replace the schedule information -->
- <xsl:if test="/root/agentSchedule/xtscm:addResponse/xtscm:schedule/xtscm:storeID">
- <!-- delete and append - maybe the case we have no schedule defined already -->
- <xts:delete select="/root/agent_definition/agentSchedule"/>
- <xts:append select="/root/agent_definition/agentSchedule">
- <agentSchedule>
- <xsl:call-template name="storeIDConverter">
- <xsl:with-param name="storeID">
- <xsl:value-of select="/root/agentSchedule/xtscm:addResponse/xtscm:schedule/xtscm: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/*[local-name()='addResponse' or local-name()='updateResponse']/xtscm:agentTaskDefinition/xtscm:storeID"/>
- </xsl:with-param>
- </xsl:call-template>
- </taskStoreID>
- <targetStoreID>
- <xsl:call-template name="storeIDConverter">
- <xsl:with-param name="storeID">
- <xsl:value-of select="./agentTask/*[local-name()='addResponse' or local-name()='updateResponse']/xtscm:agentTaskDefinition/xtscm:taskObject/*/xtscm:storeID"/>
- </xsl:with-param>
- </xsl:call-template>
- </targetStoreID>
- </xts:append>
- </xsl:for-each>
- </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:xtscm="http://developer.cognos.com/schemas/xts-cm/1/" version="1.0" exclude-result-prefixes="xtscm">
- <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="ignore" 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>
|