script.xslt 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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, 2014
  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" xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="xts xtsext">
  13. <xsl:import href="common.xslt"/>
  14. <xsl:import href="layout.xslt"/>
  15. <xsl:import href="menus.xslt"/>
  16. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
  17. <xsl:template match="/">
  18. <xsl:call-template name="fragment-globals"/>
  19. <xsl:call-template name="html-globals"/>
  20. <xsl:call-template name="html-body"/>
  21. </xsl:template>
  22. <xsl:template name="fragment-globals">
  23. <script type="text/javascript">
  24. _F_Config = (window._F_Config !== undefined) ? window._F_Config: new Object();
  25. _F_Config.init = function(){
  26. var appGateway="<xsl:value-of select="$applicationGateway"/>";
  27. this.gateway = "<xsl:value-of select="$gateway"/>";
  28. this.application = appGateway.substring(appGateway.lastIndexOf("/"));
  29. this.webContent = "<xsl:value-of select="$contextPath"/>";
  30. };
  31. _F_Config.init();
  32. _F_Config.help = {
  33. path: "<xsl:value-of select="xtsext:javascriptencode($helpPath)"/>",
  34. langs: " <xsl:value-of select="xtsext:javascriptencode($helpSupportedLangs)"/> ",
  35. book: "<xsl:value-of select="xtsext:javascriptencode($helpDefaultBook)"/>"
  36. };
  37. </script>
  38. </xsl:template>
  39. <xsl:template name="html-globals">
  40. <script type="text/javascript">
  41. <xsl:attribute name="src"><xsl:value-of select="$applicationGateway"/><xsl:text>/messages/messages/pfmessages?section=JS</xsl:text></xsl:attribute>
  42. </script>
  43. <xsl:if test="'true' = $debug and '' != $debugFile">
  44. <script type="text/javascript">
  45. _F_Debug.enabled = <xsl:value-of select="$debug"/>;
  46. _F_Debug.IELiteLevel = <xsl:value-of select="$debugIELiteLevel"/>;
  47. <xsl:for-each select="$debugObjects/debugObject">
  48. _F_Debug.settings["<xsl:value-of select="@name"/>"] = <xsl:value-of select="@setting"/>;
  49. </xsl:for-each>
  50. </script>
  51. </xsl:if>
  52. <script type="text/javascript">
  53. <xsl:variable name="rootPath">
  54. <xsl:value-of select="/root/path"/>
  55. </xsl:variable>
  56. 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});
  57. <xsl:value-of select="/root/id"/>.setOnloadHandler(ui_init);
  58. ui_error.prototype.template =
  59. '&lt;div role="alert" id="_THIS_errormsg">&lt;/div>' +
  60. '&lt;div>' +
  61. '&lt;a id="_THIS_error_showdetails"><xts:string id="IDS_GEN_DETAILS" encode="javascript"/>&lt;/a> | ' +
  62. '&lt;a id="_THIS_error_retry"><xts:string id="IDS_GEN_RETRY" encode="javascript"/>&lt;/a> | ' +
  63. '&lt;a id="_THIS_error_hide"><xts:string id="IDS_GEN_HIDE" encode="javascript"/>&lt;/a>' +
  64. '&lt;/div>';
  65. </script>
  66. </xsl:template>
  67. <xsl:template name="html-body">
  68. <xsl:apply-templates select="/root/layout"/>
  69. </xsl:template>
  70. </xsl:stylesheet>