123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472 |
- <?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: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:pf="http://developer.cognos.com/schemas/xts/pf"
- xmlns:pm="http://developer.cognos.com/schemas/xts/pm"
- xmlns:so="http://developer.cognos.com/schemas/xts/logicsheets/xslt/so/"
- xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
- xmlns:mru="http://developer.cognos.com/schemas/xts/mru/"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:xts="http://developer.cognos.com/schemas/xts/"
- xmlns:pattern="java:org.apache.oro.text.awk.AwkCompiler"
- xmlns:matcher="java:org.apache.oro.text.awk.AwkMatcher"
- xmlns:string="java:java.lang.String"
- exclude-result-prefixes="xsl send bus xts xtsext pf cm string matcher pattern pm">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:key name="env-param" match="/root/env/param" use="@name"/>
- <xsl:key name="session-param" match="/root/session/param" use="@name"/>
- <xsl:key name="system-param" match="/root/system/param" use="@name"/>
- <xsl:key name="spec-item" match="/root/selectionSpec/item" use="@name"/>
- <pf:variables/>
- <pm:permissions origin="/root/*[local-name()='queryResponse']/*[local-name()='queryReply'][1]/*/"/>
- <xsl:variable name="containerId" select="/root/*[local-name()='queryResponse']/*[local-name()='queryReply'][1]/*/*[local-name()='storeID']"/>
- <xsl:variable name="containerClass" select="/root/*[local-name()='queryResponse']/*[local-name()='queryReply'][1]/*/*[local-name()='objectClass']"/>
- <xsl:variable name="displayRoot" select="key('spec-item','presentation')/options/option[@name='displayVirtualRootNode']"/>
- <xsl:variable name="displayMRU" select="key('spec-item','presentation')/options/option[@name='displayMRU']"/>
- <xsl:variable name="modes" select="key('spec-item','modes')"/>
- <xsl:variable name="selectableObjects" select="string(key('spec-item','selectableObjects'))"/>
- <xsl:variable name="shortcut-targets" select="string(key('spec-item','shortcut-targets'))"/>
- <xsl:variable name="moveOnly" select="string(key('spec-item','operation')/@moveOnly)='true'"/>
- <xsl:variable name="isContainerMoveOrCopy" select="string(key('spec-item','operation')/@containerMoveOrCopy)='true'"/>
- <xsl:variable name="inputObjectId" select="key('spec-item','inputObjectId')"/>
- <xsl:variable name="inputObjectParentId" select="key('spec-item','inputObjectId')/@parentId"/>
- <xsl:variable name="inputObjectRootClass" select="key('spec-item','inputObjectId')/@rootClass"/>
- <xsl:variable name="launchableObjects" select="concat(' ',string(key('spec-item','launchableObjects')),' ')"/>
- <xsl:variable name="containerObjects" select="concat(' ',string(key('spec-item','containerObjects')),' ')"/>
- <xsl:variable name="actions" select="key('spec-item','actions')"/>
- <xsl:variable name="copyUserProfile" select="key('spec-item','copy_user_profile')"/>
- <xsl:variable name="displayRootDisabled" select="key('spec-item','presentation')/options/option[@name='displayRootDisabled']"/>
- <xsl:variable name="myFoldersIcon" select="string(key('spec-item','navigationId')/@myFoldersIcon)='true'"/>
- <xsl:variable name="publicFoldersIcon" select="string(key('spec-item','navigationId')/@publicFoldersIcon)='true'"/>
- <xsl:variable name="startDisplayAt" select="string(key('spec-item','presentation')/options/option[@name='startDisplayAt'])"/>
- <xsl:variable name="navigationId" select="string(key('spec-item','navigationId'))"/>
- <xsl:variable name="atRoot" select="string(key('spec-item','navigationId')/@atRoot)"/>
- <xsl:variable name="hasInitValue" select="string(key('spec-item','navigationId')/@initValue)"/>
- <xsl:variable name="mruList" select="/root/*[local-name()='queryResponse']/*[local-name()='queryReply'][3]"/>
- <xsl:variable name="verifyPackageWhenSearch" select="/root/*[local-name()='queryResponse']/*[local-name()='queryReply'][3]"/>
- <xsl:variable name="verifyPackage" select="/root/*[local-name()='queryResponse']/*[local-name()='queryReply'][4]"/>
- <xsl:variable name="filterToExcludeReportViewWithBaseObject" select="string(key('spec-item','filterToExcludeReportViewWithBaseObject'))"/>
- <xsl:variable name="overrideRoleChildRequirement" select="key('spec-item','overrideRoleChildRequirement')"/>
- <!--
- <xsl:variable name="containerPermissions">contains(./*[local-name()='permissions'],'write') and contains(./*[local-name()='permissions'],'traverse')</xsl:variable>
- <xsl:variable name="containerPermissions"><xsl:value-of select="key('spec-item','filterToSelectContainerObjects')"/></xsl:variable>
- <xsl:variable name="selectablePermissions">contains(./*[local-name()='permissions'],'read') or contains(./*[local-name()='permissions'],'execute')</xsl:variable>
- <xsl:variable name="selectablePermissions"><xsl:value-of select="key('spec-item','filterToSelectNonContainerObjects')"/></xsl:variable>
- <xsl:variable name="navigatePermissions"><xsl:value-of select="key('spec-item','filterToContainerObjects')"/></xsl:variable>
- -->
- <xsl:template match="root">
- <queryResponse xmlns="http://developer.cognos.com/schemas/xts-cm/1/">
- <queryReply xmlns="http://developer.cognos.com/schemas/xts-cm/1/">
- <xsl:copy-of select="/root/*[local-name()='queryResponse']/*[local-name()='queryReply'][1]/@*"/>
- <xsl:apply-templates select="/root/*[local-name()='queryResponse']/*[local-name()='queryReply'][1]/*" mode="one"/>
- </queryReply>
- <xsl:choose>
- <xsl:when test="count(/root/*[local-name()='queryResponse']/*[local-name()='queryReply'][2]/*)>0">
- <queryReply xmlns="http://developer.cognos.com/schemas/xts-cm/1/">
- <xsl:copy-of select="/root/*[local-name()='queryResponse']/*[local-name()='queryReply'][2]/@*"/>
- <xsl:apply-templates select="/root/*[local-name()='queryResponse']/*[local-name()='queryReply'][2]/*" mode="two"/>
- </queryReply>
- </xsl:when>
- <xsl:otherwise><queryReply xmlns="http://developer.cognos.com/schemas/xts-cm/1/"/></xsl:otherwise>
- </xsl:choose>
- <xsl:if test="string(key('env-param','sosmode')) != 'search' and count($mruList/*)>0">
- <queryReply xmlns="http://developer.cognos.com/schemas/xts-cm/1/">
- <xsl:copy-of select="$mruList/@*"/>
- <xsl:apply-templates select="$mruList" mode="three"/>
- </queryReply>
- </xsl:if>
- </queryResponse>
- </xsl:template>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - PROCESS PARENT REPLY NODE - - - - - - - - - - - - - - - - - - - - - - - - -->
- <xsl:template match="/root/*[local-name()='queryResponse']/*[local-name()='queryReply'][1]/*" mode="one">
- <xsl:variable name="inMyFolders" select="./*[local-name()='storeID']=key('session-param','mrootid') or ./*[local-name()='ancestors']/*/*[local-name()='storeID' and string(.)=key('session-param','mrootid')]"/>
- <xsl:variable name="inUsersMyFolders" select="not(./*[local-name()='storeID']=key('session-param','mrootid') or ./*[local-name()='ancestors']/*/*[local-name()='storeID' and string(.)=key('session-param','mrootid')]) and ./*[local-name()='ancestors']/*/*[local-name()='objectClass' and contains(string(.),'namespace')] and ./*[local-name()='ancestors']/*/*[local-name()='objectClass' and contains(string(.),'account')] and ./*[local-name()='objectClass']='folder'"/>
- <xsl:variable name="inMySubscriptionFolder" select="./*[local-name()='objectClass']='subscriptionFolder' and ./*[local-name()='ancestors']/*/*[local-name()='searchPath' and string(.)=key('session-param','e_hp')]"/>
- <xsl:variable name="inPublicFolders" select="./*[local-name()='storeID']=key('session-param','prootid') or ./*[local-name()='ancestors']/*/*[local-name()='storeID' and string(.)=key('session-param','prootid')]"/>
- <xsl:variable name="inAdminFolders" select="./*[local-name()='objectClass']='adminFolder'"/>
- <xsl:variable name="ancestorsIncludeMyFolders" select="./*[local-name()='ancestors']/*/*[local-name()='objectClass' and contains(string(.),'namespace')] and ./*[local-name()='ancestors']/*/*[local-name()='objectClass' and contains(string(.),'account')] and ./*[local-name()='ancestors']/*/*[local-name()='objectClass' and contains(string(.),'folder')]"/>
- <xsl:variable name="ancestorsIncludeUsersMyFolders" select="not(./*[local-name()='ancestors']/*/*[local-name()='storeID' and string(.)=key('session-param','mrootid')]) and ./*[local-name()='ancestors']/*/*[local-name()='objectClass' and contains(string(.),'namespace')] and ./*[local-name()='ancestors']/*/*[local-name()='objectClass' and contains(string(.),'account')] and ./*[local-name()='ancestors']/*/*[local-name()='objectClass' and contains(string(.),'folder')]"/>
- <xsl:copy>
- <xsl:copy-of select="./@*"/>
- <xsl:choose>
- <xsl:when test="$ancestorsIncludeUsersMyFolders='true'">
- <xsl:copy-of select="./*[not(local-name()='ancestors')]"/>
- <xsl:apply-templates select="./*[local-name()='ancestors']" mode="ans"/>
- </xsl:when>
- <xsl:when test="$inUsersMyFolders='true'">
- <xsl:copy-of select="./*[not(local-name()='defaultName')]"/>
- <defaultName>
- <xsl:value-of select="concat(string(./*[local-name()='defaultName']),' (',string(./*[local-name()='ancestors']/*/*[local-name()='objectClass' and string(.)='account']/../*[local-name()='title']),')')"/>
- </defaultName>
- </xsl:when>
- <xsl:otherwise>
- <xsl:copy-of select="./*"/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test="$canWrite and $actions/action">
- <xsl:for-each select="$actions/action">
- <action xmlns="http://developer.cognos.com/schemas/xts-cm/1/">
- <xsl:copy-of select="./@*"/>
- <xsl:for-each select="./param">
- <xsl:variable name="concatName" select="concat('m_',@name)"/>
- <xsl:element name="{$concatName}"><xsl:value-of select="."/></xsl:element>
- </xsl:for-each>
- <xsl:for-each select="./item">
- <xsl:element name="{@name}"><xsl:value-of select="."/></xsl:element>
- </xsl:for-each>
- </action>
- </xsl:for-each>
- <!-- <newAction xmlns="http://developer.cognos.com/schemas/xts-cm/1/">
- <xsl:copy-of select="$actions/new/@*"/>
- <xsl:for-each select="$actions/new/param">
- <xsl:variable name="concatName" select="concat('m_',@name)"/>
- <xsl:attribute name="{$concatName}"><xsl:value-of select="."/></xsl:attribute>
- </xsl:for-each>
- <xsl:if test="contains($containerObjects,concat(' ',string($actions/new/param[@name='new_class']),' '))">
- <xsl:attribute name="isContainer">true</xsl:attribute>
- </xsl:if>
- </newAction> -->
- </xsl:if>
- <xsl:if test="key('spec-item','presentation')/options/option[@name='displayCheckbox']">
- <xsl:variable name="objClass" select="./*[local-name()='objectClass']"/>
- <displayCheckboxDisabled>
- <xsl:choose>
- <xsl:when test="string(key('spec-item','presentation')/options/option[@name='displayCheckbox']/@disabledAtContainer) = $objClass">true</xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </displayCheckboxDisabled>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="contains($selectableObjects,concat(' ',$containerClass,' ')) and not($moveOnly and $inputObjectId=$containerId) and not($moveOnly and $isContainerMoveOrCopy and ($inputObjectId=$containerId or $inputObjectParentId=$containerId))">
- <!-- userInterface checking required for bread crumb since request predicate filter would be too restrictive -->
- <xsl:variable name="matchesUserInterface">
- <xsl:call-template name="matchUserInterface">
- <xsl:with-param name="useClass" select="$containerClass"/>
- </xsl:call-template>
- </xsl:variable>
- <!-- COGCQ00136780 - Portlet Generic Editor: Unable to navigate to and select a CMM package which resides under an FM package. -->
- <!-- The matching condition test moved here so that the bread crumb radio button is not displayed inactive, for the object that has no userinterface match -->
- <xsl:if test="$matchesUserInterface='true'">
- <locationSelect xmlns="http://developer.cognos.com/schemas/xts-cm/1/">
- <xsl:if test="(($navigationId != '' and ($hasInitValue!='true' or $inputObjectId='')) and $navigationId = $containerId) or $inputObjectId = $containerId">
- <xsl:attribute name="checked">true</xsl:attribute>
- </xsl:if>
- <xsl:variable name="permExpression">
- <xsl:call-template name="permissionsExpression">
- <xsl:with-param name="useClass" select="$containerClass"/>
- <xsl:with-param name="filterName" select="'filterToSelectContainerObjects'"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$permExpression='nil' or matcher:matches(matcher:new(), ./*[local-name()='permissions'], pattern:compile(pattern:new(), $permExpression))">
- <xsl:attribute name="enable">true</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="enable">false</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </locationSelect>
- </xsl:if>
- </xsl:when>
- <xsl:when test="(contains($selectableObjects,concat(' ',$containerClass,' ')) or $displayRootDisabled) and $atRoot!='true'">
- <locationSelect enable="false" xmlns="http://developer.cognos.com/schemas/xts-cm/1/"/>
- </xsl:when>
- </xsl:choose>
- <xsl:if test="(contains($selectableObjects,concat(' ',$containerClass,' ')) or $displayRootDisabled) and $atRoot!='true'">
- <locationGenIcons xmlns="http://developer.cognos.com/schemas/xts-cm/1/">
- <xsl:choose>
- <xsl:when test="$myFoldersIcon"><xsl:attribute name="type">myFolders</xsl:attribute></xsl:when>
- <xsl:when test="$publicFoldersIcon"><xsl:attribute name="type">publicFolders</xsl:attribute></xsl:when>
- <xsl:otherwise><xsl:attribute name="type">default</xsl:attribute></xsl:otherwise>
- </xsl:choose>
- </locationGenIcons>
- </xsl:if>
- <xsl:if test="string($atRoot)='true' or string($inMyFolders)='true' or string($inUsersMyFolders)='true' or string($inMySubscriptionFolder)='true' or string($ancestorsIncludeMyFolders)='true' or string($ancestorsIncludeUsersMyFolders)='true'">
- <locationRootName xmlns="http://developer.cognos.com/schemas/xts-cm/1/"><xsl:value-of select="key('spec-item','rootNodeMessage')"/></locationRootName>
- </xsl:if>
- <selectionRoot>
- <xsl:choose>
- <xsl:when test="$displayRoot">
- <xsl:choose>
- <xsl:when test="$inMyFolders='true' or $inMySubscriptionFolder='true'"><xsl:value-of select="key('session-param', 'e_hp')"/></xsl:when>
- <xsl:when test="$inUsersMyFolders='true' or $ancestorsIncludeUsersMyFolders='true'"><xsl:value-of select="./*[local-name()='ancestors']/*/*[local-name()='objectClass' and string(.)='account']/../*[local-name()='searchPath']"/></xsl:when>
- <xsl:when test="$ancestorsIncludeMyFolders='true' and not($atRoot='true')">/</xsl:when>
- <xsl:when test="$inPublicFolders='true' or $atRoot='true'">/</xsl:when>
- <xsl:when test="$inputObjectRootClass = 'adminFolder' or $inAdminFolders">/</xsl:when>
- <xsl:otherwise><xsl:value-of select="concat('/',$inputObjectRootClass)"/></xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="string($startDisplayAt)!=''">
- <xsl:choose>
- <xsl:when test="./*[local-name()='ancestors']/*/*[local-name()='objectClass' and string(.)=$startDisplayAt]"><xsl:value-of select="./*[local-name()='ancestors']/*/*[local-name()='objectClass' and string(.)=$startDisplayAt]/../*[local-name()='searchPath']"/></xsl:when>
- <xsl:when test="./*[local-name()='objectClass' and string(.)=$startDisplayAt]"><xsl:value-of select="./*[local-name()='searchPath']"/></xsl:when>
- <xsl:otherwise><xsl:value-of select="concat('/',$inputObjectRootClass)"/></xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </selectionRoot>
- <!-- check to set if search should be allowed -->
- <xsl:if test="$modes/search">
- <searchmode>
- <xsl:if test="string($modes/search/@disabledAtContainer) = ./*[local-name()='objectClass']">
- <xsl:attribute name="disabled">true</xsl:attribute>
- </xsl:if>
- </searchmode>
- </xsl:if>
- </xsl:copy>
- </xsl:template>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - PROCESS CHILD REPLY NODES - - - - - - - - - - - - - - - - - - - - - - - - -->
- <xsl:template match="/root/*[local-name()='queryResponse']/*[local-name()='queryReply'][2]/*" mode="two">
- <xsl:variable name="objectPerm"><xsl:value-of select="./*[local-name()='permissions']"/></xsl:variable>
- <xsl:variable name="obj" select="./*[local-name()='objectClass']"/>
-
- <!--
- * Determine if there's a specified required capability to launch or select an object; and if so, calculate
- * if user has capability.
- -->
- <xsl:variable name="hasCapability">
- <xsl:variable name="effectiveUserCapabilities" select="./cm:effectiveUserCapabilities | ./*/*/cm:effectiveUserCapabilities"/>
- <xsl:variable name="doLaunch" select="key('spec-item','presentation')/options/option[@name='isLaunchable']"/>
- <xsl:variable name="doSelection" select="key('spec-item','presentation')/options/option[@name='isSelectable']"/>
- <xsl:choose>
- <xsl:when test="$doLaunch">
- <xsl:variable name="requiredCapability" select="$doLaunch/capability"/>
- <xsl:value-of select="string($requiredCapability) = '' or boolean($effectiveUserCapabilities/*[local-name() = $requiredCapability])"/>
- </xsl:when>
- <xsl:when test="$doSelection">
- <xsl:variable name="requiredCapability" select="$doSelection/capability[@class=$obj]"/>
- <xsl:value-of select="string($requiredCapability) = '' or boolean($effectiveUserCapabilities/*[local-name() = $requiredCapability])"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="true()"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:copy>
- <xsl:copy-of select="./*"/>
- <xsl:if test="string($atRoot)='true' and $displayRoot">
- <xsl:variable name="position" select="position() - 1"/>
- <position xmlns="http://developer.cognos.com/schemas/xts-cm/1/"><xsl:value-of select="$position"/></position>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="$atRoot='true' and $displayRoot and string(./*[local-name()='storeID'])=string(key('session-param','mrootid')) and string(key('session-param','write'))!='true'"/>
- <xsl:when test="contains($selectableObjects,concat(' ',$obj,' ')) and $hasCapability='true'">
- <!-- Handle selectable objects -->
- <xsl:choose>
- <xsl:when test="contains($containerObjects,concat(' ',$obj,' '))">
- <!-- Handle containers -->
- <xsl:if test="not($moveOnly and $inputObjectId = ./*[local-name()='storeID']) and
- not($isContainerMoveOrCopy and ($inputObjectId=./*[local-name()='storeID'] or $inputObjectParentId=./*[local-name()='storeID'])) and
- (./*[local-name()='objectClass']!='reportView' or string(./*[local-name()='base']/@nil)='')">
- <xsl:variable name="matchesUserInterface">
- <xsl:call-template name="matchUserInterface">
- <xsl:with-param name="useClass" select="$obj"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="permExpression">
- <xsl:call-template name="permissionsExpression">
- <xsl:with-param name="useClass" select="$obj"/>
- <xsl:with-param name="filterName" select="'filterToSelectContainerObjects'"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:if test="$matchesUserInterface='true' and ($permExpression='nil' or matcher:matches(matcher:new(), $objectPerm, pattern:compile(pattern:new(), $permExpression)))">
- <radio xmlns="http://developer.cognos.com/schemas/xts-cm/1/">
- <xsl:if test="(($navigationId != '' and ($hasInitValue!='true' or $inputObjectId='')) and $navigationId = ./*[local-name()='storeID']) or $inputObjectId = ./*[local-name()='storeID']">
- <xsl:attribute name="checked">true</xsl:attribute>
- </xsl:if>
- </radio>
- </xsl:if>
- </xsl:if>
- </xsl:when>
- <xsl:when test="not($moveOnly and $inputObjectId = ./*[local-name()='storeID']) and
- not($isContainerMoveOrCopy and ($inputObjectId=./*[local-name()='storeID'] or $inputObjectParentId=./*[local-name()='storeID'])) and
- (./*[local-name()='objectClass']!='reportView' or string(./*[local-name()='base']/@nil)='')">
- <!-- Handle non-containers -->
- <xsl:variable name="permExpression">
- <xsl:call-template name="permissionsExpression">
- <xsl:with-param name="useClass" select="$obj"/>
- <xsl:with-param name="filterName" select="'filterToSelectNonContainerObjects'"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="exclude-reportView">
- <xsl:choose>
- <xsl:when test="$obj = 'reportView' and contains(string($filterToExcludeReportViewWithBaseObject), concat(' ', ./*[local-name()='base']/*/*[local-name()='objectClass'], ' '))"><xsl:value-of select="true()"/></xsl:when>
- <xsl:otherwise><xsl:value-of select="false()"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="exclude-shortcut-targets">
- <xsl:choose>
- <xsl:when test="$obj != 'shortcut' or not($shortcut-targets)"><xsl:value-of select="false()"/></xsl:when>
- <xsl:otherwise><xsl:value-of select="not(contains($shortcut-targets, concat(' ', ./*[local-name()='target']/*/*[local-name()='objectClass'], ' ')))"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:if test="not($exclude-reportView='true') and not($exclude-shortcut-targets='true') and ($permExpression='nil' or matcher:matches(matcher:new(), $objectPerm, pattern:compile(pattern:new(), $permExpression)))">
- <radio xmlns="http://developer.cognos.com/schemas/xts-cm/1/">
- <xsl:if test="(($navigationId != '' and ($hasInitValue!='true' or $inputObjectId='')) and $navigationId = ./*[local-name()='storeID']) or $inputObjectId = ./*[local-name()='storeID']">
- <xsl:attribute name="checked">true</xsl:attribute>
- </xsl:if>
- </radio>
- </xsl:if>
- </xsl:when>
- </xsl:choose>
- </xsl:when>
- </xsl:choose>
- <genIcon xmlns="http://developer.cognos.com/schemas/xts-cm/1/">
- <xsl:choose>
- <xsl:when test="$myFoldersIcon and $atRoot='true' and string(./*[local-name()='storeID'])=string(key('session-param','mrootid'))"><xsl:attribute name="type">myFolders</xsl:attribute></xsl:when>
- <xsl:when test="$publicFoldersIcon and $atRoot='true' and string(./*[local-name()='storeID'])=string(key('session-param','prootid'))"><xsl:attribute name="type">publicFolders</xsl:attribute></xsl:when>
- <xsl:when test="string($obj)!='reportView'"><xsl:attribute name="type">default</xsl:attribute></xsl:when>
- <xsl:otherwise><xsl:attribute name="type">reportView</xsl:attribute></xsl:otherwise>
- </xsl:choose>
- </genIcon>
- <xsl:if test="not($isContainerMoveOrCopy and $inputObjectId=./*[local-name()='storeID']) and (contains($containerObjects,concat(' ',$obj,' ')))">
- <!--
- Set drill when:
- - when in navigate mode
- - when objectClass roles and there are children.
- -->
- <xsl:if test="(string(key('env-param','sosmode')) != 'search' or $launchableObjects!='') and (not($obj='role' and string(./*[local-name()='hasChildren'])!='true') or $overrideRoleChildRequirement='true')">
- <xsl:variable name="permExpression">
- <xsl:call-template name="permissionsExpression">
- <xsl:with-param name="useClass" select="$obj"/>
- <xsl:with-param name="filterName" select="'filterToDrillContainerObjects'"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:if test="$permExpression='' or matcher:matches(matcher:new(), $objectPerm, pattern:compile(pattern:new(), $permExpression))">
- <drill name="{./*[local-name()='defaultName']}" xmlns="http://developer.cognos.com/schemas/xts-cm/1/"><xsl:value-of select="xtsext:javascriptencode(./*[local-name()='storeID'])"/></drill>
- </xsl:if>
- </xsl:if>
- </xsl:if>
- <xsl:if test="$launchableObjects!='' and contains($launchableObjects,concat(' ',$obj,' '))">
- <!-- Determine if the the package gets hyperlinked to launch a studio -->
- <!-- NOTE: the queryReply array differs between navigate and search, since navigate has a query for MRU -->
- <xsl:variable name="objectId" select="./*[local-name()='storeID']"/>
- <xsl:variable name="dfltName" select="./*[local-name()='defaultName']"/>
-
- <xsl:choose>
- <xsl:when test="string(key('env-param','sosmode')) != 'search' and $verifyPackage">
- <xsl:choose>
- <xsl:when test="$hasCapability = 'true' and count($verifyPackage/*)>0 and $verifyPackage/*/*[local-name()='storeID' and string(.) = string($objectId)]">
- <launch name="{$dfltName}" xmlns="http://developer.cognos.com/schemas/xts-cm/1/"><xsl:value-of select="xtsext:javascriptencode(string($objectId))"/></launch>
- </xsl:when>
- <xsl:otherwise><noActionLaunch name="{$dfltName}" xmlns="http://developer.cognos.com/schemas/xts-cm/1/"/></xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="string(key('env-param','sosmode')) = 'search' and $verifyPackageWhenSearch">
- <xsl:choose>
- <xsl:when test="$hasCapability = 'true' and count($verifyPackageWhenSearch/*)>0 and $verifyPackageWhenSearch/*/*[local-name()='storeID' and string(.) = string($objectId)]">
- <launch name="{$dfltName}" xmlns="http://developer.cognos.com/schemas/xts-cm/1/"><xsl:value-of select="xtsext:javascriptencode(string($objectId))"/></launch>
- </xsl:when>
- <xsl:otherwise><noActionLaunch name="{$dfltName}" xmlns="http://developer.cognos.com/schemas/xts-cm/1/"/></xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <launch name="{$dfltName}" xmlns="http://developer.cognos.com/schemas/xts-cm/1/"><xsl:value-of select="xtsext:javascriptencode(string($objectId))"/></launch>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:copy>
- </xsl:template>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - PROCESS SPECIAL REPLY NODES - - - - - - - - - - - - - - - - - - - - - - - - -->
- <xsl:template match="/root/*[local-name()='queryResponse']/*[local-name()='queryReply'][3]" mode="three">
- <xsl:copy-of select="*"/>
- </xsl:template>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - PROCESS OTHER USERS ANCESTOR NODES FOR MY FOLDERS - - - - - - - - - - - - - - - - - - - - - - - - -->
- <xsl:template match="*[local-name()='ancestors']" mode="ans">
- <ancestors>
- <xsl:copy-of select="./@*"/>
- <xsl:variable name="accountName" select="concat( '(', string(./*/*[local-name()='objectClass' and string(.)='account']/../*[local-name()='title']), ')' )"/>
- <xsl:for-each select="./*">
- <xsl:choose>
- <xsl:when test="preceding-sibling::*/*[local-name()='objectClass' and string(.)='account']">
- <xsl:choose>
- <xsl:when test="not(preceding-sibling::*/*[local-name()='objectClass' and string(.)='folder'])">
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- <xsl:for-each select="./*">
- <xsl:choose>
- <xsl:when test="local-name()!='title'">
- <xsl:copy-of select="."/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- <xsl:value-of select="concat(string(.),' ',$accountName)"/>
- </xsl:copy>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </xsl:copy>
- </xsl:when>
- <xsl:otherwise>
- <xsl:copy-of select="."/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise><xsl:copy-of select="."/></xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </ancestors>
- </xsl:template>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - MATCHUSERINTERFACE TEMPLATE - - - - - - - - - - - - - - - - - - - - - - - - -->
- <xsl:template name="matchUserInterface">
- <xsl:param name="useClass" select="''"/>
- <xsl:variable name="userInterfacesExpression">
- <xsl:if test="string(key('spec-item','userInterfacesFilter')/@objectClass)=$useClass">
- <xsl:value-of select="key('spec-item','userInterfacesFilter')[@objectClass=$useClass]"/>
- </xsl:if>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$userInterfacesExpression = ''">true</xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="matcher:matches(matcher:new(), string(./*[local-name()='userInterfaces']), pattern:compile(pattern:new(), $userInterfacesExpression))">true</xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - PERMISSIONSEXPRESSION TEMPLATE - - - - - - - - - - - - - - - - - - - - - - - - -->
- <xsl:template name="permissionsExpression">
- <xsl:param name="useClass" select="''"/>
- <xsl:param name="filterName" select="''"/>
- <xsl:choose>
- <xsl:when test="/root/selectionSpec/item[@name=$filterName and contains(@object,string($useClass))]">
- <xsl:value-of select="/root/selectionSpec/item[@name=$filterName and contains(@object,string($useClass))]"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="key('spec-item',$filterName)[not(@object)]"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <pf:serialize-xml/>
- </xsl:stylesheet>
|