promptDataSource.xts 53 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. +===================================================================+
  4. | Licensed Materials - Property of IBM
  5. | BI and PM: prmt
  6. | (C) Copyright IBM Corp. 2002, 2019
  7. |
  8. | US Government Users Restricted Rights - Use, duplication or
  9. | disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  10. |
  11. +===================================================================+
  12. -->
  13. <xts:morphlet resolverBase="prompting" xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="messages/portal.xml">
  14. <xts:block id="parseURL" path="rv/logicsheets/parseURL.xslt" type="exec" processor="XSLT" mandatory="false"/>
  15. <xts:block id="init" mode="interpret" dependency="parseURL" processor="XSLT" type="exec" mandatory="false">
  16. <xts:logicsheet path="logicsheets/portal.xsl"/>
  17. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" 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:cm="http://developer.cognos.com/schemas/cm/1/" xmlns:SOAP-ENV="http://www.w3.org/2001/09/soap-envelope" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="xsl send cml cm SOAP-ENV xtsext">
  18. <xsl:template match="/">
  19. <xts:sequence>
  20. <xts:delete select="/root/env/param[@name='run.attachmentEncoding']"/>
  21. <xts:append select="root/env">
  22. <param name="run.attachmentEncoding">
  23. <xsl:text/>base64<xsl:text/>
  24. </param>
  25. </xts:append>
  26. <xsl:if test="/root/env/param[@name='htmlFragment'] != ''">
  27. <xts:delete select="/root/env/param[@name='ui.action' or @name='htmlFragment']"/>
  28. <xts:append select="/root/env">
  29. <param name="ui.action">forward</param>
  30. </xts:append>
  31. <xts:append select="/root/header/*[local-name()='biBusHeader']/*[local-name()='hdrSession']/*[local-name()='formFieldVars']">
  32. <item>
  33. <name xsi:type="xsd:string">_promptControl</name>
  34. <value xsi:type="xsd:string">reprompt</value>
  35. </item>
  36. </xts:append>
  37. </xsl:if>
  38. </xts:sequence>
  39. </xsl:template>
  40. </xsl:stylesheet>
  41. </xts:block>
  42. <!--
  43. ===============================================================================================
  44. copy-prompts - If we are coming from a prompt page (method = forward) remember the prompt values then drop them from the
  45. environment parameters. This assumes that all parameters that begin with p_ belong to prompts.
  46. ===============================================================================================
  47. -->
  48. <xts:block id="copy-prompts" mode="interpret" processor="XSLT" type="exec" dependency="parseURL" condition=".[not(contains(string(/root/env/param[@name='ui.action']), 'Page')) and (/root/env/param[starts-with(@name, 'p_')] or (/root/env/param[@name='ui.action']='execute' and /root/env/param[@name='session_prompts']))]" mandatory="false">
  49. <xts:logicsheet path="logicsheets/portal.xsl"/>
  50. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 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:cm="http://developer.cognos.com/schemas/cm/1/" xmlns:SOAP-ENV="http://www.w3.org/2001/09/soap-envelope" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="xsl send cml cm SOAP-ENV xtsext">
  51. <xsl:template match="/">
  52. <xts:sequence>
  53. <xsl:choose>
  54. <xsl:when test="/root/env/param[@name='session_prompts'] and /root/env/param[@name='ui.action']='execute'">
  55. <xts:append select="/root">
  56. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap', string(/root/env/param[@name='session_prompts'])), true())" disable-output-escaping="yes"/>
  57. </xts:append>
  58. </xsl:when>
  59. <xsl:otherwise>
  60. <xts:append>
  61. <PromptValues>
  62. <xsl:for-each select="/root/env/param[starts-with(@name, 'p_')]">
  63. <PromptValue name="{substring-after(@name,'_')}">
  64. <xsl:choose>
  65. <xsl:when test="/root/http/param[@name='REQUEST_METHOD']='GET'">
  66. <xsl:value-of select="." disable-output-escaping="no"/>
  67. </xsl:when>
  68. <xsl:otherwise>
  69. <xsl:value-of select="." disable-output-escaping="yes"/>
  70. </xsl:otherwise>
  71. </xsl:choose>
  72. </PromptValue>
  73. </xsl:for-each>
  74. </PromptValues>
  75. </xts:append>
  76. <xts:append select="/root">
  77. <RvCachedPrompts/>
  78. </xts:append>
  79. <xts:append select="/root/RvCachedPrompts">
  80. <xsl:choose>
  81. <xsl:when test="/root/env/param[@name='session_prompts']">
  82. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap', string(/root/env/param[@name='session_prompts'])), true())" disable-output-escaping="yes"/>
  83. </xsl:when>
  84. <xsl:otherwise>
  85. <PromptValues/>
  86. </xsl:otherwise>
  87. </xsl:choose>
  88. </xts:append>
  89. <xsl:for-each select="/root/env/param[starts-with(@name, 'p_')]">
  90. <xsl:variable name="promptValueName">
  91. <xsl:value-of select="substring-after(@name,'p_')"/>
  92. </xsl:variable>
  93. <xts:delete select="/*[local-name()='root']/*[local-name()='RvCachedPrompts']/*[local-name()='PromptValues']/*[local-name()='PromptValue'][@name=&quot;{$promptValueName}&quot;]"/>
  94. <xts:append select="/root/RvCachedPrompts/PromptValues">
  95. <PromptValue name="{substring-after(@name,'p_')}">
  96. <xsl:choose>
  97. <xsl:when test="/root/http/param[@name='REQUEST_METHOD']='GET'">
  98. <xsl:value-of select="." disable-output-escaping="no"/>
  99. </xsl:when>
  100. <xsl:otherwise>
  101. <xsl:value-of select="." disable-output-escaping="yes"/>
  102. </xsl:otherwise>
  103. </xsl:choose>
  104. </PromptValue>
  105. </xts:append>
  106. </xsl:for-each>
  107. <xts:delete select="/root/env/param[starts-with(@name, 'p_')]"/>
  108. </xsl:otherwise>
  109. </xsl:choose>
  110. </xts:sequence>
  111. </xsl:template>
  112. </xsl:stylesheet>
  113. </xts:block>
  114. <!--
  115. ===============================================================================================
  116. execute - call the report server, unless the method is "view".
  117. ===============================================================================================
  118. -->
  119. <xts:block id="execute" type="exec" mode="interpret" processor="XSLT" dependency="init copy-prompts set-conversation" condition=".[ contains( ' back cancel forward release wait collectParameterValuesSpecification ', concat(' ', /root/env/param[@name='ui.action'], ' ') )]" mandatory="false">
  120. <xts:logicsheet path="prompting/soaplogic.xsl"/>
  121. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:xos="http://developer.cognos.com/schemas/xts/output/" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:sl="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/prmt/soaplogic/" exclude-result-prefixes="xsl xtsext xos cm bus SOAP-ENV xsi">
  122. <sl:soaplogic/>
  123. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  124. <xsl:variable name="affinity">
  125. <xsl:choose>
  126. <xsl:when test="key('env-param','ui.action')='forward'">.high</xsl:when>
  127. <xsl:when test="key('env-param','ui.action')='back'">.high</xsl:when>
  128. <xsl:when test="key('env-param','ui.action')='cancel'">.control</xsl:when>
  129. <xsl:when test="key('env-param','ui.action')='getOutput'">.absolute</xsl:when>
  130. <xsl:when test="key('env-param','ui.action')='release'">.absolute</xsl:when>
  131. <xsl:when test="key('env-param','ui.action')='wait'">.absolute</xsl:when>
  132. </xsl:choose>
  133. </xsl:variable>
  134. <xsl:template match="/root">
  135. <xts:sequence>
  136. <xsl:variable name="currentTracking">
  137. <xsl:if test="key('env-param', 'tracking')">
  138. <xsl:value-of select="key('env-param', 'tracking')"/>
  139. </xsl:if>
  140. </xsl:variable>
  141. <xsl:if test="key('env-param', 'tracking')">
  142. <xts:delete select="/root/env/param[@name='tracking']"/>
  143. </xsl:if>
  144. <xts:append>
  145. <response>
  146. <xts:request href="bus://dispatcher" protocol="BUS" responseEnvelope="true" option="xml-multipart" outputHeader="true">
  147. <xsl:attribute name="soapAction"><xsl:text/>http://www.ibm.com/xmlns/prod/cognos/reportService/202004/<xsl:value-of select="$affinity"/></xsl:attribute>
  148. <xsl:if test="key('env-param', 'ui.action') != 'execute'">
  149. <xsl:attribute name="outputHeader">true</xsl:attribute>
  150. </xsl:if>
  151. <SOAP-ENV:Envelope xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  152. <SOAP-ENV:Header>
  153. <bus:biBusHeader xsi:type="bus:biBusHeader">
  154. <xsl:choose>
  155. <xsl:when test="$currentTracking!=''">
  156. <bus:tracking>
  157. <xsl:choose>
  158. <xsl:when test="starts-with(string($currentTracking),'&lt;')"><xsl:value-of select="$currentTracking" disable-output-escaping="yes"/></xsl:when>
  159. <xsl:otherwise><xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap', string($currentTracking)), true())" disable-output-escaping="yes"/></xsl:otherwise>
  160. </xsl:choose>
  161. </bus:tracking>
  162. <xsl:apply-templates select="header/bus:biBusHeader/*[local-name()!='tracking']"/>
  163. </xsl:when>
  164. <xsl:otherwise>
  165. <xsl:apply-templates select="header/bus:biBusHeader/*"/>
  166. </xsl:otherwise>
  167. </xsl:choose>
  168. <xsl:if test="key('env-param', 'routingServerGroup') and key('env-param', 'routingServerGroup') != ''">
  169. <!-- we only set the routing if it is passed in to us, we don't go searching for it -->
  170. <bus:routing>
  171. <routingServerGroup>
  172. <xsl:value-of select="key('env-param', 'routingServerGroup')"/>
  173. </routingServerGroup>
  174. </bus:routing>
  175. </xsl:if>
  176. </bus:biBusHeader>
  177. </SOAP-ENV:Header>
  178. <SOAP-ENV:Body>
  179. <xsl:element name="{key('env-param', 'ui.action')}" namespace="http://developer.cognos.com/schemas/reportService/1">
  180. <xsl:choose>
  181. <xsl:when test="key('env-param','ui.action')='wait'">
  182. <bus:conversation xsi:type="bus:asynchRequest" xsi:nil="true"/>
  183. <parameterValues xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:parameterValue[]"/>
  184. <options xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:option[]"/>
  185. </xsl:when>
  186. <xsl:when test="key('env-param', 'ui.conversation') != ''">
  187. <bus:conversation xsi:type="bus:asynchRequest" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  188. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap_setflag_optionalunwrap_settemplatename_promptDataSource_settemplateid_execute', string(key('env-param', 'ui.conversation'))), true())" disable-output-escaping="yes"/>
  189. </bus:conversation>
  190. <xsl:if test="key('env-param', 'ui.action') != 'release'">
  191. <xsl:call-template name="SetParameters"/>
  192. <xsl:choose>
  193. <xsl:when test="contains( ' back cancel forward wait getOutput ', concat(' ', key('env-param','ui.action'), ' ') )">
  194. <options xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:option[]" />
  195. </xsl:when>
  196. <xsl:otherwise>
  197. <xsl:call-template name="SetOptions" />
  198. </xsl:otherwise>
  199. </xsl:choose>
  200. </xsl:if>
  201. </xsl:when>
  202. <xsl:otherwise>
  203. <xsl:choose>
  204. <xsl:when test="starts-with(key('env-param','specification'),'&lt;report')">
  205. <specification xsi:type="bus:reportServiceReportSpecification">
  206. <bus:value xsi:type="bus:specification">
  207. <xsl:value-of select="key('env-param','specification')"/>
  208. </bus:value>
  209. </specification>
  210. </xsl:when>
  211. <xsl:when test="starts-with(key('env-param','specification'),'&lt;Meta')">
  212. <specification xsi:type="bus:reportServiceMetadataSpecification">
  213. <bus:value xsi:type="bus:specification">
  214. <xsl:value-of select="key('env-param','specification')"/>
  215. </bus:value>
  216. </specification>
  217. </xsl:when>
  218. <xsl:otherwise>
  219. <specification xsi:type="bus:queryFrameworkSpecification">
  220. <bus:value xsi:type="bus:specification">
  221. <xsl:value-of select="key('env-param','specification')"/>
  222. </bus:value>
  223. </specification>
  224. </xsl:otherwise>
  225. </xsl:choose>
  226. <xsl:if test="key('env-param', 'ui.action') != 'release'">
  227. <xsl:choose>
  228. <xsl:when test="key('env-param', 'parameterValues') != ''">
  229. <parameterValues xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:parameterValue[]">
  230. <xsl:choose>
  231. <!-- If the parameter starts with a '<', it means it wasn't XML encoded first. -->
  232. <xsl:when test="starts-with(key('env-param', 'parameterValues'), '&lt;')">
  233. <xsl:value-of select="key('env-param', 'parameterValues')" disable-output-escaping="yes"/>
  234. </xsl:when>
  235. <xsl:otherwise>
  236. <xsl:value-of select="xtsext:xmldecode(string(key('env-param', 'parameterValues')))" disable-output-escaping="yes"/>
  237. </xsl:otherwise>
  238. </xsl:choose>
  239. </parameterValues>
  240. </xsl:when>
  241. <xsl:otherwise>
  242. <xsl:call-template name="SetParameters"/>
  243. </xsl:otherwise>
  244. </xsl:choose>
  245. <bus:options xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:option[]" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/">
  246. <item xsi:type="bus:runOptionString">
  247. <bus:name xsi:type="bus:runOptionEnum">promptFormat</bus:name>
  248. <bus:value xsi:type="xsd:string">HTML</bus:value>
  249. </item>
  250. </bus:options>
  251. </xsl:if>
  252. </xsl:otherwise>
  253. </xsl:choose>
  254. </xsl:element>
  255. </SOAP-ENV:Body>
  256. </SOAP-ENV:Envelope>
  257. </xts:request>
  258. </response>
  259. </xts:append>
  260. </xts:sequence>
  261. </xsl:template>
  262. <!-- don't include superfluous fields in SOAP Envelope -->
  263. <xsl:template match="*[local-name()='formFieldVars']/item[name='ui.spec' or name='ui.conversation' or name='previousConversation' or name='cancelStack']"/>
  264. <!-- used to copy the bus header stuff - see "apply-templates" above. -->
  265. <xsl:template match="*">
  266. <xsl:copy>
  267. <xsl:copy-of select="@*"/>
  268. <xsl:apply-templates/>
  269. </xsl:copy>
  270. </xsl:template>
  271. </xsl:stylesheet>
  272. </xts:block>
  273. <!--
  274. ===============================================================================================
  275. getOutput - Special case to handle responseReady.
  276. With responseReady, we just need to call getOutput to get the actual output, so do it here instead of bouncing through the browser .
  277. ===============================================================================================
  278. -->
  279. <xts:block id="getOutput" type="exec" dependency="execute" 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">
  280. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:xos="http://developer.cognos.com/schemas/xts/output/" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" exclude-result-prefixes="xsl xts xos cm bus SOAP-ENV xsi">
  281. <xsl:output method="xml"/>
  282. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  283. <xsl:template match="/root">
  284. <xts:sequence>
  285. <xts:replace select="/root/response">
  286. <!-- replace the existing response -->
  287. <response>
  288. <xts:request href="bus://dispatcher" protocol="BUS" responseEnvelope="true" outputHeader="true" option="xml-multipart"
  289. soapAction="http://www.ibm.com/xmlns/prod/cognos/reportService/202004/.absolute">
  290. <SOAP-ENV:Envelope>
  291. <SOAP-ENV:Header>
  292. <bus:biBusHeader xsi:type="bus:biBusHeader">
  293. <xsl:copy-of select="/root/response/*[local-name()='Envelope']/*[local-name()='Header']/*[local-name()='biBusHeader']/*[local-name()='tracking']"/>
  294. <xsl:apply-templates select="header/*[local-name()='biBusHeader']/*[local-name()!='tracking']"/>
  295. <xsl:if test="key('env-param', 'routingServerGroup') and key('env-param', 'routingServerGroup') != ''">
  296. <!-- we only set the routing if it is passed in to us, we don't go searching for it -->
  297. <bus:routing>
  298. <routingServerGroup>
  299. <xsl:value-of select="key('env-param', 'routingServerGroup')"/>
  300. </routingServerGroup>
  301. </bus:routing>
  302. </xsl:if>
  303. </bus:biBusHeader>
  304. </SOAP-ENV:Header>
  305. <SOAP-ENV:Body>
  306. <xsl:element name="getOutput" namespace="http://developer.cognos.com/schemas/reportService/1">
  307. <bus:conversation xsi:type="bus:asynchRequest" xsi:nil="true"/>
  308. <parameterValues xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:parameterValue[]"/>
  309. <options xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:option[]"/>
  310. </xsl:element>
  311. </SOAP-ENV:Body>
  312. </SOAP-ENV:Envelope>
  313. </xts:request>
  314. </response>
  315. </xts:replace>
  316. </xts:sequence>
  317. </xsl:template>
  318. <!-- don't include superfluous fields in Envelope -->
  319. <xsl:template match="*[local-name()='formFieldVars']/item[name='ui.spec' or name='ui.conversation' or name='previousConversation' or name='cancelStack']"/>
  320. <!-- used to copy the bus header stuff - see "apply-templates" above. -->
  321. <xsl:template match="*">
  322. <xsl:copy>
  323. <xsl:copy-of select="@*"/>
  324. <xsl:apply-templates/>
  325. </xsl:copy>
  326. </xsl:template>
  327. </xsl:stylesheet>
  328. </xts:block>
  329. <!--
  330. ===============================================================================================
  331. wait - This block generates the "please wait" message
  332. ===============================================================================================
  333. -->
  334. <xts:block id="wait" type="exec" mode="output" processor="XSLT" dependency="init getOutput execute" mimeType="text/html" contentId="wait" partId="1" condition=".[ /root/env/param[@name='ui.action']!='drillThru' and
  335. ( /root/response/*/*/*/*/*[local-name() = 'status'] = 'working' or
  336. /root/response/*/*/*/*/*[local-name() = 'status'] = 'stillWorking') ]" mandatory="false">
  337. <xts:logicsheet path="logicsheets/portal.xsl"/>
  338. <xts:logicsheet path="logicsheets/presentation/main/framework.xsl"/>
  339. <xts:logicsheet path="logicsheets/presentation/main/presentation.xsl"/>
  340. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  341. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  342. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  343. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xos="http://developer.cognos.com/schemas/xts/output/" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:mt="http://developer.cognos.com/schemas/xts/logicsheets/presentation/main/mt" xmlns:mf="http://developer.cognos.com/schemas/xts/logicsheets/presentation/main/mf" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/" xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" exclude-result-prefixes="xsl xos pf mt mf xtsext cf cp bus xts dp SOAP-ENV">
  344. <xsl:output method="html" encoding="utf-8" indent="no"/>
  345. <pf:variables/>
  346. <xsl:template match="/root">
  347. <html>
  348. <head>
  349. <META http-equiv="Content-Script-Type" content="text/javascript"/>
  350. <link rel="stylesheet" type="text/css" href="{$skin_root}/portal/default.css"/>
  351. <link rel="stylesheet" type="text/css" href="{$skin_root}/fonts.css"/>
  352. <script type="text/javascript" charset="utf-8" src="{$webRoot}/prompting/pds.js"></script>
  353. <script type="text/javascript">
  354. function submitForm()
  355. {
  356. setTimeout("document.formWarpRequest.submit()", 1);
  357. }
  358. function cancel()
  359. {
  360. F_pdsCallback(
  361. {"state":"Cancel","clientContext":"<xsl:value-of select="xtsext:javascriptencode(key('env-param', 'clientContext'))"/>"<xsl:text/>
  362. <xsl:if test="key('env-param', 'ccs_cbdata')">
  363. <xsl:text/>,"ccs_cbdata":"<xsl:value-of select="xtsext:javascriptencode(string(key('env-param', 'ccs_cbdata')))"/>"<xsl:text/>
  364. </xsl:if>
  365. <xsl:text/>},
  366. "<xsl:value-of select="xtsext:javascriptencode(string(key('env-param', 'ccs_invoke')))"/>"
  367. );
  368. <xsl:if test="key('env-param', 'newWindow') = '1' or key('env-param', 'newWindow') = 'true'">
  369. window.close();
  370. </xsl:if>
  371. }
  372. </script>
  373. </head>
  374. <body onload="submitForm();">
  375. <br/>
  376. <br/>
  377. <br/>
  378. <br/>
  379. <div style="text-align:center;">
  380. <table cellpadding="0" cellspacing="0" style="width:145px; border-width:0px; margin:0px auto;">
  381. <!--if the current method is current page, and we've received a wait response, we don't want to give the user any delivery or cancel options-->
  382. <tr>
  383. <td style="width:47%; margin:0px auto;">
  384. <img src="{$brand_images}progress.gif" style="border:0px; vertical-align:middle; width:48px; height:48px;" name="progress"/>
  385. </td>
  386. <td class="tableText" style="width:53%; text-align:center; white-space:nowrap;">
  387. <xts:string id="PROMPT_RUNNING"/>
  388. <br/>
  389. <xts:string id="RV_PLEASE_WAIT"/>
  390. </td>
  391. </tr>
  392. <tr>
  393. <td colspan="2" style="padding-top: 10px; padding-left: 5px;">
  394. <table style="margin:0px auto; padding-left:10px;">
  395. <dp:button>
  396. <a href="javascript:cancel()">
  397. <dp:buttonText>
  398. <xts:string id="CANCEL"/>
  399. </dp:buttonText>
  400. </a>
  401. </dp:button>
  402. </table>
  403. </td>
  404. </tr>
  405. </table>
  406. </div>
  407. <form action="{$gateway}" name="formWarpRequest" id="formWarpRequest" method="post" style="height:100%;margin:0px">
  408. <xsl:attribute name="onsubmit">if((typeof promptButtonOK).match(/^function$/i)){promptButtonOK();return false;} else if((typeof execute).match(/^function$/i)){execute();return false;}</xsl:attribute>
  409. <input type="hidden" name="m" value="{key('env-param', 'm')}"/>
  410. <input type="hidden" name="b_action" value="xts.run"/>
  411. <input type="hidden" name="run.xslURL" value="sa.xsl"/>
  412. <input type="hidden" name="ui.action" value="wait"/>
  413. <xsl:call-template name="addInputField">
  414. <xsl:with-param name="paramName">lang</xsl:with-param>
  415. </xsl:call-template>
  416. <input type="hidden" name="ui.object" value="{key('env-param', 'ui.object')}"/>
  417. <input type="hidden" name="ui.backURL" value="{key('env-param', 'ui.backURL')}"/>
  418. <input type="hidden" name="ui.errURL" value="{key('env-param', 'ui.errURL')}"/>
  419. <input type="hidden" name="tracking">
  420. <!-- need to grab the tracking info if it doesn't exist in the env-param -->
  421. <xsl:choose>
  422. <xsl:when test="key('env-param', 'tracking')">
  423. <xsl:attribute name="value"><xsl:value-of select="key('env-param', 'tracking')"/></xsl:attribute>
  424. </xsl:when>
  425. <xsl:otherwise>
  426. <xsl:variable name="markup-track">
  427. <xsl:apply-templates select="/root/response/*[local-name() = 'Envelope']/*[local-name() = 'Header']/*[local-name() = 'biBusHeader']/*[local-name() = 'tracking']/*[local-name() = 'conversationContext']" mode="markup"/>
  428. </xsl:variable>
  429. <xsl:attribute name="value"><xsl:value-of select="xtsext:cafaction(concat('sign_wrap_setpassportid_', $passport), xtsext:web64encode(string($markup-track), true()))"/></xsl:attribute>
  430. </xsl:otherwise>
  431. </xsl:choose>
  432. </input>
  433. <xsl:call-template name="addInputField">
  434. <xsl:with-param name="paramName">ccs_cbdata</xsl:with-param>
  435. </xsl:call-template>
  436. <xsl:call-template name="addInputField">
  437. <xsl:with-param name="paramName">ccs_invoke</xsl:with-param>
  438. </xsl:call-template>
  439. <xsl:call-template name="addInputField">
  440. <xsl:with-param name="paramName">clientContext</xsl:with-param>
  441. </xsl:call-template>
  442. <xsl:call-template name="addInputField">
  443. <xsl:with-param name="paramName">returnEntireResponse</xsl:with-param>
  444. </xsl:call-template>
  445. <xsl:if test="key('env-param', 'releaseConversation') = '1'">
  446. <input type="hidden" name="releaseConversation" value="1"/>
  447. </xsl:if>
  448. <xsl:if test="key('env-param', 'newWindow') = '1' or key('env-param', 'newWindow') = 'true'">
  449. <input type="hidden" name="newWindow" value="1"/>
  450. </xsl:if>
  451. <xsl:if test="key('env-param', 'ui.debug') = 'true'">
  452. <input type="hidden" name="ui.debug" value="true"/>
  453. </xsl:if>
  454. <xsl:call-template name="addInputField">
  455. <xsl:with-param name="paramName">routingServerGroup</xsl:with-param>
  456. </xsl:call-template>
  457. <xsl:call-template name="addInputField">
  458. <xsl:with-param name="paramName">md.callBack</xsl:with-param>
  459. </xsl:call-template>
  460. </form>
  461. </body>
  462. </html>
  463. </xsl:template>
  464. <xsl:template name="addInputField">
  465. <xsl:param name="paramName" select="''"/>
  466. <xsl:if test="key('env-param', $paramName)">
  467. <input type="hidden" name="{$paramName}" value="{key('env-param', $paramName)}"/>
  468. </xsl:if>
  469. </xsl:template>
  470. <pf:serialize-xml/>
  471. </xsl:stylesheet>
  472. </xts:block>
  473. <xts:block id="remove-primary-request-tags" dependency="init" type="exec" mode="interpret" mandatory="false" processor="XSLT" condition=".[starts-with(/root/env/param[@name = 'ui.conversation'], '&lt;bus:primaryRequest')]" nodelist="env">
  474. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:xos="http://developer.cognos.com/schemas/xts/output/" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" exclude-result-prefixes="xsl xtsext xos cm bus SOAP-ENV xsi xsd xts">
  475. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  476. <xsl:template match="/root">
  477. <xts:sequence>
  478. <xts:append select="/root">
  479. <PRconversation>
  480. <xsl:value-of select="/root/env/param[@name = 'ui.conversation']" disable-output-escaping="yes"/>
  481. </PRconversation>
  482. </xts:append>
  483. </xts:sequence>
  484. </xsl:template>
  485. </xsl:stylesheet>
  486. </xts:block>
  487. <xts:block id="set-conversation" dependency="remove-primary-request-tags" type="exec" mode="interpret" mandatory="false" processor="XSLT" condition=".[/root/PRconversation]" nodelist="env, PRconversation">
  488. <xts:logicsheet path="logicsheets/portal.xsl"/>
  489. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:xos="http://developer.cognos.com/schemas/xts/output/" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" exclude-result-prefixes="xsl xtsext xos cm bus SOAP-ENV xsi pf xsd xts">
  490. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  491. <xsl:template match="/root">
  492. <xts:sequence>
  493. <xts:replace select="/root/env/param[@name='ui.conversation']">
  494. <param name="ui.conversation">
  495. <xsl:variable name="markup-conv">
  496. <xsl:call-template name="serialize-xml">
  497. <xsl:with-param name="node-set" select="/root/PRconversation/*[local-name()='primaryRequest']/*"/>
  498. </xsl:call-template>
  499. </xsl:variable>
  500. <xsl:value-of select="string($markup-conv)"/>
  501. </param>
  502. </xts:replace>
  503. </xts:sequence>
  504. </xsl:template>
  505. <pf:serialize-xml/>
  506. </xsl:stylesheet>
  507. </xts:block>
  508. <!--
  509. ===============================================================================================
  510. render-page-fragment - Main page rendering block. Combines the "content" blocks generated in the blocks above with the report itself which is
  511. returned in a multi-part message from report server.
  512. ===============================================================================================
  513. -->
  514. <xts:block id="render-page-fragment" dependency="init set-conversation getOutput" type="exec" mode="output" mimeType="text/html" processor="XSLT" condition=".[/root/response/*[local-name()='Envelope']/*[local-name()='Body']/*/*[local-name()='result']/*[local-name()='details']/item/*[local-name() = 'status'] = 'prompting']" mandatory="false">
  515. <xts:logicsheet path="logicsheets/portal.xsl"/>
  516. <xts:logicsheet path="rv/logicsheets/rvlogic.xsl"/>
  517. <xts:logicsheet path="logicsheets/presentation/main/framework.xsl"/>
  518. <xts:logicsheet path="logicsheets/presentation/main/presentation.xsl"/>
  519. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  520. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  521. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  522. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xos="http://developer.cognos.com/schemas/xts/output/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:mt="http://developer.cognos.com/schemas/xts/logicsheets/presentation/main/mt" xmlns:mf="http://developer.cognos.com/schemas/xts/logicsheets/presentation/main/mf" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/" xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/" xmlns:rvl="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/rv/rvlogic/" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xhtml="http://www.w3.org/1999/xhtml" exclude-result-prefixes="xos pf mt mf xtsext cf cp bus xts dp SOAP-ENV xhtml rvl">
  523. <xsl:output method="html" encoding="utf-8" indent="no"/>
  524. <!-- current file name -->
  525. <xsl:variable name="mname" select="'report-viewer.xts'"/>
  526. <pf:variables/>
  527. <xsl:template match="/root">
  528. <link rel="stylesheet" type="text/css" href="{$skin_root}/portal/default.css"/>
  529. <script type="text/javascript" charset="utf-8" src="{$webcontent}/{$app}/js/cookie_jar.js"></script>
  530. <script type="text/javascript" charset="utf-8" src="{$webRoot}/prompting/CDispatcher.js"></script>
  531. <script type="text/javascript" charset="utf-8" src="{$webRoot}/prompting/pds.js"></script>
  532. <xsl:choose>
  533. <xsl:when test="/root/*[local-name() = 'response']/*[local-name() = 'Envelope']/*[local-name() = 'Body']/*/*/*[local-name()='details']/item[@xsi:type='bus:asynchDetailReportOutput']">
  534. <xsl:value-of select="/root/*[local-name() = 'response']/*[local-name() = 'Envelope']/*[local-name() = 'Body']/*/*/*[local-name()='details']/item[@xsi:type='bus:asynchDetailReportOutput']/*[local-name()='outputPages']/item" disable-output-escaping="yes"/>
  535. </xsl:when>
  536. <xsl:otherwise>
  537. <xsl:value-of select="/root/*[local-name() = 'response']/*[local-name() = 'Envelope']/*[local-name() = 'Body']/*/*/*/*[local-name() = 'item']" disable-output-escaping="yes"/>
  538. </xsl:otherwise>
  539. </xsl:choose>
  540. <script type="text/javascript">
  541. <xsl:choose>
  542. <xsl:when test="/root/response/*[local-name() = 'Envelope']/*[local-name() = 'Body']/*/*/*[local-name() = 'primaryRequest']">
  543. <xsl:variable name="markup-conv">
  544. <xsl:call-template name="serialize-xml">
  545. <xsl:with-param name="node-set" select="/root/response/*[local-name() = 'Envelope']/*[local-name() = 'Body']/*/*/*[local-name() = 'primaryRequest']/*"/>
  546. </xsl:call-template>
  547. </xsl:variable>
  548. <xsl:text/>F_pdsSetFormValue( 'ui.conversation', "<xsl:value-of select="xtsext:javascriptencode(string(xtsext:cafaction(concat('sign_wrap_setpassportid_', $passport), xtsext:web64encode(string($markup-conv), true()))))"/>" );<xsl:text/>
  549. </xsl:when>
  550. <xsl:when test="string(key('env-param', 'isEncoded')) = '1'">
  551. <xsl:text/>F_pdsSetFormValue( 'ui.conversation', "<xsl:value-of select="xtsext:javascriptencode(string(key('env-param', 'ui.conversation')))"/>" );<xsl:text/>
  552. </xsl:when>
  553. <xsl:otherwise>
  554. <xsl:text/>F_pdsSetFormValue( 'ui.conversation', "<xsl:value-of select="xtsext:javascriptencode(string(xtsext:web64encode(string(key('env-param', 'ui.conversation')), true())))"/>" );<xsl:text/>
  555. </xsl:otherwise>
  556. </xsl:choose>
  557. if (document.formWarpRequest["m"]) {
  558. document.formWarpRequest.m.value = "<xsl:value-of select="xtsext:javascriptencode(string(key('env-param', 'm')))"/>";
  559. }
  560. <xsl:choose>
  561. <xsl:when test="key('env-param', 'tracking') != ''">
  562. <!-- we'll take any tracking information that is being round tripped -->
  563. <xsl:choose>
  564. <xsl:when test="string(key('env-param', 'isEncoded')) = '1'">
  565. var tracking = "<xsl:value-of select="xtsext:javascriptencode(string(key('env-param', 'tracking')))"/>";
  566. </xsl:when>
  567. <xsl:otherwise>
  568. var tracking = "<xsl:value-of select="xtsext:javascriptencode(string(xtsext:cafaction(concat('sign_wrap_setpassportid_', $passport), xtsext:web64encode(string(key('env-param', 'tracking')), true()))))"/>";
  569. </xsl:otherwise>
  570. </xsl:choose>
  571. </xsl:when>
  572. <xsl:otherwise>
  573. <xsl:variable name="passport">
  574. <xsl:choose>
  575. <!-- pull the passport out of the bus header -->
  576. <xsl:when test="/root/credential/param[@name='CAM']/*[local-name() = 'CAM']/*[local-name = 'CAMPassport']/*[local-name() = 'id']">
  577. <xsl:value-of select="/root/credential/param[@name='CAM']/*[local-name() = 'CAM']/*[local-name = 'CAMPassport']/*[local-name() = 'id']"/>
  578. </xsl:when>
  579. <!-- if it's not there, see if it is still in the cookie -->
  580. <xsl:otherwise>
  581. <xsl:value-of select="xtsext:camcookie_action('getPassportID', $CAMPassportCookie)"/>
  582. </xsl:otherwise>
  583. </xsl:choose>
  584. </xsl:variable>
  585. <xsl:variable name="markup-track"><xsl:apply-templates select="/root/response/*[local-name()='Envelope']/*[local-name()='Header']/*[local-name()='biBusHeader']/*[local-name()='tracking']/*[local-name() = 'conversationContext']" mode="markup"/></xsl:variable>
  586. var tracking = "<xsl:value-of select="xtsext:javascriptencode(string(xtsext:cafaction(concat('sign_wrap_setpassportid_', $passport), xtsext:web64encode(string($markup-track), true()))))"/>";
  587. </xsl:otherwise>
  588. </xsl:choose>
  589. <xsl:text/>F_pdsSetFormValue( 'tracking', tracking );<xsl:text/>
  590. <xsl:if test="key('env-param', 'ccs_cbdata')">
  591. <xsl:text/>F_pdsSetFormValue( 'ccs_cbdata', "<xsl:value-of select="xtsext:javascriptencode(string(key('env-param', 'ccs_cbdata')))"/>" );<xsl:text/>
  592. </xsl:if>
  593. <xsl:if test="key('env-param', 'ccs_invoke')">
  594. <xsl:text/>F_pdsSetFormValue( 'ccs_invoke', "<xsl:value-of select="xtsext:javascriptencode(string(key('env-param', 'ccs_invoke')))"/>" );<xsl:text/>
  595. </xsl:if>
  596. <xsl:if test="key('env-param', 'routingServerGroup')">
  597. <xsl:text/>F_pdsSetFormValue( 'routingServerGroup', "<xsl:value-of select="xtsext:javascriptencode(string(key('env-param', 'routingServerGroup')))"/>" );<xsl:text/>
  598. </xsl:if>
  599. <xsl:if test="key('env-param', 'isEncoded')">
  600. <xsl:text/>F_pdsSetFormValue( 'isEncoded', "<xsl:value-of select="xtsext:javascriptencode(string(key('env-param', 'isEncoded')))"/>" );<xsl:text/>
  601. </xsl:if>
  602. <xsl:if test="key('env-param', 'clientContext')">
  603. <xsl:text/>F_pdsSetFormValue( 'clientContext', "<xsl:value-of select="xtsext:javascriptencode(string(key('env-param', 'clientContext')))"/>" );<xsl:text/>
  604. </xsl:if>
  605. <xsl:if test="key('env-param', 'returnEntireResponse')">
  606. <xsl:text/>F_pdsSetFormValue( 'returnEntireResponse', "<xsl:value-of select="xtsext:javascriptencode(string(key('env-param', 'returnEntireResponse')))"/>" );<xsl:text/>
  607. </xsl:if>
  608. <xsl:if test="key('env-param', 'newWindow') = '1' or key('env-param', 'newWindow') = 'true'">
  609. <xsl:text/>F_pdsSetFormValue( 'newWindow', 1 );<xsl:text/>
  610. </xsl:if>
  611. <xsl:if test="key('env-param', 'ui.cafcontextid')">
  612. <xsl:text/>F_pdsSetFormValue( 'ui.cafcontextid', "<xsl:value-of select="xtsext:javascriptencode(string(key('env-param', 'ui.cafcontextid')))"/>" );<xsl:text/>
  613. </xsl:if>
  614. <xsl:if test="key('env-param', 'run.xslURL')">
  615. <xsl:text/>F_pdsSetFormValue( 'run.xslURL', "<xsl:value-of select="xtsext:javascriptencode(string(key('env-param', 'run.xslURL')))"/>" );<xsl:text/>
  616. </xsl:if>
  617. <xsl:if test="key('env-param', 'md.callBack')">
  618. <xsl:text/>F_pdsSetFormValue( 'md.callBack', "<xsl:value-of select="xtsext:javascriptencode(string(key('env-param', 'md.callBack')))"/>" );<xsl:text/>
  619. </xsl:if>
  620. function promptButtonCancel()
  621. {
  622. F_pdsCallback(
  623. {"state":"Cancel"<xsl:text/>
  624. <xsl:if test="key('env-param', 'clientContext')">
  625. <xsl:text/>,"clientContext":"<xsl:value-of select="xtsext:javascriptencode(string(key('env-param', 'clientContext')))"/>"<xsl:text/>
  626. </xsl:if>
  627. <xsl:if test="key('env-param', 'ccs_cbdata')">
  628. <xsl:text/>,"ccs_cbdata":"<xsl:value-of select="xtsext:javascriptencode(string(key('env-param', 'ccs_cbdata')))"/>"<xsl:text/>
  629. </xsl:if>
  630. },
  631. "<xsl:value-of select="xtsext:javascriptencode(string(key('env-param', 'ccs_invoke')))"/>"
  632. );
  633. <xsl:if test="key('env-param', 'newWindow') = '1' or key('env-param', 'newWindow') = 'true'">
  634. window.close();
  635. </xsl:if>
  636. }
  637. </script>
  638. </xsl:template>
  639. <xsl:template name="convertBackJSEncoding">
  640. <xsl:param name="str"/>
  641. <xsl:choose>
  642. <xsl:when test="contains($str, '\n')">
  643. <xsl:call-template name="convertBackJSEncoding">
  644. <xsl:with-param name="str" select="substring-before($str, '\n')"/>
  645. </xsl:call-template><xsl:text>
  646. </xsl:text>
  647. <xsl:call-template name="convertBackJSEncoding">
  648. <xsl:with-param name="str" select="substring-after($str, '\n')"/>
  649. </xsl:call-template>
  650. </xsl:when>
  651. <xsl:when test="contains($str, '\t')">
  652. <xsl:call-template name="convertBackJSEncoding">
  653. <xsl:with-param name="str" select="substring-before($str, '\t')"/>
  654. </xsl:call-template><xsl:text> </xsl:text><xsl:call-template name="convertBackJSEncoding">
  655. <xsl:with-param name="str" select="substring-after($str, '\t')"/>
  656. </xsl:call-template>
  657. </xsl:when>
  658. <xsl:when test="contains($str, '\\')">
  659. <xsl:call-template name="convertBackJSEncoding">
  660. <xsl:with-param name="str" select="substring-before($str, '\\')"/>
  661. </xsl:call-template>\<xsl:call-template name="convertBackJSEncoding">
  662. <xsl:with-param name="str" select="substring-after($str, '\\')"/>
  663. </xsl:call-template>
  664. </xsl:when>
  665. <xsl:otherwise>
  666. <xsl:value-of select="$str" disable-output-escaping="yes"/>
  667. </xsl:otherwise>
  668. </xsl:choose>
  669. </xsl:template>
  670. <pf:serialize-xml/>
  671. </xsl:stylesheet>
  672. </xts:block>
  673. <xts:block id="render-page-finished" type="exec" mode="output" mimeType="text/html" processor="XSLT" dependency="execute wait"
  674. condition=".[(/root/response/*[local-name()='Envelope']/*[local-name()='Body']/*/*[local-name()='result']/*[local-name() = 'status'] = 'complete' or
  675. /root/response/*[local-name()='Envelope']/*[local-name()='Body']/*/*[local-name()='result']/*[local-name() = 'status'] = 'conversationComplete') and
  676. not(/root/response/*[local-name()='Envelope']/*[local-name()='Body']/*/*[local-name()='result']/*[local-name()='details']/item/*[local-name() = 'status'] = 'prompting')]"
  677. mandatory="false">
  678. <xts:logicsheet path="logicsheets/portal.xsl"/>
  679. <xts:logicsheet path="rv/logicsheets/rvlogic.xsl"/>
  680. <xts:logicsheet path="logicsheets/presentation/main/framework.xsl"/>
  681. <xts:logicsheet path="logicsheets/presentation/main/presentation.xsl"/>
  682. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  683. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  684. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  685. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xos="http://developer.cognos.com/schemas/xts/output/" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:mt="http://developer.cognos.com/schemas/xts/logicsheets/presentation/main/mt" xmlns:mf="http://developer.cognos.com/schemas/xts/logicsheets/presentation/main/mf" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/" xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/" xmlns:rvl="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/rv/rvlogic/" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" exclude-result-prefixes="xos pf mt mf xtsext cf cp bus xts dp SOAP-ENV xhtml">
  686. <xsl:output method="html" encoding="utf-8" indent="no"/>
  687. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  688. <pf:variables/>
  689. <pf:serialize-xml/>
  690. <xsl:template match="/root">
  691. <xsl:variable name="markup-track">
  692. <xsl:apply-templates select="/root/response/*[local-name() = 'Envelope']/*[local-name() = 'Header']/*[local-name() = 'biBusHeader']/*[local-name() = 'tracking']/*[local-name() = 'conversationContext']" mode="markup"/>
  693. </xsl:variable>
  694. <html>
  695. <head>
  696. <META http-equiv="Content-Script-Type" content="text/javascript"/>
  697. <script type="text/javascript" charset="utf-8" src="{$webRoot}/prompting/CDispatcher.js"></script>
  698. <script type="text/javascript" charset="utf-8" src="{$webRoot}/prompting/pds.js"></script>
  699. <script type="text/javascript" charset="utf-8" src="{$webRoot}/common/framework/util/requestManager.js"></script>
  700. <script type="text/javascript">
  701. function complete()
  702. {
  703. var conversation = null;
  704. var paramValues = new Array();
  705. <!-- calling it RPFpassport to avoid variable name collision: R(ender) P(age) F(inished) -->
  706. <xsl:variable name="RPFpassport">
  707. <xsl:choose>
  708. <!-- pull the passport out of the bus header -->
  709. <xsl:when test="/root/credential/param[@name='CAM']/*[local-name() = 'CAM']/*[local-name = 'CAMPassport']/*[local-name() = 'id']">
  710. <xsl:value-of select="/root/credential/param[@name='CAM']/*[local-name() = 'CAM']/*[local-name = 'CAMPassport']/*[local-name() = 'id']"/>
  711. </xsl:when>
  712. <!-- if it's not there, see if it is still in the cookie -->
  713. <xsl:otherwise>
  714. <xsl:value-of select="xtsext:camcookie_action('getPassportID', $CAMPassportCookie)"/>
  715. </xsl:otherwise>
  716. </xsl:choose>
  717. </xsl:variable>
  718. <xsl:choose>
  719. <xsl:when test="key('env-param', 'returnEntireResponse') = '1' or key('env-param', 'returnEntireResponse') = 'true'">
  720. <xsl:variable name="response-markup-params">
  721. <xsl:apply-templates select="/root/response/*[local-name() = 'Envelope']/*[local-name() = 'Body']/*" mode="markup"/>
  722. </xsl:variable>
  723. var response = "<xsl:value-of select="xtsext:javascriptencode(string($response-markup-params))"/>";
  724. </xsl:when>
  725. <xsl:otherwise>
  726. var response = "<xsl:value-of select="xtsext:javascriptencode(string(/root/*[local-name() = 'response']/*[local-name() = 'Envelope']/*[local-name() = 'Body']/*/*/*/*[local-name() = 'item']))"/>";
  727. </xsl:otherwise>
  728. </xsl:choose>
  729. <xsl:for-each select="/root/response/*[local-name() = 'Envelope']/*[local-name() = 'Body']/*/*/*/item[@xsi:type='bus:asynchDetailParameterValues']/*/*">
  730. <xsl:variable name="markup-params">
  731. <xsl:apply-templates select="." mode="markup"/>
  732. </xsl:variable>
  733. paramValues.push("<xsl:value-of select="xtsext:javascriptencode(string($markup-params))"/>");
  734. </xsl:for-each>
  735. <xsl:choose>
  736. <xsl:when test="key('env-param', 'releaseConversation') = '1'">
  737. dispatchObjectModelRequest("release");
  738. </xsl:when>
  739. <xsl:otherwise>
  740. <xsl:variable name="markup-conv">
  741. <xsl:apply-templates select="/root/response/*[local-name() = 'Envelope']/*[local-name() = 'Body']/*/*/*[local-name() = 'primaryRequest']/*" mode="markup"/>
  742. </xsl:variable>
  743. <xsl:variable name="passport">
  744. <xsl:choose>
  745. <!-- pull the passport out of the bus header -->
  746. <xsl:when test="/root/credential/param[@name='CAM']/*[local-name() = 'CAM']/*[local-name = 'CAMPassport']/*[local-name() = 'id']">
  747. <xsl:value-of select="/root/credential/param[@name='CAM']/*[local-name() = 'CAM']/*[local-name = 'CAMPassport']/*[local-name() = 'id']"/>
  748. </xsl:when>
  749. <!-- if it's not there, see if it is still in the cookie -->
  750. <xsl:otherwise>
  751. <xsl:value-of select="xtsext:camcookie_action('getPassportID', $CAMPassportCookie)"/>
  752. </xsl:otherwise>
  753. </xsl:choose>
  754. </xsl:variable>
  755. conversation = "<xsl:value-of select="xtsext:javascriptencode(string(xtsext:cafaction(concat('sign_wrap_setpassportid_', $passport), xtsext:web64encode(string($markup-conv), true()))))"/>";
  756. </xsl:otherwise>
  757. </xsl:choose>
  758. F_pdsCallback(
  759. {
  760. "parameters": paramValues,
  761. "state": response,
  762. "conversation": conversation,
  763. "clientContext": "<xsl:value-of select="xtsext:javascriptencode(string(key('env-param', 'clientContext')))"/>",
  764. "tracking": "<xsl:value-of select="xtsext:javascriptencode(string(xtsext:cafaction(concat('sign_wrap_setpassportid_', $RPFpassport), xtsext:web64encode(string($markup-track), true()))))"/>"
  765. <xsl:if test="key('env-param', 'ccs_cbdata')">
  766. <xsl:text/>,"ccs_cbdata":"<xsl:value-of select="xtsext:javascriptencode(string(key('env-param', 'ccs_cbdata')))"/>"<xsl:text/>
  767. </xsl:if>
  768. },
  769. "<xsl:value-of select="xtsext:javascriptencode(string(key('env-param', 'ccs_invoke')))"/>"
  770. );
  771. <xsl:if test="key('env-param', 'newWindow') = '1' or key('env-param', 'newWindow') = 'true'">
  772. window.close();
  773. </xsl:if>
  774. }
  775. </script>
  776. </head>
  777. <body onload="complete();">
  778. <form name="formWarpRequest" id="formWarpRequest" method="post" style="height:100%;margin:0px">
  779. <xsl:attribute name="onsubmit">if((typeof promptButtonOK).match(/^function$/i)){promptButtonOK();return false;} else if((typeof execute).match(/^function$/i)){execute();return false;}</xsl:attribute>
  780. <input type="hidden" name="m" value="{key('env-param', 'm')}"/>
  781. <input type="hidden" name="b_action" value="xts.run"/>
  782. <input type="hidden" name="run.xslURL" value="sa.xsl"/>
  783. <xsl:call-template name="addInputField">
  784. <xsl:with-param name="paramName">lang</xsl:with-param>
  785. </xsl:call-template>
  786. <input type="hidden" name="ui.object">
  787. <xsl:attribute name="value"><xsl:value-of select="key('env-param', 'ui.object')"/></xsl:attribute>
  788. </input>
  789. <input type="hidden" name="ui.backURL">
  790. <xsl:attribute name="value"><xsl:value-of select="key('env-param', 'ui.backURL')"/></xsl:attribute>
  791. </input>
  792. <input type="hidden" name="ui.action">
  793. <xsl:attribute name="value"><xsl:value-of select="key('env-param', 'ui.action')"/></xsl:attribute>
  794. </input>
  795. <input type="hidden" name="ui.errURL">
  796. <xsl:attribute name="value"><xsl:value-of select="key('env-param', 'ui.errURL')"/></xsl:attribute>
  797. </input>
  798. <input type="hidden" name="tracking">
  799. <xsl:attribute name="value"><xsl:value-of select="key('env-param', 'tracking')"/></xsl:attribute>
  800. </input>
  801. <input type="hidden" name="ui.conversation">
  802. <xsl:variable name="markup-conv">
  803. <xsl:call-template name="serialize-xml">
  804. <xsl:with-param name="node-set" select="/root/response/*[local-name() = 'Envelope']/*[local-name() = 'Body']/*/*/*[local-name() = 'primaryRequest']/*"/>
  805. </xsl:call-template>
  806. </xsl:variable>
  807. <xsl:attribute name="value"><xsl:value-of select="xtsext:web64encode(string($markup-conv), true())"/></xsl:attribute>
  808. </input>
  809. <xsl:call-template name="addInputField">
  810. <xsl:with-param name="paramName">ccs_invoke</xsl:with-param>
  811. </xsl:call-template>
  812. <xsl:call-template name="addInputField">
  813. <xsl:with-param name="paramName">ccs_cbdata</xsl:with-param>
  814. </xsl:call-template>
  815. <xsl:call-template name="addInputField">
  816. <xsl:with-param name="paramName">clientContext</xsl:with-param>
  817. </xsl:call-template>
  818. <xsl:call-template name="addInputField">
  819. <xsl:with-param name="paramName">clientContext</xsl:with-param>
  820. </xsl:call-template>
  821. <xsl:call-template name="addInputField">
  822. <xsl:with-param name="paramName">returnEntireResponse</xsl:with-param>
  823. </xsl:call-template>
  824. <xsl:if test="key('env-param', 'releaseConversation') = '1'">
  825. <input type="hidden" name="releaseConversation" value="1"/>
  826. </xsl:if>
  827. <xsl:if test="key('env-param', 'newWindow') = '1' or key('env-param', 'newWindow') = 'true'">
  828. <input type="hidden" name="newWindow" value="1"/>
  829. </xsl:if>
  830. <xsl:if test="key('env-param', 'ui.debug') = 'true'">
  831. <input type="hidden" name="ui.debug" value="true"/>
  832. </xsl:if>
  833. <xsl:call-template name="addInputField">
  834. <xsl:with-param name="paramName">routingServerGroup</xsl:with-param>
  835. </xsl:call-template>
  836. <xsl:call-template name="addInputField">
  837. <xsl:with-param name="paramName">ui.cafcontextid</xsl:with-param>
  838. </xsl:call-template>
  839. <xsl:call-template name="addInputField">
  840. <xsl:with-param name="paramName">run.xslURL</xsl:with-param>
  841. </xsl:call-template>
  842. <xsl:call-template name="addInputField">
  843. <xsl:with-param name="paramName">md.callBack</xsl:with-param>
  844. </xsl:call-template>
  845. </form>
  846. </body>
  847. </html>
  848. </xsl:template>
  849. <xsl:template name="addInputField">
  850. <xsl:param name="paramName" select="''"/>
  851. <xsl:if test="key('env-param', $paramName)">
  852. <input type="hidden" name="{$paramName}" value="{key('env-param', $paramName)}"/>
  853. </xsl:if>
  854. </xsl:template>
  855. </xsl:stylesheet>
  856. </xts:block>
  857. </xts:morphlet>