display_message.xslt 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. <xsl:stylesheet version="1.0"
  13. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  14. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  15. xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/"
  16. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  17. xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
  18. xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/"
  19. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  20. exclude-result-prefixes="xsl xts lyt pf dp df">
  21. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  22. <pf:variables/>
  23. <xsl:template match="/root">
  24. <xsl:variable name="browserTitle">
  25. <xts:string id="IDS_COGNOS_REPORTS"/>
  26. </xsl:variable>
  27. <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html></xsl:text><dp:page longTitle="$browserTitle">
  28. <dp:meta>
  29. <pf:meta/> <!-- Standard meta tags -->
  30. </dp:meta>
  31. <dp:script>
  32. <pf:help context=""/> <!-- Help system -->
  33. </dp:script>
  34. <script language="javascript">
  35. function closePage()
  36. {
  37. var emptyHistoryThreshold = <xsl:choose><xsl:when test="$browser = 'ie'">0</xsl:when><xsl:otherwise>1</xsl:otherwise></xsl:choose>;
  38. <xsl:choose>
  39. <xsl:when test="string(/root/displayMessage/backURL) != ''">
  40. document.location.href = "<xsl:value-of select="xtsext:javascriptencode(string(/root/displayMessage/backURL))"/>";
  41. </xsl:when>
  42. <xsl:otherwise> <!-- No BackURL provided -->
  43. // try to go back in history if we can
  44. if ( history.length > emptyHistoryThreshold )
  45. history.back();
  46. // try to close a win32 window if we appear inside of one
  47. else if (window.external &amp;&amp; window.external.HasOnClose)
  48. window.external.OnClose(1);
  49. // close the browser window
  50. else
  51. window.close();
  52. </xsl:otherwise>
  53. </xsl:choose>
  54. }
  55. </script>
  56. <!-- dialog header -->
  57. <dp:header>
  58. <!-- header titles-->
  59. <dp:title showName="false">
  60. <xsl:value-of select="$browserTitle"/>
  61. </dp:title>
  62. <!-- header introduction -->
  63. <dp:close>
  64. <xsl:variable name="close"><xts:string id="IDS_CLOSE"/></xsl:variable>
  65. <a href="javascript:closePage();"><img height="16" width="16" class="dialogClose" vspace="2" border="0" src="{$skin_images}close.gif" alt="{$close}" onmouseover="this.className = 'dialogCloseOver'" onmouseout="this.className = 'dialogClose'"/></a>
  66. </dp:close>
  67. </dp:header>
  68. <lyt:layout style="1">
  69. <lyt:section>
  70. <dp:group>
  71. <dp:groupItem valign="top">
  72. <dp:text nospace="nospace" wrap="wrap">
  73. <xsl:value-of select="string(/root/displayMessage/message)"/>
  74. </dp:text>
  75. </dp:groupItem>
  76. </dp:group>
  77. </lyt:section>
  78. </lyt:layout>
  79. <dp:footer>
  80. <df:button df:id="IDS_CLOSE" df:style="href" df:href="javascript:closePage();"/>
  81. </dp:footer>
  82. </dp:page>
  83. </xsl:template>
  84. </xsl:stylesheet>