get_content_nav.xslt 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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, 2013
  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 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
  13. xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/"
  14. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  15. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  16. xmlns:nav="http://developer.cognos.com/schemas/cps/navigation/1/"
  17. xmlns:pg="http://developer.cognos.com/schemas/xts/pg"
  18. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  19. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  20. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  21. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/">
  22. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  23. <xsl:key name="system-param" match="/root/system/param" use="@name"/>
  24. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  25. <xsl:key name="session-param" match="/root/session/param" use="@name"/>
  26. <pf:variables/>
  27. <xsl:template match="/">
  28. <xsl:variable name="navSearchSpec" select="/root/search/navSearchSpec"/>
  29. <xsl:variable name="maxObjects">
  30. <xsl:choose>
  31. <xsl:when test="string(key('env-param','m_pagertosearch')) !='' and string(key('env-param','m_pagerfromsearch')) != ''">
  32. <xsl:value-of select="key('env-param','m_pagertosearch') - key('env-param','m_pagerfromsearch') + 1"/>
  33. </xsl:when>
  34. <xsl:when test="string(key('session-param', 'linesPerPage'))!=''">
  35. <xsl:value-of select="key('session-param', 'linesPerPage')"/>
  36. </xsl:when>
  37. <xsl:otherwise>
  38. <xsl:value-of select="key('system-param', 'defaultUserPreferences')/pref[@name='lines']"/>
  39. </xsl:otherwise>
  40. </xsl:choose>
  41. </xsl:variable>
  42. <xsl:variable name="skipObjects">
  43. <xsl:choose>
  44. <xsl:when test="key('env-param', 'm_pagerfromsearch') and string(key('env-param', 'm_pagerfromsearch'))!=''">
  45. <xsl:value-of select="(key('env-param','m_pagerfromsearch'))-1"/>
  46. </xsl:when>
  47. <xsl:when test="key('env-param', 'm_searchsection') != ''">
  48. <xsl:choose>
  49. <xsl:when test="key('env-param', 'm_searchsection') != '-1'">
  50. <xsl:value-of select="((key('env-param', 'm_searchsection')) -1)"/>
  51. </xsl:when>
  52. <xsl:otherwise>
  53. <xsl:value-of select="($maxObjects) * -1"/>
  54. </xsl:otherwise>
  55. </xsl:choose>
  56. </xsl:when>
  57. <xsl:otherwise>0</xsl:otherwise>
  58. </xsl:choose>
  59. </xsl:variable>
  60. <xts:sequence>
  61. <!-- save/clear index drill search context -->
  62. <pg:store_cs_filter>
  63. <pg:cs_filter>key('env-param', 'cs_filter')</pg:cs_filter>
  64. </pg:store_cs_filter>
  65. <xts:append>
  66. <navContent>
  67. <xts:request href="bus://dispatcher" protocol="NAV" responseEnvelope="false" outputHeader="false">
  68. <SOAP-ENV:Envelope
  69. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  70. xmlns:nav="http://developer.cognos.com/schemas/cps/navigation/1/"
  71. xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  72. xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
  73. xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  74. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  75. xmlns:xs="http://www.w3.org/2001/XMLSchema">
  76. <SOAP-ENV:Header>
  77. <xsl:copy-of select="/root/header/bus:biBusHeader"/>
  78. </SOAP-ENV:Header>
  79. <SOAP-ENV:Body>
  80. <nav:search>
  81. <!-- nav options -->
  82. <nav:validateTag fault="true"/>
  83. <xsl:copy-of select="$navSearchSpec/*"/>
  84. <nav:skipObjects><xsl:value-of select="$skipObjects"/></nav:skipObjects>
  85. <nav:maxObjects><xsl:value-of select="$maxObjects"/></nav:maxObjects>
  86. <!-- nav properties -->
  87. <nav:param name="postUrl"/>
  88. <nav:param name="backUrl">false</nav:param>
  89. <nav:param name="urlFlags">h1t1</nav:param>
  90. <nav:property name="scopeInfo"/>
  91. <nav:property name="fullPath"/>
  92. <nav:property name="fullName"/>
  93. <nav:property name="icons"/>
  94. <nav:property name="screenTip"/>
  95. <nav:property name="createDate"/>
  96. <nav:property name="lastModifiedDate"/>
  97. <nav:property name="action"/>
  98. <nav:property name="actionsURL"/>
  99. <nav:property name="newState"/>
  100. <nav:property name="readState"/>
  101. <nav:property name="status"/>
  102. <nav:property name="hidden"/>
  103. <xsl:if test="/root/session/param[@name='e_showTenantInfo']='true'">
  104. <nav:property name="tenantID"/>
  105. </xsl:if>
  106. <xsl:if test="key('system-param', 'hide-rss-feed-links') != 'true'">
  107. <nav:property name="description"/>
  108. </xsl:if>
  109. <nav:param name="gatewayURL"><xsl:value-of select="$gateway"/></nav:param>
  110. <nav:param name="webContentURL">..</nav:param>
  111. <nav:param name="portalAgent">cognos</nav:param>
  112. <nav:param name="browserAgent"><xsl:value-of select="$browser"/></nav:param>
  113. </nav:search>
  114. </SOAP-ENV:Body>
  115. </SOAP-ENV:Envelope>
  116. </xts:request>
  117. </navContent>
  118. </xts:append>
  119. </xts:sequence>
  120. </xsl:template>
  121. </xsl:stylesheet>