page.xslt 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: cpscrn
  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" xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="xts xtsext">
  9. <xsl:import href="common.xslt"/>
  10. <xsl:import href="layout.xslt"/>
  11. <xsl:import href="menus.xslt"/>
  12. <xsl:import href="presentation.xslt"/>
  13. <xsl:variable name="doctype-public">
  14. <xsl:choose>
  15. <xsl:when test="string(/root/settings/doctype)='standards'">-//W3C//DTD HTML 4.01//EN</xsl:when>
  16. <xsl:otherwise>-//W3C//DTD HTML 3.2 Final//EN</xsl:otherwise>
  17. </xsl:choose>
  18. </xsl:variable>
  19. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"
  20. doctype-system=""
  21. doctype-public=""/>
  22. <xsl:template match="/">
  23. <xsl:call-template name="render-page"/>
  24. </xsl:template>
  25. <xsl:template name="fragment-globals">
  26. <script type="text/javascript">
  27. // get javascript config for caf.js
  28. <xsl:value-of select="xtsext:cafaction( 'get_jsconfig','' )"/>
  29. _F_Config = new Object();
  30. _F_Config.init = function(){
  31. var appGateway="<xsl:value-of select="xtsext:javascriptencode($applicationGateway)"/>";
  32. this.gateway = "<xsl:value-of select="xtsext:javascriptencode($gateway)"/>";
  33. this.application = appGateway.substring(appGateway.lastIndexOf("/"));
  34. this.webContent = "<xsl:value-of select="xtsext:javascriptencode($contextPath)"/>";
  35. this.productLocale = "<xsl:value-of select="xtsext:javascriptencode($productLocale)"/>";
  36. this.skin = "<xsl:value-of select="xtsext:javascriptencode($skin)"/>";
  37. this.responsePattern = "<xsl:value-of select="xtsext:javascriptencode($responsePattern)"/>";
  38. this.cookieSecure = "<xsl:value-of select="xtsext:javascriptencode($cookieSecure)"/>";
  39. };
  40. _F_Config.init();
  41. _F_Config.help = {
  42. path: "<xsl:value-of select="xtsext:javascriptencode($helpPath)"/>",
  43. langs: " <xsl:value-of select="xtsext:javascriptencode($helpSupportedLangs)"/> ",
  44. book: "<xsl:value-of select="xtsext:javascriptencode($helpDefaultBook)"/>"
  45. };
  46. </script>
  47. </xsl:template>
  48. <!-- overriden extensions -->
  49. <xsl:template name="html-globals">
  50. <xsl:if test="'true' = $debug and '' != $debugFile">
  51. <script type="text/javascript">
  52. if (navigator.userAgent.indexOf("Firefox")== -1 &amp;&amp; '' != '<xsl:value-of select="xtsext:javascriptencode($debugIELiteFile)"/>') {
  53. var head = document.getElementsByTagName('HEAD').item(0);
  54. var node = document.createElement("SCRIPT");
  55. node.type = 'text/javascript';
  56. node.src = '<xsl:value-of select="xtsext:javascriptencode($contextPath)"/><xsl:value-of select="xtsext:javascriptencode($debugIELiteFile)"/>';
  57. head.appendChild(node);
  58. }
  59. </script>
  60. <script type="text/javascript">
  61. <xsl:attribute name="src"><xsl:value-of select="$contextPath"/><xsl:value-of select="$debugFile"/></xsl:attribute>
  62. </script>
  63. <script type="text/javascript">
  64. _F_Debug.enabled = <xsl:value-of select="$debug"/>;
  65. _F_Debug.IELiteLevel = <xsl:value-of select="$debugIELiteLevel"/>;
  66. <xsl:for-each select="$debugObjects/debugObject">
  67. _F_Debug.settings["<xsl:value-of select="xtsext:javascriptencode(@name)"/>"] = <xsl:value-of select="xtsext:javascriptencode(@setting)"/>;
  68. </xsl:for-each>
  69. </script>
  70. </xsl:if>
  71. <script type="text/javascript">
  72. <xsl:variable name="rootPath">
  73. <xsl:value-of select="/root/path"/>
  74. </xsl:variable>
  75. var <xsl:value-of select="/root/id"/>=_F_attach({path: "<xsl:value-of select="xtsext:javascriptencode($rootPath)"/>", id: "<xsl:value-of select="/root/id"/>", page: true});
  76. <xsl:if test="/root/transientGlobal != ''">
  77. fragment.prototype.transientGlobal = <xsl:value-of select="/root/transientGlobal"/>;
  78. </xsl:if>
  79. <xsl:value-of select="/root/id"/>.setOnloadHandler(ui_init);
  80. ui_error.prototype.template =
  81. '&lt;div role="alert" id="_THIS_errormsg">&lt;/div>' +
  82. '&lt;div>' +
  83. '&lt;a id="_THIS_error_showdetails"><xts:string id="IDS_GEN_DETAILS" encode="javascript"/>&lt;/a> | ' +
  84. '&lt;a id="_THIS_error_retry"><xts:string id="IDS_GEN_RETRY" encode="javascript"/>&lt;/a> | ' +
  85. '&lt;a id="_THIS_error_hide"><xts:string id="IDS_GEN_HIDE" encode="javascript"/>&lt;/a>' +
  86. '&lt;/div>';
  87. </script>
  88. </xsl:template>
  89. <xsl:template name="html-pre-page">
  90. <xsl:if test="/root/fragment/info/display = 'fixed'">
  91. <xsl:attribute name="scroll">no</xsl:attribute>
  92. </xsl:if>
  93. </xsl:template>
  94. <xsl:template name="html-body">
  95. <xsl:apply-templates select="/root/layout" >
  96. <xsl:with-param name="pageType">page</xsl:with-param>
  97. </xsl:apply-templates>
  98. </xsl:template>
  99. </xsl:stylesheet>