remote.xts 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: cpscrn
  5. (C) Copyright IBM Corp. 2005, 2013
  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. <!-- $Header: //cpscrn/main/templates/cps4/portnavlets/sdk/portlet-impl/remote/remote.xts#1 $ -->
  13. <!-- $DateTime: 2008/10/22 11:12:04 $ -->
  14. <!-- $Change: 25109 $ -->
  15. <xts:morphlet version="1.0" xmlns:xts="http://developer.cognos.com/schemas/xts/">
  16. <xts:block id="request" mode="interpret" processor="XSLT" type="exec">
  17. <xts:logicsheet path="/cps4/producer/logicsheets/cps-portlet.xslt"/>
  18. <xts:logicsheet path="/cps4/producer/logicsheets/cps-ui.xslt"/>
  19. <xts:logicsheet path="/cps4/common/logicsheets/soaplogic.xslt"/>
  20. <xsl:stylesheet version="1.0" xmlns:portlet="http://developer.cognos.com/schemas/cps/logic/portlet/1/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:wsrp="urn:oasis:names:tc:wsrp:v1:types" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://developer.cognos.com/schemas/cps/logic/soap">
  21. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  22. <xsl:template match="/">
  23. <xts:sequence>
  24. <xts:append select="/root">
  25. <temp-response/>
  26. </xts:append>
  27. <xts:append select="/root/temp-response">
  28. <portlet:portlet handle="sdk">
  29. <portlet:if-mode name="wsrp:view|wsrp:preview">
  30. <portlet:response>
  31. <portlet:content>
  32. <portlet:markup-context useCachedMarkup="'false'" mimeType="'text/html'" requiresUrlRewriting="'true'">
  33. <portlet:if-window-state name="wsrp:minimized">
  34. <portlet:markup-string/>
  35. </portlet:if-window-state>
  36. <portlet:if-window-state name="wsrp:normal|wsrp:maximized|wsrp:solo">
  37. <portlet:property name="url" select="'url'"/>
  38. <xsl:variable name="url-markers">
  39. <xsl:choose>
  40. <xsl:when test="contains($url, '[$') and contains($url, '$]')">
  41. <xsl:variable name="token" select="substring-before(substring-after($url, '[$'), '$]')"/>
  42. <xsl:variable name="beforeToken" select="substring-before($url, '[$')"/>
  43. <xsl:variable name="afterToken" select="substring-after($url, '$]')"/>
  44. <xsl:variable name="atest" select="concat('sdk_', $token)"/>
  45. <portlet:property name="token-value" select="$atest"/>
  46. <xsl:value-of select="concat(concat($beforeToken, $token-value), $afterToken)"/>
  47. </xsl:when>
  48. <xsl:otherwise>
  49. <xsl:value-of select="$url"/>
  50. </xsl:otherwise>
  51. </xsl:choose>
  52. </xsl:variable>
  53. <portlet:property name="cognos-product" select="'sdk'"/>
  54. <xsl:variable name="remote-url">
  55. <xsl:if test="$url-markers != '' and not(starts-with($url-markers, 'http://') or starts-with($url-markers, 'https://'))">
  56. <xsl:call-template name="get-host">
  57. <xsl:with-param name="url" select="$cognos-product"/>
  58. </xsl:call-template>
  59. </xsl:if>
  60. <xsl:value-of select="$url-markers"/>
  61. </xsl:variable>
  62. <xsl:variable name="consumer-escape" select="$portlet-registration-params[@name = 'consumerEscape']"/>
  63. <xsl:if test="$remote-url and not($remote-url = '')">
  64. <portlet:property name="is-web" select="'isWeb'"/>
  65. <portlet:property name="features" select="'features'"/>
  66. <portlet:property name="rewrite-functions" select="'rewriteFunctions'"/>
  67. <xsl:choose>
  68. <xsl:when test="$is-web = 'true'">
  69. <!--
  70. If we have a web application, make sure we do a CM call to make sure that the
  71. passport is valid.
  72. -->
  73. <xts:discard>
  74. <soap:request provider="cm">
  75. <bus:query xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  76. <search>~</search>
  77. <properties xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:propEnum[1]">
  78. <item xsi:type="bus:propEnum">storeID</item>
  79. </properties>
  80. <options xsi:type="bus:queryOptions">
  81. <schemaInfo xsi:type="xsd:boolean">false</schemaInfo>
  82. </options>
  83. </bus:query>
  84. </soap:request>
  85. </xts:discard>
  86. <portlet:property name="scope" select="'scope'"/>
  87. <portlet:markup-string>
  88. <xsl:variable name="userprefquery">
  89. <xsl:for-each select="$portlet-user-preferences/item">
  90. <xsl:value-of select="xtsext:urlencode(string(name))"/>
  91. <xsl:text>=</xsl:text>
  92. <xsl:value-of select="xtsext:urlencode(string(value))"/>
  93. <xsl:if test="position() != last()">
  94. <xsl:text>&amp;</xsl:text>
  95. </xsl:if>
  96. </xsl:for-each>
  97. </xsl:variable>
  98. <xsl:variable name="portletsettingsquery">
  99. <xsl:for-each select="$portlet-state-params">
  100. <xsl:value-of select="xtsext:urlencode(string(@name))"/>
  101. <xsl:text>=</xsl:text>
  102. <xsl:value-of select="xtsext:urlencode(string(.))"/>
  103. <xsl:if test="position() != last()">
  104. <xsl:text>&amp;</xsl:text>
  105. </xsl:if>
  106. </xsl:for-each>
  107. </xsl:variable>
  108. <xsl:variable name="campassportcookie">
  109. <xsl:for-each select="/root/cookies/cookie[@name='cam_passport']">
  110. <xsl:value-of select="xtsext:javascriptencode(string(.))"/>
  111. </xsl:for-each>
  112. </xsl:variable>
  113. <xsl:variable name="navstatequery">
  114. <xsl:for-each select="$portlet-op/wsrp:markupParams/wsrp:navigationalState/param">
  115. <xsl:value-of select="xtsext:urlencode(string(@name))"/>
  116. <xsl:text>=</xsl:text>
  117. <xsl:value-of select="xtsext:urlencode(string(.))"/>
  118. <xsl:if test="position() != last()">
  119. <xsl:text>&amp;</xsl:text>
  120. </xsl:if>
  121. </xsl:for-each>
  122. </xsl:variable>
  123. <xts:transform name="CPSWEB"
  124. scope="{$scope}"
  125. namespacePrefix="{$portlet-op/wsrp:runtimeContext/wsrp:namespacePrefix}"
  126. webcontent="{$ui-webcontent}"
  127. gateway="{$ui-gateway}"
  128. remoteUrl = "{$remote-url}"
  129. userPreferencesQuery = "{$userprefquery}"
  130. applicationSettingsQuery = "{$portletsettingsquery}"
  131. navigationStateQuery = "{$navstatequery}"
  132. cssMappingQuery = ""
  133. messagefile = ""
  134. camPassport = "{$campassportcookie}"
  135. features = "{$features}"
  136. portalAgent = "{$portlet-op/wsrp:markupParams/wsrp:extensions/*[local-name()='portalContext']/*[local-name()='portalAgent']}"
  137. rewriteFunctions="{$rewrite-functions}">
  138. <xts:request protocol="GET" target="{ $remote-url }" faultBlock="requestFault" protocolHeader="true" protocolHeaderSelect="/root/temp-response">
  139. <xts:param name="internalRequest">true</xts:param>
  140. <xsl:if test="$portlet-markups/wsrp:locales">
  141. <xts:param name="header">
  142. <xsl:text>Accept-Language=</xsl:text>
  143. <xsl:value-of select="$portlet-markups/wsrp:locales[1]"/>
  144. </xts:param>
  145. </xsl:if>
  146. <xts:param name="header">
  147. <xsl:text>Cookie=</xsl:text>
  148. <xsl:for-each select="/root/cookies/cookie[not(@name='JSESSIONID')]">
  149. <xsl:value-of select="@name"/>=<xsl:value-of select="."/>
  150. <xsl:if test="position() != last()">
  151. <xsl:text>; </xsl:text>
  152. </xsl:if>
  153. </xsl:for-each>
  154. </xts:param>
  155. </xts:request>
  156. </xts:transform>
  157. <xsl:if test="$portlet-mode = 'wsrp:preview'">
  158. <portlet:markup-preview/>
  159. </xsl:if>
  160. </portlet:markup-string>
  161. </xsl:when>
  162. <xsl:otherwise>
  163. <xsl:variable name="cps_jsessionid" select="$portlet-navigational-params[@name = 'cps_jsessionid']"/>
  164. <xsl:variable name="jsessionid">
  165. <xsl:if test="$cps_jsessionid">
  166. <xsl:text>;jsessionid=</xsl:text>
  167. <xsl:value-of select="$cps_jsessionid"/>
  168. </xsl:if>
  169. </xsl:variable>
  170. <xsl:variable name="full-url">
  171. <xsl:choose>
  172. <xsl:when test="contains($remote-url, '?')">
  173. <xsl:value-of select="substring-before($remote-url, '?')"/>
  174. <xsl:value-of select="$jsessionid"/>
  175. <xsl:text>?</xsl:text>
  176. <xsl:value-of select="substring-after($remote-url, '?')"/>
  177. <xsl:text>&amp;</xsl:text>
  178. </xsl:when>
  179. <xsl:otherwise>
  180. <xsl:value-of select="$remote-url"/>
  181. <xsl:value-of select="$jsessionid"/>
  182. <xsl:text>?</xsl:text>
  183. </xsl:otherwise>
  184. </xsl:choose>
  185. <xsl:for-each select="$portlet-navigational-params[not(starts-with(@name, 'edit_') or starts-with(@name, 'p_') or starts-with(@name, 'tmp_') or starts-with(@name, 'stack_'))]">
  186. <xsl:value-of select="@name"/>
  187. <xsl:text>=</xsl:text>
  188. <xsl:value-of select="xtsext:urlencode(string(.))"/>
  189. <xsl:text>&amp;</xsl:text>
  190. </xsl:for-each>
  191. <xsl:for-each select="$portlet-state-params[starts-with( @name, 'sdk_' )]">
  192. <xsl:variable name="param-name" select="substring-after( @name, 'sdk_' )"/>
  193. <!--
  194. navigationalState overrides portletState sdk variables
  195. -->
  196. <xsl:if test="not($portlet-navigational-params[string(@name) = string($param-name)])">
  197. <xsl:value-of select="$param-name"/>
  198. <xsl:text>=</xsl:text>
  199. <xsl:value-of select="xtsext:urlencode(string(.))"/>
  200. <xsl:text>&amp;</xsl:text>
  201. </xsl:if>
  202. </xsl:for-each>
  203. <xsl:text>cognos_product=</xsl:text>
  204. <xsl:value-of select="$cognos-product"/>
  205. <xsl:text>&amp;namespacePrefix=</xsl:text>
  206. <xsl:value-of select="$portlet-op/wsrp:runtimeContext/wsrp:namespacePrefix"/>
  207. <xsl:if test="$consumer-escape != ''">
  208. <xsl:text>&amp;consumerEscape=</xsl:text>
  209. <xsl:value-of select="$consumer-escape"/>
  210. </xsl:if>
  211. </xsl:variable>
  212. <xsl:if test="$full-url != ''">
  213. <portlet:markup-string>
  214. <xts:request protocol="POST" target="{ $full-url }" faultBlock="requestFault" protocolHeader="true" protocolHeaderSelect="/root/temp-response">
  215. <xts:param name="internalRequest">true</xts:param>
  216. <xsl:if test="$portlet-markups/wsrp:locales">
  217. <xts:param name="header">
  218. <xsl:text>Accept-Language=</xsl:text>
  219. <xsl:value-of select="$portlet-markups/wsrp:locales[1]"/>
  220. </xts:param>
  221. </xsl:if>
  222. <xts:param name="header">
  223. <xsl:text>Cookie=</xsl:text>
  224. <xsl:for-each select="/root/cookies/cookie[not(@name='JSESSIONID')]">
  225. <xsl:value-of select="@name"/>=<xsl:value-of select="."/>
  226. <xsl:if test="position() != last()">
  227. <xsl:text>; </xsl:text>
  228. </xsl:if>
  229. </xsl:for-each>
  230. </xts:param>
  231. </xts:request>
  232. <xsl:if test="$portlet-mode = 'wsrp:preview'">
  233. <portlet:markup-preview/>
  234. </xsl:if>
  235. </portlet:markup-string>
  236. </xsl:if>
  237. </xsl:otherwise>
  238. </xsl:choose>
  239. </xsl:if>
  240. <xsl:if test="string($remote-url) = ''">
  241. <portlet:markup-transform name="XSLT" src="'/cps4/producer/wsrp-impl/transforms/display-nocontent.xslt'">
  242. <portlet:logicsheet>/cps4/producer/logicsheets/cps-ui.xslt</portlet:logicsheet>
  243. <portlet:messageBase>/cps4/producer/messages/cpsproducermsgs.xml</portlet:messageBase>
  244. <portlet:source/>
  245. </portlet:markup-transform>
  246. </xsl:if>
  247. </portlet:if-window-state>
  248. </portlet:markup-context>
  249. </portlet:content>
  250. </portlet:response>
  251. </portlet:if-mode>
  252. <portlet:if-mode name="wsrp:edit|cps:config">
  253. <portlet:response>
  254. <portlet:content>
  255. <portlet:markup-context mimeType="'text/html'" requiresUrlRewriting="'true'">
  256. <xsl:variable name="is-listapps" select="contains( $portlet-navigational-params[@name = 'edit_mode'], 'listapps' )"/>
  257. <xsl:variable name="is-about" select="contains( $portlet-navigational-params[@name = 'edit_mode'], 'about' )"/>
  258. <xsl:variable name="xslt-src">
  259. <xsl:choose>
  260. <xsl:when test="$is-about">
  261. <xsl:text>/cps4/producer/wsrp-impl/transforms/display-about.xslt</xsl:text>
  262. </xsl:when>
  263. <xsl:when test="$is-listapps">
  264. <xsl:text>/cps4/portlets/sdk/portlet-impl/remote/listapps.xslt</xsl:text>
  265. </xsl:when>
  266. <xsl:otherwise>
  267. <xsl:text>/cps4/portlets/sdk/portlet-impl/remote/edit.xslt</xsl:text>
  268. </xsl:otherwise>
  269. </xsl:choose>
  270. </xsl:variable>
  271. <portlet:markup-transform name="XSLT" src="$xslt-src">
  272. <portlet:logicsheet>/cps4/producer/logicsheets/cps-ui.xslt</portlet:logicsheet>
  273. <portlet:logicsheet>/cps4/producer/logicsheets/cps-formlogic.xslt</portlet:logicsheet>
  274. <portlet:messageBase>/cps4/producer/messages/cpsproducermsgs.xml</portlet:messageBase>
  275. <portlet:messageBase>/cps4/portlets/sdk/messages/cpssdkmsgs.xml</portlet:messageBase>
  276. <portlet:source>
  277. <portlet:property name="applications" select="'applications'"/>
  278. <xsl:choose>
  279. <xsl:when test="$is-about">
  280. <portlet:get-version/>
  281. </xsl:when>
  282. <xsl:when test="$is-listapps">
  283. <xsl:call-template name="get-content">
  284. <xsl:with-param name="apps" select="$applications"/>
  285. </xsl:call-template>
  286. </xsl:when>
  287. <xsl:otherwise>
  288. <xsl:variable name="alias">
  289. <xsl:choose>
  290. <xsl:when test="$portlet-navigational-params[@name = 'p_alias'] != ''">
  291. <xsl:value-of select="$portlet-navigational-params[@name = 'p_alias']"/>
  292. </xsl:when>
  293. <xsl:otherwise>
  294. <xsl:value-of select="$portlet-state-params[@name = 'alias']"/>
  295. </xsl:otherwise>
  296. </xsl:choose>
  297. </xsl:variable>
  298. <xsl:if test="$alias != ''">
  299. <xsl:call-template name="get-app">
  300. <xsl:with-param name="apps" select="$applications"/>
  301. <xsl:with-param name="alias" select="$alias"/>
  302. </xsl:call-template>
  303. </xsl:if>
  304. </xsl:otherwise>
  305. </xsl:choose>
  306. <xsl:variable name="nav-titles" select="$portlet-navigational-params[starts-with( @name, 'p_title_' ) and .!='']"/>
  307. <xsl:variable name="state-titles" select="$portlet-state-params[starts-with( @name, 'title_' ) and .!='']"/>
  308. <portlet:title-locale selectState1="$nav-titles" selectState2="$state-titles"/>
  309. </portlet:source>
  310. </portlet:markup-transform>
  311. </portlet:markup-context>
  312. </portlet:content>
  313. </portlet:response>
  314. </portlet:if-mode>
  315. <portlet:if-mode name="wsrp:help">
  316. <portlet:response>
  317. <portlet:content>
  318. <portlet:markup-context mimeType="'text/html'" requiresUrlRewriting="'false'">
  319. <portlet:markup-help/>
  320. </portlet:markup-context>
  321. </portlet:content>
  322. </portlet:response>
  323. </portlet:if-mode>
  324. </portlet:portlet>
  325. </xts:append>
  326. </xts:sequence>
  327. </xsl:template>
  328. <xsl:template name="get-content">
  329. <xsl:param name="apps"/>
  330. <xts:transform name="XSLT" src="/cps4/portlets/sdk/portlet-impl/transforms/app2cps.xslt">
  331. <root>
  332. <summaryOnly>true</summaryOnly>
  333. <xsl:call-template name="get-request">
  334. <xsl:with-param name="apps" select="$apps"/>
  335. </xsl:call-template>
  336. </root>
  337. </xts:transform>
  338. </xsl:template>
  339. <xsl:template name="get-request">
  340. <xsl:param name="apps"/>
  341. <xsl:choose>
  342. <xsl:when test="starts-with($apps,'http://') or starts-with($apps,'https://')">
  343. <xts:request protocol="GET" target="{ $apps }" faultBlock="applicationsFileFault">
  344. <xts:param name="internalRequest">true</xts:param>
  345. </xts:request>
  346. </xsl:when>
  347. <xsl:otherwise>
  348. <xts:request protocol="FILEREAD" target="{$apps}"/>
  349. </xsl:otherwise>
  350. </xsl:choose>
  351. </xsl:template>
  352. <xsl:template name="get-app">
  353. <xsl:param name="apps"/>
  354. <xsl:param name="alias"/>
  355. <xts:transform name="XSLT" src="/cps4/portlets/sdk/portlet-impl/transforms/app2cps.xslt">
  356. <root>
  357. <applicationName>
  358. <xsl:value-of select="string( $alias)"/>
  359. </applicationName>
  360. <xsl:call-template name="get-request">
  361. <xsl:with-param name="apps" select="$apps"/>
  362. </xsl:call-template>
  363. </root>
  364. </xts:transform>
  365. </xsl:template>
  366. <xsl:template name="get-host">
  367. <xsl:param name="url"/>
  368. <xsl:choose>
  369. <xsl:when test="$url != ''">
  370. <xsl:variable name="protocol" select="substring-before($url, '://')"/>
  371. <xsl:variable name="host" select="substring-before(substring-after($url, '://'), '/')"/>
  372. <xsl:value-of select="concat($protocol, '://')"/>
  373. <xsl:value-of select="$host"/>
  374. </xsl:when>
  375. <xsl:otherwise>
  376. <xsl:value-of select="'http://'"/>
  377. <xsl:value-of select="/root/serverInfo/param[@name = 'HTTP_HOST']"/>
  378. </xsl:otherwise>
  379. </xsl:choose>
  380. </xsl:template>
  381. </xsl:stylesheet>
  382. </xts:block>
  383. <xts:block dependency="request" id="response" mode="interpret" processor="XSLT" type="exec">
  384. <xts:logicsheet path="/cps4/producer/logicsheets/cps-portlet.xslt"/>
  385. <xsl:stylesheet version="1.0" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:portlet="http://developer.cognos.com/schemas/cps/logic/portlet/1/" xmlns:wsrp="urn:oasis:names:tc:wsrp:v1:types" xmlns:xos="http://developer.cognos.com/schemas/xts/output/" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt">
  386. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  387. <xsl:template match="/">
  388. <xsl:variable name="originalPassportID">
  389. <xsl:choose>
  390. <xsl:when test="/root/credential/param[@name='CAM']/*[local-name() ='CAM']/*[local-name() = 'CAMPassport']/*[local-name() = 'id']">
  391. <xsl:value-of select="/root/credential/param[@name='CAM']/*[local-name() ='CAM']/*[local-name() = 'CAMPassport']/*[local-name() = 'id']"/>
  392. </xsl:when>
  393. <xsl:when test="/root/header/*[local-name() = 'biBusHeader']/*[local-name()= 'CAM']/CAMPassport/id">
  394. <xsl:value-of select="/root/header/*[local-name() = 'biBusHeader']/*[local-name()= 'CAM']/CAMPassport/id"/>
  395. </xsl:when>
  396. <xsl:otherwise>
  397. <xsl:value-of select="xtsext:camcookie_action('getPassportID', string(/root/cookies/cookie[@name='cam_passport']))"/>
  398. </xsl:otherwise>
  399. </xsl:choose>
  400. </xsl:variable>
  401. <xsl:variable name="newPassportID">
  402. <xsl:call-template name="getCamPassportCookie"/>
  403. </xsl:variable>
  404. <portlet:soap-response>
  405. <xsl:choose>
  406. <xsl:when test="$newPassportID != '' and $newPassportID != $originalPassportID">
  407. <SOAP-ENV:Fault xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsrp="urn:oasis:names:tc:wsrp:v1:types">
  408. <faultcode xmlns:wsrp="urn:oasis:names:tc:wsrp:v1:types" wsrp:dummy="">wsrp:InvalidCookie</faultcode>
  409. <faultstring>The producer environment has timed out. The consumer needs to initialize the cookies again.</faultstring>
  410. <detail>
  411. <wsrp:InvalidCookie/>
  412. </detail>
  413. </SOAP-ENV:Fault>
  414. </xsl:when>
  415. <xsl:otherwise>
  416. <xsl:copy-of select="/root/temp-response/*[local-name()='getMarkupResponse']"/>
  417. </xsl:otherwise>
  418. </xsl:choose>
  419. </portlet:soap-response>
  420. </xsl:template>
  421. <xsl:template name="getCamPassportCookie">
  422. <xsl:for-each select="/root/temp-response/xos:protocolHeader/xos:param[@name = 'Set-Cookie']">
  423. <xsl:variable name="cookieName" select="substring-before(., '=')"/>
  424. <xsl:if test="$cookieName = 'cam_passport'">
  425. <xsl:variable name="value" select="substring-after(., '=')"/>
  426. <xsl:choose>
  427. <xsl:when test="contains($value, ';')">
  428. <xsl:value-of select="substring-before($value, ';')"/>
  429. </xsl:when>
  430. <xsl:otherwise>
  431. <xsl:value-of select="$value"/>
  432. </xsl:otherwise>
  433. </xsl:choose>
  434. </xsl:if>
  435. </xsl:for-each>
  436. </xsl:template>
  437. </xsl:stylesheet>
  438. </xts:block>
  439. <xts:block id="requestFault" processor="XSLT" type="fault">
  440. <xsl:stylesheet version="1.0" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:bus="http://developer.cognos.com/schemas/bibus/2/" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  441. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  442. <xsl:template match="/">
  443. <xsl:variable name="xts-fault" select="/root/fault/xts:exception[last()]"/>
  444. <xsl:variable name="http-response" select="$xts-fault/xts:exceptionDetail/httpResponse"/>
  445. <fault>
  446. <xsl:choose>
  447. <xsl:when test="$http-response">
  448. <xsl:copy-of select="$xts-fault/xts:exceptionCode"/>
  449. <xsl:copy-of select="$xts-fault/xts:exceptionMsg"/>
  450. <xts:exceptionDetail>
  451. <httpResponse>
  452. <xsl:copy-of select="$http-response/code"/>
  453. <xsl:copy-of select="$http-response/message"/>
  454. </httpResponse>
  455. </xts:exceptionDetail>
  456. </xsl:when>
  457. <xsl:otherwise>
  458. <xsl:copy-of select="/root/fault/*"/>
  459. </xsl:otherwise>
  460. </xsl:choose>
  461. </fault>
  462. </xsl:template>
  463. </xsl:stylesheet>
  464. </xts:block>
  465. <!--
  466. This fault block is used to handle the error when we can't read the application.xml
  467. file The error is appended to the input and handled later in the listapps.xslt stylesheet.
  468. -->
  469. <xts:block id="applicationsFileFault" processor="XSLT" type="fault">
  470. <xsl:stylesheet version="1.0" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:bus="http://developer.cognos.com/schemas/bibus/2/" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  471. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  472. <xsl:template match="/">
  473. <xsl:variable name="xts-fault" select="/root/fault/xts:exception[last()]"/>
  474. <xsl:variable name="http-response" select="$xts-fault/xts:exceptionDetail/httpResponse"/>
  475. <application-file-error>
  476. <xsl:choose>
  477. <xsl:when test="$http-response">
  478. <xsl:copy-of select="$xts-fault/xts:exceptionCode"/>
  479. <xsl:copy-of select="$xts-fault/xts:exceptionMsg"/>
  480. <xts:exceptionDetail>
  481. <httpResponse>
  482. <xsl:copy-of select="$http-response/code"/>
  483. <xsl:copy-of select="$http-response/message"/>
  484. </httpResponse>
  485. </xts:exceptionDetail>
  486. </xsl:when>
  487. <xsl:otherwise>
  488. <xsl:copy-of select="/root/fault/*"/>
  489. </xsl:otherwise>
  490. </xsl:choose>
  491. </application-file-error>
  492. </xsl:template>
  493. </xsl:stylesheet>
  494. </xts:block>
  495. </xts:morphlet>
  496. <!-- This file was formated by XML Formatter (Cognos Inc.) on Aug 17, 2005 2:36:24 PM -->