123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: ps
- (C) Copyright IBM Corp. 2005, 2015
- US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- -->
- <!--
- Copyright (C) 2008 Cognos ULC, an IBM Company. All rights reserved.
- Cognos (R) is a trademark of Cognos ULC, (formerly Cognos Incorporated).
- -->
- <xsl:stylesheet version="1.0"
- xmlns:xts="http://developer.cognos.com/schemas/xts/"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/"
- xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- exclude-result-prefixes="cml cm xts xtsext">
-
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
-
- <!-- If we have m_reload in the request then this means we need to update user prefs -->
- <xsl:variable name="refresh-session" select="/root/env/param[@name='m_reload']"/>
- <xsl:key name="env-param" match="/root/env/param" use="@name"/>
- <xsl:key name="system-param" match="/root/system/param" use="@name"/>
-
- <xsl:template match="/root">
- <xsl:variable name="userAccount" select="newSession/cm:queryResponse/cm:queryReply[3]/cm:account"/>
- <xsl:variable name="tenantID" select="newSession/tenantInfo//cm:tenantID"/>
- <xsl:variable name="tenantDisplayName" select="newSession/tenantInfo//cm:defaultName"/>
- <xsl:variable name="readTenantID" select="newSession/camIdentity//*[local-name()='readTenantIDs']"/>
- <xsl:variable name="writeTenantID" select="newSession/camIdentity//*[local-name()='writeTenantID']"/>
- <xsl:variable name="isImpersonating" select="newSession/camIdentity//*[local-name()='isImpersonating']"/>
- <xsl:variable name="camIdentity" select="newSession/camIdentity/*[local-name()='getIdentityResponse']"/>
- <xsl:variable name="tenantEnabledInstall" select="count(availableTenants/cm:queryResponse/*/cm:tenantID) > 0"/>
- <xsl:variable name="showTenantInfoForAllUsers" select="/root/configSettings/configuration/property[@name='portal.showTenantInfoForAllUsers']='true'"/>
- <xsl:variable name="role" select="newSession/cm:queryResponse/cm:queryReply[4]/cm:session/cm:identity/cm:role"/>
- <xsl:variable name="isSysAdmin" select="count($role[cm:searchPath='CAMID("::System Administrators")'])!= 0"/>
- <xsl:variable name="isTenantAdmin" select="count($role[cm:searchPath='CAMID("::Tenant Administrators")'])!= 0"/>
- <xsl:variable name="showTenantInfo" select="$tenantEnabledInstall and ($showTenantInfoForAllUsers or $isSysAdmin or $isTenantAdmin)"/>
- <xsl:variable name="mPath" select="/root/mroot/cm:queryResponse/*/cm:searchPath"/>
- <xsl:variable name="cPath" select="/root/croot/cm:queryResponse/*/cm:searchPath"/>
- <xsl:variable name="activeNamespaces" select="count(newSession/cm:queryResponse/cm:queryReply[5]/*[./*[local-name() = 'active'] = 'true'])"/>
- <xsl:variable name="traversableNamespaces" select="count(newSession/cm:queryResponse/cm:queryReply[5]/*[contains(concat(' ', ./*[local-name() = 'permissions'], ' '), ' traverse ')])"/>
- <xsl:variable name="canCallLogon">
- <xsl:choose>
- <xsl:when test="/root/credential/param[@name='CAM']/*[local-name() ='CAM']/*[local-name() = 'CAMPassport']/*[local-name() = 'canCallLogon']">
- <xsl:value-of select="/root/credential/param[@name='CAM']/*[local-name() ='CAM']/*[local-name() = 'CAMPassport']/*[local-name() = 'canCallLogon']"/>
- </xsl:when>
- <xsl:when test="/root/header/*[local-name() = 'biBusHeader']/*[local-name()= 'CAM']/CAMPassport/canCallLogon">
- <xsl:value-of select="/root/header/*[local-name() = 'biBusHeader']/*[local-name()= 'CAM']/CAMPassport/canCallLogon"/>
- </xsl:when>
- <xsl:otherwise>
- <!-- Rare cases where the CAM section is not available -->
- <xsl:value-of select="$activeNamespaces > $traversableNamespaces"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xts:sequence>
- <!-- Set the current session -->
- <xsl:choose>
- <!-- If we have a session cookie then xts created a <session> element, update any parameters which need updating -->
- <xsl:when test="cookies/cookie[@name='cc_session'] and cookies/cookie[@name='cc_session'] != '' ">
-
- <!-- Sort options can be set by passing them in the request.
- Therefore, look for these in the current request and update the corresponding session values accordingly
- -->
- <!-- Sort options-->
- <xsl:for-each select="env/param[starts-with(@name,'m_s_')]">
- <xts:replace select="/root/session/param[@name='{substring(./@name,3)}']">
- <param name="{substring(@name,3)}"><xsl:value-of select="."/></param>
- </xts:replace>
- </xsl:for-each>
-
- <!-- After changing the default order of entries on the "sort" page we would want to revert back to default sorting -->
- <xsl:if test="/root/env/param[@name = 'resetSort']">
- <xts:replace select="/root/session/param[@name='s_cc']">
- <param name="s_cc"/>
- </xts:replace>
- </xsl:if>
-
- <xsl:if test="key('env-param', 'ui')">
- <xts:replace select="/root/session/param[@name='ui']">
- <param name="ui"><xsl:value-of select="xtsext:urlencode(string(key('env-param', 'ui')))"/></param>
- </xts:replace>
- </xsl:if>
- <!-- If user prefs have changed then update the session -->
- <xsl:if test="$refresh-session">
- <!-- Clear the cache state (portal tabs) -->
- <xts:delete select="/root/session/param[@name='cachestamp']"/>
-
- <!-- Refresh User Name -->
- <xsl:if test="boolean($userAccount/cm:defaultName) and not($userAccount/cm:defaultName='')">
- <xts:replace select="/root/session/param[@name='e_user']">
- <param name="e_user"><xsl:value-of select="$userAccount/cm:defaultName"/></param>
- </xts:replace>
- </xsl:if>
- <xts:replace select="/root/session/param[@name='e_isSysAdmin']">
- <param name="e_isSysAdmin"><xsl:value-of select="$isSysAdmin"/></param>
- </xts:replace>
-
- <xts:replace select="/root/session/param[@name='e_isTenantAdmin']">
- <param name="e_isTenantAdmin"><xsl:value-of select="$isTenantAdmin"/></param>
- </xts:replace>
-
- <!-- Refresh Tenant Info -->
- <xts:replace select="/root/session/param[@name='e_tenantDisplayName']">
- <param name="e_tenantDisplayName"><xsl:value-of select="$tenantDisplayName"/></param>
- </xts:replace>
- <xts:replace select="/root/session/param[@name='e_tenantID']">
- <param name="e_tenantID"><xsl:value-of select="$tenantID"/></param>
- </xts:replace>
- <xts:replace select="/root/session/param[@name='e_showTenantInfo']">
- <param name="e_showTenantInfo"><xsl:value-of select="$showTenantInfo"/></param>
- </xts:replace>
- <!-- Refresh read TenantID -->
- <xts:delete select="/root/session/param[@name='e_readTenantID']"/>
- <xsl:if test="boolean($readTenantID)">
- <xts:append select="/root/session">
- <param name="e_readTenantID"><xsl:value-of select="$readTenantID"/></param>
- </xts:append>
- </xsl:if>
-
- <!-- Refresh write TenantID -->
- <xts:delete select="/root/session/param[@name='e_writeTenantID']"/>
- <xts:delete select="/root/session/param[@name='e_writeTenantName']"/>
- <xsl:if test="boolean($writeTenantID)">
- <xts:append select="/root/session">
- <param name="e_writeTenantID"><xsl:value-of select="$writeTenantID"/></param>
- <param name="e_writeTenantName"><xsl:value-of select="newSession/camIdentity/writeTenantName//*[local-name()='defaultName']"/></param>
- </xts:append>
- </xsl:if>
-
- <!-- Refresh Home page -->
- <xts:replace select="/root/session/param[@name='e_hp']">
- <param name="e_hp"><xsl:value-of select="$userAccount/cm:searchPath"/></param>
- </xts:replace>
-
- <!-- Refresh permissions -->
- <xts:replace select="/root/session/param[@name='write']">
- <param name="write"><xsl:value-of select="string(contains($userAccount/cm:permissions, 'write'))"/></param>
- </xts:replace>
-
- <!-- Refresh public root folder name id and path-->
- <xts:replace select="/root/session/param[@name='e_proot']">
- <param name="e_proot"><xsl:value-of select="newSession/cm:queryResponse/cm:queryReply[1]/*/cm:defaultName"/></param>
- </xts:replace>
- <xts:replace select="/root/session/param[@name='prootid']">
- <param name="prootid"><xsl:value-of select="newSession/cm:queryResponse/cm:queryReply[1]/*/cm:storeID"/></param>
- </xts:replace>
- <xts:replace select="/root/session/param[@name='e_prootpath']">
- <param name="e_prootpath"><xsl:value-of select="newSession/cm:queryResponse/cm:queryReply[1]/*/cm:searchPath"/></param>
- </xts:replace>
-
- <!-- Refresh private root folder name id and path -->
- <xts:replace select="/root/session/param[@name='e_mroot']">
- <param name="e_mroot"><xsl:value-of select="newSession/cm:queryResponse/cm:queryReply[2]/*/cm:defaultName"/></param>
- </xts:replace>
- <!-- Refresh public root folder id -->
- <xts:replace select="/root/session/param[@name='mrootid']">
- <param name="mrootid"><xsl:value-of select="newSession/cm:queryResponse/cm:queryReply[2]/*/cm:storeID"/></param>
- </xts:replace>
- <xts:replace select="/root/session/param[@name='e_mrootpath']">
- <param name="e_mrootpath"><xsl:value-of select="newSession/cm:queryResponse/cm:queryReply[2]/*/cm:searchPath"/></param>
- </xts:replace>
- <!-- refresh the content locale used to snapshot e_proot and e_mroot -->
- <xts:replace select="/root/session/param[@name='cl']">
- <param name="cl"><xsl:value-of select="/root/session/param[@name='contentLocale']"/></param>
- </xts:replace>
-
- <!-- Refresh default context id (id of the first tab in the user's my pages) -->
- <xts:replace select="/root/session/param[@name='dcid']">
- <param name="dcid">
- <xsl:call-template name="set-dcid">
- <xsl:with-param name="account" select="$userAccount"/>
- </xsl:call-template>
- </param>
- </xts:replace>
-
- <!-- Refresh UI control groups -->
- <xts:replace select="/root/session/param[@name='uig']">
- <param name="uig">
- <xsl:call-template name="setUIControlGroups"/>
- </param>
- </xts:replace>
-
- <!-- Refresh RS UI Profiles (Professional and BUA - formerly Express) -->
- <xts:replace select="/root/session/param[@name='rsuiprofile']">
- <param name="rsuiprofile">
- <xsl:variable name="rsProfilesPro" select="/root/rsProfiles/*/*[local-name()='uiProfile']/*[local-name()='name']/*[local-name()='multilingualToken' and string(.)='Professional']/../../*[local-name()='permissions' and (contains(string(.),'execute') or contains(string(.),'traverse'))]"/>
- <xsl:variable name="rsProfilesBia" select="/root/rsProfiles/*/*[local-name()='uiProfile']/*[local-name()='name']/*[local-name()='multilingualToken' and string(.)='Express']/../../*[local-name()='permissions' and (contains(string(.),'execute') or contains(string(.),'traverse'))]"/>
- <xsl:variable name="lastUIProfile" select="/root/lastUserInterfaceProfile/*/*[local-name()='userInterfaceProfile']"/>
- <xsl:variable name="uiProfilesPro" select="/root/readableUserInterfaceProfile/*/*[local-name()='userInterfaceProfile']/*[local-name()='name']/*[local-name()='multilingualToken' and string(.)='Report Studio Professional']/../../*[local-name()='permissions' and (contains(string(.),'read'))]"/>
- <xsl:variable name="uiProfilesNum" select="count(/root/readableUserInterfaceProfile/*/*[local-name()='userInterfaceProfile'])"/>
- <xsl:choose>
- <xsl:when test="not($lastUIProfile)">
- <xsl:choose>
- <xsl:when test="$rsProfilesPro and $rsProfilesBia">all</xsl:when>
- <xsl:when test="$rsProfilesPro">pro</xsl:when>
- <xsl:when test="$rsProfilesBia">bua</xsl:when>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="$uiProfilesPro and number($uiProfilesNum) > 1">all</xsl:when>
- <xsl:when test="$uiProfilesPro and number($uiProfilesNum) = 1">pro</xsl:when>
- <xsl:when test="not($uiProfilesPro) and number($uiProfilesNum) > 0">bua</xsl:when>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </param>
- </xts:replace>
- <!-- Refresh LotusConnections HomePage -->
- <xts:replace select="/root/session/param[@name='lch']">
- <param name="lch">
- <xsl:choose>
- <xsl:when test="string(/root/collaborationApps/configuration/property[@name='lc_homepage_uri'])!=''">t</xsl:when>
- <xsl:otherwise>f</xsl:otherwise>
- </xsl:choose>
- </param>
- </xts:replace>
- <!-- Refresh LotusConnections activities -->
- <xts:replace select="/root/session/param[@name='lca']">
- <param name="lca">
- <xsl:choose>
- <xsl:when test="string(/root/collaborationApps/configuration/property[@name='lc_activities_uri'])!=''">t</xsl:when>
- <xsl:otherwise>f</xsl:otherwise>
- </xsl:choose>
- </param>
- </xts:replace>
- <!-- Refresh Desk top install state -->
- <xts:replace select="/root/session/param[@name='ci']">
- <param name="ci">
- <xsl:choose>
- <xsl:when test="/root/ciInstalled/cddNotFound">f</xsl:when>
- <xsl:otherwise>t</xsl:otherwise>
- </xsl:choose>
- </param>
- </xts:replace>
- <!-- Refresh Show Logon -->
- <xts:replace select="/root/session/param[@name='show_logon']">
- <param name="show_logon"><xsl:value-of select="$canCallLogon='true'"/></param>
- </xts:replace>
-
- <!--
- We normally reset pager flages when we refresh the session.
- Except when explicitly instructed not to (b/c it is important to maintain paging state for one reason or another.
- -->
- <xsl:if test="not(key('env-param', 'm_retainPagerState'))">
- <xts:delete select="/root/env/param[starts-with(@name, 'm_section')]"/>
- <xts:delete select="/root/env/param[starts-with(@name, 'm_pagerfrom')]"/>
- <xts:delete select="/root/env/param[starts-with(@name, 'm_pagerto')]"/>
- <xts:delete select="/root/env/param[starts-with(@name, 'm_pg_e')]"/>
- </xsl:if>
- </xsl:if>
- <!-- Support for m_root URL parameter and consumer_root entry in system.xml -->
- <!--
- Order of precedence
- 1. m_root value is used provided:
- - the user is not restricted by the consumer_root.
- - the user is restricted by the consumer_root and the restriction level is an ancestor of the value.
- - if it is not a part of the /content structure.
- 2. consumer_root value is used provided:
- - the system.xml file contains a value other than /content.
- - the user does not have administrator capabilities.
- -->
- <!-- It is only necessary to update the e_root value in the session cookie when the m_root is specified or its value is blank -->
- <!-- If m_roots are cleared, the consumer_root restrictions then apply - if applicable -->
- <!-- m_root restrictions apply until a new m_root is provided -->
-
- <xsl:choose>
- <xsl:when test="/root/mroot">
- <xsl:variable name="mrVal">
- <xsl:choose>
- <xsl:when test="not(boolean(/root/session/param[@name='capabilities']/canUseAdministrationPortal)) and /root/croot and starts-with( string($mPath),'/content') and not( contains( string($mPath),string($cPath) ) )"><xsl:value-of select="$cPath"/></xsl:when>
- <xsl:otherwise><xsl:value-of select="$mPath"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xts:replace select="/root/session/param[@name='e_root']">
- <param name="e_root"><xsl:value-of select="$mrVal"/></param>
- </xts:replace>
- </xsl:when>
- <xsl:when test="/root/croot and string(/root/session/param[@name='e_root'])!=string($cPath) and not(boolean(/root/session/param[@name='capabilities']/canUseAdministrationPortal))">
- <xts:replace select="/root/session/param[@name='e_root']">
- <param name="e_root"><xsl:value-of select="$cPath"/></param>
- </xts:replace>
- </xsl:when>
- </xsl:choose>
- </xsl:when>
-
-
- <!-- If we have no session cookie then xts created an empty <session/> element - update it with user prefs. -->
- <!-- ============================================================================= -->
- <xsl:otherwise>
-
-
- <xsl:variable name="debug">
- <xsl:choose>
- <xsl:when test="key('env-param', 'd')"><xsl:value-of select="key('env-param', 'd')"/></xsl:when>
- <xsl:otherwise>0</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <!-- Construct the default session.. This element will be packed and stored in a session cookie for later use. -->
- <!--
- Parameters prefixed with e_ are can contain none-ascii and multibyte chars and therefore are carefully encoded/decoded whenever the session is packed or unpacked.
- Parameters prefixed with s_ are reserved for sorting options.
- -->
- <xts:delete select="/root/session/param[string(@type)!='CRN']"/>
- <xts:append select="/root/session">
- <param name="s_cc"/>
- <param name="s_conf">na</param>
- <param name="s_sch">td</param>
- <param name="s_hd">sa</param>
- <param name="s_serv">na</param>
- <param name="s_disp">na</param>
- <param name="s_set"></param>
- <param name="s_dep">na</param>
- <param name="s_dir">na</param>
- <param name="s_sms">dd</param>
- <param name="s_ct">sa</param>
- <param name="s_cs">sa</param>
- <param name="s_so">sa</param>
- <param name="e_hp"><xsl:value-of select="$userAccount/cm:searchPath"/></param>
- <param name="e_proot"><xsl:value-of select="newSession/cm:queryResponse/cm:queryReply[1]/*/cm:defaultName"/></param>
- <param name="prootid"><xsl:value-of select="newSession/cm:queryResponse/cm:queryReply[1]/*/cm:storeID"/></param>
- <param name="e_mroot"><xsl:value-of select="newSession/cm:queryResponse/cm:queryReply[2]/*/cm:defaultName"/></param>
- <param name="mrootid"><xsl:value-of select="newSession/cm:queryResponse/cm:queryReply[2]/*/cm:storeID"/></param>
- <param name="e_mrootpath"><xsl:value-of select="newSession/cm:queryResponse/cm:queryReply[2]/*/cm:searchPath"/></param>
- <param name="e_user"><xsl:value-of select="$userAccount/cm:defaultName"/></param>
- <param name="e_tenantID"><xsl:value-of select="$tenantID"/></param>
- <param name="e_tenantDisplayName"><xsl:value-of select="$tenantDisplayName"/></param>
- <param name="e_showTenantInfo"><xsl:value-of select="$showTenantInfo"/></param>
- <param name="e_isSysAdmin"><xsl:value-of select="$isSysAdmin"/></param>
- <param name="e_isTenantAdmin"><xsl:value-of select="$isTenantAdmin"/></param>
- <xsl:if test="boolean($readTenantID)">
- <param name="e_readTenantID"><xsl:value-of select="$readTenantID"/></param>
- </xsl:if>
- <xsl:if test="boolean($writeTenantID)">
- <param name="e_writeTenantID"><xsl:value-of select="$writeTenantID"/></param>
- <param name="e_writeTenantName"/>
- </xsl:if>
- <param name="e_isImpersonating"><xsl:value-of select="$isImpersonating"/></param>
- <param name="cl"><xsl:value-of select="/root/session/param[@name='contentLocale']"/></param>
- <param name="dcid">
- <xsl:call-template name="set-dcid">
- <xsl:with-param name="account" select="$userAccount"/>
- </xsl:call-template>
- </param>
- <param name="show_logon"><xsl:value-of select="$canCallLogon='true'"/></param>
- <param name="uig">
- <xsl:call-template name="setUIControlGroups"/>
- </param>
- <param name="ui"><xsl:value-of select="xtsext:urlencode(string(key('env-param', 'ui')))"/></param>
- <xsl:if test="string(key('system-param', 'enable-package-capability-check'))='true'">
- <param name="pccEnabled"/>
- </xsl:if>
- <param name="rsuiprofile">
- <xsl:variable name="rsProfilesPro" select="/root/rsProfiles/*/*[local-name()='uiProfile']/*[local-name()='name']/*[local-name()='multilingualToken' and string(.)='Professional']/../../*[local-name()='permissions' and (contains(string(.),'execute') or contains(string(.),'traverse'))]"/>
- <xsl:variable name="rsProfilesBia" select="/root/rsProfiles/*/*[local-name()='uiProfile']/*[local-name()='name']/*[local-name()='multilingualToken' and string(.)='Express']/../../*[local-name()='permissions' and (contains(string(.),'execute') or contains(string(.),'traverse'))]"/>
- <xsl:variable name="lastUIProfile" select="/root/lastUserInterfaceProfile/*/*[local-name()='userInterfaceProfile']"/>
- <xsl:variable name="uiProfilesPro" select="/root/readableUserInterfaceProfile/*/*[local-name()='userInterfaceProfile']/*[local-name()='name']/*[local-name()='multilingualToken' and string(.)='Report Studio Professional']/../../*[local-name()='permissions' and (contains(string(.),'read'))]"/>
- <xsl:variable name="uiProfilesNum" select="count(/root/readableUserInterfaceProfile/*/*[local-name()='userInterfaceProfile'])"/>
- <xsl:choose>
- <xsl:when test="not($lastUIProfile)">
- <xsl:choose>
- <xsl:when test="$rsProfilesPro and $rsProfilesBia">all</xsl:when>
- <xsl:when test="$rsProfilesPro">pro</xsl:when>
- <xsl:when test="$rsProfilesBia">bua</xsl:when>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="$uiProfilesPro and number($uiProfilesNum) > 1">all</xsl:when>
- <xsl:when test="$uiProfilesPro and number($uiProfilesNum) = 1">pro</xsl:when>
- <xsl:when test="not($uiProfilesPro) and number($uiProfilesNum) > 0">bua</xsl:when>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </param>
- <!-- LotusConnections Homepage -->
- <param name="lch">
- <xsl:choose>
- <xsl:when test="string(/root/collaborationApps/configuration/property[@name='lc_homepage_uri'])!=''">t</xsl:when>
- <xsl:otherwise>f</xsl:otherwise>
- </xsl:choose>
- </param>
- <!-- LotusConnections Activities -->
- <param name="lca">
- <xsl:choose>
- <xsl:when test="string(/root/collaborationApps/configuration/property[@name='lc_activities_uri'])!=''">t</xsl:when>
- <xsl:otherwise>f</xsl:otherwise>
- </xsl:choose>
- </param>
-
- <!-- Set session Desk top install state -->
- <param name="ci">
- <xsl:choose>
- <xsl:when test="/root/ciInstalled/cddNotFound">f</xsl:when>
- <xsl:otherwise>t</xsl:otherwise>
- </xsl:choose>
- </param>
- <!-- Support for m_root URL parameter and consumer_root entry in system.xml -->
- <!--
- Order of precedence
- 1. m_root value is used provided:
- - the user is not restricted by the consumer_root.
- - the user is restricted by the consumer_root and the restriction level is an ancestor of the value.
- - if it is not a part of the /content structure.
- 2. consumer_root value is used provided:
- - the system.xml file contains a value other than /content.
- - the user does not have administrator capabilities.
- -->
- <!-- No e_root session cookie entry is created when there are no m_root or consumer_root restrictions -->
-
- <xsl:if test="/root/mroot or /root/croot">
- <xsl:variable name="rootValue">
- <xsl:choose>
- <xsl:when test="/root/mroot">
- <xsl:choose>
- <xsl:when test="/root/croot and starts-with( string($mPath),'/content ') and ( not(boolean(/root/session/param[@name='capabilities']/canUseAdministrationPortal)) and not( contains( string($mPath),string($cPath) ) ) )"><xsl:value-of select="$cPath"/></xsl:when>
- <xsl:otherwise><xsl:value-of select="$mPath"/></xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="/root/croot and string($cPath) != '/content' and not(boolean(/root/session/param[@name='capabilities']/canUseAdministrationPortal))"><xsl:value-of select="$cPath"/></xsl:when>
- </xsl:choose>
- </xsl:variable>
- <param name="e_root"><xsl:value-of select="$rootValue"/></param>
- </xsl:if>
- <param name="write"><xsl:value-of select="string(contains($userAccount/cm:permissions, 'write'))"/></param>
- <!-- <param name="showGroupAndRolePages">true</param> -->
- <xsl:if test="string(key('system-param', 'http-cache'))='false'">
- <param name="no304"/>
- </xsl:if>
- <xsl:if test="string(key('system-param', 'series7')/enabled)='true'">
- <param name="s7e"/>
- </xsl:if>
- <param name="eom"><xsl:value-of select="key('system-param', 'entry-order-mode')"/></param>
- </xts:append>
- </xsl:otherwise>
- </xsl:choose>
- <!-- Cleanup - remove the existing passport entry otherwise duplicates get created -->
- <xts:delete select="/root/session/param[@name='pp']"/>
- <xts:delete select="/root/session/param[@name='ssshsh']"/>
- <xts:append select="/root/session">
- <!-- Make the cc_session passport-sensitive by tagging (a portion of) the passport to it. XTS will validate
- it to determine if it's valid with the current passport. If it's nolonger valid, XTS will clear it out forcing
- a session reconstruction. -->
- <xsl:variable name="cam_passport">
- <xsl:choose>
- <xsl:when test="/root/header/*[local-name()='biBusHeader']/*[local-name()='hdrSession']/*[local-name()='setCookieVars']/item[name='cam_passport']/value">
- <xsl:variable name="setPassportCookie" select="/root/header/*[local-name()='biBusHeader']/*[local-name()='hdrSession']/*[local-name()='setCookieVars']/item[name='cam_passport']/value"/>
- <xsl:value-of select="xtsext:camcookie_action('getPassportID', $setPassportCookie)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="/root/credential/param[@name='CAM']/*[local-name() ='CAM']/*[local-name() = 'CAMPassport']/*[local-name() = 'id']"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <param name="pp"><xsl:value-of select="xtsext:substringAfterLast(string($cam_passport), ':')"/></param>
- </xts:append>
-
- <!--
- If the CRN cookie is not available in the cookies element but it is available in the header's setCookie vars,
- it means that the CRN cookie was not initially available in the request and XTS did not get a chance to decode it an copy it to the session element
- We need to update the session with the CRN cookies values since they might be needed later
- -->
- <xsl:variable name="crn-setcookie" select="/root/header/*[local-name()='biBusHeader']/*[local-name()='hdrSession']/*[local-name()='setCookieVars']/item[name='CRN']/value"/>
- <xsl:if test=" not(cookies/cookie[@name='CRN']) and $crn-setcookie and $crn-setcookie != '' ">
- <xts:append select="/root/session">
- <xts:transform name="XMLDecode">
- <xsl:value-of select="xtsext:decodeCRNCookie($crn-setcookie)"/>
- </xts:transform>
- </xts:append>
- </xsl:if>
-
-
- <!-- MVC -->
- <xsl:if test="/root/mvcSettings">
- <xts:delete select="/root/session/param[@name='mvc']"/>
- <xts:delete select="/root/session/param[@name='mvcsys']"/>
- <xts:append select="/root/session">
- <xsl:variable name="mvc-remote-gateway" select="string(/root/mvcSettings/configuration/property[@name='MVC_remoteGateway'])"/>
- <xsl:variable name="mvc-remote-webcontent" select="string(/root/mvcSettings/configuration/property[@name='MVC_remoteWebContent'])"/>
- <xsl:variable name="mvc-N-enabled" select="$mvc-remote-gateway != '' and $mvc-remote-webcontent != ''"/>
- <xsl:if test="$mvc-N-enabled">
- <!-- The "mvc" cookie establishes MVC environment. This is important
- for the N-1 system esp. to handle the redirection/authentication.
- This cookie is set up by the N side and is visible to both N and N-1 systems -->
- <param name="mvc" type="NOPATH"/>
-
- <!-- The "mvcsys" cookie establishes that this is the N session in an mvc environment.
- This cookie is set up by the N side and is only visible to the N system -->
- <param name="mvcsys">n</param>
- </xsl:if>
- </xts:append>
- </xsl:if>
-
- <!-- Tell the set session block to repack the cc session cookie -->
- <xts:append>
- <updateSession/>
- </xts:append>
- </xts:sequence>
- </xsl:template>
-
- <!-- Build UI groups list -->
- <xsl:template name="setUIControlGroups">
- <xsl:variable name="userMembership" select="/root/newSession/cm:queryResponse/cm:queryReply[4]/cm:session/cm:identity"/>
- <xsl:for-each select="key('system-param', 'ui_groups')/group">
- <xsl:if test="$userMembership/*[cm:storeID = current()] and string-length(@id) < 3">
- <xsl:value-of select="concat(' ', @id, ' ')"/>
- </xsl:if>
- </xsl:for-each>
- </xsl:template>
-
- <!-- Determines the id of the first page in the user's portal tabs array -->
- <xsl:template name="set-dcid">
- <xsl:param name="account"/>
- <xsl:choose>
- <xsl:when test="string(key('system-param', 'hideInaccessibleTabs')) = 'true'">
- <xsl:value-of select="$account/cm:portalPages/*[contains((concat(' ', cm:permissions, ' ')) , ' read ') and contains((concat(' ', cm:permissions, ' ')) , ' traverse ')][1]/cm:storeID"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$account/cm:portalPages/*[1]/cm:storeID"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- </xsl:stylesheet>
|