reportTemplateRequest.xts 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. BI and PM: qs
  5. (C) Copyright IBM Corp. 2001, 2017
  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. <xts:morphlet version="1.0" xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="messages/QSRVUITextPL.xml,messages/portal.xml,messages/portalRL.xml" requiredCapability="canUseQueryStudio">
  13. <!--
  14. ===============================================================================================
  15. getContent - get our data from Content Manager
  16. ===============================================================================================
  17. -->
  18. <xts:block id="getContent" processor="XSLT" type="exec">
  19. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  20. <xsl:stylesheet
  21. xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
  22. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
  23. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  24. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  25. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  26. <xsl:variable name="objectPath" select="/root/env/param[@name = 'm_obj']"/>
  27. <xsl:variable name="isQS" select="/root/env/param[@name = 'm_app']"/>
  28. <xsl:variable name="containerPath" select="/root/env/param[@name='xxPath']"/>
  29. <xsl:template match="/">
  30. <xts:sequence>
  31. <!-- If a new path has been chosen (or handed to us on the request) then get its ancestors.-->
  32. <xsl:if test=" $containerPath != '' ">
  33. <xts:append>
  34. <newpath>
  35. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  36. <send:request provider="cm">
  37. <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
  38. <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  39. <cm:search>
  40. <xsl:value-of select="$containerPath"/>
  41. </cm:search>
  42. <cm:properties>
  43. <cm:property name="defaultName"/>
  44. <cm:property name="searchPath"/>
  45. <cm:property name="permissions"/>
  46. <cm:property name="ancestors"/>
  47. </cm:properties>
  48. </cm:query>
  49. </xts:transform>
  50. </send:request>
  51. </xts:transform>
  52. </newpath>
  53. </xts:append>
  54. </xsl:if>
  55. </xts:sequence>
  56. </xsl:template>
  57. </xsl:stylesheet>
  58. </xts:block>
  59. <xts:block id="parseContent" mode="output" processor="XSLT" type="exec" mimeType="application/x-javascript" dependency="getContent">
  60. <!-- get the new theme stuff -->
  61. <xts:logicsheet path="logicsheets/portal.xsl"/>
  62. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  63. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  64. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" version="1.0"
  65. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  66. xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
  67. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  68. xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/"
  69. exclude-result-prefixes="cf cm df pf">
  70. <xsl:output method="text" version="1.0" encoding="UTF-8" indent="no"/>
  71. <!-- add any theme variables -->
  72. <df:variables/>
  73. <pf:variables/>
  74. <xsl:template match="/root">
  75. <xsl:variable name="path">
  76. <xsl:value-of select="newpath/cm:queryResponse/*/cm:searchPath"/>
  77. </xsl:variable>
  78. var responseArray = new Array("<xsl:value-of select="xtsext:javascriptencode(string($path))"/>",
  79. <xsl:choose>
  80. <xsl:when test="$path!=''">
  81. <!-- Determine if the current path points to the personal folder space (We need a session element to make this determination) -->
  82. <xsl:variable name="isPersonalPath" select="starts-with($path, '~') or ( key('session-param', 'e_hp') and starts-with($path, key('session-param', 'e_hp')) )"/>
  83. <!-- For personal folder destinations, render the path starting at the directory/namespace/account/folder ancestor. -->
  84. <xsl:variable name="rootPath">
  85. <xsl:choose>
  86. <xsl:when test="$isPersonalPath">
  87. <xsl:value-of select="concat(key('session-param', 'e_hp'), '/folder')"/>
  88. </xsl:when>
  89. <xsl:when test="starts-with($path, '/content')">
  90. <xsl:value-of select="$defaultContentRoot"/>
  91. </xsl:when>
  92. </xsl:choose>
  93. </xsl:variable>
  94. <xsl:variable name="fullPath">
  95. <cf:do-the-path-link>
  96. <cf:param name="familytree">newpath/cm:queryResponse/*/cm:ancestors</cf:param>
  97. <cf:param name="familymember">newpath/cm:queryResponse/*/cm:defaultName</cf:param>
  98. <cf:param name="home"><xsl:value-of select="$rootPath"/></cf:param>
  99. </cf:do-the-path-link>
  100. </xsl:variable>
  101. "<xsl:value-of select="xtsext:javascriptencode(string($fullPath))"/>"
  102. </xsl:when>
  103. <xsl:otherwise>"<xts:string id="REPORT_TEMPLATE_NONE"/>"</xsl:otherwise>
  104. </xsl:choose>)
  105. </xsl:template>
  106. </xsl:stylesheet>
  107. </xts:block>
  108. </xts:morphlet>