BaseServiceImpl.xts 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478
  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, 2011
  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/producer/wsrp-impl/BaseServiceImpl.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="login" type="exec" mode="interpret" processor="XSLT" nodelist="envelope" condition="/root/envelope/*[local-name()='Envelope']/*[local-name()='Body']/*[1][local-name()='initCookie']" mandatory="false">
  17. <xts:logicsheet path="/cps4/common/logicsheets/soaplogic.xslt"/>
  18. <xsl:stylesheet version="1.0"
  19. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  20. 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:discard>
  25. <soap:request provider="cm">
  26. <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">
  27. <search>~</search>
  28. <properties xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:propEnum[1]">
  29. <item xsi:type="bus:propEnum">storeID</item>
  30. </properties>
  31. <options xsi:type="bus:queryOptions">
  32. <schemaInfo xsi:type="xsd:boolean">false</schemaInfo>
  33. </options>
  34. </bus:query>
  35. </soap:request>
  36. </xts:discard>
  37. </xts:sequence>
  38. </xsl:template>
  39. </xsl:stylesheet>
  40. </xts:block>
  41. <xts:block id="execution" type="exec" mode="interpret" dependency="login" processor="XSLT" zzznodelist="output, envelope, setCookies, system, debug">
  42. <xts:logicsheet path="/cps4/producer/logicsheets/cps-portlet.xslt"/>
  43. <xts:logicsheet path="/cps4/common/logicsheets/soaplogic.xslt"/>
  44. <xsl:stylesheet version="1.0"
  45. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  46. xmlns:wsrp="urn:oasis:names:tc:wsrp:v1:types"
  47. xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  48. xmlns:xos="http://developer.cognos.com/schemas/xts/output/"
  49. xmlns:soap="http://developer.cognos.com/schemas/cps/logic/soap"
  50. xmlns:portlet="http://developer.cognos.com/schemas/cps/logic/portlet/1/"
  51. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  52. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt">
  53. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  54. <xsl:variable name="op" select="/root/envelope/SOAP-ENV:Envelope/SOAP-ENV:Body/*[1]"/>
  55. <xsl:variable name="op-name" select="local-name($op)"/>
  56. <xsl:variable name="handle" select="substring-before( concat( $op/wsrp:portletContext/wsrp:portletHandle, ':' ), ':' )"/>
  57. <xsl:key name="key-params" match="/root/envelope/SOAP-ENV:Envelope/SOAP-ENV:Body/*[1]/wsrp:interactionParams/wsrp:formParameters" use="@name"/>
  58. <portlet:passport/>
  59. <xsl:template match="/">
  60. <xts:sequence>
  61. <xsl:if test="$op-name = 'initCookie'">
  62. <xts:append select="/root/output/*[local-name()='protocolHeader']">
  63. <xsl:for-each select="/root/setCookies/cookie">
  64. <xos:param name="Set-Cookie">
  65. <xsl:value-of select="@name"/>
  66. <xsl:text>=</xsl:text>
  67. <xsl:value-of select="."/>
  68. </xos:param>
  69. </xsl:for-each>
  70. <xsl:for-each select="/root/output/*[local-name()='protocolHeader']/*[local-name()='param' and @name='setSoapHeader']/SOAP-ENV:Header/bus:biBusHeader/*[local-name()='hdrSession']/bus:setCookieVars/*[local-name()='item']">
  71. <xos:param name="Set-Cookie">
  72. <xsl:value-of select="*[local-name()='name']"/>
  73. <xsl:text>=</xsl:text>
  74. <xsl:value-of select="*[local-name()='value']"/>
  75. </xos:param>
  76. </xsl:for-each>
  77. </xts:append>
  78. </xsl:if>
  79. <xts:append select="/root/output">
  80. <xos:part>
  81. <xos:entityHeader>
  82. <xos:param name="Content-type">text/xml</xos:param>
  83. </xos:entityHeader>
  84. <xos:entityBody>
  85. <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  86. <SOAP-ENV:Body>
  87. <xsl:choose>
  88. <xsl:when test="$op-name = 'initCookie'">
  89. <wsrp:initCookieResponse xmlns:wsrp="urn:oasis:names:tc:wsrp:v1:types"/>
  90. </xsl:when>
  91. <xsl:when test="$op-name = 'performBlockingInteraction'">
  92. <!-- NOTES: Form params starting with 'edit_*' and 'stack_*' are reserved by this framework. -->
  93. <!-- Params starting with 'p_*' are saved in the portlet state (save operation). -->
  94. <!-- -->
  95. <!-- The 'interactionState' are: -->
  96. <!-- nav = Take all input params and saved them in the navigational state. -->
  97. <!-- merge = Merge all input params and existing navigational params in the navigational -->
  98. <!-- state. -->
  99. <!-- set:xxxx = Maintain all input params (like the 'nav') and set the properties identified -->
  100. <!-- as "session" into the channel named 'xxxx'. -->
  101. <!-- -->
  102. <!-- save = Save all input params starting with p_* in the portlet state. -->
  103. <!-- Unchecked checkboxes are also saved with a 'false' value. -->
  104. <!-- If 'edit_navState' is defined, this will become the new navigational state. -->
  105. <!-- reset = Clear both the navigational state and the portlet state. -->
  106. <!-- -->
  107. <!-- maintain = Copy all input params (including tmp_* and stack_* into the navigational state. -->
  108. <!-- Some edit_* variables are also set (see the code below). -->
  109. <!-- push = Save all current inputs on the stack and into the navigational state. -->
  110. <!-- pop = Cancel all input params and restore with what's on the stack. -->
  111. <!-- drop = Merge the current input params with what's on the stack. -->
  112. <!-- -->
  113. <xsl:variable name="interactionState" select="$op/wsrp:interactionParams/wsrp:interactionState"/>
  114. <xsl:variable name="params" select="$op/wsrp:interactionParams/wsrp:formParameters"/>
  115. <xsl:choose>
  116. <xsl:when test="($interactionState = 'save' or $interactionState = 'reset') and ($op/wsrp:interactionParams/wsrp:portletStateChange = 'readOnly')">
  117. <xts:transform name="XML" cache="false">
  118. <xts:param name="messageBase"><xts:queryValue select="/root/interfaces/interfaceInfo/param[@name='location']"/>/messages/cpsproducermsgs.xml</xts:param>
  119. <xts:param name="systemId">no-cache-id</xts:param>
  120. <xts:param name="src">
  121. <SOAP-ENV:Fault>
  122. <faultcode xmlns:wsrp="urn:oasis:names:tc:wsrp:v1:types">wsrp:PortletStateChangeRequired</faultcode>
  123. <faultstring><xts:string id="IDS_PRO_WSF_PORTLETSTATECHANGEREQUIREDFAULT"/></faultstring>
  124. <detail>
  125. <wsrp:PortletStateChangeRequired xmlns:wsrp="urn:oasis:names:tc:wsrp:v1:types"/>
  126. </detail>
  127. </SOAP-ENV:Fault>
  128. </xts:param>
  129. </xts:transform>
  130. </xsl:when>
  131. <xsl:otherwise>
  132. <wsrp:performBlockingInteractionResponse xmlns:wsrp="urn:oasis:names:tc:wsrp:v1:types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  133. <wsrp:updateResponse>
  134. <xsl:choose>
  135. <xsl:when test="$interactionState = 'save'">
  136. <!-- save the portlet context -->
  137. <wsrp:portletContext>
  138. <wsrp:portletHandle>
  139. <xsl:value-of select="$op/wsrp:portletContext/wsrp:portletHandle"/>
  140. <xsl:if test="not( contains( $op/wsrp:portletContext/wsrp:portletHandle, ':' ) )">
  141. <xsl:text>:</xsl:text>
  142. <xsl:value-of select="xtsext:generateGUID()"/>
  143. </xsl:if>
  144. </wsrp:portletHandle>
  145. <!-- convert all input params starting with 'p_' as portlet state -->
  146. <xsl:variable name="new-state">
  147. <xsl:for-each select="$params[starts-with(@name, 'p_')]">
  148. <xsl:call-template name="gen-param">
  149. <xsl:with-param name="name" select="substring-after(@name, 'p_')"/>
  150. </xsl:call-template>
  151. </xsl:for-each>
  152. <xsl:for-each select="/root/system/param[@type = 'boolean']">
  153. <xsl:if test="not( key( 'key-params', concat('p_', @name) ) )">
  154. <xsl:call-template name="gen-param">
  155. <xsl:with-param name="name" select="@name"/>
  156. <xsl:with-param name="value" select="'false'"/>
  157. </xsl:call-template>
  158. </xsl:if>
  159. </xsl:for-each>
  160. </xsl:variable>
  161. <wsrp:portletState>
  162. <xsl:if test="not($new-state = '')">
  163. <xsl:value-of select="xtsext:base64encode(string($new-state), true())"/>
  164. </xsl:if>
  165. </wsrp:portletState>
  166. <xsl:variable name="external-ref-params" select="/root/system/param[@externalRef != '' and @externalRef != 'none' and key('key-params', concat('p_', @name) )]"/>
  167. <xsl:if test="$external-ref-params">
  168. <wsrp:extensions>
  169. <cpsext:state xmlns:cpsext="http://developer.cognos.com/schemas/cps/wsrp/extensions/1/">
  170. <xsl:for-each select="$external-ref-params">
  171. <cpsext:externalRef name="{@name}" type="{@externalRef}">
  172. <xsl:value-of select="key('key-params', concat('p_', @name))/wsrp:value"/>
  173. </cpsext:externalRef>
  174. </xsl:for-each>
  175. </cpsext:state>
  176. </wsrp:extensions>
  177. </xsl:if>
  178. </wsrp:portletContext>
  179. <wsrp:navigationalState>
  180. <!-- restore last view's navigational state -->
  181. <xsl:value-of select="key( 'key-params', 'edit_navState')/wsrp:value"/>
  182. </wsrp:navigationalState>
  183. </xsl:when>
  184. <xsl:when test="$interactionState = 'reset'">
  185. <!-- reset the portlet context -->
  186. <wsrp:portletContext>
  187. <wsrp:portletHandle>
  188. <xsl:value-of select="$handle"/>
  189. </wsrp:portletHandle>
  190. <wsrp:portletState/>
  191. </wsrp:portletContext>
  192. <wsrp:navigationalState xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
  193. </xsl:when>
  194. <!-- the rest is navigationalState only -->
  195. <xsl:when test="$interactionState != ''">
  196. <xsl:variable name="stacks" select="$params[ starts-with( @name, 'stack_' ) ]"/>
  197. <xsl:variable name="current-stack-level" select="count( $stacks ) - 1"/>
  198. <xsl:variable name="current-stack-name" select="concat( 'stack_', string( $current-stack-level ) )"/>
  199. <xsl:variable name="markup">
  200. <!-- grab everything except: 'edit_' and 'stack_' fields -->
  201. <xsl:for-each select="$params[not(starts-with(@name, 'edit_') or starts-with(@name, 'stack_'))]">
  202. <xsl:call-template name="gen-param"/>
  203. </xsl:for-each>
  204. </xsl:variable>
  205. <wsrp:navigationalState>
  206. <xsl:choose>
  207. <xsl:when test="$interactionState = 'nav'">
  208. <xsl:if test="not($markup = '')">
  209. <xsl:value-of select="xtsext:validator('prepare','nav',xtsext:base64encode(string($markup), true()))"/>
  210. </xsl:if>
  211. </xsl:when>
  212. <xsl:when test="starts-with($interactionState, 'set:')">
  213. <xsl:variable name="set-data">
  214. <xsl:for-each select="$op/wsrp:markupParams/wsrp:navigationalState/param">
  215. <xsl:call-template name="gen-param">
  216. <xsl:with-param name="name" select="@name"/>
  217. <xsl:with-param name="value" select="."/>
  218. </xsl:call-template>
  219. </xsl:for-each>
  220. </xsl:variable>
  221. <xsl:if test="not($set-data = '')">
  222. <xsl:value-of select="xtsext:validator('prepare','set',xtsext:base64encode(string($set-data), true()))"/>
  223. </xsl:if>
  224. </xsl:when>
  225. <xsl:when test="$interactionState = 'merge'">
  226. <xsl:variable name="merge-data">
  227. <xsl:text>&lt;param name="interaction"></xsl:text>
  228. <xsl:value-of select="xtsext:base64encode(string($markup),true())"/>
  229. <xsl:text>&lt;/param></xsl:text>
  230. <xsl:for-each select="$op/wsrp:markupParams/wsrp:navigationalState/param">
  231. <!-- only add navigational params that are missing form the interaction params -->
  232. <xsl:if test="not(key( 'key-params', @name ))">
  233. <xsl:call-template name="gen-param">
  234. <xsl:with-param name="name" select="@name"/>
  235. <xsl:with-param name="value" select="."/>
  236. </xsl:call-template>
  237. </xsl:if>
  238. </xsl:for-each>
  239. </xsl:variable>
  240. <xsl:if test="not($merge-data = '')">
  241. <xsl:value-of select="xtsext:validator('prepare','merge',xtsext:base64encode(string($merge-data), true()))"/>
  242. </xsl:if>
  243. </xsl:when>
  244. <xsl:when test="$interactionState = 'maintain'">
  245. <xsl:variable name="maintain-data">
  246. <xsl:value-of select="$markup"/>
  247. <xsl:call-template name="gen-param">
  248. <xsl:with-param name="name" select="'edit_mode'"/>
  249. <xsl:with-param name="value" select="key( 'key-params', 'edit_mode' )/wsrp:value"/>
  250. </xsl:call-template>
  251. <xsl:call-template name="gen-param">
  252. <xsl:with-param name="name" select="'edit_stack'"/>
  253. <xsl:with-param name="value" select="key( 'key-params', 'edit_stack' )/wsrp:value"/>
  254. </xsl:call-template>
  255. <xsl:call-template name="gen-param">
  256. <xsl:with-param name="name" select="'edit_visited'"/>
  257. <xsl:with-param name="value" select="'true'"/>
  258. </xsl:call-template>
  259. <xsl:if test="key( 'key-params', 'edit_navState' )">
  260. <xsl:call-template name="gen-param">
  261. <xsl:with-param name="name" select="'edit_navState'"/>
  262. <xsl:with-param name="value" select="key( 'key-params', 'edit_navState' )/wsrp:value"/>
  263. </xsl:call-template>
  264. </xsl:if>
  265. <!-- also include any 'stack_' fields -->
  266. <xsl:for-each select="$params[starts-with(@name, 'stack_')]">
  267. <xsl:call-template name="gen-param"/>
  268. </xsl:for-each>
  269. </xsl:variable>
  270. <xsl:value-of select="xtsext:validator('prepare','maintain',xtsext:base64encode(string($maintain-data), true()))"/>
  271. </xsl:when>
  272. <xsl:when test="$interactionState = 'push'">
  273. <xsl:variable name="push-data">
  274. <xsl:value-of select="$markup"/>
  275. <xsl:call-template name="gen-param">
  276. <xsl:with-param name="name" select="concat('stack_', string(number($current-stack-level) + 1))"/>
  277. <xsl:with-param name="value" select="xtsext:base64encode(string($markup), true())"/>
  278. </xsl:call-template>
  279. <xsl:call-template name="gen-param">
  280. <xsl:with-param name="name" select="'edit_mode'"/>
  281. <xsl:with-param name="value" select="key( 'key-params', 'edit_mode' )/wsrp:value"/>
  282. </xsl:call-template>
  283. <xsl:call-template name="gen-param">
  284. <xsl:with-param name="name" select="'edit_stack'"/>
  285. <xsl:with-param name="value" select="concat(concat(key( 'key-params', 'edit_name')/wsrp:value, '*'), key( 'key-params', 'edit_stack' )/wsrp:value)"/>
  286. </xsl:call-template>
  287. <xsl:if test="key( 'key-params', 'edit_navState' )">
  288. <xsl:call-template name="gen-param">
  289. <xsl:with-param name="name" select="'edit_navState'"/>
  290. <xsl:with-param name="value" select="key( 'key-params', 'edit_navState' )/wsrp:value"/>
  291. </xsl:call-template>
  292. </xsl:if>
  293. <!-- also include any 'stack_' fields -->
  294. <xsl:for-each select="$params[starts-with(@name, 'stack_')]">
  295. <xsl:call-template name="gen-param"/>
  296. </xsl:for-each>
  297. </xsl:variable>
  298. <xsl:value-of select="xtsext:validator('prepare','push',xtsext:base64encode(string($push-data), true()))"/>
  299. </xsl:when>
  300. <xsl:when test="$interactionState = 'pop'">
  301. <xsl:choose>
  302. <xsl:when test="key( 'key-params', string( $current-stack-name ) )">
  303. <xsl:variable name="pop-data">
  304. <xsl:call-template name="gen-param">
  305. <xsl:with-param name="name" select="'edit_mode'"/>
  306. <xsl:with-param name="value" select="substring-before( string( key( 'key-params', 'edit_stack' )/wsrp:value ), '*')"/>
  307. </xsl:call-template>
  308. <xsl:call-template name="gen-param">
  309. <xsl:with-param name="name" select="'edit_stack'"/>
  310. <xsl:with-param name="value" select="substring-after( string( key( 'key-params', 'edit_stack' )/wsrp:value ), '*')"/>
  311. </xsl:call-template>
  312. <xsl:call-template name="gen-param">
  313. <xsl:with-param name="name" select="'edit_visited'"/>
  314. <xsl:with-param name="value" select="'true'"/>
  315. </xsl:call-template>
  316. <xsl:if test="key( 'key-params', 'edit_navState' )">
  317. <xsl:call-template name="gen-param">
  318. <xsl:with-param name="name" select="'edit_navState'"/>
  319. <xsl:with-param name="value" select="key( 'key-params', 'edit_navState' )/wsrp:value"/>
  320. </xsl:call-template>
  321. </xsl:if>
  322. <xsl:for-each select="$params[starts-with(@name, 'stack_') and @name != string( $current-stack-name )]">
  323. <xsl:call-template name="gen-param"/>
  324. </xsl:for-each>
  325. <xsl:value-of select="xtsext:base64decode(string( key( 'key-params', string( $current-stack-name ) )/wsrp:value ), true())"/>
  326. </xsl:variable>
  327. <xsl:value-of select="xtsext:validator('prepare','pop',xtsext:base64encode(string($pop-data), true()))"/>
  328. </xsl:when>
  329. <xsl:otherwise>
  330. <xsl:if test="not($markup = '')">
  331. <!-- TODO: add a "stack-underflow" param here! -->
  332. <xsl:value-of select="xtsext:validator('prepare','underflow',xtsext:base64encode(string($markup), true()))"/>
  333. </xsl:if>
  334. </xsl:otherwise>
  335. </xsl:choose>
  336. </xsl:when>
  337. <xsl:when test="$interactionState = 'drop'">
  338. <xsl:variable name="drop-data">
  339. <xsl:value-of select="$markup"/>
  340. <xsl:call-template name="gen-param">
  341. <xsl:with-param name="name" select="'edit_mode'"/>
  342. <xsl:with-param name="value" select="substring-before( string( key( 'key-params', 'edit_stack' )/wsrp:value ), '*')"/>
  343. </xsl:call-template>
  344. <xsl:call-template name="gen-param">
  345. <xsl:with-param name="name" select="'edit_stack'"/>
  346. <xsl:with-param name="value" select="substring-after( string( key( 'key-params', 'edit_stack' )/wsrp:value ), '*')"/>
  347. </xsl:call-template>
  348. <xsl:call-template name="gen-param">
  349. <xsl:with-param name="name" select="'edit_visited'"/>
  350. <xsl:with-param name="value" select="'true'"/>
  351. </xsl:call-template>
  352. <xsl:if test="key( 'key-params', 'edit_navState' )">
  353. <xsl:call-template name="gen-param">
  354. <xsl:with-param name="name" select="'edit_navState'"/>
  355. <xsl:with-param name="value" select="key( 'key-params', 'edit_navState' )/wsrp:value"/>
  356. </xsl:call-template>
  357. </xsl:if>
  358. <xsl:for-each select="$params[starts-with(@name, 'stack_') and @name != string( $current-stack-name )]">
  359. <xsl:call-template name="gen-param"/>
  360. </xsl:for-each>
  361. </xsl:variable>
  362. <xsl:value-of select="xtsext:validator('prepare','drop',xtsext:base64encode(string($drop-data), true()))"/>
  363. </xsl:when>
  364. </xsl:choose>
  365. </wsrp:navigationalState>
  366. <xsl:if test="$interactionState = 'pop' or $interactionState = 'drop'">
  367. <!-- update the mode (wsrp:newMode) by reading what's on the stack -->
  368. <!-- if wsrp-mode is not available, 'wsrp:edit' is assumed -->
  369. <!-- a wsrp-mode is available if the '|' char is present -->
  370. <!-- e.g. "xxx|yyy" means wsrp-mode=xxx, edit_mode=yyy -->
  371. <xsl:variable name="mode" select="substring-before( string( key( 'key-params', 'edit_stack' )/wsrp:value ), '*')"/>
  372. <wsrp:newMode>
  373. <xsl:choose>
  374. <xsl:when test="contains( $mode, '|' )">
  375. <xsl:value-of select="substring-before( $mode, '|' )"/>
  376. </xsl:when>
  377. <xsl:otherwise>wsrp:edit</xsl:otherwise>
  378. </xsl:choose>
  379. </wsrp:newMode>
  380. </xsl:if>
  381. </xsl:when>
  382. </xsl:choose>
  383. </wsrp:updateResponse>
  384. <xsl:if test="starts-with($interactionState, 'set:')">
  385. <xsl:variable name="channel" select="substring-after($interactionState, ':')"/>
  386. <xsl:variable name="variables" select="/root/system/param[@shared = 'true' and key( 'key-params', @name )]"/>
  387. <xsl:if test="$variables">
  388. <xts:discard>
  389. <xsl:variable name="name-prefix" select="concat( $op/wsrp:registrationContext/wsrp:registrationHandle, ':', $channel, '#' )"/>
  390. <xsl:for-each select="$variables">
  391. <xts:function name="TDSRequest">
  392. <xts:param name="action">set</xts:param>
  393. <xts:param name="session-id"><xsl:value-of select="$passport"/></xts:param>
  394. <xts:param name="map-id"><xsl:value-of select="'portlets'"/></xts:param>
  395. <xts:param name="name"><xsl:value-of select="concat($name-prefix, @name)"/></xts:param>
  396. <xts:param name="report-errors">true</xts:param>
  397. <xts:param name="source">
  398. <xsl:choose>
  399. <xsl:when test="@type='guid' and @updateOnSet='true'">
  400. <xsl:value-of select="xtsext:generateGUID()"/>
  401. </xsl:when>
  402. <xsl:otherwise>
  403. <xsl:value-of select="key( 'key-params', @name )/wsrp:value"/>
  404. </xsl:otherwise>
  405. </xsl:choose>
  406. </xts:param>
  407. </xts:function>
  408. </xsl:for-each>
  409. </xts:discard>
  410. </xsl:if>
  411. </xsl:if>
  412. </wsrp:performBlockingInteractionResponse>
  413. </xsl:otherwise>
  414. </xsl:choose>
  415. </xsl:when>
  416. <xsl:otherwise>
  417. <xts:transform name="XML" cache="false">
  418. <xts:param name="messageBase"><xts:queryValue select="/root/interfaces/interfaceInfo/param[@name='location']"/>/messages/cpsproducermsgs.xml</xts:param>
  419. <xts:param name="systemId">no-cache-id</xts:param>
  420. <xts:param name="src">
  421. <SOAP-ENV:Fault>
  422. <faultcode xmlns:wsrp="urn:oasis:names:tc:wsrp:v1:types">wsrp:OperationFailed</faultcode>
  423. <faultstring><xts:string id="IDS_PRO_WSF_NOTIMPLEMENTEDFAULT"/></faultstring>
  424. <detail>
  425. <wsrp:OperationFailed xmlns:wsrp="urn:oasis:names:tc:wsrp:v1:types"/>
  426. </detail>
  427. </SOAP-ENV:Fault>
  428. </xts:param>
  429. </xts:transform>
  430. </xsl:otherwise>
  431. </xsl:choose>
  432. </SOAP-ENV:Body>
  433. </SOAP-ENV:Envelope>
  434. </xos:entityBody>
  435. </xos:part>
  436. </xts:append>
  437. </xts:sequence>
  438. </xsl:template>
  439. <xsl:template name="gen-param">
  440. <xsl:param name="name" select="@name"/>
  441. <xsl:param name="value" select="wsrp:value"/>
  442. <xsl:text>&lt;param name="</xsl:text>
  443. <xsl:value-of select="$name"/>
  444. <xsl:text>"></xsl:text>
  445. <xsl:value-of select="xtsext:xmlencode(string($value))"/>
  446. <xsl:text>&lt;/param></xsl:text>
  447. </xsl:template>
  448. </xsl:stylesheet>
  449. </xts:block>
  450. </xts:morphlet>