summaryBarUpdate.xts 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373
  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, 2009
  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. decodeAgentDefinitionBlob - Decode the agent definition blob and then append the agent_definition here so we can create the tasks.
  18. ===============================================================================================
  19. -->
  20. <xts:block id="decodeAgentDefinitionBlob" dependency="formlogic_init" processor="XSLT" type="exec" condition=".[/root/env/param[@name = 'agent_definition_blob'] and /root/env/param[@name = 'agent_definition_blob']!='']" mandatory="false" nodelist="env,agent_definition">
  21. <xts:logicsheet path="logicsheets/presentation/dialog/controller-templates.xsl"/>
  22. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  23. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="xsl xtsext">
  24. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  25. <xsl:template match="/">
  26. <xts:sequence>
  27. <xts:append select="/root">
  28. <xsl:value-of select="xtsext:web64decode( xtsext:cafaction('sign_unwrap_settemplatename_decodeagentdefinitionblob_settemplateid_summarybarupdate001', string( /root/env/param[@name = 'agent_definition_blob'])), true() )" disable-output-escaping="yes"/>
  29. </xts:append>
  30. </xts:sequence>
  31. </xsl:template>
  32. </xsl:stylesheet>
  33. </xts:block>
  34. <!--
  35. ===============================================================================================
  36. decodeItems - Decode the ordered task id list
  37. The new ordering is specified by the following xml :
  38. <items>
  39. <item id='id1"/>
  40. <item id='id3"/>
  41. <item id='id2"/>
  42. <item id='id5"/>
  43. <item id='id4"/>
  44. </items>
  45. ===============================================================================================
  46. -->
  47. <xts:block id="decodeItems" nodelist="env" processor="XSLT" type="exec" condition=".[/root/env/param[@name = 'item2move']]" dependency="decodeAgentDefinitionBlob" mandatory="false">
  48. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  49. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  50. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  51. version="1.0" exclude-result-prefixes="xts xtsext">
  52. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  53. <xsl:template match="/">
  54. <xts:sequence>
  55. <!-- decode the data items and meta data that wraps them -->
  56. <xts:append select="/root">
  57. <xts:transform name="XMLDecode">
  58. <xsl:value-of select="/root/env/param[@name='item2move']"/>
  59. </xts:transform>
  60. </xts:append>
  61. </xts:sequence>
  62. </xsl:template>
  63. </xsl:stylesheet>
  64. </xts:block>
  65. <!--
  66. ===================================================================================================================
  67. update agent sequencing - this block will only be entered when the SeqTasks parameter exists and where it differs from the value present in the AgentDefinition
  68. ===================================================================================================================
  69. -->
  70. <xts:block id="updateAgentSequencing" processor="XSLT" type="exec" nodelist="env,agent_definition" mandatory="false" dependency="decodeItems"
  71. condition=".[/root/env/param[@name = 'SeqTasks'] and /root/env/param[@name = 'SeqTasks']!='' and /root/agent_definition/sequencing != /root/env/param[@name = 'SeqTasks']]">
  72. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:xts="http://developer.cognos.com/schemas/xts/" exclude-result-prefixes="xts xtsext">
  73. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  74. <xsl:template match="/">
  75. <xts:sequence>
  76. <xsl:if test="/root/env/param[@name='SeqTasks']">
  77. <!-- update the agent definition -->
  78. <xts:update select="/root/agent_definition/sequencing">
  79. <sequencing>
  80. <xsl:value-of select="/root/env/param[@name='SeqTasks']"/>
  81. </sequencing>
  82. </xts:update>
  83. <!-- set the flag to indicate that the agent definition needs to be blobbed up again with the new sequencing value-->
  84. <xts:append select="/root/env">
  85. <param name="sequencingUpdated">true</param>
  86. </xts:append>
  87. </xsl:if>
  88. </xts:sequence>
  89. </xsl:template>
  90. </xsl:stylesheet>
  91. </xts:block>
  92. <!--
  93. ===============================================================================================
  94. updateItemOrder - reorder the agent definition item list
  95. ===============================================================================================
  96. -->
  97. <xts:block id="updateItemOrder" dependency="updateAgentSequencing" processor="XSLT" type="exec" nodelist="env,temp,items,agent_definition" condition=".[/root/items]" mandatory="false">
  98. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:xts="http://developer.cognos.com/schemas/xts/" exclude-result-prefixes="xts xtsext">
  99. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  100. <xsl:template match="/">
  101. <xts:sequence>
  102. <xts:append select="/root">
  103. <temp>
  104. <items>
  105. <xsl:for-each select="/root/items/item">
  106. <xsl:variable name="taskId" select="./@id"/>
  107. <xsl:copy-of select="/root/agent_definition/items/item[id=$taskId]"/>
  108. </xsl:for-each>
  109. </items>
  110. </temp>
  111. </xts:append>
  112. <xts:delete select="/root/agent_definition/items"/>
  113. <xts:append select="/root/agent_definition">
  114. <xts:queryNode select="/root/temp/items"/>
  115. </xts:append>
  116. <!-- set the flag to indicate that the agent definition needs to be blobbed up again with the new sequencing value-->
  117. <xts:append select="/root/env">
  118. <param name="sequencingUpdated">true</param>
  119. </xts:append>
  120. </xts:sequence>
  121. </xsl:template>
  122. </xsl:stylesheet>
  123. </xts:block>
  124. <!--
  125. ===================================================================================================================
  126. tidy up
  127. ===================================================================================================================
  128. -->
  129. <xts:block id="tidy" processor="XSLT" type="exec" nodelist="env,temp" mandatory="false" dependency="updateItemOrder">
  130. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:xts="http://developer.cognos.com/schemas/xts/" exclude-result-prefixes="xts xtsext">
  131. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  132. <xsl:template match="/">
  133. <xts:sequence>
  134. <xts:delete select="/root/env/param[@name='SeqTasks']"/>
  135. <xts:delete select="/root/env/param[@name = 'agent_definition_blob']"/>
  136. <xts:delete select="/root/temp"/>
  137. </xts:sequence>
  138. </xsl:template>
  139. </xsl:stylesheet>
  140. </xts:block>
  141. <!--
  142. ===============================================================================================
  143. encodeAgentDefinition- blob up the agent definition if we need to i.e. the sequencing parameter has changed
  144. ===============================================================================================
  145. -->
  146. <xts:block id="encodeAgentDefinition" dependency="tidy" processor="XSLT" type="exec" mandatory="false" condition=".[/root/env/param[@name = 'sequencingUpdated']='true' ]" nodelist="env,credential,cookies,agent_definition">
  147. <xts:logicsheet path="logicsheets/portal.xsl"/>
  148. <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">
  149. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  150. <pf:serialize-xml/>
  151. <pf:variables/>
  152. <xsl:template match="/">
  153. <xts:sequence>
  154. <xsl:variable name="markup">
  155. <xsl:call-template name="serialize-xml">
  156. <xsl:with-param name="node-set" select="/root/agent_definition"/>
  157. </xsl:call-template>
  158. </xsl:variable>
  159. <xts:append select="/root/env">
  160. <param name="agent_definition_blob">
  161. <xsl:value-of select="xtsext:cafaction( concat('sign_wrap_setpassportid_', $passport, '_settemplatename_encodeagentdefinition_settemplateid_summarybarupdate001'), xtsext:web64encode( string( $markup ), true()))"/>
  162. </param>
  163. </xts:append>
  164. </xts:sequence>
  165. </xsl:template>
  166. </xsl:stylesheet>
  167. </xts:block>
  168. <!--
  169. ===============================================================================================
  170. summarybar- render the summary bar HTML and place it in /root/summaryContent
  171. ===============================================================================================
  172. -->
  173. <xts:block id="summarybarVars" type="exec" processor="XSLT" dependency="encodeAgentDefinition">
  174. <xsl:stylesheet version="1.0"
  175. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  176. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  177. exclude-result-prefixes="xsl xts">
  178. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  179. <xsl:template match="/">
  180. <xts:sequence>
  181. <xts:append select="/root">
  182. <sb>
  183. <param name="tabSelectedID">
  184. <xsl:value-of select="/root/env/param[@name='tabSelectedID']"/>
  185. </param>
  186. <param name="prevTabID">
  187. <xsl:value-of select="/root/env/param[@name='prevTabID']"/>
  188. </param>
  189. <param name="itemSelected">
  190. <xsl:value-of select="/root/env/param[@name='itemSelected']"/>
  191. </param>
  192. <param name="itemNewLocation">
  193. <xsl:value-of select="/root/env/param[@name='itemNewLocation']"/>
  194. </param>
  195. <param name="cafcontextid">
  196. <xsl:value-of select="/root/env/param[@name='cafcontextid']"/>
  197. </param>
  198. </sb>
  199. </xts:append>
  200. <xts:delete select="/root/env/param[@name='tabSelectedID']"/>
  201. <xts:delete select="/root/env/param[@name='prevTabID']"/>
  202. <xts:delete select="/root/env/param[@name='newTaskType']"/>
  203. <xts:delete select="/root/env/param[@name='itemSelected']"/>
  204. <xts:delete select="/root/env/param[@name='itemNewLocation']"/>
  205. <xts:delete select="/root/env/param[@name='cafcontextid']"/>
  206. <xts:delete select="/root/env/param[@name='hid']"/>
  207. </xts:sequence>
  208. </xsl:template>
  209. </xsl:stylesheet>
  210. </xts:block>
  211. <xts:block id="summarybar" type="exec" processor="XSLT" dependency="summarybarVars">
  212. <!-- stuff for the summaryBar -->
  213. <xts:logicsheet path="ags/logicsheets/agentDefinition.xsl"/>
  214. <!-- portal specific information -->
  215. <xts:logicsheet path="logicsheets/portal.xsl"/>
  216. <!-- presentation stuff -->
  217. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  218. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  219. <xsl:stylesheet version="1.0"
  220. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  221. exclude-result-prefixes="xsl">
  222. <xsl:output method="xml" encoding="utf-8" indent="no"/>
  223. <xsl:template match="/">
  224. <xts:sequence>
  225. <xts:append select="/root">
  226. <summaryBar>
  227. <xts:transform name="XMLEncode">
  228. <xts:transform src="/ags/summarybar.xslt" processor="XSLT">
  229. <xts:param name="logicsheet">ags/logicsheets/agentDefinition.xsl</xts:param>
  230. <xts:param name="logicsheet">logicsheets/portal.xsl</xts:param>
  231. <xts:param name="logicsheet">logicsheets/presentation/controls/presentation.xsl</xts:param>
  232. <xts:param name="logicsheet">logicsheets/presentation/controls/framework.xsl</xts:param>
  233. <xts:param name="messageBase">messages/AGS.xml</xts:param>
  234. <xts:param name="messageBase">messages/portal.xml</xts:param>
  235. <xts:param name="messageBase">messages/portalRL.xml</xts:param>
  236. <root>
  237. <env>
  238. <xsl:copy-of select="/root/env/*"/>
  239. </env>
  240. <agent_definition>
  241. <xsl:copy-of select="/root/agent_definition/*"/>
  242. </agent_definition>
  243. <sb>
  244. <xsl:copy-of select="/root/sb/*"/>
  245. </sb>
  246. <!-- system -->
  247. <xsl:copy-of select="/root/system"/>
  248. <!-- http -->
  249. <xsl:copy-of select="/root/http"/>
  250. <!-- session -->
  251. <xsl:copy-of select="/root/session"/>
  252. <!-- credential -->
  253. <xsl:copy-of select="/root/credential"/>
  254. <!-- cookies-->
  255. <xsl:copy-of select="/root/cookies"/>
  256. </root>
  257. </xts:transform>
  258. </xts:transform>
  259. </summaryBar>
  260. </xts:append>
  261. </xts:sequence>
  262. </xsl:template>
  263. </xsl:stylesheet>
  264. </xts:block>
  265. ===============================================================================================
  266. Process the suppression rules if need be, and prepare an html fragment that will then be used for any visible task.
  267. ===============================================================================================
  268. -->
  269. <xts:block id="processSuppression" path="/ags/processSuppression.xslt" dependency="summarybar" mandatory="false" processor="XSLT" type="exec">
  270. <xts:logicsheet path="ags/logicsheets/agentDefinition.xsl"/>
  271. <!-- portal specific information -->
  272. <xts:logicsheet path="logicsheets/portal.xsl"/>
  273. <!-- presentation stuff -->
  274. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  275. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  276. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  277. </xts:block>
  278. <!--
  279. ===============================================================================================
  280. genMarkup - Produce the much needed XML response
  281. ===============================================================================================
  282. -->
  283. <xts:block id="genMarkup" type="exec" mode="output" mimeType="application/xml; charset=utf-8" processor="XSLT" dependency="processSuppression">
  284. <!-- logicsheets -->
  285. <xts:logicsheet path="ags/logicsheets/promptValues.xslt"/>
  286. <xts:logicsheet path="ags/logicsheets/run_options.xslt"/>
  287. <!-- portal specific information -->
  288. <xts:logicsheet path="logicsheets/portal.xsl"/>
  289. <xts:logicsheet path="ags/logicsheets/dialogs.xsl"/>
  290. <xts:logicsheet path="ags/logicsheets/agentDefinition.xsl"/>
  291. <xts:logicsheet path="ags/logicsheets/condition-ui-templates.xslt"/>
  292. <!-- Dialog specific logicsheets -->
  293. <xts:logicsheet path="logicsheets/presentation/dialog/ui-templates.xsl"/>
  294. <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
  295. <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
  296. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  297. <!-- Generic logicsheets -->
  298. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  299. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  300. <!-- apply the form logic -->
  301. <xts:logicsheet path="logicsheets/formlogic.xslt"/>
  302. <!-- Prevent the href from appearing in the status bar. -->
  303. <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
  304. <xsl:stylesheet version="1.0"
  305. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  306. xmlns:out="http://www.w3.org/1999/XSL/Transform"
  307. xmlns:agsad="http://developer.cognos.com/schemas/xts/logicsheets/xslt/ags/agentDefinition/"
  308. xmlns:ut="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/ui-templates/"
  309. exclude-result-prefixes="xsl out agsad ut">
  310. <xsl:output method="xml" encoding="utf-8" indent="no"/>
  311. <xsl:key name="request-param" match="/root/*[local-name()='requestParams']/*[local-name()='param']" use="@name"/>
  312. <!-- declared a variable to determine if a report has been selected, used for validation purposes-->
  313. <!-- determine which dialog to show when the set... options link is clicked-->
  314. <xsl:template match="/">
  315. <summaryBarResponse>
  316. <markup>
  317. <xsl:value-of select="/root/summaryBar"/>
  318. </markup>
  319. <xsl:if test="/root/env/param[@name='sequencingUpdated']='true'">
  320. <taskSequence><xsl:value-of select="/root/agent_definition/sequencing"/></taskSequence>
  321. <blobby><xsl:value-of select="/root/env/param[@name='agent_definition_blob']"/></blobby>
  322. </xsl:if>
  323. <isCurrentFailureTask><xsl:value-of select="/root/suppressionDetails/@isCurrentFailureTask"/></isCurrentFailureTask>
  324. <suppressionDetails><xsl:value-of select="/root/suppressionDetails"/></suppressionDetails>
  325. <!-- report task run option summary string-->
  326. <xsl:variable name="ro" select="/root/agent_definition/agentOptions/*[local-name()='options']/*[local-name()='value']/*[local-name()='item']"/>
  327. <reportOptionSummary>
  328. <xsl:choose>
  329. <xsl:when test="/root/agent_definition/agentOptions/form-vars/param[@name='override_default_options']='true'">
  330. <xsl:call-template name="ut:buildRunOptionSummary">
  331. <xsl:with-param name="summaryPath" select="/root/agent_definition/agentOptions/*[local-name()='UIHelpers']"/>
  332. <xsl:with-param name="outputFormat" select="$ro[./*[local-name()='name']='outputFormat']/*[local-name()='value']/*"/>
  333. <xsl:with-param name="outputLocale" select="$ro[./*[local-name()='name']='outputLocale']/*[local-name()='value']/*"/>
  334. <xsl:with-param name="saveAsReportView" select="$ro[./*[local-name()='name']='saveAs' and ./*[local-name()='objectClass']='reportView']"/>
  335. <xsl:with-param name="save" select="$ro[./*[local-name()='name']='saveOutput']/*[local-name()='value'] = 'true'"/>
  336. <xsl:with-param name="saveAsName" select="$ro[./*[local-name()='name']='saveAs' and ./*[local-name()='objectClass']='reportView']/*[local-name()='objectName']/*[local-name()='item']/*[local-name() ='value']"/>
  337. <xsl:with-param name="print" select="$ro[./*[local-name()='name']='print']/*[local-name()='value'] = 'true'"/>
  338. <xsl:with-param name="email" select="$ro[./*[local-name()='name']='email']/*[local-name()='value'] = 'true'"/>
  339. <xsl:with-param name="burst" select="$ro[./*[local-name()='name']='burst']/*[local-name()='value'] = 'true'"/>
  340. <xsl:with-param name="contentTaskOption" select="$ro[./*[local-name()='name']='repairSecurityReferences']/*[local-name()='value']"/>
  341. <xsl:with-param name="deploymentUpgradeOption" select="$ro[./*[local-name()='name']='upgradeClasses']"/>
  342. <xsl:with-param name="jobDefinition" select="false()"/>
  343. <xsl:with-param name="contentTask" select="true()"/>
  344. <xsl:with-param name="deployment" select="true()"/>
  345. <xsl:with-param name="detailed" select="false()"/>
  346. </xsl:call-template>
  347. </xsl:when>
  348. <xsl:otherwise><xts:string id="IDS_OTHERRUN_DEFAULT"/></xsl:otherwise>
  349. </xsl:choose>
  350. </reportOptionSummary>
  351. </summaryBarResponse>
  352. </xsl:template>
  353. <agsad:taskSuppressionStateText/>
  354. <ut:buildRunOptionSummary/>
  355. </xsl:stylesheet>
  356. </xts:block>
  357. </xts:morphlet>