head.xslt 4.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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, 2019
  6. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. -->
  8. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  9. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  10. xmlns:mt="http://developer.cognos.com/schemas/xts/logicsheets/presentation/main/mt"
  11. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  12. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  13. xmlns:prt="http://developer.cognos.com/schemas/xts/iPrompting/logicsheets/common"
  14. exclude-result-prefixes="xsl pf mt xts xtsext prt">
  15. <xsl:output method="html" encoding="utf-8" indent="no"/>
  16. <pf:variables/>
  17. <xsl:template match="/">
  18. <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'"/>
  19. <head>
  20. <title>
  21. <xsl:value-of select="$product_name"/>
  22. </title>
  23. <meta http-equiv="MSThemeCompatible" content="no"/>
  24. <!-- Standard meta tags -->
  25. <pf:meta/>
  26. <!-- add the theme style sheet -->
  27. <mt:stylesheet/>
  28. <!-- add the stylesheet for the prompt controls-->
  29. <link href="{concat($skin_root, '/prompting/promptCommon.css')}" type="text/css" rel="stylesheet"/>
  30. <script language="javascript">
  31. var timerID = 0;
  32. function init() {
  33. <xsl:choose>
  34. <xsl:when test="((/root/resultStatus='conversationComplete' or /root/resultStatus='complete') and not($detailStatusIsPrompting)) and /root/command/*/*[local-name()='callFinish']='true'">
  35. if ( document.formWarpRequest ) {
  36. document.formWarpRequest.method.value = 'finish';
  37. document.formWarpRequest.submit();
  38. }
  39. </xsl:when>
  40. <xsl:otherwise>
  41. <!-- reset method when user uses browser back button -->
  42. if ( document.formWarpRequest ) {
  43. document.formWarpRequest.method.value = "<xsl:value-of select="xtsext:javascriptencode(string(key('env-param', 'method')))"/>";
  44. }
  45. if (window.history.length > 0)
  46. {
  47. if(document.progress)
  48. window.history.go(+1);
  49. }
  50. if (document.progress) {
  51. window.timerID = setTimeout(doWaitInit, 1500);
  52. }
  53. </xsl:otherwise>
  54. </xsl:choose>
  55. }
  56. <xsl:if test="not(((/root/resultStatus='conversationComplete' or /root/resultStatus='complete') and not($detailStatusIsPrompting)) and /root/command/*/*[local-name()='callFinish']='true')">
  57. function doWaitInit() {
  58. <!-- reset backURL and method when user uses browser back button -->
  59. if ( document.formWarpRequest ) {
  60. <!-- do a wait command -->
  61. document.formWarpRequest.method.value = 'wait';
  62. document.formWarpRequest.submit();
  63. setTimeout('document.progress.src="<xsl:value-of select="xtsext:javascriptencode(string($brand_images))"/>progress.gif"',1);
  64. }
  65. }
  66. <prt:javascripts/>
  67. </xsl:if>
  68. </script>
  69. <xsl:variable name="cmd-form" select="'dummy'"/>
  70. <!-- adds functions to launch the studios.... -->
  71. <!--These variables must be declared here since they are required by cookie_jar.js-->
  72. <script language="javascript">
  73. var sParamDelimiter = "<xsl:value-of select="xtsext:javascriptencode(string(key('system-param', 'delimiters')/@d1))"/>";
  74. var sNameValueDelimiter = "<xsl:value-of select="xtsext:javascriptencode(string(key('system-param', 'delimiters')/@d2))"/>";
  75. var sCookiePath = "<xsl:value-of select="xtsext:javascriptencode(string($cookie_path))"/>";
  76. var sCookieDomain = "<xsl:value-of select="xtsext:javascriptencode(string($cookie_domain))"/>";
  77. var sCookieSecure = "<xsl:value-of select="xtsext:javascriptencode(string($cookie_secure))"/>";
  78. </script>
  79. <script language="javascript" src="{$webcontent}/{$app}/js/cookie_jar.js"/>
  80. </head>
  81. </xsl:template>
  82. </xsl:stylesheet>