gen_custom_page.xslt 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  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:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  15. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  16. xmlns:pm="http://developer.cognos.com/schemas/xts/pm"
  17. xmlns:mt="http://developer.cognos.com/schemas/xts/logicsheets/presentation/main/mt"
  18. xmlns:mf="http://developer.cognos.com/schemas/xts/logicsheets/presentation/main/mf"
  19. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  20. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  21. xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
  22. xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
  23. xmlns:rss="http://developer.cognos.com/schemas/xts/rss/"
  24. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  25. xmlns:out="dummy-uri"
  26. xmlns:cps="http://developer.cognos.com/schemas/cps/asm/objects/1/"
  27. xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  28. exclude-result-prefixes="xsl cps cm pf pm mt mf xts xtsext cf cp rss out bus xts SOAP-ENV">
  29. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  30. <!-- Global vars -->
  31. <!-- ================================================= -->
  32. <mf:variables stateParams="m_ts m_folder m_folder2 m_nbid m_nbid2 m_section m_pagerfrom m_pagerto m_pg_e m_tab rui m_page backURL m_portlet" mode="main"/>
  33. <pf:variables/>
  34. <mf:main-variables/>
  35. <mf:TabRenderingTemplates/>
  36. <cp:flyoutControl/>
  37. <xsl:variable name="cmd-form" select="'cform'"/>
  38. <xsl:variable name="edit-form" select="'pform'"/>
  39. <!-- start the output -->
  40. <!-- ================================================= -->
  41. <xsl:template match="/root">
  42. <xsl:variable name="oTitle">
  43. <xsl:choose>
  44. <xsl:when test="$pageName != ''">
  45. <xsl:value-of select="$pageName"/>
  46. </xsl:when>
  47. <xsl:when test="$pageNotFound != ''">
  48. <xts:string id="IDS_PAGE_UNAVAILABLE"/>
  49. </xsl:when>
  50. </xsl:choose>
  51. </xsl:variable>
  52. <!-- HTML body -->
  53. <mt:customPage mode="main">
  54. <!-- Render the top headers. -->
  55. <xsl:call-template name="render-header"/>
  56. <xsl:variable name="isHomeCommand" select="key('env-param', 'gohome')"/>
  57. <xsl:variable name="invalidHomeHandler">
  58. <script>
  59. alert("<xts:string id="IDS_PAGE_INVALID_HOME" encode="javascript"/>");
  60. var url = "<xsl:value-of select="xtsext:javascriptencode($gateway)"/>?<xsl:value-of select="xtsext:javascriptencode($baseCCQS)"/>";
  61. location.href = url;
  62. </script>
  63. </xsl:variable>
  64. <form name="cform" method="post" action="{$gateway}" style="margin:0px">
  65. <mf:cmd-vars/>
  66. </form>
  67. <!-- End of HTML body -->
  68. </mt:customPage>
  69. </xsl:template>
  70. <xsl:template name="render-header">
  71. <mt:h1 mode="main">
  72. <mt:title>
  73. <xsl:choose>
  74. <xsl:when test="$displayMode = 'viewer'">
  75. <xsl:choose>
  76. <xsl:when test="$pageName != ''">
  77. <xsl:value-of select="$pageName"/>
  78. </xsl:when>
  79. <xsl:when test="$pageNotFound != ''">
  80. <xts:string id="IDS_PAGE_UNAVAILABLE"/>
  81. </xsl:when>
  82. </xsl:choose>
  83. </xsl:when>
  84. <xsl:otherwise>
  85. <xts:string id="IDS_PORTAL"/>
  86. </xsl:otherwise>
  87. </xsl:choose>
  88. </mt:title>
  89. </mt:h1>
  90. <!-- only render these headers when in portal mode -->
  91. <xsl:if test="$displayMode = 'portal'">
  92. <mt:h3 mode="main">
  93. <mt:tabs/>
  94. </mt:h3>
  95. <mt:h4>
  96. <mt:path/>
  97. <mt:toolbar>
  98. <mt:tool-group hideDivider="true">
  99. <mt:tool name="new" new-class="pagelet"/>
  100. <xsl:if test="$canAddPageToPortal">
  101. <mt:tool name="add_page"/>
  102. </xsl:if>
  103. </mt:tool-group>
  104. <xsl:if test="not($pageNotFound) and $pageCanWrite and $pageCanRead">
  105. <mt:tool-group>
  106. <mt:tool name="edit_pagelet"/>
  107. </mt:tool-group>
  108. </xsl:if>
  109. </mt:toolbar>
  110. </mt:h4>
  111. </xsl:if>
  112. <xsl:if test="$displayMode = 'viewer' and $pageID != 'portlet'">
  113. <mt:h4>
  114. <mt:toolbar>
  115. <mt:tool-group hideDivider="true">
  116. <xsl:choose>
  117. <xsl:when test="$displayMode = 'viewer'">
  118. <mt:tool name="refresh"/>
  119. </xsl:when>
  120. <xsl:otherwise>
  121. <mt:tool name="refreshUsingGet"/>
  122. </xsl:otherwise>
  123. </xsl:choose>
  124. </mt:tool-group>
  125. <xsl:choose>
  126. <xsl:when test="$canAddPageToPortal">
  127. <mt:tool-group>
  128. <mt:tool name="add_page"/>
  129. </mt:tool-group>
  130. </xsl:when>
  131. <!-- We typically should check for page level access here but we can cheat a bit and
  132. show a disabled icon when the page is already in the user's portal. -->
  133. <xsl:when test="$isPersonalPortalPage">
  134. <mt:tool-group>
  135. <mt:tool name="add_page" disable="true"/>
  136. </mt:tool-group>
  137. </xsl:when>
  138. </xsl:choose>
  139. <xsl:if test="$canEditPage">
  140. <mt:tool-group>
  141. <mt:tool name="edit_pagelet"/>
  142. </mt:tool-group>
  143. </xsl:if>
  144. </mt:toolbar>
  145. </mt:h4>
  146. </xsl:if>
  147. </xsl:template>
  148. <cp:tabControl/>
  149. </xsl:stylesheet>