cc.xts 52 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: ps
  5. (C) Copyright IBM Corp. 2005, 2017
  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 xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="messages/portal.xml, messages/portalRL.xml">
  13. <!-- ======================================================== -->
  14. <!-- State Management -->
  15. <!-- ======================================================== -->
  16. <!-- Unpack the CC state if we have one in the request -->
  17. <xts:block processor="XSLT" type="exec" mandatory="false"
  18. id="ccstate"
  19. condition=".[/root/env/param[@name='ccstate']]"
  20. nodelist="env">
  21. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 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. <xts:append select="/root/env">
  26. <xsl:value-of select="xtsext:web64decode(string(xtsext:cafaction('sign_unwrap', string(/root/env/param[@name='ccstate']))), true())" disable-output-escaping="yes"/>
  27. </xts:append>
  28. <xts:delete select="/root/env/param[@name='ccstate']"/>
  29. </xts:sequence>
  30. </xsl:template>
  31. </xsl:stylesheet>
  32. </xts:block>
  33. <xts:block id="classNames" type="exec" mode="input" processor="XML" path="/portal/uiExtensions.xml" condition=".[not(string(/root/output/*[local-name() = 'statusCode']) = '304')]">
  34. <xts:logicsheet path="/logicsheets/uiobjects/uiobjects_names.xslt"/>
  35. </xts:block>
  36. <!-- ======================================================== -->
  37. <!-- Session Management -->
  38. <!-- ======================================================== -->
  39. <!-- Reads session-sensitive info from CM -->
  40. <xts:block processor="XSLT" type="exec" mandatory="false"
  41. id="refreshSession"
  42. path="portal/cc/read_session.xml"
  43. dependency="ccstate"
  44. condition=".[
  45. string(/root/cookies/cookie[@name = 'cc_session']) = ''
  46. or /root/env/param[@name='m_reload']
  47. or /root/env/param[@name='m_root'] ]">
  48. <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
  49. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  50. </xts:block>
  51. <!-- Update the <session> element for this request. -->
  52. <xts:block id="buildSession" path="portal/session.xml" dependency="refreshSession impersonateTenant" processor="XSLT" type="exec"
  53. condition=".[
  54. /root/newSession
  55. or /root/env/param[@name='ui']
  56. or /root/env/param[@name='d']
  57. or /root/env/param[starts-with(@name,'m_s_')]
  58. or /root/env/param[@name = 'resetSort'] ]"
  59. mandatory="false"/>
  60. <!-- Save changes to the state info in a cookie -->
  61. <xts:block mode="interpret" processor="XSLT" type="exec"
  62. id="setSession"
  63. path="portal/set_session.xml"
  64. dependency="ccResponse groupEdit"
  65. condition=".[/root/updateSession]"
  66. mandatory="false"/>
  67. <!-- ======================================================== -->
  68. <!-- Process -->
  69. <!-- ======================================================== -->
  70. <xts:block processor="XSLT" type="exec" mandatory="false"
  71. id="pre-process"
  72. condition=".[string(/root/env/param[@name='m_tabPath']) != '' or
  73. starts-with(/root/env/param[@name='m_tab' or @name='m_page'],'path:') or
  74. /root/env/param[@name='cpstarget'] or
  75. (not(/root/env/param[@name='cs_filter']) and string(/root/env/param[@name='t_cs_filter_saved']) = 'true')]"
  76. dependency="buildSession" nodelist="env, header">
  77. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  78. <xsl:stylesheet version="1.0"
  79. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  80. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  81. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  82. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
  83. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  84. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  85. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  86. <xsl:template match="/">
  87. <xts:sequence>
  88. <!-- convert tab path to its id equivalent -->
  89. <xsl:if test="string(/root/env/param[@name='m_tabPath']) != '' or starts-with(/root/env/param[@name='m_tab' or @name='m_page'],'path:')">
  90. <xts:append>
  91. <tabPath_id>
  92. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  93. <send:request provider="cm">
  94. <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
  95. <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  96. <cm:search>
  97. <xsl:choose>
  98. <xsl:when test="string(/root/env/param[@name='m_tabPath']) != ''">
  99. <xsl:value-of select="string(/root/env/param[@name='m_tabPath'])"/>
  100. </xsl:when>
  101. <xsl:when test="starts-with(/root/env/param[@name='m_tab'],'path:')">
  102. <xsl:value-of select="substring-after(/root/env/param[@name='m_tab'],'path:')"/>
  103. </xsl:when>
  104. <xsl:otherwise>
  105. <xsl:value-of select="substring-after(/root/env/param[@name='m_page'],'path:')"/>
  106. </xsl:otherwise>
  107. </xsl:choose>
  108. </cm:search>
  109. <cm:properties>
  110. <cm:property name="storeID"/>
  111. </cm:properties>
  112. <cm:options schemaInfo="false"/>
  113. </cm:query>
  114. </xts:transform>
  115. </send:request>
  116. </xts:transform>
  117. </tabPath_id>
  118. </xts:append>
  119. </xsl:if>
  120. <!-- unpack cpstarget -->
  121. <xsl:if test="string(/root/env/param[@name='cpstarget']) != ''">
  122. <xsl:variable name="cpstarget">
  123. <xsl:value-of select="xtsext:web64decode(xtsext:validator('verify', 'cpstarget', string(/root/env/param[@name='cpstarget'])), true())" disable-output-escaping="yes"/>
  124. </xsl:variable>
  125. <xts:append select="/root/env">
  126. <xsl:copy-of select="$cpstarget"/>
  127. </xts:append>
  128. </xsl:if>
  129. </xts:sequence>
  130. </xsl:template>
  131. </xsl:stylesheet>
  132. </xts:block>
  133. <!-- For search requests, build the search expression -->
  134. <xts:block mandatory="false" processor="XSLT" type="exec"
  135. id="setSearch"
  136. dependency="buildSession pre-process"
  137. condition=".[ /root/env/param[@name = 'search'] ]"
  138. nodelist="cookies, env, session, system, user, configProps">
  139. <xts:logicsheet path="logicsheets/portal.xsl"/>
  140. <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
  141. <xts:logicsheet path="logicsheets/searchlogic.xslt"/>
  142. <xsl:stylesheet version="1.0"
  143. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  144. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  145. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  146. xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/"
  147. xmlns:search="http://developer.cognos.com/schemas/xts/logicsheets/xslt/searchlogic/">
  148. <xsl:output method="xml" version="1.0" encoding="UTF-8" omit-xml-declaration="yes" indent="no"/>
  149. <pf:variables/>
  150. <cml:object-predicates/>
  151. <xsl:template match="/root">
  152. <!-- If we have a search command then append a <search> element -->
  153. <xsl:variable name="path">
  154. <xsl:choose>
  155. <xsl:when test="string(/root/env/param[@name='m_folder']) != ''">
  156. <xsl:value-of select="concat('storeID(&quot;', /root/env/param[@name='m_folder'], '&quot;)')"/>
  157. </xsl:when>
  158. <xsl:when test="string(/root/env/param[@name='m_path']) != ''">
  159. <xsl:value-of select="string(/root/env/param[@name='m_path'])"/>
  160. </xsl:when>
  161. <xsl:otherwise>
  162. <xsl:value-of select="string(/root/system/param[@name='consumer-root'])"/>
  163. </xsl:otherwise>
  164. </xsl:choose>
  165. </xsl:variable>
  166. <xts:sequence>
  167. <search:gen-search-exp>
  168. <search:defaultTypes>
  169. <search:defaultType>document</search:defaultType>
  170. <search:defaultType>cd</search:defaultType>
  171. <search:defaultType>advisorView</search:defaultType>
  172. <search:defaultType>advisorCanvas</search:defaultType>
  173. <search:defaultType>shortcut</search:defaultType>
  174. <search:defaultType>analysis</search:defaultType>
  175. <search:defaultType>agentDefinition</search:defaultType>
  176. <search:defaultType>agentDefinitionView</search:defaultType>
  177. <search:defaultType>dataMovementTask</search:defaultType>
  178. <search:defaultType>dataMovementTaskAlias</search:defaultType>
  179. <search:defaultType>report</search:defaultType>
  180. <search:defaultType>interactiveReport</search:defaultType>
  181. <search:defaultType>query</search:defaultType>
  182. <search:defaultType>reportView</search:defaultType>
  183. <search:defaultType>folder</search:defaultType>
  184. <search:defaultType>URL</search:defaultType>
  185. <search:defaultType>pagelet</search:defaultType>
  186. <search:defaultType>package</search:defaultType>
  187. <search:defaultType>jobDefinition</search:defaultType>
  188. <search:defaultType>planningTask</search:defaultType>
  189. <search:defaultType>powerPlayCube</search:defaultType>
  190. <search:defaultType>powerPlayReport</search:defaultType>
  191. <search:defaultType>powerPlay8Report</search:defaultType>
  192. <search:defaultType>powerPlay8ReportView</search:defaultType>
  193. <search:defaultType>reportTemplate</search:defaultType>
  194. <search:defaultType>metricsFileImportTask</search:defaultType>
  195. <search:defaultType>metricsDataSourceETLTask</search:defaultType>
  196. <search:defaultType>metricsMaintenanceTask</search:defaultType>
  197. <search:defaultType>metricsExportTask</search:defaultType>
  198. <search:defaultType>contentReference</search:defaultType>
  199. </search:defaultTypes>
  200. </search:gen-search-exp>
  201. </xts:sequence>
  202. </xsl:template>
  203. </xsl:stylesheet>
  204. </xts:block>
  205. <!-- ======================================================== -->
  206. <!-- Content request -->
  207. <!-- ======================================================== -->
  208. <!-- Content request for PF/MF navigation/search and portal pages -->
  209. <xts:block processor="XSLT" type="exec" mandatory="false"
  210. id="getContent"
  211. path="portal/cc/get_content.xslt"
  212. dependency="setSearch ccstate buildSession"
  213. nodelist="header, http, env, session, search, cookies, setCookies, user, credential, configProps, page, tabPath_id, mvcSettings">
  214. <xts:logicsheet path="logicsheets/tenantlogic.xsl"/>
  215. <xts:logicsheet path="logicsheets/portal.xsl"/>
  216. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  217. <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
  218. </xts:block>
  219. <!-- Merge the tenantNames into the response -->
  220. <xts:block processor="XSLT" type="exec" mandatory="false"
  221. path="/portal/tenancy/mergeTenantNames.xslt"
  222. id="mergeTenantNames"
  223. dependency="getContent"
  224. condition=".[/root/session/param[@name='e_showTenantInfo']='true']">
  225. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  226. </xts:block>
  227. <!-- Call nav to get content for the search -->
  228. <xts:block processor="XSLT" type="exec" mandatory="false"
  229. id="getNavContent"
  230. condition=".[/root/search/navSearchSpec]"
  231. path="portal/cc/get_content_nav.xslt"
  232. dependency="setSearch ccstate buildSession"
  233. nodelist="header, http, env, system, session, search, cookies, setCookies, user, credential, configProps, page, tabPath_id">
  234. <xts:logicsheet path="logicsheets/tenantlogic.xsl"/>
  235. <xts:logicsheet path="portal/cc/search_pagers.xslt"/>
  236. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  237. <xts:logicsheet path="logicsheets/portal.xsl"/>
  238. </xts:block>
  239. <!--
  240. Read the portal tabs if they did not exist in the session.
  241. -->
  242. <xts:block processor="XSLT" type="exec" mandatory="false"
  243. id="getPortalPages"
  244. dependency="mergeTenantNames getNavContent"
  245. nodelist="header, cookies, setCookies, env, system, session, configProps, page, credential"
  246. path="portal/cc/get_portal_pages.xslt"
  247. condition=".[
  248. (
  249. not(/root/cmContent/*[local-name()='queryResponse']/*[local-name()='queryReply'][1]/*[local-name()='runTimeState']/*[local-name()='portalTabs'])
  250. and
  251. ((/root/cmContent/*[local-name()='queryResponse']/*[local-name()='queryReply'][2]/*) or (/root/page/type = 'custom'))
  252. )
  253. or
  254. /root/env/param[@name='m_reload']
  255. or
  256. /root/env/param[@name='refresh']
  257. or
  258. not(/root/session/param[@name='cachestamp'])
  259. ]">
  260. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  261. <xts:logicsheet path="logicsheets/portal.xsl"/>
  262. </xts:block>
  263. <!-- ================================================ -->
  264. <!-- getPagelet -->
  265. <!-- ================================================ -->
  266. <xts:block processor="XSLT" type="exec" mandatory="false"
  267. id="getPagelet"
  268. dependency="getPortalPages"
  269. condition=".[/root/page/type = 'custom']"
  270. nodelist="http, env, user, session, credential, header, page, state, cmContent, configProps">
  271. <xts:logicsheet path="/cps4/common/logicsheets/soaplogic.xslt"/>
  272. <xts:logicsheet path="logicsheets/portal.xsl"/>
  273. <xsl:stylesheet version="1.0"
  274. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  275. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  276. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  277. xmlns:cps="http://developer.cognos.com/schemas/cps/asm/objects/1/"
  278. xmlns:asm="http://developer.cognos.com/schemas/cps/asm/assembler/1/"
  279. xmlns:soap="http://developer.cognos.com/schemas/cps/logic/soap"
  280. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  281. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  282. exclude-result-prefixes="xts cm cps asm soap xtsext pf">
  283. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  284. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  285. <xsl:variable name="pageID" select="/root/page/id"/>
  286. <xsl:variable name="portlet-param" select="key('env-param', 'm_portlet')"/>
  287. <xsl:variable name="cps-package">
  288. <xsl:choose>
  289. <xsl:when test="$pageID = 'portlet'">
  290. <xsl:value-of select="concat('/', substring-before(substring-after($portlet-param, '/'), '/'))"/>
  291. </xsl:when>
  292. <xsl:otherwise>
  293. <xsl:text>/connection</xsl:text>
  294. </xsl:otherwise>
  295. </xsl:choose>
  296. </xsl:variable>
  297. <xsl:variable name="cps-pagelet">
  298. <xsl:choose>
  299. <xsl:when test="$pageID = 'portlet'">
  300. <xsl:value-of select="concat('/', substring-after(substring-after($portlet-param, '/'), '/'))"/>
  301. </xsl:when>
  302. <xsl:otherwise>
  303. <xsl:value-of select="concat('/', $pageID)"/>
  304. </xsl:otherwise>
  305. </xsl:choose>
  306. </xsl:variable>
  307. <xsl:variable name="cps-path" select="concat($cps-package, $cps-pagelet)"/>
  308. <xsl:variable name="passport" select="/root/credential/param[@name='CAM']/*[local-name() ='CAM']/*[local-name() = 'CAMPassport']/*[local-name() = 'id']"/>
  309. <xsl:variable name="session-objects" select="/root/cmContent/cm:queryResponse/cm:queryReply/cm:runTimeState"/>
  310. <xsl:variable name="package-context" select="$session-objects/cps:packageContext"/>
  311. <xsl:variable name="pagelet-context" select="/root/state/cps:pageletContext | $session-objects/cps:pageletContext"/>
  312. <xsl:variable name="wsrp-urlType" select="string(key('env-param', 'wsrp-urlType'))"/>
  313. <xsl:variable name="cps-portlet" select="string(key('env-param', 'cps-portlet'))"/>
  314. <!-- parameters not to be passed into assembler call -->
  315. <xsl:variable name="params-excluded" select="' m b_action m_obj m_folder m_folder2 m_tab encoding backURL tb nh rui style m_page m_portlet m_pagemode m_state '"/>
  316. <!-- base url -->
  317. <xsl:variable name="request-url" select="/root/http/param[@name = 'SCRIPT_NAME']"/>
  318. <xsl:variable name="resource-url" select="concat($request-url, '?b_action=xts.run&amp;m=portal/mypages/page_resource.xts')"/>
  319. <!--
  320. being viewed as tab
  321. m_tab
  322. m_folder
  323. m_folder2
  324. rui
  325. being viewed as page
  326. backURL
  327. rui
  328. -->
  329. <xsl:variable name="m_page" select="key('env-param', 'm_page')"/>
  330. <xsl:variable name="m_portlet" select="key('env-param', 'm_portlet')"/>
  331. <xsl:variable name="m_tab" select="key('env-param', 'm_tab')"/>
  332. <xsl:variable name="m_folder" select="key('env-param', 'm_folder')"/>
  333. <xsl:variable name="m_folder2" select="key('env-param', 'm_folder2')"/>
  334. <xsl:variable name="rui" select="key('env-param', 'rui')"/>
  335. <xsl:variable name="style" select="key('env-param', 'style')"/>
  336. <xsl:variable name="m_ts" select="key('env-param', 'm_ts')"/>
  337. <!-- page mode overrride, 'edit'=show edit captions, 'view'=hide edit captions -->
  338. <xsl:variable name="m_pagemode" select="key('env-param', 'm_pagemode')"/>
  339. <!-- target portion determines routing -->
  340. <xsl:variable name="target">
  341. <xsl:text>b_action=xts.run&amp;m=portal/cc.xts</xsl:text>
  342. </xsl:variable>
  343. <xsl:variable name="extras">
  344. <xsl:if test="$m_tab">
  345. <param name="m_tab"><xsl:value-of select="$m_tab"/></param>
  346. </xsl:if>
  347. <xsl:if test="$m_page">
  348. <param name="m_page"><xsl:value-of select="$m_page"/></param>
  349. </xsl:if>
  350. <xsl:if test="$m_portlet">
  351. <param name="m_portlet"><xsl:value-of select="$m_portlet"/></param>
  352. </xsl:if>
  353. <xsl:if test="$m_pagemode">
  354. <param name="m_pagemode"><xsl:value-of select="$m_pagemode"/></param>
  355. </xsl:if>
  356. <xsl:if test="$rui">
  357. <param name="rui"><xsl:value-of select="$rui"/></param>
  358. </xsl:if>
  359. <xsl:if test="$style">
  360. <param name="style"><xsl:value-of select="$style"/></param>
  361. </xsl:if>
  362. <xsl:if test="$m_folder">
  363. <param name="m_folder"><xsl:value-of select="$m_folder"/></param>
  364. </xsl:if>
  365. <xsl:if test="$m_folder2">
  366. <param name="m_folder2"><xsl:value-of select="$m_folder2"/></param>
  367. </xsl:if>
  368. <xsl:if test="$m_ts">
  369. <param name="m_ts"><xsl:value-of select="$m_ts"/></param>
  370. </xsl:if>
  371. </xsl:variable>
  372. <!-- cpstarget is a bypass parameter in CAF - we handle the signing separately in XTS. -->
  373. <xsl:variable name="cpstarget">
  374. <xsl:variable name="params">
  375. <xsl:call-template name="serialize-xml">
  376. <xsl:with-param name="node-set" select="$extras"/>
  377. </xsl:call-template>
  378. </xsl:variable>
  379. <xsl:text/>&amp;cpstarget=<xsl:value-of select="xtsext:urlencode(xtsext:validator('prepare', 'cpstarget', xtsext:web64encode(string($params), true())))"/>
  380. </xsl:variable>
  381. <xsl:variable name="base-url">
  382. <xsl:value-of select="$request-url"/>?<xsl:text/>
  383. <xsl:value-of select="$target"/>
  384. <xsl:value-of select="$cpstarget"/>
  385. </xsl:variable>
  386. <!-- backURL -->
  387. <xsl:variable name="gateway" select="/root/http/param[@name = 'SCRIPT_NAME']"/>
  388. <xsl:variable name="backURL" select="key('env-param', 'backURL')"/>
  389. <xsl:variable name="backTemplate">
  390. <xsl:value-of select="$gateway"/>
  391. <xsl:text>?b_action=xts.run&amp;m=/portal/back.xts&amp;id={backID}</xsl:text>
  392. </xsl:variable>
  393. <!-- rewrite into page or save in session -->
  394. <xsl:variable name="guid" select="xtsext:generateGUID()"/>
  395. <xsl:variable name="state-id" select="/root/state/id"/>
  396. <xsl:variable name="param-state" select="key('env-param', 'm_state')"/>
  397. <xsl:variable name="rewrite-state" select="/root/page/displayMode = 'viewer' or $param-state"/>
  398. <!-- user and session -->
  399. <xsl:variable name="user-id" select="xtsext:web64encode( string( /root/session/param[@name = 'e_hp'] ), false() )"/>
  400. <xsl:variable name="user-name" select="/root/session/param[@name = 'e_user']"/>
  401. <xsl:variable name="user-agent" select="/root/http/param[@name = 'HTTP_USER_AGENT']"/>
  402. <xsl:variable name="content-locale" select="/root/user/param[@name = 'contentLocale']"/>
  403. <xsl:variable name="product-locale" select="/root/user/param[@name = 'productLocale']"/>
  404. <xsl:template match="/">
  405. <xts:sequence>
  406. <!-- save copy of new state-id for save to session -->
  407. <xsl:if test="$rewrite-state and not($state-id)">
  408. <xts:append select="/root/state">
  409. <guid>
  410. <xsl:value-of select="concat('ID:', $guid)"/>
  411. </guid>
  412. </xts:append>
  413. </xsl:if>
  414. <xts:append>
  415. <assembler>
  416. <soap:request provider="assembler" responseEnvelope="false" option="xml-part">
  417. <xts:param name="baseURL">
  418. <xsl:value-of select="$base-url"/>
  419. </xts:param>
  420. <xts:param name="backURL">
  421. <xsl:value-of select="$backURL"/>
  422. </xts:param>
  423. <xts:param name="backTemplate">
  424. <xsl:value-of select="$backTemplate"/>
  425. </xts:param>
  426. <xts:param name="resourceURL">
  427. <xsl:value-of select="$resource-url"/>
  428. </xts:param>
  429. <xts:param name="portletInstanceKey">
  430. <xsl:value-of select="$cps-portlet"/>
  431. </xts:param>
  432. <xts:param name="resourceInstance">
  433. <xsl:value-of select="$guid"/>
  434. </xts:param>
  435. <xts:param name="rewriteState">
  436. <xsl:value-of select="$rewrite-state"/>
  437. </xts:param>
  438. <xts:param name="stateID">
  439. <xsl:choose>
  440. <xsl:when test="$state-id">
  441. <xsl:value-of select="$state-id"/>
  442. </xsl:when>
  443. <xsl:when test="$rewrite-state = 'true'">
  444. <xsl:value-of select="concat('ID:', $guid)"/>
  445. </xsl:when>
  446. </xsl:choose>
  447. </xts:param>
  448. <asm:getPagelet xmlns:asm="http://developer.cognos.com/schemas/cps/asm/assembler/1/">
  449. <cps:path>
  450. <xsl:value-of select="$cps-path"/>
  451. </cps:path>
  452. <!-- packageContext -->
  453. <xsl:copy-of select="$package-context"/>
  454. <!-- pageletContext -->
  455. <xsl:copy-of select="$pagelet-context"/>
  456. <!-- portalContext -->
  457. <cps:portalContext>
  458. <cps:portalAgent>cognos</cps:portalAgent>
  459. <cps:param name="webContentURL">
  460. <xts:queryValue select="string(/root/http/param[@name='WEB_CONTENT_ROOT'])"/>
  461. </cps:param>
  462. <!--parse request type from incoming request-->
  463. <cps:param name="gatewayURL">
  464. <xsl:value-of select="$request-url"/>
  465. </cps:param>
  466. </cps:portalContext>
  467. <!-- userContext -->
  468. <cps:userContext>
  469. <cps:userContextKey>
  470. <xsl:value-of select="$user-id"/>
  471. </cps:userContextKey>
  472. <cps:userName>
  473. <xsl:value-of select="$user-name"/>
  474. </cps:userName>
  475. <cps:preferences>
  476. <xsl:for-each select="/root/user/param">
  477. <cps:param name="{ @name }">
  478. <xsl:value-of select="."/>
  479. </cps:param>
  480. </xsl:for-each>
  481. </cps:preferences>
  482. </cps:userContext>
  483. <!-- cps:interaction -->
  484. <xsl:if test="($wsrp-urlType = 'blockingAction' or $wsrp-urlType = 'render') and not($cps-portlet = '') or /root/env/param[@name='refresh']">
  485. <cps:interaction>
  486. <xsl:choose>
  487. <xsl:when test="/root/env/param[@name='refresh']">
  488. <cps:param name="cps-event">name=fragment.refresh</cps:param>
  489. </xsl:when>
  490. <xsl:otherwise>
  491. <cps:param name="wsrp-portletInstanceKey">
  492. <xsl:value-of select="$cps-portlet"/>
  493. </cps:param>
  494. <xsl:for-each select="/root/env/param[not(contains($params-excluded, concat(' ', @name, ' ')))]">
  495. <cps:param name="{ @name }">
  496. <xsl:choose>
  497. <xsl:when test="@format = 'encrypted'">
  498. <xts:decrypt>
  499. <xts:param name="encode">xml</xts:param>
  500. <xts:param name="provider">cognos.cam</xts:param>
  501. <xts:param name="source">
  502. <xsl:value-of select="."/>
  503. </xts:param>
  504. </xts:decrypt>
  505. </xsl:when>
  506. <xsl:otherwise>
  507. <xsl:value-of select="."/>
  508. </xsl:otherwise>
  509. </xsl:choose>
  510. </cps:param>
  511. </xsl:for-each>
  512. </xsl:otherwise>
  513. </xsl:choose>
  514. </cps:interaction>
  515. </xsl:if>
  516. <!-- pageletParams -->
  517. <cps:pageletParams>
  518. <xsl:variable name="content-validator" select="string(/root/page/cache/contentValidator)"/>
  519. <xsl:variable name="validator">
  520. <xsl:if test="$content-validator != '' and string(/root/page/cache/ccETagUsable) = 'true'">
  521. <xsl:value-of select="$content-validator"/>
  522. </xsl:if>
  523. </xsl:variable>
  524. <!-- Add the options element with a cache validator -->
  525. <cps:validateTag>
  526. <xsl:value-of select="$validator"/>
  527. </cps:validateTag>
  528. <cps:userAgent>
  529. <xsl:value-of select="$user-agent"/>
  530. </cps:userAgent>
  531. <xsl:choose>
  532. <xsl:when test="$m_pagemode = 'view'">
  533. <cps:pageletMode>cps:view</cps:pageletMode>
  534. </xsl:when>
  535. <xsl:when test="$m_pagemode = 'preview'">
  536. <cps:pageletMode>cps:preview</cps:pageletMode>
  537. </xsl:when>
  538. <xsl:when test="$m_pagemode = 'edit'">
  539. <cps:pageletMode>cps:edit</cps:pageletMode>
  540. </xsl:when>
  541. </xsl:choose>
  542. <cps:locales>
  543. <xsl:value-of select="$content-locale"/>
  544. </cps:locales>
  545. <xsl:if test="$content-locale != $product-locale">
  546. <cps:locales>
  547. <xsl:value-of select="$product-locale"/>
  548. </cps:locales>
  549. </xsl:if>
  550. <cps:mimeTypes>text/html</cps:mimeTypes>
  551. </cps:pageletParams>
  552. </asm:getPagelet>
  553. </soap:request>
  554. <xsl:if test="contains(string(/root/http/param[@name='HTTP_USER_AGENT']) , 'MSIE')">
  555. <msie/>
  556. </xsl:if>
  557. </assembler>
  558. </xts:append>
  559. </xts:sequence>
  560. </xsl:template>
  561. <pf:serialize-xml/>
  562. </xsl:stylesheet>
  563. </xts:block>
  564. <!-- validator - handle the validator tag -->
  565. <!-- ============================================================================= -->
  566. <xts:block type="exec" mode="interpret" processor="XML"
  567. id="304"
  568. dependency="getPortalPages getPagelet"
  569. condition=".[/root/page/cache/ccETagUsable = 'true' and ((string(/root/cmContent/*[local-name() = 'queryResponse']/*[local-name() = 'validator']) != '' and string(/root/cmContent/*[local-name() = 'queryResponse']/*[local-name() = 'validator']) = /root/page/cache/contentValidator) or string(/root/assembler/*[local-name() = 'getPageletResponse']/*[local-name() = 'pageletMarkup']/*[local-name() = 'useCachedMarkup']) = 'true')]"
  570. mandatory="false">
  571. <xts:sequence xmlns:xos="http://developer.cognos.com/schemas/xts/output/">
  572. <xts:append select="/root/output">
  573. <xos:statusCode xmlns:xos="http://developer.cognos.com/schemas/xts/output/">304</xos:statusCode>
  574. <xos:part>
  575. <xos:entityHeader>
  576. <xos:param name="ETag"><xts:queryValue select="concat(/root/page/cache/ccETag,':',/root/page/cache/contentValidator)"/></xos:param>
  577. <xos:param name="Content-Length">0</xos:param>
  578. <xos:param name="Cache-Control">must-revalidate</xos:param>
  579. </xos:entityHeader>
  580. </xos:part>
  581. </xts:append>
  582. </xts:sequence>
  583. </xts:block>
  584. <!--
  585. ===============================================================================================
  586. get_advanced_settings - get advanced settings
  587. ===============================================================================================
  588. -->
  589. <xts:block id="get_advanced_settings" type="exec" processor="XSLT" mandatory="false" mode="interpret">
  590. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  591. <xsl:template match="/">
  592. <xts:sequence>
  593. <xts:append>
  594. <advancedSettings>
  595. <xts:function name="getConfiguration">
  596. <xts:param name="portal.disablecc"/>
  597. </xts:function>
  598. </advancedSettings>
  599. </xts:append>
  600. </xts:sequence>
  601. </xsl:template>
  602. </xsl:stylesheet>
  603. </xts:block>
  604. <!-- ================================================ -->
  605. <!-- ccResponse -->
  606. <!-- ================================================ -->
  607. <!--
  608. generate response
  609. if search request
  610. render search page
  611. else
  612. render main page
  613. -->
  614. <!-- ================================================ -->
  615. <xts:block type="exec" mode="interpret" processor="XSLT"
  616. id="ccResponse"
  617. dependency="304 classNames get_advanced_settings"
  618. condition=".[not(string(/root/output/*[local-name() = 'statusCode']) = '304')]"
  619. nodelist="env, page, search, assembler, session, objectClass, advancedSettings, http">
  620. <xsl:stylesheet version="1.0"
  621. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  622. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  623. xmlns:cps="http://developer.cognos.com/schemas/cps/asm/objects/1/"
  624. xmlns:xos="http://developer.cognos.com/schemas/xts/output/"
  625. xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  626. xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
  627. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  628. xmlns:nav="http://developer.cognos.com/schemas/cps/navigation/1/"
  629. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  630. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
  631. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  632. xmlns:asm="http://developer.cognos.com/schemas/cps/asm/assembler/1/"
  633. exclude-result-prefixes="cm cps xos SOAP-ENV SOAP-ENC xsi bus send xtsext">
  634. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  635. <xsl:variable name="asm-redirect" select="/root/assembler/asm:getPageletResponse/cps:redirectURL"/>
  636. <xsl:variable name="asm-remote" select="/root/env/param[@name = 'asm-remote']"/>
  637. <xsl:template match="/">
  638. <xsl:choose>
  639. <xsl:when test="$asm-remote">
  640. <xsl:call-template name="remote"/>
  641. </xsl:when>
  642. <xsl:when test="$asm-redirect">
  643. <xsl:call-template name="redirect"/>
  644. </xsl:when>
  645. <xsl:otherwise>
  646. <xsl:call-template name="render-page"/>
  647. </xsl:otherwise>
  648. </xsl:choose>
  649. </xsl:template>
  650. <xsl:template name="render-page">
  651. <xsl:variable name="gateway" select="/root/http/param[@name = 'SCRIPT_NAME']"/>
  652. <xts:sequence>
  653. <xts:append select="/root/output">
  654. <xsl:variable name="disableCC" select="/root/*[local-name()='advancedSettings']/*[local-name()='configuration']/*[local-name()='property' and @name='portal.disablecc']"/>
  655. <xsl:choose>
  656. <xsl:when test="not($disableCC='false')">
  657. <xos:part>
  658. <xos:entityBody>
  659. <html>
  660. <head>
  661. <meta http-equiv="refresh">
  662. <xsl:attribute name="content">0; URL=<xsl:value-of select="concat(xtsext:substringBeforeLast(xtsext:substringBeforeLast($gateway,'/'),'/'), '/')"/></xsl:attribute>
  663. </meta>
  664. </head>
  665. </html>
  666. </xos:entityBody>
  667. <xos:entityHeader>
  668. <xos:param name="Content-Type">text/html; charset=UTF-8</xos:param>
  669. </xos:entityHeader>
  670. </xos:part>
  671. </xsl:when>
  672. <xsl:when test="root/env/param[@name='feed'] = 'rss'">
  673. <xts:transform processor="XSLT" src="portal/cc/gen_rss.xslt" option="part" mimeType="text/xml">
  674. <xts:param name="logicsheet">logicsheets/portal.xsl</xts:param>
  675. <xts:param name="logicsheet">logicsheets/presentation/main/framework.xsl</xts:param>
  676. <xts:param name="logicsheet">logicsheets/rss.xslt</xts:param>
  677. <xts:param name="messageBase">messages/portal.xml</xts:param>
  678. <xts:param name="messageBase">messages/portalRL.xml</xts:param>
  679. <root>
  680. <xsl:choose>
  681. <xsl:when test="root/search/expression or /root/search/navSearchSpec">
  682. <title><xts:string id="IDS_SEARCH"/></title>
  683. </xsl:when>
  684. <xsl:otherwise>
  685. <title><xts:queryNode select="/root/cmContent/*[local-name() = 'queryResponse']/*[local-name() = 'queryReply'][2]/*/*[local-name() = 'defaultName']"/></title>
  686. <description><xts:queryNode select="/root/cmContent/*[local-name() = 'queryResponse']/*[local-name() = 'queryReply'][2]/*/*[local-name() = 'defaultDescription']"/></description>
  687. </xsl:otherwise>
  688. </xsl:choose>
  689. <objs>
  690. <xsl:choose>
  691. <xsl:when test="/root/search/navSearchSpec">
  692. <xts:queryNode select="/root/navContent/*[local-name() = 'searchResponse']/*[local-name() = 'content']/*"/>
  693. </xsl:when>
  694. <xsl:otherwise>
  695. <xts:queryNode select="/root/cmContent/*[local-name() = 'queryResponse']/*[local-name() = 'queryReply'][3]/*"/>
  696. </xsl:otherwise>
  697. </xsl:choose>
  698. </objs>
  699. <xts:queryNode select="/root/http | /root/env | /root/user | /root/system | /root/cmContent | /root/configProps | /root/session | /root/header | /root/credential | /root/cookies | /root/setCookies "/>
  700. </root>
  701. </xts:transform>
  702. </xsl:when>
  703. <xsl:when test="/root/search">
  704. <xts:transform processor="XSLT" src="portal/cc/gen_search_page.xslt" option="part" mimeType="text/html">
  705. <xts:param name="logicsheet">portal/mvc/multi-instance.xsl</xts:param>
  706. <xts:param name="logicsheet">logicsheets/portal.xsl</xts:param>
  707. <xts:param name="logicsheet">portal/cc/search_pagers.xslt</xts:param>
  708. <xts:param name="logicsheet">logicsheets/permissions.xsl</xts:param>
  709. <xts:param name="logicsheet">logicsheets/presentation/main/framework.xsl</xts:param>
  710. <xts:param name="logicsheet">logicsheets/presentation/main/presentation.xsl</xts:param>
  711. <xts:param name="logicsheet">logicsheets/presentation/main/search.xsl</xts:param>
  712. <xts:param name="logicsheet">logicsheets/indextree.xslt</xts:param>
  713. <xts:param name="logicsheet">logicsheets/presentation/layout.xsl</xts:param>
  714. <xts:param name="logicsheet">logicsheets/presentation/dialog/presentation.xsl</xts:param>
  715. <xts:param name="logicsheet">logicsheets/presentation/controls/framework.xsl</xts:param>
  716. <xts:param name="logicsheet">logicsheets/presentation/controls/presentation.xsl</xts:param>
  717. <xts:param name="logicsheet">logicsheets/rss.xslt</xts:param>
  718. <xts:param name="logicsheet">logicsheets/validation.xslt</xts:param>
  719. <xts:param name="logicsheet">logicsheets/presentation/touch_up.xslt</xts:param>
  720. <xts:param name="messageBase">messages/portal.xml</xts:param>
  721. <xts:param name="messageBase">messages/portalRL.xml</xts:param>
  722. <xts:queryNode select="/root"/>
  723. </xts:transform>
  724. </xsl:when>
  725. <xsl:when test="/root/page/type = 'custom'">
  726. <xos:part>
  727. <xos:entityBody>
  728. <xsl:text disable-output-escaping="yes">&lt;![CDATA[&lt;!DOCTYPE html&gt;]]&gt;&#10;</xsl:text>
  729. <html lang="{/root/session/param[@name='productLocale']}">
  730. <!-- check for new backURL -->
  731. <xsl:if test="/root/assembler/backContext/newBack">
  732. <xts:update xmlns:xts="http://developer.cognos.com/schemas/xts/" select="/root/env/param[@name='backURL']" mandatory="true">
  733. <param name="backURL"><xsl:value-of select="/root/assembler/backContext/newBack"/></param>
  734. </xts:update>
  735. </xsl:if>
  736. <xts:transform processor="XSLT" nodelist="http, credential, env, user, system, session, cmContent, upfContent, page, gatewayURI, assembler, tab, portalTabs, configProps" src="portal/cc/gen_head.xslt" option="content" mimeType="text/html">
  737. <xts:param name="logicsheet">logicsheets/portal.xsl</xts:param>
  738. <xts:param name="logicsheet">logicsheets/permissions.xsl</xts:param>
  739. <xts:param name="logicsheet">logicsheets/presentation/main/framework.xsl</xts:param>
  740. <xts:param name="logicsheet">logicsheets/presentation/main/presentation.xsl</xts:param>
  741. <xts:param name="logicsheet">logicsheets/presentation/controls/framework.xsl</xts:param>
  742. <xts:param name="logicsheet">logicsheets/presentation/controls/presentation.xsl</xts:param>
  743. <xts:param name="logicsheet">logicsheets/rss.xslt</xts:param>
  744. <xts:param name="logicsheet">logicsheets/validation.xslt</xts:param>
  745. <xts:param name="logicsheet">logicsheets/presentation/touch_up.xslt</xts:param>
  746. <xts:param name="messageBase">messages/portal.xml</xts:param>
  747. <xts:param name="messageBase">messages/portalRL.xml</xts:param>
  748. </xts:transform>
  749. <body onload="if (window.init) init();" topmargin="3" bottommargin="0" marginheight="3" rightmargin="5" leftmargin="5" marginwidth="3">
  750. <xsl:if test="/root/assembler/msie">
  751. <xsl:attribute name="style">overflow:auto</xsl:attribute>
  752. </xsl:if>
  753. <xts:transform processor="XSLT" nodelist="http, credential, env, user, system, session, cmContent, upfContent, page, gatewayURI, assembler, tab, portalTabs, configProps" src="portal/cc/gen_custom_page.xslt" option="content" mimeType="text/html">
  754. <xts:param name="logicsheet">logicsheets/portal.xsl</xts:param>
  755. <xts:param name="logicsheet">logicsheets/permissions.xsl</xts:param>
  756. <xts:param name="logicsheet">logicsheets/presentation/main/framework.xsl</xts:param>
  757. <xts:param name="logicsheet">logicsheets/presentation/main/presentation.xsl</xts:param>
  758. <xts:param name="logicsheet">logicsheets/presentation/controls/framework.xsl</xts:param>
  759. <xts:param name="logicsheet">logicsheets/presentation/controls/presentation.xsl</xts:param>
  760. <xts:param name="logicsheet">logicsheets/rss.xslt</xts:param>
  761. <xts:param name="logicsheet">logicsheets/validation.xslt</xts:param>
  762. <xts:param name="logicsheet">logicsheets/presentation/touch_up.xslt</xts:param>
  763. <xts:param name="messageBase">messages/portal.xml</xts:param>
  764. <xts:param name="messageBase">messages/portalRL.xml</xts:param>
  765. </xts:transform>
  766. <xos:content refId="{/root/assembler/xos:part/xos:entityBody/@refId}"/>
  767. </body>
  768. </html>
  769. </xos:entityBody>
  770. <xos:entityHeader>
  771. <xos:param name="Content-Type">text/html; charset=UTF-8</xos:param>
  772. </xos:entityHeader>
  773. </xos:part>
  774. </xsl:when>
  775. <xsl:otherwise>
  776. <xts:transform processor="XSLT" nodelist="objectClass, cookies, http, credential, env, user, system, session, cmContent, upfContent, page, gatewayURI, generalConfigSettings, assembler, tab, portalTabs, configProps, mvcSettings" src="portal/cc/gen_page.xslt" option="part" mimeType="text/html">
  777. <xts:param name="logicsheet">portal/mvc/multi-instance.xsl</xts:param>
  778. <xts:param name="logicsheet">portal/mvc/config/configuration.xslt</xts:param>
  779. <xts:param name="logicsheet">logicsheets/portal.xsl</xts:param>
  780. <xts:param name="logicsheet">logicsheets/permissions.xsl</xts:param>
  781. <xts:param name="logicsheet">logicsheets/presentation/main/framework.xsl</xts:param>
  782. <xts:param name="logicsheet">logicsheets/presentation/main/presentation.xsl</xts:param>
  783. <xts:param name="logicsheet">logicsheets/presentation/controls/framework.xsl</xts:param>
  784. <xts:param name="logicsheet">logicsheets/presentation/controls/presentation.xsl</xts:param>
  785. <xts:param name="logicsheet">logicsheets/rss.xslt</xts:param>
  786. <xts:param name="logicsheet">logicsheets/validation.xslt</xts:param>
  787. <xts:param name="logicsheet">logicsheets/presentation/touch_up.xslt</xts:param>
  788. <xts:param name="messageBase">messages/portal.xml</xts:param>
  789. <xts:param name="messageBase">messages/portalRL.xml</xts:param>
  790. </xts:transform>
  791. </xsl:otherwise>
  792. </xsl:choose>
  793. </xts:append>
  794. <xsl:if test="string(/root/page/cache/ccCanCache) = 'true' and string(/root/page/cache/ccETag) != '0'">
  795. <!-- Set the validator to be sent to the browser as an Etag header -->
  796. <xts:append select="/root/output/*[local-name() = 'part']/*[local-name() = 'entityHeader']">
  797. <xos:param name="ETag"><xts:queryValue select="concat(/root/page/cache/ccETag,':',/root/cmContent/*[local-name() = 'queryResponse']/*[local-name() = 'validator'] | /root/assembler/*[local-name() = 'getPageletResponse']/*[local-name() = 'pageletMarkup']/*[local-name() = 'cacheControl']/*[local-name() = 'validateTag'])"/></xos:param>
  798. <xos:param name="Cache-Control">must-revalidate</xos:param>
  799. </xts:append>
  800. </xsl:if>
  801. </xts:sequence>
  802. </xsl:template>
  803. <xsl:template name="redirect">
  804. <xsl:variable name="redirect-page">
  805. <xsl:choose>
  806. <xsl:when test="$asm-redirect = 'page:///back'">
  807. <xsl:value-of select="/root/env/param[@name = 'backURL']"/>
  808. </xsl:when>
  809. <xsl:when test="starts-with($asm-redirect, 'http://')">
  810. <xsl:value-of select="$asm-redirect"/>
  811. </xsl:when>
  812. </xsl:choose>
  813. </xsl:variable>
  814. <xts:sequence>
  815. <xts:append select="/root/output">
  816. <xos:part xmlns:xos="http://developer.cognos.com/schemas/xts/output/">
  817. <xos:entityHeader>
  818. <xos:param name="Content-Type">text/html</xos:param>
  819. </xos:entityHeader>
  820. <xos:entityBody>
  821. <html lang="{/root/session/param[@name='productLocale']}">
  822. <head>
  823. <meta http-equiv="refresh">
  824. <xsl:attribute name="content">0; URL=<xsl:value-of select="$redirect-page"/></xsl:attribute>
  825. </meta>
  826. <title>CPS Redirect</title>
  827. </head>
  828. <body bgcolor="#ffffff"/>
  829. </html>
  830. </xos:entityBody>
  831. </xos:part>
  832. </xts:append>
  833. </xts:sequence>
  834. </xsl:template>
  835. <xsl:template name="remote">
  836. <xts:sequence>
  837. <xts:append select="/root/output">
  838. <xos:part xmlns:xos="http://developer.cognos.com/schemas/xts/output/">
  839. <xos:entityHeader>
  840. <xos:param name="Content-Type">text/xml</xos:param>
  841. </xos:entityHeader>
  842. <xos:entityBody>
  843. <xts:queryNode select="/root/assembler/*[1]/*[local-name() = 'pageletMarkup']"/>
  844. </xos:entityBody>
  845. </xos:part>
  846. </xts:append>
  847. </xts:sequence>
  848. </xsl:template>
  849. </xsl:stylesheet>
  850. </xts:block>
  851. <!--
  852. if cps:pageletContext
  853. if state-id else guid else path
  854. save in session
  855. if state/id
  856. delete state/id from session
  857. -->
  858. <xts:block type="exec" mode="interpret" processor="XSLT"
  859. id="updatesession"
  860. dependency="getPagelet"
  861. condition=".[/root/page/type='custom']"
  862. nodelist="header, env, credential, cookies, setCookies, page, state, assembler"
  863. mandatory="false">
  864. <xts:logicsheet path="logicsheets/portal.xsl"/>
  865. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  866. <xsl:stylesheet version="1.0"
  867. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  868. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  869. xmlns:cps="http://developer.cognos.com/schemas/cps/asm/objects/1/"
  870. xmlns:xos="http://developer.cognos.com/schemas/xts/output/"
  871. xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  872. xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
  873. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  874. xmlns:nav="http://developer.cognos.com/schemas/cps/navigation/1/"
  875. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  876. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
  877. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  878. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  879. xmlns:asm="http://developer.cognos.com/schemas/cps/asm/assembler/1/"
  880. exclude-result-prefixes="cm cps xos SOAP-ENV SOAP-ENC xsi bus send xtsext pf asm">
  881. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  882. <xsl:variable name="asm-update" select="/root/assembler/asm:getPageletResponse/cps:updateResponse"/>
  883. <pf:sessionpassport/>
  884. <xsl:template match="/">
  885. <xsl:variable name="pageID" select="/root/page/id"/>
  886. <xsl:variable name="state-id" select="/root/state/id"/>
  887. <xsl:variable name="state-guid" select="/root/state/guid"/>
  888. <xsl:variable name="portlet-param" select="/root/env/param[@name = 'm_portlet']"/>
  889. <xsl:variable name="cps-package">
  890. <xsl:choose>
  891. <xsl:when test="$pageID = 'portlet'">
  892. <xsl:value-of select="concat('/', substring-before(substring-after($portlet-param, '/'), '/'))"/>
  893. </xsl:when>
  894. <xsl:otherwise>
  895. <xsl:text>/connection</xsl:text>
  896. </xsl:otherwise>
  897. </xsl:choose>
  898. </xsl:variable>
  899. <xsl:variable name="cps-pagelet">
  900. <xsl:choose>
  901. <xsl:when test="$pageID = 'portlet'">
  902. <xsl:value-of select="concat('/', substring-after(substring-after($portlet-param, '/'), '/'))"/>
  903. </xsl:when>
  904. <xsl:otherwise>
  905. <xsl:value-of select="concat('/', $pageID)"/>
  906. </xsl:otherwise>
  907. </xsl:choose>
  908. </xsl:variable>
  909. <xsl:variable name="cps-path" select="concat($cps-package, $cps-pagelet)"/>
  910. <!-- check for updated session state -->
  911. <xsl:variable name="new-package-context" select="$asm-update/cps:packageContext"/>
  912. <xsl:variable name="new-pagelet-context" select="$asm-update/cps:pageletContext"/>
  913. <xsl:variable name="new-back-context" select="/root/assembler/backContext"/>
  914. <xsl:if test="$new-package-context | $new-pagelet-context | $new-back-context">
  915. <xts:sequence>
  916. <xts:discard>
  917. <xsl:if test="$new-package-context">
  918. <xts:function name="TDSRequest">
  919. <xts:param name="action">set</xts:param>
  920. <xts:param name="session-id"><xsl:value-of select="$passport"/></xts:param>
  921. <xts:param name="map-id"><xsl:value-of select="'portlets'"/></xts:param>
  922. <xts:param name="name"><xsl:value-of select="xtsext:web64encode($cps-package, false())"/></xts:param>
  923. <xts:param name="source">
  924. <xsl:text>&lt;packageContext xmlns="http://developer.cognos.com/schemas/cps/asm/objects/1/" xmlns:cps="http://developer.cognos.com/schemas/cps/asm/objects/1/"&gt;&lt;path&gt;</xsl:text>
  925. <xsl:value-of select="xtsext:xmlencode($cps-package)"/>
  926. <xsl:text>&lt;/path&gt;&lt;state&gt;</xsl:text>
  927. <xsl:value-of select="$new-package-context/cps:state"/>
  928. <xsl:text>&lt;/state&gt;&lt;/packageContext&gt;</xsl:text>
  929. </xts:param>
  930. </xts:function>
  931. </xsl:if>
  932. <xsl:if test="$new-pagelet-context">
  933. <xts:function name="TDSRequest">
  934. <xts:param name="action">set</xts:param>
  935. <xts:param name="session-id"><xsl:value-of select="$passport"/></xts:param>
  936. <xts:param name="map-id"><xsl:value-of select="'portlets'"/></xts:param>
  937. <xts:param name="name">
  938. <xsl:choose>
  939. <xsl:when test="$state-id">
  940. <xsl:value-of select="$state-id"/>
  941. </xsl:when>
  942. <xsl:when test="$state-guid">
  943. <xsl:value-of select="$state-guid"/>
  944. </xsl:when>
  945. <xsl:otherwise>
  946. <xsl:value-of select="xtsext:web64encode($cps-path, false())"/>
  947. </xsl:otherwise>
  948. </xsl:choose>
  949. </xts:param>
  950. <xts:param name="source">
  951. <xsl:text>&lt;pageletContext xmlns="http://developer.cognos.com/schemas/cps/asm/objects/1/" xmlns:cps="http://developer.cognos.com/schemas/cps/asm/objects/1/"&gt;&lt;path&gt;</xsl:text>
  952. <xsl:value-of select="xtsext:xmlencode($cps-path)"/>
  953. <xsl:text>&lt;/path&gt;&lt;state&gt;</xsl:text>
  954. <xsl:value-of select="$new-pagelet-context/cps:state"/>
  955. <xsl:text>&lt;/state&gt;&lt;/pageletContext&gt;</xsl:text>
  956. </xts:param>
  957. </xts:function>
  958. </xsl:if>
  959. <xsl:if test="$new-back-context">
  960. <xts:function name="TDSRequest">
  961. <xts:param name="action">set</xts:param>
  962. <xts:param name="session-id"><xsl:value-of select="$passport"/></xts:param>
  963. <xts:param name="map-id"><xsl:value-of select="'portlets'"/></xts:param>
  964. <xts:param name="name"><xsl:value-of select="$new-back-context/id"/></xts:param>
  965. <xts:param name="source">
  966. <xsl:text>&lt;backURL xmlns=""&gt;</xsl:text>
  967. <xsl:value-of select="xtsext:xmlencode($new-back-context/saveBack)"/>
  968. <xsl:text>&lt;/backURL&gt;</xsl:text>
  969. </xts:param>
  970. </xts:function>
  971. </xsl:if>
  972. </xts:discard>
  973. </xts:sequence>
  974. </xsl:if>
  975. <!-- state has transitioned to in-page, delete version in session -->
  976. <xsl:if test="$state-id and not($new-pagelet-context)">
  977. <xts:sequence>
  978. <xts:discard>
  979. <xts:function name="TDSRequest">
  980. <xts:param name="action">delete</xts:param>
  981. <xts:param name="session-id"><xsl:value-of select="$passport"/></xts:param>
  982. <xts:param name="map-id"><xsl:value-of select="'portlets'"/></xts:param>
  983. <xts:param name="name"><xsl:value-of select="$state-id"/></xts:param>
  984. </xts:function>
  985. </xts:discard>
  986. </xts:sequence>
  987. </xsl:if>
  988. <!-- Dump report portlet state -->
  989. <xsl:if test="/root/env/param[@name='refresh']">
  990. <xts:sequence>
  991. <xts:discard>
  992. <send:request provider="cm">
  993. <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
  994. <cm:delete xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  995. <cm:search>~~/runTimeState[starts-with(@name, '_CPSID_')]</cm:search>
  996. <cm:options recursive="true" force="true"/>
  997. </cm:delete>
  998. </xts:transform>
  999. </send:request>
  1000. </xts:discard>
  1001. </xts:sequence>
  1002. </xsl:if>
  1003. </xsl:template>
  1004. </xsl:stylesheet>
  1005. </xts:block>
  1006. <!-- ================================================ -->
  1007. <!-- Fault Handling -->
  1008. <!-- ================================================ -->
  1009. <!-- generic fault handler for my pages-->
  1010. <xts:block id="generic-fb" type="fault" processor="XSLT" path="portal/faults/generic-fault.xslt"/>
  1011. <xts:block id="cps_fault" processor="XSLT" type="fault">
  1012. <xsl:stylesheet version="1.0"
  1013. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  1014. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  1015. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  1016. xmlns:xos="http://developer.cognos.com/schemas/xts/output/"
  1017. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/">
  1018. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  1019. <xsl:template match="/">
  1020. <cps:pageletMarkup xmlns:cps="http://developer.cognos.com/schemas/cps/asm/objects/1/">
  1021. <cps:markupString>&lt;br&gt;&lt;br&gt;&lt;center&gt;CPS ERROR&lt;/center&gt;</cps:markupString>
  1022. </cps:pageletMarkup>
  1023. </xsl:template>
  1024. </xsl:stylesheet>
  1025. </xts:block>
  1026. <xts:block id="impersonateTenant" path="/portal/tenants/impersonateTenant.xsl" processor="XSLT" type="exec" mode="interpret" condition=".[/root/env/param[@name='impersonateTenantCmd']!='']" mandatory="false">
  1027. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  1028. </xts:block>
  1029. <!-- Fault handler for cogx
  1030. <xts:block id="cogx-fault" type="fault" path="portal/faults/cogx-fault.xslt" processor="XSLT"/>
  1031. -->
  1032. <!-- ================================================ -->
  1033. <!-- Group Edit -->
  1034. <!-- ================================================ -->
  1035. <!--
  1036. "editentries" in the request indicates a copy or a cut operation.
  1037. Therefore, we must save cut or copied entries into a CM clipboard
  1038. -->
  1039. <xts:block processor="XSLT" type="exec" mandatory="false"
  1040. id="groupEdit"
  1041. path="portal/set_clipboard.xml"
  1042. condition=".[/root/env/param[@name='editentries']]">
  1043. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  1044. <xts:logicsheet path="logicsheets/portal.xsl"/>
  1045. </xts:block>
  1046. <!-- Debug
  1047. -->
  1048. <xts:block type="exec" mode="output" processor="XSLT" mandatory="false" mimeType="text/html"
  1049. id="debug"
  1050. condition=".[ /root/env/param[@name='d'] = '1' or /root/session/param[@name='debug'] = '1']"
  1051. dependency="ccResponse">
  1052. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  1053. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dbg="http://developer.cognos.com/schemas/xts/logicsheets/xslt/debug/" exclude-result-prefixes="dbg">
  1054. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
  1055. <dbg:templates/>
  1056. <xsl:template match="/">
  1057. <dbg:dumpxml select="/root"/>
  1058. </xsl:template>
  1059. </xsl:stylesheet>
  1060. </xts:block>
  1061. </xts:morphlet>