123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: ps
- (C) Copyright IBM Corp. 2005, 2011
- 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:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
- xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
- xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
- exclude-result-prefixes="xts xtsext send bus cm pf">
-
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
-
- <pf:sessionpassport/>
-
- <xsl:template match="root">
-
- <xts:sequence>
- <!-- Read portal pages from CM -->
- <xts:append select="/root">
- <portalTabs xmlns="http://developer.cognos.com/schemas/xts-cm/1/" >
- <send:request provider="cm2" postxslt="transforms/CM/post-process-tabs.xslt">
- <bus:query xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
- xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:cm2="http://developer.cognos.com/schemas/contentManagerService/1"
- xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:bus="http://developer.cognos.com/schemas/bibus/3/">
-
- <search xsi:type="xsd:string">~</search>
- <properties xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:propEnum[1]">
- <item xsi:type="bus:propEnum">portalPages</item>
- </properties>
- <options xsi:type="bus:queryOptions">
- <schemaInfo xsi:type="xsd:boolean">false</schemaInfo>
- <refProps xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:refProp[1]">
- <item xsi:type="bus:refProp">
- <refPropName xsi:type="bus:propEnum">portalPages</refPropName>
- <properties xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:propEnum[5]">
- <item xsi:type="bus:propEnum">defaultName</item>
- <item xsi:type="bus:propEnum">permissions</item>
- <item xsi:type="bus:propEnum">searchPath</item>
- <item xsi:type="bus:propEnum">disabled</item>
- <item xsi:type="bus:propEnum">storeID</item>
- </properties>
- </item>
- </refProps>
- </options>
- </bus:query>
- </send:request>
- </portalTabs>
- </xts:append>
-
- <!-- Remove any objects from the portal pages array that we don't support (CC only supports objects of type pagelet, content and folder when it is the root personal folder only) -->
- <xts:delete select="/root/portalTabs/*[(local-name() != 'content' and local-name() != 'pagelet' and local-name() != 'folder') or (local-name() = 'folder' and ./*[local-name() = 'storeID'] != /root/session/param[@name='mrootid'] ) ] "/>
- <xsl:if test="string(/root/system/param[@name='hideInaccessibleTabs']) = 'true'">
- <!-- Throw away inaccessible tabs -->
- <xts:delete select="/root/*[local-name()='portalTabs']/*[not(contains(concat(' ', ./*[local-name() = 'permissions'], ' '), ' execute '))] "/>
- <!-- Update cached id of the first tab in case it happens to be one of the tabs we tosses away above -->
- <xts:replace select="/root/session/param[@name='dcid']"><param name="dcid"><xts:queryValue select="/root/*[local-name()='portalTabs']/*/*[local-name()='storeID']"/></param></xts:replace>
- </xsl:if>
-
-
- <xts:append>
- <TDS-set>
- <xts:function name="TDSRequest">
- <xts:param name="action">set</xts:param>
- <xts:param name="session-id"><xsl:value-of select="$passport"/></xts:param>
- <xts:param name="name"><xsl:value-of select="'ccPages'"/></xts:param>
- <xts:param name="source">
- <xts:transform xmlns:xts="http://developer.cognos.com/schemas/xts/" name="XMLEncode">
- <xts:queryNode select="/root/*[local-name()= 'portalTabs']"/>
- </xts:transform>
- </xts:param>
- </xts:function>
- </TDS-set>
- </xts:append>
-
- <!-- New cache stamp -->
- <xsl:variable name="cachestamp" select="xtsext:getCurrentDateTime('EST')"/>
-
- <xsl:choose>
- <xsl:when test="/root/session/param[@name='cachestamp']">
- <xts:replace select="/root/session/param[@name='cachestamp']">
- <param name="cachestamp"><xsl:value-of select="$cachestamp"/></param>
- </xts:replace>
- </xsl:when>
- <xsl:otherwise>
- <xts:append select="/root/session">
- <param name="cachestamp"><xsl:value-of select="$cachestamp"/></param>
- </xts:append>
- </xsl:otherwise>
- </xsl:choose>
-
-
- <!-- Tell the set session block to repack the cc session cookie -->
- <xts:append>
- <updateSession/>
- </xts:append>
-
- <!-- Add the tabs to where they would normally be stored -->
-
- <xts:replace select="/root/cmContent/*[local-name()='queryResponse']/*[local-name()='queryReply'][1]/*[local-name()='runTimeState']">
- <runTimeState xmlns="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
- <xts:queryNode select="/root/*[local-name()= 'portalTabs']"/>
- </runTimeState>
- </xts:replace>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
|