search.xts 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573
  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/portlets/nav/portlet-impl/search/search.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/" messageBase="/cps4/portlets/nav/messages/cpsnavmsgs.xml">
  16. <xts:block id="decode" processor="XSLT" type="exec" mode="interpret">
  17. <xsl:stylesheet version="1.0"
  18. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  19. xmlns:wsrp="urn:oasis:names:tc:wsrp:v1:types"
  20. xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  21. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt">
  22. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  23. <xsl:template match="/">
  24. <xts:sequence>
  25. <xsl:variable name="last-search" select="/root/envelope/SOAP-ENV:Envelope/SOAP-ENV:Body/*[1]/wsrp:markupParams/wsrp:navigationalState/param[@name='last_search']"/>
  26. <xsl:if test="$last-search != ''">
  27. <xts:append>
  28. <lastSearch>
  29. <xts:transform name="XMLDecode">
  30. <xsl:value-of select="xtsext:base64decode(string($last-search), true())"/>
  31. </xts:transform>
  32. </lastSearch>
  33. </xts:append>
  34. </xsl:if>
  35. </xts:sequence>
  36. </xsl:template>
  37. </xsl:stylesheet>
  38. </xts:block>
  39. <xts:block id="request" dependency="decode" type="exec" mode="interpret" processor="XSLT">
  40. <xts:logicsheet path="/cps4/producer/logicsheets/cps-portlet.xslt"/>
  41. <xts:logicsheet path="/cps4/portlets/nav/logicsheets/nav-request.xslt"/>
  42. <xsl:stylesheet version="1.0"
  43. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  44. xmlns:wsrp="urn:oasis:names:tc:wsrp:v1:types"
  45. xmlns:portlet="http://developer.cognos.com/schemas/cps/logic/portlet/1/"
  46. xmlns:nav="http://developer.cognos.com/schemas/cps/navigation/1/"
  47. xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  48. xmlns:nreq="http://developer.cognos.com/schemas/cps/logic/nav/request/1/"
  49. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  50. xmlns:cps="http://developer.cognos.com/schemas/cps/asm/objects/1/">
  51. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  52. <xsl:variable name="nav-service">interface://crn</xsl:variable>
  53. <portlet:property name="display-advanced" select="'display_advanced'"/>
  54. <portlet:property name="display-actions-link" select="'display_actions_link'"/>
  55. <portlet:property name="context" select="'context'" />
  56. <xsl:template match="/">
  57. <xts:sequence>
  58. <xts:append>
  59. <results>
  60. <portlet:if-window-state name="wsrp:normal|wsrp:maximized|wsrp:solo">
  61. <portlet:if-mode name="wsrp:view|wsrp:preview">
  62. <xsl:call-template name="request-serviceDescription"/>
  63. <xsl:call-template name="request-itemtypes"/>
  64. <!-- if we're in advanced mode get the list of item types -->
  65. <xsl:if test="$display-advanced = 'true'">
  66. <searchScope>
  67. <xsl:call-template name="request-searchscope"/>
  68. </searchScope>
  69. </xsl:if>
  70. <!-- if the user executed a search build the query and execute the searth -->
  71. <xsl:if test="$portlet-navigational-params[@name = 'execute'] = 'true' or ($portlet-navigational-params[@name = 'execute'] = 'false' and ($context != '' or /root/lastSearch/*))">
  72. <!-- Check if we have a search filter -->
  73. <xsl:variable name="params">
  74. <xsl:choose>
  75. <xsl:when test="$portlet-navigational-params[@name = 'execute'] = 'true' ">
  76. <xsl:copy-of select="$portlet-navigational-params[@name = 'cps_fields' or @name = 'cps_string' or @name = 'cps_itemType' or @name = 'cps_itemModified']"/>
  77. </xsl:when>
  78. <xsl:when test=" /root/lastSearch/*">
  79. <xsl:copy-of select="/root/lastSearch/param[@name = 'cps_fields' or @name = 'cps_string' or @name = 'cps_itemType' or @name = 'cps_itemModified']"/>
  80. </xsl:when>
  81. </xsl:choose>
  82. </xsl:variable>
  83. <xsl:variable name="item-type">
  84. <xsl:choose>
  85. <xsl:when test="not ($params/param[@name = 'cps_itemType']) or $params/param[@name = 'cps_itemType'] = ''">any</xsl:when>
  86. <xsl:otherwise><xsl:value-of select="$params/param[@name = 'cps_itemType']"/></xsl:otherwise>
  87. </xsl:choose>
  88. </xsl:variable>
  89. <xsl:variable name="item-modified">
  90. <xsl:choose>
  91. <xsl:when test="not ($params/param[@name = 'cps_itemModified']) or $params/param[@name = 'cps_itemModified'] = ''">any</xsl:when>
  92. <xsl:otherwise><xsl:value-of select="$params/param[@name = 'cps_itemModified']"/></xsl:otherwise>
  93. </xsl:choose>
  94. </xsl:variable>
  95. <xsl:variable name="no-filter">
  96. <xsl:choose>
  97. <xsl:when test="$params/param[@name = 'cps_fields' ] = 'cs' and $params/param[@name = 'cps_string'] = '' ">
  98. <xsl:text>true</xsl:text>
  99. </xsl:when>
  100. <xsl:when test="$params/param[@name = 'cps_fields' ] != 'cs' and $params/param[@name = 'cps_string'] = '' and $item-type = 'any' and $item-modified = 'any' ">
  101. <xsl:text>true</xsl:text>
  102. </xsl:when>
  103. <xsl:otherwise>
  104. <xsl:text>false</xsl:text>
  105. </xsl:otherwise>
  106. </xsl:choose>
  107. </xsl:variable>
  108. <xsl:choose>
  109. <xsl:when test="$no-filter = 'true'">
  110. <no-filter/>
  111. </xsl:when>
  112. <xsl:otherwise>
  113. <xsl:call-template name="request-search"/>
  114. </xsl:otherwise>
  115. </xsl:choose>
  116. </xsl:if>
  117. </portlet:if-mode>
  118. <portlet:if-mode name="wsrp:edit|cps:config">
  119. <xsl:if test="contains( $portlet-navigational-params[@name = 'edit_mode'], 'about' )">
  120. <portlet:get-version/>
  121. </xsl:if>
  122. </portlet:if-mode>
  123. </portlet:if-window-state>
  124. </results>
  125. </xts:append>
  126. </xts:sequence>
  127. </xsl:template>
  128. <xsl:template name="cps-header">
  129. <!-- TODO: replace the cpsh:CPSHeader locales into the BIBUS header -->
  130. <xts:queryNode select="/root/envelope/*[local-name()='Envelope']/*[local-name()='Header']/*"/>
  131. </xsl:template>
  132. <xsl:template name="request-searchscope">
  133. <xts:request protocol="NAV" target="{ $nav-service }" responseEnvelope="false" faultBlock="requestFault">
  134. <SOAP-ENV:Envelope>
  135. <SOAP-ENV:Header>
  136. <xsl:call-template name="cps-header"/>
  137. </SOAP-ENV:Header>
  138. <SOAP-ENV:Body>
  139. <nav:getContainer>
  140. <nav:id>rootDefault</nav:id>
  141. <nreq:common-request-params/>
  142. </nav:getContainer>
  143. </SOAP-ENV:Body>
  144. </SOAP-ENV:Envelope>
  145. </xts:request>
  146. </xsl:template>
  147. <xsl:template name="request-itemtypes">
  148. <xts:request protocol="NAV" target="{ $nav-service }" responseEnvelope="false" faultBlock="requestFault">
  149. <SOAP-ENV:Envelope>
  150. <SOAP-ENV:Header>
  151. <xsl:call-template name="cps-header"/>
  152. </SOAP-ENV:Header>
  153. <SOAP-ENV:Body>
  154. <nav:getItemTypes>
  155. <nreq:common-request-params/>
  156. </nav:getItemTypes>
  157. </SOAP-ENV:Body>
  158. </SOAP-ENV:Envelope>
  159. </xts:request>
  160. </xsl:template>
  161. <xsl:template name="request-serviceDescription">
  162. <xts:request protocol="NAV" target="{ $nav-service }" responseEnvelope="false" faultBlock="requestFault">
  163. <SOAP-ENV:Envelope>
  164. <SOAP-ENV:Header>
  165. <xsl:call-template name="cps-header"/>
  166. </SOAP-ENV:Header>
  167. <SOAP-ENV:Body>
  168. <nav:getServiceDescription/>
  169. </SOAP-ENV:Body>
  170. </SOAP-ENV:Envelope>
  171. </xts:request>
  172. </xsl:template>
  173. <xsl:template name="request-search">
  174. <xsl:variable name="from" select="$portlet-navigational-params[@name = 'from']"/>
  175. <xsl:variable name="to" select="$portlet-navigational-params[@name = 'to']"/>
  176. <xsl:variable name="skip" select="$portlet-navigational-params[@name = 'skip']"/>
  177. <xsl:variable name="sort" select="$portlet-navigational-params[@name = 'sort']"/>
  178. <xsl:variable name="open-links">
  179. <xsl:choose>
  180. <xsl:when test="$portlet-state-params[@name = 'open_links'] != ''">
  181. <xsl:value-of select="$portlet-state-params[@name = 'open_links']"/>
  182. </xsl:when>
  183. <xsl:otherwise>
  184. <xsl:value-of select="$portlet-system-params[@name = 'open_links']"/>
  185. </xsl:otherwise>
  186. </xsl:choose>
  187. </xsl:variable>
  188. <xsl:variable name="skipObjects">
  189. <xsl:choose>
  190. <xsl:when test="$from != ''">
  191. <xsl:value-of select="number( $from ) - 1"/>
  192. </xsl:when>
  193. <xsl:when test="$skip != ''">
  194. <xsl:value-of select="$skip"/>
  195. </xsl:when>
  196. <xsl:otherwise>0</xsl:otherwise>
  197. </xsl:choose>
  198. </xsl:variable>
  199. <xsl:variable name="display-max-objects">
  200. <xsl:call-template name="portlet-get-property">
  201. <xsl:with-param name="property-name" select="'display_max_objects'"/>
  202. </xsl:call-template>
  203. </xsl:variable>
  204. <xsl:variable name="maxObjects">
  205. <xsl:choose>
  206. <xsl:when test="$to != '' and number($display-max-objects) = number($portlet-navigational-params[@name = 'display_max'])">
  207. <xsl:value-of select="number( $to ) - number($skipObjects)"/>
  208. </xsl:when>
  209. <xsl:otherwise>
  210. <xsl:value-of select="$display-max-objects"/>
  211. </xsl:otherwise>
  212. </xsl:choose>
  213. </xsl:variable>
  214. <xts:request protocol="NAV" target="{ $nav-service }" responseEnvelope="false" protocolHeader="true" protocolHeaderSelect="/root/output" faultBlock="requestFault">
  215. <SOAP-ENV:Envelope>
  216. <SOAP-ENV:Header>
  217. <xsl:call-template name="cps-header"/>
  218. </SOAP-ENV:Header>
  219. <SOAP-ENV:Body>
  220. <nav:search>
  221. <nav:validateTag fault="true">
  222. <xsl:value-of select="$portlet-markups/wsrp:validateTag"/>
  223. </nav:validateTag>
  224. <xsl:choose>
  225. <xsl:when test="$context != '' and $portlet-navigational-params[@name = 'execute'] = 'false'">
  226. <!-- use the last search nav:context -->
  227. <nav:skipObjects><xsl:value-of select="$skipObjects"/></nav:skipObjects>
  228. <nav:maxObjects><xsl:value-of select="$maxObjects"/></nav:maxObjects>
  229. <nav:context><xsl:value-of select="$context"/></nav:context>
  230. </xsl:when>
  231. <xsl:when test="/root/lastSearch/* and $portlet-navigational-params[@name = 'execute'] = 'false'">
  232. <!-- iNav's Search does not support nav:context, used our own saved last search criteria -->
  233. <xsl:call-template name="request-criteria">
  234. <xsl:with-param name="params" select="/root/lastSearch/param"/>
  235. <xsl:with-param name="skipObjects" select="$skipObjects"/>
  236. <xsl:with-param name="maxObjects" select="$maxObjects"/>
  237. </xsl:call-template>
  238. </xsl:when>
  239. <xsl:otherwise>
  240. <!-- execute a new request with the given search criteria -->
  241. <xsl:call-template name="request-criteria">
  242. <xsl:with-param name="params" select="$portlet-navigational-params"/>
  243. <xsl:with-param name="skipObjects" select="$skipObjects"/>
  244. <xsl:with-param name="maxObjects" select="$maxObjects"/>
  245. </xsl:call-template>
  246. </xsl:otherwise>
  247. </xsl:choose>
  248. <xsl:if test="$sort != ''">
  249. <xsl:variable name="order">
  250. <xsl:choose>
  251. <xsl:when test="$sort = 'name_d'"><xsl:text>descending</xsl:text></xsl:when>
  252. <xsl:otherwise><xsl:text>ascending</xsl:text></xsl:otherwise>
  253. </xsl:choose>
  254. </xsl:variable>
  255. <nav:sort order="{$order}">name</nav:sort>
  256. </xsl:if>
  257. <nav:property name="fullName"/>
  258. <nav:property name="icons"/>
  259. <xsl:if test="$open-links = 'channel'">
  260. <nav:property name="viewable"/>
  261. </xsl:if>
  262. <xsl:if test="$portlet-markups/wsrp:windowState = 'wsrp:maximized'">
  263. <nav:property name="description"/>
  264. </xsl:if>
  265. <nav:property name="screenTip"/>
  266. <nav:property name="createDate"/>
  267. <nav:property name="lastModifiedDate"/>
  268. <xsl:if test="$display-actions-link = 'true'">
  269. <nav:property name="action"/>
  270. <nav:property name="actionsURL"/>
  271. </xsl:if>
  272. <nav:property name="newState"/>
  273. <nav:property name="readState"/>
  274. <nav:property name="status"/>
  275. <nav:property name="hidden"/>
  276. <!-- burgundy search urlParameters -->
  277. <xsl:if test="$portlet-navigational-params[@name = 'cps_fields' ] = 'cs'">
  278. <nav:param name="useAllFilters"><xsl:value-of select="$portlet-navigational-params[@name = 'all_filters' ]"/></nav:param>
  279. <nav:param name="urlParameters">
  280. <xsl:for-each select="$portlet-navigational-params[starts-with( @name, 'cs_' ) and .!='']" >
  281. <xsl:value-of select="'&amp;'"/>
  282. <xsl:value-of select="@name"/>
  283. <xsl:value-of select="'='"/>
  284. <xsl:value-of select="xtsext:urlencode(.)"/>
  285. </xsl:for-each>
  286. </nav:param>
  287. </xsl:if>
  288. <!-- Current window mode is disabled in myPortal (standalone pages) -->
  289. <xsl:if test="$open-links='current' and not($portlet-is-myportal)">
  290. <xsl:choose>
  291. <xsl:when test="$portlet-is-cognos-connection">
  292. <!--
  293. If the portal agent is CC, instruct NAV to return a rewritable back url.
  294. This way the portlet will be able to add the back url itself.
  295. Also, we need to show the header
  296. -->
  297. <nav:param name="default:backUrl">rewrite</nav:param>
  298. <nav:param name="default:urlFlags">h1</nav:param>
  299. </xsl:when>
  300. <xsl:otherwise>
  301. <!-- If this is a 3rd party portal, just don't return a back url. It doesn't make sense to use javascript:close() -->
  302. <nav:param name="default:backUrl">false</nav:param>
  303. </xsl:otherwise>
  304. </xsl:choose>
  305. </xsl:if>
  306. <nreq:common-request-params/>
  307. </nav:search>
  308. </SOAP-ENV:Body>
  309. </SOAP-ENV:Envelope>
  310. </xts:request>
  311. </xsl:template>
  312. <xsl:template name="request-criteria">
  313. <xsl:param name="params"/>
  314. <xsl:param name="skipObjects"/>
  315. <xsl:param name="maxObjects"/>
  316. <nav:string><xsl:value-of select="$params[@name = 'cps_string']"/></nav:string>
  317. <nav:skipObjects><xsl:value-of select="$skipObjects"/></nav:skipObjects>
  318. <nav:maxObjects><xsl:value-of select="$maxObjects"/></nav:maxObjects>
  319. <xsl:variable name="search-type">
  320. <xsl:choose>
  321. <xsl:when test="$params[@name = 'cps_fields' ] = 'cs'">
  322. <xsl:text>content</xsl:text>
  323. </xsl:when>
  324. <xsl:otherwise>normal</xsl:otherwise>
  325. </xsl:choose>
  326. </xsl:variable>
  327. <nav:searchType><xsl:value-of select="$search-type"/></nav:searchType>
  328. <xsl:if test="$params[@name = 'cps_objects']">
  329. <nav:objects><xsl:value-of select="$params[@name = 'cps_objects']"/></nav:objects>
  330. </xsl:if>
  331. <xsl:if test="$params[@name = 'cps_match']">
  332. <nav:match><xsl:value-of select="$params[@name = 'cps_match']"/></nav:match>
  333. </xsl:if>
  334. <xsl:if test="$params[@name = 'cps_fields']">
  335. <nav:fields><xsl:value-of select="$params[@name = 'cps_fields']"/></nav:fields>
  336. </xsl:if>
  337. <xsl:if test="$params[@name = 'cps_itemType']">
  338. <nav:itemType><xsl:value-of select="$params[@name = 'cps_itemType']"/></nav:itemType>
  339. </xsl:if>
  340. <xsl:if test="$params[@name = 'cps_itemState']">
  341. <nav:itemState><xsl:value-of select="$params[@name = 'cps_itemState']"/></nav:itemState>
  342. </xsl:if>
  343. <xsl:if test="$params[@name = 'cps_itemModified']">
  344. <nav:itemModified><xsl:value-of select="$params[@name = 'cps_itemModified']"/></nav:itemModified>
  345. </xsl:if>
  346. <xsl:if test="$params[@name = 'cps_scope']">
  347. <nav:scope><xsl:value-of select="$params[@name = 'cps_scope']"/></nav:scope>
  348. </xsl:if>
  349. </xsl:template>
  350. </xsl:stylesheet>
  351. </xts:block>
  352. <xts:block id="response" dependency="request" type="exec" mode="interpret" processor="XSLT">
  353. <xts:logicsheet path="/cps4/producer/logicsheets/cps-portlet.xslt"/>
  354. <xts:logicsheet path="/cps4/common/logicsheets/soaplogic.xslt"/>
  355. <xsl:stylesheet version="1.0"
  356. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  357. xmlns:wsrp="urn:oasis:names:tc:wsrp:v1:types"
  358. xmlns:portlet="http://developer.cognos.com/schemas/cps/logic/portlet/1/"
  359. xmlns:string="java.lang.String"
  360. xmlns:nav="http://developer.cognos.com/schemas/cps/navigation/1/">
  361. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  362. <xsl:template match="/">
  363. <portlet:portlet handle="search">
  364. <portlet:soap-response>
  365. <xsl:choose>
  366. <xsl:when test="/root/results/error">
  367. <portlet:soap-fault select="/root/results/error"/>
  368. </xsl:when>
  369. <xsl:otherwise>
  370. <portlet:if-mode name="wsrp:view|wsrp:preview">
  371. <portlet:response>
  372. <portlet:content>
  373. <xsl:variable name="val-tag">
  374. <xsl:choose>
  375. <xsl:when test="/root/results/nav:searchResponse">
  376. <xsl:value-of select="/root/results/nav:searchResponse/nav:validateTag"/>
  377. </xsl:when>
  378. <xsl:when test="/root/results/uiError">
  379. <xsl:text>error</xsl:text>
  380. <xsl:value-of select="string:hashCode(string:new(string(/root/results/uiError/message)))"/>
  381. </xsl:when>
  382. <xsl:otherwise>norequest</xsl:otherwise>
  383. </xsl:choose>
  384. </xsl:variable>
  385. <xsl:variable name="use-cache" select="$portlet-markups/wsrp:validateTag = string($val-tag) and (string($val-tag) != '')"/>
  386. <portlet:markup-context useCachedMarkup="$use-cache" mimeType="'text/html'" requiresUrlRewriting="'true'">
  387. <xsl:if test="not($use-cache = 'true')">
  388. <portlet:if-window-state name="wsrp:minimized">
  389. <portlet:markup-string/>
  390. </portlet:if-window-state>
  391. <portlet:if-window-state name="wsrp:normal|wsrp:maximized|wsrp:solo">
  392. <portlet:markup-transform name="XSLT" src="'/cps4/portlets/nav/portlet-impl/search/view.xslt'">
  393. <portlet:logicsheet>/cps4/portlets/nav/logicsheets/nav-ui.xslt</portlet:logicsheet>
  394. <portlet:logicsheet>/cps4/producer/logicsheets/cps-ui.xslt</portlet:logicsheet>
  395. <portlet:logicsheet>/logicsheets/indextree.xslt</portlet:logicsheet>
  396. <portlet:messageBase>/cps4/producer/messages/cpsproducermsgs.xml</portlet:messageBase>
  397. <portlet:messageBase>/cps4/portlets/nav/messages/cpsnavmsgs.xml</portlet:messageBase>
  398. <portlet:source>
  399. <lastSearch>
  400. <xsl:choose>
  401. <xsl:when test="/root/lastSearch/param">
  402. <xsl:copy-of select="/root/lastSearch/param[starts-with(@name, 'cps_')]"/>
  403. </xsl:when>
  404. <xsl:otherwise>
  405. <xsl:copy-of select="$portlet-navigational-params[starts-with(@name, 'cps_')]"/>
  406. </xsl:otherwise>
  407. </xsl:choose>
  408. </lastSearch>
  409. <xts:queryNode select="/root/results/*"/>
  410. <xts:function name="getConfiguration">
  411. <xts:param name="portal.disablecmsearch"/>
  412. </xts:function>
  413. </portlet:source>
  414. </portlet:markup-transform>
  415. <portlet:cache-control expires="'15'" validateTag="$val-tag"/>
  416. <xsl:variable name="titles" select="$portlet-state-params[starts-with( @name, 'title_' ) and .!='']"/>
  417. <portlet:preferred-title-localized select="$titles"/>
  418. </portlet:if-window-state>
  419. </xsl:if>
  420. </portlet:markup-context>
  421. </portlet:content>
  422. </portlet:response>
  423. </portlet:if-mode>
  424. <portlet:if-mode name="wsrp:edit|cps:config">
  425. <portlet:response>
  426. <portlet:content>
  427. <portlet:markup-context mimeType="'text/html'" requiresUrlRewriting="'true'">
  428. <xsl:variable name="xslt-src">
  429. <xsl:choose>
  430. <xsl:when test="contains( $portlet-navigational-params[@name = 'edit_mode'], 'about' )">
  431. <xsl:text>/cps4/producer/wsrp-impl/transforms/display-about.xslt</xsl:text>
  432. </xsl:when>
  433. <xsl:otherwise>
  434. <xsl:text>/cps4/portlets/nav/portlet-impl/search/edit.xslt</xsl:text>
  435. </xsl:otherwise>
  436. </xsl:choose>
  437. </xsl:variable>
  438. <portlet:markup-transform name="XSLT" src="$xslt-src">
  439. <portlet:logicsheet>/cps4/producer/logicsheets/cps-ui-ext.xslt</portlet:logicsheet>
  440. <portlet:logicsheet>/cps4/producer/logicsheets/cps-ui.xslt</portlet:logicsheet>
  441. <portlet:logicsheet>/cps4/producer/logicsheets/cps-formlogic.xslt</portlet:logicsheet>
  442. <portlet:messageBase>/cps4/producer/messages/cpsproducermsgs.xml</portlet:messageBase>
  443. <portlet:messageBase>/cps4/portlets/nav/messages/cpsnavmsgs.xml</portlet:messageBase>
  444. <portlet:source>
  445. <xts:queryNode select="/root/results/*"/>
  446. <xts:function name="getConfiguration">
  447. <xts:param name="contentLocales">
  448. <xsl:value-of select="$portlet-product-locale"/>
  449. </xts:param>
  450. </xts:function>
  451. <xsl:variable name="nav-titles" select="$portlet-navigational-params[starts-with( @name, 'p_title_' ) and .!='']"/>
  452. <xsl:variable name="state-titles" select="$portlet-state-params[starts-with( @name, 'title_' ) and .!='']"/>
  453. <portlet:title-locale selectState1="$nav-titles" selectState2="$state-titles"/>
  454. </portlet:source>
  455. </portlet:markup-transform>
  456. </portlet:markup-context>
  457. </portlet:content>
  458. </portlet:response>
  459. </portlet:if-mode>
  460. <portlet:if-mode name="wsrp:help">
  461. <portlet:response>
  462. <portlet:content>
  463. <portlet:markup-context mimeType="'text/html'" requiresUrlRewriting="'false'">
  464. <portlet:markup-help/>
  465. </portlet:markup-context>
  466. </portlet:content>
  467. </portlet:response>
  468. </portlet:if-mode>
  469. </xsl:otherwise>
  470. </xsl:choose>
  471. </portlet:soap-response>
  472. </portlet:portlet>
  473. </xsl:template>
  474. </xsl:stylesheet>
  475. </xts:block>
  476. <xts:block id="requestFault" type="fault" processor="XSLT">
  477. <xsl:stylesheet version="1.0"
  478. xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  479. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  480. <xsl:template match="/">
  481. <xsl:variable name="xts-fault" select="/root/fault/xts:exception[last()]"/>
  482. <xsl:variable name="code" select="$xts-fault/xts:exceptionCode"/>
  483. <xsl:variable name="prefix" select="substring-before( string( $code ), ':' )"/>
  484. <xsl:variable name="local-code" select="substring-after( string( $code ), ':' )"/>
  485. <xsl:choose>
  486. <xsl:when test="($prefix = 'nav') and ($local-code = 'InvalidCredentials')">
  487. <error type="invalidCookie">
  488. <message>
  489. <xsl:value-of select="$xts-fault/xts:exceptionMsg"/>
  490. </message>
  491. </error>
  492. </xsl:when>
  493. <xsl:otherwise>
  494. <uiError>
  495. <message>
  496. <xsl:variable name="err-msg" select="$xts-fault/xts:exceptionMsg"/>
  497. <xsl:choose>
  498. <xsl:when test="contains($err-msg, 'CSN-IDS-0093')">
  499. <xts:string id="IDS_SEARCH_NO_INDEX"/>
  500. </xsl:when>
  501. <xsl:otherwise>
  502. <xsl:value-of select="$err-msg"/>
  503. </xsl:otherwise>
  504. </xsl:choose>
  505. </message>
  506. </uiError>
  507. </xsl:otherwise>
  508. </xsl:choose>
  509. </xsl:template>
  510. </xsl:stylesheet>
  511. </xts:block>
  512. </xts:morphlet>