prepareNavRequests.xslt 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. <xsl:stylesheet version="1.0"
  13. xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  14. <!--
  15. the following imports requires these variables to be defined:
  16. $metaData, $interactions, $logic, $userPreferences, $navRequest, $navResponse
  17. -->
  18. <xsl:import href="/common/propeditor/types/xsdtypes.xslt"/>
  19. <xsl:import href="/common/propeditor/types/fragextTypes.xslt"/>
  20. <xsl:import href="/common/propeditor/types/cmtypes.xslt"/>
  21. <xsl:import href="/common/propeditor/types/cmmtypes.xslt"/>
  22. <xsl:import href="/common/propeditor/types/generictypes.xslt"/>
  23. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  24. <!--
  25. Variable declarations. The xpath "/*[false()]" provides an empty node set result.
  26. -->
  27. <xsl:variable name="interactions" select="/root/interactions"/>
  28. <xsl:variable name="state" select="/root/state"/>
  29. <xsl:variable name="controllerParams" select="/root/controllerParams/param"/>
  30. <xsl:variable name="userPreferences" select="/*[false()]"/>
  31. <xsl:variable name="logic" select="/root/logic"/>
  32. <xsl:variable name="metaData" select="$logic/targetMeta/meta"/>
  33. <xsl:variable name="navRequest" select="/*[false()]"/>
  34. <xsl:variable name="navResponse" select="/*[false()]"/>
  35. <xsl:template match="/">
  36. <response>
  37. <xsl:variable name="fragPortalAgent">
  38. <xsl:choose>
  39. <xsl:when test="$controllerParams[@name='frag-portalAgent'] != ''">
  40. <xsl:value-of select="$controllerParams[@name='frag-portalAgent']"/>
  41. </xsl:when>
  42. <xsl:otherwise>
  43. <xsl:text>cognosFragmentServer</xsl:text>
  44. </xsl:otherwise>
  45. </xsl:choose>
  46. </xsl:variable>
  47. <request>
  48. <SOAP-ENV:Envelope xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:nav="http://developer.cognos.com/schemas/cps/navigation/1/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  49. <SOAP-ENV:Header>
  50. <xsl:copy-of select="/root/bus:biBusHeader"/>
  51. </SOAP-ENV:Header>
  52. <SOAP-ENV:Body>
  53. <nav:request>
  54. <nav:param name="portalAgent"><xsl:value-of select="$fragPortalAgent"/></nav:param>
  55. <nav:queries>
  56. <xsl:for-each select="/root/fragment/meta/customProperties[string(control/@appearance)!='hidden']">
  57. <xsl:apply-templates select="." mode="prepare-nav-request"/>
  58. </xsl:for-each>
  59. </nav:queries>
  60. </nav:request>
  61. </SOAP-ENV:Body>
  62. </SOAP-ENV:Envelope>
  63. </request>
  64. </response>
  65. </xsl:template>
  66. <!-- these are templates required by the markup stage -->
  67. <xsl:template name="getPropertyValue"/>
  68. <xsl:template name="relatedControl"/>
  69. <xsl:template name="keyScript"/>
  70. <xsl:template name="createLanguageSelector"/>
  71. <xsl:template match="customProperties" mode="prepare-nav-request">
  72. <xsl:variable name="prefix" select="substring-before(datatype, ':')"/>
  73. <xsl:variable name="type" select="substring-after(datatype, ':')"/>
  74. <xsl:variable name="namespaceSpecificCustomProps">
  75. <xsl:element name="{$prefix}:{$type}" namespace="{datatype/namespace::*[name() = $prefix]}">
  76. <xsl:copy-of select="self::node()"/>
  77. </xsl:element>
  78. </xsl:variable>
  79. <xsl:apply-templates select="$namespaceSpecificCustomProps/*" mode="navReq"/>
  80. </xsl:template>
  81. </xsl:stylesheet>
  82. <!-- $Header: //cpscrn/main/src/java/etc/webapps/cps/WEB-INF/fragments/producers/common/propeditor/prepareNavRequests.xslt#1 $ -->
  83. <!-- $DateTime: 2008/10/22 11:12:04 $ -->
  84. <!-- $Change: 25109 $ -->