rerun.xts 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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, 2011
  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. <!--
  14. ===============================================================================================
  15. doFormCommand
  16. Send the run request to the monitor service
  17. ===============================================================================================
  18. --> <xts:block id="doFormCommand" processor="XSLT" type="exec">
  19. <xts:logicsheet path="logicsheets/portal.xsl"/>
  20. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  21. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  22. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
  23. xmlns:form="http://developer.cognos.com/schemas/xts/portal/iFrmCmd/1/"
  24. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  25. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  26. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  27. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  28. xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  29. xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
  30. xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  31. xmlns:ms="http://developer.cognos.com/schemas/monitorService/1"
  32. xmlns:cm="http://developer.cognos.com/schemas/bibus/3/"
  33. exclude-result-prefixes="xsl xts send form bus xtsext pf xsi SOAP-ENC SOAP-ENV ms">
  34. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  35. <!-- global application variables -->
  36. <pf:variables/>
  37. <xsl:key name="form-param" match="/root/command/form:rerun/form:env/form:param" use="@name"/>
  38. <xsl:template match="/root/command/form:rerun/form:env">
  39. <xts:sequence>
  40. <xts:append>
  41. <send:request provider="monitorService" affinity="session">
  42. <ms:run>
  43. <objectPath xsi:type="bus:searchPathSingleObject">
  44. <xsl:value-of select="key('form-param','parentSearchPath')"/>
  45. </objectPath>
  46. <parameterValues xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:parameterValue[0]"/>
  47. <options xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:option[2]">
  48. <item xsi:type="cm:asynchOptionSearchPathSingleObject">
  49. <name xsi:type="cm:asynchOptionEnum">restartHistoryLocation</name>
  50. <value xsi:type="cm:searchPathSingleObject">
  51. <xsl:choose>
  52. <!-- if we have a restartID then use it, should help performance in the back end -->
  53. <xsl:when test="key('form-param', 'restartEventID') != ''">//history[@eventID = '<xsl:value-of select="key('form-param', 'restartEventID')"/>']</xsl:when>
  54. <xsl:when test="key('form-param', 'eventID') != ''">//history[@eventID = '<xsl:value-of select="key('form-param', 'eventID')"/>']</xsl:when>
  55. <xsl:otherwise><xsl:value-of select="key('form-param', 'm_obj')"/></xsl:otherwise>
  56. </xsl:choose>
  57. </value>
  58. </item>
  59. <item xsi:type="cm:asynchOptionSearchPathSingleObjectArray">
  60. <name xsi:type="cm:asynchOptionEnum">skipTaskHistoryLocations</name>
  61. <value xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="cm:searchPathSingleObject[]">
  62. <xsl:for-each select="form:param[starts-with(@name,'skipEventID_') and string(.) != '']">
  63. <item xsi:type="cm:searchPathSingleObject">//history[@eventID = '<xsl:value-of select="."/>']</item>
  64. </xsl:for-each>
  65. </value>
  66. </item>
  67. </options>
  68. </ms:run>
  69. </send:request>
  70. </xts:append>
  71. </xts:sequence>
  72. </xsl:template>
  73. <xsl:template match="text()"/>
  74. </xsl:stylesheet>
  75. </xts:block>
  76. <!--
  77. ===============================================================================================
  78. commandResults - operation results
  79. ===============================================================================================
  80. -->
  81. <xts:block id="commandResults" processor="XSLT" type="exec" mode="output" mimeType="text/xml" dependency="doFormCommand">
  82. <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
  83. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" version="1.0">
  84. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  85. <xsl:template match="/root">
  86. <response xmlns="http://developer.cognos.com/schemas/xts/portal/iFrmCmd/1/">
  87. <xsl:choose>
  88. <xsl:when test="*[local-name()='runResponse']">
  89. <xsl:copy-of select="*[local-name()='runResponse']"/>
  90. </xsl:when>
  91. <xsl:otherwise>
  92. <error/>
  93. </xsl:otherwise>
  94. </xsl:choose>
  95. </response>
  96. </xsl:template>
  97. <xsl:template match="text()"/>
  98. </xsl:stylesheet>
  99. </xts:block>
  100. </xts:morphlet>