123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192 |
- <?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:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/"
- xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
- xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
- xmlns:xts="http://developer.cognos.com/schemas/xts/"
- xmlns:mf="http://developer.cognos.com/schemas/xts/logicsheets/presentation/main/mf"
- xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/"
- xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
- xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/"
- xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
- xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
- xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/"
- xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
- xmlns:mru="http://developer.cognos.com/schemas/xts/mru/"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:out="dummy-uri">
-
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:namespace-alias stylesheet-prefix="out" result-prefix="xsl"/>
- <xsl:template match="mru:update">
- <out:variable name="mruFolder" select="concat(string(/root/session/param[@name='e_hp']),'/mruFolder')"/>
- <out:variable name="targetObjSearchPath">
- <out:value-of select="$mruTargetObjectSearchPath"/>
- </out:variable>
- <out:variable name="shorcutName">
- <out:value-of select="$mruTargetObjectId"/>
- </out:variable>
- <out:if test="string($targetObjSearchPath) != '' and string($shorcutName) != ''">
- <xts:sequence>
- <xts:append>
- <send:request provider="cm">
- <cm:add 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/bibus/3/"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:bus="http://developer.cognos.com/schemas/bibus/3/">
- <cm:search><out:value-of select="$mruFolder"/></cm:search>
- <objects xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="cm:baseClass[1]">
- <item xsi:type="cm:shortcut">
- <target xsi:type="cm:baseClassArrayProp">
- <value xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="cm:baseClass[1]">
- <item xsi:type="cm:nil">
- <searchPath xsi:type="cm:stringProp">
- <value xsi:type="xsd:string">
- <out:value-of select="$targetObjSearchPath"/>
- </value>
- </searchPath>
- </item>
- </value>
- </target>
- <defaultName xsi:type="cm:tokenProp">
- <value xsi:type="xsd:string">
- <out:value-of select="$shorcutName"/>
- </value>
- </defaultName>
- </item>
- </objects>
- <options xsi:type="cm:addOptions">
- <updateAction xsi:type="cm:updateActionEnum">update</updateAction>
- </options>
- </cm:add>
- </send:request>
- </xts:append>
- </xts:sequence>
- </out:if>
- </xsl:template>
- <xsl:template match="mru:read">
- <out:variable name="mruPath">
- <out:text>/mruFolder/*[@objectClass = 'shortcut']</out:text>
- </out:variable>
- <out:variable name="mruFolder" select="concat(string(/root/session/param[@name='e_hp']), $mruPath)"/>
- <cm:query>
- <cm:search><out:value-of select="$mruFolder"/></cm:search>
- <cm:properties>
- <cm:property name="defaultName"/>
- <cm:property name="permissions"/>
- <cm:property name="effectiveUserCapabilities"/>
- <cm:property name="searchPath"/>
- <cm:property name="storeID"/>
- </cm:properties>
- <cm:options schemaInfo="true">
- <cm:refProps>
- <cm:refProp refPropName="target">
- <cm:properties>
- <cm:property name="defaultName"/>
- <cm:property name="searchPath"/>
- <cm:property name="userInterfaces"/>
- <cm:property name="effectiveUserCapabilities"/>
- </cm:properties>
- </cm:refProp>
- </cm:refProps>
- </cm:options>
- <cm:sortBy>
- <!-- most recently used entry percolated to the top -->
- <cm:sort name="modificationTime" order="descending"/>
- </cm:sortBy>
- </cm:query>
- </xsl:template>
- <xsl:template match="mru:filter">
- <!--
- * Apply filter to objects in the MRU folder to:
- * a] return applicable (studio, permission) packages
- * b] suppress stale entries (entries whose referenced targets do not exist or have been renamed)
- * c] get rid of duplicate(s) (e.g.: same pkg redeployed)
- -->
- <mruPackages>
- <out:if test="count($mruShortcutNodes) > 0">
- <out:variable name="mruPkgs">
- <packages>
- <out:for-each select="$mruShortcutNodes">
- <out:variable name="userInterface"><out:value-of select="/root/launchComponent/userInterface"/></out:variable>
- <out:variable name="requiredCapability"><out:value-of select="/root/launchComponent/capability/@name"/></out:variable>
- <out:variable name="name" select="cm:target/*/cm:defaultName"/>
- <out:variable name="isPackage" select="string(cm:target/*/cm:objectClass) = 'package'"/>
- <out:if test="not(preceding-sibling::*[cm:target/*/cm:defaultName = $name])">
- <out:if test="$isPackage and (not(cm:target/*/cm:userInterfaces/child::node()) or cm:target/*/cm:userInterfaces/*[local-name()='uiComponentEnum' and string(.)=$userInterface])">
- <out:variable name="hasCapability" select="string($requiredCapability) = '' or boolean(cm:target/*/*[local-name()='effectiveUserCapabilities']/*[local-name() = $requiredCapability])"/>
- <out:if test="$hasCapability">
- <package>
- <out:value-of select="cm:target/*/cm:searchPath"/>
- <out:value-of select="/root/selectionSpec/item[@name='requestPredicate']"/>
- <out:value-of select="/root/selectionSpec/item[@name='selectionPermissions']"/>
- </package>
- </out:if>
- </out:if>
- </out:if>
- </out:for-each>
- </packages>
- </out:variable>
- <out:if test="count($mruPkgs/packages/package)>0">
- <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>
- <out:for-each select="$mruPkgs/packages/package">
- <cm:query>
- <cm:search><out:value-of select="string(.)"/></cm:search>
- <cm:properties>
- <cm:property name="objectClass"/>
- <cm:property name="defaultName"/>
- <cm:property name="storeID"/>
- <cm:property name="searchPath"/>
- <cm:property name="permissions"/>
- <cm:property name="effectiveUserCapabilities"/>
- </cm:properties>
- </cm:query>
- </out:for-each>
- </cm:requests>
- </cm:query>
- </xts:transform>
- </send:request>
- </xts:transform>
- </out:if>
- </out:if>
- </mruPackages>
- </xsl:template>
-
- <xsl:template match="*">
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- <xsl:apply-templates/>
- </xsl:copy>
- </xsl:template>
-
- </xsl:stylesheet>
|