dialogAdapter.xts 97 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: AGS
  5. (C) Copyright IBM Corp. 2005, 2017
  6. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. -->
  8. <xts:morphlet xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="messages/AGS.xml,messages/portal.xml, messages/portalRL.xml" resolverBase="prompting" includeConfig="true" requiredCapability="canUseEventStudio">
  9. <!--
  10. ===============================================================================================
  11. formlogic_init - standard form logic initialization
  12. ===============================================================================================
  13. -->
  14. <xts:block id="formlogic_init" type="exec" mode="interpret" processor="XSLT" path="/logicsheets/formlogic_init.xslt"/>
  15. <!--
  16. ===============================================================================================
  17. restore_state - have been called from powerPlayService so we have to restore the state and extract the new prompt parameters
  18. ===============================================================================================
  19. -->
  20. <xts:block id="restore_state" processor="XSLT" dependency="formlogic_init" type="exec" condition=".[ /root/env/param[@name='opaque'] or /root/env/param[@name='ccstate']]" mandatory="false">
  21. <xts:logicsheet path="logicsheets/portal.xsl"/>
  22. <xsl:stylesheet version="1.0"
  23. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  24. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  25. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  26. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  27. xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
  28. exclude-result-prefixes="xsl pf xtsext xsi SOAP-ENC">
  29. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  30. <pf:variables/>
  31. <xsl:template match="/">
  32. <xts:sequence>
  33. <!-- save the value of this environment variable while we restore the <env> node -->
  34. <xsl:variable name="saved_parameters" select="key('env-param','m_parameter')"/>
  35. <xsl:variable name="saved_parameters_exists" select="boolean(key('env-param','m_parameter'))"/>
  36. <xsl:variable name="saved_m" select="key('env-param', 'm')"/>
  37. <xsl:variable name="saved_m_exists" select="boolean(key('env-param', 'm'))"/>
  38. <!-- restore the saved state -->
  39. <xts:replace select="/root/env">
  40. <env>
  41. <xts:transform name="XMLDecode">
  42. <xsl:choose>
  43. <!-- ccstate is returned from powerPlay when the user presses Cancel so unpack the state that is returned from ccstate -->
  44. <xsl:when test="/root/env/param[@name='ccstate']">
  45. <xsl:value-of select="xtsext:web64decode(string(xtsext:cafaction('sign_unwrap', string( key('env-param','ccstate')))), true())"/>
  46. </xsl:when>
  47. <!-- opaque is returned from powerPlay when the user presses OK. -->
  48. <xsl:otherwise>
  49. <xsl:value-of select="xtsext:web64decode(string(xtsext:cafaction('sign_unwrap', string( key('env-param','opaque')))), true())"/>
  50. </xsl:otherwise>
  51. </xsl:choose>
  52. </xts:transform>
  53. </env>
  54. </xts:replace>
  55. <!-- the saved environment might have an invalid value for m - so replace it -->
  56. <xsl:if test="$saved_m_exists">
  57. <xts:delete select="/root/env/param[@name='m']"/>
  58. <xts:append select="/root/env">
  59. <param name="m">
  60. <xsl:value-of select="$saved_m"/>
  61. </param>
  62. </xts:append>
  63. </xsl:if>
  64. <!-- restore the environment variable that was saved prior to restoring the <env> node -->
  65. <xsl:if test="$saved_parameters_exists">
  66. <xts:delete select="/root/env/param[@name='m_parameter']"/>
  67. <xts:append select="/root/env">
  68. <param name="m_parameter">
  69. <xsl:value-of select="$saved_parameters"/>
  70. </param>
  71. </xts:append>
  72. </xsl:if>
  73. <!-- clear some environment parameters from the restored state -->
  74. <xts:delete select="/root/env/param[@name='controller_state']"/>
  75. <xts:delete select="/root/env/param[@name='parameterDescription']"/> <!-- force generation of new parameter description -->
  76. <xts:delete select="/root/env/param[@name='cleared_prompts']"/>
  77. </xts:sequence>
  78. </xsl:template>
  79. </xsl:stylesheet>
  80. </xts:block>
  81. <!--
  82. ================================================================================
  83. create the user capabilities structure
  84. ===============================================================================================
  85. -->
  86. <xts:block id="buildCapabilities" dependency="restore_state" processor="XSLT" type="exec">
  87. <xts:logicsheet path="logicsheets/portal.xsl"/>
  88. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="xsl pf xts xtsext">
  89. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  90. <!-- pf:variables defines the user capabilities variables for Cognos 8 (amongst other useful things). Interested in these :
  91. userCanUseSched
  92. userCanUseAGS
  93. userCanUseCST
  94. userCanUseIndexSearch
  95. -->
  96. <pf:variables/>
  97. <xsl:template match="/">
  98. <xts:sequence>
  99. <xts:append select="/root">
  100. <userCapabilities>
  101. <value>
  102. <xsl:if test="$userCanUseSched">
  103. <item>
  104. <userCapability>canUseScheduling</userCapability>
  105. </item>
  106. </xsl:if>
  107. <xsl:if test="$userCanUseAGS">
  108. <item>
  109. <userCapability>canUseEventStudio</userCapability>
  110. </item>
  111. </xsl:if>
  112. <xsl:if test="$userCanUseCST">
  113. <item>
  114. <userCapability>canUseContentStoreTool</userCapability>
  115. </item>
  116. </xsl:if>
  117. <xsl:if test="$userCanUseIndexSearch">
  118. <item>
  119. <userCapability>canUseIndexSearch</userCapability>
  120. </item>
  121. </xsl:if>
  122. <xsl:if test="$hasMetricsManagerAdministrationCapability">
  123. <item>
  124. <userCapability>canUseMetricsManagerAdministration</userCapability>
  125. </item>
  126. </xsl:if>
  127. <xsl:if test="$userCanUsePlanningAdministration">
  128. <item>
  129. <userCapability>canUsePlanningAdministration</userCapability>
  130. </item>
  131. </xsl:if>
  132. </value>
  133. </userCapabilities>
  134. </xts:append>
  135. </xts:sequence>
  136. </xsl:template>
  137. </xsl:stylesheet>
  138. </xts:block>
  139. <!--
  140. ================================================================================
  141. decode the agent items
  142. ===============================================================================================
  143. -->
  144. <xts:block id="decode_agent_definition" dependency="buildCapabilities" processor="XSLT" type="exec">
  145. <xts:logicsheet path="logicsheets/presentation/dialog/templates.xsl"/>
  146. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  147. <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" exclude-result-prefixes="xsl xtsext xts">
  148. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  149. <xsl:template match="/">
  150. <xts:sequence>
  151. <xsl:choose>
  152. <xsl:when test="/root/env/param[@name = 'agent_definition_blob']">
  153. <!-- decode the agent items -->
  154. <xts:append select="/root">
  155. <xsl:value-of select="xtsext:web64decode( xtsext:cafaction('sign_unwrap_settemplatename_decodeagentdefinition_settemplateid_dialogadapter001', string( /root/env/param[@name = 'agent_definition_blob'])), true() )" disable-output-escaping="yes"/>
  156. </xts:append>
  157. <!-- get rid of the blob for the time being -->
  158. <xts:delete select="/root/env/param[@name = 'agent_definition_blob']"/>
  159. <xts:delete select="/root/env/param[@name='showAlert']" mandatory="false"/>
  160. </xsl:when>
  161. <xsl:otherwise>
  162. <!-- create an empty agent item -->
  163. <xts:append select="/root">
  164. <agent_definition>
  165. <sequencing>parallel</sequencing>
  166. <allowNotification>false</allowNotification>
  167. <notificationList/>
  168. <condition/>
  169. <schedule/>
  170. <deletedItems/>
  171. <items/>
  172. <agentOptions>
  173. <!-- create new default agent options-->
  174. <xts:transform src="transforms/portal/options/buildOptions.xslt" processor="XSLT">
  175. <root>
  176. <xts:transform src="transforms/portal/options/buildOptionItems.xslt" processor="XSLT">
  177. <root>
  178. <xts:transform name="XML" src="portal/options.xml"/>
  179. <optionType>runOptions</optionType>
  180. <optionType>powerPlay8Options</optionType> -->
  181. <env>
  182. <param name="m_ro_saveOutput">true</param>
  183. <param name="save_how">report</param>
  184. <param name="m_ro_prompt">false</param>
  185. <param name="m_ppro_prompt">false</param>
  186. <param name="m_pp8ro_prompt">false</param>
  187. </env>
  188. <genDefaults>false</genDefaults>
  189. </root>
  190. </xts:transform>
  191. </root>
  192. </xts:transform>
  193. </agentOptions>
  194. </agent_definition>
  195. </xts:append>
  196. </xsl:otherwise>
  197. </xsl:choose>
  198. </xts:sequence>
  199. </xsl:template>
  200. </xsl:stylesheet>
  201. </xts:block>
  202. <!--
  203. ===============================================================================================
  204. getPageData - create the request parameters for the content page
  205. ===============================================================================================
  206. -->
  207. <xts:block id="getPageData" dependency="decode_agent_definition" path="ags/navigator.xslt" processor="XSLT" type="exec"/>
  208. <!--
  209. ===============================================================================================
  210. Handle controller template results - some pages/condition/schedule/email are written in the controller_template form. This means
  211. we have to call them a second time to get the result
  212. ===============================================================================================
  213. -->
  214. <xts:block id="callControllerTemplateResults" path="/ags/callResultTemplate.xslt" dependency="getPageData" condition=".[(/root/env/param[@name='prevTabID']!=/root/env/param[@name='tabSelectedID']) or (/root/env/param[@name='agentItemOp']='remove') or (/root/env/param[@name='agentItemOp']='undo')]" mandatory="false" processor="XSLT" type="exec">
  215. <xts:logicsheet path="logicsheets/portal.xsl"/>
  216. </xts:block>
  217. <!--
  218. ===============================================================================================
  219. Handle controller template results - some pages/condition/schedule/email are written in the controller_template form. This means
  220. we have to call them a second time to get the result
  221. ===============================================================================================
  222. -->
  223. <xts:block id="handleControllerTemplateResults" path="/ags/handleResultTemplate.xslt" dependency="callControllerTemplateResults" condition=".[(/root/env/param[@name='prevTabID']!=/root/env/param[@name='tabSelectedID']) or (/root/env/param[@name='agentItemOp']='remove') or (/root/env/param[@name='agentItemOp']='undo')]" mandatory="false" processor="XSLT" type="exec">
  224. <xts:logicsheet path="logicsheets/portal.xsl"/>
  225. </xts:block>
  226. <!--
  227. ===============================================================================================
  228. Add additional info after task submission such as email has attachment or report has prompts
  229. ===============================================================================================
  230. -->
  231. <xts:block id="addTaskAdditionalInfo" type="exec" dependency="handleControllerTemplateResults" processor="XSLT" mandatory="false" condition=".[(/root/env/param[@name='prevTabID']!=/root/env/param[@name='tabSelectedID']) and (/root/env/param[@name='agentItemOp']!='remove') and (/root/env/param[@name='agentItemOp']!='undo')]">
  232. <xts:logicsheet path="logicsheets/portal.xsl"/>
  233. <xsl:stylesheet version="1.0" xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" exclude-result-prefixes="xts xsl xtsext pf">
  234. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  235. <!-- include the serialization code -->
  236. <pf:serialize-xml/>
  237. <pf:variables/>
  238. <xsl:template match="/">
  239. <xsl:variable name="prevTabID">
  240. <xsl:value-of select="/root/env/param[@name='prevTabID']"/>
  241. </xsl:variable>
  242. <xts:sequence>
  243. <!-- delete prev. info if found -->
  244. <xsl:if test="/root/agent_definition/items/item[id=$prevTabID]/type='message' or /root/agent_definition/items/item[id=$prevTabID]/type='report'">
  245. <xts:delete select="/root/agent_definition/items/item[id='{$prevTabID}']/addInfo" mandatory="false"/>
  246. </xsl:if>
  247. <!-- add additional information to the agent item -->
  248. <xsl:if test="/root/agent_definition/items/item[id=$prevTabID]/type='message' and /root/morphletResponse/hasAttachment='true'">
  249. <xts:append select="/root/agent_definition/items/item[id='{$prevTabID}']">
  250. <addInfo>hasAttachment</addInfo>
  251. </xts:append>
  252. </xsl:if>
  253. <xsl:if test="/root/agent_definition/items/item[id=$prevTabID]/type='report' and /root/env/param[@name='has_prompts']='true'">
  254. <xts:append select="/root/agent_definition/items/item[id='{$prevTabID}']">
  255. <addInfo>hasPrompts</addInfo>
  256. </xts:append>
  257. </xsl:if>
  258. <!-- clean env -->
  259. <xsl:if test="/root/agent_definition/items/item[id=$prevTabID]/type='report'">
  260. <xts:delete select="/root/env/param[@name='has_prompts']" />
  261. </xsl:if>
  262. </xts:sequence>
  263. </xsl:template>
  264. </xsl:stylesheet>
  265. </xts:block>
  266. <!--
  267. ===============================================================================================
  268. Correct the task name if required ... the agent task action names which are now not specified by
  269. user and are taken from task property
  270. for Email it is subject, report .. report name, webservice - operation name, SQL - proc name etc.
  271. thus in order to avoid duplicate names we need to manage these names and we do it by putting a
  272. sequence number at the end of task name
  273. ===============================================================================================
  274. -->
  275. <xts:block id="manageTaskNameBlock" path="/ags/manageTaskName.xslt" dependency="addTaskAdditionalInfo" mandatory="false" processor="XSLT" type="exec">
  276. <xts:logicsheet path="logicsheets/portal.xsl"/>
  277. </xts:block>
  278. <!--
  279. ===============================================================================================
  280. Save the agent action info. The encoded contents will be stored in /root/env/param[@name='<action>']. where the action is
  281. the contents of /root/env/param[@name='prevTabID'] which can be schedule/message/agent/job/report.
  282. Once the individual elements have been saved into the environment they will be removed.
  283. ===============================================================================================
  284. -->
  285. <xts:block id="storePreviousTab" path="/ags/storeTabTemplate.xslt" dependency="manageTaskNameBlock" mandatory="false" condition=".[(/root/env/param[@name='prevTabID'] != /root/env/param[@name='tabSelectedID']) or (/root/env/param[@name='agentItemOp']='remove') or (/root/env/param[@name='agentItemOp']='undo')]" processor="XSLT" type="exec">
  286. <xts:logicsheet path="logicsheets/portal.xsl"/>
  287. </xts:block>
  288. <!--
  289. ================================================================================
  290. add a new item into the tasks if we wanted to
  291. ===============================================================================================
  292. -->
  293. <xts:block id="add_new_task" type="exec" dependency="storePreviousTab" processor="XSLT" mandatory="false" condition=".[/root/env/param[@name='newTaskType']!='']">
  294. <xts:logicsheet path="logicsheets/portal.xsl"/>
  295. <xsl:stylesheet version="1.0" xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" exclude-result-prefixes="xts xsl xtsext pf">
  296. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  297. <!-- include the serialization code -->
  298. <pf:serialize-xml/>
  299. <pf:variables/>
  300. <xsl:template match="/">
  301. <xsl:variable name="newTaskType">
  302. <xsl:value-of select="/root/env/param[@name='newTaskType']"/>
  303. </xsl:variable>
  304. <xsl:variable name="task_guid">
  305. <xsl:value-of select="xtsext:generateGUID()"/>
  306. </xsl:variable>
  307. <xsl:variable name="task_id">
  308. <xsl:value-of select="concat('AgentTask-', string($task_guid))"/>
  309. </xsl:variable>
  310. <xsl:variable name="task_name">
  311. <xsl:call-template name="buildTaskName">
  312. <!-- should this be localized - it's going to show up in the UI -->
  313. <xsl:with-param name="baseName">
  314. <xsl:choose>
  315. <!-- any extraneous new lines gotten included in string here removed beow by normalize-space()-->
  316. <xsl:when test="$newTaskType='url'">
  317. <xts:string id="AGS_URL_WTASK"/>
  318. </xsl:when>
  319. <xsl:when test="$newTaskType='web'">
  320. <xts:string id="AGS_WEB_WTASK"/>
  321. </xsl:when>
  322. <xsl:when test="$newTaskType='sql'">
  323. <xts:string id="AGS_SQL_WTASK"/>
  324. </xsl:when>
  325. <xsl:when test="$newTaskType='message'">
  326. <xts:string id="AGS_EMAIL_WTASK"/>
  327. </xsl:when>
  328. <xsl:when test="$newTaskType='report'">
  329. <xts:string id="AGS_REPORT_WTASK"/>
  330. </xsl:when>
  331. <xsl:when test="$newTaskType='job'">
  332. <xts:string id="AGS_JOB_WTASK"/>
  333. </xsl:when>
  334. <xsl:when test="$newTaskType='agent'">
  335. <xts:string id="AGS_AGENT_WTASK"/>
  336. </xsl:when>
  337. <xsl:when test="$newTaskType='import'">
  338. <xts:string id="AGS_IMPORT_WTASK"/>
  339. </xsl:when>
  340. <xsl:when test="$newTaskType='export'">
  341. <xts:string id="AGS_EXPORT_WTASK"/>
  342. </xsl:when>
  343. <xsl:when test="$newTaskType='index'">
  344. <xts:string id="AGS_INDEX_WTASK"/>
  345. </xsl:when>
  346. <xsl:when test="$newTaskType='content'">
  347. <xts:string id="AGS_CONTENT_MANAGEMENT_WTASK"/>
  348. </xsl:when>
  349. <xsl:when test="$newTaskType='metric'">
  350. <xts:string id="AGS_METRIC_WTASK"/>
  351. </xsl:when>
  352. <xsl:when test="$newTaskType='planningMacro'">
  353. <xts:string id="AGS_PLANNING_MACRO_WTASK"/>
  354. </xsl:when>
  355. <xsl:when test="$newTaskType='migration'">
  356. <xts:string id="AGS_MIGRATION_WTASK"/>
  357. </xsl:when>
  358. <xsl:when test="$newTaskType='approval'">
  359. <xts:string id="AGS_APPROVAL_REQUEST"/>
  360. </xsl:when>
  361. <xsl:when test="$newTaskType='notification'">
  362. <xts:string id="AGS_NOTIFICATION_REQUEST"/>
  363. </xsl:when>
  364. <!-- space to add any other changes -->
  365. <xsl:otherwise>
  366. <xsl:value-of select="$newTaskType"/>
  367. </xsl:otherwise>
  368. </xsl:choose>
  369. </xsl:with-param>
  370. <xsl:with-param name="suffix">
  371. <xsl:text>0</xsl:text>
  372. </xsl:with-param>
  373. </xsl:call-template>
  374. </xsl:variable>
  375. <xsl:if test="$newTaskType != ''">
  376. <xts:sequence>
  377. <xts:append select="/root/agent_definition/items">
  378. <item>
  379. <id>
  380. <xsl:value-of select="$task_id"/>
  381. </id>
  382. <type>
  383. <xsl:value-of select="$newTaskType"/>
  384. </type>
  385. <name>
  386. <xsl:value-of select="$task_name"/>
  387. </name>
  388. <!-- New task filter is not set yet-->
  389. <taskLevelFilter/>
  390. <runCondition>runOnSuccess</runCondition>
  391. <!-- add in the default suppression when creating the item -->
  392. <xsl:if test="/root/agent_definition/suppressionSet != ''">
  393. <suppression>
  394. <param name="Filter_new">new</param>
  395. <param name="Filter_changed">changed</param>
  396. <param name="Filter_unchanged">unchanged</param>
  397. </suppression>
  398. </xsl:if>
  399. </item>
  400. </xts:append>
  401. <!-- create the parameter for the task -->
  402. <xts:append select="/root/env">
  403. <param name="taskName">
  404. <xsl:value-of select="$task_name"/>
  405. </param>
  406. </xts:append>
  407. <!-- we also want to create a blob for the entry and update the task name to a default value -->
  408. <xsl:variable name="serialized_task">
  409. <xsl:call-template name="serialize-xml">
  410. <!-- hopefully - this will pick up on the appended item and put it in there too -->
  411. <xsl:with-param name="node-set" select="/root/env/param[@name=$task_name]"/>
  412. </xsl:call-template>
  413. </xsl:variable>
  414. <!-- build the task blob -->
  415. <xts:append select="/root/env">
  416. <param name="{$task_id}">
  417. <xsl:value-of select="xtsext:cafaction( concat('sign_wrap_setpassportid_', $passport, '_settemplatename_addnewtask_settemplateid_dialogadapter002'), xtsext:web64encode( string( $serialized_task ), true()))"/>
  418. </param>
  419. </xts:append>
  420. <xsl:if test="/root/env/param[@name='tabSelectedID'] = /root/env/param[@name='newTaskType']">
  421. <xts:delete select="/root/env/param[@name='tabSelectedID']"/>
  422. <xts:append select="/root/env">
  423. <param name="tabSelectedID">
  424. <xsl:value-of select="$task_id"/>
  425. </param>
  426. </xts:append>
  427. </xsl:if>
  428. </xts:sequence>
  429. </xsl:if>
  430. </xsl:template>
  431. <!-- mini template to generate a unique task name -->
  432. <xsl:template name="buildTaskName">
  433. <xsl:param name="baseName"/>
  434. <xsl:param name="suffix"/>
  435. <!-- build the task name we want -->
  436. <xsl:variable name="taskName">
  437. <xsl:value-of select="normalize-space($baseName)"/>
  438. <xsl:if test="number($suffix) != 0">
  439. <!-- append the suffix -->
  440. <xsl:value-of select="$suffix"/>
  441. </xsl:if>
  442. </xsl:variable>
  443. <xsl:choose>
  444. <xsl:when test="/root/agent_definition/items/item[./name=$taskName]">
  445. <xsl:call-template name="buildTaskName">
  446. <xsl:with-param name="baseName">
  447. <xsl:value-of select="normalize-space($baseName)"/>
  448. </xsl:with-param>
  449. <xsl:with-param name="suffix">
  450. <xsl:value-of select="string(number($suffix)+1)"/>
  451. </xsl:with-param>
  452. </xsl:call-template>
  453. </xsl:when>
  454. <xsl:otherwise>
  455. <xsl:value-of select="$taskName"/>
  456. </xsl:otherwise>
  457. </xsl:choose>
  458. </xsl:template>
  459. </xsl:stylesheet>
  460. </xts:block>
  461. <!--
  462. ===============================================================================================
  463. generate default email
  464. ===============================================================================================
  465. -->
  466. <xts:block id="generateDefaultEmail" dependency="add_new_task" processor="XSLT" type="exec" mandatory="false" condition=".[/root/env/param[@name='newTaskType']='message']">
  467. <xts:logicsheet path="logicsheets/portal.xsl"/>
  468. <xts:logicsheet path="logicsheets/presentation/dialog/controller-templates.xsl"/>
  469. <xsl:stylesheet version="1.0"
  470. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  471. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  472. xmlns:dlgctrl="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/controller-templates/"
  473. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  474. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  475. exclude-result-prefixes="xts xsl xtsext dlgctrl">
  476. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  477. <!-- get the number of agent items that we're going to be dealing with -->
  478. <xsl:template match="/">
  479. <xts:sequence>
  480. <dlgctrl:XTS2Request>
  481. <dlgctrl:target>/ags/email_options_ags.xts</dlgctrl:target>
  482. <dlgctrl:stackName>email_options</dlgctrl:stackName>
  483. <dlgctrl:requestState>email|genDefault</dlgctrl:requestState>
  484. <dlgctrl:resultNode>messageDefaults</dlgctrl:resultNode>
  485. </dlgctrl:XTS2Request>
  486. <xts:delete select="/root/messageDefaults/options/value/item/name[.='subject']/.." mandatory="false"/>
  487. </xts:sequence>
  488. </xsl:template>
  489. </xsl:stylesheet>
  490. </xts:block>
  491. <!--
  492. ===============================================================================================
  493. generateDefaultEmail2
  494. ===============================================================================================
  495. -->
  496. <xts:block id="generateDefaultEmail2" dependency="generateDefaultEmail" processor="XSLT" type="exec" mandatory="false" condition=".[/root/env/param[@name='newTaskType']='message']">
  497. <xts:logicsheet path="logicsheets/portal.xsl"/>
  498. <xsl:stylesheet version="1.0"
  499. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  500. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  501. xmlns:dlgctrl="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/controller-templates/"
  502. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  503. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  504. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  505. exclude-result-prefixes="xts xsl xtsext dlgctrl pf">
  506. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  507. <!-- get the number of agent items that we're going to be dealing with -->
  508. <pf:serialize-xml/>
  509. <pf:variables/>
  510. <xsl:template match="/">
  511. <xts:sequence>
  512. <xsl:variable name="markup">
  513. <xsl:call-template name="serialize-xml">
  514. <xsl:with-param name="node-set" select="/root/messageDefaults"/>
  515. </xsl:call-template>
  516. </xsl:variable>
  517. <xts:append select="/root/env">
  518. <param name="options">
  519. <xsl:value-of select="xtsext:cafaction( concat('sign_wrap_setpassportid_', $passport, '_settemplatename_generateDefaultEmail2_settemplateid_dialogadapter612'), xtsext:web64encode( string( $markup ), true()))"/>
  520. </param>
  521. </xts:append>
  522. </xts:sequence>
  523. </xsl:template>
  524. </xsl:stylesheet>
  525. </xts:block>
  526. <!--
  527. ===============================================================================================
  528. Do any agent items operations
  529. ===============================================================================================
  530. -->
  531. <xts:block id="agent_definition_ops" dependency="generateDefaultEmail2" processor="XSLT" type="exec" mandatory="false" condition=".[/root/env/param[@name='agentItemOp']!='']">
  532. <xsl:stylesheet version="1.0" xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="xts xsl xtsext">
  533. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  534. <!-- get the number of agent items that we're going to be dealing with -->
  535. <xsl:variable name="num_agent_items" select="count(/root/agent_definition/items/item)"/>
  536. <xsl:variable name="agentItemOp" select="/root/env/param[@name = 'agentItemOp']"/>
  537. <xsl:template match="/">
  538. <xts:sequence>
  539. <!-- do what we have to do -->
  540. <xsl:choose>
  541. <!-- DO THE SHUFFLE OPERATION -->
  542. <xsl:when test="$agentItemOp = 'shuffle'">
  543. <xsl:variable name="id1" select="/root/env/param[@name='itemSelected']"/>
  544. <xsl:variable name="id2" select="/root/env/param[@name='itemNewLocation']"/>
  545. <!-- swap the nodes id1 and id2 -->
  546. <xsl:variable name="tempNode">
  547. <xsl:copy-of select="/root/agent_definition/items/item[./id=$id1]"/>
  548. </xsl:variable>
  549. <!-- delete it now -->
  550. <xts:delete select="/root/agent_definition/items/item[./id='{$id1}']"/>
  551. <!-- insert it before id2 -->
  552. <xts:insert select="/root/agent_definition/items/item[./id='{$id2}']" mandatory="true">
  553. <xsl:copy-of select="$tempNode"/>
  554. </xts:insert>
  555. </xsl:when>
  556. <xsl:when test="$agentItemOp = 'remove'">
  557. <xsl:variable name="delTab" select="/root/env/param[@name='tabSelectedID']"/>
  558. <xsl:choose>
  559. <xsl:when test="$delTab = 'AgentTask-condition'">
  560. <xts:delete select="/root/agent_definition/condition"/>
  561. <xts:delete select="/root/env/param[@name='Summary_condition']"/>
  562. </xsl:when>
  563. <xsl:when test="$delTab = 'AgentTask-schedule'">
  564. <xts:delete select="/root/agent_definition/schedule"/>
  565. <xts:delete select="/root/env/param[@name = '{$delTab}']"/>
  566. <!--
  567. delete schedule's massive params from ENV
  568. -->
  569. <xts:delete select="/root/env/param[starts-with(@name,'m_sp') or starts-with(@name,'p_sche') or
  570. @name='sub_type' or
  571. @name='scheduleParameters' or
  572. starts-with(@name,'txtDate')
  573. or starts-with(@name,'AMPM') or
  574. contains(@name,'stime')
  575. ]"/>
  576. </xsl:when>
  577. <xsl:otherwise>
  578. <xsl:for-each select="/root/agent_definition/items/item">
  579. <xsl:if test="./id = $delTab">
  580. <xts:append select="/root/agent_definition/deletedItems">
  581. <item>
  582. <position><xsl:value-of select="position()"/></position>
  583. <params>
  584. <xsl:value-of select="/root/env/param[@name = $delTab]"/>
  585. </params>
  586. <xsl:copy-of select="./*"/>
  587. </item>
  588. </xts:append>
  589. <!-- delete the item in the list -->
  590. <xts:delete select="/root/agent_definition/items/item[./id = '{$delTab}']"/>
  591. <!-- delete the associated data blob -->
  592. <xts:delete select="/root/env/param[@name = '{$delTab}']"/>
  593. <xsl:variable name="prevTabID" select="/root/env/param[@name='prevTabID']"/>
  594. <xts:update select="/root/env/param[@name='tabSelectedID']">
  595. <param name="tabSelectedID">
  596. <xsl:choose>
  597. <xsl:when test="$prevTabID ='' or $prevTabID =$delTab or $prevTabID ='AgentTask-schedule'">AgentTask-condition</xsl:when>
  598. <xsl:otherwise>
  599. <xsl:value-of select="$prevTabID"/>
  600. </xsl:otherwise>
  601. </xsl:choose>
  602. </param>
  603. </xts:update>
  604. </xsl:if>
  605. </xsl:for-each>
  606. </xsl:otherwise>
  607. </xsl:choose>
  608. </xsl:when>
  609. <xsl:when test="$agentItemOp = 'undo'">
  610. <xsl:if test="/root/agent_definition/deletedItems/item">
  611. <xsl:variable name="restoreTab" select="/root/agent_definition/deletedItems/item[last()]"/>
  612. <xsl:variable name="restoreTabId" select="$restoreTab/id"/>
  613. <xsl:choose>
  614. <xsl:when test="number($restoreTab/position) > count(/root/agent_definition/items/item)">
  615. <xts:append select="/root/agent_definition/items">
  616. <item>
  617. <xsl:copy-of select="$restoreTab/*[not(local-name()='position' or local-name()='params')] "/>
  618. </item>
  619. </xts:append>
  620. </xsl:when>
  621. <xsl:otherwise>
  622. <xts:insert select="/root/agent_definition/items/item[number('{$restoreTab/position}')]">
  623. <item>
  624. <xsl:copy-of select="$restoreTab/*[not(local-name()='position' or local-name()='params')] "/>
  625. </item>
  626. </xts:insert>
  627. </xsl:otherwise>
  628. </xsl:choose>
  629. <!--/xts:append-->
  630. <!-- restore the associated data blob -->
  631. <xts:append select="/root/env">
  632. <param name="{$restoreTabId}">
  633. <xsl:value-of select="$restoreTab/params"/>
  634. </param>
  635. </xts:append>
  636. <!-- delete the deleted item from the list -->
  637. <xts:delete select="/root/agent_definition/deletedItems/item[./id = '{$restoreTabId}']"/>
  638. <xts:update select="/root/env/param[@name='tabSelectedID']">
  639. <param name="tabSelectedID">
  640. <xsl:value-of select="$restoreTabId"/>
  641. </param>
  642. </xts:update>
  643. </xsl:if>
  644. </xsl:when>
  645. </xsl:choose>
  646. <!-- get rid of the agent item op -->
  647. <xts:delete select="/root/env/param[@name = 'agentItemOp']"/>
  648. </xts:sequence>
  649. <xts:sequence>
  650. <xts:append>
  651. <!-- log to IPF-->
  652. <log>
  653. <xts:function name="ipflog">
  654. <xts:param name="indication">Audit.RTUsage</xts:param>
  655. <xts:param name="level">3</xts:param>
  656. <xts:param name="logData">&lt;parameters&gt;&lt;item name=&quot;user&quot;&gt;&lt;![CDATA[<xsl:value-of select="xtsext:xmlencode(string(/root/session/param[@name ='e_user']))"/>]]&gt;&lt;/item&gt;&lt;item name=&quot;agentpath&quot;&gt;&lt;![CDATA[<xsl:value-of select="xtsext:xmlencode(string(/root/env/param[@name ='m_path']))"/>]]&gt;&lt;/item&gt;&lt;/parameters&gt;</xts:param>
  657. <xts:param name="operation">DELETE</xts:param>
  658. <xts:param name="objectPath">
  659. <xsl:value-of select="/root/env/param[@name = 'selected_path']"/>
  660. </xts:param>
  661. <xts:param name="objectType">AGENTTASKDEFINITION</xts:param>
  662. <xts:param name="status">Success</xts:param>
  663. <xts:param name="errorMessage">N/A</xts:param>
  664. </xts:function>
  665. </log>
  666. </xts:append>
  667. </xts:sequence>
  668. </xsl:template>
  669. </xsl:stylesheet>
  670. </xts:block>
  671. <!--
  672. ===============================================================================================
  673. restore the variables for the tab we are going to
  674. ===============================================================================================
  675. -->
  676. <xts:block id="restoreCurrentTab" type="exec" dependency="agent_definition_ops" processor="XSLT" mandatory="false" condition=".[/root/env/param[@name='prevTabID'] != /root/env/param[@name='tabSelectedID']]">
  677. <xsl:stylesheet version="1.0" xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="xts xsl xtsext">
  678. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  679. <xsl:template match="/">
  680. <xts:sequence>
  681. <!-- decode data for the current page, if available -->
  682. <xsl:variable name="currentTab">
  683. <xsl:value-of select="/root/env/param[@name ='tabSelectedID']"/>
  684. </xsl:variable>
  685. <!-- test if there is encoded tab information-->
  686. <xsl:if test="/root/env/param[@name=$currentTab] != ''">
  687. <xts:append select="/root/env">
  688. <xsl:choose>
  689. <xsl:when test="/root/env/param[@name ='tabSelectedID'] = 'AgentTask-condition'">
  690. <param name="AgentTask-condition">
  691. <xsl:value-of select="/root/env/param[@name=$currentTab]"/>
  692. </param>
  693. </xsl:when>
  694. <xsl:when test="/root/env/param[@name ='tabSelectedID'] = 'AgentTask-schedule'">
  695. <param name="scheduleParameters">
  696. <xsl:value-of select="/root/env/param[@name=$currentTab]"/>
  697. </param>
  698. </xsl:when>
  699. <xsl:otherwise>
  700. <!-- decode the tab information into the environment, this must be unwrapped using the cafaction command because each agent task blob is signed. A signed block will have a prefix 'CAFS'.
  701. If the cafaction command is not called here and CAF is enabled the web64decode will be ignored and the blob will not be expanded. -->
  702. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap_settemplatename_restorecurrenttab_settemplateid_dialogadapter001',string(/root/env/param[@name =$currentTab])), true())" disable-output-escaping="yes"/>
  703. </xsl:otherwise>
  704. </xsl:choose>
  705. </xts:append>
  706. <xts:delete select="/root/navigator"/>
  707. </xsl:if>
  708. </xts:sequence>
  709. </xsl:template>
  710. </xsl:stylesheet>
  711. </xts:block>
  712. <!--
  713. ===============================================================================================
  714. getPageData - create the request parameters for the content page
  715. ===============================================================================================
  716. -->
  717. <xts:block id="getPageData2" dependency="restoreCurrentTab" path="ags/navigator.xslt" processor="XSLT" type="exec"/>
  718. <!--
  719. ===============================================================================================
  720. decodeReportTasks- if the next page is of type 'message' then expand each report task. A temporary <reportTask>...</reportTask>
  721. structure is created that holds information that is passed into the email options page as a correctly formatted <req-params:param/>
  722. See the 'setMessageRequestParams' block for more details
  723. ==============================================================================================
  724. -->
  725. <xts:block id="decodeReportTasks" type="exec" processor="XSLT" dependency="getPageData2" condition=".[/root/agent_definition/items/item[type='report'] and (/root/agent_definition/items/item[type='message'] or /root/agent_definition/items/item[type='notification'] or /root/agent_definition/items/item[type='approval'])]" mandatory="false">
  726. <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" exclude-result-prefixes="xtsext xts xsl">
  727. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  728. <xsl:template match="/">
  729. <xsl:variable name="currentSelectedTaskId" select="/root/env/param[@name='tabSelectedID']"/>
  730. <xsl:variable name="currentSelectedTaskType" select="/root/agent_definition/items/item[id=$currentSelectedTaskId]/type"/>
  731. <xsl:if test="$currentSelectedTaskType='message' or $currentSelectedTaskType='notification' or $currentSelectedTaskType='approval'">
  732. <xts:sequence>
  733. <xts:append select="/root">
  734. <xsl:for-each select="/root/agent_definition/items/item[type='report']">
  735. <xsl:variable name="taskID" select="./id"/>
  736. <reportTask id="{$taskID}">
  737. <xts:transform name="XMLDecode">
  738. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(/root/env/param[@name=$taskID])), true())"/>
  739. </xts:transform>
  740. </reportTask>
  741. </xsl:for-each>
  742. </xts:append>
  743. </xts:sequence>
  744. </xsl:if>
  745. </xsl:template>
  746. </xsl:stylesheet>
  747. </xts:block>
  748. <!--
  749. ===============================================================================================
  750. setMessageRequestParams- create the message request parameter for each report task - this now applies to
  751. notification and approval tasks too
  752. ==============================================================================================
  753. -->
  754. <xts:block id="setMessageRequestParams" type="exec" processor="XSLT" dependency="decodeReportTasks" condition="/root/agent_definition/items/item[type='message'] or /root/agent_definition/items/item[type='notification'] or /root/agent_definition/items/item[type='approval']" mandatory="false">
  755. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:req-params="http://developer.cognos.com/schemas/request/params" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="xsl xts req-params xtsext">
  756. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  757. <xsl:template match="/">
  758. <xts:sequence>
  759. <xsl:variable name="currentSelectedTaskId" select="/root/env/param[@name='tabSelectedID']"/>
  760. <xsl:variable name="currentSelectedTaskType" select="/root/agent_definition/items/item[id=$currentSelectedTaskId]/type"/>
  761. <!-- only build the structures if we're in the right type of task -->
  762. <xsl:if test="$currentSelectedTaskType='message' or $currentSelectedTaskType='notification' or $currentSelectedTaskType='approval'">
  763. <!-- attach is built for all tasks -->
  764. <xts:append select="/root/navigator/page[@name='{$currentSelectedTaskType}']/params">
  765. <req-params:param name="attach">
  766. <eventOutput>
  767. <searchPath>eventOutput</searchPath>
  768. </eventOutput>
  769. <xsl:for-each select="/root/reportTask">
  770. <xsl:if test="./param[@name='selected_path']">
  771. <xsl:variable name='taskId' select="./@id"/>
  772. <xts:transform src="ags/transforms/attachment_request_params.xslt" processor="XSLT">
  773. <root>
  774. <id><xsl:value-of select="$taskId"/></id>
  775. <taskName><xsl:value-of select="/root/agent_definition/items/item[id=$taskId]/name"/></taskName>
  776. <xsl:value-of select="xtsext:web64decode( xtsext:cafaction('sign_unwrap_settemplatename_setmessagerequestparams_settemplateid_dialogadaptor001', string( ./param[@name ='reportOptions'])), true() )" disable-output-escaping="yes"/>
  777. <m_class><xsl:value-of select="./param[@name='m_class']"/></m_class>
  778. </root>
  779. </xts:transform>
  780. </xsl:if>
  781. </xsl:for-each>
  782. </req-params:param>
  783. <xsl:if test="$currentSelectedTaskType='notification' or $currentSelectedTaskType='approval' ">
  784. <req-params:param name="followingTaskList">
  785. <xsl:for-each select="/root/agent_definition/items/item[./id=$currentSelectedTaskId]/following-sibling::*">
  786. <futureTask>
  787. <display><xsl:value-of select="./name"/></display>
  788. <id><xsl:value-of select="./id"/></id>
  789. <taskType><xsl:value-of select="./type"/></taskType>
  790. </futureTask>
  791. </xsl:for-each>
  792. </req-params:param>
  793. </xsl:if>
  794. </xts:append>
  795. </xsl:if>
  796. <!-- tidy up the appended reportTask information -->
  797. <xts:delete select="/root/reportTask"/>
  798. </xts:sequence>
  799. </xsl:template>
  800. </xsl:stylesheet>
  801. </xts:block>
  802. <!--
  803. ===============================================================================================
  804. appendTargetStoreId
  805. ===============================================================================================
  806. -->
  807. <xts:block id="appendTargetStoreId" type="exec" processor="XSLT" dependency="setMessageRequestParams" condition=".[not(contains(' storedProcedureTask webServiceTask memo shortcutRSSTask urlRSSTask ', /root/agent_definition/items/item[id=/root/env/param[@name='tabSelectedID']]/type))]" mandatory="false">
  808. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:req-params="http://developer.cognos.com/schemas/request/params" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="xsl xts req-params xtsext">
  809. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  810. <xsl:template match="/">
  811. <xts:sequence>
  812. <xsl:if test="/root/env/param[@name = 'selected_path'] and /root/env/param[@name = 'selected_path'] != ''">
  813. <xsl:choose>
  814. <xsl:when test="/root/agent_definition/items/item[id=/root/env/param[@name='tabSelectedID']]/targetStoreID">
  815. <xts:replace select="/root/agent_definition/items/item[id=/root/env/param[@name='tabSelectedID']]/targetStoreID">
  816. <targetStoreID>
  817. <xsl:value-of select="/root/env/param[@name = 'selected_path']"/>
  818. </targetStoreID>
  819. </xts:replace>
  820. </xsl:when>
  821. <xsl:otherwise>
  822. <xts:append select="/root/agent_definition/items/item[id=/root/env/param[@name='tabSelectedID']]">
  823. <targetStoreID>
  824. <xsl:value-of select="/root/env/param[@name = 'selected_path']"/>
  825. </targetStoreID>
  826. </xts:append>
  827. </xsl:otherwise>
  828. </xsl:choose>
  829. </xsl:if>
  830. </xts:sequence>
  831. </xsl:template>
  832. </xsl:stylesheet>
  833. </xts:block>
  834. <!--
  835. ===============================================================================================
  836. If we have at least one human task then check if the agent has been set to submit the tasks sequentially. This is a prerequisite for
  837. an approval task.
  838. ===============================================================================================
  839. -->
  840. <xts:block id="checkForHumanTask" dependency="appendTargetStoreId" condition=".[(/root/agent_definition/items/item[type='approval'] or /root/agent_definition/items/item[type='notification']) and /root/agent_definition/sequencing!='sequential' and count(/root/agent_definition/items/item) &gt; 1]" processor="XSLT" type="exec" mandatory="false">
  841. <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" exclude-result-prefixes="xsl xtsext xts">
  842. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  843. <xsl:template match="/">
  844. <!-- the task is an approval so switch to sequential processing if not already done -->
  845. <xts:sequence>
  846. <xts:replace select="/root/agent_definition/sequencing">
  847. <sequencing>sequential</sequencing>
  848. </xts:replace>
  849. <xts:append select="/root/env">
  850. <param name="showAlert"><xts:string id="AGS_INFO_TASK_SUBMISSION_SEQUENTIAL" encode="javascript"/></param>
  851. </xts:append>
  852. </xts:sequence>
  853. </xsl:template>
  854. </xsl:stylesheet>
  855. </xts:block>
  856. <!--
  857. ================================================================================
  858. encode the agent items again
  859. ================================================================================
  860. -->
  861. <xts:block id="encode_agent_definition" dependency="checkForHumanTask" processor="XSLT" type="exec">
  862. <xts:logicsheet path="logicsheets/portal.xsl"/>
  863. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="xsl pf cm xts xtsext">
  864. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  865. <pf:serialize-xml/>
  866. <pf:variables/>
  867. <xsl:template match="/">
  868. <xts:sequence>
  869. <xsl:variable name="markup">
  870. <xsl:call-template name="serialize-xml">
  871. <xsl:with-param name="node-set" select="/root/agent_definition"/>
  872. </xsl:call-template>
  873. </xsl:variable>
  874. <xts:append select="/root/env">
  875. <param name="agent_definition_blob">
  876. <xsl:value-of select="xtsext:cafaction( concat('sign_wrap_setpassportid_', $passport, '_settemplatename_encodeagentdefinition_settemplateid_dialogadapter003'), xtsext:web64encode( string( $markup ), true()))"/>
  877. </param>
  878. </xts:append>
  879. </xts:sequence>
  880. </xsl:template>
  881. </xsl:stylesheet>
  882. </xts:block>
  883. <!--
  884. ===============================================================================================
  885. summarybar- render the summary bar HTML and place it in /root/summaryContent
  886. ===============================================================================================
  887. -->
  888. <xts:block id="summarybarVars" type="exec" processor="XSLT" mimeType="text/html" contentId="summaryContent" partId="1" dependency="encode_agent_definition">
  889. <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" exclude-result-prefixes="xsl xts xtsext">
  890. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  891. <xsl:template match="/">
  892. <xts:sequence>
  893. <xts:append select="/root">
  894. <sb>
  895. <param name="tabSelectedID">
  896. <xsl:value-of select="/root/env/param[@name='tabSelectedID']"/>
  897. </param>
  898. <param name="prevTabID">
  899. <xsl:value-of select="/root/env/param[@name='prevTabID']"/>
  900. </param>
  901. <param name="itemSelected">
  902. <xsl:value-of select="/root/env/param[@name='itemSelected']"/>
  903. </param>
  904. <param name="itemNewLocation">
  905. <xsl:value-of select="/root/env/param[@name='itemNewLocation']"/>
  906. </param>
  907. <param name="agentItemOp">
  908. <xsl:value-of select="/root/env/param[@name='agentItemOp']"/>
  909. </param>
  910. <param name="cafcontextid">
  911. <xsl:value-of select="/root/env/param[@name='cafcontextid']"/>
  912. </param>
  913. <param name="agsSave_m_app">
  914. <xsl:value-of select="/root/env/param[@name='agsSave_m_app']"/>
  915. </param>
  916. <param name="m_app">
  917. <xsl:value-of select="/root/env/param[@name='m_app']"/>
  918. </param>
  919. </sb>
  920. </xts:append>
  921. <xts:delete select="/root/env/param[@name='tabSelectedID']"/>
  922. <xts:delete select="/root/env/param[@name='prevTabID']"/>
  923. <xts:delete select="/root/env/param[@name='newTaskType']"/>
  924. <xts:delete select="/root/env/param[@name='itemSelected']"/>
  925. <xts:delete select="/root/env/param[@name='itemNewLocation']"/>
  926. <xts:delete select="/root/env/param[@name='agentItemOp']"/>
  927. <xts:delete select="/root/env/param[@name='cafcontextid']"/>
  928. <xts:delete select="/root/env/param[@name='hid']"/>
  929. <xts:delete select="/root/env/param[@name='agsSave_m_app']"/>
  930. <xts:delete select="/root/env/param[@name='m_app']"/>
  931. </xts:sequence>
  932. </xsl:template>
  933. </xsl:stylesheet>
  934. </xts:block>
  935. <!--
  936. ===============================================================================================
  937. summarybar- render the summary bar HTML and place it in /root/summaryContent
  938. ===============================================================================================
  939. -->
  940. <xts:block id="summarybar" path="/ags/summarybar.xslt" type="exec" mode="output" processor="XSLT" mimeType="text/html" contentId="summaryContent" partId="1" dependency="summarybarVars">
  941. <!-- stuff for the summaryBar -->
  942. <xts:logicsheet path="ags/logicsheets/agentDefinition.xsl"/>
  943. <!-- portal specific information -->
  944. <xts:logicsheet path="logicsheets/portal.xsl"/>
  945. <!-- presentation stuff -->
  946. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  947. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  948. </xts:block>
  949. <!--
  950. ===============================================================================================
  951. Process the suppression rules if need be, and prepare an html fragment that will then be used for any visible task.
  952. ===============================================================================================
  953. -->
  954. <xts:block id="processSuppression" path="/ags/processSuppression.xslt" dependency="summarybar" mandatory="false" processor="XSLT" type="exec">
  955. <xts:logicsheet path="ags/logicsheets/agentDefinition.xsl"/>
  956. <!-- portal specific information -->
  957. <xts:logicsheet path="logicsheets/portal.xsl"/>
  958. <!-- presentation stuff -->
  959. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  960. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  961. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  962. </xts:block>
  963. <!--
  964. ===============================================================================================
  965. callMorphlet - Calls the appropriate morphlet using the passed in params which will return
  966. markup to be displayed or the expected results
  967. ===============================================================================================
  968. -->
  969. <xts:block id="callMorphlet" processor="XSLT" type="exec" dependency="processSuppression">
  970. <!--xts:logicsheet path="ags/logicsheets/dialogs.xsl"/-->
  971. <xts:logicsheet path="ags/logicsheets/agentDefinition.xsl"/>
  972. <xts:logicsheet path="logicsheets/presentation/dialog/controller-templates.xsl"/>
  973. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:out="http://www.w3.org/1999/XSL/Transform" xmlns:agsad="http://developer.cognos.com/schemas/xts/logicsheets/xslt/ags/agentDefinition/" xmlns:dlgctrl="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/controller-templates/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:req-params="http://developer.cognos.com/schemas/request/params" xmlns:agsdlg="http://developer.cognos.com/schemas/xts/logicsheets/xslt/ags/dialog/" xmlns:xts="http://developer.cognos.com/schemas/xts/" exclude-result-prefixes="out agsad dlgctrl xtsext req-params agsdlg xts">
  974. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  975. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  976. <xsl:key name="request-param" match="/root/*[local-name()='requestParams']/*[local-name()='param']" use="@name"/>
  977. <xsl:template match="/">
  978. <!-- current controller_state -->
  979. <xsl:variable name="ctrl-template-controller-state">
  980. <xsl:choose>
  981. <xsl:when test="not(/root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'])">
  982. <xsl:choose>
  983. <xsl:when test="not(/root/env/param[@name='controller_state']) or /root/env/param[@name='controller_state']=''">
  984. <xsl:text>dialogAdaptor|markup</xsl:text>
  985. </xsl:when>
  986. <xsl:otherwise>
  987. <xsl:value-of select="/root/env/param[@name='controller_state']"/>
  988. </xsl:otherwise>
  989. </xsl:choose>
  990. </xsl:when>
  991. <xsl:otherwise>
  992. <xsl:value-of select="/root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState']"/>
  993. </xsl:otherwise>
  994. </xsl:choose>
  995. </xsl:variable>
  996. <!-- get the id of the selected tab -->
  997. <xsl:variable name="tabSelectedID" select="/root/sb/param[@name='tabSelectedID']"/>
  998. <!-- state that will be sent in the request. -->
  999. <xsl:variable name="ctrl-template-new-state">
  1000. <xsl:value-of select="substring-after($ctrl-template-controller-state,'|')"/>
  1001. </xsl:variable>
  1002. <!-- get the type of the selected tab - either the condition/summary/ or one of the agent/report/job etc types
  1003. tabSelectedID actually can hold either a type - or a task id. Have to handle both -->
  1004. <xsl:variable name="selTabType">
  1005. <xsl:choose>
  1006. <xsl:when test="not(/root/sb/param[@name='tabSelectedID']) or /root/sb/param[@name='tabSelectedID']=''">
  1007. <xsl:value-of select="/root/navigator/page[@default='true']/@name"/>
  1008. </xsl:when>
  1009. <!-- we have a reference to a task -->
  1010. <xsl:when test="/root/agent_definition/items/item[./id = $tabSelectedID]">
  1011. <xsl:value-of select="/root/agent_definition/items/item[./id = $tabSelectedID]/type"/>
  1012. </xsl:when>
  1013. <!-- we have a type - so use that -->
  1014. <xsl:otherwise>
  1015. <xsl:value-of select="/root/sb/param[@name='tabSelectedID']"/>
  1016. </xsl:otherwise>
  1017. </xsl:choose>
  1018. </xsl:variable>
  1019. <!-- get the name of the dialog that is to be loaded-->
  1020. <xsl:variable name="forwardLocation">
  1021. <xsl:value-of select="/root/navigator/page[@name=$selTabType]/link"/>
  1022. </xsl:variable>
  1023. <xsl:variable name="params">
  1024. <xsl:copy-of select="/root/navigator/page[@name='{$selTabType}']/params/*[local-name()='param']"/>
  1025. </xsl:variable>
  1026. <xts:sequence>
  1027. <!-- Call the morphlet -->
  1028. <xts:append select="/root">
  1029. <xts:request name="BUS" target="bus://xts2{$forwardLocation}" option="xml" outputHeader="true">
  1030. <req-params:requestParams>
  1031. <req-params:param name="requestState">
  1032. <xsl:value-of select="$ctrl-template-new-state"/>
  1033. </req-params:param>
  1034. <req-params:param name="suppressionDetails">
  1035. <xsl:value-of select="/root/suppressionDetails"/>
  1036. </req-params:param>
  1037. <req-params:param name="inWizard">
  1038. <xsl:text>false</xsl:text>
  1039. </req-params:param>
  1040. <req-params:param name="agentStudio">
  1041. <xsl:text>true</xsl:text>
  1042. </req-params:param>
  1043. <req-params:param name="tabSelectedID">
  1044. <xsl:value-of select="$tabSelectedID"/>
  1045. </req-params:param>
  1046. <req-params:param name="defaultTarget">
  1047. <xsl:text>ags/dialogAdapter.xts</xsl:text>
  1048. </req-params:param>
  1049. <req-params:param name="resultNode">
  1050. <xsl:text>morphletResponse</xsl:text>
  1051. </req-params:param>
  1052. <req-params:param name="hideEmailAsAttachment">
  1053. <xsl:text>true</xsl:text>
  1054. </req-params:param>
  1055. <req-params:param name="hideLinkToReport">
  1056. <xsl:text>true</xsl:text>
  1057. </req-params:param>
  1058. <req-params:param name="hideAttachMenu">
  1059. <xsl:text>false</xsl:text>
  1060. </req-params:param>
  1061. <req-params:param name="hideAddLinks">
  1062. <xsl:text>false</xsl:text>
  1063. </req-params:param>
  1064. <xsl:copy-of select="/root/navigator/page[@name=$selTabType]/params/*[local-name()='param']"/>
  1065. </req-params:requestParams>
  1066. <!-- env -->
  1067. <xsl:copy-of select="/root/env"/>
  1068. <!-- system -->
  1069. <xsl:copy-of select="/root/system"/>
  1070. <!-- take a copy of the user params too -->
  1071. <xsl:copy-of select="/root/user"/>
  1072. <!-- http -->
  1073. <xsl:copy-of select="/root/http"/>
  1074. <!-- session -->
  1075. <xsl:copy-of select="/root/session"/>
  1076. <!-- header -->
  1077. <xsl:copy-of select="/root/header"/>
  1078. <!-- credential -->
  1079. <xsl:copy-of select="/root/credential"/>
  1080. <!-- cookies-->
  1081. <xsl:copy-of select="/root/cookies"/>
  1082. </xts:request>
  1083. </xts:append>
  1084. </xts:sequence>
  1085. </xsl:template>
  1086. <agsad:taskSuppressionStateText/>
  1087. </xsl:stylesheet>
  1088. </xts:block>
  1089. <!--
  1090. ===============================================================================================
  1091. processReponse - Process the response from the callMorphlet block and either displays
  1092. the markup or processes the results
  1093. ===============================================================================================
  1094. -->
  1095. <xts:block id="processResponse" processor="XSLT" dependency="callMorphlet" type="exec">
  1096. <xts:logicsheet path="logicsheets/presentation/dialog/controller-templates.xsl"/>
  1097. <xts:logicsheet path="logicsheets/portal.xsl"/>
  1098. <xsl:stylesheet version="1.0"
  1099. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  1100. xmlns:dlgctrl="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/controller-templates/"
  1101. xmlns:xos="http://developer.cognos.com/schemas/xts/output/"
  1102. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  1103. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  1104. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  1105. exclude-result-prefixes="xsl dlgctrl xtsext xos xts pf">
  1106. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  1107. <pf:variables/>
  1108. <xsl:key name="request-param" match="/root/*[local-name()='requestParams']/*[local-name()='param']" use="@name"/>
  1109. <!-- get the output - not needed at the moment - but will be needed when we start calling Marcel pages -->
  1110. <!-- get the id of the selected tab -->
  1111. <xsl:variable name="tabSelectedID" select="/root/sb/param[@name='tabSelectedID']"/>
  1112. <!-- get the type of the tab - we need to mutate the output if we are on the email page -->
  1113. <xsl:variable name="selTabType">
  1114. <xsl:choose>
  1115. <xsl:when test="not(/root/sb/param[@name='tabSelectedID']) or /root/sb/param[@name='tabSelectedID']=''">
  1116. <xsl:value-of select="/root/navigator/page[@default='true']/@name"/>
  1117. </xsl:when>
  1118. <!-- we have a reference to a task -->
  1119. <xsl:when test="/root/agent_definition/items/item[./id = $tabSelectedID]">
  1120. <xsl:value-of select="/root/agent_definition/items/item[./id = $tabSelectedID]/type"/>
  1121. </xsl:when>
  1122. <!-- we have a type - so use that -->
  1123. <xsl:otherwise>
  1124. <xsl:value-of select="/root/sb/param[@name='tabSelectedID']"/>
  1125. </xsl:otherwise>
  1126. </xsl:choose>
  1127. </xsl:variable>
  1128. <!-- do the template -->
  1129. <xsl:template match="/">
  1130. <!-- create the output -->
  1131. <xts:sequence>
  1132. <xts:append select="/root/output/*[local-name()='part']/*[local-name()='entityBody']">
  1133. <xts:transform name="Null" option="content" mimeType="text/html" contentId="mainContent" partId="1">
  1134. <xts:transform processor="XSLT" src="ags/transforms/display_markup_fragment.xslt">
  1135. <root>
  1136. <markup>
  1137. <xts:transform name="XMLDecode">
  1138. <xsl:value-of select="/root/morphletResponse/markup"/>
  1139. </xts:transform>
  1140. </markup>
  1141. <!-- special case for hts tasks-->
  1142. <xsl:if test="$selTabType = 'message' or $selTabType = 'approval' or $selTabType = 'notification'">
  1143. <formFields>
  1144. <!--- do all variable maintainence in here - fixes problem with XML/HTML encoding from dialog adaptor -->
  1145. <input id="m" type="hidden" name="m" value="{/root/env/param[@name='m']}"/>
  1146. <input id="b_action" type="hidden" name="b_action" value="xts.run"/>
  1147. <input id="ps_nav_op" type="hidden" name="ps_nav_op" value="{/root/env/param[@name='ps_nav_op']}"/>
  1148. <input id="ps_nav_stack" type="hidden" name="ps_nav_stack" value="{/root/env/param[@name='ps_nav_stack']}"/>
  1149. <!-- this is straight from the utml:form source - ps_nav_source represents the page where we come from -
  1150. so it's always a copy of "m" -->
  1151. <input id="ps_nav_source" type="hidden" name="ps_nav_source" value="{/root/env/param[@name='m']}"/>
  1152. <!-- this is straight from the utml:form source - ps_nav_source represents the page where we come from -
  1153. so it's always a copy of "m" -->
  1154. <!-- lets persist the agent definition as well -->
  1155. <input id="agent_definition_blob" type="hidden" name="agent_definition_blob" value="{/root/env/param[@name='agent_definition_blob']}"/>
  1156. <xsl:for-each select="/root/env/param[starts-with(@name,'AgentTask-')]">
  1157. <input id="{./@name}" type="hidden" name="{./@name}" value="{.}"/>
  1158. </xsl:for-each>
  1159. <input id="m_path" type="hidden" name="m_path" value="{/root/env/param[@name='m_path']}"/>
  1160. <xsl:if test="not(/root/env/param[@name = 'm_app'])">
  1161. <input id="m_app" type="hidden" name="m_app" value="AS"/>
  1162. </xsl:if>
  1163. </formFields>
  1164. </xsl:if>
  1165. </root>
  1166. </xts:transform>
  1167. </xts:transform>
  1168. </xts:append>
  1169. <!-- a little bit of tidyage is needed here -->
  1170. <xts:delete select="/root/morphletResponse"/>
  1171. </xts:sequence>
  1172. </xsl:template>
  1173. </xsl:stylesheet>
  1174. </xts:block>
  1175. <!--
  1176. ===============================================================================================
  1177. render-page
  1178. ===============================================================================================
  1179. -->
  1180. <xts:block id="render-page" type="exec" mode="interpret" processor="XSLT" dependency="processResponse" mimeType="text/html">
  1181. <!-- portal specific information -->
  1182. <xts:logicsheet path="logicsheets/portal.xsl"/>
  1183. <xts:logicsheet path="ags/logicsheets/presentation.xsl"/>
  1184. <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
  1185. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  1186. <!-- Prevent the href from appearing in the status bar. -->
  1187. <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
  1188. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:edp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/ags/presentation/" xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/" xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/" xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/" xmlns:xos="http://developer.cognos.com/schemas/xts/output/" xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/" xmlns:xts="http://developer.cognos.com/schemas/xts/" exclude-result-prefixes="xsl pf xtsext edp dp df cf xos cp xts">
  1189. <pf:variables/>
  1190. <xsl:variable name="showAlert_exists" select="boolean(key('env-param', 'showAlert'))"/>
  1191. <!-- get the id of the selected tab -->
  1192. <xsl:variable name="tabSelectedID" select="/root/sb/param[@name='tabSelectedID']"/>
  1193. <xsl:variable name="selTabType">
  1194. <xsl:choose>
  1195. <xsl:when test="not(/root/sb/param[@name='tabSelectedID']) or /root/sb/param[@name='tabSelectedID']=''">
  1196. <xsl:value-of select="/root/navigator/page[@default='true']/@name"/>
  1197. </xsl:when>
  1198. <!-- we have a reference to a task -->
  1199. <xsl:when test="/root/agent_definition/items/item[./id = $tabSelectedID]">
  1200. <xsl:value-of select="/root/agent_definition/items/item[./id = $tabSelectedID]/type"/>
  1201. </xsl:when>
  1202. <!-- we have a type - so use that -->
  1203. <xsl:otherwise>
  1204. <xsl:value-of select="/root/sb/param[@name='tabSelectedID']"/>
  1205. </xsl:otherwise>
  1206. </xsl:choose>
  1207. </xsl:variable>
  1208. <xsl:template match="/root">
  1209. <!-- are we in a sub-morphlet call or not -->
  1210. <!-- we only display the summary bar for main requests. If we're in a sub-morphlet - from email page - we don't display it -->
  1211. <xsl:variable name="mainMorphlet" select="not(/root/env/param[@name='controller_state']) or /root/env/param[@name='controller_state']='' or string(xtsext:substringAfterLast(string(/root/env/param[@name='controller_state']), '|'))='canceled' or string(xtsext:substringAfterLast(string(/root/env/param[@name='controller_state']), '|'))='finished' "/>
  1212. <xts:sequence>
  1213. <xts:replace select="/root/output/*[local-name()='part']">
  1214. <xos:part>
  1215. <xos:entityHeader>
  1216. <xos:param name="Content-Type">text/html; charset=utf-8</xos:param>
  1217. </xos:entityHeader>
  1218. <xos:entityBody>
  1219. <xsl:text disable-output-escaping="yes">&lt;![CDATA[&lt;!DOCTYPE html&gt;]]&gt;&#10;</xsl:text>
  1220. <edp:evtpage initFunction="dialogAdapterInit">
  1221. <link rel="stylesheet" type="text/css" href="{$skin_style}"/>
  1222. <link rel="stylesheet" type="text/css" href="{$skin_fonts}"/>
  1223. <link rel="stylesheet" type="text/css" href="{$skin_root}/ags/ags.css"/>
  1224. <link rel="stylesheet" type="text/css" href="{$skin_root}/ags/crn.css"/>
  1225. <dp:meta>
  1226. <pf:meta/>
  1227. </dp:meta>
  1228. <script language="javascript">
  1229. function doDeletedAgentItems()
  1230. {
  1231. <xsl:for-each select="/root/agent_definition/deletedItems/item">
  1232. parent.getAgentItemsListener().removeAllReferencesById('<xsl:value-of select="xtsext:javascriptencode(string(./id))"/>');
  1233. </xsl:for-each>
  1234. }
  1235. function handleDeleteKeyDown(event) {
  1236. //delete key
  1237. if(parent.getKeyCode(event) == 46) {
  1238. parent.deleteSelectedItem();
  1239. }
  1240. return true;
  1241. }
  1242. </script>
  1243. <script language="javascript" src="{$webRoot}/cr1/caf.js"/>
  1244. <script language="javascript" src="{$webcontent}/portal/js/validation.js"/>
  1245. <script language="javascript">
  1246. var cafInvalidStringMsg = &quot;<xts:string id="IDS_VAL_ERR_INVALID_STRING" encode="javascript"/>&quot;;
  1247. var cafInvalidInteger = &quot;<xts:string id="IDS_VAL_ERR_INVALID_INTEGER" encode="javascript"/>&quot;;
  1248. var cafInvalidUnsignedInteger = &quot;<xts:string id="IDS_VAL_ERR_UNSIGNED_INTEGER" encode="javascript"/>&quot;;
  1249. var cafInvalidLength = &quot;<xts:string id="IDS_VAL_ERR_MAXIMUM_LENGTH" encode="javascript"/>&quot;;
  1250. <xsl:if test="$browser = 'ie'">
  1251. var cafGKeyPress = &quot;&quot;
  1252. function setGlobalKeyDownHandler(event)
  1253. {
  1254. cafGKeyPress = event.keyCode;
  1255. }
  1256. </xsl:if>
  1257. </script>
  1258. <xsl:choose>
  1259. <xsl:when test="$mainMorphlet">
  1260. <script type="text/javascript" src="../ags/drag.js"/>
  1261. <script type="text/javascript" src="../common/framework/notification/CObserver.js">//</script>
  1262. <script type="text/javascript" src="../common/framework/ui/CUIStyle.js">//</script>
  1263. <script type="text/javascript" src="../ags/common/CBar.js">//</script>
  1264. <script type="text/javascript" src="../ags/CMenuItem.js">//</script>
  1265. <script type="text/javascript" src="../ags/CMenu.js">//</script>
  1266. <script type="text/javascript" src="../ags/common/CIcon.js">//</script>
  1267. <script type="text/javascript" src="../ags/CToolbarButton.js">//</script>
  1268. <script type="text/javascript" src="../ags/help.js">//</script>
  1269. <script type="text/javascript" src="../ags/summarybar.js">//</script>
  1270. <script type="text/javascript" src="../ags/AccessibilityHandler.js">//</script>
  1271. <script type="text/javascript" src="../ags/CMenuExtractor.js">//</script>
  1272. <script language="javascript">
  1273. function dialogAdapterInit()
  1274. {
  1275. // if Loading pop-up is shown tell it to hide now
  1276. if(parent.cfgGet('loadwait')==true){
  1277. parent.doSetPopUpClosureFlag();
  1278. parent.cfgSet('loadwait', false);
  1279. }
  1280. if(parent.cfgGet('agsInit')==true){
  1281. parent.showLoadingMsg('100', '<xts:string id="AGS_LOADING_DONE" encode="javascript"/>');
  1282. setTimeout("parent.g_divProgressBar.F_Hide()", 300);
  1283. parent.cfgSet('agsInit', false);
  1284. parent.getFrame("metadataIFrame").focus();
  1285. }
  1286. // do the summaryBar init
  1287. setBarSize();
  1288. doDeletedAgentItems() ;
  1289. // now carry on the normal init procedure
  1290. if(window.init) init();
  1291. parent.deletionCandidateManager.setCandidate('tabSelectedID',parent.K_sControlCandidate);
  1292. //unblock deletion now its all calmed down
  1293. parent.applicationActionManager.allowActions();
  1294. // move to tab in focus, this must happen after allowing actions
  1295. setFocusToSelectedTab();
  1296. updateSuppressionMessage();
  1297. parent.cfgSet("isCurrentFailureTask",<xsl:value-of select="/root/suppressionDetails/@isCurrentFailureTask"/>);
  1298. //This function is used to fix scroll bar issue of dialogIFrame in Standards mode.
  1299. resetMargin();
  1300. //add the key down delete handler
  1301. var docco = parent.getMessageIFrame().document;
  1302. parent.addEvent(docco,"keydown",handleDeleteKeyDown);
  1303. //important to focus here otherwise the key press will not be detected
  1304. //immediately after a task is shown unless the user explicitly clicks
  1305. //in the task area
  1306. parent.getMessageIFrame().focus();
  1307. parent.getCommandStackManager().processCommandStack();
  1308. <xsl:if test="$showAlert_exists">
  1309. alert('<xsl:value-of select="/root/env/param[@name='showAlert']"/>');
  1310. </xsl:if>
  1311. }
  1312. function resetMargin(){
  1313. var elementArray = document.getElementsByTagName("body");
  1314. var iframeBody = elementArray[0];
  1315. iframeBody.style.margin = "0px";
  1316. }
  1317. function updateSuppressionMessage() {
  1318. var eventListTable = document.getElementById("eventListTable");
  1319. var msg = '<xsl:value-of select="xtsext:javascriptencode(string(/root/suppressionDetails))"/>';
  1320. if (eventListTable) {
  1321. eventListTable.parentNode.innerHTML = parent.decode(msg);
  1322. eventListTable.style.display = '';
  1323. }
  1324. }
  1325. </script>
  1326. </xsl:when>
  1327. <xsl:otherwise>
  1328. <script language="javascript">
  1329. function dialogAdapterInit()
  1330. {
  1331. //******************************
  1332. // NOTHING SHOULD BE ADDED HERE
  1333. //*****************************
  1334. // IN REALITY THIS CASE WILL APPLY
  1335. // WHEN YOU HAVE A POPUP ONLY.
  1336. // now carry on the normal init procedure
  1337. if(window.init) init();
  1338. }
  1339. </script>
  1340. </xsl:otherwise>
  1341. </xsl:choose>
  1342. <form name="pform" method="post" action="{$gateway}">
  1343. <!-- all tasks should have a help id-->
  1344. <input id="hid" type="hidden" name="hid" value="{/root/navigator/page[@name=$selTabType]/*[local-name()='params']/*[local-name()='param'][@name='hid']}"/>
  1345. <!-- main morphlet route means no pop-up is being shown -->
  1346. <xsl:choose>
  1347. <xsl:when test="$mainMorphlet">
  1348. <table cellpadding="0" cellspacing="0" width="100%" height="100%" border="0" role="presentation">
  1349. <tr valign="top" style="display:block;">
  1350. <td height="84px" style="width:100%;display:block;">
  1351. <div id="d1" style="width:100%; height:100%">
  1352. <!-- add in the summary bar -->
  1353. <xsl:copy-of select="output/xos:part/xos:entityBody/xos:content[@id = 'summaryContent']"/>
  1354. </div>
  1355. </td>
  1356. </tr>
  1357. <tr valign="top" style="display:block;">
  1358. <td height="2px" style="display:block;">
  1359. <img alt="" height="2" width="3" border="0" src="../ps/images/space.gif" title=""/>
  1360. </td>
  1361. </tr>
  1362. <tr valign="top">
  1363. <td valign="top">
  1364. <div id="d2" role="presentation" style="width:100%;height:100%;">
  1365. <!-- add in the other page information -->
  1366. <xsl:copy-of select="output/xos:part/xos:entityBody/xos:content[@id = 'mainContent']"/>
  1367. </div>
  1368. </td>
  1369. </tr>
  1370. </table>
  1371. </xsl:when>
  1372. <xsl:otherwise>
  1373. <!-- add in the summary bar -->
  1374. <xsl:copy-of select="output/xos:part/xos:entityBody/xos:content[@id = 'summaryContent']"/>
  1375. <!-- add in the other page information -->
  1376. <xsl:copy-of select="output/xos:part/xos:entityBody/xos:content[@id = 'mainContent']"/>
  1377. </xsl:otherwise>
  1378. </xsl:choose>
  1379. </form>
  1380. </edp:evtpage>
  1381. </xos:entityBody>
  1382. </xos:part>
  1383. </xts:replace>
  1384. </xts:sequence>
  1385. </xsl:template>
  1386. </xsl:stylesheet>
  1387. </xts:block>
  1388. <!--
  1389. ===============================================================================================
  1390. debug - display debug information
  1391. ===============================================================================================
  1392. -->
  1393. <xts:block id="debug" dependency="render-page" condition=".[/root/session/param[@name='debug']='1']" type="exec" mode="output" processor="XSLT" mandatory="false" mimeType="text/html">
  1394. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  1395. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dbg="http://developer.cognos.com/schemas/xts/logicsheets/xslt/debug/" exclude-result-prefixes="dbg">
  1396. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
  1397. <xsl:template match="/">
  1398. <dbg:dumpxml select="/root"/>
  1399. </xsl:template>
  1400. </xsl:stylesheet>
  1401. </xts:block>
  1402. </xts:morphlet>