rerun.xts 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: ps
  5. (C) Copyright IBM Corp. 2005, 2014
  6. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. -->
  8. <!--
  9. Copyright (C) 2008 Cognos ULC, an IBM Company. All rights reserved.
  10. Cognos (R) is a trademark of Cognos ULC, (formerly Cognos Incorporated).
  11. -->
  12. <xts:morphlet xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="messages/portal.xml, messages/portalRL.xml">
  13. <xts:block id="formlogic_init" type="exec" mode="interpret" processor="XSLT" path="/logicsheets/formlogic_init.xslt" nodelist="env,credential,system,http"/>
  14. <!--
  15. ===============================================================================================
  16. getRerunList: Query the Monitor service to find out if anything can be rerun.
  17. Should only do this when the status is failed
  18. ===============================================================================================
  19. -->
  20. <xts:block id="getRerunList" path="/portal/history/getRerunList.xsl" nodelist="header, env, queryResponse" type="exec" mode="interpret" processor="XSLT" dependency="formlogic_init">
  21. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  22. </xts:block>
  23. <!--
  24. ===============================================================================================
  25. eatFault - eat up any fault that occured while trying to release the conversation
  26. ===============================================================================================
  27. -->
  28. <xts:block id="eatFault" type="fault" processor="XSLT">
  29. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  30. <xsl:output method="xml"/>
  31. <xsl:template match="/">
  32. <eatFault/>
  33. </xsl:template>
  34. </xsl:stylesheet>
  35. </xts:block>
  36. <!--
  37. ===============================================================================================
  38. Load class names map
  39. ===============================================================================================
  40. -->
  41. <xts:block id="getClassNames" type="exec" mode="input" processor="XML" path="/portal/uiExtensions.xml">
  42. <xts:logicsheet path="/logicsheets/uiobjects/uiobjects_names.xslt"/>
  43. </xts:block>
  44. <!--
  45. ===============================================================================================
  46. main
  47. ===============================================================================================
  48. -->
  49. <xts:block id="main" mode="output" processor="XSLT" type="exec" mimeType="text/html" dependency="getClassNames getRerunList">
  50. <xts:logicsheet path="logicsheets/portal.xsl"/>
  51. <xts:logicsheet path="logicsheets/presentation/dialog/templates.xsl"/>
  52. <xts:logicsheet path="logicsheets/presentation/dialog/ui-templates.xsl"/>
  53. <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
  54. <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
  55. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  56. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  57. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  58. <xts:logicsheet path="logicsheets/presentation/dialog/confirm.xslt"/>
  59. <xts:logicsheet path="logicsheets/formlogic.xslt"/>
  60. <xts:logicsheet path="logicsheets/validation.xslt"/>
  61. <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
  62. <xsl:stylesheet version="1.0"
  63. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  64. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  65. xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/"
  66. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  67. xmlns:mt="http://developer.cognos.com/schemas/xts/logicsheets/presentation/main/mt"
  68. xmlns:mf="http://developer.cognos.com/schemas/xts/logicsheets/presentation/main/mf"
  69. xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
  70. xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/"
  71. xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
  72. xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
  73. xmlns:dt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/templates/"
  74. xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/"
  75. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  76. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  77. exclude-result-prefixes="xsl cm lyt pf mt mf dp df cf cp utml xts xtsext dt">
  78. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  79. <!-- current file name -->
  80. <xsl:variable name="mname" select="'history/rerun.xts'"/>
  81. <xsl:variable name="rerunList" select="/root/rerunList/*[local-name()='Envelope']/*[local-name()='Body']/*[local-name()='runSpecificationResponse']/result/details/details[contains(@*[local-name()='type'], ':asynchDetailEventRecord')]"/>
  82. <!-- add any theme variables -->
  83. <pf:variables/>
  84. <!-- start the output -->
  85. <xsl:template match="/root">
  86. <xsl:variable name="browserTitle">
  87. <xts:string id="IDS_HRE_TITLE">
  88. <xts:param name="objectName">
  89. <span lang="{$contentLocale}"><xsl:value-of select="key('env-param','m_name')"/></span>
  90. </xts:param>
  91. </xts:string>
  92. </xsl:variable>
  93. <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html></xsl:text><dp:page longTitle="$browserTitle">
  94. <mf:head/>
  95. <dp:meta>
  96. <pf:meta/> <!-- Standard meta tags -->
  97. </dp:meta>
  98. <dp:script>
  99. <!-- Help system -->
  100. <pf:help context="HID_PERMISSIONS"/>
  101. <dt:selectDeselectAll/>
  102. <script language="javascript">
  103. function validate() {
  104. var frm = document.pform;
  105. var restartCount = '<xsl:value-of select="count($rerunList)"/>';
  106. var bChecked = false;
  107. <!--
  108. the UI asks the UI which items he wants to rerun while the API takes a list of items
  109. to be skipped. Go through all the checkboxes and for everyone not checked update the
  110. associated 'skip' hidden field.
  111. -->
  112. for (var i = 1; i &lt;= restartCount; i++) {
  113. if (!document.getElementById('checkbox_eventID_' + i).checked) {
  114. document.getElementById('skipEventID_' + i).value = document.getElementById('checkbox_eventID_' + i).value;
  115. }
  116. else {
  117. bChecked = true;
  118. document.getElementById('skipEventID_' + i).value = '';
  119. }
  120. }
  121. <!-- user selected something to rerun -->
  122. if (bChecked) {
  123. frm.ifrmcmd.value = 'rerun';
  124. }
  125. <!-- user didn't select anything to rerun -->
  126. else {
  127. alert('<xts:string id="IDS_HRE_NO_SELECTION" encode="javascript"/>');
  128. return false;
  129. }
  130. return true;
  131. }
  132. </script>
  133. </dp:script>
  134. <xsl:variable name="objString">
  135. <xsl:choose>
  136. <xsl:when test="key('env-param','m_class')='jobDefinition'"><xts:string id="IDS_HRE_STEPS"/></xsl:when>
  137. <xsl:otherwise><xts:string id="IDS_HRE_TASKS"/></xsl:otherwise>
  138. </xsl:choose>
  139. </xsl:variable>
  140. <utml:form name="pform" method="post" action="{$gateway}">
  141. <xsl:variable name="useStack" select="key('env-param', 'ps_nav_stack') and not(key('env-param', 'ps_nav_stack') = '')"/>
  142. <utml:input type="hidden" name="ifrmcmd" value="" utml:update="false"/>
  143. <!-- dialog header -->
  144. <dp:header useBackURL="not($useStack)">
  145. <!-- header titles-->
  146. <dp:title><xsl:copy-of select="$browserTitle"/></dp:title>
  147. <dp:description>
  148. <xsl:choose>
  149. <xsl:when test="key('env-param','m_class')='jobDefinition'">
  150. <xts:string id="IDS_HRE_DESCRIPTION_STEPS"/>
  151. </xsl:when>
  152. <xsl:otherwise>
  153. <xts:string id="IDS_HRE_DESCRIPTION">
  154. <xts:param name="objectClass"><xsl:value-of select="$objString"/></xts:param>
  155. </xts:string>
  156. </xsl:otherwise>
  157. </xsl:choose>
  158. </dp:description>
  159. </dp:header>
  160. <br/>
  161. <xsl:variable name="tableLabel">
  162. <xsl:choose>
  163. <xsl:when test="key('env-param','m_class')='jobDefinition'">
  164. <xts:string id="IDS_HRE_TABLE_DESCRIPTION_STEPS"/>
  165. </xsl:when>
  166. <xsl:otherwise>
  167. <xts:string id="IDS_HRE_TABLE_DESCRIPTION">
  168. <xts:param name="objectClass">
  169. <xsl:value-of select="$objString"/>
  170. </xts:param>
  171. </xts:string>
  172. </xsl:otherwise>
  173. </xsl:choose>
  174. </xsl:variable>
  175. <dp:list>
  176. <dp:section>
  177. <dp:label><xsl:copy-of select="$tableLabel"/></dp:label>
  178. <dp:text width="100%"/>
  179. <xsl:choose>
  180. <xsl:when test="count($rerunList/*) > 0">
  181. <dp:text nospace="nospace">
  182. 1 - <xsl:value-of select="count($rerunList)"/>
  183. </dp:text>
  184. </xsl:when>
  185. <xsl:otherwise>
  186. <dp:text/>
  187. </xsl:otherwise>
  188. </xsl:choose>
  189. </dp:section>
  190. </dp:list>
  191. <cp:table name="outstanding" iterate="$rerunList" showEmptyMsg="true">
  192. <cp:tableSummary><xsl:copy-of select="$tableLabel"/></cp:tableSummary>
  193. <!-- Column Headers -->
  194. <cp:tableHeader>
  195. <cp:columnHeader width="16" toggleName="checkbox_eventID"/>
  196. <!-- Icon Column -->
  197. <cp:columnHeader width="20"/>
  198. <!-- Path Column -->
  199. <cp:columnHeader width="50%">
  200. <span style="padding-left: 1px; padding-right: 1px;"><xts:string id="IDS_PATH_INDICATOR"/>&#160;</span>
  201. <xsl:text/><xts:string id="IDS_HEADING_REPORT_NAME"/><xsl:text/>
  202. </cp:columnHeader>
  203. <cp:columnHeader width="50%">
  204. <xts:string id="IDS_HEADING_STATUS"/>
  205. </cp:columnHeader>
  206. </cp:tableHeader>
  207. <!-- Column contents -->
  208. <cp:tableContent>
  209. <!-- checkbox column -->
  210. <cp:columnContent>
  211. <input type="checkbox" name="checkbox_eventID_{position()}" id="checkbox_eventID_{position()}" value="{history/history/eventID/value}" utml:update="false">
  212. <xsl:attribute name="aria-label"><xts:string id="IDS_SELECTION_FOR_PAGER_ITEM"><xts:param name="pagerItemName"><xsl:value-of select="runnable/runnable/defaultName/value"/></xts:param></xts:string></xsl:attribute>
  213. </input>
  214. <input type="hidden" name="skipEventID_{position()}" id="skipEventID_{position()}" value="" utml:update="false"/>
  215. </cp:columnContent>
  216. <!-- Icon Column -->
  217. <cp:columnContent>
  218. <xsl:variable name="runnable" select="runnable/runnable"/>
  219. <xsl:call-template name="gen-icon">
  220. <xsl:with-param name="class" select="$runnable/objectClass/value"/>
  221. <xsl:with-param name="hiddenObject" select="$runnable/hidden/value"/>
  222. <xsl:with-param name="iconURIOverride" select="$runnable/iconURI/value"/>
  223. </xsl:call-template>
  224. </cp:columnContent>
  225. <cp:columnContent scope="row">
  226. <img align="absmiddle" height="16" width="20" src="{$skin_images}path.gif">
  227. <xsl:attribute name="alt">
  228. <!-- we can't use the do-the-path-link template since the response didn't go through post-process -->
  229. <xsl:for-each select="runnable/runnable/ancestors/value/value">
  230. <xsl:value-of select="title"/>
  231. <xsl:if test="position() != last()">&#160;&gt;&#160;</xsl:if>
  232. </xsl:for-each>
  233. </xsl:attribute>
  234. </img>
  235. <xsl:text>&#160;</xsl:text>
  236. <xsl:value-of select="runnable/runnable/defaultName/value"/>
  237. </cp:columnContent>
  238. <!-- Status Column -->
  239. <cp:columnContent>
  240. <xsl:choose>
  241. <xsl:when test="string(history/history/status/value)='pending'">
  242. <xts:string id="IDS_JOB_STATUS_PENDING"/>
  243. </xsl:when>
  244. <xsl:when test="string(history/history/status/value)='suspended'">
  245. <xts:string id="IDS_JOB_STATUS_SUSPENDED"/>
  246. </xsl:when>
  247. <xsl:when test="string(history/history/status/value)='executing'">
  248. <xts:string id="IDS_JOB_STATUS_EXECUTING"/>
  249. </xsl:when>
  250. <xsl:when test="string(history/history/status/value)='succeeded'">
  251. <xts:string id="IDS_JOB_STATUS_SUCCEEDED"/>
  252. </xsl:when>
  253. <xsl:when test="string(history/history/status/value)='failed'">
  254. <xts:string id="IDS_JOB_STATUS_FAILED"/>
  255. </xsl:when>
  256. <xsl:when test="string(history/history/status/value)='cancelled' or string(history/history/status/value)='terminated' or string(history/history/status/value)='purged'">
  257. <xts:string id="IDS_JOB_STATUS_CANCELLED"/>
  258. </xsl:when>
  259. </xsl:choose>
  260. </cp:columnContent>
  261. </cp:tableContent>
  262. </cp:table>
  263. <dp:footer>
  264. <df:button df:id="IDS_OK" utml:validate="true" df:style="submit"/>
  265. <xsl:choose>
  266. <xsl:when test="$useStack">
  267. <df:button df:id="IDS_CANCEL" df:style="stack-down"/>
  268. </xsl:when>
  269. <xsl:otherwise>
  270. <df:button df:id="IDS_CANCEL" df:style="back-url"/>
  271. </xsl:otherwise>
  272. </xsl:choose>
  273. </dp:footer>
  274. </utml:form>
  275. </dp:page>
  276. </xsl:template>
  277. <pf:gen-icon/>
  278. </xsl:stylesheet>
  279. </xts:block>
  280. <!--
  281. ===============================================================================================
  282. debug
  283. ===============================================================================================
  284. -->
  285. <xts:block id="debug" dependency="main" condition=".[/root/session/param[@name='debug']='1']" type="exec" mode="output" processor="XSLT" mandatory="false" mimeType="text/html">
  286. <!-- get the debug logic sheet -->
  287. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  288. <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">
  289. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  290. <xsl:template match="/">
  291. <dbg:dumpxml select="/root"/>
  292. </xsl:template>
  293. </xsl:stylesheet>
  294. </xts:block>
  295. </xts:morphlet>