functionTreeRequest.xts 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: AGS
  5. (C) Copyright IBM Corp. 2005, 2008
  6. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. -->
  8. <xts:morphlet resolverBase="prompting" xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="messages/portal.xml" requiredCapability="canUseEventStudio">
  9. <!-- place the specificiation we want into the DOM -->
  10. <xts:block id="buildSpecification" processor="XSLT" type="exec">
  11. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt">
  12. <xsl:template match="/">
  13. <xts:sequence>
  14. <xts:append>
  15. <specification>
  16. &lt;metadataRequest connection=&quot;<xsl:value-of select="xtsext:xmlencode(string(/root/env/param[@name='model']))"/>&quot;&gt;
  17. &lt;Functions authoringLocale=&quot;<xsl:value-of select="/root/env/param[@name='cl']"/>&quot; xml:lang=&quot;<xsl:value-of select="/root/env/param[@name='pl']"/>&quot;&gt;
  18. &lt;Properties&gt;
  19. &lt;Property name=&quot;/@decimalSeparator&quot;/&gt;
  20. &lt;Property name=&quot;/@listSeparator&quot;/&gt;
  21. &lt;Property name=&quot;./group&quot;/&gt;
  22. &lt;Property name=&quot;*/@id&quot;/&gt;
  23. &lt;Property name=&quot;group/@name&quot;/&gt;
  24. &lt;Property name=&quot;group/@qosLevel&quot;/&gt;
  25. &lt;Property name=&quot;./function&quot;/&gt;
  26. &lt;Property name=&quot;function/@name&quot;/&gt;
  27. &lt;Property name=&quot;function/@tip&quot;/&gt;
  28. &lt;Property name=&quot;function/@syntax&quot;/&gt;
  29. &lt;Property name=&quot;function/@dropText&quot;/&gt;
  30. &lt;Property name=&quot;function/@type&quot;/&gt;
  31. &lt;Property name=&quot;function/@qosLevel&quot;/&gt;
  32. &lt;/Properties&gt;
  33. &lt;Constraints&gt;
  34. &lt;Constraint Condition=&quot;FDS[@context=&apos;tabular&apos;]&quot;/&gt;
  35. &lt;/Constraints&gt;
  36. &lt;/Functions&gt;
  37. &lt;/metadataRequest&gt;
  38. </specification>
  39. </xts:append>
  40. </xts:sequence>
  41. </xsl:template>
  42. </xsl:stylesheet>
  43. </xts:block>
  44. <!-- call the getExternalRequest to see if the request came from the /ext entry point -->
  45. <xts:block id="getExternalRequest" dependency="buildSpecification" processor="XSLT" type="exec">
  46. <xts:logicsheet path="logicsheets/portal.xsl"/>
  47. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" exclude-result-prefixes="pf">
  48. <pf:variables/>
  49. <xsl:template match="/">
  50. <xts:sequence>
  51. <xts:append>
  52. <externalRequest>
  53. <xts:function name="getRequestExternal" xmlns:xts="http://developer.cognos.com/schemas/xts/">
  54. <xts:param name="passport">
  55. <xsl:value-of select="$passport"/>
  56. </xts:param>
  57. <xts:param name="secureState">
  58. <xsl:value-of select="/root/header/*[local-name()='biBusHeader']/*[local-name()='CAF']/*[local-name()='secureState']"/>
  59. </xts:param>
  60. </xts:function>
  61. </externalRequest>
  62. </xts:append>
  63. </xts:sequence>
  64. </xsl:template>
  65. </xsl:stylesheet>
  66. </xts:block>
  67. <!-- depending on the output of the getExternalRequest request - sign the request -->
  68. <xts:block id="signSpecification" dependency="getExternalRequest" processor="XSLT" type="exec">
  69. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt">
  70. <xsl:template match="/">
  71. <xts:sequence>
  72. <xts:append>
  73. <signedSpec>
  74. <xsl:choose>
  75. <xsl:when test="/root/getRequestExternalResponse">
  76. <xts:function name="signReportSpec" xmlns:xts="http://developer.cognos.com/schemas/xts/">
  77. <xts:param name="source">
  78. <xsl:value-of select="/root/specification"/>
  79. </xts:param>
  80. </xts:function>
  81. </xsl:when>
  82. <xsl:otherwise>
  83. <xsl:value-of select="/root/specification"/>
  84. </xsl:otherwise>
  85. </xsl:choose>
  86. </signedSpec>
  87. </xts:append>
  88. </xts:sequence>
  89. </xsl:template>
  90. </xsl:stylesheet>
  91. </xts:block>
  92. <!-- build the output we want with the signed request -->
  93. <xts:block id="makeRequest" dependency="signSpecification" mode="output" mimeType="text/xml" processor="XSLT" type="exec">
  94. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt">
  95. <xsl:output method="xml" version="1.0" encoding="UTF-8"/>
  96. <!-- build the function tree request -->
  97. <xsl:template match="/">
  98. <xsl:call-template name="makeFunctionTreeRequest"/>
  99. </xsl:template>
  100. <!-- call the template which is going to make the function tree request -->
  101. <xsl:template name="makeFunctionTreeRequest">
  102. <bus:value xsi:type="bus:specification" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  103. <xsl:value-of select="/root/signedSpec"/>
  104. </bus:value>
  105. </xsl:template>
  106. </xsl:stylesheet>
  107. </xts:block>
  108. </xts:morphlet>