filterSearchRequest.xts 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538
  1. <xts:morphlet xmlns:xts="http://developer.cognos.com/schemas/xts/" requiredCapability="canUseQueryStudio">
  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:block id="queryCM" mode="interpret" processor="XSLT" type="exec" condition=".[/root/env/param[@name='xxRetrievePrompt']='true']" mandatory="false" nodelist="header, env, http, cookies, bus:biBusHeader">
  13. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  14. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:cm="http://developer.cognos.com/schemas/bibus/3/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt">
  15. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  16. <xsl:template match="/">
  17. <xts:sequence>
  18. <xts:append>
  19. <xts:request asText="true" href="bus://dispatcher" protocol="BUS" responseEnvelope="false" soapAction="http://www.ibm.com/xmlns/prod/cognos/contentManagerService/201404/">
  20. <SOAP-ENV:Envelope xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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:xs="http://www.w3.org/2001/XMLSchema">
  21. <SOAP-ENV:Header>
  22. <!--<bus:biBusHeader xsi:type="bus:biBusHeader" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/">
  23. <xsl:choose>
  24. <xsl:when test="/root/env/param[@name='ui.routingServerGroup']!=''">
  25. <bus:routing>
  26. <routingServerGroup>
  27. <xsl:value-of select="/root/env/param[@name='ui.routingServerGroup']"/>
  28. </routingServerGroup>
  29. </bus:routing>
  30. <xsl:apply-templates select="/root/header/bus:biBusHeader/*[local-name()!='routing']"/>
  31. </xsl:when>
  32. <xsl:otherwise>
  33. <xsl:apply-templates select="/root/header/bus:biBusHeader/*"/>
  34. </xsl:otherwise>
  35. </xsl:choose>
  36. </bus:biBusHeader>-->
  37. <xsl:if test="/root/env/param[@name='markup_track']!=''">
  38. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap', string(key('env-param','markup_track'))), true())" disable-output-escaping="yes"/>
  39. </xsl:if>
  40. <xsl:apply-templates select="/root/header/*[local-name() = 'biBusHeader']/*[local-name() != 'tracking' and local-name() != 'dispatcherTransportVars']"/>
  41. <xsl:if test="string(/root/env/param[@name='ui.routingServerGroup'])!=''">
  42. <bus:routing xsi:type="bus:routingInfo">
  43. <routingServerGroup>
  44. <xsl:value-of select="/root/env/param[@name='ui.routingServerGroup']"/>
  45. </routingServerGroup>
  46. </bus:routing>
  47. </xsl:if>
  48. </SOAP-ENV:Header>
  49. <SOAP-ENV:Body>
  50. <cm:query xmlns:cm="http://developer.cognos.com/schemas/bibus/3/">
  51. <search>
  52. <xsl:value-of select="xtsext:urldecode(string(/root/env/param[@name='xxSearchPath']))"/>
  53. </search>
  54. <properties xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="cm:propEnum[1]">
  55. <item xsi:type="">parameters</item>
  56. </properties>
  57. </cm:query>
  58. </SOAP-ENV:Body>
  59. </SOAP-ENV:Envelope>
  60. </xts:request>
  61. </xts:append>
  62. </xts:sequence>
  63. </xsl:template>
  64. <xsl:template match="*">
  65. <xsl:copy>
  66. <xsl:copy-of select="@*"/>
  67. <xsl:apply-templates/>
  68. </xsl:copy>
  69. </xsl:template>
  70. </xsl:stylesheet>
  71. </xts:block>
  72. <xts:block id="convertParameters" condition=".[/root/env/param[@name='xxExecutionParameters']!='']" mode="interpret" processor="XSLT" type="exec" mandatory="false" nodelist="env">
  73. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt">
  74. <xsl:template match="/">
  75. <xts:sequence>
  76. <xts:append select="/root">
  77. <executionParameters>
  78. <xsl:choose>
  79. <xsl:when test="starts-with(/root/env/param[@name='xxExecutionParameters'], 'CAF')">
  80. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap_settemplatename_filterpicklist_settemplateid_01', string(/root/env/param[@name='xxExecutionParameters'])), true())" disable-output-escaping="yes"/>
  81. </xsl:when>
  82. <xsl:otherwise>
  83. <xsl:value-of select="xtsext:web64decode(string(/root/env/param[@name='xxExecutionParameters']), true())" disable-output-escaping="yes"/>
  84. </xsl:otherwise>
  85. </xsl:choose>
  86. </executionParameters>
  87. </xts:append>
  88. </xts:sequence>
  89. </xsl:template>
  90. </xsl:stylesheet>
  91. </xts:block>
  92. <xts:block id="getContent" mode="interpret" processor="XSLT" type="exec" dependency="queryCM convertParameters" nodelist="env, header, command, system, session, user, actions, tabs, http, configProps, credential, cookies, setCookies, accountOptions, newSession, gatewayURI, bus:biBusHeader, executionParameters, output, SOAP-ENV:Envelope">
  93. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  94. <xts:logicsheet path="logicsheets/portal.xsl"/>
  95. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:SOAP-ENV="http://www.w3.org/2001/09/soap-envelope" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:pf="http://developer.cognos.com/schemas/xts/pf">
  96. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  97. <xsl:output method="xml" version="1.0" encoding="UTF-8"/>
  98. <pf:variables/>
  99. <xsl:variable name="colId">
  100. <xsl:text/>
  101. <xsl:value-of select="/root/env/param[@name='xxColid']"/>
  102. <xsl:text/>
  103. </xsl:variable>
  104. <xsl:variable name="useItemRef">
  105. <xsl:text/>
  106. <xsl:value-of select="/root/env/param[@name='xxUseItemRef']"/>
  107. <xsl:text/>
  108. </xsl:variable>
  109. <xsl:variable name="displayItemRef">
  110. <xsl:text/>
  111. <xsl:value-of select="/root/env/param[@name='xxDisplayItemRef']"/>
  112. <xsl:text/>
  113. </xsl:variable>
  114. <xsl:variable name="displayItemRefExp">
  115. <xsl:text/>
  116. <xsl:value-of select="/root/env/param[@name='xxDisplayItemRefExp']"/>
  117. <xsl:text/>
  118. </xsl:variable>
  119. <xsl:variable name="fullColExpression">
  120. <xsl:text/>
  121. <xsl:value-of select="/root/env/param[@name='xxFullColExpression']"/>
  122. <xsl:text/>
  123. </xsl:variable>
  124. <!-- The display item ref is the displayItemRef if defined and if not it is the colID-->
  125. <xsl:variable name="displayItemRefColumn">
  126. <xsl:choose>
  127. <xsl:when test="$displayItemRef != ''">
  128. <xsl:value-of select="$displayItemRef" />
  129. </xsl:when>
  130. <xsl:otherwise>
  131. <xsl:value-of select="$colId" />
  132. </xsl:otherwise>
  133. </xsl:choose>
  134. </xsl:variable>
  135. <xsl:variable name="displayItemRefColumnExpr">
  136. <xsl:choose>
  137. <xsl:when test="$displayItemRefExp != ''">
  138. <xsl:value-of select="$displayItemRefExp" />
  139. </xsl:when>
  140. <xsl:otherwise>
  141. <xsl:value-of select="$fullColExpression" />
  142. </xsl:otherwise>
  143. </xsl:choose>
  144. </xsl:variable>
  145. <xsl:variable name="useItemRefColumn">
  146. <!-- set the dataItemRef to request. This is useItemRef or colId. -->
  147. <xsl:choose>
  148. <xsl:when test="$useItemRef != ''">
  149. <xsl:value-of select="$useItemRef" />
  150. </xsl:when>
  151. <xsl:otherwise>
  152. <xsl:value-of select="$colId" />
  153. </xsl:otherwise>
  154. </xsl:choose>
  155. </xsl:variable>
  156. <xsl:variable name="sortItemRefColumn">
  157. <!-- set the dataItemRef to request. This is displayItemRef, useItemRef or colId. -->
  158. <xsl:choose>
  159. <xsl:when test="$displayItemRef != ''">
  160. <xsl:value-of select="$displayItemRef" />
  161. </xsl:when>
  162. <xsl:when test="$useItemRef != ''">
  163. <xsl:value-of select="$useItemRef" />
  164. </xsl:when>
  165. <xsl:otherwise>
  166. <xsl:value-of select="$colId" />
  167. </xsl:otherwise>
  168. </xsl:choose>
  169. </xsl:variable>
  170. <xsl:variable name="QSRunSpecification">
  171. &lt;report expressionLocale=&quot;<xsl:value-of select="xtsext:xmlencode(string(/root/env/param[@name='xxExprLocale']))"/>&quot; xmlns=&quot;http://developer.cognos.com/schemas/report/5.0/&quot;&gt;
  172. &lt;layouts&gt;
  173. &lt;layout&gt;
  174. &lt;reportPages&gt;
  175. &lt;page name=&quot;PromptPage&quot;&gt;
  176. &lt;pageBody&gt;
  177. &lt;contents&gt;
  178. &lt;selectWithSearch name=&quot;pSearch&quot; parameter=&quot;searchEngine&quot; refQuery=&quot;Query1&quot;&gt;
  179. &lt;useItem refDataItem=&quot;<xsl:value-of select="xtsext:xmlencode(string($useItemRefColumn))"/>&quot;&gt;<xsl:text/>
  180. &lt;displayItem refDataItem=&quot;<xsl:value-of select="xtsext:xmlencode(string($displayItemRefColumn))"/>&quot;/&gt;<xsl:text/>
  181. &lt;/useItem&gt;
  182. &lt;sortList&gt;
  183. &lt;sortItem refDataItem=&quot;<xsl:value-of select="xtsext:xmlencode(string($sortItemRefColumn))"/>&quot; sortOrder=&quot;ascending&quot;/&gt;
  184. &lt;/sortList&gt;
  185. &lt;/selectWithSearch&gt;
  186. &lt;/contents&gt;
  187. &lt;/pageBody&gt;
  188. &lt;/page&gt;
  189. &lt;/reportPages&gt;
  190. &lt;/layout&gt;
  191. &lt;/layouts&gt;
  192. &lt;modelPath&gt;<xsl:value-of select="xtsext:xmlencode(xtsext:urldecode(string(/root/env/param[@name='xxModelName'])))"/>&lt;/modelPath&gt;
  193. &lt;queries&gt;
  194. &lt;query name=&quot;Query1&quot;&gt;
  195. &lt;source&gt;
  196. &lt;model/&gt;
  197. &lt;/source&gt;
  198. &lt;selection&gt;
  199. <xsl:if test="$useItemRef != '' and $useItemRef != $displayItemRefColumn">
  200. &lt;dataItem name=&quot;<xsl:value-of select="xtsext:xmlencode(string(/root/env/param[@name='xxUseItemRef']))"/>&quot; aggregate=&quot;none&quot;&gt;
  201. &lt;expression&gt;<xsl:text/>
  202. <xsl:value-of select="xtsext:xmlencode(string(/root/env/param[@name='xxUseItemRefExp']))"/>
  203. <xsl:text/>&lt;/expression&gt;
  204. &lt;/dataItem&gt;
  205. </xsl:if>
  206. <xsl:if test="$colId != '' and $colId != $useItemRef and $colId != $displayItemRefColumn">
  207. &lt;dataItem name=&quot;<xsl:value-of select="xtsext:xmlencode(string(/root/env/param[@name='xxColid']))"/>&quot; aggregate=&quot;none&quot;&gt;
  208. &lt;expression&gt;<xsl:text/>
  209. <xsl:value-of select="xtsext:xmlencode(string($fullColExpression))"/>
  210. <xsl:text/>&lt;/expression&gt;
  211. &lt;/dataItem&gt;
  212. </xsl:if>
  213. <xsl:if test="$displayItemRefColumn != ''">
  214. &lt;dataItem name=&quot;<xsl:value-of select="xtsext:xmlencode(string($displayItemRefColumn))"/>&quot; aggregate=&quot;none&quot;&gt;
  215. &lt;expression&gt;<xsl:text/>
  216. <xsl:value-of select="xtsext:xmlencode(string($displayItemRefColumnExpr))"/>
  217. <xsl:text/>&lt;/expression&gt;
  218. &lt;/dataItem&gt;
  219. </xsl:if>
  220. <xsl:for-each select="/root/env/param[@name='xxOtherCols']">
  221. <xsl:variable name="var"><xsl:value-of select="."/></xsl:variable>
  222. <xsl:variable name="colLabel"><xsl:value-of select="substring-before($var,',')"/></xsl:variable>
  223. <xsl:variable name="colExpr"><xsl:value-of select="substring-after($var,',')"/></xsl:variable>
  224. &lt;dataItem name=&quot;<xsl:value-of select="xtsext:xmlencode(string(/root/env/param[@name=$colLabel]))"/>&quot; aggregate=&quot;none&quot;&gt;
  225. &lt;expression&gt;<xsl:text/>
  226. <xsl:value-of select="xtsext:xmlencode(string(/root/env/param[@name=$colExpr]))"/>
  227. <xsl:text/>&lt;/expression&gt;
  228. &lt;/dataItem&gt;
  229. </xsl:for-each>
  230. <!-- I don't know how this should work for prompt cascades yet
  231. <xsl:for-each select="/root/env/param[@name='xxPromptCascade']">
  232. &lt;detailFilter&gt;
  233. &lt;filter use=&quot;optional&quot;&gt;
  234. &lt;filterExpression&gt;<xsl:value-of select="."/>&lt;/filterExpression&gt;
  235. &lt;/filter&gt;
  236. &lt;/detailFilter&gt;
  237. </xsl:for-each>
  238. -->
  239. &lt;/selection&gt;
  240. <xsl:if test="
  241. (/root/env/param[@name='xxIsAttribute'] = 'true' and not(/root/env/param[@name='xxFilterItemRefExp']))
  242. or
  243. (/root/env/param[@name='xxOtherCols'] and (/root/env/param[@name='xxCalcOp'] = 'rangeNumber' or /root/env/param[@name='xxIsCondStyle'] = 'true'))">
  244. &lt;dimensionInfo&gt;
  245. &lt;dimensions&gt;
  246. <xsl:if test="(/root/env/param[@name='xxFilterItemRef']!='') or (/root/env/param[@name='xxColid'])">
  247. &lt;dimension name=&quot;dimFilterItemRef&quot;&gt;
  248. &lt;levels&gt;
  249. <xsl:if test="/root/env/param[@name='xxFilterItemRef']!=''">
  250. &lt;level name=&quot;<xsl:value-of select="xtsext:xmlencode(string(/root/env/param[@name='xxFilterItemRef']))"/>&quot;&gt;
  251. &lt;keys&gt;
  252. &lt;key name=&quot;<xsl:value-of select="xtsext:xmlencode(string(/root/env/param[@name='xxFilterItemRef']))"/>&quot; refDataItem=&quot;<xsl:value-of select="xtsext:xmlencode(string(/root/env/param[@name='xxFilterItemRef']))"/>&quot;/&gt;
  253. &lt;/keys&gt;
  254. &lt;/level&gt;
  255. </xsl:if>
  256. <xsl:if test="/root/env/param[@name='xxColid']">
  257. &lt;level name=&quot;<xsl:value-of select="xtsext:xmlencode(string(/root/env/param[@name='xxColid']))"/>&quot;&gt;
  258. &lt;keys&gt;
  259. &lt;key name=&quot;<xsl:value-of select="xtsext:xmlencode(string(/root/env/param[@name='xxColid']))"/>&quot; refDataItem=&quot;<xsl:value-of select="xtsext:xmlencode(string(/root/env/param[@name='xxColid']))"/>&quot;/&gt;
  260. &lt;/keys&gt;
  261. &lt;/level&gt;
  262. </xsl:if>
  263. &lt;/levels&gt;
  264. &lt;/dimension&gt;
  265. </xsl:if>
  266. <xsl:if test="/root/env/param[@name='xxOtherCols'] and (/root/env/param[@name='xxCalcOp'] = 'rangeNumber' or /root/env/param[@name='xxIsCondStyle'] = 'true')">
  267. <xsl:for-each select="/root/env/param[@name='xxOtherCols']">
  268. <xsl:variable name="var"><xsl:value-of select="."/></xsl:variable>
  269. <xsl:variable name="colLabel"><xsl:value-of select="substring-before($var,',')"/></xsl:variable>
  270. <xsl:variable name="colExpr"><xsl:value-of select="substring-after($var,',')"/></xsl:variable>
  271. &lt;dimension name=&quot;<xsl:value-of select="xtsext:xmlencode(string(/root/env/param[@name=$colLabel]))"/>&quot;&gt;
  272. &lt;levels&gt;
  273. &lt;level name=&quot;<xsl:value-of select="xtsext:xmlencode(string(/root/env/param[@name=$colLabel]))"/>&quot;&gt;
  274. &lt;keys&gt;
  275. &lt;key name=&quot;<xsl:value-of select="xtsext:xmlencode(string(/root/env/param[@name=$colLabel]))"/>&quot; refDataItem=&quot;<xsl:value-of select="xtsext:xmlencode(string(/root/env/param[@name=$colLabel]))"/>&quot;/&gt;
  276. &lt;/keys&gt;
  277. &lt;/level&gt;
  278. &lt;/levels&gt;
  279. &lt;/dimension&gt;
  280. </xsl:for-each>
  281. </xsl:if>
  282. &lt;/dimensions&gt;
  283. &lt;/dimensionInfo&gt;
  284. </xsl:if>
  285. &lt;/query&gt;
  286. &lt;/queries&gt;
  287. &lt;/report&gt;
  288. </xsl:variable>
  289. <xsl:template match="/">
  290. <xts:sequence>
  291. <xts:append select="/root/env">
  292. <param name="QSRunSpecification"><xsl:value-of select="$QSRunSpecification"/></param>
  293. </xts:append>
  294. <xts:append>
  295. <xts:request asText="true" href="bus://dispatcher" protocol="BUS" soapAction="http://www.ibm.com/xmlns/prod/cognos/reportService/201404/" faultBlock="faultHandler" responseEnvelope="true" outputHeader="true">
  296. <SOAP-ENV:Envelope 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:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  297. <SOAP-ENV:Header>
  298. <bus:biBusHeader xsi:type="bus:biBusHeader" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/">
  299. <xsl:if test="/root/env/param[@name='searchTracking']!='' or /root/header/bus:biBusHeader/*[local-name()='tracking']">
  300. <xsl:choose>
  301. <xsl:when test="/root/env/param[@name='searchTracking']!=''">
  302. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap', string(/root/env/param[@name='searchTracking'])), true())" disable-output-escaping="yes"/>
  303. </xsl:when>
  304. <xsl:otherwise>
  305. <xsl:if test="/root/env/param[@name='markup_track']!=''">
  306. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap', string(key('env-param','markup_track'))), true())" disable-output-escaping="yes"/>
  307. </xsl:if>
  308. </xsl:otherwise>
  309. </xsl:choose>
  310. </xsl:if>
  311. <xsl:choose>
  312. <xsl:when test="/root/env/param[@name='ui.routingServerGroup']!=''">
  313. <bus:routing>
  314. <routingServerGroup>
  315. <xsl:value-of select="/root/env/param[@name='ui.routingServerGroup']"/>
  316. </routingServerGroup>
  317. </bus:routing>
  318. <xsl:apply-templates select="/root/header/bus:biBusHeader/*[local-name()!='routing' and local-name()!='tracking' and local-name() != 'dispatcherTransportVars']"/>
  319. </xsl:when>
  320. <xsl:otherwise>
  321. <!--For bug 611371. Don't copy the dispatcherTransportVars since these are copied directly from
  322. the browser. This can cause permission problems due to a 'front' = 'true' variable signifying
  323. this as an external request, even though it's internal.-->
  324. <xsl:apply-templates select="/root/header/bus:biBusHeader/*[local-name() != 'tracking' and local-name() != 'dispatcherTransportVars']"/>
  325. </xsl:otherwise>
  326. </xsl:choose>
  327. </bus:biBusHeader>
  328. </SOAP-ENV:Header>
  329. <SOAP-ENV:Body>
  330. <xsl:choose>
  331. <xsl:when test="/root/env/param[@name='searchConversation']!=''">
  332. <forward xmlns="http://developer.cognos.com/schemas/reportService/1">
  333. <bus:conversation xsi:type="bus:asynchRequest">
  334. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap', string(/root/env/param[@name='searchConversation'])), true())" disable-output-escaping="yes"/>
  335. </bus:conversation>
  336. <xsl:call-template name="setParameterValues"/>
  337. <xsl:call-template name="setOptions"/>
  338. </forward>
  339. </xsl:when>
  340. <xsl:otherwise>
  341. <runSpecification xmlns="http://developer.cognos.com/schemas/reportService/1">
  342. <specification xsi:type="bus:reportServiceReportSpecification">
  343. <bus:value xsi:type="bus:specification">
  344. <xsl:value-of select="$QSRunSpecification"/>
  345. </bus:value>
  346. </specification>
  347. <xsl:call-template name="setParameterValues"/>
  348. <xsl:call-template name="setOptions"/>
  349. </runSpecification>
  350. </xsl:otherwise>
  351. </xsl:choose>
  352. </SOAP-ENV:Body>
  353. </SOAP-ENV:Envelope>
  354. </xts:request>
  355. </xts:append>
  356. </xts:sequence>
  357. </xsl:template>
  358. <xsl:template name="setParameterValues" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
  359. <parameterValues xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:parameterValue[]">
  360. <xsl:for-each select="/root/env/param[@name='xxCreds']">
  361. <xsl:value-of select="." disable-output-escaping="yes"/>
  362. </xsl:for-each>
  363. <xsl:for-each select="/root/env/param[@name='xxPromptValues']">
  364. <xsl:value-of select="." disable-output-escaping="yes"/>
  365. </xsl:for-each>
  366. <xsl:if test="/root/executionParameters">
  367. <xsl:copy-of select="/root/executionParameters/*[local-name()='parameters']/*"/>
  368. </xsl:if>
  369. </parameterValues>
  370. </xsl:template>
  371. <xsl:template name="setOptions" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
  372. <options xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:option[]" >
  373. <item xsi:type="bus:runOptionStringArray">
  374. <bus:name xsi:type="bus:runOptionEnum">outputFormat</bus:name>
  375. <bus:value xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:string[1]">
  376. <item>XHTML</item>
  377. </bus:value>
  378. </item>
  379. <item xsi:type="bus:runOptionAnyURI">
  380. <bus:name xsi:type="bus:runOptionEnum">xslURL</bus:name>
  381. <bus:value xsi:type="xsd:string">null.xsl</bus:value>
  382. </item>
  383. <item xsi:type="bus:asynchOptionInt">
  384. <bus:name xsi:type="bus:asynchOptionEnum">primaryWaitThreshold</bus:name>
  385. <bus:value xsi:type="xsd:int">0</bus:value>
  386. </item>
  387. <item xsi:type="bus:runOptionBoolean">
  388. <bus:name xsi:type="bus:runOptionEnum">prompt</bus:name>
  389. <bus:value xsi:type="xsd:boolean">false</bus:value>
  390. </item>
  391. <xsl:if test="/root/env/param[@name='xxDesignMode'] = 'true'">
  392. <item xsi:type="bus:runOptionData">
  393. <bus:name xsi:type="bus:runOptionEnum">data</bus:name>
  394. <bus:value xsi:type="bus:dataEnum">previewWithLimitedData</bus:value>
  395. </item>
  396. </xsl:if>
  397. </options>
  398. </xsl:template>
  399. <xsl:template match="*">
  400. <xsl:copy>
  401. <xsl:copy-of select="@*"/>
  402. <xsl:apply-templates/>
  403. </xsl:copy>
  404. </xsl:template>
  405. </xsl:stylesheet>
  406. </xts:block>
  407. <xts:block id="appendDocument" mode="interpret" processor="XSLT" type="exec" dependency="getContent" mandatory="false" nodelist="env, output, SOAP-ENV:Envelope, cm:queryResponse" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  408. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:cm="http://developer.cognos.com/schemas/cm/1/" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="xsl xts cm bus xtsext">
  409. <xsl:output method="xml" version="1.0" encoding="UTF-8"/>
  410. <xsl:template match="/root">
  411. <xts:sequence>
  412. <xts:append select="/root">
  413. <xsl:value-of select=".//*[local-name()='runSpecificationResponse' or local-name()='forwardResponse']/*[local-name()='result']/*[local-name()='details']/*[local-name()='item']/*[local-name()='outputPages']/*[local-name()='item']" disable-output-escaping="yes"/>
  414. </xts:append>
  415. <xts:append select="/root/env">
  416. <param name="promptSelections"><selectChoices><xsl:for-each select="/root/*[local-name() = 'queryResponse']/queryResult/item/parameters/value/item"><xsl:if test="/root/env/param[@name='xxPromptParam']=./name"><xsl:for-each select="./value/item"><selectOption><xsl:attribute name="displayValue"><xsl:value-of select="./display" disable-output-escaping="yes"/></xsl:attribute><xsl:attribute name="useValue"><xsl:value-of select="./use" disable-output-escaping="yes"/></xsl:attribute></selectOption></xsl:for-each></xsl:if></xsl:for-each></selectChoices></param>
  417. </xts:append>
  418. </xts:sequence>
  419. </xsl:template>
  420. </xsl:stylesheet>
  421. </xts:block>
  422. <!-- A block to handle a prompt response. This usually doesn't happen because all our prompts are already defined via xxPromptParams
  423. or in executionParameters. However, in the case of prompt macros, they may not be defined when in nodata mode. (See bug 613217).
  424. Simply creates javascript that contains the report spec we're going to round-trip to promptDataSource.xts.
  425. -->
  426. <xts:block id="handlePrompt" mode="output" processor="XSLT" type="exec" mimeType="application/x-javascript" dependency="appendDocument" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" condition=".[/root/*[local-name() = 'Envelope']/*[local-name() = 'Body']/*/*[local-name() = 'result']/*[local-name() = 'details']/item/*[local-name() = 'status'] = 'prompting']" mandatory="false">
  427. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" version="1.0">
  428. <xsl:output method="text" version="1.0" encoding="UTF-8" indent="no"/>
  429. <pf:variables/>
  430. <!-- Set the run Specification we've already created. This will be passed along to promptDataSource.xts -->
  431. <xsl:variable name="runSpecification">
  432. <xsl:value-of select="/root/env/param[@name='QSRunSpecification']"/>
  433. </xsl:variable>
  434. <xsl:template match="/root">
  435. var bPrompting = true;
  436. var sReportSpecification = "<xsl:text/><xsl:value-of select="xtsext:javascriptencode($runSpecification)"/><xsl:text/>";
  437. </xsl:template>
  438. </xsl:stylesheet>
  439. </xts:block>
  440. <xts:block id="parseContent" mode="output" processor="XSLT" type="exec" mimeType="application/x-javascript" dependency="appendDocument" mandatory="false" nodelist="env, header, command, system, session, user, actions, tabs, http, configProps, credential, cookies, setCookies, accountOptions, newSession, gatewayURI, executionParameters, logonFault, Document, output, SOAP-ENV:Envelope">
  441. <xts:logicsheet path="logicsheets/portal.xsl"/>
  442. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" version="1.0">
  443. <xsl:output method="text" version="1.0" encoding="UTF-8" indent="no"/>
  444. <pf:variables/>
  445. <pf:serialize-xml/>
  446. <xsl:template match="/root">
  447. <xsl:choose>
  448. <xsl:when test="/root/logonFault">
  449. <xsl:text/>FAULT;timeout<xsl:text/>
  450. </xsl:when>
  451. <xsl:otherwise>
  452. <xsl:variable name="textBoxControlLocal">
  453. <xsl:choose>
  454. <xsl:when test="/root/env/param[@name='textBoxControl']='checkBoxListpList'">checkBoxListpList</xsl:when>
  455. <xsl:when test="/root/env/param[@name='textBoxControl']='treepList'">treepList</xsl:when>
  456. <xsl:otherwise>searchpSearch</xsl:otherwise>
  457. </xsl:choose>
  458. </xsl:variable>
  459. <xsl:for-each select="/root/Document/DATA/PAGE/OTR/OTD/selectWithSearch/selectOptions/selectOption">
  460. <xsl:text/>
  461. <xsl:value-of select="$textBoxControlLocal"/>.addNoUpdate(<xsl:text/>
  462. <xsl:text/>'<xsl:value-of select="xtsext:javascriptencode(./@displayValue)"/>','<xsl:value-of select="xtsext:javascriptencode(./@useValue)"/>','result',false<xsl:text/>
  463. <xsl:text/>);<xsl:text/>
  464. </xsl:for-each>
  465. <xsl:for-each select="/root/env/param[@name='promptSelections']/selectChoices/selectOption">
  466. <xsl:text/>
  467. <xsl:value-of select="$textBoxControlLocal"/>.addNoUpdate(<xsl:text/>
  468. <xsl:text/>'<xsl:value-of select="xtsext:javascriptencode(./@displayValue)"/>','<xsl:value-of select="xtsext:javascriptencode(./@useValue)"/>','list',false<xsl:text/>
  469. <xsl:text/>);<xsl:text/>
  470. </xsl:for-each>
  471. <xsl:text/><xsl:value-of select="$textBoxControlLocal"/>.update();<xsl:text/>
  472. <xsl:if test="/root//*[local-name()='runSpecificationResponse']/*[local-name()='result']/*[local-name()='primaryRequest']">
  473. <xsl:variable name="conversation">
  474. <xsl:call-template name="serialize-xml">
  475. <xsl:with-param name="node-set" select="/root//*[local-name()='runSpecificationResponse']/*[local-name()='result']/*[local-name()='primaryRequest']/*"/>
  476. </xsl:call-template>
  477. </xsl:variable>
  478. <xsl:text/>getConfigFrame().dlgGlobalSetParm("searchConversation", "<xsl:value-of select="xtsext:cafaction(concat('sign_wrap_setpassportid_', $passport), xtsext:web64encode(string($conversation), true()))" disable-output-escaping="yes"/>");<xsl:text/>
  479. </xsl:if>
  480. <xsl:choose>
  481. <xsl:when test="/root/*[local-name()='Envelope']/*[local-name()='Header']/*[local-name()='biBusHeader']/*[local-name()='tracking']">
  482. <xsl:variable name="tracking">
  483. <xsl:call-template name="serialize-xml">
  484. <xsl:with-param name="node-set" select="/root/*[local-name()='Envelope']/*[local-name()='Header']/*[local-name()='biBusHeader']/*[local-name()='tracking']"/>
  485. </xsl:call-template>
  486. </xsl:variable>
  487. <xsl:text/>getConfigFrame().dlgGlobalSetParm("searchTracking", "<xsl:value-of select="xtsext:cafaction(concat('sign_wrap_setpassportid_', $passport), xtsext:web64encode(string($tracking), true()))" disable-output-escaping="yes"/>");<xsl:text/>
  488. </xsl:when>
  489. <xsl:when test="/root/header/*[local-name()='biBusHeader']/*[local-name()='tracking']">
  490. <xsl:variable name="tracking">
  491. <xsl:call-template name="serialize-xml">
  492. <xsl:with-param name="node-set" select="/root/header/*[local-name()='biBusHeader']/*[local-name()='tracking']"/>
  493. </xsl:call-template>
  494. </xsl:variable>
  495. <xsl:text/>getConfigFrame().dlgGlobalSetParm("searchTracking", "<xsl:value-of select="xtsext:cafaction(concat('sign_wrap_setpassportid_', $passport), xtsext:web64encode(string($tracking), true()))" disable-output-escaping="yes"/>");<xsl:text/>
  496. </xsl:when>
  497. </xsl:choose>
  498. </xsl:otherwise>
  499. </xsl:choose>
  500. </xsl:template>
  501. </xsl:stylesheet>
  502. </xts:block>
  503. <xts:block id="faultHandler" path="qs/logicsheets/faultHandler.xsl" type="fault" processor="XSLT" nodelist="fault"/>
  504. </xts:morphlet>