metadata.xts 52 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951
  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 resolverBase="prompting" 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. </bus:biBusHeader>
  34. </SOAP-ENV:Header>
  35. <SOAP-ENV:Body>
  36. <xsl:element name="wait" namespace="http://developer.cognos.com/schemas/reportService/1">
  37. <bus:conversation xsi:type="bus:asynchRequest" xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:nil="true"/>
  38. <bus:parameterValues xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:parameterValue[]" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"/>
  39. <bus:options xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:option[]" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"/>
  40. </xsl:element>
  41. </SOAP-ENV:Body>
  42. </SOAP-ENV:Envelope>
  43. </xts:request>
  44. </response>
  45. </xts:append>
  46. </xts:sequence>
  47. </xsl:template>
  48. <!-- don't include superfluous fields in Envelope -->
  49. <xsl:template match="*[local-name()='formFieldVars']/item[name='inlineSpec' or name='conversation' or name='previousConversation' or name='cancelStack']"/>
  50. <!-- used to copy the bus header stuff - see "apply-templates" above. -->
  51. <xsl:template match="*">
  52. <xsl:copy>
  53. <xsl:copy-of select="@*"/>
  54. <xsl:apply-templates/>
  55. </xsl:copy>
  56. </xsl:template>
  57. </xsl:stylesheet>
  58. </xts:block>
  59. <!--
  60. ===============================================================================================
  61. getOutput - Special case to handle complete.
  62. With complete, we just need to call getOutput to get the actual output, so do it here instead of bouncing through the browser .
  63. ===============================================================================================
  64. -->
  65. <xts:block id="getOutput" dependency="wait" type="exec" mode="interpret" processor="XSLT"
  66. condition=".[not(/root/env/param[@name = 'metadataTree']) and (/root/*[local-name()='response']/*[local-name()='Envelope']/*[local-name()='Body']/*[local-name()='waitResponse']/*/*[local-name()='details']/*[local-name()='item']/*[local-name()='status']='responseReady')]" mandatory="false" nodelist="header, env, response">
  67. <xsl:stylesheet version="1.0"
  68. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  69. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  70. xmlns:xos="http://developer.cognos.com/schemas/xts/output/"
  71. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  72. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  73. xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  74. xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
  75. xmlns:xs="http://www.w3.org/2001/XMLSchema"
  76. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  77. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
  78. exclude-result-prefixes="xsl xts xos cm bus SOAP-ENV xsi send"
  79. >
  80. <xsl:output method="xml"/>
  81. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  82. <xsl:template match="/root">
  83. <xts:sequence>
  84. <xts:append>
  85. <affinity>absolute</affinity>
  86. </xts:append>
  87. </xts:sequence>
  88. <xts:sequence>
  89. <xts:replace select="/root/response">
  90. <!-- replace the existing response -->
  91. <response>
  92. <xts:request href="bus://dispatcher" protocol="BUS" responseEnvelope="true" outputHeader="true" option="xml-multipart" soapAction="http://www.ibm.com/xmlns/prod/cognos/reportService/201404/.absolute" faultBlock="faultHandler">
  93. <SOAP-ENV:Envelope>
  94. <SOAP-ENV:Header>
  95. <bus:biBusHeader xsi:type="bus:biBusHeader" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  96. <xsl:if test="/root/env/param[@name='markup_track']!=''">
  97. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap', string(key('env-param','markup_track'))), true())" disable-output-escaping="yes"/>
  98. </xsl:if>
  99. <!-- For bug 611371. Don't copy the dispatcherTransportVars since these are copied directly from
  100. the browser. This can cause permission problems due to a 'front' = 'true' variable signifying
  101. this as an external request, even though it's internal. -->
  102. <xsl:apply-templates select="/root/header/*[local-name() = 'biBusHeader']/*[local-name() != 'tracking' and local-name() != 'dispatcherTransportVars']"/>
  103. <xsl:if test="key('env-param','ui.routingServerGroup')!=''">
  104. <bus:routing>
  105. <routingServerGroup>
  106. <xsl:value-of select="key('env-param','ui.routingServerGroup')"/>
  107. </routingServerGroup>
  108. </bus:routing>
  109. </xsl:if>
  110. </bus:biBusHeader>
  111. </SOAP-ENV:Header>
  112. <SOAP-ENV:Body>
  113. <xsl:element name="getOutput" namespace="http://developer.cognos.com/schemas/reportService/1">
  114. <bus:conversation xsi:type="bus:asynchRequest" xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:nil="true"/>
  115. <bus:parameterValues xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:parameterValue[]" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"/>
  116. <bus:options xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:option[]" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"/>
  117. </xsl:element>
  118. </SOAP-ENV:Body>
  119. </SOAP-ENV:Envelope>
  120. </xts:request>
  121. </response>
  122. </xts:replace>
  123. </xts:sequence>
  124. </xsl:template>
  125. <!-- used to copy the bus header stuff - see "apply-templates" above. -->
  126. <xsl:template match="*">
  127. <xsl:copy>
  128. <xsl:copy-of select="@*"/>
  129. <xsl:apply-templates/>
  130. </xsl:copy>
  131. </xsl:template>
  132. </xsl:stylesheet>
  133. </xts:block>
  134. <xts:block id="appendTracking" mode="interpret" processor="XSLT" type="exec" condition=".[/root/env/param[@name='m_tracking']!='']" mandatory="false" nodelist="env">
  135. <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">
  136. <xsl:output method="xml" version="1.0" encoding="UTF-8"/>
  137. <xsl:template match="/root">
  138. <xts:sequence>
  139. <xts:append select="/root">
  140. <tracking xmlns:bus="http://developer.cognos.com/schemas/bibus/3/">
  141. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap', string(/root/env/param[@name='m_tracking'])), true())" disable-output-escaping="yes"/>
  142. </tracking>
  143. </xts:append>
  144. </xts:sequence>
  145. </xsl:template>
  146. </xsl:stylesheet>
  147. </xts:block>
  148. <xts:block id="appendExecutionParameters" mode="interpret" processor="XSLT" type="exec" condition=".[/root/env/param[@name='executionParameters']!='']" mandatory="false" nodelist="env">
  149. <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">
  150. <xsl:output method="xml" version="1.0" encoding="UTF-8"/>
  151. <xsl:template match="/root">
  152. <xts:sequence>
  153. <xts:append select="/root">
  154. <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">
  155. <xsl:choose>
  156. <xsl:when test="starts-with(/root/env/param[@name='executionParameters'], 'CAF')">
  157. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap', string(/root/env/param[@name='executionParameters'])), true())" disable-output-escaping="yes"/>
  158. </xsl:when>
  159. <xsl:otherwise>
  160. <xsl:value-of select="xtsext:web64decode(string(/root/env/param[@name='executionParameters']), true())" disable-output-escaping="yes"/>
  161. </xsl:otherwise>
  162. </xsl:choose>
  163. </executionParameters>
  164. </xts:append>
  165. </xts:sequence>
  166. </xsl:template>
  167. </xsl:stylesheet>
  168. </xts:block>
  169. <!-- Release metadata conversation -->
  170. <xts:block id="releaseConversation" mode="interpret" processor="XSLT" type="exec" condition=".[/root/env/param[@name = 'qs_releaseConversation'] = 'true']" mandatory="false" nodelist="env, header">
  171. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  172. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt">
  173. <xsl:output method="xml" version="1.0" encoding="UTF-8"/>
  174. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  175. <xsl:template match="/">
  176. <xts:sequence>
  177. <xts:append>
  178. <xts:request asText="true" href="bus://dispatcher" protocol="BUS" soapAction="http://www.ibm.com/xmlns/prod/cognos/reportService/201404/.absolute" responseEnvelope="false" outputHeader="true">
  179. <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:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  180. <SOAP-ENV:Header>
  181. <bus:biBusHeader xsi:type="bus:biBusHeader" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  182. <xsl:if test="/root/env/param[@name='markup_track']!=''">
  183. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap', string(key('env-param','markup_track'))), true())" disable-output-escaping="yes"/>
  184. </xsl:if>
  185. <xsl:if test="key('env-param','ui.routingServerGroup')!=''">
  186. <bus:routing>
  187. <routingServerGroup>
  188. <xsl:value-of select="key('env-param','ui.routingServerGroup')"/>
  189. </routingServerGroup>
  190. </bus:routing>
  191. </xsl:if>
  192. <xsl:apply-templates select="/root/header/*[local-name() = 'biBusHeader']/*[local-name() != 'tracking' and local-name() != 'dispatcherTransportVars']"/>
  193. </bus:biBusHeader>
  194. </SOAP-ENV:Header>
  195. <SOAP-ENV:Body>
  196. <rs:release xmlns:rs="http://developer.cognos.com/schemas/reportService/1">
  197. <bus:conversation xsi:type="bus:asynchRequest" xsi:nil="true"/>
  198. </rs:release>
  199. </SOAP-ENV:Body>
  200. </SOAP-ENV:Envelope>
  201. </xts:request>
  202. </xts:append>
  203. </xts:sequence>
  204. </xsl:template>
  205. <!-- used to copy the bus header stuff - see "apply-templates" above. -->
  206. <xsl:template match="*">
  207. <xsl:copy>
  208. <xsl:copy-of select="@*"/>
  209. <xsl:apply-templates/>
  210. </xsl:copy>
  211. </xsl:template>
  212. </xsl:stylesheet>
  213. </xts:block>
  214. <xts:block id="getContent" mode="interpret" processor="XSLT" type="exec" condition=".[not(/root/env/param[@name = 'metadataTree']) and not(/root/env/param[@name = 'qs_releaseConversation']) and
  215. (/root/response/*/*/*/*/*[local-name() = 'status'] != 'working' or
  216. /root/response/*/*/*/*/*[local-name() = 'status'] != 'stillWorking' or
  217. /root/response/*/*/*/*/*[local-name() = 'status'] != 'complete' or
  218. not(/root/env/param[@name = 'doWait']))]" mandatory="false" dependency="appendTracking appendExecutionParameters getOutput"
  219. nodelist="env,tracking,header,executionParameters"
  220. >
  221. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  222. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt">
  223. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  224. <xsl:output method="xml" version="1.0" encoding="UTF-8"/>
  225. <xsl:variable name="authoringLocale">
  226. <xsl:choose>
  227. <xsl:when test="/root/env/param[@name='el']!=''">
  228. <xsl:value-of select="/root/env/param[@name='el']"/>
  229. </xsl:when>
  230. <xsl:otherwise>
  231. <xsl:value-of select="/root/env/param[@name='cl']"/>
  232. </xsl:otherwise>
  233. </xsl:choose>
  234. </xsl:variable>
  235. <xsl:variable name="getMembers">
  236. <xsl:choose>
  237. <xsl:when test="/root/env/param[@name='memberFolder']='true'">
  238. <xsl:text>true</xsl:text>
  239. </xsl:when>
  240. <xsl:otherwise>
  241. <xsl:text>false</xsl:text>
  242. </xsl:otherwise>
  243. </xsl:choose>
  244. </xsl:variable>
  245. <xsl:template match="/">
  246. <xts:sequence>
  247. <xts:append>
  248. <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">
  249. <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">
  250. <SOAP-ENV:Header>
  251. <bus:biBusHeader xsi:type="bus:biBusHeader" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  252. <xsl:if test="/root/env/param[@name='markup_track']!=''">
  253. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap', string(key('env-param','markup_track'))), true())" disable-output-escaping="yes"/>
  254. </xsl:if>
  255. <!-- We don't want to copy the tracking info in this case because we want a separate conversation for the metadata -->
  256. <!-- For bug 611371. Don't copy the dispatcherTransportVars since these are copied directly from
  257. the browser. This can cause permission problems due to a 'front' = 'true' variable signifying
  258. this as an external request, even though it's internal. -->
  259. <xsl:apply-templates select="/root/header/*[local-name() = 'biBusHeader']/*[local-name() != 'tracking' and local-name() != 'dispatcherTransportVars']"/>
  260. <xsl:if test="key('env-param','ui.routingServerGroup')!=''">
  261. <bus:routing>
  262. <routingServerGroup>
  263. <xsl:value-of select="key('env-param','ui.routingServerGroup')"/>
  264. </routingServerGroup>
  265. </bus:routing>
  266. </xsl:if>
  267. </bus:biBusHeader>
  268. </SOAP-ENV:Header>
  269. <SOAP-ENV:Body>
  270. <runSpecification xmlns="http://developer.cognos.com/schemas/reportService/1">
  271. <bus:specification xsi:type="bus:reportServiceMetadataSpecification" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  272. <xsl:choose>
  273. <xsl:when test="$getMembers='true'">
  274. <bus:value xsi:type="bus:specification">&lt;metadataRequest connection=&quot;<xsl:value-of select="xtsext:xmlencode(string(/root/env/param[@name='model']))"/>&quot;&gt;
  275. &lt;Metadata authoringLocale=&quot;<xsl:value-of select="$authoringLocale"/>&quot; xml:lang=&quot;<xsl:value-of select="/root/env/param[@name='pl']"/>&quot; start_at=&quot;<xsl:value-of select="xtsext:xmlencode(string(/root/env/param[@name='startAtPath']))"/>&quot; Depth=&quot;<xsl:value-of select="/root/env/param[@name='depth']"/>&quot; ResultStart=&quot;0&quot; ResultCount=&quot;51&quot;&gt;
  276. &lt;Properties&gt;
  277. &lt;Property name=&quot;./folder&quot;/&gt;
  278. &lt;Property name=&quot;./dimension&quot;/&gt;
  279. &lt;Property name=&quot;./hierarchy&quot;/&gt;
  280. &lt;Property name=&quot;./hierarchyFolder&quot;/&gt;
  281. &lt;Property name=&quot;./level&quot;/&gt;
  282. &lt;Property name=&quot;./member&quot;/&gt;
  283. &lt;Property name=&quot;./@_RootMembers&quot;/&gt;
  284. &lt;Property name=&quot;*/@name&quot;/&gt;
  285. &lt;Property name=&quot;*/@_path&quot;/&gt;
  286. &lt;Property name=&quot;*/@_ref&quot;/&gt;
  287. &lt;Property name=&quot;*/@memberUniqueName&quot;/&gt;
  288. &lt;Property name=&quot;*/@memberCaption&quot;/&gt;
  289. &lt;Property name=&quot;*/@levelUniqueName&quot;/&gt;
  290. &lt;Property name=&quot;*/@levelNumber&quot;/&gt;
  291. &lt;Property name=&quot;*/@levelLabel&quot;/&gt;
  292. &lt;Property name=&quot;*/@parentUniqueName&quot;/&gt;
  293. &lt;Property name=&quot;*/@currencyCode&quot;/&gt;
  294. &lt;Property name=&quot;*/@_IntrinsicPropertiesOff&quot;/&gt;
  295. &lt;Property name=&quot;*/@parentChild&quot;/&gt;&lt;/Properties&gt;
  296. &lt;/Metadata&gt;
  297. &lt;/metadataRequest&gt;
  298. </bus:value>
  299. </xsl:when>
  300. <xsl:otherwise>
  301. <bus:value xsi:type="bus:specification">&lt;metadataRequest connection=&quot;<xsl:value-of select="xtsext:xmlencode(string(/root/env/param[@name='model']))"/>&quot;&gt;
  302. &lt;Metadata authoringLocale=&quot;<xsl:value-of select="$authoringLocale"/>&quot; xml:lang=&quot;<xsl:value-of select="/root/env/param[@name='pl']"/>&quot; start_at=&quot;<xsl:value-of select="xtsext:xmlencode(string(/root/env/param[@name='startAtPath']))"/>&quot; Depth=&quot;<xsl:value-of select="/root/env/param[@name='depth']"/>&quot; no_collections=&quot;1&quot; _enumLabels=&quot;0&quot; &gt;
  303. &lt;Properties&gt;
  304. &lt;Property name=&quot;*/@name&quot;/&gt;
  305. &lt;Property name=&quot;*/@_path&quot;/&gt;
  306. &lt;Property name=&quot;*/@_ref&quot;/&gt;
  307. &lt;Property name=&quot;*/@isNamespace&quot;/&gt;
  308. &lt;Property name=&quot;*/@screenTip&quot;/&gt;
  309. &lt;Property name=&quot;*/@description&quot;/&gt;
  310. &lt;Property name=&quot;*/@externalOrdinal&quot;/&gt;
  311. &lt;Property name=&quot;./folder&quot;/&gt;
  312. &lt;Property name=&quot;./measureFolder&quot;/&gt;
  313. &lt;Property name=&quot;./querySubject&quot;/&gt;
  314. &lt;Property name=&quot;./queryItem&quot;/&gt;
  315. &lt;Property name=&quot;./queryItemFolder&quot;/&gt;
  316. &lt;Property name=&quot;./filter&quot;/&gt;
  317. &lt;Property name=&quot;./calculation&quot;/&gt;
  318. &lt;Property name=&quot;*/@currency&quot;/&gt;
  319. &lt;Property name=&quot;*/@datatype&quot;/&gt;
  320. &lt;Property name=&quot;*/@usage&quot;/&gt;
  321. &lt;Property name=&quot;*/@regularAggregate&quot;/&gt;
  322. &lt;Property name=&quot;*/@promptType&quot;/&gt;
  323. &lt;Property name=&quot;*/@promptFilterItemRef&quot;/&gt;
  324. &lt;Property name=&quot;*/@promptUseItemRef&quot;/&gt;
  325. &lt;Property name=&quot;*/@promptDisplayItemRef&quot;/&gt;
  326. &lt;Property name=&quot;*/@promptCascadeOnRef&quot;/&gt;
  327. &lt;Property name=&quot;*/@displayType&quot;/&gt;
  328. &lt;Property name=&quot;*/@semiAggregate&quot;/&gt;
  329. &lt;Property name=&quot;*/@sortOnRef&quot;/&gt;
  330. &lt;Property name=&quot;*/@parentChild&quot;/&gt;
  331. &lt;Property name=&quot;*/@calcType&quot;/&gt;
  332. &lt;Property name=&quot;measure/@isHierarchical&quot;/&gt;
  333. &lt;Property name=&quot;dimension/@type&quot;/&gt;
  334. &lt;Property name=&quot;./dimension&quot;/&gt;
  335. &lt;Property name=&quot;./hierarchy&quot;/&gt;
  336. &lt;Property name=&quot;./hierarchyFolder&quot;/&gt;
  337. &lt;Property name=&quot;./level&quot;/&gt;
  338. &lt;Property name=&quot;./measure&quot;/&gt;
  339. &lt;Property name=&quot;*/@_IntrinsicPropertiesOff&quot;/&gt;
  340. &lt;Property name=&quot;measure/aggregateRule&quot;/&gt;
  341. &lt;Property name=&quot;*/@applyAggregate&quot;/&gt;
  342. &lt;Property name=&quot;*/@_effectivePromptInfo&quot;/&gt;
  343. &lt;/Properties&gt;
  344. &lt;/Metadata&gt;
  345. &lt;/metadataRequest&gt;
  346. </bus:value>
  347. </xsl:otherwise>
  348. </xsl:choose>
  349. </bus:specification>
  350. <xsl:choose>
  351. <xsl:when test="key('env-param', 'metadataParameters') != ''">
  352. <bus:parameterValues xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:parameterValue[]" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/">
  353. <xsl:if test="string(/root/env/param[@name='metadataParameters'])!= 'null'">
  354. <xsl:value-of select="/root/env/param[@name='metadataParameters']" disable-output-escaping="yes"/>
  355. </xsl:if>
  356. <xsl:if test="/root/executionParameters != ''">
  357. <xsl:for-each select="/root/executionParameters/bus:parameters/*">
  358. <xsl:copy-of select="."/>
  359. </xsl:for-each>
  360. </xsl:if>
  361. </bus:parameterValues>
  362. </xsl:when>
  363. <xsl:when test="/root/executionParameters != ''">
  364. <bus:parameterValues xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:parameterValue[]" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/">
  365. <xsl:for-each select="/root/executionParameters/bus:parameters/*">
  366. <xsl:copy-of select="."/>
  367. </xsl:for-each>
  368. </bus:parameterValues>
  369. </xsl:when>
  370. <xsl:when test="key('env-param', 'parameterValues') != '' and contains(key('env-param', 'parameterValues'), 'item')">
  371. <xsl:value-of select="string(key('env-param', 'parameterValues'))" disable-output-escaping="yes"/>
  372. </xsl:when>
  373. <xsl:when test="key('env-param', 'promptValues') != ''">
  374. <bus:parameterValues xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:parameterValue[]" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/">
  375. <xsl:for-each select="/root/env/param[@name='promptValues']">
  376. <xsl:value-of select="." disable-output-escaping="yes"/>
  377. </xsl:for-each>
  378. </bus:parameterValues>
  379. </xsl:when>
  380. <xsl:otherwise>
  381. <bus:parameterValues xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:parameterValue[]" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"/>
  382. </xsl:otherwise>
  383. </xsl:choose>
  384. <bus:options xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:option[]" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/">
  385. <item xsi:type="bus:runOptionString">
  386. <bus:name xsi:type="bus:runOptionEnum">promptFormat</bus:name>
  387. <bus:value xsi:type="xsd:string">HTML</bus:value>
  388. </item>
  389. <item xsi:type="bus:runOptionBoolean">
  390. <bus:name xsi:type="bus:runOptionEnum">prompt</bus:name>
  391. <bus:value xsi:type="xsd:boolean">false</bus:value>
  392. </item>
  393. </bus:options>
  394. </runSpecification>
  395. </SOAP-ENV:Body>
  396. </SOAP-ENV:Envelope>
  397. </xts:request>
  398. </xts:append>
  399. </xts:sequence>
  400. </xsl:template>
  401. <!-- used to copy the bus header stuff - see "apply-templates" above. -->
  402. <xsl:template match="*">
  403. <xsl:copy>
  404. <xsl:copy-of select="@*"/>
  405. <xsl:apply-templates/>
  406. </xsl:copy>
  407. </xsl:template>
  408. </xsl:stylesheet>
  409. </xts:block>
  410. <xts:block id="appendDocument" mode="interpret" processor="XSLT" type="exec" dependency="releaseConversation getContent getOutput" mandatory="false">
  411. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  412. <xts:logicsheet path="logicsheets/portal.xsl"/>
  413. <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/">
  414. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  415. <xsl:output method="xml" version="1.0" encoding="UTF-8"/>
  416. <xsl:template match="/root">
  417. <xsl:variable name="markup-track">
  418. <xsl:apply-templates select="/root/output/*/*/*[local-name()='Header']/*[local-name()='biBusHeader']/*[local-name()='tracking']/*[local-name()='conversationContext']" mode="markup"/>
  419. </xsl:variable>
  420. <xts:sequence>
  421. <xts:delete select="/root/env/param[@name='m_tracking']"/>
  422. <xts:append select="/root/env">
  423. <param name="m_tracking">
  424. <xsl:value-of select="string($markup-track)"/>
  425. </param>
  426. </xts:append>
  427. <xsl:choose>
  428. <xsl:when test="key('env-param','metadataTree')">
  429. <xts:append select="/root">
  430. <metadataTree>
  431. <xsl:value-of select="substring-after(string(key('env-param','metadataTree')), '?&gt;')" disable-output-escaping="yes"/>
  432. </metadataTree>
  433. </xts:append>
  434. </xsl:when>
  435. <xsl:when test="./*[local-name() = 'runSpecificationResponse']/bus:result/bus:details/item[@xsi:type='bus:asynchDetailReportStatus']/bus:status = 'prompting'">
  436. <xts:append select="/root/env">
  437. <param name="htmlFragment">
  438. <xsl:value-of select="./*[local-name() = 'runSpecificationResponse']/bus:result/bus:details/item[@xsi:type='bus:asynchDetailReportOutput']/bus:outputPages/item"/>
  439. </param>
  440. </xts:append>
  441. </xsl:when>
  442. <xsl:when test="./response/*/*[local-name()='Body']/*/*/*[local-name()='details']/item[@xsi:type='bus:asynchDetailReportStatus']/bus:status = 'prompting'">
  443. <xts:delete select="/root/env/param[@name='htmlFragment']"/>
  444. <xts:append select="/root/env">
  445. <param name="htmlFragment">
  446. <xsl:value-of select="./response/*/*[local-name()='Body']/*/*/*[local-name()='details']/item[@xsi:type='bus:asynchDetailReportOutput']/bus:outputPages/item"/>
  447. </param>
  448. </xts:append>
  449. </xsl:when>
  450. <xsl:otherwise>
  451. <xts:append select="/root">
  452. <xsl:variable name="metadata">
  453. <xsl:choose>
  454. <xsl:when test="./response/*[local-name() = 'Envelope']/*[local-name() = 'Body']/*[local-name() = 'waitResponse']">
  455. <xsl:choose>
  456. <xsl:when test="contains(./response/*[local-name() = 'Envelope']/*[local-name() = 'Body']/*[local-name() = 'waitResponse']/bus:result/bus:details/item/bus:metadata, '&lt;?xml')">
  457. <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"/>
  458. </xsl:when>
  459. <xsl:otherwise>
  460. <xsl:value-of select="./response/*[local-name() = 'Envelope']/*[local-name() = 'Body']/*[local-name() = 'waitResponse']/bus:result/bus:details/item/bus:metadata" disable-output-escaping="yes"/>
  461. </xsl:otherwise>
  462. </xsl:choose>
  463. </xsl:when>
  464. <xsl:otherwise>
  465. <xsl:choose>
  466. <xsl:when test="contains(./*[local-name() = 'runSpecificationResponse']/bus:result/bus:details/item/bus:metadata, '&lt;?xml')">
  467. <xsl:value-of select="substring-after(./*[local-name() = 'runSpecificationResponse']/bus:result/bus:details/item/bus:metadata, '?&gt;')" disable-output-escaping="yes"/>
  468. </xsl:when>
  469. <xsl:otherwise>
  470. <xsl:value-of select="./*[local-name() = 'runSpecificationResponse']/bus:result/bus:details/item/bus:metadata" disable-output-escaping="yes"/>
  471. </xsl:otherwise>
  472. </xsl:choose>
  473. </xsl:otherwise>
  474. </xsl:choose>
  475. </xsl:variable>
  476. <!-- detect when we are in a wait state. There seems to be a bug where we can get a 'working' state even though we have the metadata info already -->
  477. <xsl:choose>
  478. <xsl:when test="
  479. $metadata='' and
  480. (contains(./*[local-name() = 'runSpecificationResponse']/bus:result/bus:status, 'working') or
  481. contains(./*[local-name() = 'runSpecificationResponse']/bus:result/bus:status, 'stillWorking') or
  482. contains(./response/*[local-name() = 'Envelope']/*[local-name() = 'Body']/*[local-name() = 'waitResponse']/bus:result/bus:status, 'stillWorking'))">
  483. <working>
  484. <xsl:value-of select="string($markup-track)"/>
  485. </working>
  486. </xsl:when>
  487. <!-- We can't just reuse $metadata above cause that's a string. We want the actual XML. So, in typical XTS style, we duplicate code! YAY! -->
  488. <xsl:when test="./response/*[local-name() = 'Envelope']/*[local-name() = 'Body']/*[local-name() = 'waitResponse']">
  489. <metadataTree>
  490. <xsl:choose>
  491. <xsl:when test="contains(./response/*[local-name() = 'Envelope']/*[local-name() = 'Body']/*[local-name() = 'waitResponse']/bus:result/bus:details/item/bus:metadata, '&lt;?xml')">
  492. <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"/>
  493. </xsl:when>
  494. <xsl:otherwise>
  495. <xsl:value-of select="./response/*[local-name() = 'Envelope']/*[local-name() = 'Body']/*[local-name() = 'waitResponse']/bus:result/bus:details/item/bus:metadata" disable-output-escaping="yes"/>
  496. </xsl:otherwise>
  497. </xsl:choose>
  498. </metadataTree>
  499. </xsl:when>
  500. <xsl:otherwise>
  501. <metadataTree>
  502. <xsl:choose>
  503. <xsl:when test="contains(./*[local-name() = 'runSpecificationResponse']/bus:result/bus:details/item/bus:metadata, '&lt;?xml')">
  504. <xsl:value-of select="substring-after(./*[local-name() = 'runSpecificationResponse']/bus:result/bus:details/item/bus:metadata, '?&gt;')" disable-output-escaping="yes"/>
  505. </xsl:when>
  506. <xsl:otherwise>
  507. <xsl:value-of select="./*[local-name() = 'runSpecificationResponse']/bus:result/bus:details/item/bus:metadata" disable-output-escaping="yes"/>
  508. </xsl:otherwise>
  509. </xsl:choose>
  510. </metadataTree>
  511. </xsl:otherwise>
  512. </xsl:choose>
  513. </xts:append>
  514. </xsl:otherwise>
  515. </xsl:choose>
  516. </xts:sequence>
  517. </xsl:template>
  518. <pf:serialize-xml/>
  519. </xsl:stylesheet>
  520. </xts:block>
  521. <xts:block id="addMemberFolder" mode="interpret" processor="XSLT" type="exec" dependency="appendDocument" condition=".[(/root/env/param[@name='showMetaExtensions']='1') and (not(/root/response/*/*/*/*/*[local-name() = 'status'] = 'working' or /root/response/*/*/*/*/*[local-name() = 'status'] = 'stillWorking')) and (/root/metadataTree/ResponseRoot or /root/soapFault)]" mandatory="false"
  522. nodelist="metadataTree, env"
  523. >
  524. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  525. <xsl:template match="/root">
  526. <xts:sequence>
  527. <xts:delete select="/root/*[local-name()='metadataTree']/*[local-name()='ResponseRoot']/*[local-name()='level' or local-name()='hierarchy' or local-name()='hierarchyFolder']"/>
  528. <xts:append select="/root/*[local-name()='metadataTree']/*[local-name()='ResponseRoot']">
  529. <xsl:for-each select="/root/*[local-name()='metadataTree']/*[local-name()='ResponseRoot']/*[local-name()='hierarchy' or local-name()='hierarchyFolder' or local-name()='level']">
  530. <xsl:element name="{name()}">
  531. <xsl:for-each select="@*">
  532. <xsl:attribute name="{name()}">
  533. <xsl:value-of select="."/>
  534. </xsl:attribute>
  535. </xsl:for-each>
  536. <xsl:choose>
  537. <xsl:when test="/root/env/param[@name='memberFolder']='true'">
  538. <xsl:copy-of select="./*[local-name()='member']"/>
  539. </xsl:when>
  540. <xsl:otherwise>
  541. <xsl:element name="folder">
  542. <xsl:attribute name="_path"><xsl:value-of select="./@_path"/></xsl:attribute>
  543. <xsl:attribute name="_ref"><xsl:value-of select="./@_ref"/></xsl:attribute>
  544. <xsl:attribute name="name">Members</xsl:attribute>
  545. <xsl:attribute name="memberFolder">true</xsl:attribute>
  546. </xsl:element>
  547. <xsl:copy-of select="./*"/>
  548. </xsl:otherwise>
  549. </xsl:choose>
  550. </xsl:element>
  551. </xsl:for-each>
  552. </xts:append>
  553. </xts:sequence>
  554. </xsl:template>
  555. </xsl:stylesheet>
  556. </xts:block>
  557. <xts:block id="format" type="exec" mode="output" processor="XSLT" mimeType="application/xml" condition="(not(/root/response/*/*/*/*/*[local-name() = 'status'] = 'working' or /root/response/*/*/*/*/*[local-name() = 'status'] = 'stillWorking')) and (/root/metadataTree/ResponseRoot or /root/soapFault)" dependency="addMemberFolder">
  558. <!-- get the debug logic sheet -->
  559. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  560. <xts:logicsheet path="logicsheets/portal.xsl"/>
  561. <!-- apply the form logic -->
  562. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:dbg="http://developer.cognos.com/schemas/xts/logicsheets/xslt/debug/" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" exclude-result-prefixes="xsl xts dbg xtsext bus pf">
  563. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  564. <pf:variables/>
  565. <!-- start the output -->
  566. <xsl:template match="/root">
  567. <xmlResponse>
  568. <xsl:choose>
  569. <xsl:when test="./metadataTree/ResponseRoot">
  570. <xsl:apply-templates select="./metadataTree/ResponseRoot"/>
  571. </xsl:when>
  572. <xsl:when test="./working">
  573. <xsl:variable name="passport">
  574. <!-- pull the passport out of the bus header -->
  575. <xsl:value-of select="/root/credential/param[@name='CAM']/*[local-name() ='CAM']/*[local-name() = 'CAMPassport']/*[local-name() = 'id']"/>
  576. </xsl:variable>
  577. <xsl:text/>working;<xsl:value-of select="xtsext:javascriptencode(string(/root/env/param[@name='contextNodeRef']))"/>;<xsl:value-of select="xtsext:javascriptencode(string(xtsext:cafaction(concat('sign_wrap_setpassportid_', $passport), xtsext:web64encode(string(./working), true()))))"/>;<xsl:text/>
  578. <xsl:if test="key('env-param', 'depth')!=''">
  579. <xsl:value-of select="xtsext:javascriptencode(string(key('env-param','depth')))"/>
  580. </xsl:if>
  581. </xsl:when>
  582. <xsl:when test="./env/param[@name='htmlFragment']">
  583. <xsl:variable name="markup-conv">
  584. <xsl:choose>
  585. <xsl:when test="./*[local-name() = 'runSpecificationResponse']/bus:result/bus:primaryRequest">
  586. <xsl:call-template name="serialize-xml">
  587. <xsl:with-param name="node-set" select="./*[local-name() = 'runSpecificationResponse']/bus:result/bus:primaryRequest/*"/>
  588. </xsl:call-template>
  589. </xsl:when>
  590. <xsl:otherwise>
  591. <xsl:call-template name="serialize-xml">
  592. <xsl:with-param name="node-set" select="./*[local-name()='response']/*/*[local-name()='Body']/*/bus:result/bus:primaryRequest/*"/>
  593. </xsl:call-template>
  594. </xsl:otherwise>
  595. </xsl:choose>
  596. </xsl:variable>
  597. <xsl:text/>prompting;<xsl:text/>
  598. <xsl:text/><xsl:value-of select="xtsext:javascriptencode(string($gateway))"/>;<xsl:text/>
  599. <xsl:text/><xsl:value-of select="xtsext:javascriptencode(string(/root/env/param[@name='contextNodeRef']))"/>;<xsl:text/>
  600. <xsl:text/><xsl:value-of select="xtsext:javascriptencode(string(xtsext:cafaction(concat('sign_wrap_setpassportid_', $passport), xtsext:web64encode(string($markup-conv), true()))))"/>;<xsl:text/>
  601. <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/>
  602. <xsl:text/><xsl:value-of select="xtsext:javascriptencode(string(/root/env/param[@name='htmlFragment']))"/><xsl:text/>
  603. </xsl:when>
  604. <xsl:otherwise/>
  605. </xsl:choose>
  606. <xsl:apply-templates select="./logonFault"/>
  607. <xsl:apply-templates select="./soapFault"/>
  608. </xmlResponse>
  609. </xsl:template>
  610. <xsl:template match="/root/metadataTree/ResponseRoot">
  611. <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/>
  612. <xsl:text/><xsl:call-template name="commaAndSemicolonEncode">
  613. <xsl:with-param name="strVal">
  614. <xsl:value-of select="/root/env/param[@name='contextNodeRef']"/>
  615. </xsl:with-param>
  616. </xsl:call-template><xsl:text/>
  617. <xsl:text/>;<xsl:call-template name="commaAndSemicolonEncode">
  618. <xsl:with-param name="strVal">
  619. <xsl:value-of select="/root/metadataTree/ResponseRoot/package/@name"/>
  620. </xsl:with-param>
  621. </xsl:call-template><xsl:text/>
  622. <xsl:text/>;<xsl:call-template name="commaAndSemicolonEncode">
  623. <xsl:with-param name="strVal">
  624. <xsl:value-of select="/root/metadataTree/ResponseRoot/package/@screenTip"/>
  625. </xsl:with-param>
  626. </xsl:call-template><xsl:text/>
  627. <xsl:variable name="depth">0</xsl:variable>
  628. <xsl:for-each select="./folder | ./querySubject | ./queryItemFolder | ./dimension | ./hierarchy | ./level | ./member | ./measure | ./measureFolder | ./hierarchyFolder">
  629. <xsl:variable name="parent"><xsl:call-template name="commaAndSemicolonEncode">
  630. <xsl:with-param name="strVal">
  631. <xsl:value-of select="@_path"/>
  632. </xsl:with-param>
  633. </xsl:call-template></xsl:variable>
  634. <xsl:variable name="parentRefExpression">
  635. <xsl:call-template name="commaAndSemicolonEncode">
  636. <xsl:with-param name="strVal">
  637. <xsl:value-of select="@_ref"/>
  638. </xsl:with-param>
  639. </xsl:call-template>
  640. </xsl:variable>
  641. <xsl:choose>
  642. <xsl:when test="name()='dimension' and count(./hierarchy)=1 and count(*)=1 and (not(./hierarchy[@parentChild]) or ./hierarchy[@parentChild!='1'])">
  643. <xsl:choose>
  644. <xsl:when test="/root/env/param[@name='depth']='2'">resubmitSingleHierarchy;<xsl:text/><xsl:call-template name="commaAndSemicolonEncode">
  645. <xsl:with-param name="strVal">
  646. <xsl:value-of select="./hierarchy/@_path"/>
  647. </xsl:with-param>
  648. </xsl:call-template>;<xsl:text/><xsl:call-template name="commaAndSemicolonEncode">
  649. <xsl:with-param name="strVal">
  650. <xsl:value-of select="./hierarchy/@name"/>
  651. </xsl:with-param>
  652. </xsl:call-template>;<xsl:text/><xsl:call-template name="commaAndSemicolonEncode">
  653. <xsl:with-param name="strVal">
  654. <xsl:value-of select="./hierarchy/@_ref"/>
  655. </xsl:with-param>
  656. </xsl:call-template><xsl:text/></xsl:when>
  657. <xsl:otherwise>
  658. <xsl:call-template name="buildTreeItemResponseString">
  659. <xsl:with-param name="node" select="./hierarchy"/>
  660. <xsl:with-param name="parent" select="$parent"/>
  661. <xsl:with-param name="depth" select="$depth"/>
  662. <xsl:with-param name="parentRefExpression" select="$parentRefExpression"/>
  663. </xsl:call-template>
  664. </xsl:otherwise>
  665. </xsl:choose>
  666. </xsl:when>
  667. <xsl:otherwise>
  668. <xsl:call-template name="buildTreeItemResponseString">
  669. <xsl:with-param name="node" select="."/>
  670. <xsl:with-param name="parent" select="$parent"/>
  671. <xsl:with-param name="depth" select="$depth"/>
  672. <xsl:with-param name="parentRefExpression" select="$parentRefExpression"/>
  673. </xsl:call-template>
  674. </xsl:otherwise>
  675. </xsl:choose>
  676. </xsl:for-each>
  677. </xsl:template>
  678. <xsl:template match="/root/logonFault">
  679. <xsl:text/>FAULT;timeout<xsl:text/>
  680. </xsl:template>
  681. <xsl:template match="/root/soapFault">
  682. <xsl:text/>FAULT<xsl:text/>
  683. <xsl:choose>
  684. <xsl:when test=".//bus:message">
  685. <xsl:for-each select=".//bus:message">
  686. <xsl:text/>;<xsl:call-template name="commaAndSemicolonEncode">
  687. <xsl:with-param name="strVal">
  688. <xsl:value-of select="./*[local-name() = 'messageString']"/>
  689. </xsl:with-param>
  690. </xsl:call-template><xsl:text/>
  691. </xsl:for-each>
  692. </xsl:when>
  693. <xsl:otherwise>
  694. <xsl:variable name="markup">
  695. <xsl:text/><xsl:call-template name="commaAndSemicolonEncode">
  696. <xsl:with-param name="strVal">
  697. <xsl:call-template name="serialize-xml">
  698. <xsl:with-param name="node-set" select="."/>
  699. </xsl:call-template>
  700. </xsl:with-param>
  701. </xsl:call-template><xsl:text/>
  702. </xsl:variable>
  703. <xsl:text/>;<xsl:value-of select="$markup"/><xsl:text/>
  704. </xsl:otherwise>
  705. </xsl:choose>
  706. </xsl:template>
  707. <xsl:template name="commaAndSemicolonEncode">
  708. <xsl:param name="strVal"/>
  709. <xsl:choose>
  710. <xsl:when test="contains($strVal, ',')">
  711. <xsl:call-template name="commaAndSemicolonEncode">
  712. <xsl:with-param name="strVal" select="substring-before($strVal, ',')"/>
  713. </xsl:call-template>&amp;comma<xsl:call-template name="commaAndSemicolonEncode">
  714. <xsl:with-param name="strVal" select="substring-after($strVal, ',')"/>
  715. </xsl:call-template>
  716. </xsl:when>
  717. <xsl:when test="contains($strVal, ';')">
  718. <xsl:call-template name="commaAndSemicolonEncode">
  719. <xsl:with-param name="strVal" select="substring-before($strVal, ';')"/>
  720. </xsl:call-template>&amp;semicolon<xsl:call-template name="commaAndSemicolonEncode">
  721. <xsl:with-param name="strVal" select="substring-after($strVal, ';')"/>
  722. </xsl:call-template>
  723. </xsl:when>
  724. <xsl:otherwise>
  725. <xsl:value-of select="xtsext:javascriptencode(string($strVal))"/>
  726. </xsl:otherwise>
  727. </xsl:choose>
  728. </xsl:template>
  729. <xsl:template name="buildTreeItemResponseString">
  730. <xsl:param name="node"/>
  731. <xsl:param name="parent"/>
  732. <xsl:param name="depth"/>
  733. <xsl:param name="parentRefExpression"/>
  734. <xsl:for-each select="$node/*">
  735. <xsl:variable name="path">
  736. <xsl:if test="name()='member'">children(</xsl:if>
  737. <xsl:value-of select="@_path"/>
  738. <xsl:if test="name()='member'">)</xsl:if>
  739. </xsl:variable>
  740. <xsl:variable name="ref">
  741. <xsl:if test="name()='member'">children(</xsl:if>
  742. <xsl:value-of select="@_ref"/>
  743. <xsl:if test="name()='member'">)</xsl:if>
  744. </xsl:variable>
  745. <xsl:text/>;<xsl:text/>
  746. <xsl:if test="position()=1">
  747. <xsl:text/>firstChild<xsl:text/>
  748. </xsl:if>
  749. <xsl:if test="position()=last()">
  750. <xsl:text/>lastChild<xsl:text/>
  751. </xsl:if>
  752. <xsl:if test="not((position()=1) or (position()=last()))">
  753. <xsl:text/>child<xsl:text/>
  754. </xsl:if>
  755. <xsl:text/><xsl:value-of select="xtsext:javascriptencode(string($depth))"/>,<xsl:text/>
  756. <xsl:choose>
  757. <xsl:when test="@isNamespace='1' and name()='folder'">
  758. <xsl:text/><xsl:call-template name="commaAndSemicolonEncode">
  759. <xsl:with-param name="strVal">namespace</xsl:with-param>
  760. </xsl:call-template><xsl:text/>
  761. </xsl:when>
  762. <xsl:when test="@isHierarchical='1'">
  763. <xsl:text/><xsl:call-template name="commaAndSemicolonEncode">
  764. <xsl:with-param name="strVal">rollupMeasure</xsl:with-param>
  765. </xsl:call-template><xsl:text/>
  766. </xsl:when>
  767. <xsl:when test="@type='3' or @type='measure'">
  768. <xsl:text/><xsl:call-template name="commaAndSemicolonEncode">
  769. <xsl:with-param name="strVal">measureDimension</xsl:with-param>
  770. </xsl:call-template><xsl:text/>
  771. </xsl:when>
  772. <xsl:when test="@calcType='1'">
  773. <xsl:text/><xsl:call-template name="commaAndSemicolonEncode">
  774. <xsl:with-param name="strVal">namedSet</xsl:with-param>
  775. </xsl:call-template><xsl:text/>
  776. </xsl:when>
  777. <xsl:when test="@calcType='2'">
  778. <xsl:text/><xsl:call-template name="commaAndSemicolonEncode">
  779. <xsl:with-param name="strVal">calculationConstant</xsl:with-param>
  780. </xsl:call-template><xsl:text/>
  781. </xsl:when>
  782. <xsl:otherwise>
  783. <xsl:text/><xsl:call-template name="commaAndSemicolonEncode">
  784. <xsl:with-param name="strVal">
  785. <xsl:value-of select="name()"/>
  786. </xsl:with-param>
  787. </xsl:call-template><xsl:text/>
  788. </xsl:otherwise>
  789. </xsl:choose>
  790. <xsl:text/>,<xsl:call-template name="commaAndSemicolonEncode">
  791. <xsl:with-param name="strVal">
  792. <xsl:choose>
  793. <xsl:when test="name()='member'">
  794. <xsl:value-of select="@memberCaption"/>
  795. </xsl:when>
  796. <xsl:otherwise>
  797. <xsl:value-of select="@name"/>
  798. </xsl:otherwise>
  799. </xsl:choose>
  800. </xsl:with-param>
  801. </xsl:call-template><xsl:text/>
  802. <xsl:text/>,<xsl:call-template name="commaAndSemicolonEncode">
  803. <xsl:with-param name="strVal">
  804. <xsl:value-of select="@screenTip"/>
  805. </xsl:with-param>
  806. </xsl:call-template><xsl:text/>
  807. <xsl:text/>,<xsl:call-template name="commaAndSemicolonEncode">
  808. <xsl:with-param name="strVal">
  809. <xsl:value-of select="@_path"/>
  810. </xsl:with-param>
  811. </xsl:call-template><xsl:text/>
  812. <xsl:text/>,<xsl:call-template name="commaAndSemicolonEncode">
  813. <xsl:with-param name="strVal">
  814. <xsl:value-of select="$ref"/>
  815. </xsl:with-param>
  816. </xsl:call-template><xsl:text/>
  817. <xsl:if test="not(name()='folder' or name()='querySubject' or name()='queryItemFolder' or name()='filter' or name()='dimension' or name()='hierarchy' or name()='hierarchyFolder')">
  818. <xsl:call-template name="buildQueryItemResponseString">
  819. <xsl:with-param name="node" select="."/>
  820. </xsl:call-template>
  821. </xsl:if>
  822. <xsl:text/>,<xsl:value-of select="xtsext:javascriptencode(string($parent))"/><xsl:text/>
  823. <xsl:text/>,<xsl:value-of select="xtsext:javascriptencode(string($parentRefExpression))"/><xsl:text/>
  824. <xsl:text/>,<xsl:call-template name="commaAndSemicolonEncode">
  825. <xsl:with-param name="strVal">
  826. <xsl:value-of select="@description"/>
  827. </xsl:with-param>
  828. </xsl:call-template><xsl:text/>
  829. <xsl:if test="(name()='hierarchy' or name()='hierarchyFolder') and @parentChild='1'">
  830. <xsl:text/>,parentChild<xsl:text/>
  831. </xsl:if>
  832. <xsl:if test="/root/env/param[@name='processRecursion']='1'">
  833. <xsl:choose>
  834. <xsl:when test="name()='dimension' and count(./hierarchy)=1 and (not(./hierarchy[@parentChild]) or ./hierarchy[@parentChild!='1'])">
  835. <xsl:call-template name="buildTreeItemResponseString">
  836. <xsl:with-param name="node" select="./hierarchy"/>
  837. <xsl:with-param name="parent" select="$node"/>
  838. <xsl:with-param name="depth" select="$depth + 1"/>
  839. <xsl:with-param name="parentRefExpression" select="$parentRefExpression"/>
  840. </xsl:call-template>
  841. </xsl:when>
  842. <xsl:otherwise>
  843. <xsl:call-template name="buildTreeItemResponseString">
  844. <xsl:with-param name="node" select="."/>
  845. <xsl:with-param name="parent" select="$node"/>
  846. <xsl:with-param name="depth" select="$depth + 1"/>
  847. <xsl:with-param name="parentRefExpression" select="$parentRefExpression"/>
  848. </xsl:call-template>
  849. </xsl:otherwise>
  850. </xsl:choose>
  851. </xsl:if>
  852. </xsl:for-each>
  853. </xsl:template>
  854. <xsl:template name="buildQueryItemResponseString">
  855. <xsl:param name="node"/>
  856. <xsl:text/>,<xsl:call-template name="commaAndSemicolonEncode">
  857. <xsl:with-param name="strVal">
  858. <xsl:value-of select="$node/@datatype"/>
  859. </xsl:with-param>
  860. </xsl:call-template><xsl:text/>
  861. <xsl:text/>,<xsl:call-template name="commaAndSemicolonEncode">
  862. <xsl:with-param name="strVal">
  863. <xsl:value-of select="$node/@usage"/>
  864. </xsl:with-param>
  865. </xsl:call-template><xsl:text/>
  866. <xsl:text/>,<xsl:call-template name="commaAndSemicolonEncode">
  867. <xsl:with-param name="strVal">
  868. <xsl:value-of select="$node/@regularAggregate"/>
  869. </xsl:with-param>
  870. </xsl:call-template><xsl:text/>
  871. <xsl:text/>,<xsl:call-template name="commaAndSemicolonEncode">
  872. <xsl:with-param name="strVal">
  873. <xsl:choose>
  874. <!--
  875. Bug 540435
  876. Use the first aggregateRule applyAggregate attribute (defined in WO939)
  877. instead of using the deprecated semiAggregate attribute
  878. -->
  879. <xsl:when test="$node/aggregateRule/@applyAggregate"><xsl:value-of select="$node/aggregateRule/@applyAggregate"/></xsl:when>
  880. <xsl:otherwise><xsl:value-of select="$node/@semiAggregate"/></xsl:otherwise>
  881. </xsl:choose>
  882. </xsl:with-param>
  883. </xsl:call-template><xsl:text/>
  884. <xsl:text/>,<xsl:call-template name="commaAndSemicolonEncode">
  885. <xsl:with-param name="strVal">
  886. <xsl:value-of select="$node/@promptType"/>
  887. </xsl:with-param>
  888. </xsl:call-template><xsl:text/>
  889. <xsl:text/>,<xsl:call-template name="commaAndSemicolonEncode">
  890. <xsl:with-param name="strVal">
  891. <xsl:value-of select="$node/@displayType"/>
  892. </xsl:with-param>
  893. </xsl:call-template><xsl:text/>
  894. <xsl:text/>,<xsl:call-template name="commaAndSemicolonEncode">
  895. <xsl:with-param name="strVal">
  896. <xsl:value-of select="$node/@sortOnRef"/>
  897. </xsl:with-param>
  898. </xsl:call-template><xsl:text/>
  899. <xsl:text/>,<xsl:call-template name="commaAndSemicolonEncode">
  900. <xsl:with-param name="strVal">
  901. <xsl:value-of select="$node/@promptCascadeOnRef"/>
  902. </xsl:with-param>
  903. </xsl:call-template><xsl:text/>
  904. <xsl:text/>,<xsl:call-template name="commaAndSemicolonEncode">
  905. <xsl:with-param name="strVal">
  906. <xsl:value-of select="$node/@promptFilterItemRef"/>
  907. </xsl:with-param>
  908. </xsl:call-template><xsl:text/>
  909. <xsl:text/>,<xsl:call-template name="commaAndSemicolonEncode">
  910. <xsl:with-param name="strVal">
  911. <xsl:choose>
  912. <xsl:when test="name($node)='member'">
  913. <xsl:value-of select="$node/@levelNumber"/>
  914. </xsl:when>
  915. <xsl:otherwise>
  916. <xsl:value-of select="position()-1"/>
  917. </xsl:otherwise>
  918. </xsl:choose>
  919. </xsl:with-param>
  920. </xsl:call-template><xsl:text/>
  921. <xsl:text/>,<xsl:call-template name="commaAndSemicolonEncode">
  922. <xsl:with-param name="strVal">
  923. <xsl:value-of select="$node/@currency"/>
  924. </xsl:with-param>
  925. </xsl:call-template><xsl:text/>
  926. <xsl:text/>,<xsl:call-template name="commaAndSemicolonEncode">
  927. <xsl:with-param name="strVal">
  928. <xsl:value-of select="$node/@promptUseItemRef"/>
  929. </xsl:with-param>
  930. </xsl:call-template><xsl:text/>
  931. <xsl:text/>,<xsl:call-template name="commaAndSemicolonEncode">
  932. <xsl:with-param name="strVal">
  933. <xsl:value-of select="$node/@promptDisplayItemRef"/>
  934. </xsl:with-param>
  935. </xsl:call-template><xsl:text/>
  936. </xsl:template>
  937. <pf:serialize-xml/>
  938. </xsl:stylesheet>
  939. </xts:block>
  940. <xts:block id="faultHandler" path="qs/logicsheets/faultHandlerMetadata.xsl" type="fault" processor="XSLT"/>
  941. </xts:morphlet>