123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- <?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).
- -->
- <!-- File: Content request for retrieving the default names of the "public" or "Personal" tabs -->
- <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/">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" omit-xml-declaration="yes" indent="no"/>
- <xsl:template match="root">
- <xts:sequence>
- <!-- Get the defaultName property of the "public" and "personal" folder spaces -->
- <xts:append>
- <cmRoots>
- <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
- <send:request provider="cm">
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
- <cm:requests>
- <cm:query>
- <cm:search>/content</cm:search>
- <cm:properties><cm:property name="defaultName"/></cm:properties>
- </cm:query>
- <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
- <cm:search>~/folder</cm:search>
- <cm:properties><cm:property name="defaultName"/></cm:properties>
- </cm:query>
- <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
- <cm:search>~</cm:search>
- <cm:properties><cm:property name="searchPath"/></cm:properties>
- </cm:query>
- </cm:requests>
- </cm:query>
- </xts:transform>
- </send:request>
- </xts:transform>
- </cmRoots>
- </xts:append>
-
- <xsl:choose>
- <!-- If there is an existing session with "root" parameters in it then update the root parameters. -->
- <xsl:when test="/root/session/param[@name='e_proot']">
- <xts:replace select="/root/session/param[@name='e_proot']">
- <param name="e_proot"><xts:function name="xmlencode"><xts:param name="source"><xts:queryValue select="/root/cmRoots/*[local-name()='queryResponse']/*[local-name()='queryReply'][1]/*/*[local-name()='defaultName']"/></xts:param></xts:function></param>
- </xts:replace>
- <xts:replace select="/root/session/param[@name='e_mroot']">
- <param name="e_mroot"><xts:function name="xmlencode"><xts:param name="source"><xts:queryValue select="/root/cmRoots/*[local-name()='queryResponse']/*[local-name()='queryReply'][2]/*/*[local-name()='defaultName']"/></xts:param></xts:function></param>
- </xts:replace>
- <xts:replace select="/root/session/param[@name='e_hp']">
- <param name="e_hp"><xts:function name="xmlencode"><xts:param name="source"><xts:queryValue select="/root/cmRoots/*[local-name()='queryResponse']/*[local-name()='queryReply'][3]/*/*[local-name()='searchPath']"/></xts:param></xts:function></param>
- </xts:replace>
- </xsl:when>
- <!-- There is no portal session to update. We must be here through a back door. Fake a sesion element to be used for processing this request only and add the e_proot, mroot and hp params to it. -->
- <xsl:otherwise>
- <xts:append select="/root/session">
- <param name="e_proot"><xts:function name="xmlencode"><xts:param name="source"><xts:queryValue select="/root/cmRoots/*[local-name()='queryResponse']/*[local-name()='queryReply'][1]/*/*[local-name()='defaultName']"/></xts:param></xts:function></param>
- <param name="e_mroot"><xts:function name="xmlencode"><xts:param name="source"><xts:queryValue select="/root/cmRoots/*[local-name()='queryResponse']/*[local-name()='queryReply'][2]/*/*[local-name()='defaultName']"/></xts:param></xts:function></param>
- <param name="e_hp"><xts:function name="xmlencode"><xts:param name="source"><xts:queryValue select="/root/cmRoots/*[local-name()='queryResponse']/*[local-name()='queryReply'][3]/*/*[local-name()='searchPath']"/></xts:param></xts:function></param>
- </xts:append>
- </xsl:otherwise>
- </xsl:choose>
-
- <!-- Clean up -->
- <xts:delete select="/root/cmRoots/*[local-name()='queryResponse']"/>
-
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
|