cs.xts 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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. <!-- $Header: //ps/main/prod/templates/ps/portal/cs.xts#3 $ -->
  13. <!-- $DateTime: 2010/04/01 10:04:17 $ -->
  14. <!-- $Change: 29055 $ -->
  15. <xts:morphlet version="1.0" xmlns:xts="http://developer.cognos.com/schemas/xts/">
  16. <xts:block id="request" type="exec" mode="interpret" processor="XSLT">
  17. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt">
  18. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  19. <xsl:template match="/">
  20. <xsl:variable name="terms" select="/root/env/param[@name='terms']"/>
  21. <xsl:variable name="node" select="/root/env/param[@name='node']"/>
  22. <xts:sequence>
  23. <xts:append>
  24. <xts:request protocol="BUS" target="bus://dispatcher" soapAction="http://developer.cognos.com/schemas/indexSearchService/1">
  25. <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/">
  26. <SOAP-ENV:Header>
  27. <xsl:copy-of select="/root/header/*"/>
  28. </SOAP-ENV:Header>
  29. <SOAP-ENV:Body>
  30. <ns:search xmlns:ns="http://developer.cognos.com/schemas/indexSearchService/1/" xmlns:bibus="http://developer.cognos.com/schemas/bibus/3/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  31. <cs:document xmlns:cs="http://developer.cognos.com/schemas/cs/">
  32. <cs:request>
  33. <cs:searchQuery>
  34. <cs:terms>
  35. <xsl:value-of select="$terms"/>
  36. </cs:terms>
  37. <cs:requestParameters>
  38. <cs:searchType>tree</cs:searchType>
  39. <cs:includeSearchQuery>true</cs:includeSearchQuery>
  40. <cs:includeSearchConversation>true</cs:includeSearchConversation>
  41. <cs:includeSecurityContext>false</cs:includeSecurityContext>
  42. <cs:treeQuery levels="1" expand="*">
  43. <xsl:if test="$node and $node!=''">
  44. <cs:subTree path="{$node}"/>
  45. </xsl:if>
  46. </cs:treeQuery>
  47. </cs:requestParameters>
  48. </cs:searchQuery>
  49. <cs:sourceContext/>
  50. </cs:request>
  51. </cs:document>
  52. </ns:search>
  53. </SOAP-ENV:Body>
  54. </SOAP-ENV:Envelope>
  55. </xts:request>
  56. </xts:append>
  57. </xts:sequence>
  58. </xsl:template>
  59. </xsl:stylesheet>
  60. </xts:block>
  61. <xts:block dependency="request" id="xmlresult" type="exec" mode="interpret" processor="XSLT">
  62. <xsl:stylesheet version="1.0" xmlns:cs="http://developer.cognos.com/schemas/cs" xmlns:ns="http://developer.cognos.com/schemas/indexSearchService/1/" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
  63. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  64. <xsl:variable name="node" select="/root/env/param[@name='node']"/>
  65. <xsl:template match="/">
  66. <xts:sequence>
  67. <xts:append select="/root/output">
  68. <xos:part xmlns:xos="http://developer.cognos.com/schemas/xts/output/">
  69. <xos:entityHeader>
  70. <xos:param name="Content-Type">text/xml</xos:param>
  71. <xos:param name="Cache-Control">max-age=3600</xos:param>
  72. </xos:entityHeader>
  73. <xos:entityBody>
  74. <xsl:choose>
  75. <xsl:when test="$node and $node!=''">
  76. <SubjectTree>
  77. <xsl:copy-of select="/root/ns:searchResponse/result/cs:document/cs:result/cs:extensions/cs:subjectTree/QueryDescription/SubjectTree/Subject/Subject"/>
  78. </SubjectTree>
  79. </xsl:when>
  80. <xsl:otherwise>
  81. <xsl:copy-of select="/root/ns:searchResponse/result/cs:document/cs:result/cs:extensions/cs:subjectTree/QueryDescription/SubjectTree"/>
  82. </xsl:otherwise>
  83. </xsl:choose>
  84. </xos:entityBody>
  85. </xos:part>
  86. </xts:append>
  87. </xts:sequence>
  88. </xsl:template>
  89. </xsl:stylesheet>
  90. </xts:block>
  91. <xts:block id="fault_request" type="fault" processor="XSLT">
  92. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
  93. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  94. <xsl:template match="/">
  95. <error>
  96. <xsl:copy-of select="/root/fault"/>
  97. </error>
  98. </xsl:template>
  99. </xsl:stylesheet>
  100. </xts:block>
  101. </xts:morphlet>