cancel.xts 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  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, 2018
  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. formlogic_init
  16. ===============================================================================================
  17. -->
  18. <xts:block id="formlogic_init" type="exec" mode="interpret" processor="XSLT" path="/logicsheets/formlogic_init.xslt" nodelist="env,credential,system,http"/>
  19. <!--
  20. ===============================================================================================
  21. request - Cancel the conversation
  22. ===============================================================================================
  23. -->
  24. <xts:block id="request" dependency="formlogic_init" mode="interpret" processor="XSLT" type="exec" condition=".[/root/env/param[@name='web64conversation']!='']" mandatory="false">
  25. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  26. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:rs="http://developer.cognos.com/schemas/reportService/1" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://www.w3.org/2001/09/soap-envelope" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt">
  27. <xsl:output method="xml" version="1.0" encoding="UTF-8"/>
  28. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  29. <xsl:template match="/">
  30. <xts:sequence>
  31. <xts:append>
  32. <response>
  33. <send:request provider="warp" option="xml-multipart" outputHeader="true" responseEnvelope="true" affinity=".control">
  34. <rs:cancel xmlns:xs="http://www.w3.org/2001/XMLSchema">
  35. <conversation xsi:type="bus:asynchRequest">
  36. <xts:transform name="XMLDecode">
  37. <xsl:value-of select="xtsext:web64decode(string(xtsext:cafaction('sign_unwrap', string(key('env-param','web64conversation')))), true())"/>
  38. </xts:transform>
  39. </conversation>
  40. </rs:cancel>
  41. </send:request>
  42. </response>
  43. </xts:append>
  44. <xts:append>
  45. <conversationStatus>
  46. <xts:queryNode select="/root/response/*[local-name()='Envelope']/*[local-name()='Body']/*/*[local-name()='result']/*[local-name()='details']/*[local-name()='item' and contains(@*[local-name()='type'], 'asynchDetailReportStatus')]/*[local-name()='status']"/>
  47. </conversationStatus>
  48. <resultStatus>
  49. <xts:queryNode select="/root/response/*[local-name()='Envelope']/*[local-name()='Body']/*/*[local-name()='result']/*[local-name()='status']"/>
  50. </resultStatus>
  51. </xts:append>
  52. </xts:sequence>
  53. </xsl:template>
  54. </xsl:stylesheet>
  55. </xts:block>
  56. <!--
  57. ===============================================================================================
  58. unpackAdminState - Replace the current environment with the calling environment
  59. ===============================================================================================
  60. -->
  61. <xts:block id="unpackAdminState" type="exec" mode="interpret" processor="XSLT" dependency="request" condition=".[/root/env/param[@name='adminState']!='']">
  62. <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="xsl">
  63. <xsl:output method="xml" version="1.0" encoding="utf-8" indent="no"/>
  64. <xsl:template match="/root">
  65. <xts:sequence>
  66. <xts:replace select="/root/env">
  67. <env>
  68. <xts:transform name="XMLDecode">
  69. <xsl:value-of select="xtsext:web64decode(string(xtsext:cafaction('sign_unwrap', string(/root/env/param[@name='adminState']))), true())"/>
  70. </xts:transform>
  71. </env>
  72. </xts:replace>
  73. </xts:sequence>
  74. </xsl:template>
  75. </xsl:stylesheet>
  76. </xts:block>
  77. <!--
  78. ===============================================================================================
  79. resetClearedPrompts - This block resets the value of environment variable cleared_prompts
  80. ===============================================================================================
  81. -->
  82. <xts:block id="resetClearedPrompts" type="exec" mode="interpret" processor="XSLT" dependency="unpackAdminState">
  83. <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="xsl">
  84. <xsl:output method="xml" version="1.0" encoding="utf-8" indent="no"/>
  85. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  86. <xsl:template match="/root">
  87. <!-- need to reset the value of cleared_prompts because it is set to false as soon as collect is called. This
  88. ensures that it's back to the original value if cancel is pressed -->
  89. <xts:sequence>
  90. <xsl:choose>
  91. <xsl:when test="key('env-param', 'parameterDescription')=''">
  92. <xts:replace select="/root/env/param[@name='cleared_prompts']">
  93. <param name="cleared_prompts">true</param>
  94. </xts:replace>
  95. </xsl:when>
  96. <xsl:otherwise>
  97. <xts:replace select="/root/env/param[@name='cleared_prompts']">
  98. <param name="cleared_prompts">false</param>
  99. </xts:replace>
  100. </xsl:otherwise>
  101. </xsl:choose>
  102. </xts:sequence>
  103. </xsl:template>
  104. </xsl:stylesheet>
  105. </xts:block>
  106. <!--
  107. ===============================================================================================
  108. cancelForm - This block generates all the hidden inputs needed in the cancel form
  109. ===============================================================================================
  110. -->
  111. <xts:block id="cancelForm" type="exec" mode="output" processor="XSLT" dependency="resetClearedPrompts" mimeType="text/html" contentId="cancelInputs" partId="1" path="/portal/iPrompting/page-parts/cancel.xslt">
  112. <xts:logicsheet path="logicsheets/portal.xsl"/>
  113. </xts:block>
  114. <!--
  115. ===============================================================================================
  116. redirect - redirect the browser
  117. ===============================================================================================
  118. -->
  119. <xts:block id="render-page" type="exec" mode="interpret" processor="XSLT" dependency="cancelForm">
  120. <xts:logicsheet path="logicsheets/portal.xsl"/>
  121. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  122. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xos="http://developer.cognos.com/schemas/xts/output/" xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:xts="http://developer.cognos.com/schemas/xts/" exclude-result-prefixes="xsl xos pf dp xtsext xts">
  123. <xsl:output method="xml" version="1.0" encoding="utf-8" indent="no"/>
  124. <!-- current file name -->
  125. <xsl:variable name="mname" select="key('env-param', 'm')"/>
  126. <pf:variables/>
  127. <xsl:template match="/root">
  128. <xts:sequence>
  129. <xts:replace select="/root/output/*[local-name() = 'part']">
  130. <xos:part>
  131. <xos:entityHeader>
  132. <xos:param name="Content-Type">text/xml; charset=utf-8</xos:param>
  133. </xos:entityHeader>
  134. <xos:entityBody>
  135. <xsl:element name="{local-name(/root/command/*)}Response" namespace="http://developer.cognos.com/schemas/xts/portal/iPrompting/1/">
  136. <status>
  137. <xsl:choose>
  138. <xsl:when test="/root/conversationStatus!=''">
  139. <xsl:value-of select="/root/conversationStatus"/>
  140. </xsl:when>
  141. <xsl:otherwise>
  142. <xsl:value-of select="/root/resultStatus"/>
  143. </xsl:otherwise>
  144. </xsl:choose>
  145. </status>
  146. </xsl:element>
  147. </xos:entityBody>
  148. </xos:part>
  149. <xos:part>
  150. <xos:entityHeader>
  151. <xos:param name="Content-Type">text/html; charset=utf-8</xos:param>
  152. </xos:entityHeader>
  153. <xos:entityBody>
  154. <dp:page longTitle="$product_name" getRidOfDoctype="true()">
  155. <dp:meta>
  156. <pf:meta/>
  157. </dp:meta>
  158. <form name="pform" method="post" action="{$gateway}">
  159. <!-- always copy in the bottomRow content -->
  160. <xsl:copy-of select="output/xos:part/xos:entityBody/xos:content[@id = 'cancelInputs']"/>
  161. </form>
  162. <script language="javascript">
  163. function init()
  164. {
  165. <xsl:choose>
  166. <xsl:when test="/root/env/param[starts-with(@name,'stack_')] and ( not(/root/command/*/*[local-name()='ps_nav_op']) or /root/command/*/*[local-name()='ps_nav_op'] = 'pop' or /root/command/*/*[local-name()='ps_nav_op'] = 'stack_down' )">
  167. document.pform.ps_nav_op.value = 'pop';
  168. <xsl:choose>
  169. <xsl:when test="/root/command/*/*[local-name()='returnMorphlet'] != ''">
  170. document.pform.m.value = '<xsl:value-of select="/root/command/*/*[local-name()='returnMorphlet']"/>';
  171. </xsl:when>
  172. <xsl:when test="key('env-param','step_options_visited')='true'">
  173. document.pform.m.value = '<xsl:value-of select="xtsext:javascriptencode(string(/root/command/*/redirect))"/>';
  174. </xsl:when>
  175. <xsl:otherwise>
  176. document.pform.m.value = 'portal/runWithOptions/report.xts';
  177. </xsl:otherwise>
  178. </xsl:choose>
  179. document.pform.submit();
  180. </xsl:when>
  181. <xsl:otherwise>
  182. <xsl:choose>
  183. <xsl:when test="/root/command/*/*[local-name()='returnMorphlet'] != ''">
  184. document.pform.m.value = '<xsl:value-of select="/root/command/*/*[local-name()='returnMorphlet']"/>';
  185. document.pform.submit();
  186. </xsl:when>
  187. <xsl:when test="/root/env/param[@name='visited_run_options_property']">
  188. document.pform.m.value = 'portal/properties_run_options.xts';
  189. document.pform.submit();
  190. </xsl:when>
  191. <xsl:otherwise>
  192. location.href = document.pform.backURL.value;
  193. </xsl:otherwise>
  194. </xsl:choose>
  195. </xsl:otherwise>
  196. </xsl:choose>
  197. }
  198. </script>
  199. </dp:page>
  200. </xos:entityBody>
  201. </xos:part>
  202. </xts:replace>
  203. </xts:sequence>
  204. </xsl:template>
  205. </xsl:stylesheet>
  206. </xts:block>
  207. </xts:morphlet>