back.xts 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  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, 2011
  6. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. -->
  8. <xts:morphlet version="1.0" xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="/cps4/portlets/nav/messages/cpsnavmsgs.xml">
  9. <xts:block id="init" type="exec" mode="interpret" processor="XML" condition=".[/root/env/param[@name='s7'] = '1']" mandatory="false">
  10. <xts:sequence>
  11. <xts:append>
  12. <!-- If we are dealing with a series7 object, we read the gateway from the configuration instead of calculating it. This is to support "https" if it is used.-->
  13. <xts:function name="getConfiguration">
  14. <xts:param name="gateway"/>
  15. </xts:function>
  16. </xts:append>
  17. </xts:sequence>
  18. </xts:block>
  19. <xts:block id="render" dependency="init" type="exec" mode="output" processor="XSLT" mimeType="text/html">
  20. <xsl:stylesheet version="1.0" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xts="http://developer.cognos.com/schemas/xts/">
  21. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
  22. <xsl:template match="/">
  23. <xsl:variable name="url" select="/root/env/param[@name='url']"/>
  24. <xsl:variable name="is-url-base64encoded" select ="/root/env/param[@name='urlEncoded'] = 'true'"/>
  25. <xsl:variable name="action" select="/root/env/param[@name='action']"/>
  26. <xsl:variable name="series7" select="/root/env/param[@name='s7'] = '1'"/>
  27. <xsl:variable name="skin">
  28. <xsl:choose>
  29. <xsl:when test="root/user/param[@name='skin']"><xsl:value-of select="root/user/param[@name='skin']"/></xsl:when>
  30. <xsl:otherwise>corporate</xsl:otherwise>
  31. </xsl:choose>
  32. </xsl:variable>
  33. <xsl:variable name="skin_root" select="concat(/root/system/param[@name='skin-root'], '/', $skin )"/>
  34. <xsl:variable name="skin_style" select="concat($skin_root, '/', /root/system/param[@name='app-portal-ref'], '/default.css')"/>
  35. <xsl:variable name="skin_font" select="concat($skin_root, '/fonts.css')"/>
  36. <xsl:variable name="image-root" select="/root/system/param[@name='img-root']"/>
  37. <xsl:variable name="images" select="concat($image-root,'/portlets/nav/images/')"/>
  38. <html>
  39. <head>
  40. <meta name="Copyright" content="(C) Copyright IBM Corp. 2005, 2011"/>
  41. <meta name="Trademark" content="Licensed Material - Property of IBM Corp. IBM, the IBM logo, and Cognos are trademarks of IBM Corp., registered in many jurisdictions worldwide."/>
  42. <title></title>
  43. <link rel="stylesheet" type="text/css" href="{$skin_style}"/>
  44. <link rel="stylesheet" type="text/css" href="{$skin_font}"/>
  45. </head>
  46. <body>
  47. <xsl:choose>
  48. <xsl:when test="$action='close'">
  49. <xsl:attribute name="onload">close();</xsl:attribute>
  50. </xsl:when>
  51. <xsl:otherwise>
  52. <script language="javascript">
  53. <xsl:if test="$url">
  54. function getRedirectUrl(){
  55. <xsl:variable name="request-uri">
  56. <xsl:choose>
  57. <xsl:when test="$series7">
  58. <xsl:value-of select="/root/configuration/property[@name = 'gateway']"/>
  59. </xsl:when>
  60. <xsl:otherwise>
  61. <xsl:value-of select="/root/http/param[@name='SCRIPT_NAME']"/>
  62. </xsl:otherwise>
  63. </xsl:choose>
  64. <xsl:text>?b_action=xts.run&amp;m=/cps4/common/back.xts&amp;urlEncoded=</xsl:text>
  65. <xsl:value-of select="$is-url-base64encoded"/>
  66. <xsl:if test="$url">
  67. <xsl:text>&amp;url=</xsl:text>
  68. <xsl:value-of select="xtsext:urlencode($url)"/>
  69. </xsl:if>
  70. <xsl:if test="$action">
  71. <xsl:text>&amp;action=</xsl:text>
  72. <xsl:value-of select="$action"/>
  73. </xsl:if>
  74. <xsl:if test="$series7">
  75. <xsl:text>&amp;s7=1</xsl:text>
  76. </xsl:if>
  77. </xsl:variable>
  78. <xsl:variable name="new-url">
  79. <xsl:choose>
  80. <xsl:when test="$is-url-base64encoded">
  81. <xsl:value-of select="xtsext:web64decode($url, true())"/>
  82. </xsl:when>
  83. <xsl:otherwise>
  84. <xsl:value-of select="$url"/>
  85. </xsl:otherwise>
  86. </xsl:choose>
  87. <xsl:choose>
  88. <xsl:when test="$series7">
  89. <xsl:text>&amp;BACK=</xsl:text>
  90. <xsl:value-of select="xtsext:urlencode($request-uri)"/>
  91. </xsl:when>
  92. <xsl:otherwise>
  93. <xsl:text>&amp;ui.backURL=</xsl:text>
  94. <xsl:value-of select="xtsext:protect(xtsext:urlencode($request-uri),'url','url','getdata')"/>
  95. </xsl:otherwise>
  96. </xsl:choose>
  97. </xsl:variable>
  98. <!-- Used for unit testing -->
  99. <xsl:if test="/root/unitTest = 'true'">
  100. <xsl:text>/*</xsl:text>
  101. <requestUri><xsl:value-of select="$request-uri"/></requestUri>
  102. <redirectUrl><xsl:value-of select="$new-url"/></redirectUrl>
  103. <xsl:text>*/</xsl:text>
  104. </xsl:if>
  105. return "<xsl:value-of select="xtsext:javascriptencode($new-url)"/>";
  106. }
  107. </xsl:if>
  108. function redirect(){
  109. <xsl:if test="$url ">
  110. location.href=getRedirectUrl();
  111. </xsl:if>
  112. }
  113. </script>
  114. <div class="boxbody">
  115. <table border="0" cellspacing="0" cellpadding="0" width="100%">
  116. <tr>
  117. <td class="portlet-font" align="center" valign="middle" height="100">
  118. <xsl:choose>
  119. <xsl:when test="$action = 'run'">
  120. <xts:string id="IDS_NAV_VEW_CLICK_RUN"/><br/>
  121. <a href="#" onclick="redirect()">
  122. <img src="{$images}action_run_report_20.gif" border="0" >
  123. <xsl:attribute name="alt"><xts:string id="IDS_NAV_VEW_RUN_NOW"/></xsl:attribute>
  124. </img>
  125. </a>
  126. </xsl:when>
  127. <xsl:otherwise>
  128. <xts:string id="IDS_NAV_VEW_CLICK_VIEW"/><br/>
  129. <a href="#" onclick="redirect()">
  130. <img src="{$images}action_view_report_20.gif" border="0">
  131. <xsl:attribute name="alt"><xts:string id="IDS_NAV_VEW_VIEW_NOW"/></xsl:attribute>
  132. </img>
  133. </a>
  134. </xsl:otherwise>
  135. </xsl:choose>
  136. </td>
  137. </tr>
  138. </table>
  139. </div>
  140. </xsl:otherwise>
  141. </xsl:choose>
  142. </body>
  143. </html>
  144. </xsl:template>
  145. </xsl:stylesheet>
  146. </xts:block>
  147. </xts:morphlet>