upf_actions.xts 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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. <!-- Get the Theme properties description from Upfront -->
  13. <xts:morphlet xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="messages/portal.xml, messages/portalRL.xml">
  14. <xts:block id="getThemeProperties" processor="XSLT" type="exec">
  15. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  16. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  17. <xsl:key name="user-prefs" match="/root/user/param" use="@name"/>
  18. <xsl:template match="/">
  19. <xsl:variable name="encoding">
  20. <xsl:choose>
  21. <xsl:when test="/root/system/param[@name='series7']/encoding and /root/system/param[@name='series7']/encoding != ''">
  22. <xsl:value-of select="/root/system/param[@name='series7']/encoding"/>
  23. </xsl:when>
  24. <xsl:otherwise>UTF-8</xsl:otherwise>
  25. </xsl:choose>
  26. </xsl:variable>
  27. <xts:sequence>
  28. <xts:append>
  29. <upfThemeProperties>
  30. <xts:transform src="transforms/upfront/post-process_tp.xslt" processor="XSLT">
  31. <xts:request protocol="COGX" href="cogx://upfront" faultBlock="cogx-fault">
  32. <xts:param name="host"><xsl:value-of select="/root/system/param[@name='series7']/host"/></xts:param>
  33. <xts:param name="port"><xsl:value-of select="/root/system/param[@name='series7']/port"/></xts:param>
  34. <xts:param name="encoding"><xsl:value-of select="$encoding"/></xts:param>
  35. <envelope xmlns="http://developer.cognos.com/schemas/cogx/">
  36. <routing xmlns="http://developer.cognos.com/schemas/cogx/">
  37. <apiversion>2.0</apiversion>
  38. <dispatcher did="cogx://upfront:8030"/>
  39. <sender component="CC" version="1.0" msgversion="3.0"/>
  40. <target>upfront</target>
  41. </routing>
  42. <command xmlns="http://developer.cognos.com/schemas/cogx/">
  43. <apiversion>3.0</apiversion>
  44. <sender component="CC" version="1.0" msgversion="3.0"/>
  45. <messageattribute>
  46. <ticket>
  47. <xsl:value-of select="/root/cookies/cookie[@name='AS_TICKET']"/>
  48. </ticket>
  49. <language><xsl:value-of select="key('user-prefs', 'productLocale')"/></language>
  50. <locale><xsl:value-of select="key('user-prefs', 'contentLocale')"/></locale>
  51. <timezoneid><xsl:value-of select="key('user-prefs', 'timeZoneID')"/></timezoneid>
  52. <!-- it is OK to hard-code this to "ie" since the file we are requesting is browser-neutral -->
  53. <browser>ie</browser>
  54. </messageattribute>
  55. <message>
  56. <getTemplate xmlns="http://developer.cognos.com/schemas/upfront/">
  57. <Template><xsl:value-of select="translate(string(/root/env/param[@name = 'provider']),'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')"/>_themeproperties.xml</Template>
  58. </getTemplate>
  59. </message>
  60. </command>
  61. </envelope>
  62. </xts:request>
  63. </xts:transform>
  64. </upfThemeProperties>
  65. </xts:append>
  66. </xts:sequence>
  67. </xsl:template>
  68. </xsl:stylesheet>
  69. </xts:block>
  70. <!-- Fault handler for cogx -->
  71. <!-- ============================================================================= -->
  72. <xts:block id="cogx-fault" type="fault" path="portal/faults/cogx-fault.xslt" processor="XSLT"/>
  73. <!-- Output -->
  74. <!-- ============================================================================= -->
  75. <xts:block id="format" mode="output" processor="XSLT" type="exec" mimeType="text/html" dependency="getThemeProperties">
  76. <xts:logicsheet path="logicsheets/portal.xsl"/>
  77. <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">
  78. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  79. <xsl:template match="/root">
  80. <!-- Get the target actions template. If no actions template is specified then default to the generic one -->
  81. <xsl:variable name="target_template">
  82. <xsl:choose>
  83. <xsl:when test="/root/upfThemeProperties/Provider/Property[./Name = 'Actions']/Value != ''">
  84. <xsl:value-of select="/root/upfThemeProperties/Provider/Property[./Name = 'Actions']/Value"/>
  85. </xsl:when>
  86. <xsl:otherwise>ni_actions.utml</xsl:otherwise>
  87. </xsl:choose>
  88. </xsl:variable>
  89. <!-- Build the redirection URL -->
  90. <xsl:variable name="redirect-url">
  91. <xsl:value-of select="/root/system/param[@name='series7']/gateway"/>
  92. <xsltext/>?xmlcmd=&lt;GetPage>&lt;Template><xsl:value-of select="$target_template"/>&lt;/Template>&lt;/GetPage><xsl:text/>
  93. <xsl:text/>&amp;id=<xsl:value-of select="/root/env/param[@name = 'id']"/><xsltext/>
  94. <xsl:text/>&amp;LA=<xsl:value-of select="/root/env/param[@name = 'LA']"/><xsl:text/>
  95. <xsl:text/>&amp;LO=<xsl:value-of select="/root/env/param[@name = 'LO']"/><xsl:text/>
  96. <xsl:text/>&amp;back=<xsl:value-of select="xtsext:urlencode(string(/root/env/param[@name = 'back']))"/><xsl:text/>
  97. </xsl:variable>
  98. <html lang="{/root/user/param[@name='productLocale']}">
  99. <head>
  100. <meta http-equiv="refresh" content="0; URL={xtsext:protect(string($redirect-url),'none','s7url','s7url')}"/>
  101. </head>
  102. <body/>
  103. </html>
  104. </xsl:template>
  105. </xsl:stylesheet>
  106. </xts:block>
  107. <!--<xts:block id="debug" type="exec" mode="output" dependency="getThemeProperties" processor="XSLT" mandatory="false" mimeType="text/html">
  108. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  109. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dbg="http://developer.cognos.com/schemas/xts/logicsheets/xslt/debug/" exclude-result-prefixes="dbg">
  110. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  111. <dbg:templates/>
  112. <xsl:template match="/">
  113. <dbg:dumpxml select="/root"/>
  114. </xsl:template>
  115. </xsl:stylesheet>
  116. </xts:block>-->
  117. </xts:morphlet>