navigator.xts 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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. <!--
  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/">
  13. <xts:block id="getContent" type="exec"
  14. condition=".[not(/root/env/param[@name='frag-directive']='meta-only')]"
  15. mode="interpret" processor="XSLT">
  16. <xsl:stylesheet version="1.0"
  17. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  18. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  19. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  20. xmlns:xos="http://developer.cognos.com/schemas/xts/output/"
  21. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  22. xmlns:nav="http://developer.cognos.com/schemas/cps/navigation/1/"
  23. xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  24. exclude-result-prefixes="xts xos bus nav SOAP-ENV">
  25. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  26. <xsl:include href="/fragments/mvc/includes/common-include.xslt"/>
  27. <xsl:template match="/">
  28. <xsl:variable name="container-id">
  29. <xsl:choose>
  30. <xsl:when test="string($params[@name='containerId']) != ''">
  31. <xsl:choose>
  32. <xsl:when test="$params[@name='containerId'] = 'systemDefault' or $params[@name='containerId'] = 'userDefault' or $params[@name='containerId'] = 'rootDefault'">
  33. <xsl:value-of select="$params[@name='containerId']"/>
  34. </xsl:when>
  35. <xsl:otherwise>
  36. <xsl:if test="not(starts-with($params[@name='containerId'], '_'))">
  37. <xsl:text/>path:<xsl:text/>
  38. </xsl:if>
  39. <xsl:value-of select="$params[@name='containerId']"/>
  40. </xsl:otherwise>
  41. </xsl:choose>
  42. </xsl:when>
  43. <xsl:when test="string($params[@name='customContentId']) != ''">
  44. <xsl:value-of select="$params[@name='customContentId']"/>
  45. </xsl:when>
  46. <xsl:otherwise>
  47. <xsl:text/>systemDefault<xsl:text/>
  48. </xsl:otherwise>
  49. </xsl:choose>
  50. </xsl:variable>
  51. <xts:sequence>
  52. <xts:append select="/root/output">
  53. <xos:part>
  54. <xos:entityHeader>
  55. <xos:param name="Content-Type">text/xml; charset=UTF-8</xos:param>
  56. </xos:entityHeader>
  57. <xos:entityBody>
  58. <response>
  59. <logic>
  60. <configured-gateway><xts:function name="getConfiguration"><xts:param name="gateway"/></xts:function></configured-gateway>
  61. <xsl:copy-of select="/root/state"/>
  62. <xsl:if test="string($container-id) != ''">
  63. <xts:request name="NAV" faultBlock="requestFault">
  64. <SOAP-ENV:Envelope>
  65. <SOAP-ENV:Header>
  66. <xsl:copy-of select="/root/bus:biBusHeader"/>
  67. </SOAP-ENV:Header>
  68. <SOAP-ENV:Body>
  69. <nav:getContainer>
  70. <nav:validateTag/>
  71. <nav:id><xsl:value-of select="$container-id"/></nav:id>
  72. <nav:childObjects>all</nav:childObjects>
  73. <xsl:call-template name="build-pagination-params"/>
  74. <nav:param name="postUrl"/>
  75. <nav:param name="backUrl">rewrite</nav:param>
  76. <nav:param name="browserAgent"><xsl:value-of select="$browser"/></nav:param>
  77. <!-- properties -->
  78. <xsl:call-template name="build-navQuery-properties"/>
  79. </nav:getContainer>
  80. </SOAP-ENV:Body>
  81. </SOAP-ENV:Envelope>
  82. </xts:request>
  83. </xsl:if>
  84. </logic>
  85. </response>
  86. </xos:entityBody>
  87. </xos:part>
  88. </xts:append>
  89. </xts:sequence>
  90. </xsl:template>
  91. </xsl:stylesheet>
  92. </xts:block>
  93. <xts:block id="requestFault" type="fault" processor="XSLT">
  94. <xsl:stylesheet version="1.0"
  95. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  96. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  97. exclude-result-prefixes="xts">
  98. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  99. <xsl:include href="/fragments/mvc/includes/common-include.xslt"/>
  100. <xsl:template match="/">
  101. <xsl:call-template name="handleException"/>
  102. </xsl:template>
  103. </xsl:stylesheet>
  104. </xts:block>
  105. </xts:morphlet>