page.xslt 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  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. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  13. xmlns:xos="http://developer.cognos.com/schemas/xts/output/"
  14. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  15. xmlns:mt="http://developer.cognos.com/schemas/xts/logicsheets/presentation/main/mt"
  16. xmlns:mf="http://developer.cognos.com/schemas/xts/logicsheets/presentation/main/mf"
  17. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  18. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  19. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  20. exclude-result-prefixes="xsl xos pf mt mf xtsext xts">
  21. <xsl:output method="xml" version="1.0" encoding="utf-8" indent="no"/>
  22. <!-- current file name -->
  23. <xsl:variable name="mname" select="key('env-param', 'm')"/>
  24. <pf:variables/>
  25. <xsl:template match="/root">
  26. <xsl:variable name="detailStatusIsPrompting" select="string(/root/response/*/*/*[contains(local-name(), 'Response')]/*[local-name()='result']/*[local-name()='details']/*[local-name()='item']/*[local-name()='status'])='prompting'"/>
  27. <xts:sequence>
  28. <xts:replace select="/root/output/*[local-name() = 'part']">
  29. <xos:part>
  30. <xos:entityHeader>
  31. <xos:param name="Content-Type">text/xml; charset=utf-8</xos:param>
  32. </xos:entityHeader>
  33. <xos:entityBody>
  34. <xsl:variable name="isComplete" select="(/root/resultStatus='conversationComplete' or /root/resultStatus='complete')"/>
  35. <xsl:element name="{local-name(/root/command/*)}Response" namespace="http://developer.cognos.com/schemas/xts/portal/iPrompting/1/">
  36. <xsl:variable name="asynchDetailParameterValues" select="/root/response/*/*/*[local-name()='collectParameterValuesResponse']/*[local-name()='result']/*[local-name()='details']/*[local-name()='item' and contains(@xsi:type, 'asynchDetailParameterValues')]"/>
  37. <xsl:choose>
  38. <!-- prompt information supplied by collect. Ensure that something was returned -->
  39. <xsl:when test="(count($asynchDetailParameterValues) &gt; 0) and $isComplete and not($detailStatusIsPrompting)">
  40. <parameters>
  41. <xts:transform src="transforms/portal/parameters/post-WARP-process.xslt" processor="XSLT">
  42. <xsl:copy-of select="$asynchDetailParameterValues"/>
  43. </xts:transform>
  44. </parameters>
  45. </xsl:when>
  46. <xsl:when test="/root/command/*/getParametersRequest and (/root/resultStatus='conversationComplete' or /root/resultStatus='complete')">
  47. <xsl:copy-of select="/root/response/*/*/*[local-name()='getParametersResponse']/*[local-name()='result']/*[local-name()='details']/*[local-name()='item' and contains(@xsi:type, 'asynchDetailParameters')]/*"/>
  48. </xsl:when>
  49. <xsl:when test="/root/command/*/metaDataRequest and string(/root/env/param[@name='execMethod'])='metadata' and /root/response/*/*/*[contains(local-name(),'Response')]/*[local-name()='result']/*[local-name()='details']/*[local-name()='item']/*[local-name()='metadata'] and ((/root/resultStatus='conversationComplete' or /root/resultStatus='complete') and not($detailStatusIsPrompting))">
  50. <xsl:if test="/root/env/param[@name='startScopeAt'] or /root/env/param[@name='startBMItemAt'] or /root/env/param[starts-with(@name,'startDataItemAt_')]">
  51. <metadataResponse>
  52. <xsl:if test="string(/root/response/*/*/*[contains(local-name(),'Response')]/*[local-name()='result']/*[local-name()='details']/*[local-name()='item']/*[local-name()='metadata'])!=''">
  53. <xts:transform name="XMLDecode">
  54. <xsl:value-of select="/root/response/*/*/*[contains(local-name(),'Response')]/*[local-name()='result']/*[local-name()='details']/*[local-name()='item']/*[local-name()='metadata']"/>
  55. </xts:transform>
  56. </xsl:if>
  57. </metadataResponse>
  58. </xsl:if>
  59. </xsl:when>
  60. </xsl:choose>
  61. <status>
  62. <xsl:choose>
  63. <xsl:when test="/root/conversationStatus!=''">
  64. <xsl:value-of select="/root/conversationStatus"/>
  65. </xsl:when>
  66. <xsl:otherwise>
  67. <xsl:value-of select="/root/resultStatus"/>
  68. </xsl:otherwise>
  69. </xsl:choose>
  70. </status>
  71. </xsl:element>
  72. </xos:entityBody>
  73. </xos:part>
  74. <xsl:if test="(not(((/root/resultStatus='conversationComplete' or /root/resultStatus='complete') and not($detailStatusIsPrompting)) and (not(/root/command/*/*[local-name()='callFinish']) or /root/command/*/*[local-name()='callFinish']='false'))) or (not(/root/command/*/*[local-name()='showNoPromptsWarning']) or /root/command/*/*[local-name()='showNoPromptsWarning']='true')">
  75. <xos:part>
  76. <xos:entityHeader>
  77. <xos:param name="Content-Type">text/html; charset=utf-8</xos:param>
  78. </xos:entityHeader>
  79. <xos:entityBody>
  80. <html lang="{/root/session/param[@name='productLocale']}">
  81. <!-- copy in the head content -->
  82. <xsl:copy-of select="output/xos:part/xos:entityBody/xos:content[@id = 'head']"/>
  83. <mt:page region="IDS_OTHERRUN_REPORT_PROMPTS">
  84. <div id="maincontent" style="height: 100%; width: 100%">
  85. <form name="formWarpRequest" id="formWarpRequest" method="post" style="height:100%;margin:0px">
  86. <table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  87. <tr><td height="100%">
  88. <!-- =============== R E P O R T B O D Y ============== -->
  89. <div>
  90. <xsl:choose>
  91. <xsl:when test="$browser = 'ie'">
  92. <xsl:attribute name="style">height:100%;border:0; padding:0;</xsl:attribute>
  93. <xsl:attribute name="class">reportViewerContent</xsl:attribute>
  94. </xsl:when>
  95. <xsl:when test="$browser = 'moz'">
  96. <xsl:attribute name="style">position:relative; left:0; top:1; width:100%; height:100%;border : 0px;</xsl:attribute>
  97. </xsl:when>
  98. <xsl:otherwise>
  99. <xsl:attribute name="style">height:100%;border:0; padding:0;</xsl:attribute>
  100. </xsl:otherwise>
  101. </xsl:choose>
  102. <!-- An inner div for IE makes the scrolling work best -->
  103. <xsl:if test="$browser = 'ie'">
  104. <xts:function name="xmldecode">
  105. <xts:param name="source">&lt;div style="position:absolute;height:100%;width:100%"&gt;</xts:param>
  106. </xts:function>
  107. </xsl:if>
  108. <xsl:choose>
  109. <xsl:when test="/root/conversationStatus='prompting'">
  110. <!-- page is following the response as a "part" -->
  111. <xos:content refId="{response/xos:part/xos:entityBody/@refId}"/>
  112. </xsl:when>
  113. <xsl:when test="(/root/resultStatus='conversationComplete' or /root/resultStatus='complete') and (not(/root/command/*/*[local-name()='showNoPromptsWarning']) or /root/command/*/*[local-name()='showNoPromptsWarning']='true')">
  114. <xsl:copy-of select="output/xos:part/xos:entityBody/xos:content[@id = 'noPromptsMessage']"/>
  115. </xsl:when>
  116. <xsl:when test="contains(' working stillWorking ', concat(' ', /root/resultStatus, ' '))">
  117. <xsl:copy-of select="output/xos:part/xos:entityBody/xos:content[@id = 'waitPage']"/>
  118. </xsl:when>
  119. </xsl:choose>
  120. <xsl:if test="$browser = 'ie'">
  121. <xts:function name="xmldecode">
  122. <xts:param name="source">&lt;/div&gt;</xts:param>
  123. </xts:function>
  124. </xsl:if>
  125. </div>
  126. </td></tr>
  127. </table>
  128. <!-- always copy in the bottomRow content -->
  129. <xsl:copy-of select="output/xos:part/xos:entityBody/xos:content[@id = 'bottomRow']"/>
  130. </form>
  131. </div>
  132. </mt:page>
  133. </html>
  134. </xos:entityBody>
  135. </xos:part>
  136. </xsl:if>
  137. </xts:replace>
  138. </xts:sequence>
  139. </xsl:template>
  140. </xsl:stylesheet>