spParamRequest.xts 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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, 2014
  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. <xts:logicsheet path="logicsheets/portal.xsl"/>
  12. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" version="1.0" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="pf bus xtsext">
  13. <pf:variables/>
  14. <xsl:template match="/">
  15. <xsl:variable name="storedProc">
  16. <!-- when there is something in the update spec use that if not then blank the variable. -->
  17. <xsl:value-of select="/root/env/param[@name='sql_procedure_name']"/>
  18. </xsl:variable>
  19. <xts:sequence>
  20. <xts:append>
  21. <specification>
  22. &lt;qs:command xmlns:qs=&quot;http://developer.cognos.com/schemas/qf_xml_api/3/&quot;&gt;
  23. &lt;connection&gt;
  24. &lt;QFProviderType value=&quot;QueryFrameworkService&quot;/&gt;
  25. &lt;contentManagerURI value=&quot;<xsl:value-of select="/root/configProps/param/property[@name='contentManager']"/>&quot;/&gt;
  26. &lt;productLocale value=&quot;<xsl:value-of select="/root/env/param[@name='pl']"/>&quot;/&gt;
  27. &lt;runLocale value=&quot;<xsl:value-of select="/root/env/param[@name='cl']"/>&quot;/&gt;
  28. &lt;CAMPassport value=&quot;<xsl:value-of select="$passport"/>&quot;/&gt;
  29. &lt;/connection&gt;
  30. &lt;update&gt;
  31. &lt;updateSet&gt;
  32. &lt;modelPath&gt;<xsl:value-of select="/root/env/param[@name='sql_package']"/>&lt;/modelPath&gt;
  33. &lt;updateSubject name=&quot;subject1&quot;&gt;<xts:transform name="XMLEncode"><xsl:value-of select="$storedProc"/></xts:transform>&lt;/updateSubject&gt;
  34. &lt;/updateSet&gt;
  35. &lt;/update&gt;
  36. &lt;/qs:command&gt;
  37. </specification>
  38. </xts:append>
  39. </xts:sequence>
  40. </xsl:template>
  41. </xsl:stylesheet>
  42. </xts:block>
  43. <!--call the getExternalRequest to see if the request came from the /ext entry point -->
  44. <xts:block id="getExternalRequest" dependency="buildSpecification" processor="XSLT" type="exec">
  45. <xts:logicsheet path="logicsheets/portal.xsl"/>
  46. <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">
  47. <pf:variables/>
  48. <xsl:template match="/">
  49. <xts:sequence>
  50. <xts:append>
  51. <externalRequest>
  52. <xts:function name="getRequestExternal" xmlns:xts="http://developer.cognos.com/schemas/xts/">
  53. <xts:param name="passport">
  54. <xsl:value-of select="$passport"/>
  55. </xts:param>
  56. <xts:param name="secureState">
  57. <xsl:value-of select="/root/header/*[local-name()='biBusHeader']/*[local-name()='CAF']/*[local-name()='secureState']"/>
  58. </xts:param>
  59. </xts:function>
  60. </externalRequest>
  61. </xts:append>
  62. </xts:sequence>
  63. </xsl:template>
  64. </xsl:stylesheet>
  65. </xts:block>
  66. <!-- depending on the output of the getExternalRequest request - sign the request -->
  67. <xts:block id="signSpecification" dependency="getExternalRequest" processor="XSLT" type="exec">
  68. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt">
  69. <xsl:template match="/">
  70. <xts:sequence>
  71. <xts:append>
  72. <signedSpec>
  73. <xsl:choose>
  74. <xsl:when test="/root/getRequestExternalResponse">
  75. <xts:function name="signReportSpec" xmlns:xts="http://developer.cognos.com/schemas/xts/">
  76. <xts:param name="source">
  77. <xsl:value-of select="/root/specification"/>
  78. </xts:param>
  79. </xts:function>
  80. </xsl:when>
  81. <xsl:otherwise>
  82. <xsl:value-of select="/root/specification"/>
  83. </xsl:otherwise>
  84. </xsl:choose>
  85. </signedSpec>
  86. </xts:append>
  87. </xts:sequence>
  88. </xsl:template>
  89. </xsl:stylesheet>
  90. </xts:block>
  91. <xts:block id="makeRequest" dependency="signSpecification" mode="output" mimeType="text/xml" processor="XSLT" type="exec">
  92. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt">
  93. <xsl:output method="xml" version="1.0" encoding="UTF-8"/>
  94. <!-- build the metadata request -->
  95. <xsl:template match="/">
  96. <xsl:call-template name="buildMetadataRequest"/>
  97. </xsl:template>
  98. <xsl:template name="buildMetadataRequest">
  99. <bus:value xsi:type="bus:specification" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  100. <xsl:value-of select="/root/signedSpec"/>
  101. </bus:value>
  102. </xsl:template>
  103. </xsl:stylesheet>
  104. </xts:block>
  105. </xts:morphlet>