1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: ps
- (C) Copyright IBM Corp. 2005, 2019
- US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- -->
- <!-- This file defines common variables and templates used in rendering the main view of Cognos Central. -->
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:mf="http://developer.cognos.com/schemas/xts/logicsheets/presentation/main/mf"
- xmlns:mt="http://developer.cognos.com/schemas/xts/logicsheets/presentation/main/mt"
- xmlns:out="dummy-uri"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:xts="http://developer.cognos.com/schemas/xts/"
- xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
- xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
- xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
- exclude-result-prefixes="mt xtsext bus">
- <xsl:output method="xml" encoding="UTF-8" indent="no"/>
- <xsl:namespace-alias stylesheet-prefix="out" result-prefix="xsl"/>
- <!--
- This stylesheet (framework.xsl) consists of the following templates:
- mf:variables - generate main page global variables.
- mf:tweak-url - modify the url.
- mf:main-variables - generate main page variables.
- mf:head - render heading.
- mf:edit-vars - hidden input tags used for edits.
- mf:cmd-vars - hidden input tags used for commands.
- mf:common-entry-varaibles - generate entry characteristics variables.
- mf:entry-name - generate the entry name.
- -->
- <!--
- Template - mf:variables:
- This template is used to generate the common variables that are global to all CC main views.
- Operation:
- Generate variables.
- -->
- <xsl:template match="mf:variables">
- <xsl:choose>
- <xsl:when test="string(./mf:toolsdrillthru)!='true'">
- <out:variable name="rootReply" select="/root/cmContent/cm:queryResponse/cm:queryReply[2]"/>
- <out:variable name="childReply" select="/root/cmContent/cm:queryResponse/cm:queryReply[3]"/>
- <out:variable name="current-class">
- <out:value-of select="$rootReply/child::node()/cm:objectClass"/>
- </out:variable>
- <!-- This var should hold the search path of the current package context if there is one. Otherwise, it is left blank -->
- <out:variable name="pkg">
- <out:if test="$rootReply/*/cm:ancestors/cm:ancestorInfo">
- <out:choose>
- <!-- If we are at the root of a package (CM returns / in this case for packageBase) then use the current container path -->
- <out:when test=" $current-class = 'package' ">
- <out:value-of select="$rootReply/*/cm:searchPath"/>
- </out:when>
- <!-- Searchpath of the last package in ancestor info or blank -->
- <out:otherwise>
- <out:value-of select="string($rootReply/*/cm:ancestors/cm:ancestorInfo[./cm:objectClass='package'][last()]/cm:searchPath)"/>
- </out:otherwise>
- </out:choose>
- </out:if>
- </out:variable>
- <!-- This var should hold the search path of the current folder path. Otherwise, it is left blank -->
- <out:variable name="location">
- <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'))">
- <out:value-of select="string($rootReply/*/cm:searchPath)"/>
- </out:if>
- </out:variable>
- </xsl:when>
- <xsl:otherwise>
- <out:variable name="rootReply" select="/root/path/cm:queryResponse"/>
- <out:variable name="childReply" select="/root/content/cm:queryResponse/cm:queryReply"/>
- <out:variable name="current-class">
- <out:value-of select="string($rootReply/child::node()/cm:objectClass)"/>
- </out:variable>
- <out:variable name="pkg">
- <out:if test="string($rootReply/*/cm:searchPath)!=''">
- <out:value-of select="string($rootReply/*/cm:searchPath)"/>
- </out:if>
- </out:variable>
- <out:variable name="location">
- <out:if test="string($rootReply/*/cm:searchPath)!=''">
- <out:value-of select="string($rootReply/*/cm:searchPath)"/>
- </out:if>
- </out:variable>
- </xsl:otherwise>
- </xsl:choose>
-
- <!-- Folder path encoded and ready for GET requests -->
- <out:variable name="encodedLocation" select="xtsext:protect(xtsext:urlencode(string($location)),'url','searchPath','getdata')"/>
-
- <!-- Build a list of UI elements that we want to hide from the current user. -->
- <out:variable name="ui_black_list">
- <!-- System-based list -->
- <out:for-each select="key('system-param', 'ui_hide')/*">
- <out:variable name="s" select="concat(' ', @show, ' ')"/>
- <out:if test="
- not (
- (contains($s , 'Administrators') and $isAdminUser) or
- (contains($s , 'QSUsers') and $userCanUseFullQS) or
- (contains($s , 'RSUsers') and $userCanUseFullRS) or
- (contains($s , 'Consumers') and $is-named='1') or
- (contains($s , 'Anonymous') and $is-named='0') or
- (key('system-param', 'ui_groups')/group[contains($s, concat(' ', @id, ' ')) and contains( key('session-param', 'uig'), concat(' ', @id, ' '))])
- )">
- <out:value-of select="' '"/><out:value-of select="local-name()"/><out:value-of select="' '"/>
- </out:if>
- </out:for-each>
-
- <!-- Session URL-based list -->
- <out:if test="key('session-param', 'ui') != ''">
- <out:if test="contains(key('session-param', 'ui'), 'hh')">
- <out:value-of select="' CRN_HEADER CC_HEADER CC_VIEW CC_TOOLBAR '"/>
- </out:if>
- <out:if test="contains(key('session-param', 'ui'), 'h1')">
- <out:value-of select="' CRN_HEADER '"/>
- </out:if>
- <out:if test="contains(key('session-param', 'ui'), 't1')">
- <out:value-of select="' CRN_HEADER_TITLE '"/>
- </out:if>
- <out:if test="contains(key('session-param', 'ui'), 'm1')">
- <out:value-of select="' CRN_HEADER_OPTIONS '"/>
- </out:if>
- <!-- No longer exists in CC UI
- <out:if test="contains(key('session-param', 'ui'), 'h2')">
- <out:value-of select="' CC_HEADER '"/>
- </out:if>
- <out:if test="contains(key('session-param', 'ui'), 't2')">
- <out:value-of select="' CC_HEADER_TITLE '"/>
- </out:if>
- <out:if test="contains(key('session-param', 'ui'), 'm2')">
- <out:value-of select="' CC_HEADER_MENU '"/>
- </out:if>
- -->
- <out:if test="contains(key('session-param', 'ui'), 'h3')">
- <out:value-of select="' CC_VIEW '"/>
- </out:if>
- <out:if test="contains(key('session-param', 'ui'), 't3')">
- <out:value-of select="' CC_VIEW_TABS '"/>
- </out:if>
- <!-- No longer exists in CC UI
- <out:if test="contains(key('session-param', 'ui'), 'm3')">
- <out:value-of select="' CC_VIEW_TOOLS '"/>
- </out:if>
- -->
- <out:if test="contains(key('session-param', 'ui'), 'h4')">
- <out:value-of select="' CC_TOOLBAR '"/>
- </out:if>
- <out:if test="contains(key('session-param', 'ui'), 't4')">
- <out:value-of select="' CC_TOOLBAR_PATH '"/>
- </out:if>
- <out:if test="contains(key('session-param', 'ui'), 'm4')">
- <out:value-of select="' CC_TOOLBAR_BUTTONS '"/>
- </out:if>
- </out:if>
- <!-- Request URL-based list. Should map the same way as the session URL-based list. -->
- <out:if test="key('env-param', 'rui') != ''">
- <out:if test="contains(key('env-param', 'rui'), 'hh')">
- <out:value-of select="' CRN_HEADER CC_HEADER CC_VIEW CC_TOOLBAR '"/>
- </out:if>
- <out:if test="contains(key('env-param', 'rui'), 'h1')">
- <out:value-of select="' CRN_HEADER '"/>
- </out:if>
- <out:if test="contains(key('env-param', 'rui'), 't1')">
- <out:value-of select="' CRN_HEADER_TITLE '"/>
- </out:if>
- <out:if test="contains(key('env-param', 'rui'), 'm1')">
- <out:value-of select="' CRN_HEADER_OPTIONS '"/>
- </out:if>
- <!-- No longer exists in CC UI
- <out:if test="contains(key('env-param', 'rui'), 'h2')">
- <out:value-of select="' CC_HEADER '"/>
- </out:if>
- <out:if test="contains(key('env-param', 'rui'), 't2')">
- <out:value-of select="' CC_HEADER_TITLE '"/>
- </out:if>
- <out:if test="contains(key('env-param', 'rui'), 'm2')">
- <out:value-of select="' CC_HEADER_MENU '"/>
- </out:if>
- -->
- <out:if test="contains(key('env-param', 'rui'), 'h3')">
- <out:value-of select="' CC_VIEW '"/>
- </out:if>
- <out:if test="contains(key('env-param', 'rui'), 't3')">
- <out:value-of select="' CC_VIEW_TABS '"/>
- </out:if>
- <!-- No longer exists in CC UI
- <out:if test="contains(key('env-param', 'rui'), 'm3')">
- <out:value-of select="' CC_VIEW_TOOLS '"/>
- </out:if>
- -->
- <out:if test="contains(key('env-param', 'rui'), 'h4')">
- <out:value-of select="' CC_TOOLBAR '"/>
- </out:if>
- <out:if test="contains(key('env-param', 'rui'), 't4')">
- <out:value-of select="' CC_TOOLBAR_PATH '"/>
- </out:if>
- <out:if test="contains(key('env-param', 'rui'), 'm4')">
- <out:value-of select="' CC_TOOLBAR_BUTTONS '"/>
- </out:if>
- </out:if>
- </out:variable>
-
- <!-- 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 -->
- <out:variable name="folderID">
- <!-- main page navigation: read the path from CM query not the URI -->
- <xsl:if test="@mode = 'main'">
- <out:choose>
- <out:when test="string($rootReply/*/cm:storeID) != '' and $pageType = 'PFMF'">
- <out:value-of select="string($rootReply/*/cm:storeID)"/>
- </out:when>
- <out:otherwise>
- <out:value-of select="key('env-param', 'm_folder')"/>
- </out:otherwise>
- </out:choose>
- </xsl:if>
- </out:variable>
-
- <out:variable name="m_path">
- <xsl:choose>
- <!-- main page navigation: read the path from CM query not the URI -->
- <xsl:when test="@mode = 'main'">
- <out:value-of select="string($rootReply/*/cm:searchPath)"/>
- </xsl:when>
- <xsl:otherwise>
- <out:if test="key('env-param', 'm_path') and key('env-param', 'm_path') != ''">
- <out:value-of select="key('env-param', 'm_path')"/>
- </out:if>
- </xsl:otherwise>
- </xsl:choose>
- </out:variable>
-
- <out:variable name="request-url-params">
- <out:if test="/root/env/param[@name='rui']">
- <out:text/>&rui=<out:value-of select="xtsext:protect(xtsext:urlencode(string(/root/env/param[@name='rui'])),'url','rui','getdata')"/>
- </out:if>
- </out:variable>
- <out:variable name="state-params">
- <xsl:choose>
- <xsl:when test="@stateParams">
- <xsl:attribute name="select">' <xsl:value-of select="@stateParams"/> '</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:copy-of select="mf:stateParams/child::node()"/>
- </xsl:otherwise>
- </xsl:choose>
- </out:variable>
-
- <!-- URL to get back to this page encapsulating this page's state. -->
- <out:variable name="back-url">
- <out:value-of select="$gateway"/>?b_action=xts.run&m=<out:value-of select="key('env-param','m')"/>
- <out:for-each select="/root/env/param">
- <out:if test="contains($state-params, concat(' ', @name, ' '))">
- <out:text/>&<out:value-of select="@name"/>=<out:value-of select="xtsext:protect(xtsext:urlencode(string(.)),'url', concat('NAME',@name),'getdata')"/>
- </out:if>
- </out:for-each>
- <!-- Add this bit in the case of consumer UI to pick up the id when the page is generated using a path -->
- <xsl:if test="@mode = 'main'">
- <out:if test="not(/root/env/param[@name='m_folder']) and $folderID != ''">
- <out:text/>&m_folder=<out:value-of select="$folderID"/>
- </out:if>
- <!--
- 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.
- If, this is the case, then we need to render the new user "my folder" instead of the old user.
- -->
- <out:if test="$isMFNav">
- <out:text/>&mfid=<out:value-of select="$personalRootID"/>
- </out:if>
- </xsl:if>
- </out:variable>
- <!-- MVC -->
- <out:variable name="mvc-back-url">
- <out:variable name="back-url-params" select="substring-after($back-url, '?')"/>
- <out:value-of select="$gatewayURI"/>?<out:value-of select="$back-url-params"/>
- </out:variable>
- <out:variable name="encoded-mvc-back-url">
- <out:value-of select="xtsext:protect(xtsext:urlencode(string($mvc-back-url)),'url','url','getdata')"/>
- </out:variable>
-
- <!-- BackURL passed to this page. -->
- <out:variable name="returnURL" select="string(/root/env/param[@name='backURL'])"/>
- <out:variable name="encodedReturnURL" select="xtsext:protect(xtsext:urlencode(string(/root/env/param[@name='backURL'])),'url','url','getdata')"/>
-
- <out:variable name="gatewayURI" select="/root/gatewayURI/configuration/property[@name='gateway']"/>
- <!-- URL to get back to this page from S7 (don't use protection) -->
- <out:variable name="s7-back-url">
- <out:value-of select="'?b_action=xts.run&m='"/><out:value-of select="key('env-param','m')"/>
- <out:for-each select="/root/env/param">
- <out:if test="contains($state-params, concat(' ', @name, ' '))">
- <out:text/>&<out:value-of select="@name"/>=<out:value-of select="xtsext:urlencode(string(.))"/>
- </out:if>
- </out:for-each>
- <!-- Add this bit in the case of consumer UI to pick up the id when the page is generated using a path -->
- <xsl:if test="@mode = 'main'">
- <out:if test="not(/root/env/param[@name='m_folder']) and $folderID != ''">
- <out:text/>&m_folder=<out:value-of select="$folderID"/>
- </out:if>
- </xsl:if>
- </out:variable>
- <out:variable name="encoded-back-url">
- <out:value-of select="xtsext:protect(xtsext:urlencode(string($back-url)),'url','url','getdata')"/>
- </out:variable>
- <!-- Series 7-destined back url -->
- <out:variable name="encoded-s7-back-url">
- <out:value-of select="xtsext:urlencode(concat(string(/root/system/param[@name='series7']/back-prefix),string($gateway),string($s7-back-url)))"/>
- </out:variable>
-
- <out:variable name="ppw-to-cc">
- <out:variable name="states">
- <out:for-each select="/root/env/param">
- <out:if test="contains($state-params, concat(' ', @name, ' '))">
- <out:text><param name="</out:text>
- <out:value-of select="@name"/>
- <out:text>"></out:text>
- <out:value-of select="xtsext:xmlencode(string(.))"/>
- <out:text></param></out:text>
- </out:if>
- </out:for-each>
- </out:variable>
- <out:value-of select="xtsext:cafaction( concat('sign_wrap_setpassportid_', $passport), xtsext:web64encode(string($states), true()))"/>
- </out:variable>
-
- <out:variable name="encodedPPBack">
- <out:if test="/root/page/type != 'custom'">
- <out:choose>
- <out:when test="/root/system/param[@name='pp-prefix']='true'">
- <out:value-of select="xtsext:urlencode(string($gatewayURI))"/>
- </out:when>
- <out:otherwise>
- <out:value-of select="xtsext:urlencode(string($gateway))"/>
- </out:otherwise>
- </out:choose>
- <out:value-of select="xtsext:urlencode( string(concat('?b_action=xts.run&m=',string(key('env-param','m')),'&ccstate=' )) )"/><out:value-of select="string($ppw-to-cc)"/>
- </out:if>
- </out:variable>
-
- <out:variable name="javascript-encodedPP8Back">
- <out:if test="/root/page/type != 'custom'">
- <out:value-of select="xtsext:javascriptencode(string($gateway))"/>
- <out:value-of select="xtsext:javascriptencode( string(concat('?b_action=xts.run&m=',string(key('env-param','m')),'&ccstate=' )) )"/><out:value-of select="string($ppw-to-cc)"/>
- </out:if>
- </out:variable>
-
- <out:variable name="encodedPP8Back">
- <out:if test="/root/page/type != 'custom'">
- <out:value-of select="xtsext:urlencode(string($gateway))"/>
- <out:value-of select="xtsext:urlencode( string(concat('?b_action=xts.run&m=',string(key('env-param','m')),'&ccstate=' )) )"/><out:value-of select="string($ppw-to-cc)"/>
- </out:if>
- </out:variable>
-
-
- <out:variable name="s7gateway" select="/root/system/param[@name='series7']/gateway"/>
-
- <out:variable name="default-xss-chars"><'"></out:variable>
- <out:variable name="isXSSCheckingOn" select="$default-xss-chars != xtsext:protect($default-xss-chars,'','userData','getdata')"/>
- <!-- view modes in CC navigation and search -->
- <!--
- *
- * portal.navigationView = {detailedlist|newspaper}
- * default: detailedlist
- * Note: newspaper mode is being deprecated!
- *
- -->
- <out:variable name="portal.navigationView" select="string(/root/configProps/param[@name='cc.nav']/property[@name='portal.navigationView'])"/>
- <out:variable name="defaultNavigationView">
- <out:choose>
- <out:when test="key('session-param', 'displayMode') = 'detail' and $portal.navigationView='newspaper'">newspaper</out:when>
- <out:otherwise>
- <out:value-of select="key('session-param', 'displayMode')"/>
- </out:otherwise>
- </out:choose>
- </out:variable>
- </xsl:template>
- <!--
- Template - mf:tweak-url:
- This template is used to generate the tweak-url template.
- Operation:
- Tweaks a url.
- -->
- <xsl:template match="mf:tweak-url">
- <out:template name="tweak-url">
- <out:param name="old-url"/>
- <out:param name="param-name"/>
- <out:param name="new-value"/>
- <out:variable name="unique-name" select="concat('&', $param-name,'=')"/>
- <out:choose>
- <out:when test="contains($old-url, $unique-name)">
- <out:variable name="lastPart" select="substring-after(substring-after($old-url, $unique-name), '&')"/>
- <out:value-of select="concat(substring-before($old-url, $unique-name), $unique-name, $new-value)"/>
- <out:if test="$lastPart != ''">
- <out:value-of select="concat('&', $lastPart)"/>
- </out:if>
- </out:when>
- <out:otherwise>
- <out:value-of select="concat($old-url, $unique-name, $new-value)"/>
- </out:otherwise>
- </out:choose>
- </out:template>
- </xsl:template>
-
- <!--
- Template - mf:variables:
- This template is used to generate the common variables that are global to ccentral.
- Operation:
- Generate variables.
- -->
- <xsl:template match="mf:main-variables">
- <out:variable name="mname" select="'cc.xts'"/>
-
- <!-- env navigation info -->
- <out:variable name="m_folder" select="string(key('env-param', 'm_folder'))"/>
- <out:variable name="m_folder2" select="string(key('env-param', 'm_folder2'))"/>
- <out:variable name="m_nbid2" select="string(key('env-param', 'm_nbid2'))"/>
- <out:variable name="m_nbid" select="string(key('env-param', 'm_nbid'))"/>
- <out:variable name="nbid" select="substring-after($m_nbid, '-')"/>
-
- <!-- Folder navigation info -->
- <out:variable name="publicRootID" select="key('session-param', 'prootid')"/>
- <out:variable name="personalRootID" select="key('session-param', 'mrootid')"/>
- <!-- Flag PF navigation. We are navigating PF if:
- 1- "content" object id is in the ancestors tree of the current folder
- 2- At the root of PF no ancestor info.), the id of the root = id of /content
- 3- Navigation Upfront "newsIndex tree
- -->
- <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'"/>
- <!-- Flag MF navigation in the same way -->
- <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'"/>
- <!-- MVC -->
- <out:variable name="mvc-remotePFNav" select="$rootReply/*/cm:launchableType = 'application/vnd.ibm.cognos.instance' and $isPFNav"/>
- <out:variable name="mvc-remoteMFNav" select="$rootReply/*/cm:launchableType = 'application/vnd.ibm.cognos.instance' and $isMFNav"/>
- <out:variable name="mvc-remoteNav" select="$mvc-remotePFNav or $mvc-remoteMFNav"/>
- <!-- <out:variable name="searchPathStoreID" select="$rootReply/*/cm:storeID"/> -->
- <out:variable name="searchPath" select="$rootReply/*/cm:searchPath"/>
- <out:variable name="isRootFolder" select="$folderID = $publicRootID or $folderID = $personalRootID"/>
- <out:variable name="showingUPF" select="(/root/upfContent/cm:queryResponse) or $m_nbid != ''"/>
-
-
- <!-- Tab navigation info -->
- <out:variable name="portalPages" select="/root/cmContent/cm:queryResponse/cm:queryReply[1]/cm:runTimeState/cm:portalTabs"/>
- <out:variable name="asm-response" select="/root/assembler/*[1]"/>
- <out:variable name="pageInfo" select="/root/page"/><!-- This is the page information used to get content for this view -->
- <out:variable name="pageType" select="string($pageInfo/type)"/><!-- PFMF | custom -->
- <out:variable name="displayMode" select="string($pageInfo/displayMode)"/><!-- viewer | portal -->
- <out:variable name="pageID">
- <out:choose>
- <!--An explicit page id was specified in the request context -->
- <out:when test="$pageInfo/id != ''"><out:value-of select="$pageInfo/id"/></out:when>
- <out:when test="$pageType = 'PFMF' and $isPFNav"><out:value-of select="key('session-param', 'prootid')"/></out:when>
- <out:when test="$pageType = 'PFMF' and $isMFNav"><out:value-of select="key('session-param', 'mrootid')"/></out:when>
- </out:choose>
- </out:variable>
- <out:variable name="javascriptescapedPageID" select="xtsext:javascriptencode($pageID)"/>
- <out:variable name="isPersonalPortalPage" select="$pageID != '' and $portalPages/*[cm:storeID = $pageID]"/>
- <out:variable name="isSingleTabRequest" select="$pageID != '' and not($isPersonalPortalPage) and $displayMode = 'portal'"/>
- <out:variable name="isSinglePageRequest" select="$pageID != '' and $displayMode = 'viewer'"/>
-
- <!--
- Point to the node where we can generically read page properties
- ** Does not apply when showing PF/MF on their OWN **
- -->
- <out:variable name="pageProperties">
- <out:choose>
- <out:when test="/root/page/type = 'custom' and ($isSingleTabRequest or $isSinglePageRequest)">
- <out:variable name="object-class">
- <out:choose>
- <out:when test="/root/page/id = 'portlet'">portlet</out:when>
- <out:otherwise>pagelet</out:otherwise>
- </out:choose>
- </out:variable>
- <out:variable name="object-id" select="$asm-response/cps:id"/>
- <out:variable name="object-path" select="$asm-response/cps:path"/>
- <out:variable name="object-name" select="$asm-response/cps:name"/>
- <out:variable name="object-readonly" select="boolean($asm-response/cps:accessRights[. = 'readonly'])"/>
- <out:variable name="object-disabled" select="boolean($asm-response/cps:accessRights[. = 'disabled'])"/>
- <out:variable name="object-unavailable" select="boolean($asm-response/cps:accessRights[. = 'unavailable'])"/>
- <out:if test ="$object-id != ''">
- <out:element name="cm:{'{ $object-class }'}" namespace="http://developer.cognos.com/schemas/xts-cm/1/">
- <cm:objectClass>
- <out:value-of select="$object-class"/>
- </cm:objectClass>
- <cm:permissions type="xsd:string">
- <out:text>execute read</out:text>
- <out:if test="not($object-unavailable)"> traverse</out:if>
- <out:if test="not($object-readonly)"> write</out:if>
- </cm:permissions>
- <cm:searchPath type="cm:stringProp">
- <out:value-of select="substring-after($object-path, '/path:')"/>
- </cm:searchPath>
- <cm:defaultName type="cm:tokenProp">
- <out:value-of select="$object-name"/>
- </cm:defaultName>
- <cm:disabled type="cm:booleanProp">
- <out:value-of select="$object-disabled"/>
- </cm:disabled>
- <cm:storeID type="cm:guidProp">
- <out:value-of select="$object-id"/>
- </cm:storeID>
- </out:element>
- </out:if>
- </out:when>
- <out:when test="$isSingleTabRequest and $pageID = key('session-param', 'prootid')">
- <content>
- <cm:objectClass>content</cm:objectClass>
- <cm:searchPath type="cm:stringProp">/content</cm:searchPath>
- <cm:defaultName type="cm:tokenProp"><out:value-of select="key('session-param', 'e_proot')"/></cm:defaultName>
- <cm:storeID><out:value-of select="key('session-param', 'prootid')"/></cm:storeID>
- <cm:disabled>false</cm:disabled> <!-- This is here for show only -->
- <cm:permissions>execute read setPolicy traverse write</cm:permissions><!-- This is here for show only -->
- </content>
- </out:when>
- <out:when test="$isSingleTabRequest and $pageID = key('session-param', 'mrootid')">
- <folder>
- <cm:objectClass>folder</cm:objectClass>
- <cm:searchPath type="cm:stringProp"><out:value-of select="key('session-param', 'e_mrootpath')"/></cm:searchPath>
- <cm:defaultName type="cm:tokenProp"><out:value-of select="key('session-param', 'e_mroot')"/></cm:defaultName>
- <cm:storeID><out:value-of select="key('session-param', 'mrootid')"/></cm:storeID>
- <cm:disabled>false</cm:disabled> <!-- This is here for show only -->
- <cm:permissions>execute read setPolicy traverse write</cm:permissions><!-- This is here for show only -->
- </folder>
- </out:when>
- <out:otherwise>
- <out:copy-of select="$portalPages/*[cm:storeID = $pageID]"/>
- </out:otherwise>
- </out:choose>
- </out:variable>
-
- <!-- Page-specific info. -->
- <out:variable name="pagePath" select="string($pageProperties/*/cm:searchPath)"/>
- <out:variable name="pageDisabled" select="$pageProperties/*/cm:disabled and $pageProperties/*/cm:disabled = 'true'"/>
- <out:variable name="pageCanWrite" select="contains($pageProperties/*/cm:permissions, 'write')"/>
- <out:variable name="pageCanRead" select="contains($pageProperties/*/cm:permissions, 'read')"/>
- <out:variable name="pageCanTraverse" select="contains($pageProperties/*/cm:permissions, 'traverse')"/>
- <out:variable name="pageName" select="string($pageProperties/*/cm:defaultName)"/>
- <out:variable name="pageClass" select="string($pageProperties/*/cm:objectClass)"/>
-
- <!-- Page action flags -->
- <out:variable name="pageNotFound" select="$pagePath = '' or (/root/assembler and not(/root/assembler/*/*[local-name()='id']))"/>
- <out:variable name="canWriteToAccount" select="key('session-param', 'write') = 'true'"/>
- <out:variable name="canEditPage" select="$pageType = 'custom' and not($pageNotFound) and $pageCanWrite and $pageCanRead and $pageCanTraverse"/>
- <out:variable name="canAddPageToPortal" select="not($isPersonalPortalPage) and not($pageNotFound) and $pageCanTraverse and $pageCanRead and $canWriteToAccount"/>
-
- <out:variable name="baseCCQS">
- <out:text/>b_action=xts.run&m=<out:value-of select="xtsext:urlencode(string(key('env-param','m')))"/>
- </out:variable>
-
- <out:variable name="home-query-url">
- <out:value-of select="$baseCCQS"/>
- <!--
- Don't save the query string if it exceeds 2048 chars. in length.
- Effectivelly only check for 2000 char limit to allow for extra stuff. in the QS.
- -->
- <out:choose>
- <out:when test="$pageType = 'custom'">
- <out:choose>
- <!-- try for path first -->
- <out:when test="string-length(concat($baseCCQS, xtsext:urlencode(string($pagePath)))) < 2000">
- <out:text/>&m_tabPath=<out:value-of select="xtsext:urlencode(string($pagePath))"/>
- </out:when>
- <!-- Revert to id if path is not suitable -->
- <out:when test="$pageID != ''">
- <out:text/>&m_tab=<out:value-of select="$pageID"/>
- </out:when>
- <out:otherwise><!-- No valid page context. Don't bother saving anything --></out:otherwise>
- </out:choose>
- </out:when>
- <out:when test="$pageType = 'PFMF'">
- <out:choose>
- <out:when test="string-length(concat($baseCCQS, xtsext:urlencode(string($searchPath)))) < 2000">
- <out:text/>&m_path=<out:value-of select="xtsext:urlencode(string($searchPath))"/>
- </out:when>
- <out:when test="$folderID != ''">
- <out:text/>&m_folder=<out:value-of select="$folderID"/>
- </out:when>
- <out:otherwise><!-- No valid folder context. Don't bother saving anything --></out:otherwise>
- </out:choose>
- </out:when>
- <out:otherwise><!-- Don't bother adding anything to the base QS. --></out:otherwise>
- </out:choose>
- </out:variable>
- </xsl:template>
-
- <!--
- Template - mf:head
- -->
- <xsl:template match="mf:head">
- <!-- Portal core JS -->
- <script language="javascript">
- var g_PS_skinImageRoot = "<out:value-of select="xtsext:javascriptencode(string($skin_images))"/>";
- var g_PS_imageRoot = "<out:value-of select="xtsext:javascriptencode(string($image_root))"/>";
- var g_PS_app = "<out:value-of select="xtsext:javascriptencode(string($app))"/>";
- var g_PS_USER_productLocale = "<out:value-of select="xtsext:javascriptencode(string($mappedProductLocale))"/>";
-
- var g_PS_PFRootId = "<out:value-of select="xtsext:javascriptencode(string(key('session-param', 'prootid')))"/>";
- var g_PS_MFRootId = "<out:value-of select="xtsext:javascriptencode(string(key('session-param', 'mrootid')))"/>";
- var g_PS_gateway = "<out:value-of select="xtsext:javascriptencode(string($gateway))"/>";
- var g_PS_COGNOSHome = "<out:value-of select="xtsext:javascriptencode(key('system-param', 'COGNOSHome'))"/>";
- var g_PS_CCHome = "<out:value-of select="xtsext:javascriptencode(key('system-param', 'CCHome'))"/>";
-
- var g_PS_CCBaseURL = g_PS_gateway + "?" + g_PS_CCHome;
- var g_PS_returnURL = "<out:value-of select="xtsext:javascriptencode(string(key('env-param', 'backURL')))"/>";
- var g_PS_URLEncodedReturnURL = "<out:value-of select="xtsext:javascriptencode(string($encodedReturnURL))"/>";
- var g_PS_backURL = "<out:value-of select="xtsext:javascriptencode(string($back-url))"/>";
- var g_PS_URLEncodedBackURL = "<out:value-of select="xtsext:javascriptencode(string($encoded-back-url))"/>";
-
- var g_PS_cmdFormName = "<out:value-of select="xtsext:javascriptencode(string($cmd-form))"/>";
-
- <!-- MVC - Content Reference-->
- var g_PS_mvcRemoteFolderContext = null;
-
- <!-- wrapper functions for CC context -->
- function g_PS_getObjectContext()
- {
- return "<out:value-of select="xtsext:javascriptencode(string($pkg))"/>";
- }
- function g_PS_getFolderContext()
- {
- return "<out:value-of select="xtsext:javascriptencode(string($location))"/>";
- }
- function g_PS_getEncodedFolderContext()
- {
- return "<out:value-of select="xtsext:javascriptencode($encodedLocation)"/>";
- }
- function g_PS_getWebRoot()
- {
- return "<out:value-of select="xtsext:javascriptencode($webRoot)"/>";
- }
-
- <!-- The following functions are repeated in the controls/framework.xsl to be used in dialogues -->
- <!-- Used when need to reset the flyouts for document.onclick -->
- <!-- Specify supplimentary functions that need to be run in the otherResizeFunctions attribute -->
- function resetOnResize()
- {
- <out:variable name="otherResizeFunctions"><xsl:value-of select="@otherResizeFunctions"/></out:variable>
- <out:if test="string($otherResizeFunctions) != ''">
- <out:value-of select="$otherResizeFunctions"/>
- </out:if>
- flyonresize();
- }
- <!-- Used when need to reset the flyouts for window.onresize -->
- <!-- Specify supplimentary functions that need to be run in the otherClickFunctions attribute -->
- function resetOnClick(event)
- {
- <out:variable name="otherClickFunctions"><xsl:value-of select="@otherClickFunctions"/></out:variable>
- <out:if test="string($otherClickFunctions) != ''">
- <out:value-of select="$otherClickFunctions"/>
- </out:if>
- flyonclick(event);
- }
- </script>
- <script language="javascript">
- var sParamDelimiter = "<out:value-of select="xtsext:javascriptencode(string(key('system-param', 'delimiters')/@d1))"/>";
- var sNameValueDelimiter = "<out:value-of select="xtsext:javascriptencode(string(key('system-param', 'delimiters')/@d2))"/>";
- var sCookiePath = "<out:value-of select="xtsext:javascriptencode(string($cookie_path))"/>";
- var sCookieDomain = "<out:value-of select="xtsext:javascriptencode(string($cookie_domain))"/>";
- var sCookieSecure = "<out:value-of select="xtsext:javascriptencode(string($cookie_secure))"/>";
- </script>
- <script language="javascript" src="{'{$webcontent}'}/{'{$app}'}/js/cookie_jar.js"/>
- <script language="javascript" src="{'{$webcontent}'}/{'{$app}'}/js/CCflyoutMenu.js"/>
- <script language="javascript" src="{'{$webcontent}'}/{'{$app}'}/js/cc.js"/>
- </xsl:template>
-
-
- <!--
- Template - mf:edit-vars:
- This template is used to specify standard form variables for edits.
- Operation:
- Hidden input tag definitions
- -->
- <xsl:template match="mf:edit-vars">
- <input type="hidden" name="b_action" value="xts.run"/>
- <input type="hidden" name="backURL" value="{'{$returnURL}'}"/>
- <input type="hidden" name="m_path" value="{'{$m_path}'}"/>
- <input type="hidden" name="m" value=""/>
- <input type="hidden" name="ifrmcmd" value=""/>
- <input type="hidden" name="ps_nav_op" value="submit"/>
-
- <!-- use this to flag a group edit operation -->
- <input type="hidden" name="editentries" value=""/>
-
- <input type="hidden" name="errURL" value=""/>
-
- <out:if test="key('session-param', 'e_showTenantInfo')='true'">
- <input type="hidden" name="impersonateTenantId" value=""/>
- <input type="hidden" name="impersonateTenantCmd" value=""/>
- </out:if>
-
- <!-- List of edit vars that are hard-coded on the host morphlet inside of this edit form.
- This is a rough way to get at these vars. It is not 100% fool - proof since some form fields can be
- coded in such a way that this loop will not pick them up.
- -->
- <out:variable name="pageVars">
- <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_'))]">
- <xsl:value-of select="concat(' ' , @name, ' ' )"/>
- </xsl:for-each>
- </out:variable>
-
- <!-- List of all edit variables that get inserted into this form before runtime -->
- <out:variable name="execludeVars">
- <out:value-of select="$pageVars"/><out:value-of select="' b_action backURL m_path m ifrmcmd ps_nav_op editentries impersonateTenantId impersonateTenantCmd '"/>
- <xsl:if test="@mf:excludeVars">
- <out:text/><xsl:value-of select="concat(@mf:excludeVars, ' ')"/><out:text/>
- </xsl:if>
- </out:variable>
- <!-- Add any "runtime" request parameters so that the state is maintained after this form is submitted. -->
- <out:for-each select="/root/env/param[not(starts-with(@name, 'checkbox_')) and not(contains($execludeVars, concat(' ' , @name , ' ' )))]">
- <input type="hidden" name="{'{@name}'}" value="{'{.}'}"/>
- </out:for-each>
- <!-- Insert a cafcontextid if it is needed -->
- <out:if test="xtsext:cafaction('get_extendedcontextid', '') = 'true'">
- <input type="hidden" name="ui.cafcontextid">
- <out:attribute name="value">
- <out:value-of select="xtsext:cafaction(concat('get_contextid_settemplatename_mainframeworkxsl_setcomponent_ps_setpassportid_', $passport), '')"/>
- </out:attribute>
- </input>
- </out:if>
- </xsl:template>
- <!--
- Template - mf:cmd-vars:
- This template is used to specify standard form variables for commands.
- Operation:
- Hidden input tag definitions
- -->
- <xsl:template match="mf:cmd-vars">
- <input type="hidden" name="b_action" value="xts.run"/>
- <input type="hidden" name="m" value=""/>
- <input type="hidden" name="cmd" value=""/>
- <input type="hidden" name="m_path" value="{'{$m_path}'}"/>
- <input type="hidden" name="m_class" value=""/>
- <input type="hidden" name="b_report_type" value=""/>
- <input type="hidden" name="m_new_class" value=""/>
- <input type="hidden" name="m_classSubtype" value=""/>
- <input type="hidden" name="m_name" value=""/>
- <input type="hidden" name="m_obj" value=""/>
- <input type="hidden" name="m_location" value=""/>
- <input type="hidden" name="backURL" value=""/>
- <input type="hidden" name="reportLocation" value=""/>
- <input type="hidden" name="sharedPagesChanged" value=""/>
- <input type="hidden" name="ifrmcmd" value=""/>
- <input type="hidden" name="m_selectedPage" value=""/>
- <out:if test="key('env-param', 'rui')">
- <input type="hidden" name="rui" value="{'{key("env-param", "rui")}'}"/>
- </out:if>
- <out:if test="key('env-param', 'skin')">
- <input type="hidden" name="skin" value="{'{key("env-param", "skin")}'}"/>
- </out:if>
- <!-- Insert a cafcontextid if it is needed -->
- <out:if test="xtsext:cafaction('get_extendedcontextid', '') = 'true'">
- <input type="hidden" name="ui.cafcontextid">
- <out:attribute name="value">
- <out:value-of select="xtsext:cafaction(concat('get_contextid_settemplatename_mainframeworkxsl_setcomponent_ps_setpassportid_', $passport), '')"/>
- </out:attribute>
- </input>
- </out:if>
- </xsl:template>
-
- <!-- A collection of handy functions to generate parts for an arbitrary page set -->
- <xsl:template match="mf:TabRenderingTemplates">
- <!-- Calculates path query string variables to add to the url of a tab -->
- <out:template name="buildTabNavigationInfo">
- <out:param name="class"/>
-
- <!-- 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! -->
- <out:variable name="upfront_pnb">
- <out:choose>
- <out:when test="starts-with($m_nbid, 'p-') or starts-with($m_nbid2, 'm-')">
- <out:if test="$m_nbid != ''">
- <out:value-of select="concat('&m_nbid=', $m_nbid)"/>
- </out:if>
- <out:if test="$m_nbid2 != ''">
- <out:value-of select="concat('&m_nbid2=', $m_nbid2)"/>
- </out:if>
- </out:when>
- <out:when test="starts-with($m_nbid2, 'p-') or starts-with($m_nbid, 'm-')">
- <out:if test="$m_nbid2 != ''">
- <out:value-of select="concat('&m_nbid=', $m_nbid2)"/>
- </out:if>
- <out:if test="$m_nbid != ''">
- <out:value-of select="concat('&m_nbid2=', $m_nbid)"/>
- </out:if>
- </out:when>
- </out:choose>
- </out:variable>
-
- <!-- Build Upfront NewsBox Query string for targeting the "My Folders" tab". If Series 7 integration is turned off then this will be empty!-->
- <out:variable name="upfront_mnb">
- <out:choose>
- <out:when test="starts-with($m_nbid, 'm-') or starts-with($m_nbid2, 'p-')">
- <out:if test="$m_nbid != ''">
- <out:value-of select="concat('&m_nbid=', $m_nbid)"/>
- </out:if>
- <out:if test="$m_nbid2 != ''">
- <out:value-of select="concat('&m_nbid2=', $m_nbid2)"/>
- </out:if>
- </out:when>
- <out:when test="starts-with($m_nbid2, 'm-') or starts-with($m_nbid, 'p-')">
- <out:if test="$m_nbid2 != ''">
- <out:value-of select="concat('&m_nbid=', $m_nbid2)"/>
- </out:if>
- <out:if test="$m_nbid != ''">
- <out:value-of select="concat('&m_nbid2=', $m_nbid)"/>
- </out:if>
- </out:when>
- </out:choose>
- </out:variable>
-
- <!-- 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. -->
- <out:variable name="upfront_nb">
- <out:if test="$m_nbid != ''">
- <out:value-of select="concat('&m_nbid=', $m_nbid)"/>
- </out:if>
- <out:if test="$m_nbid2 != ''">
- <out:value-of select="concat('&m_nbid2=', $m_nbid2)"/>
- </out:if>
- </out:variable>
-
- <!-- Folder path (when toggling btwn PF/MF) -->
- <out:choose>
- <!-- Build a URL to target PF -->
- <out:when test="$class = 'content' and ( ($m_folder2 != '' and starts-with($m_folder2, 'p-') ) or $isMFNav)">
- <out:if test="substring-after($m_folder2, 'p-') != ''">
- <out:text/>&m_folder=<out:value-of select="substring-after($m_folder2, 'p-')"/>
- </out:if>
- <out:if test="$folderID != ''">
- <out:text/>&m_folder2=<out:value-of select="concat('m-', $folderID)"/>
- </out:if>
- <out:value-of select="$upfront_pnb"/>
- </out:when>
- <!-- Build a URL to target MF -->
- <out:when test="$class = 'folder' and ((starts-with($m_folder2, 'm-') and $m_folder2 != '') or $isPFNav)">
- <out:if test="substring-after($m_folder2, 'm-') != ''">
- <out:text/>&m_folder=<out:value-of select="substring-after($m_folder2, 'm-')"/>
- </out:if>
- <out:if test="$folderID != ''">
- <out:text/>&m_folder2=<out:value-of select="concat('p-', $folderID)"/>
- </out:if>
- <out:value-of select="$upfront_mnb"/>
- </out:when>
- <!-- Nvigating the same tab - no need to switch folder id -->
- <out:otherwise>
- <out:if test="$folderID != ''">
- <out:text/>&m_folder=<out:value-of select="$folderID"/>
- </out:if>
- <!-- 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. -->
- <out:choose>
- <out:when test="$m_folder2 = '' and $isMFNav">&m_folder2=p-</out:when>
- <out:when test="$m_folder2 = '' and $isPFNav">&m_folder2=m-</out:when>
- <out:when test="$m_folder2 != ''">&m_folder2=<out:value-of select="$m_folder2"/></out:when>
- </out:choose>
- <out:value-of select="$upfront_nb"/>
- </out:otherwise>
- </out:choose>
- </out:template>
-
-
-
- <out:template name="genWarningSigns">
- <out:param name="pageProp"/>
- <out:variable name="warningMessage">
- <out:choose>
- <out:when test="not($pageProp/cm:objectClass) or $pageProp/cm:objectClass = 'nil'">
- <xts:string id="IDS_PAGE_UNAVAILABLE"/>
- </out:when>
- <out:when test="$pageProp/cm:disabled = 'true'">
- <xts:string id="IDS_PAGE_DISABLED"/>
- </out:when>
- <out:when test="not(contains($pageProp/cm:permissions, 'execute'))">
- <xts:string id="IDS_PAGE_NO_ACCESS"/>
- </out:when>
- </out:choose>
- </out:variable>
-
- <out:if test="$warningMessage != ''">
- <img style="margin-right:5px;" src="{'{$image_root}'}state_warning.gif" width="11" height="16" border="0" align="absmiddle" title="{'{$warningMessage}'}" alt="{'{$warningMessage}'}"/>
- </out:if>
- </out:template>
-
- <out:template name="genTabLable">
- <out:param name="CMClass"/>
- <out:param name="CMName"/>
- <out:choose>
- <out:when test="$CMClass = 'nil' or $CMClass = ''">
- <xts:string id="IDS_PAGE_UNAVAILABLE"/>
- </out:when>
- <out:otherwise>
- <out:value-of select="$CMName"/>
- </out:otherwise>
- </out:choose>
- </out:template>
-
- <out:template name="genTabURL">
- <out:param name="pageID"/>
- <out:param name="pageClass"/>
- <out:value-of select="$gateway"/>?b_action=xts.run&m=<out:value-of select="$app"/>/<out:value-of select="$mname"/>
- <out:value-of select="$request-url-params"/>&m_tab=<out:value-of select="$pageID"/>
- <out:call-template name="buildTabNavigationInfo">
- <out:with-param name="class" select="$pageClass"/>
- </out:call-template>
- </out:template>
- </xsl:template>
- <!--
- Template - mf:common-entry-varaibles:
- This template is used to generate common variables for entries
- Operation:
- Generate variables.
- -->
- <xsl:template match="mf:common-entry-varaibles">
- <!-- An entry is considered "dangling" if it is:
- - a shortcut to a none existent object
- - a custom view of a none existent report or query
- - a shortcut to a custom view of a none existent report or query
- -->
- <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)))"/>
- <!-- Determine the class of the object. If it is a shortcut entry then get the class of the target object. -->
- <out:variable name="class">
- <out:choose>
- <out:when test=" cm:objectClass = 'shortcut' "><out:value-of select="cm:target/*/cm:objectClass[1]"/></out:when>
- <out:otherwise><out:value-of select="cm:objectClass"/></out:otherwise>
- </out:choose>
- </out:variable>
- <out:variable name="userInterfaces" select="cm:userInterfaces/cm:uiComponentEnum"/> <!-- this is a node-set -->
- <out:variable name="targetUserInterfaces" select="cm:target/*/cm:userInterfaces/cm:uiComponentEnum"/>
- <out:variable name="executionFormat">
- <out:choose>
- <out:when test="( cm:target/*/cm:executionFormat and not( cm:target/*/cm:executionFormat/@nil ) )">
- <out:value-of select="cm:target/*/cm:executionFormat"/>
- </out:when>
- <out:when test="(cm:executionFormat and not( cm:executionFormat/@nil ) )">
- <out:value-of select="cm:executionFormat"/>
- </out:when>
- <out:when test="string(cm:target/*/cm:options/*[cm:name='outputFormat']/cm:value)!=''">
- <out:value-of select="string(cm:target/*/cm:options/*[cm:name='outputFormat']/cm:value)"/>
- </out:when>
- <out:when test="string(cm:options/*[cm:name='outputFormat']/cm:value)!=''">
- <out:value-of select="string(cm:options/*[cm:name='outputFormat']/cm:value)"/>
- </out:when>
- </out:choose>
- </out:variable>
- <out:variable name="isContainer" select=" key( 'ui-object', string($class))/@container = 'T' "/>
- <out:variable name="hasURI" select="concat(cm:uri, cm:target/*/cm:uri)"/>
- <out:variable name="effectiveUserCapabilities">
- <out:call-template name="calEffectiveObjectCapabilities">
- <out:with-param name="capabilities" select="./cm:effectiveUserCapabilities | ./*/*/cm:effectiveUserCapabilities"/>
- </out:call-template>
- </out:variable>
- <out:variable name="action">
- <out:call-template name="gen-action">
- <out:with-param name="class" select="$class"/>
- <out:with-param name="object" select="."/>
- <out:with-param name="canExecute" select="$canExecute"/>
- <out:with-param name="canRead" select="$canRead"/>
- <out:with-param name="canTraverse" select="$canTraverse"/>
- <out:with-param name="output_format" select="$output_format"/>
- <out:with-param name="userInterfaces" select="$userInterfaces"/>
- <out:with-param name="targetUserInterfaces" select="$targetUserInterfaces"/>
- <out:with-param name="effectiveUserCapabilities" select="$effectiveUserCapabilities"/>
- </out:call-template>
- </out:variable>
- <out:variable name="hiddenObject" select="cm:hidden"/>
- </xsl:template>
- <!--
- Template - mf:entry-name:
- This template is used to generate the entry name.
- Operation:
- Generate the entry name and hyperlink the name if required.
- -->
- <xsl:template match="mf:entry-name">
- <!-- Only hyperlink the entry if it is:
- - not a dangling reference.
- - It is a container and the user can traverse it.
- - It is a URL to an external web site
- - 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.
- - 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.
- - it is a reportTemplate to which the user has read access and the user can use Report Studio
- -->
- <out:variable name="hyperlink">
- <out:call-template name="gen-url">
- <out:with-param name="canExecute" select="$canExecute"/>
- <out:with-param name="canRead" select="$canRead"/>
- <out:with-param name="canTraverse" select="$canTraverse"/>
- <out:with-param name="output_format" select="$output_format"/>
- <xsl:if test="@target='true'">
- <out:with-param name="target" select="$target"/>
- </xsl:if>
- <out:with-param name="class" select="$class"/>
- <out:with-param name="userInterfaces" select="$userInterfaces"/>
- <xsl:for-each select="param">
- <out:with-param name="{@name}"><xsl:value-of select="."/></out:with-param>
- </xsl:for-each>
- <out:with-param name="targetUserInterfaces" select="$targetUserInterfaces"/>
- <xsl:for-each select="param">
- <out:with-param name="{@name}"><xsl:value-of select="."/></out:with-param>
- </xsl:for-each>
- <xsl:choose>
- <xsl:when test="@action"><out:with-param name="action" select="'{@action}'"/></xsl:when>
- <xsl:otherwise><out:with-param name="action" select="$action"/></xsl:otherwise>
- </xsl:choose>
- <out:with-param name="isDangling" select="$isDangling"/>
- <out:with-param name="isContainer" select="$isContainer"/>
- <out:with-param name="canWrite" select="$canWrite"/>
- <xsl:if test="@tool='portalAdmin'">
- <out:with-param name="url-encoded-id" select="$url-encoded-id"/>
- <out:with-param name="canReadParent" select="$parentHasReadPermission"/>
- <out:with-param name="navigateUsingID" select="'true'"/>
- </xsl:if>
- <xsl:if test="@mode = 'search'">
- <out:with-param name="isSearch" select="true()"/>
- </xsl:if>
- <out:with-param name="effectiveUserCapabilities" select="$effectiveUserCapabilities"/>
- </out:call-template>
- </out:variable>
- <out:variable name="defaultName">
- <out:value-of select="cm:defaultName"/>
- </out:variable>
- <out:choose>
- <out:when test="$hyperlink !='' ">
- <a>
- <out:if test="$defaultNavigationView = 'detail'">
- <out:attribute name="aria-describedby"><out:text>longdescid_</out:text><out:value-of select="position()"/><out:text>_span</out:text></out:attribute>
- </out:if>
- <out:choose>
- <out:when test="starts-with($hyperlink,'javascript:')">
- <out:attribute name="href">
- <out:value-of select="'#'"/>
- </out:attribute>
- <out:attribute name="onclick">
- <out:value-of select="$hyperlink"/>
- </out:attribute>
- </out:when>
- <out:otherwise>
- <out:attribute name="href">
- <out:value-of select="$hyperlink"/>
- </out:attribute>
- </out:otherwise>
- </out:choose>
- <xsl:if test="@target='true'">
- <out:attribute name="target">
- <out:value-of select="$target"/>
- </out:attribute>
- </xsl:if>
- <out:if test="$isBidiEnabled = 'true'">
- <out:attribute name="dir">
- <out:value-of select="xtsext:getBTD($defaultName, $baseTextDirection, $productLocale)"/>
- </out:attribute>
- </out:if>
- <out:value-of select="$defaultName"/>
- </a>
- </out:when>
- <out:otherwise>
- <out:value-of select="xtsext:enforceBTD($defaultName, $baseTextDirection, $productLocale, boolean($isBidiEnabled='true'))"/>
- </out:otherwise>
- </out:choose>
-
- <!-- Render the disabled icon if this entry is disabled -->
- <out:choose>
- <out:when test="cm:disabled = 'true'">
- <img height="16" width="16" hspace="4" align="absmiddle" src="{'{$image_root}'}state_disabled.gif">
- <out:attribute name="alt"><xts:string id="IDS_DISABLED"/></out:attribute>
- </img>
- </out:when>
- <out:when test="cm:target/*/cm:disabled = 'true' or cm:base/*/cm:disabled = 'true'">
- <img height="16" width="16" hspace="4" align="absmiddle" src="{'{$image_root}'}state_source_disabled.gif">
- <out:attribute name="alt"><xts:string id="IDS_DISABLED"/></out:attribute>
- </img>
- </out:when>
- </out:choose>
- </xsl:template>
- <xsl:template match="mf:long-description-scripts">
- <out:if test="$defaultNavigationView = 'detail'">
- <script>
- function longdescToggle(id, toggle) {
- if (toggle == "expand") {
- document.getElementById(id + "_collapse").innerHTML = document.getElementById(id).innerHTML;
- var spNodes = document.getElementById(id + "_collapse").getElementsByTagName("span");
- if (spNodes.length > 0){
- spNodes[0].id = id + "_HIDDENCOLLPASEDTHING";
- }
- document.getElementById(id).innerHTML = document.getElementById(id + "_expand").innerHTML;
- } else if (toggle == "collapse") {
- document.getElementById(id).innerHTML = document.getElementById(id + "_collapse").innerHTML;
- }
- var spanNodes = document.getElementById(id).getElementsByTagName("span");
- if (spanNodes.length > 0){
- spanNodes[0].id = id + "_span";
- }
- }
- </script>
- </out:if>
- </xsl:template>
- <xsl:template match="mf:long-description">
- <out:if test="$defaultNavigationView = 'detail'">
- <out:variable name="detailedListViewTruncationSize">
- <out:variable name="ts" select="string(/root/configProps/param[@name='cc.nav']/property[@name='portal.detailedListViewTruncationSize'])"/>
- <out:choose>
- <out:when test="$ts = '' or string(number($ts)) = 'NaN'"><out:value-of select="-1"/></out:when>
- <out:otherwise><out:value-of select="$ts"/></out:otherwise>
- </out:choose>
- </out:variable>
- <out:variable name="isTruncated" select="string-length(cm:defaultDescription) > $detailedListViewTruncationSize and number($detailedListViewTruncationSize) > 0"/>
- <out:variable name="description">
- <out:choose>
- <out:when test="$isTruncated">
- <out:value-of select="substring(cm:defaultDescription,0,$detailedListViewTruncationSize)"/>
- <out:value-of select="substring-before(substring(cm:defaultDescription,$detailedListViewTruncationSize), ' ')"/>
- <out:value-of select="'...'"/>
- </out:when>
- <out:otherwise>
- <out:value-of select="cm:defaultDescription"/>
- </out:otherwise>
- </out:choose>
- </out:variable>
- <out:variable name="dir">
- <out:if test="$isBidiEnabled = 'true'">
- <out:value-of select="xtsext:getBTD(cm:defaultDescription, $baseTextDirection, $productLocale)"/>
- </out:if>
- </out:variable>
-
- <div id="longdescid_{'{position()}'}" >
- <span id="longdescid_{'{position()}'}_span">
- <out:if test="$dir != ''"><out:attribute name="dir"><out:value-of select="$dir"/></out:attribute></out:if>
- <out:value-of select="$description"/>
- </span>
- <out:if test="$isTruncated">
- <img tabindex="0" role="button" border="0" src="{'{$skin_images}'}prompt_option_expand.gif" aria-expanded="false">
- <out:attribute name="alt"><xts:string id="IDS_DESCRIPTION_EXPAND"/></out:attribute>
- <out:attribute name="title"><xts:string id="IDS_DESCRIPTION_EXPAND"/></out:attribute>
- <out:attribute name="onclick">javascript:longdescToggle('longdescid_<out:value-of select="position()"/>', "expand");</out:attribute>
- <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>
- </img>
- </out:if>
- </div>
-
- <out:if test="$isTruncated">
- <!-- Holder for full description content -->
- <div id="longdescid_{'{position()}'}_expand" style="display:none">
- <span id="longdescid_{'{position()}'}_expand_span">
- <out:if test="$dir != ''"><out:attribute name="dir"><out:value-of select="$dir"/></out:attribute></out:if>
- <out:value-of select="cm:defaultDescription"/>
- </span>
- <img tabindex="0" role="button" aria-expanded="true" border="0" src="{'{$skin_images}'}prompt_option_collapse.gif">
- <out:attribute name="alt"><xts:string id="IDS_DESCRIPTION_COLLAPSE"/></out:attribute>
- <out:attribute name="title"><xts:string id="IDS_DESCRIPTION_COLLAPSE"/></out:attribute>
- <out:attribute name="onclick">javascript:longdescToggle('longdescid_<out:value-of select="position()"/>', "collapse");</out:attribute>
- <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>
- </img>
- </div>
-
- <!-- Holder for partial description content -->
- <div id="longdescid_{'{position()}'}_collapse" style="display:none">
- </div>
- </out:if>
- </out:if>
- </xsl:template>
-
- <xsl:template match="*">
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- <xsl:apply-templates/>
- </xsl:copy>
- </xsl:template>
-
-
- </xsl:stylesheet>
|