framework.xsl 55 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192
  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, 2019
  6. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. -->
  8. <!-- This file defines common variables and templates used in rendering the main view of Cognos Central. -->
  9. <xsl:stylesheet version="1.0"
  10. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  11. xmlns:mf="http://developer.cognos.com/schemas/xts/logicsheets/presentation/main/mf"
  12. xmlns:mt="http://developer.cognos.com/schemas/xts/logicsheets/presentation/main/mt"
  13. xmlns:out="dummy-uri"
  14. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  15. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  16. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  17. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  18. xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
  19. exclude-result-prefixes="mt xtsext bus">
  20. <xsl:output method="xml" encoding="UTF-8" indent="no"/>
  21. <xsl:namespace-alias stylesheet-prefix="out" result-prefix="xsl"/>
  22. <!--
  23. This stylesheet (framework.xsl) consists of the following templates:
  24. mf:variables - generate main page global variables.
  25. mf:tweak-url - modify the url.
  26. mf:main-variables - generate main page variables.
  27. mf:head - render heading.
  28. mf:edit-vars - hidden input tags used for edits.
  29. mf:cmd-vars - hidden input tags used for commands.
  30. mf:common-entry-varaibles - generate entry characteristics variables.
  31. mf:entry-name - generate the entry name.
  32. -->
  33. <!--
  34. Template - mf:variables:
  35. This template is used to generate the common variables that are global to all CC main views.
  36. Operation:
  37. Generate variables.
  38. -->
  39. <xsl:template match="mf:variables">
  40. <xsl:choose>
  41. <xsl:when test="string(./mf:toolsdrillthru)!='true'">
  42. <out:variable name="rootReply" select="/root/cmContent/cm:queryResponse/cm:queryReply[2]"/>
  43. <out:variable name="childReply" select="/root/cmContent/cm:queryResponse/cm:queryReply[3]"/>
  44. <out:variable name="current-class">
  45. <out:value-of select="$rootReply/child::node()/cm:objectClass"/>
  46. </out:variable>
  47. <!-- This var should hold the search path of the current package context if there is one. Otherwise, it is left blank -->
  48. <out:variable name="pkg">
  49. <out:if test="$rootReply/*/cm:ancestors/cm:ancestorInfo">
  50. <out:choose>
  51. <!-- If we are at the root of a package (CM returns / in this case for packageBase) then use the current container path -->
  52. <out:when test=" $current-class = 'package' ">
  53. <out:value-of select="$rootReply/*/cm:searchPath"/>
  54. </out:when>
  55. <!-- Searchpath of the last package in ancestor info or blank -->
  56. <out:otherwise>
  57. <out:value-of select="string($rootReply/*/cm:ancestors/cm:ancestorInfo[./cm:objectClass='package'][last()]/cm:searchPath)"/>
  58. </out:otherwise>
  59. </out:choose>
  60. </out:if>
  61. </out:variable>
  62. <!-- This var should hold the search path of the current folder path. Otherwise, it is left blank -->
  63. <out:variable name="location">
  64. <out:if test="starts-with(string($rootReply/*/cm:searchPath),'/content/') or starts-with(string($rootReply/*/cm:searchPath),'~/folder/') or (starts-with(string($rootReply/*/cm:searchPath),string(key('session-param','e_hp'))) and contains(string($rootReply/*/cm:searchPath),'/folder'))">
  65. <out:value-of select="string($rootReply/*/cm:searchPath)"/>
  66. </out:if>
  67. </out:variable>
  68. </xsl:when>
  69. <xsl:otherwise>
  70. <out:variable name="rootReply" select="/root/path/cm:queryResponse"/>
  71. <out:variable name="childReply" select="/root/content/cm:queryResponse/cm:queryReply"/>
  72. <out:variable name="current-class">
  73. <out:value-of select="string($rootReply/child::node()/cm:objectClass)"/>
  74. </out:variable>
  75. <out:variable name="pkg">
  76. <out:if test="string($rootReply/*/cm:searchPath)!=''">
  77. <out:value-of select="string($rootReply/*/cm:searchPath)"/>
  78. </out:if>
  79. </out:variable>
  80. <out:variable name="location">
  81. <out:if test="string($rootReply/*/cm:searchPath)!=''">
  82. <out:value-of select="string($rootReply/*/cm:searchPath)"/>
  83. </out:if>
  84. </out:variable>
  85. </xsl:otherwise>
  86. </xsl:choose>
  87. <!-- Folder path encoded and ready for GET requests -->
  88. <out:variable name="encodedLocation" select="xtsext:protect(xtsext:urlencode(string($location)),'url','searchPath','getdata')"/>
  89. <!-- Build a list of UI elements that we want to hide from the current user. -->
  90. <out:variable name="ui_black_list">
  91. <!-- System-based list -->
  92. <out:for-each select="key('system-param', 'ui_hide')/*">
  93. <out:variable name="s" select="concat(' ', @show, ' ')"/>
  94. <out:if test="
  95. not (
  96. (contains($s , 'Administrators') and $isAdminUser) or
  97. (contains($s , 'QSUsers') and $userCanUseFullQS) or
  98. (contains($s , 'RSUsers') and $userCanUseFullRS) or
  99. (contains($s , 'Consumers') and $is-named='1') or
  100. (contains($s , 'Anonymous') and $is-named='0') or
  101. (key('system-param', 'ui_groups')/group[contains($s, concat(' ', @id, ' ')) and contains( key('session-param', 'uig'), concat(' ', @id, ' '))])
  102. )">
  103. <out:value-of select="' '"/><out:value-of select="local-name()"/><out:value-of select="' '"/>
  104. </out:if>
  105. </out:for-each>
  106. <!-- Session URL-based list -->
  107. <out:if test="key('session-param', 'ui') != ''">
  108. <out:if test="contains(key('session-param', 'ui'), 'hh')">
  109. <out:value-of select="' CRN_HEADER CC_HEADER CC_VIEW CC_TOOLBAR '"/>
  110. </out:if>
  111. <out:if test="contains(key('session-param', 'ui'), 'h1')">
  112. <out:value-of select="' CRN_HEADER '"/>
  113. </out:if>
  114. <out:if test="contains(key('session-param', 'ui'), 't1')">
  115. <out:value-of select="' CRN_HEADER_TITLE '"/>
  116. </out:if>
  117. <out:if test="contains(key('session-param', 'ui'), 'm1')">
  118. <out:value-of select="' CRN_HEADER_OPTIONS '"/>
  119. </out:if>
  120. <!-- No longer exists in CC UI
  121. <out:if test="contains(key('session-param', 'ui'), 'h2')">
  122. <out:value-of select="' CC_HEADER '"/>
  123. </out:if>
  124. <out:if test="contains(key('session-param', 'ui'), 't2')">
  125. <out:value-of select="' CC_HEADER_TITLE '"/>
  126. </out:if>
  127. <out:if test="contains(key('session-param', 'ui'), 'm2')">
  128. <out:value-of select="' CC_HEADER_MENU '"/>
  129. </out:if>
  130. -->
  131. <out:if test="contains(key('session-param', 'ui'), 'h3')">
  132. <out:value-of select="' CC_VIEW '"/>
  133. </out:if>
  134. <out:if test="contains(key('session-param', 'ui'), 't3')">
  135. <out:value-of select="' CC_VIEW_TABS '"/>
  136. </out:if>
  137. <!-- No longer exists in CC UI
  138. <out:if test="contains(key('session-param', 'ui'), 'm3')">
  139. <out:value-of select="' CC_VIEW_TOOLS '"/>
  140. </out:if>
  141. -->
  142. <out:if test="contains(key('session-param', 'ui'), 'h4')">
  143. <out:value-of select="' CC_TOOLBAR '"/>
  144. </out:if>
  145. <out:if test="contains(key('session-param', 'ui'), 't4')">
  146. <out:value-of select="' CC_TOOLBAR_PATH '"/>
  147. </out:if>
  148. <out:if test="contains(key('session-param', 'ui'), 'm4')">
  149. <out:value-of select="' CC_TOOLBAR_BUTTONS '"/>
  150. </out:if>
  151. </out:if>
  152. <!-- Request URL-based list. Should map the same way as the session URL-based list. -->
  153. <out:if test="key('env-param', 'rui') != ''">
  154. <out:if test="contains(key('env-param', 'rui'), 'hh')">
  155. <out:value-of select="' CRN_HEADER CC_HEADER CC_VIEW CC_TOOLBAR '"/>
  156. </out:if>
  157. <out:if test="contains(key('env-param', 'rui'), 'h1')">
  158. <out:value-of select="' CRN_HEADER '"/>
  159. </out:if>
  160. <out:if test="contains(key('env-param', 'rui'), 't1')">
  161. <out:value-of select="' CRN_HEADER_TITLE '"/>
  162. </out:if>
  163. <out:if test="contains(key('env-param', 'rui'), 'm1')">
  164. <out:value-of select="' CRN_HEADER_OPTIONS '"/>
  165. </out:if>
  166. <!-- No longer exists in CC UI
  167. <out:if test="contains(key('env-param', 'rui'), 'h2')">
  168. <out:value-of select="' CC_HEADER '"/>
  169. </out:if>
  170. <out:if test="contains(key('env-param', 'rui'), 't2')">
  171. <out:value-of select="' CC_HEADER_TITLE '"/>
  172. </out:if>
  173. <out:if test="contains(key('env-param', 'rui'), 'm2')">
  174. <out:value-of select="' CC_HEADER_MENU '"/>
  175. </out:if>
  176. -->
  177. <out:if test="contains(key('env-param', 'rui'), 'h3')">
  178. <out:value-of select="' CC_VIEW '"/>
  179. </out:if>
  180. <out:if test="contains(key('env-param', 'rui'), 't3')">
  181. <out:value-of select="' CC_VIEW_TABS '"/>
  182. </out:if>
  183. <!-- No longer exists in CC UI
  184. <out:if test="contains(key('env-param', 'rui'), 'm3')">
  185. <out:value-of select="' CC_VIEW_TOOLS '"/>
  186. </out:if>
  187. -->
  188. <out:if test="contains(key('env-param', 'rui'), 'h4')">
  189. <out:value-of select="' CC_TOOLBAR '"/>
  190. </out:if>
  191. <out:if test="contains(key('env-param', 'rui'), 't4')">
  192. <out:value-of select="' CC_TOOLBAR_PATH '"/>
  193. </out:if>
  194. <out:if test="contains(key('env-param', 'rui'), 'm4')">
  195. <out:value-of select="' CC_TOOLBAR_BUTTONS '"/>
  196. </out:if>
  197. </out:if>
  198. </out:variable>
  199. <!-- Folder ID is only meaningful in the context of the consumer UI but must be defined globally since it is used to calculate pager state -->
  200. <out:variable name="folderID">
  201. <!-- main page navigation: read the path from CM query not the URI -->
  202. <xsl:if test="@mode = 'main'">
  203. <out:choose>
  204. <out:when test="string($rootReply/*/cm:storeID) != '' and $pageType = 'PFMF'">
  205. <out:value-of select="string($rootReply/*/cm:storeID)"/>
  206. </out:when>
  207. <out:otherwise>
  208. <out:value-of select="key('env-param', 'm_folder')"/>
  209. </out:otherwise>
  210. </out:choose>
  211. </xsl:if>
  212. </out:variable>
  213. <out:variable name="m_path">
  214. <xsl:choose>
  215. <!-- main page navigation: read the path from CM query not the URI -->
  216. <xsl:when test="@mode = 'main'">
  217. <out:value-of select="string($rootReply/*/cm:searchPath)"/>
  218. </xsl:when>
  219. <xsl:otherwise>
  220. <out:if test="key('env-param', 'm_path') and key('env-param', 'm_path') != ''">
  221. <out:value-of select="key('env-param', 'm_path')"/>
  222. </out:if>
  223. </xsl:otherwise>
  224. </xsl:choose>
  225. </out:variable>
  226. <out:variable name="request-url-params">
  227. <out:if test="/root/env/param[@name='rui']">
  228. <out:text/>&amp;rui=<out:value-of select="xtsext:protect(xtsext:urlencode(string(/root/env/param[@name='rui'])),'url','rui','getdata')"/>
  229. </out:if>
  230. </out:variable>
  231. <out:variable name="state-params">
  232. <xsl:choose>
  233. <xsl:when test="@stateParams">
  234. <xsl:attribute name="select">' <xsl:value-of select="@stateParams"/> '</xsl:attribute>
  235. </xsl:when>
  236. <xsl:otherwise>
  237. <xsl:copy-of select="mf:stateParams/child::node()"/>
  238. </xsl:otherwise>
  239. </xsl:choose>
  240. </out:variable>
  241. <!-- URL to get back to this page encapsulating this page's state. -->
  242. <out:variable name="back-url">
  243. <out:value-of select="$gateway"/>?b_action=xts.run&amp;m=<out:value-of select="key('env-param','m')"/>
  244. <out:for-each select="/root/env/param">
  245. <out:if test="contains($state-params, concat(' ', @name, ' '))">
  246. <out:text/>&amp;<out:value-of select="@name"/>=<out:value-of select="xtsext:protect(xtsext:urlencode(string(.)),'url', concat('NAME',@name),'getdata')"/>
  247. </out:if>
  248. </out:for-each>
  249. <!-- Add this bit in the case of consumer UI to pick up the id when the page is generated using a path -->
  250. <xsl:if test="@mode = 'main'">
  251. <out:if test="not(/root/env/param[@name='m_folder']) and $folderID != ''">
  252. <out:text/>&amp;m_folder=<out:value-of select="$folderID"/>
  253. </out:if>
  254. <!--
  255. If we are navigating the personal folder, we add the id to the backurl so we can detect if the user has changed when the back url is invoked.
  256. If, this is the case, then we need to render the new user "my folder" instead of the old user.
  257. -->
  258. <out:if test="$isMFNav">
  259. <out:text/>&amp;mfid=<out:value-of select="$personalRootID"/>
  260. </out:if>
  261. </xsl:if>
  262. </out:variable>
  263. <!-- MVC -->
  264. <out:variable name="mvc-back-url">
  265. <out:variable name="back-url-params" select="substring-after($back-url, '?')"/>
  266. <out:value-of select="$gatewayURI"/>?<out:value-of select="$back-url-params"/>
  267. </out:variable>
  268. <out:variable name="encoded-mvc-back-url">
  269. <out:value-of select="xtsext:protect(xtsext:urlencode(string($mvc-back-url)),'url','url','getdata')"/>
  270. </out:variable>
  271. <!-- BackURL passed to this page. -->
  272. <out:variable name="returnURL" select="string(/root/env/param[@name='backURL'])"/>
  273. <out:variable name="encodedReturnURL" select="xtsext:protect(xtsext:urlencode(string(/root/env/param[@name='backURL'])),'url','url','getdata')"/>
  274. <out:variable name="gatewayURI" select="/root/gatewayURI/configuration/property[@name='gateway']"/>
  275. <!-- URL to get back to this page from S7 (don't use protection) -->
  276. <out:variable name="s7-back-url">
  277. <out:value-of select="'?b_action=xts.run&amp;m='"/><out:value-of select="key('env-param','m')"/>
  278. <out:for-each select="/root/env/param">
  279. <out:if test="contains($state-params, concat(' ', @name, ' '))">
  280. <out:text/>&amp;<out:value-of select="@name"/>=<out:value-of select="xtsext:urlencode(string(.))"/>
  281. </out:if>
  282. </out:for-each>
  283. <!-- Add this bit in the case of consumer UI to pick up the id when the page is generated using a path -->
  284. <xsl:if test="@mode = 'main'">
  285. <out:if test="not(/root/env/param[@name='m_folder']) and $folderID != ''">
  286. <out:text/>&amp;m_folder=<out:value-of select="$folderID"/>
  287. </out:if>
  288. </xsl:if>
  289. </out:variable>
  290. <out:variable name="encoded-back-url">
  291. <out:value-of select="xtsext:protect(xtsext:urlencode(string($back-url)),'url','url','getdata')"/>
  292. </out:variable>
  293. <!-- Series 7-destined back url -->
  294. <out:variable name="encoded-s7-back-url">
  295. <out:value-of select="xtsext:urlencode(concat(string(/root/system/param[@name='series7']/back-prefix),string($gateway),string($s7-back-url)))"/>
  296. </out:variable>
  297. <out:variable name="ppw-to-cc">
  298. <out:variable name="states">
  299. <out:for-each select="/root/env/param">
  300. <out:if test="contains($state-params, concat(' ', @name, ' '))">
  301. <out:text>&lt;param name="</out:text>
  302. <out:value-of select="@name"/>
  303. <out:text>"></out:text>
  304. <out:value-of select="xtsext:xmlencode(string(.))"/>
  305. <out:text>&lt;/param></out:text>
  306. </out:if>
  307. </out:for-each>
  308. </out:variable>
  309. <out:value-of select="xtsext:cafaction( concat('sign_wrap_setpassportid_', $passport), xtsext:web64encode(string($states), true()))"/>
  310. </out:variable>
  311. <out:variable name="encodedPPBack">
  312. <out:if test="/root/page/type != 'custom'">
  313. <out:choose>
  314. <out:when test="/root/system/param[@name='pp-prefix']='true'">
  315. <out:value-of select="xtsext:urlencode(string($gatewayURI))"/>
  316. </out:when>
  317. <out:otherwise>
  318. <out:value-of select="xtsext:urlencode(string($gateway))"/>
  319. </out:otherwise>
  320. </out:choose>
  321. <out:value-of select="xtsext:urlencode( string(concat('?b_action=xts.run&amp;m=',string(key('env-param','m')),'&amp;ccstate=' )) )"/><out:value-of select="string($ppw-to-cc)"/>
  322. </out:if>
  323. </out:variable>
  324. <out:variable name="javascript-encodedPP8Back">
  325. <out:if test="/root/page/type != 'custom'">
  326. <out:value-of select="xtsext:javascriptencode(string($gateway))"/>
  327. <out:value-of select="xtsext:javascriptencode( string(concat('?b_action=xts.run&amp;m=',string(key('env-param','m')),'&amp;ccstate=' )) )"/><out:value-of select="string($ppw-to-cc)"/>
  328. </out:if>
  329. </out:variable>
  330. <out:variable name="encodedPP8Back">
  331. <out:if test="/root/page/type != 'custom'">
  332. <out:value-of select="xtsext:urlencode(string($gateway))"/>
  333. <out:value-of select="xtsext:urlencode( string(concat('?b_action=xts.run&amp;m=',string(key('env-param','m')),'&amp;ccstate=' )) )"/><out:value-of select="string($ppw-to-cc)"/>
  334. </out:if>
  335. </out:variable>
  336. <out:variable name="s7gateway" select="/root/system/param[@name='series7']/gateway"/>
  337. <out:variable name="default-xss-chars">&lt;&apos;&quot;&gt;</out:variable>
  338. <out:variable name="isXSSCheckingOn" select="$default-xss-chars != xtsext:protect($default-xss-chars,'','userData','getdata')"/>
  339. <!-- view modes in CC navigation and search -->
  340. <!--
  341. *
  342. * portal.navigationView = {detailedlist|newspaper}
  343. * default: detailedlist
  344. * Note: newspaper mode is being deprecated!
  345. *
  346. -->
  347. <out:variable name="portal.navigationView" select="string(/root/configProps/param[@name='cc.nav']/property[@name='portal.navigationView'])"/>
  348. <out:variable name="defaultNavigationView">
  349. <out:choose>
  350. <out:when test="key('session-param', 'displayMode') = 'detail' and $portal.navigationView='newspaper'">newspaper</out:when>
  351. <out:otherwise>
  352. <out:value-of select="key('session-param', 'displayMode')"/>
  353. </out:otherwise>
  354. </out:choose>
  355. </out:variable>
  356. </xsl:template>
  357. <!--
  358. Template - mf:tweak-url:
  359. This template is used to generate the tweak-url template.
  360. Operation:
  361. Tweaks a url.
  362. -->
  363. <xsl:template match="mf:tweak-url">
  364. <out:template name="tweak-url">
  365. <out:param name="old-url"/>
  366. <out:param name="param-name"/>
  367. <out:param name="new-value"/>
  368. <out:variable name="unique-name" select="concat('&amp;', $param-name,'=')"/>
  369. <out:choose>
  370. <out:when test="contains($old-url, $unique-name)">
  371. <out:variable name="lastPart" select="substring-after(substring-after($old-url, $unique-name), '&amp;')"/>
  372. <out:value-of select="concat(substring-before($old-url, $unique-name), $unique-name, $new-value)"/>
  373. <out:if test="$lastPart != ''">
  374. <out:value-of select="concat('&amp;', $lastPart)"/>
  375. </out:if>
  376. </out:when>
  377. <out:otherwise>
  378. <out:value-of select="concat($old-url, $unique-name, $new-value)"/>
  379. </out:otherwise>
  380. </out:choose>
  381. </out:template>
  382. </xsl:template>
  383. <!--
  384. Template - mf:variables:
  385. This template is used to generate the common variables that are global to ccentral.
  386. Operation:
  387. Generate variables.
  388. -->
  389. <xsl:template match="mf:main-variables">
  390. <out:variable name="mname" select="'cc.xts'"/>
  391. <!-- env navigation info -->
  392. <out:variable name="m_folder" select="string(key('env-param', 'm_folder'))"/>
  393. <out:variable name="m_folder2" select="string(key('env-param', 'm_folder2'))"/>
  394. <out:variable name="m_nbid2" select="string(key('env-param', 'm_nbid2'))"/>
  395. <out:variable name="m_nbid" select="string(key('env-param', 'm_nbid'))"/>
  396. <out:variable name="nbid" select="substring-after($m_nbid, '-')"/>
  397. <!-- Folder navigation info -->
  398. <out:variable name="publicRootID" select="key('session-param', 'prootid')"/>
  399. <out:variable name="personalRootID" select="key('session-param', 'mrootid')"/>
  400. <!-- Flag PF navigation. We are navigating PF if:
  401. 1- "content" object id is in the ancestors tree of the current folder
  402. 2- At the root of PF no ancestor info.), the id of the root = id of /content
  403. 3- Navigation Upfront "newsIndex tree
  404. -->
  405. <out:variable name="isPFNav" select="($rootReply/*/cm:ancestors/cm:ancestorInfo[cm:storeID = $publicRootID] or ($rootReply/*/cm:storeID = $publicRootID) or starts-with($m_nbid, 'p')) and $pageType != 'customsearch'"/>
  406. <!-- Flag MF navigation in the same way -->
  407. <out:variable name="isMFNav" select="($rootReply/*/cm:ancestors/cm:ancestorInfo[cm:storeID = $personalRootID] or ($rootReply/*/cm:storeID = $personalRootID) or starts-with($m_nbid, 'm')) and $pageType != 'customsearch'"/>
  408. <!-- MVC -->
  409. <out:variable name="mvc-remotePFNav" select="$rootReply/*/cm:launchableType = 'application/vnd.ibm.cognos.instance' and $isPFNav"/>
  410. <out:variable name="mvc-remoteMFNav" select="$rootReply/*/cm:launchableType = 'application/vnd.ibm.cognos.instance' and $isMFNav"/>
  411. <out:variable name="mvc-remoteNav" select="$mvc-remotePFNav or $mvc-remoteMFNav"/>
  412. <!-- <out:variable name="searchPathStoreID" select="$rootReply/*/cm:storeID"/> -->
  413. <out:variable name="searchPath" select="$rootReply/*/cm:searchPath"/>
  414. <out:variable name="isRootFolder" select="$folderID = $publicRootID or $folderID = $personalRootID"/>
  415. <out:variable name="showingUPF" select="(/root/upfContent/cm:queryResponse) or $m_nbid != ''"/>
  416. <!-- Tab navigation info -->
  417. <out:variable name="portalPages" select="/root/cmContent/cm:queryResponse/cm:queryReply[1]/cm:runTimeState/cm:portalTabs"/>
  418. <out:variable name="asm-response" select="/root/assembler/*[1]"/>
  419. <out:variable name="pageInfo" select="/root/page"/><!-- This is the page information used to get content for this view -->
  420. <out:variable name="pageType" select="string($pageInfo/type)"/><!-- PFMF | custom -->
  421. <out:variable name="displayMode" select="string($pageInfo/displayMode)"/><!-- viewer | portal -->
  422. <out:variable name="pageID">
  423. <out:choose>
  424. <!--An explicit page id was specified in the request context -->
  425. <out:when test="$pageInfo/id != ''"><out:value-of select="$pageInfo/id"/></out:when>
  426. <out:when test="$pageType = 'PFMF' and $isPFNav"><out:value-of select="key('session-param', 'prootid')"/></out:when>
  427. <out:when test="$pageType = 'PFMF' and $isMFNav"><out:value-of select="key('session-param', 'mrootid')"/></out:when>
  428. </out:choose>
  429. </out:variable>
  430. <out:variable name="javascriptescapedPageID" select="xtsext:javascriptencode($pageID)"/>
  431. <out:variable name="isPersonalPortalPage" select="$pageID != '' and $portalPages/*[cm:storeID = $pageID]"/>
  432. <out:variable name="isSingleTabRequest" select="$pageID != '' and not($isPersonalPortalPage) and $displayMode = 'portal'"/>
  433. <out:variable name="isSinglePageRequest" select="$pageID != '' and $displayMode = 'viewer'"/>
  434. <!--
  435. Point to the node where we can generically read page properties
  436. ** Does not apply when showing PF/MF on their OWN **
  437. -->
  438. <out:variable name="pageProperties">
  439. <out:choose>
  440. <out:when test="/root/page/type = 'custom' and ($isSingleTabRequest or $isSinglePageRequest)">
  441. <out:variable name="object-class">
  442. <out:choose>
  443. <out:when test="/root/page/id = 'portlet'">portlet</out:when>
  444. <out:otherwise>pagelet</out:otherwise>
  445. </out:choose>
  446. </out:variable>
  447. <out:variable name="object-id" select="$asm-response/cps:id"/>
  448. <out:variable name="object-path" select="$asm-response/cps:path"/>
  449. <out:variable name="object-name" select="$asm-response/cps:name"/>
  450. <out:variable name="object-readonly" select="boolean($asm-response/cps:accessRights[. = 'readonly'])"/>
  451. <out:variable name="object-disabled" select="boolean($asm-response/cps:accessRights[. = 'disabled'])"/>
  452. <out:variable name="object-unavailable" select="boolean($asm-response/cps:accessRights[. = 'unavailable'])"/>
  453. <out:if test ="$object-id != ''">
  454. <out:element name="cm:{'{ $object-class }'}" namespace="http://developer.cognos.com/schemas/xts-cm/1/">
  455. <cm:objectClass>
  456. <out:value-of select="$object-class"/>
  457. </cm:objectClass>
  458. <cm:permissions type="xsd:string">
  459. <out:text>execute read</out:text>
  460. <out:if test="not($object-unavailable)"> traverse</out:if>
  461. <out:if test="not($object-readonly)"> write</out:if>
  462. </cm:permissions>
  463. <cm:searchPath type="cm:stringProp">
  464. <out:value-of select="substring-after($object-path, '/path:')"/>
  465. </cm:searchPath>
  466. <cm:defaultName type="cm:tokenProp">
  467. <out:value-of select="$object-name"/>
  468. </cm:defaultName>
  469. <cm:disabled type="cm:booleanProp">
  470. <out:value-of select="$object-disabled"/>
  471. </cm:disabled>
  472. <cm:storeID type="cm:guidProp">
  473. <out:value-of select="$object-id"/>
  474. </cm:storeID>
  475. </out:element>
  476. </out:if>
  477. </out:when>
  478. <out:when test="$isSingleTabRequest and $pageID = key('session-param', 'prootid')">
  479. <content>
  480. <cm:objectClass>content</cm:objectClass>
  481. <cm:searchPath type="cm:stringProp">/content</cm:searchPath>
  482. <cm:defaultName type="cm:tokenProp"><out:value-of select="key('session-param', 'e_proot')"/></cm:defaultName>
  483. <cm:storeID><out:value-of select="key('session-param', 'prootid')"/></cm:storeID>
  484. <cm:disabled>false</cm:disabled> <!-- This is here for show only -->
  485. <cm:permissions>execute read setPolicy traverse write</cm:permissions><!-- This is here for show only -->
  486. </content>
  487. </out:when>
  488. <out:when test="$isSingleTabRequest and $pageID = key('session-param', 'mrootid')">
  489. <folder>
  490. <cm:objectClass>folder</cm:objectClass>
  491. <cm:searchPath type="cm:stringProp"><out:value-of select="key('session-param', 'e_mrootpath')"/></cm:searchPath>
  492. <cm:defaultName type="cm:tokenProp"><out:value-of select="key('session-param', 'e_mroot')"/></cm:defaultName>
  493. <cm:storeID><out:value-of select="key('session-param', 'mrootid')"/></cm:storeID>
  494. <cm:disabled>false</cm:disabled> <!-- This is here for show only -->
  495. <cm:permissions>execute read setPolicy traverse write</cm:permissions><!-- This is here for show only -->
  496. </folder>
  497. </out:when>
  498. <out:otherwise>
  499. <out:copy-of select="$portalPages/*[cm:storeID = $pageID]"/>
  500. </out:otherwise>
  501. </out:choose>
  502. </out:variable>
  503. <!-- Page-specific info. -->
  504. <out:variable name="pagePath" select="string($pageProperties/*/cm:searchPath)"/>
  505. <out:variable name="pageDisabled" select="$pageProperties/*/cm:disabled and $pageProperties/*/cm:disabled = 'true'"/>
  506. <out:variable name="pageCanWrite" select="contains($pageProperties/*/cm:permissions, 'write')"/>
  507. <out:variable name="pageCanRead" select="contains($pageProperties/*/cm:permissions, 'read')"/>
  508. <out:variable name="pageCanTraverse" select="contains($pageProperties/*/cm:permissions, 'traverse')"/>
  509. <out:variable name="pageName" select="string($pageProperties/*/cm:defaultName)"/>
  510. <out:variable name="pageClass" select="string($pageProperties/*/cm:objectClass)"/>
  511. <!-- Page action flags -->
  512. <out:variable name="pageNotFound" select="$pagePath = '' or (/root/assembler and not(/root/assembler/*/*[local-name()='id']))"/>
  513. <out:variable name="canWriteToAccount" select="key('session-param', 'write') = 'true'"/>
  514. <out:variable name="canEditPage" select="$pageType = 'custom' and not($pageNotFound) and $pageCanWrite and $pageCanRead and $pageCanTraverse"/>
  515. <out:variable name="canAddPageToPortal" select="not($isPersonalPortalPage) and not($pageNotFound) and $pageCanTraverse and $pageCanRead and $canWriteToAccount"/>
  516. <out:variable name="baseCCQS">
  517. <out:text/>b_action=xts.run&amp;m=<out:value-of select="xtsext:urlencode(string(key('env-param','m')))"/>
  518. </out:variable>
  519. <out:variable name="home-query-url">
  520. <out:value-of select="$baseCCQS"/>
  521. <!--
  522. Don't save the query string if it exceeds 2048 chars. in length.
  523. Effectivelly only check for 2000 char limit to allow for extra stuff. in the QS.
  524. -->
  525. <out:choose>
  526. <out:when test="$pageType = 'custom'">
  527. <out:choose>
  528. <!-- try for path first -->
  529. <out:when test="string-length(concat($baseCCQS, xtsext:urlencode(string($pagePath)))) &lt; 2000">
  530. <out:text/>&amp;m_tabPath=<out:value-of select="xtsext:urlencode(string($pagePath))"/>
  531. </out:when>
  532. <!-- Revert to id if path is not suitable -->
  533. <out:when test="$pageID != ''">
  534. <out:text/>&amp;m_tab=<out:value-of select="$pageID"/>
  535. </out:when>
  536. <out:otherwise><!-- No valid page context. Don't bother saving anything --></out:otherwise>
  537. </out:choose>
  538. </out:when>
  539. <out:when test="$pageType = 'PFMF'">
  540. <out:choose>
  541. <out:when test="string-length(concat($baseCCQS, xtsext:urlencode(string($searchPath)))) &lt; 2000">
  542. <out:text/>&amp;m_path=<out:value-of select="xtsext:urlencode(string($searchPath))"/>
  543. </out:when>
  544. <out:when test="$folderID != ''">
  545. <out:text/>&amp;m_folder=<out:value-of select="$folderID"/>
  546. </out:when>
  547. <out:otherwise><!-- No valid folder context. Don't bother saving anything --></out:otherwise>
  548. </out:choose>
  549. </out:when>
  550. <out:otherwise><!-- Don't bother adding anything to the base QS. --></out:otherwise>
  551. </out:choose>
  552. </out:variable>
  553. </xsl:template>
  554. <!--
  555. Template - mf:head
  556. -->
  557. <xsl:template match="mf:head">
  558. <!-- Portal core JS -->
  559. <script language="javascript">
  560. var g_PS_skinImageRoot = "<out:value-of select="xtsext:javascriptencode(string($skin_images))"/>";
  561. var g_PS_imageRoot = "<out:value-of select="xtsext:javascriptencode(string($image_root))"/>";
  562. var g_PS_app = "<out:value-of select="xtsext:javascriptencode(string($app))"/>";
  563. var g_PS_USER_productLocale = "<out:value-of select="xtsext:javascriptencode(string($mappedProductLocale))"/>";
  564. var g_PS_PFRootId = "<out:value-of select="xtsext:javascriptencode(string(key('session-param', 'prootid')))"/>";
  565. var g_PS_MFRootId = "<out:value-of select="xtsext:javascriptencode(string(key('session-param', 'mrootid')))"/>";
  566. var g_PS_gateway = "<out:value-of select="xtsext:javascriptencode(string($gateway))"/>";
  567. var g_PS_COGNOSHome = "<out:value-of select="xtsext:javascriptencode(key('system-param', 'COGNOSHome'))"/>";
  568. var g_PS_CCHome = "<out:value-of select="xtsext:javascriptencode(key('system-param', 'CCHome'))"/>";
  569. var g_PS_CCBaseURL = g_PS_gateway + "?" + g_PS_CCHome;
  570. var g_PS_returnURL = "<out:value-of select="xtsext:javascriptencode(string(key('env-param', 'backURL')))"/>";
  571. var g_PS_URLEncodedReturnURL = "<out:value-of select="xtsext:javascriptencode(string($encodedReturnURL))"/>";
  572. var g_PS_backURL = "<out:value-of select="xtsext:javascriptencode(string($back-url))"/>";
  573. var g_PS_URLEncodedBackURL = "<out:value-of select="xtsext:javascriptencode(string($encoded-back-url))"/>";
  574. var g_PS_cmdFormName = "<out:value-of select="xtsext:javascriptencode(string($cmd-form))"/>";
  575. <!-- MVC - Content Reference-->
  576. var g_PS_mvcRemoteFolderContext = null;
  577. <!-- wrapper functions for CC context -->
  578. function g_PS_getObjectContext()
  579. {
  580. return "<out:value-of select="xtsext:javascriptencode(string($pkg))"/>";
  581. }
  582. function g_PS_getFolderContext()
  583. {
  584. return "<out:value-of select="xtsext:javascriptencode(string($location))"/>";
  585. }
  586. function g_PS_getEncodedFolderContext()
  587. {
  588. return "<out:value-of select="xtsext:javascriptencode($encodedLocation)"/>";
  589. }
  590. function g_PS_getWebRoot()
  591. {
  592. return "<out:value-of select="xtsext:javascriptencode($webRoot)"/>";
  593. }
  594. <!-- The following functions are repeated in the controls/framework.xsl to be used in dialogues -->
  595. <!-- Used when need to reset the flyouts for document.onclick -->
  596. <!-- Specify supplimentary functions that need to be run in the otherResizeFunctions attribute -->
  597. function resetOnResize()
  598. {
  599. <out:variable name="otherResizeFunctions"><xsl:value-of select="@otherResizeFunctions"/></out:variable>
  600. <out:if test="string($otherResizeFunctions) != ''">
  601. <out:value-of select="$otherResizeFunctions"/>
  602. </out:if>
  603. flyonresize();
  604. }
  605. <!-- Used when need to reset the flyouts for window.onresize -->
  606. <!-- Specify supplimentary functions that need to be run in the otherClickFunctions attribute -->
  607. function resetOnClick(event)
  608. {
  609. <out:variable name="otherClickFunctions"><xsl:value-of select="@otherClickFunctions"/></out:variable>
  610. <out:if test="string($otherClickFunctions) != ''">
  611. <out:value-of select="$otherClickFunctions"/>
  612. </out:if>
  613. flyonclick(event);
  614. }
  615. </script>
  616. <script language="javascript">
  617. var sParamDelimiter = "<out:value-of select="xtsext:javascriptencode(string(key('system-param', 'delimiters')/@d1))"/>";
  618. var sNameValueDelimiter = "<out:value-of select="xtsext:javascriptencode(string(key('system-param', 'delimiters')/@d2))"/>";
  619. var sCookiePath = "<out:value-of select="xtsext:javascriptencode(string($cookie_path))"/>";
  620. var sCookieDomain = "<out:value-of select="xtsext:javascriptencode(string($cookie_domain))"/>";
  621. var sCookieSecure = "<out:value-of select="xtsext:javascriptencode(string($cookie_secure))"/>";
  622. </script>
  623. <script language="javascript" src="{'{$webcontent}'}/{'{$app}'}/js/cookie_jar.js"/>
  624. <script language="javascript" src="{'{$webcontent}'}/{'{$app}'}/js/CCflyoutMenu.js"/>
  625. <script language="javascript" src="{'{$webcontent}'}/{'{$app}'}/js/cc.js"/>
  626. </xsl:template>
  627. <!--
  628. Template - mf:edit-vars:
  629. This template is used to specify standard form variables for edits.
  630. Operation:
  631. Hidden input tag definitions
  632. -->
  633. <xsl:template match="mf:edit-vars">
  634. <input type="hidden" name="b_action" value="xts.run"/>
  635. <input type="hidden" name="backURL" value="{'{$returnURL}'}"/>
  636. <input type="hidden" name="m_path" value="{'{$m_path}'}"/>
  637. <input type="hidden" name="m" value=""/>
  638. <input type="hidden" name="ifrmcmd" value=""/>
  639. <input type="hidden" name="ps_nav_op" value="submit"/>
  640. <!-- use this to flag a group edit operation -->
  641. <input type="hidden" name="editentries" value=""/>
  642. <input type="hidden" name="errURL" value=""/>
  643. <out:if test="key('session-param', 'e_showTenantInfo')='true'">
  644. <input type="hidden" name="impersonateTenantId" value=""/>
  645. <input type="hidden" name="impersonateTenantCmd" value=""/>
  646. </out:if>
  647. <!-- List of edit vars that are hard-coded on the host morphlet inside of this edit form.
  648. This is a rough way to get at these vars. It is not 100% fool - proof since some form fields can be
  649. coded in such a way that this loop will not pick them up.
  650. -->
  651. <out:variable name="pageVars">
  652. <xsl:for-each select="ancestor::*[local-name() = 'form']/descendant::*[local-name() = 'input' or local-name() = 'select' or local-name() = 'textarea' and not(starts-with(@name , 'checkbox_'))]">
  653. <xsl:value-of select="concat(' ' , @name, ' ' )"/>
  654. </xsl:for-each>
  655. </out:variable>
  656. <!-- List of all edit variables that get inserted into this form before runtime -->
  657. <out:variable name="execludeVars">
  658. <out:value-of select="$pageVars"/><out:value-of select="' b_action backURL m_path m ifrmcmd ps_nav_op editentries impersonateTenantId impersonateTenantCmd '"/>
  659. <xsl:if test="@mf:excludeVars">
  660. <out:text/><xsl:value-of select="concat(@mf:excludeVars, ' ')"/><out:text/>
  661. </xsl:if>
  662. </out:variable>
  663. <!-- Add any "runtime" request parameters so that the state is maintained after this form is submitted. -->
  664. <out:for-each select="/root/env/param[not(starts-with(@name, 'checkbox_')) and not(contains($execludeVars, concat(' ' , @name , ' ' )))]">
  665. <input type="hidden" name="{'{@name}'}" value="{'{.}'}"/>
  666. </out:for-each>
  667. <!-- Insert a cafcontextid if it is needed -->
  668. <out:if test="xtsext:cafaction('get_extendedcontextid', '') = 'true'">
  669. <input type="hidden" name="ui.cafcontextid">
  670. <out:attribute name="value">
  671. <out:value-of select="xtsext:cafaction(concat('get_contextid_settemplatename_mainframeworkxsl_setcomponent_ps_setpassportid_', $passport), '')"/>
  672. </out:attribute>
  673. </input>
  674. </out:if>
  675. </xsl:template>
  676. <!--
  677. Template - mf:cmd-vars:
  678. This template is used to specify standard form variables for commands.
  679. Operation:
  680. Hidden input tag definitions
  681. -->
  682. <xsl:template match="mf:cmd-vars">
  683. <input type="hidden" name="b_action" value="xts.run"/>
  684. <input type="hidden" name="m" value=""/>
  685. <input type="hidden" name="cmd" value=""/>
  686. <input type="hidden" name="m_path" value="{'{$m_path}'}"/>
  687. <input type="hidden" name="m_class" value=""/>
  688. <input type="hidden" name="b_report_type" value=""/>
  689. <input type="hidden" name="m_new_class" value=""/>
  690. <input type="hidden" name="m_classSubtype" value=""/>
  691. <input type="hidden" name="m_name" value=""/>
  692. <input type="hidden" name="m_obj" value=""/>
  693. <input type="hidden" name="m_location" value=""/>
  694. <input type="hidden" name="backURL" value=""/>
  695. <input type="hidden" name="reportLocation" value=""/>
  696. <input type="hidden" name="sharedPagesChanged" value=""/>
  697. <input type="hidden" name="ifrmcmd" value=""/>
  698. <input type="hidden" name="m_selectedPage" value=""/>
  699. <out:if test="key('env-param', 'rui')">
  700. <input type="hidden" name="rui" value="{'{key(&quot;env-param&quot;, &quot;rui&quot;)}'}"/>
  701. </out:if>
  702. <out:if test="key('env-param', 'skin')">
  703. <input type="hidden" name="skin" value="{'{key(&quot;env-param&quot;, &quot;skin&quot;)}'}"/>
  704. </out:if>
  705. <!-- Insert a cafcontextid if it is needed -->
  706. <out:if test="xtsext:cafaction('get_extendedcontextid', '') = 'true'">
  707. <input type="hidden" name="ui.cafcontextid">
  708. <out:attribute name="value">
  709. <out:value-of select="xtsext:cafaction(concat('get_contextid_settemplatename_mainframeworkxsl_setcomponent_ps_setpassportid_', $passport), '')"/>
  710. </out:attribute>
  711. </input>
  712. </out:if>
  713. </xsl:template>
  714. <!-- A collection of handy functions to generate parts for an arbitrary page set -->
  715. <xsl:template match="mf:TabRenderingTemplates">
  716. <!-- Calculates path query string variables to add to the url of a tab -->
  717. <out:template name="buildTabNavigationInfo">
  718. <out:param name="class"/>
  719. <!-- Build the Upfront NewsBox Query string to be used when targeting the "Public Folders" tab". If Series 7 integration is turned off then this will be empty! -->
  720. <out:variable name="upfront_pnb">
  721. <out:choose>
  722. <out:when test="starts-with($m_nbid, 'p-') or starts-with($m_nbid2, 'm-')">
  723. <out:if test="$m_nbid != ''">
  724. <out:value-of select="concat('&amp;m_nbid=', $m_nbid)"/>
  725. </out:if>
  726. <out:if test="$m_nbid2 != ''">
  727. <out:value-of select="concat('&amp;m_nbid2=', $m_nbid2)"/>
  728. </out:if>
  729. </out:when>
  730. <out:when test="starts-with($m_nbid2, 'p-') or starts-with($m_nbid, 'm-')">
  731. <out:if test="$m_nbid2 != ''">
  732. <out:value-of select="concat('&amp;m_nbid=', $m_nbid2)"/>
  733. </out:if>
  734. <out:if test="$m_nbid != ''">
  735. <out:value-of select="concat('&amp;m_nbid2=', $m_nbid)"/>
  736. </out:if>
  737. </out:when>
  738. </out:choose>
  739. </out:variable>
  740. <!-- Build Upfront NewsBox Query string for targeting the "My Folders" tab". If Series 7 integration is turned off then this will be empty!-->
  741. <out:variable name="upfront_mnb">
  742. <out:choose>
  743. <out:when test="starts-with($m_nbid, 'm-') or starts-with($m_nbid2, 'p-')">
  744. <out:if test="$m_nbid != ''">
  745. <out:value-of select="concat('&amp;m_nbid=', $m_nbid)"/>
  746. </out:if>
  747. <out:if test="$m_nbid2 != ''">
  748. <out:value-of select="concat('&amp;m_nbid2=', $m_nbid2)"/>
  749. </out:if>
  750. </out:when>
  751. <out:when test="starts-with($m_nbid2, 'm-') or starts-with($m_nbid, 'p-')">
  752. <out:if test="$m_nbid2 != ''">
  753. <out:value-of select="concat('&amp;m_nbid=', $m_nbid2)"/>
  754. </out:if>
  755. <out:if test="$m_nbid != ''">
  756. <out:value-of select="concat('&amp;m_nbid2=', $m_nbid)"/>
  757. </out:if>
  758. </out:when>
  759. </out:choose>
  760. </out:variable>
  761. <!-- If we are navigation within an Upfront NewsBox then Build Upfront NewsBox Query string (to maintain newsbox navigation state) for targeting the "MWelcome"/"My Pages" tabs. -->
  762. <out:variable name="upfront_nb">
  763. <out:if test="$m_nbid != ''">
  764. <out:value-of select="concat('&amp;m_nbid=', $m_nbid)"/>
  765. </out:if>
  766. <out:if test="$m_nbid2 != ''">
  767. <out:value-of select="concat('&amp;m_nbid2=', $m_nbid2)"/>
  768. </out:if>
  769. </out:variable>
  770. <!-- Folder path (when toggling btwn PF/MF) -->
  771. <out:choose>
  772. <!-- Build a URL to target PF -->
  773. <out:when test="$class = 'content' and ( ($m_folder2 != '' and starts-with($m_folder2, 'p-') ) or $isMFNav)">
  774. <out:if test="substring-after($m_folder2, 'p-') != ''">
  775. <out:text/>&amp;m_folder=<out:value-of select="substring-after($m_folder2, 'p-')"/>
  776. </out:if>
  777. <out:if test="$folderID != ''">
  778. <out:text/>&amp;m_folder2=<out:value-of select="concat('m-', $folderID)"/>
  779. </out:if>
  780. <out:value-of select="$upfront_pnb"/>
  781. </out:when>
  782. <!-- Build a URL to target MF -->
  783. <out:when test="$class = 'folder' and ((starts-with($m_folder2, 'm-') and $m_folder2 != '') or $isPFNav)">
  784. <out:if test="substring-after($m_folder2, 'm-') != ''">
  785. <out:text/>&amp;m_folder=<out:value-of select="substring-after($m_folder2, 'm-')"/>
  786. </out:if>
  787. <out:if test="$folderID != ''">
  788. <out:text/>&amp;m_folder2=<out:value-of select="concat('p-', $folderID)"/>
  789. </out:if>
  790. <out:value-of select="$upfront_mnb"/>
  791. </out:when>
  792. <!-- Nvigating the same tab - no need to switch folder id -->
  793. <out:otherwise>
  794. <out:if test="$folderID != ''">
  795. <out:text/>&amp;m_folder=<out:value-of select="$folderID"/>
  796. </out:if>
  797. <!-- Add folder2 navigation context when navigation into custom pages so we can tell where m_folder points to when we get back to folder navigation tabs. -->
  798. <out:choose>
  799. <out:when test="$m_folder2 = '' and $isMFNav">&amp;m_folder2=p-</out:when>
  800. <out:when test="$m_folder2 = '' and $isPFNav">&amp;m_folder2=m-</out:when>
  801. <out:when test="$m_folder2 != ''">&amp;m_folder2=<out:value-of select="$m_folder2"/></out:when>
  802. </out:choose>
  803. <out:value-of select="$upfront_nb"/>
  804. </out:otherwise>
  805. </out:choose>
  806. </out:template>
  807. <out:template name="genWarningSigns">
  808. <out:param name="pageProp"/>
  809. <out:variable name="warningMessage">
  810. <out:choose>
  811. <out:when test="not($pageProp/cm:objectClass) or $pageProp/cm:objectClass = 'nil'">
  812. <xts:string id="IDS_PAGE_UNAVAILABLE"/>
  813. </out:when>
  814. <out:when test="$pageProp/cm:disabled = 'true'">
  815. <xts:string id="IDS_PAGE_DISABLED"/>
  816. </out:when>
  817. <out:when test="not(contains($pageProp/cm:permissions, 'execute'))">
  818. <xts:string id="IDS_PAGE_NO_ACCESS"/>
  819. </out:when>
  820. </out:choose>
  821. </out:variable>
  822. <out:if test="$warningMessage != ''">
  823. <img style="margin-right:5px;" src="{'{$image_root}'}state_warning.gif" width="11" height="16" border="0" align="absmiddle" title="{'{$warningMessage}'}" alt="{'{$warningMessage}'}"/>
  824. </out:if>
  825. </out:template>
  826. <out:template name="genTabLable">
  827. <out:param name="CMClass"/>
  828. <out:param name="CMName"/>
  829. <out:choose>
  830. <out:when test="$CMClass = 'nil' or $CMClass = ''">
  831. <xts:string id="IDS_PAGE_UNAVAILABLE"/>
  832. </out:when>
  833. <out:otherwise>
  834. <out:value-of select="$CMName"/>
  835. </out:otherwise>
  836. </out:choose>
  837. </out:template>
  838. <out:template name="genTabURL">
  839. <out:param name="pageID"/>
  840. <out:param name="pageClass"/>
  841. <out:value-of select="$gateway"/>?b_action=xts.run&amp;m=<out:value-of select="$app"/>/<out:value-of select="$mname"/>
  842. <out:value-of select="$request-url-params"/>&amp;m_tab=<out:value-of select="$pageID"/>
  843. <out:call-template name="buildTabNavigationInfo">
  844. <out:with-param name="class" select="$pageClass"/>
  845. </out:call-template>
  846. </out:template>
  847. </xsl:template>
  848. <!--
  849. Template - mf:common-entry-varaibles:
  850. This template is used to generate common variables for entries
  851. Operation:
  852. Generate variables.
  853. -->
  854. <xsl:template match="mf:common-entry-varaibles">
  855. <!-- An entry is considered "dangling" if it is:
  856. - a shortcut to a none existent object
  857. - a custom view of a none existent report or query
  858. - a shortcut to a custom view of a none existent report or query
  859. -->
  860. <out:variable name="isDangling" select="(cm:objectClass = 'shortcut' and (cm:target/*/cm:objectClass = 'nil' or cm:target/*/cm:base/*/cm:objectClass = 'nil' or (cm:target/*/cm:base and not(cm:target/*/cm:base/*/cm:objectClass)))) or ((cm:objectClass = 'reportView' or cm:objectClass = 'agentDefinitionView' or cm:objectClass = 'dataMovementTaskAlias' or cm:objectClass = 'powerPlay8ReportView') and (cm:base/*/cm:objectClass = 'nil' or not(cm:base/*/cm:objectClass)))"/>
  861. <!-- Determine the class of the object. If it is a shortcut entry then get the class of the target object. -->
  862. <out:variable name="class">
  863. <out:choose>
  864. <out:when test=" cm:objectClass = 'shortcut' "><out:value-of select="cm:target/*/cm:objectClass[1]"/></out:when>
  865. <out:otherwise><out:value-of select="cm:objectClass"/></out:otherwise>
  866. </out:choose>
  867. </out:variable>
  868. <out:variable name="userInterfaces" select="cm:userInterfaces/cm:uiComponentEnum"/> <!-- this is a node-set -->
  869. <out:variable name="targetUserInterfaces" select="cm:target/*/cm:userInterfaces/cm:uiComponentEnum"/>
  870. <out:variable name="executionFormat">
  871. <out:choose>
  872. <out:when test="( cm:target/*/cm:executionFormat and not( cm:target/*/cm:executionFormat/@nil ) )">
  873. <out:value-of select="cm:target/*/cm:executionFormat"/>
  874. </out:when>
  875. <out:when test="(cm:executionFormat and not( cm:executionFormat/@nil ) )">
  876. <out:value-of select="cm:executionFormat"/>
  877. </out:when>
  878. <out:when test="string(cm:target/*/cm:options/*[cm:name='outputFormat']/cm:value)!=''">
  879. <out:value-of select="string(cm:target/*/cm:options/*[cm:name='outputFormat']/cm:value)"/>
  880. </out:when>
  881. <out:when test="string(cm:options/*[cm:name='outputFormat']/cm:value)!=''">
  882. <out:value-of select="string(cm:options/*[cm:name='outputFormat']/cm:value)"/>
  883. </out:when>
  884. </out:choose>
  885. </out:variable>
  886. <out:variable name="isContainer" select=" key( 'ui-object', string($class))/@container = 'T' "/>
  887. <out:variable name="hasURI" select="concat(cm:uri, cm:target/*/cm:uri)"/>
  888. <out:variable name="effectiveUserCapabilities">
  889. <out:call-template name="calEffectiveObjectCapabilities">
  890. <out:with-param name="capabilities" select="./cm:effectiveUserCapabilities | ./*/*/cm:effectiveUserCapabilities"/>
  891. </out:call-template>
  892. </out:variable>
  893. <out:variable name="action">
  894. <out:call-template name="gen-action">
  895. <out:with-param name="class" select="$class"/>
  896. <out:with-param name="object" select="."/>
  897. <out:with-param name="canExecute" select="$canExecute"/>
  898. <out:with-param name="canRead" select="$canRead"/>
  899. <out:with-param name="canTraverse" select="$canTraverse"/>
  900. <out:with-param name="output_format" select="$output_format"/>
  901. <out:with-param name="userInterfaces" select="$userInterfaces"/>
  902. <out:with-param name="targetUserInterfaces" select="$targetUserInterfaces"/>
  903. <out:with-param name="effectiveUserCapabilities" select="$effectiveUserCapabilities"/>
  904. </out:call-template>
  905. </out:variable>
  906. <out:variable name="hiddenObject" select="cm:hidden"/>
  907. </xsl:template>
  908. <!--
  909. Template - mf:entry-name:
  910. This template is used to generate the entry name.
  911. Operation:
  912. Generate the entry name and hyperlink the name if required.
  913. -->
  914. <xsl:template match="mf:entry-name">
  915. <!-- Only hyperlink the entry if it is:
  916. - not a dangling reference.
  917. - It is a container and the user can traverse it.
  918. - It is a URL to an external web site
  919. - it is a analysis, query, report, a report view or a shortcut to any of these where there is output to view and the user has read access to the base report.
  920. - it is a analysis, query, report, a report view or a shortcut to any of these where there is not output to view and the user has at least execute access.
  921. - it is a reportTemplate to which the user has read access and the user can use Report Studio
  922. -->
  923. <out:variable name="hyperlink">
  924. <out:call-template name="gen-url">
  925. <out:with-param name="canExecute" select="$canExecute"/>
  926. <out:with-param name="canRead" select="$canRead"/>
  927. <out:with-param name="canTraverse" select="$canTraverse"/>
  928. <out:with-param name="output_format" select="$output_format"/>
  929. <xsl:if test="@target='true'">
  930. <out:with-param name="target" select="$target"/>
  931. </xsl:if>
  932. <out:with-param name="class" select="$class"/>
  933. <out:with-param name="userInterfaces" select="$userInterfaces"/>
  934. <xsl:for-each select="param">
  935. <out:with-param name="{@name}"><xsl:value-of select="."/></out:with-param>
  936. </xsl:for-each>
  937. <out:with-param name="targetUserInterfaces" select="$targetUserInterfaces"/>
  938. <xsl:for-each select="param">
  939. <out:with-param name="{@name}"><xsl:value-of select="."/></out:with-param>
  940. </xsl:for-each>
  941. <xsl:choose>
  942. <xsl:when test="@action"><out:with-param name="action" select="'{@action}'"/></xsl:when>
  943. <xsl:otherwise><out:with-param name="action" select="$action"/></xsl:otherwise>
  944. </xsl:choose>
  945. <out:with-param name="isDangling" select="$isDangling"/>
  946. <out:with-param name="isContainer" select="$isContainer"/>
  947. <out:with-param name="canWrite" select="$canWrite"/>
  948. <xsl:if test="@tool='portalAdmin'">
  949. <out:with-param name="url-encoded-id" select="$url-encoded-id"/>
  950. <out:with-param name="canReadParent" select="$parentHasReadPermission"/>
  951. <out:with-param name="navigateUsingID" select="'true'"/>
  952. </xsl:if>
  953. <xsl:if test="@mode = 'search'">
  954. <out:with-param name="isSearch" select="true()"/>
  955. </xsl:if>
  956. <out:with-param name="effectiveUserCapabilities" select="$effectiveUserCapabilities"/>
  957. </out:call-template>
  958. </out:variable>
  959. <out:variable name="defaultName">
  960. <out:value-of select="cm:defaultName"/>
  961. </out:variable>
  962. <out:choose>
  963. <out:when test="$hyperlink !='' ">
  964. <a>
  965. <out:if test="$defaultNavigationView = 'detail'">
  966. <out:attribute name="aria-describedby"><out:text>longdescid_</out:text><out:value-of select="position()"/><out:text>_span</out:text></out:attribute>
  967. </out:if>
  968. <out:choose>
  969. <out:when test="starts-with($hyperlink,'javascript:')">
  970. <out:attribute name="href">
  971. <out:value-of select="'#'"/>
  972. </out:attribute>
  973. <out:attribute name="onclick">
  974. <out:value-of select="$hyperlink"/>
  975. </out:attribute>
  976. </out:when>
  977. <out:otherwise>
  978. <out:attribute name="href">
  979. <out:value-of select="$hyperlink"/>
  980. </out:attribute>
  981. </out:otherwise>
  982. </out:choose>
  983. <xsl:if test="@target='true'">
  984. <out:attribute name="target">
  985. <out:value-of select="$target"/>
  986. </out:attribute>
  987. </xsl:if>
  988. <out:if test="$isBidiEnabled = 'true'">
  989. <out:attribute name="dir">
  990. <out:value-of select="xtsext:getBTD($defaultName, $baseTextDirection, $productLocale)"/>
  991. </out:attribute>
  992. </out:if>
  993. <out:value-of select="$defaultName"/>
  994. </a>
  995. </out:when>
  996. <out:otherwise>
  997. <out:value-of select="xtsext:enforceBTD($defaultName, $baseTextDirection, $productLocale, boolean($isBidiEnabled='true'))"/>
  998. </out:otherwise>
  999. </out:choose>
  1000. <!-- Render the disabled icon if this entry is disabled -->
  1001. <out:choose>
  1002. <out:when test="cm:disabled = 'true'">
  1003. <img height="16" width="16" hspace="4" align="absmiddle" src="{'{$image_root}'}state_disabled.gif">
  1004. <out:attribute name="alt"><xts:string id="IDS_DISABLED"/></out:attribute>
  1005. </img>
  1006. </out:when>
  1007. <out:when test="cm:target/*/cm:disabled = 'true' or cm:base/*/cm:disabled = 'true'">
  1008. <img height="16" width="16" hspace="4" align="absmiddle" src="{'{$image_root}'}state_source_disabled.gif">
  1009. <out:attribute name="alt"><xts:string id="IDS_DISABLED"/></out:attribute>
  1010. </img>
  1011. </out:when>
  1012. </out:choose>
  1013. </xsl:template>
  1014. <xsl:template match="mf:long-description-scripts">
  1015. <out:if test="$defaultNavigationView = 'detail'">
  1016. <script>
  1017. function longdescToggle(id, toggle) {
  1018. if (toggle == "expand") {
  1019. document.getElementById(id + "_collapse").innerHTML = document.getElementById(id).innerHTML;
  1020. var spNodes = document.getElementById(id + "_collapse").getElementsByTagName("span");
  1021. if (spNodes.length > 0){
  1022. spNodes[0].id = id + "_HIDDENCOLLPASEDTHING";
  1023. }
  1024. document.getElementById(id).innerHTML = document.getElementById(id + "_expand").innerHTML;
  1025. } else if (toggle == "collapse") {
  1026. document.getElementById(id).innerHTML = document.getElementById(id + "_collapse").innerHTML;
  1027. }
  1028. var spanNodes = document.getElementById(id).getElementsByTagName("span");
  1029. if (spanNodes.length > 0){
  1030. spanNodes[0].id = id + "_span";
  1031. }
  1032. }
  1033. </script>
  1034. </out:if>
  1035. </xsl:template>
  1036. <xsl:template match="mf:long-description">
  1037. <out:if test="$defaultNavigationView = 'detail'">
  1038. <out:variable name="detailedListViewTruncationSize">
  1039. <out:variable name="ts" select="string(/root/configProps/param[@name='cc.nav']/property[@name='portal.detailedListViewTruncationSize'])"/>
  1040. <out:choose>
  1041. <out:when test="$ts = '' or string(number($ts)) = 'NaN'"><out:value-of select="-1"/></out:when>
  1042. <out:otherwise><out:value-of select="$ts"/></out:otherwise>
  1043. </out:choose>
  1044. </out:variable>
  1045. <out:variable name="isTruncated" select="string-length(cm:defaultDescription) &gt; $detailedListViewTruncationSize and number($detailedListViewTruncationSize) &gt; 0"/>
  1046. <out:variable name="description">
  1047. <out:choose>
  1048. <out:when test="$isTruncated">
  1049. <out:value-of select="substring(cm:defaultDescription,0,$detailedListViewTruncationSize)"/>
  1050. <out:value-of select="substring-before(substring(cm:defaultDescription,$detailedListViewTruncationSize), ' ')"/>
  1051. <out:value-of select="'...'"/>
  1052. </out:when>
  1053. <out:otherwise>
  1054. <out:value-of select="cm:defaultDescription"/>
  1055. </out:otherwise>
  1056. </out:choose>
  1057. </out:variable>
  1058. <out:variable name="dir">
  1059. <out:if test="$isBidiEnabled = 'true'">
  1060. <out:value-of select="xtsext:getBTD(cm:defaultDescription, $baseTextDirection, $productLocale)"/>
  1061. </out:if>
  1062. </out:variable>
  1063. <div id="longdescid_{'{position()}'}" >
  1064. <span id="longdescid_{'{position()}'}_span">
  1065. <out:if test="$dir != ''"><out:attribute name="dir"><out:value-of select="$dir"/></out:attribute></out:if>
  1066. <out:value-of select="$description"/>
  1067. </span>
  1068. <out:if test="$isTruncated">
  1069. <img tabindex="0" role="button" border="0" src="{'{$skin_images}'}prompt_option_expand.gif" aria-expanded="false">
  1070. <out:attribute name="alt"><xts:string id="IDS_DESCRIPTION_EXPAND"/></out:attribute>
  1071. <out:attribute name="title"><xts:string id="IDS_DESCRIPTION_EXPAND"/></out:attribute>
  1072. <out:attribute name="onclick">javascript:longdescToggle('longdescid_<out:value-of select="position()"/>', "expand");</out:attribute>
  1073. <out:attribute name="onkeypress">javascript:if(event.keyCode==13||event.keyCode==32||event.charCode==32)<xsl:text>{</xsl:text>this.onclick(); return false;<xsl:text>}</xsl:text> return true;</out:attribute>
  1074. </img>
  1075. </out:if>
  1076. </div>
  1077. <out:if test="$isTruncated">
  1078. <!-- Holder for full description content -->
  1079. <div id="longdescid_{'{position()}'}_expand" style="display:none">
  1080. <span id="longdescid_{'{position()}'}_expand_span">
  1081. <out:if test="$dir != ''"><out:attribute name="dir"><out:value-of select="$dir"/></out:attribute></out:if>
  1082. <out:value-of select="cm:defaultDescription"/>
  1083. </span>
  1084. <img tabindex="0" role="button" aria-expanded="true" border="0" src="{'{$skin_images}'}prompt_option_collapse.gif">
  1085. <out:attribute name="alt"><xts:string id="IDS_DESCRIPTION_COLLAPSE"/></out:attribute>
  1086. <out:attribute name="title"><xts:string id="IDS_DESCRIPTION_COLLAPSE"/></out:attribute>
  1087. <out:attribute name="onclick">javascript:longdescToggle('longdescid_<out:value-of select="position()"/>', "collapse");</out:attribute>
  1088. <out:attribute name="onkeypress">javascript:if(event.keyCode==13||event.keyCode==32||event.charCode==32)<xsl:text>{</xsl:text>this.onclick(); return false;<xsl:text>}</xsl:text> return true;</out:attribute>
  1089. </img>
  1090. </div>
  1091. <!-- Holder for partial description content -->
  1092. <div id="longdescid_{'{position()}'}_collapse" style="display:none">
  1093. </div>
  1094. </out:if>
  1095. </out:if>
  1096. </xsl:template>
  1097. <xsl:template match="*">
  1098. <xsl:copy>
  1099. <xsl:copy-of select="@*"/>
  1100. <xsl:apply-templates/>
  1101. </xsl:copy>
  1102. </xsl:template>
  1103. </xsl:stylesheet>