cmroots.xml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. <!-- File: Content request for retrieving the default names of the "public" or "Personal" tabs -->
  13. <xsl:stylesheet version="1.0"
  14. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  15. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  16. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
  17. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  18. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  19. <xsl:output method="xml" version="1.0" encoding="UTF-8" omit-xml-declaration="yes" indent="no"/>
  20. <xsl:template match="root">
  21. <xts:sequence>
  22. <!-- Get the defaultName property of the "public" and "personal" folder spaces -->
  23. <xts:append>
  24. <cmRoots>
  25. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  26. <send:request provider="cm">
  27. <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
  28. <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  29. <cm:requests>
  30. <cm:query>
  31. <cm:search>/content</cm:search>
  32. <cm:properties><cm:property name="defaultName"/></cm:properties>
  33. </cm:query>
  34. <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  35. <cm:search>~/folder</cm:search>
  36. <cm:properties><cm:property name="defaultName"/></cm:properties>
  37. </cm:query>
  38. <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  39. <cm:search>~</cm:search>
  40. <cm:properties><cm:property name="searchPath"/></cm:properties>
  41. </cm:query>
  42. </cm:requests>
  43. </cm:query>
  44. </xts:transform>
  45. </send:request>
  46. </xts:transform>
  47. </cmRoots>
  48. </xts:append>
  49. <xsl:choose>
  50. <!-- If there is an existing session with "root" parameters in it then update the root parameters. -->
  51. <xsl:when test="/root/session/param[@name='e_proot']">
  52. <xts:replace select="/root/session/param[@name='e_proot']">
  53. <param name="e_proot"><xts:function name="xmlencode"><xts:param name="source"><xts:queryValue select="/root/cmRoots/*[local-name()='queryResponse']/*[local-name()='queryReply'][1]/*/*[local-name()='defaultName']"/></xts:param></xts:function></param>
  54. </xts:replace>
  55. <xts:replace select="/root/session/param[@name='e_mroot']">
  56. <param name="e_mroot"><xts:function name="xmlencode"><xts:param name="source"><xts:queryValue select="/root/cmRoots/*[local-name()='queryResponse']/*[local-name()='queryReply'][2]/*/*[local-name()='defaultName']"/></xts:param></xts:function></param>
  57. </xts:replace>
  58. <xts:replace select="/root/session/param[@name='e_hp']">
  59. <param name="e_hp"><xts:function name="xmlencode"><xts:param name="source"><xts:queryValue select="/root/cmRoots/*[local-name()='queryResponse']/*[local-name()='queryReply'][3]/*/*[local-name()='searchPath']"/></xts:param></xts:function></param>
  60. </xts:replace>
  61. </xsl:when>
  62. <!-- There is no portal session to update. We must be here through a back door. Fake a sesion element to be used for processing this request only and add the e_proot, mroot and hp params to it. -->
  63. <xsl:otherwise>
  64. <xts:append select="/root/session">
  65. <param name="e_proot"><xts:function name="xmlencode"><xts:param name="source"><xts:queryValue select="/root/cmRoots/*[local-name()='queryResponse']/*[local-name()='queryReply'][1]/*/*[local-name()='defaultName']"/></xts:param></xts:function></param>
  66. <param name="e_mroot"><xts:function name="xmlencode"><xts:param name="source"><xts:queryValue select="/root/cmRoots/*[local-name()='queryResponse']/*[local-name()='queryReply'][2]/*/*[local-name()='defaultName']"/></xts:param></xts:function></param>
  67. <param name="e_hp"><xts:function name="xmlencode"><xts:param name="source"><xts:queryValue select="/root/cmRoots/*[local-name()='queryResponse']/*[local-name()='queryReply'][3]/*/*[local-name()='searchPath']"/></xts:param></xts:function></param>
  68. </xts:append>
  69. </xsl:otherwise>
  70. </xsl:choose>
  71. <!-- Clean up -->
  72. <xts:delete select="/root/cmRoots/*[local-name()='queryResponse']"/>
  73. </xts:sequence>
  74. </xsl:template>
  75. </xsl:stylesheet>