functionList.xts 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. BI and PM: qs
  5. (C) Copyright IBM Corp. 2001, 2019
  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. <xts:morphlet xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="messages/QSRVUITextPL.xml,messages/portal.xml,messages/portalRL.xml" requiredCapability="canUseQueryStudio">
  13. <xts:block id="wait" mode="interpret" processor="XSLT" type="exec" condition=".[/root/env/param[@name='m_tracking'] and /root/env/param[@name='doWait']='1']" mandatory="false">
  14. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  15. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/">
  16. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  17. <xsl:output method="xml" version="1.0" encoding="UTF-8"/>
  18. <xsl:template match="/">
  19. <xts:sequence>
  20. <xts:append select="/root">
  21. <response>
  22. <xts:request asText="true" href="bus://dispatcher" protocol="BUS" soapAction="http://www.ibm.com/xmlns/prod/cognos/reportService/201404/.absolute" faultBlock="faultHandler" responseEnvelope="true" outputHeader="true">
  23. <SOAP-ENV:Envelope 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">
  24. <SOAP-ENV:Header>
  25. <bus:biBusHeader xsi:type="bus:biBusHeader">
  26. <bus:tracking>
  27. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap', string(key('env-param','m_tracking'))), true())" disable-output-escaping="yes"/>
  28. </bus:tracking>
  29. <!-- For bug 611371. Don't copy the dispatcherTransportVars since these are copied directly from
  30. the browser. This can cause permission problems due to a 'front' = 'true' variable signifying
  31. this as an external request, even though it's internal. -->
  32. <xsl:apply-templates select="/root/header/*[local-name() = 'biBusHeader']/*[local-name() != 'tracking' and local-name() != 'dispatcherTransportVars']"/>
  33. <xsl:if test="string(/root/env/param[@name='ui.routingServerGroup'])!=''">
  34. <bus:routing xsi:type="bus:routingInfo">
  35. <routingServerGroup>
  36. <xsl:value-of select="/root/env/param[@name='ui.routingServerGroup']"/>
  37. </routingServerGroup>
  38. </bus:routing>
  39. </xsl:if>
  40. </bus:biBusHeader>
  41. </SOAP-ENV:Header>
  42. <SOAP-ENV:Body>
  43. <xsl:element name="wait" namespace="http://developer.cognos.com/schemas/reportService/1">
  44. <bus:conversation xsi:type="bus:asynchRequest" xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:nil="true"/>
  45. <bus:parameterValues xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:parameterValue[]" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"/>
  46. <bus:options xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:option[]" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"/>
  47. </xsl:element>
  48. </SOAP-ENV:Body>
  49. </SOAP-ENV:Envelope>
  50. </xts:request>
  51. </response>
  52. </xts:append>
  53. </xts:sequence>
  54. </xsl:template>
  55. <!-- don't include superfluous fields in Envelope -->
  56. <xsl:template match="*[local-name()='formFieldVars']/item[name='inlineSpec' or name='conversation' or name='previousConversation' or name='cancelStack']"/>
  57. <!-- used to copy the bus header stuff - see "apply-templates" above. -->
  58. <xsl:template match="*">
  59. <xsl:copy>
  60. <xsl:copy-of select="@*"/>
  61. <xsl:apply-templates/>
  62. </xsl:copy>
  63. </xsl:template>
  64. </xsl:stylesheet>
  65. </xts:block>
  66. <xts:block id="prependDocument" mode="interpret" processor="XSLT" type="exec" condition=".[not(/root/env/param[@name = 'functionList']) and not(/root/env/param[@name = 'doWait'])]" mandatory="false">
  67. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="xsl xtsext">
  68. <xsl:output method="xml" version="1.0" encoding="UTF-8"/>
  69. <xsl:key name="env-param" match="/root/env/param" use="@name" />
  70. <xsl:template match="/root">
  71. <xts:sequence>
  72. <xts:append select="/root">
  73. <trackingInfo>
  74. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap', string(key('env-param','m_tracking'))), true())" disable-output-escaping="yes"/>
  75. </trackingInfo>
  76. </xts:append>
  77. </xts:sequence>
  78. </xsl:template>
  79. </xsl:stylesheet>
  80. </xts:block>
  81. <xts:block id="appendExecutionParameters" mode="interpret" processor="XSLT" type="exec" condition=".[/root/env/param[@name='executionParameters']!='']" mandatory="false">
  82. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:cm="http://developer.cognos.com/schemas/cm/1/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="xsl xts cm xtsext">
  83. <xsl:output method="xml" version="1.0" encoding="UTF-8"/>
  84. <xsl:template match="/root">
  85. <xts:sequence>
  86. <xts:append select="/root">
  87. <executionParameters xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" 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">
  88. <xsl:choose>
  89. <xsl:when test="starts-with(/root/env/param[@name='executionParameters'], 'CAF')">
  90. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap', string(/root/env/param[@name='executionParameters'])), true())" disable-output-escaping="yes"/>
  91. </xsl:when>
  92. <xsl:otherwise>
  93. <xsl:value-of select="xtsext:web64decode(string(/root/env/param[@name='executionParameters']), true())" disable-output-escaping="yes"/>
  94. </xsl:otherwise>
  95. </xsl:choose>
  96. </executionParameters>
  97. </xts:append>
  98. </xts:sequence>
  99. </xsl:template>
  100. </xsl:stylesheet>
  101. </xts:block>
  102. <xts:block id="getContent" type="exec" mode="interpret" processor="XSLT" dependency="prependDocument appendExecutionParameters" condition=".[not(/root/env/param[@name = 'functionList']) and
  103. (/root/response/*/*/*/*/*[local-name() = 'status'] != 'working' or
  104. /root/response/*/*/*/*/*[local-name() = 'status'] != 'stillWorking' or
  105. /root/response/*/*/*/*/*[local-name() = 'status'] != 'complete' or
  106. not(/root/env/param[@name = 'doWait']))]" mandatory="false">
  107. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  108. <xts:logicsheet path="logicsheets/portal.xsl"/>
  109. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  110. exclude-result-prefixes="xsl xsi xtsext">
  111. <xsl:output method="xml" version="1.0" encoding="UTF-8"/>
  112. <xsl:key name="env-param" match="/root/env/param" use="@name" />
  113. <xsl:variable name="authoringLocale">
  114. <xsl:choose>
  115. <xsl:when test="/root/env/param[@name='el']!=''">
  116. <xsl:value-of select="/root/env/param[@name='el']"/>
  117. </xsl:when>
  118. <xsl:otherwise>
  119. <xsl:value-of select="/root/env/param[@name='cl']"/>
  120. </xsl:otherwise>
  121. </xsl:choose>
  122. </xsl:variable>
  123. <xsl:template match="/root">
  124. <xts:sequence>
  125. <xts:append>
  126. <xts:request asText="true" href="bus://dispatcher" protocol="BUS" soapAction="http://www.ibm.com/xmlns/prod/cognos/reportService/201404/.session" faultBlock="faultHandler" responseEnvelope="false" outputHeader="true">
  127. <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
  128. xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  129. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
  130. <SOAP-ENV:Header>
  131. <bus:biBusHeader xsi:type="bus:biBusHeader">
  132. <xsl:if test="/root/env/param[@name='markup_track']!=''">
  133. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap', string(key('env-param','markup_track'))), true())" disable-output-escaping="yes"/>
  134. </xsl:if>
  135. <xsl:apply-templates select="/root/header/*[local-name() = 'biBusHeader']/*[local-name() != 'tracking' and local-name() != 'dispatcherTransportVars']"/>
  136. <xsl:if test="string(/root/env/param[@name='ui.routingServerGroup'])!=''">
  137. <bus:routing xsi:type="bus:routingInfo">
  138. <routingServerGroup>
  139. <xsl:value-of select="/root/env/param[@name='ui.routingServerGroup']"/>
  140. </routingServerGroup>
  141. </bus:routing>
  142. </xsl:if>
  143. </bus:biBusHeader>
  144. </SOAP-ENV:Header>
  145. <SOAP-ENV:Body>
  146. <runSpecification xmlns="http://developer.cognos.com/schemas/reportService/1">
  147. <bus:specification xsi:type="bus:reportServiceMetadataSpecification" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  148. <bus:value xsi:type="bus:specification">&lt;metadataRequest connection=&quot;<xsl:value-of select="xtsext:xmlencode(string(/root/env/param[@name='model']))"/>&quot;&gt;
  149. &lt;Functions authoringLocale=&quot;<xsl:value-of select="$authoringLocale"/>&quot;&gt;
  150. &lt;Properties&gt;
  151. &lt;Property name=&quot;./group&quot;/&gt;
  152. &lt;Property name=&quot;group/@id&quot;/&gt;
  153. &lt;Property name=&quot;group/@qosLevel&quot;/&gt;
  154. &lt;Property name=&quot;./function&quot;/&gt;
  155. &lt;Property name=&quot;function/@id&quot;/&gt;
  156. &lt;Property name=&quot;function/@type&quot;/&gt;
  157. &lt;Property name=&quot;function/@qosLevel&quot;/&gt;
  158. &lt;/Properties&gt;
  159. &lt;Constraints&gt;
  160. <xsl:choose>
  161. <xsl:when test="/root/env/param[@name='fetch']='onlyOperation'">
  162. &lt;Constraint Condition=&quot;FDS[@type=&apos;operation&apos;]&quot;/&gt;
  163. </xsl:when>
  164. <xsl:when test="/root/env/param[@name='fetch']='all'">
  165. &lt;Constraint Condition=&quot;FDS[@type=&apos;operation&apos;]&quot;/&gt;
  166. &lt;Constraint Condition=&quot;FDS[@type=&apos;function&apos;]&quot;/&gt;
  167. &lt;Constraint Condition=&quot;FDS[@type=&apos;operator&apos;]&quot;/&gt;
  168. &lt;Constraint Condition=&quot;FDS[@type=&apos;literal&apos;]&quot;/&gt;
  169. &lt;Constraint Condition=&quot;FDS[@type=&apos;summary&apos;]&quot;/&gt;
  170. </xsl:when>
  171. <xsl:otherwise>
  172. &lt;Constraint Condition=&quot;FDS[@type=&apos;function&apos;]&quot;/&gt;
  173. &lt;Constraint Condition=&quot;FDS[@type=&apos;operator&apos;]&quot;/&gt;
  174. &lt;Constraint Condition=&quot;FDS[@type=&apos;literal&apos;]&quot;/&gt;
  175. &lt;Constraint Condition=&quot;FDS[@type=&apos;summary&apos;]&quot;/&gt;
  176. </xsl:otherwise>
  177. </xsl:choose>
  178. &lt;/Constraints&gt;
  179. &lt;/Functions&gt;
  180. &lt;/metadataRequest&gt;</bus:value>
  181. </bus:specification>
  182. <xsl:choose>
  183. <xsl:when test="key('env-param', 'metadataParameters') != ''">
  184. <bus:parameterValues xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:parameterValue[]" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/">
  185. <xsl:if test="string(/root/env/param[@name='metadataParameters'])!= 'null'">
  186. <xsl:value-of select="/root/env/param[@name='metadataParameters']" disable-output-escaping="yes"/>
  187. </xsl:if>
  188. <xsl:if test="/root/executionParameters != ''">
  189. <xsl:for-each select="/root/executionParameters/bus:parameters/*">
  190. <xsl:copy-of select="."/>
  191. </xsl:for-each>
  192. </xsl:if>
  193. </bus:parameterValues>
  194. </xsl:when>
  195. <xsl:when test="/root/executionParameters != ''">
  196. <bus:parameterValues xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:parameterValue[]" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/">
  197. <xsl:for-each select="/root/executionParameters/bus:parameters/*">
  198. <xsl:copy-of select="."/>
  199. </xsl:for-each>
  200. </bus:parameterValues>
  201. </xsl:when>
  202. <xsl:when test="key('env-param', 'parameterValues') != '' and contains(key('env-param', 'parameterValues'), 'item')">
  203. <xsl:value-of select="string(key('env-param', 'parameterValues'))" disable-output-escaping="yes"/>
  204. </xsl:when>
  205. <xsl:when test="key('env-param', 'promptValues') != ''">
  206. <bus:parameterValues xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:parameterValue[]" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/">
  207. <xsl:for-each select="/root/env/param[@name='promptValues']">
  208. <xsl:value-of select="." disable-output-escaping="yes"/>
  209. </xsl:for-each>
  210. </bus:parameterValues>
  211. </xsl:when>
  212. <xsl:otherwise>
  213. <bus:parameterValues xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:parameterValue[]" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"/>
  214. </xsl:otherwise>
  215. </xsl:choose>
  216. <bus:options xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:option[]" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/">
  217. <item xsi:type="bus:runOptionString">
  218. <bus:name xsi:type="bus:runOptionEnum">promptFormat</bus:name>
  219. <bus:value xsi:type="xsd:string">HTML</bus:value>
  220. </item>
  221. <item xsi:type="bus:runOptionBoolean">
  222. <bus:name xsi:type="bus:runOptionEnum">prompt</bus:name>
  223. <bus:value xsi:type="xsd:boolean">false</bus:value>
  224. </item>
  225. </bus:options>
  226. </runSpecification>
  227. </SOAP-ENV:Body>
  228. </SOAP-ENV:Envelope>
  229. </xts:request>
  230. </xts:append>
  231. </xts:sequence>
  232. </xsl:template>
  233. <!-- used to copy the bus header stuff - see "apply-templates" above. -->
  234. <xsl:template match="*">
  235. <xsl:copy>
  236. <xsl:copy-of select="@*"/>
  237. <xsl:apply-templates/>
  238. </xsl:copy>
  239. </xsl:template>
  240. </xsl:stylesheet>
  241. </xts:block>
  242. <!--
  243. ===============================================================================================
  244. getOutput - Special case to handle responseReady.
  245. With responseReady, we just need to call getOutput to get the actual output, so do it here instead of bouncing through the browser .
  246. ===============================================================================================
  247. -->
  248. <xts:block id="getOutput" type="exec" dependency="wait getContent prependDocument" mode="interpret" processor="XSLT" condition=".[/root/response/*[local-name()='Envelope']/*[local-name()='Body']/*/*[local-name()='result']/*[local-name() = 'details']/*[local-name() = 'item']/*[local-name() = 'status'] = 'responseReady']" mandatory="false" nodelist="header, env, response">
  249. <xsl:stylesheet version="1.0"
  250. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  251. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  252. xmlns:xos="http://developer.cognos.com/schemas/xts/output/"
  253. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  254. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  255. xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  256. xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
  257. xmlns:xs="http://www.w3.org/2001/XMLSchema"
  258. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  259. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
  260. exclude-result-prefixes="xsl xts xos cm bus SOAP-ENV xsi send">
  261. <xsl:output method="xml"/>
  262. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  263. <xsl:template match="/root">
  264. <xts:sequence>
  265. <xts:replace select="/root/response">
  266. <!-- replace the existing response -->
  267. <response>
  268. <send:request provider="warp" responseEnvelope="true" option="xml-multipart" affinity=".absolute">
  269. <xsl:element name="getOutput" namespace="http://developer.cognos.com/schemas/reportService/1">
  270. <bus:conversation xsi:type="bus:asynchRequest" xsi:nil="true"/>
  271. <parameterValues xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:parameterValue[]"/>
  272. <options xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:option[]"/>
  273. </xsl:element>
  274. </send:request>
  275. </response>
  276. </xts:replace>
  277. </xts:sequence>
  278. </xsl:template>
  279. <!-- don't include superfluous fields in Envelope -->
  280. <xsl:template match="*[local-name()='formFieldVars']/item[name='ui.spec' or name='ui.conversation' or name='previousConversation' or name='cancelStack']"/>
  281. <!-- used to copy the bus header stuff - see "apply-templates" above. -->
  282. <xsl:template match="*">
  283. <xsl:copy>
  284. <xsl:copy-of select="@*"/>
  285. <xsl:apply-templates/>
  286. </xsl:copy>
  287. </xsl:template>
  288. </xsl:stylesheet>
  289. </xts:block>
  290. <xts:block id="appendDocument" mode="interpret" processor="XSLT" type="exec" dependency="getContent wait prependDocument getOutput" mandatory="false">
  291. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  292. <xts:logicsheet path="logicsheets/portal.xsl"/>
  293. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/" xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:cm="http://developer.cognos.com/schemas/cm/1/" xmlns:SOAP-ENV="http://www.w3.org/2001/09/soap-envelope" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xos="http://developer.cognos.com/schemas/xts/output/">
  294. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  295. <xsl:output method="xml" version="1.0" encoding="UTF-8"/>
  296. <xsl:template match="/root">
  297. <xts:sequence>
  298. <xsl:choose>
  299. <xsl:when test="key('env-param','functionList')">
  300. <xts:append select="/root">
  301. <functionList>
  302. <xsl:value-of select="substring-after(string(key('env-param','functionList')), '?&gt;')" disable-output-escaping="yes"/>
  303. </functionList>
  304. </xts:append>
  305. </xsl:when>
  306. <xsl:when test="./*[local-name() = 'runSpecificationResponse']/bus:result/bus:details/item[@xsi:type='bus:asynchDetailReportStatus']/bus:status = 'prompting'">
  307. <xts:append select="/root/env">
  308. <param name="htmlFragment">
  309. <xsl:value-of select="./*[local-name() = 'runSpecificationResponse']/bus:result/bus:details/item[@xsi:type='bus:asynchDetailReportOutput']/bus:outputPages/item"/>
  310. </param>
  311. <param name="m_tracking">
  312. <xsl:for-each select="/root/output/*/*/*[local-name()='Header']/*[local-name()='biBusHeader']/*[local-name()='tracking']/*">
  313. <xsl:variable name="markup-track">
  314. <xsl:call-template name="serialize-xml">
  315. <xsl:with-param name="node-set" select="."/>
  316. </xsl:call-template>
  317. </xsl:variable>
  318. <xsl:value-of select="string($markup-track)"/>
  319. </xsl:for-each>
  320. </param>
  321. </xts:append>
  322. </xsl:when>
  323. <xsl:when test="./response/*/*[local-name()='Body']/*/*/*[local-name()='details']/item[@xsi:type='bus:asynchDetailReportStatus']/bus:status = 'prompting'">
  324. <xts:replace select="/root/env/param[@name='htmlFragment' or @name='m_tracking']">
  325. <param name="htmlFragment">
  326. <xsl:value-of select="./response/*/*[local-name()='Body']/*/*/*[local-name()='details']/item[@xsi:type='bus:asynchDetailReportOutput']/bus:outputPages/item"/>
  327. </param>
  328. <param name="m_tracking">
  329. <xsl:for-each select="/root/output/*/*/*[local-name()='Header']/*[local-name()='biBusHeader']/*[local-name()='tracking']/*">
  330. <xsl:variable name="markup-track">
  331. <xsl:call-template name="serialize-xml">
  332. <xsl:with-param name="node-set" select="."/>
  333. </xsl:call-template>
  334. </xsl:variable>
  335. <xsl:value-of select="string($markup-track)"/>
  336. </xsl:for-each>
  337. </param>
  338. </xts:replace>
  339. </xsl:when>
  340. <xsl:otherwise>
  341. <xts:append select="/root">
  342. <xsl:choose>
  343. <xsl:when test="contains(./*[local-name() = 'runSpecificationResponse']/bus:result/bus:status, 'working') or
  344. contains(./*[local-name() = 'runSpecificationResponse']/bus:result/bus:status, 'stillWorking') or
  345. contains(./response/*[local-name() = 'Envelope']/*[local-name() = 'Body']/*[local-name() = 'waitResponse']/bus:result/bus:status, 'stillWorking')">
  346. <working>
  347. <xsl:for-each select="/root/output/*/*/*[local-name() = 'Header']/*[local-name() = 'biBusHeader']/*[local-name() = 'tracking']/*">
  348. <xsl:variable name="markup-track">
  349. <xsl:call-template name="serialize-xml">
  350. <xsl:with-param name="node-set" select="."/>
  351. </xsl:call-template>
  352. </xsl:variable>
  353. <xsl:value-of select="string($markup-track)"/>
  354. </xsl:for-each>
  355. </working>
  356. </xsl:when>
  357. <xsl:when test="./response/*[local-name() = 'Envelope']/*[local-name() = 'Body']/*[local-name() = 'getOutputResponse']">
  358. <functionList>
  359. <xsl:choose>
  360. <xsl:when test="contains(./response/*[local-name() = 'Envelope']/*[local-name() = 'Body']/*[local-name() = 'getOutputResponse']/bus:result/bus:details/item/bus:metadata, '&lt;?xml')">
  361. <xsl:value-of select="substring-after(./response/*[local-name() = 'Envelope']/*[local-name() = 'Body']/*[local-name() = 'getOutputResponse']/bus:result/bus:details/item/bus:metadata, '?&gt;')" disable-output-escaping="yes"/>
  362. </xsl:when>
  363. <xsl:otherwise>
  364. <xsl:value-of select="./response/*[local-name() = 'Envelope']/*[local-name() = 'Body']/*[local-name() = 'getOutputResponse']/bus:result/bus:details/item/bus:metadata" disable-output-escaping="yes"/>
  365. </xsl:otherwise>
  366. </xsl:choose>
  367. </functionList>
  368. </xsl:when>
  369. <xsl:otherwise>
  370. <functionList>
  371. <xsl:choose>
  372. <xsl:when test="contains(./*[local-name() = 'runSpecificationResponse']/bus:result/bus:details/item/bus:metadata, '&lt;?xml')">
  373. <xsl:value-of select="substring-after(./*[local-name() = 'runSpecificationResponse']/bus:result/bus:details/item/bus:metadata, '?&gt;')" disable-output-escaping="yes"/>
  374. </xsl:when>
  375. <xsl:when test="contains(./*[local-name() = 'waitResponse']/bus:result/bus:details/item/bus:metadata, '&lt;?xml')">
  376. <xsl:value-of select="substring-after(./*[local-name() = 'waitResponse']/bus:result/bus:details/item/bus:metadata, '?&gt;')" disable-output-escaping="yes"/>
  377. </xsl:when>
  378. <xsl:when test="contains(./response/*[local-name() = 'Envelope']/*[local-name() = 'Body']/*[local-name() = 'waitResponse']/bus:result/bus:details/item/bus:metadata, '&lt;?xml')">
  379. <xsl:value-of select="substring-after(./response/*[local-name() = 'Envelope']/*[local-name() = 'Body']/*[local-name() = 'waitResponse']/bus:result/bus:details/item/bus:metadata, '?&gt;')" disable-output-escaping="yes"/>
  380. </xsl:when>
  381. <xsl:otherwise>
  382. <xsl:value-of select="./*[local-name() = 'runSpecificationResponse']/bus:result/bus:details/item/bus:metadata" disable-output-escaping="yes"/>
  383. </xsl:otherwise>
  384. </xsl:choose>
  385. </functionList>
  386. </xsl:otherwise>
  387. </xsl:choose>
  388. </xts:append>
  389. </xsl:otherwise>
  390. </xsl:choose>
  391. </xts:sequence>
  392. </xsl:template>
  393. <pf:serialize-xml/>
  394. </xsl:stylesheet>
  395. </xts:block>
  396. <!--
  397. Process Response
  398. -->
  399. <xts:block id="format" mode="output" processor="XSLT" type="exec" mimeType="application/xml" condition="/root/functionList/ResponseRoot or /root/soapFault" dependency="appendDocument" mandatory="false">
  400. <!-- get the debug logic sheet -->
  401. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  402. <xts:logicsheet path="logicsheets/portal.xsl"/>
  403. <!-- apply the form logic -->
  404. <xsl:stylesheet version="1.0"
  405. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  406. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  407. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  408. xmlns:dbg="http://developer.cognos.com/schemas/xts/logicsheets/xslt/debug/"
  409. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  410. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  411. exclude-result-prefixes="xsl xts dbg xtsext bus pf">
  412. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  413. <pf:variables/>
  414. <!-- start the output -->
  415. <xsl:template match="/root">
  416. <xmlResponse>
  417. <xsl:choose>
  418. <xsl:when test="./working">
  419. <xsl:variable name="passport">
  420. <!-- pull the passport out of the bus header -->
  421. <xsl:value-of select="/root/credential/param[@name='CAM']/*[local-name() ='CAM']/*[local-name() = 'CAMPassport']/*[local-name() = 'id']"/>
  422. </xsl:variable>
  423. <xsl:text/>working;<xsl:value-of select="xtsext:javascriptencode(string(/root/env/param[@name='fetch']))"/>;<xsl:value-of select="xtsext:javascriptencode(string(xtsext:cafaction(concat('sign_wrap_setpassportid_', $passport), xtsext:web64encode(string(./working), true()))))"/><xsl:text/>
  424. </xsl:when>
  425. <xsl:when test="./env/param[@name='htmlFragment']">
  426. <xsl:variable name="markup-conv">
  427. <xsl:choose>
  428. <xsl:when test="./*[local-name() = 'runSpecificationResponse']/bus:result/bus:primaryRequest">
  429. <xsl:call-template name="serialize-xml">
  430. <xsl:with-param name="node-set" select="./*[local-name() = 'runSpecificationResponse']/bus:result/bus:primaryRequest/*"/>
  431. </xsl:call-template>
  432. </xsl:when>
  433. <xsl:otherwise>
  434. <xsl:call-template name="serialize-xml">
  435. <xsl:with-param name="node-set" select="./response/*/*[local-name()='Body']/*/bus:result/bus:primaryRequest/*"/>
  436. </xsl:call-template>
  437. </xsl:otherwise>
  438. </xsl:choose>
  439. </xsl:variable>
  440. <xsl:text/>prompting;<xsl:text/>
  441. <xsl:text/><xsl:value-of select="xtsext:javascriptencode(string($gateway))"/>;<xsl:text/>
  442. <xsl:text/><xsl:value-of select="xtsext:javascriptencode(string(/root/env/param[@name='fetch']))"/>;<xsl:text/>
  443. <xsl:text/><xsl:value-of select="xtsext:javascriptencode(string(xtsext:cafaction(concat('sign_wrap_setpassportid_', $passport), xtsext:web64encode(string($markup-conv), true()))))"/>;<xsl:text/>
  444. <xsl:text/><xsl:value-of select="xtsext:javascriptencode(string(xtsext:cafaction(concat('sign_wrap_setpassportid_', $passport), xtsext:web64encode(string(/root/env/param[@name='m_tracking']), true()))))"/>;<xsl:text/>
  445. <xsl:text/><xsl:value-of select="xtsext:javascriptencode(string(/root/env/param[@name='htmlFragment']))"/><xsl:text/>
  446. </xsl:when>
  447. <xsl:otherwise>
  448. <xsl:apply-templates select="functionList/ResponseRoot/functionsRoot/group"/>
  449. <xsl:apply-templates select="./logonFault"/>
  450. <xsl:apply-templates select="./soapFault"/>
  451. </xsl:otherwise>
  452. </xsl:choose>
  453. </xmlResponse>
  454. </xsl:template>
  455. <xsl:template match="/root/functionList/ResponseRoot/functionsRoot/group">
  456. <xsl:for-each select="./group">
  457. <xsl:call-template name="recurseFunctionTreeForOKLimited"/>
  458. </xsl:for-each>
  459. <xsl:text/>*#*<xsl:text/>
  460. <xsl:for-each select="./group">
  461. <xsl:call-template name="recurseFunctionTreeForRestricted"/>
  462. </xsl:for-each>
  463. </xsl:template>
  464. <xsl:template match="/root/logonFault">
  465. <xsl:text/>FAULT;timeout<xsl:text/>
  466. <xsl:for-each select="/root/output//bus:biBusHeader/bus:CAM/bus:exception/bus:promptInfo/bus:displayObjects/item[bus:type='hidden']">
  467. <xsl:text>;</xsl:text>
  468. <xsl:value-of select="xtsext:javascriptencode(string(bus:name))"/>
  469. <xsl:text>=</xsl:text>
  470. <xsl:value-of select="xtsext:javascriptencode(string(bus:value))"/>
  471. </xsl:for-each>
  472. </xsl:template>
  473. <xsl:template name="recurseFunctionTreeForOKLimited">
  474. <xsl:for-each select="./group">
  475. <xsl:call-template name="recurseFunctionTreeForOKLimited"/>
  476. </xsl:for-each>
  477. <xsl:for-each select="./function[@qosLevel='OK' or @qosLevel='limited']">
  478. <xsl:text/><xsl:value-of select="xtsext:javascriptencode(string(@id))"/>;<xsl:text/>
  479. </xsl:for-each>
  480. </xsl:template>
  481. <xsl:template name="recurseFunctionTreeForRestricted">
  482. <xsl:for-each select="./group">
  483. <xsl:call-template name="recurseFunctionTreeForRestricted"/>
  484. </xsl:for-each>
  485. <xsl:for-each select="./function[@qosLevel='restricted']">
  486. <xsl:text/><xsl:value-of select="xtsext:javascriptencode(string(@id))"/>;<xsl:text/>
  487. </xsl:for-each>
  488. </xsl:template>
  489. <xsl:template match="/root/soapFault">
  490. <xsl:text/>FAULT<xsl:text/>
  491. <xsl:choose>
  492. <xsl:when test=".//bus:message">
  493. <xsl:for-each select=".//bus:message">
  494. <xsl:text/>;<xsl:call-template name="commaAndSemicolonEncode">
  495. <xsl:with-param name="strVal">
  496. <xsl:value-of select="./bus:messageString"/>
  497. </xsl:with-param>
  498. </xsl:call-template><xsl:text/>
  499. </xsl:for-each>
  500. </xsl:when>
  501. <xsl:otherwise>
  502. <xsl:variable name="markup">
  503. <xsl:text/><xsl:call-template name="commaAndSemicolonEncode">
  504. <xsl:with-param name="strVal">
  505. <xsl:call-template name="serialize-xml">
  506. <xsl:with-param name="node-set" select="."/>
  507. </xsl:call-template>
  508. </xsl:with-param>
  509. </xsl:call-template><xsl:text/>
  510. </xsl:variable>
  511. <xsl:text/>;<xsl:value-of select="$markup"/><xsl:text/>
  512. </xsl:otherwise>
  513. </xsl:choose>
  514. </xsl:template>
  515. <xsl:template name="commaAndSemicolonEncode">
  516. <xsl:param name="strVal"/>
  517. <xsl:choose>
  518. <xsl:when test="contains($strVal, ',')">
  519. <xsl:call-template name="commaAndSemicolonEncode">
  520. <xsl:with-param name="strVal" select="substring-before($strVal, ',')"/>
  521. </xsl:call-template>&amp;comma<xsl:call-template name="commaAndSemicolonEncode">
  522. <xsl:with-param name="strVal" select="substring-after($strVal, ',')"/>
  523. </xsl:call-template>
  524. </xsl:when>
  525. <xsl:when test="contains($strVal, ';')">
  526. <xsl:call-template name="commaAndSemicolonEncode">
  527. <xsl:with-param name="strVal" select="substring-before($strVal, ';')"/>
  528. </xsl:call-template>&amp;semicolon<xsl:call-template name="commaAndSemicolonEncode">
  529. <xsl:with-param name="strVal" select="substring-after($strVal, ';')"/>
  530. </xsl:call-template>
  531. </xsl:when>
  532. <xsl:otherwise>
  533. <xsl:value-of select="xtsext:javascriptencode(string($strVal))"/>
  534. </xsl:otherwise>
  535. </xsl:choose>
  536. </xsl:template>
  537. <pf:serialize-xml/>
  538. </xsl:stylesheet>
  539. </xts:block>
  540. <xts:block id="faultHandler" path="qs/logicsheets/faultHandlerMetadata.xsl" type="fault" processor="XSLT"/>
  541. </xts:morphlet>