123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639 |
- <?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:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:xts="http://developer.cognos.com/schemas/xts/"
- xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
- exclude-result-prefixes="xtsext xts xsl pf">
- <!-- xmlns:so="http://developer.cognos.com/schemas/xts/so" -->
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <pf:variables/>
- <xsl:key name="env-param" match="/root/env/param" use="@name"/>
- <xsl:key name="env-param" match="/root/session/param" use="@name"/>
- <!-- Parameter select - must be a value that matches a subject, based on specGuide.xml. -->
- <xsl:variable name="soSelect" select="key('env-param','so.select')"/>
- <!-- Parameter editOp - operation: either move or copy. -->
- <xsl:variable name="soEditOp" select="key('env-param','so.editOp')"/>
-
- <!-- Parameter defaultObjectId - current object being operated on. -->
- <xsl:variable name="soDefObjectId" select="string(key('env-param','so.defaultObjectId'))"/>
- <!-- Parameter defaultLocationId - current immediate parent to the default object. -->
- <xsl:variable name="soDefLocationId">
- <xsl:choose>
- <xsl:when test="string(key('env-param','so.defaultLocationId'))!=''">
- <xsl:value-of select="string(key('env-param','so.defaultLocationId'))"/>
- </xsl:when>
- <xsl:when test="/root/specGuide/subject[contains(concat(' ',@match,' '),concat(' ',$soSelect,' '))]/param[@name='defaultRootId']">
- <xsl:variable name="dl" select="/root/specGuide/subject[contains(concat(' ',@match,' '),concat(' ',$soSelect,' '))]/param[@name='defaultRootId']"/>
- <xsl:value-of select="key('env-param',concat('so.',$dl))"/>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- <!-- current root id for the default object -->
- <xsl:variable name="soDefRootId" select="string(key('env-param','so.defaultRootId'))"/>
- <!-- current root class for the default object -->
- <xsl:variable name="soDefRootClass" select="string(key('env-param','so.defaultRootClass'))"/>
-
- <!-- current object being operated on for the move or copy -->
- <xsl:variable name="soEditOpObjId" select="string(key('env-param','so.defaultEditOpObjectId'))"/>
- <!-- For display purposes the name of the object needs to be displayed in the title - so.objectName is generated in the handleCallerEnv block -->
- <xsl:variable name="soObjectName" select="string(key('env-param','so.objectName'))"/>
- <!-- current selected object id. -->
- <xsl:variable name="soInObjId" select="string(key('env-param','so.id'))"/>
-
- <!-- the current object is the object's root -->
- <xsl:variable name="soAtInObjRootId">
- <xsl:choose>
- <xsl:when test="$soDefObjectId=$soDefRootId">true</xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <!-- current object id during navigation -->
- <xsl:variable name="soNavigationId" select="key('env-param','so.navigationId')"/>
- <!-- current root id - corresponds to path '/' -->
- <xsl:variable name="soCmRootId" select="string(key('env-param','so.cmRootId'))"/>
- <!-- current adminFolder id - corresponds to path '/adminFolder' -->
- <xsl:variable name="soAdminId" select="string(key('env-param','so.adminId'))"/>
- <!-- Set the parent id to the default object id -->
- <xsl:variable name="soInObjParentId">
- <xsl:if test="string($soEditOpObjId) != ''"><xsl:value-of select="$soDefObjectId"/></xsl:if>
- </xsl:variable>
- <!-- Set the object id to use based on whether or not the opEdit is set. -->
- <xsl:variable name="useObjId">
- <xsl:choose>
- <xsl:when test="string($soEditOpObjId)!=''"><xsl:value-of select="$soEditOpObjId"/></xsl:when>
- <xsl:otherwise><xsl:value-of select="$soDefObjectId"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
- <!-- Main template +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
- <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
- <xsl:template match="/root">
- <xsl:choose>
- <!-- First time displaying selection dialogue - build the selectionSpec based on the specGuide xml file -->
- <xsl:when test="not(/root/selectionSpec)">
- <xsl:variable name="subjectNode" select="/root/specGuide/subject[contains(concat(' ',@match,' '),concat(' ',$soSelect,' '))]"/>
- <selectionSpec>
- <xsl:choose>
- <xsl:when test="not($subjectNode)">
- <xsl:value-of select="/root/selectionSpecMessages/message[@id='specification.error']/property[@name='introText']"/>,<xsl:value-of select="/root/selectionSpecMessages/message[@id='specification.error']/property[@name='specErrorText']"/>
- </xsl:when>
- <xsl:when test="$subjectNode/param[@name='objects']">
- <xsl:call-template name="buildCoreSelectionSpec">
- <xsl:with-param name="API" select="string($subjectNode/@api)"/>
- </xsl:call-template>
- <xsl:apply-templates select="$subjectNode/*" mode="socss"/>
- <xsl:if test="not($subjectNode/param[@name='consumer-root'])">
- <xsl:call-template name="setConsumerRoot"/>
- </xsl:if>
- <xsl:if test="not($subjectNode/param[@name='filterToExcludeReportViewWithBaseObject'])">
- <!-- Generate the reportView-exclusions when subject does not specify permissions parameter -->
- <xsl:apply-templates select="/root/specGuide/globalParams/param[@name='filterToExcludeReportViewWithBaseObject']" mode="socss"/>
- </xsl:if>
- <xsl:if test="not($subjectNode/param[@name='permissions'])">
- <!-- Generate the permissions when subject does not specify permissions parameter -->
- <xsl:apply-templates select="/root/specGuide/globalParams/param[@name='permissions']" mode="socss"/>
- </xsl:if>
- <!--
- <xsl:if test="not($subjectNode/param[@name='containerPermissions'])">
- <xsl:apply-templates select="/root/specGuide/globalParams/param[@name='containerPermissions']" mode="socss"/>
- </xsl:if>
- <xsl:if test="not($subjectNode/param[@name='selectablePermissions'])">
- <xsl:apply-templates select="/root/specGuide/globalParams/param[@name='selectablePermissions']" mode="socss"/>
- </xsl:if>
- <xsl:if test="not($subjectNode/param[@name='navigatePermissions'])">
- <xsl:apply-templates select="/root/specGuide/globalParams/param[@name='navigatePermissions']" mode="socss"/>
- </xsl:if>
- -->
- <!-- Generate the returns with any previous values when passed from a calling dialogue -->
- <xsl:if test="not($subjectNode/param[@name='returns'])">
- <xsl:apply-templates select="/root/specGuide/globalParams/param[@name='returns']" mode="rtns"/>
- </xsl:if>
- <xsl:apply-templates select="/root/searchSpecMessages" mode="mp"/>
- </xsl:when>
- </xsl:choose>
- </selectionSpec>
- </xsl:when>
- <!-- Navigating within the selection dialogue - update pertinent selectionSpec entries -->
- <xsl:otherwise>
- <selectionSpec>
- <xsl:apply-templates select="/root/selectionSpec/*" mode="ssu"/>
- </selectionSpec>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
- <!-- Templates for updating the selectionSpec DOM entry (mode ssu) ++++++++++++++++++++++++++++ -->
- <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
- <!-- update selectionPath with the current location to use in the cm request -->
- <xsl:template match="item[@name='navigationId']" mode="ssu">
- <item name="navigationId" input="so.navigationId">
- <xsl:attribute name="atRoot">
- <xsl:choose>
- <xsl:when test="/root/selectionSpec/item[@name='presentation']/options/option[@name='displayVirtualRootNode']">
- <xsl:choose>
- <xsl:when test="$soNavigationId=$soCmRootId">true</xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
-
- <!-- update atSelectionPFRoot if navigated to the Public Folders directory -->
- <xsl:attribute name="atSelectionPFRoot">
- <xsl:choose>
- <xsl:when test="key('session-param','prootid')=$soNavigationId">true</xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- <xsl:call-template name="publicFoldersIcon"/>
-
- <!-- update atSelectionMFRoot if navigated to the My Folders directory -->
- <xsl:attribute name="atSelectionMFRoot">
- <xsl:choose>
- <xsl:when test="key('session-param','mrootid')=$soNavigationId">true</xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
-
- <xsl:attribute name="rootId"><xsl:value-of select="$soCmRootId"/></xsl:attribute>
-
- <!-- update atInputObjectRoot if we are located at the input objects root location -->
- <xsl:attribute name="atInputObjectRoot"><xsl:value-of select="$soAtInObjRootId"/></xsl:attribute>
- <xsl:if test="/root/selectionSpec/item[@name='navigationId']/@displayRootWhenAdmin"><xsl:attribute name="displayRootWhenAdmin"><xsl:value-of select="/root/selectionSpec/item[@name='navigationId']/@displayRootWhenAdmin"/></xsl:attribute></xsl:if>
- <xsl:attribute name="initValue">false</xsl:attribute>
- <xsl:call-template name="myFoldersIcon"/>
- <xsl:value-of select="$soNavigationId"/>
- </item>
- </xsl:template>
- <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
-
- <xsl:template match="item[@name='presentation']" mode="ssu">
- <xsl:variable name="condition" select="string(key('env-param',concat('so.condition_',./options/option[@name='displayCheckbox']/@oncheckDisplay)))"/>
- <xsl:choose>
- <xsl:when test="$condition=''"><xsl:copy-of select="."/></xsl:when>
- <xsl:otherwise>
- <xsl:copy>
- <xsl:apply-templates select="@*" mode="socss"/>
- <xsl:apply-templates select="./*" mode="ssu"/>
- </xsl:copy>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
-
- <xsl:template match="options" mode="ssu">
- <xsl:copy>
- <xsl:apply-templates select="./option" mode="ssu"/>
- </xsl:copy>
- </xsl:template>
- <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
-
- <xsl:template match="option" mode="ssu">
- <xsl:variable name="condition" select="string(key('env-param',concat('so.condition_',@oncheckDisplay)))"/>
- <xsl:choose>
- <xsl:when test="not(@name='displayCheckbox')"><xsl:copy-of select="."/></xsl:when>
- <xsl:otherwise>
- <xsl:copy>
- <xsl:apply-templates select="@*[not(local-name()='state')]" mode="socss"/>
- <xsl:attribute name="state"><xsl:value-of select="$condition"/></xsl:attribute>
- </xsl:copy>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
-
- <xsl:template match="*" mode="ssu">
- <xsl:copy-of select="."/>
- </xsl:template>
-
- <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
- <!-- Templates for creating the selectionSpec DOM entry +++++++++++++++++++++++++++++++++++++ -->
- <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
- <xsl:template match="param[@name='objects']" mode="socss">
- <xsl:variable name="param" select="."/>
-
- <!-- create items for all object attributes other than those starting with 'is' or 'over' -->
- <xsl:apply-templates select="$param/*/@*[not(starts-with(string(local-name()),'is') or starts-with(string(local-name()),'over'))]" mode="soobj"/>
- <item name="containerObjects">
- <xsl:apply-templates select="$param/*[string(@isContainer)='true']" mode="soobj"/>
- </item>
- <item name="selectableObjects">
- <xsl:apply-templates select="$param/*[string(@isSelectable)='true']" mode="soobj"/>
- </item>
- <xsl:if test="$param/*[string(@isLaunchable)='true']">
- <item name="launchableObjects">
- <xsl:apply-templates select="$param/object[string(@isLaunchable)='true']" mode="soobj"/>
- <xsl:text> </xsl:text>
- </item>
- </xsl:if>
- <xsl:apply-templates select="/root/specGuide/globalParams/param[@name='filterToSelectContainerObjects']" mode="socss"/>
- <xsl:apply-templates select="/root/specGuide/globalParams/param[@name='filterToSelectNonContainerObjects']" mode="socss"/>
- <xsl:apply-templates select="/root/specGuide/globalParams/param[@name='filterToDrillContainerObjects']" mode="socss"/>
- <xsl:if test="$param/*[@overrideFilterToSelectContainerObjects]">
- <xsl:apply-templates select="$param/*[@overrideFilterToSelectContainerObjects]" mode="ovrfltr"/>
- </xsl:if>
- <xsl:if test="$param/*[@overrideFilterToSelectNonContainerObjects]">
- <xsl:apply-templates select="$param/*[@overrideFilterToSelectNonContainerObjects]" mode="ovrfltr"/>
- </xsl:if>
- <xsl:if test="$param/*[@overrideFilterToDrillContainerObjects]">
- <xsl:apply-templates select="$param/*[@overrideFilterToDrillContainerObjects]" mode="ovrfltr"/>
- </xsl:if>
-
- <xsl:variable name="optionalObject" select="../param[@name='presentation']/options/option[@name='displayCheckbox']"/>
- <xsl:variable name="objectFilter">
- <xsl:text/>/*[<xsl:text/>
- <xsl:for-each select="$param/*[not(string(.)=string($optionalObject/@oncheckDisplay))]">
- <xsl:variable name="pos" select="position()"/>
- <xsl:if test="$pos > 1"><xsl:text/> or <xsl:text/></xsl:if>
- <xsl:text/>@objectClass="<xsl:value-of select="string(.)"/>"<xsl:text/>
- </xsl:for-each>
- <xsl:text/>]<xsl:text/>
- </xsl:variable>
- <item name="selectionFilter"><xsl:value-of select="$objectFilter"/></item>
- <xsl:if test="$optionalObject">
- <item name="conditionFilter_{$optionalObject/@oncheckDisplay}">
- <xsl:value-of select="substring-before($objectFilter,']')"/><xsl:text/> or @objectClass="<xsl:text/><xsl:value-of select="$optionalObject/@oncheckDisplay"/><xsl:text/>"]<xsl:text/>
- </item>
- </xsl:if>
-
- <item name="operation">
- <xsl:if test="$soEditOp='move'">
- <xsl:attribute name="moveOnly">true</xsl:attribute><xsl:attribute name="moveOrCopy">true</xsl:attribute>
- <xsl:if test="string(../param[@name='presentation']/options/option[@name='onMove']/@objectIsContainer)='false'"><xsl:attribute name="containerMoveOrCopy">true</xsl:attribute></xsl:if>
- </xsl:if>
- <xsl:if test="$soEditOp='copy'">
- <xsl:attribute name="copyOnly">true</xsl:attribute><xsl:attribute name="moveOrCopy">true</xsl:attribute>
- <xsl:if test="string(../param[@name='presentation']/options/option[@name='onCopy']/@objectIsContainer)='false'"><xsl:attribute name="containerMoveOrCopy">true</xsl:attribute></xsl:if>
- </xsl:if>
- <xsl:value-of select="$soEditOp"/>
- </item>
- </xsl:template>
- <xsl:template match="param[@name='shortcut-targets']" mode="socss">
- <item name="shortcut-targets">
- <xsl:apply-templates select="./*" mode="soobj"/>
- </item>
- </xsl:template>
- <xsl:template match="param[@name='filterToExcludeReportViewWithBaseObject']" mode="socss">
- <item name="filterToExcludeReportViewWithBaseObject">
- <xsl:apply-templates select="./*" mode="soobj"/>
- </item>
- </xsl:template>
- <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
- <xsl:template match="param[@name='permissions']" mode="socss">
- <item name="selectionPermissions"><xsl:value-of select="."/></item>
- </xsl:template>
-
- <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
- <xsl:template match="object" mode="ovrfltr">
- <xsl:variable name="filter">
- <xsl:choose>
- <xsl:when test="@overrideFilterToSelectContainerObjects"><xsl:value-of select="@overrideFilterToSelectContainerObjects"/></xsl:when>
- <xsl:when test="@overrideFilterToSelectNonContainerObjects"><xsl:value-of select="@overrideFilterToSelectNonContainerObjects"/></xsl:when>
- <xsl:when test="@overrideFilterToDrillContainerObjects"><xsl:value-of select="@overrideFilterToDrillContainerObjects"/></xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="filterName">
- <xsl:choose>
- <xsl:when test="@overrideFilterToSelectContainerObjects">filterToSelectContainerObjects</xsl:when>
- <xsl:when test="@overrideFilterToSelectNonContainerObjects">filterToSelectNonContainerObjects</xsl:when>
- <xsl:when test="@overrideFilterToDrillContainerObjects">filterToDrillContainerObjects</xsl:when>
- </xsl:choose>
- </xsl:variable>
- <item name="{$filterName}" object="{string(.)}">
- <xsl:value-of select="$filter"/>
- </item>
- </xsl:template>
- <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
- <xsl:template match="param[@name='returns']" mode="socss">
- <item name="returns">
- <!-- <xsl:apply-templates select="/root/specGuide/globalParams/param[@name='returns']/*" mode="rtns"/> -->
- <xsl:apply-templates select="*" mode="rtns"/>
- </item>
- </xsl:template>
- <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
- <xsl:template match="param[@name='returns']" mode="rtns">
- <item name="returns"><xsl:apply-templates select="*" mode="rtns"/></item>
- </xsl:template>
- <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
- <xsl:template match="return" mode="rtns">
- <param>
- <xsl:copy-of select="@*"/>
- </param>
- </xsl:template>
- <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
- <xsl:template match="param[@name='presentation']" mode="socss">
- <xsl:variable name="messageId" select="@messageId"/>
- <xsl:variable name="currentObject">
- <xsl:choose>
- <xsl:when test="$soNavigationId!=''"><xsl:value-of select="$soNavigationId"/></xsl:when>
- <xsl:when test="string(../param[string(@name)='objects']/*[string(@isLaunchable)='true'])!='' and $soDefObjectId != ''"><xsl:value-of select="$soDefObjectId"/></xsl:when>
- <xsl:when test="$soDefLocationId!=''"><xsl:value-of select="$soDefLocationId"/></xsl:when>
- <xsl:when test="$soDefRootId!=''"><xsl:value-of select="$soDefRootId"/></xsl:when>
- <xsl:otherwise><xsl:value-of select="key('session-param','prootid')"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <item name="presentation">
- <xsl:call-template name="myFoldersIcon"/>
- <xsl:apply-templates select="./*" mode="socss-present"/>
- </item>
- <xsl:apply-templates select="/root/selectionSpecMessages/message[@id=$messageId]/property" mode="mp"/>
- <xsl:if test="./options/option/@name='displayVirtualRootNode'">
- <xsl:apply-templates select="/root/selectionSpecMessages/message[@id='root']/property" mode="mp"/>
- </xsl:if>
- <item name="inputObjectId">
- <xsl:attribute name="parentId"><xsl:value-of select="$soInObjParentId"/></xsl:attribute>
- <xsl:attribute name="rootClass"><xsl:value-of select="$soDefRootClass"/></xsl:attribute>
- <xsl:choose>
- <xsl:when test="$soInObjId!=''">
- <xsl:value-of select="$soInObjId"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="param">so.objectId</xsl:attribute>
- <xsl:value-of select="$useObjId"/>
- </xsl:otherwise>
- </xsl:choose>
- </item>
- <item name="navigationId" input="so.navigationId">
- <!-- This attribute indicates if the current location is root '/' -->
- <xsl:attribute name="navClass"/>
- <xsl:attribute name="navClassInput">so.navigationClass</xsl:attribute>
- <xsl:attribute name="atRoot">
- <xsl:choose>
- <xsl:when test="./options/option[@name='displayVirtualRootNode'] and $soCmRootId=$soNavigationId">true</xsl:when>
- <xsl:when test="./options/option[@name='displayVirtualRootNode'] and (not($soNavigationId) and $soCmRootId=$soDefLocationId)">true</xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
-
- <!-- This attribute indicates if the current location is at My Folders -->
- <xsl:attribute name="atSelectionMFRoot">
- <xsl:choose>
- <xsl:when test="(not($soNavigationId) and $currentObject=key('session-param','mrootid')) or ($soNavigationId=key('session-param','mrootid'))">true</xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- <xsl:call-template name="myFoldersIcon">
- <xsl:with-param name="currentObject" select="$currentObject"/>
- </xsl:call-template>
-
- <!-- This attribute indicates if the current location is at Public Folders-->
- <xsl:attribute name="atSelectionPFRoot">
- <xsl:choose>
- <xsl:when test="(not($soNavigationId) and $currentObject=key('session-param','prootid')) or ($soNavigationId=key('session-param','prootid'))">true</xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- <xsl:call-template name="publicFoldersIcon">
- <xsl:with-param name="currentObject" select="$currentObject"/>
- </xsl:call-template>
-
- <xsl:attribute name="rootId"><xsl:value-of select="$soCmRootId"/></xsl:attribute>
- <xsl:attribute name="atInputObjectRoot"><xsl:value-of select="$soAtInObjRootId"/></xsl:attribute>
- <xsl:attribute name="initValue">true</xsl:attribute>
- <xsl:call-template name="myFoldersIcon"/>
- <xsl:value-of select="$currentObject"/>
- </item>
- </xsl:template>
- <xsl:template match="searchSpecMessages" mode="mp">
- <xsl:copy-of select="."/>
- </xsl:template>
- <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
- <xsl:template match="param[@name='actions']" mode="socss">
- <item name="actions">
- <xsl:choose>
- <xsl:when test="@references">
- <xsl:variable name="references" select="@references"/>
- <xsl:apply-templates select="/root/specGuide/globalParams/param[@name=$references]/action" mode="soact"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="./action" mode="soact"/>
- </xsl:otherwise>
- </xsl:choose>
- </item>
- </xsl:template>
- <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
- <xsl:template match="action" mode="soact">
- <xsl:variable name="messageId" select="@messageId"/>
- <action name="{@name}">
- <xsl:copy-of select="@*[name()!='messageId' and name()!='name']"/>
- <xsl:copy-of select="./*"/>
- <xsl:apply-templates select="/root/selectionSpecMessages/message[@id=$messageId]/property" mode="mp"/>
- </action>
- </xsl:template>
- <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
- <xsl:template match="param[@name='modes']" mode="socss">
- <item name="modes">
- <xsl:copy-of select="@*"/>
- <xsl:apply-templates select="./*" mode="socss-modes"/>
- </item>
- </xsl:template>
- <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
- <xsl:template match="search" mode="socss-modes">
- <xsl:choose>
- <xsl:when test="@references">
- <xsl:variable name="references" select="@references"/>
- <xsl:copy-of select="/root/specGuide/globalParams/param[@name=$references]/*"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:copy-of select="."/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
- <xsl:template match="options" mode="socss-present">
- <xsl:copy>
- <xsl:apply-templates select="./*" mode="socss-present"/>
- </xsl:copy>
- </xsl:template>
- <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
- <xsl:template match="option" mode="socss-present">
- <xsl:choose>
- <xsl:when test="@references">
- <xsl:variable name="references" select="@references"/>
- <option>
- <xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute>
- <xsl:copy-of select="/root/specGuide/globalParams/param[@name=$references]/*"/>
- </option>
- </xsl:when>
- <xsl:otherwise>
- <xsl:copy-of select="."/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
- <xsl:template match="param[@name='includeItems']" mode="socss">
- <xsl:copy-of select="./*"/>
- </xsl:template>
- <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
- <xsl:template match="param" mode="socss">
- <item name="{./@name}"><xsl:value-of select="string(.)"/></item>
- </xsl:template>
- <xsl:template match="object" mode="soobj">
- <xsl:variable name="pos" select="position()"/>
- <xsl:text> </xsl:text><xsl:value-of select="string(.)"/><xsl:if test="$pos=last()"><xsl:text> </xsl:text></xsl:if>
- </xsl:template>
- <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
- <xsl:template match="property" mode="mp">
- <!-- set all the messages based on the subjects presentation messageId -->
- <xsl:choose>
- <xsl:when test="@name!='selectionTitle'">
- <item>
- <xsl:copy-of select="@*"/>
- <xsl:value-of select="."/>
- </item>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="$soObjectName!='' and (@includes='objectName' or not(../property[@name='selectionTitle' and @includes='objectName']))">
- <item>
- <xsl:copy-of select="@*"/>
- <xsl:value-of select="."/>
- </item>
- </xsl:when>
- <xsl:when test="$soObjectName='' and not(@includes='objectName')">
- <item>
- <xsl:copy-of select="@*"/>
- <xsl:value-of select="."/>
- </item>
- </xsl:when>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
- <xsl:template match="@*" mode="soobj">
- <!-- creates items for some attributes from the object in the selectionSpec -->
- <item name="{name()}" objectClass="{string(parent::node())}"><xsl:value-of select="."/></item>
- </xsl:template>
- <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
- <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
- <xsl:template match="@*" mode="socss">
- <!-- adds all the attributes from the subject to the items in the selectionSpec -->
- <xsl:attribute name="{name()}"><xsl:value-of select="."/></xsl:attribute>
- </xsl:template>
- <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
- <!-- Template processes all non-matching nodes from the specGuide -->
- <xsl:template match="*"/>
- <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
- <!-- Template to build the core items in the selectionSpec -->
- <xsl:template name="buildCoreSelectionSpec">
- <xsl:param name="API"/>
- <!-- This item contains the permissions to use with the cm request; uses the specGuide selectionPermissions when no filter is specified and does not use it when usePermissions attribute is false -->
- <xsl:for-each select="/root/env/param[starts-with(@name,'so.return.')]">
- <item name="{@name}"><xsl:value-of select="."/></item>
- </xsl:for-each>
- <!-- Special processing in contentLogic for copy_user_profile -->
- <xsl:if test="$soSelect='copy_user_profile'">
- <item name="{$soSelect}"/>
- </xsl:if>
- <item name="errorReturnsFailText"><xsl:value-of select="/root/selectionSpecMessages/message[@id='specification.error']/property[@name='errorReturnsFailText']"/></item>
-
- </xsl:template>
-
- <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
- <!-- Template to set the genPublicFoldersIcon attribute for presentation -->
- <xsl:template name="publicFoldersIcon">
- <xsl:param name="currentObject" select="''"/>
- <xsl:attribute name="publicFoldersIcon">
- <xsl:choose>
- <xsl:when test="(not($soNavigationId) and string($currentObject)=key('session-param','prootid')) or ($soNavigationId=$soCmRootId or $soNavigationId=key('session-param','prootid'))">true</xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- </xsl:template>
- <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
- <!-- Template to set the genMyFoldersIcon attribute for presentation -->
- <xsl:template name="myFoldersIcon">
- <xsl:param name="currentObject" select="''"/>
- <xsl:attribute name="myFoldersIcon">
- <xsl:choose>
- <xsl:when test="(not($soNavigationId) and string($currentObject)=key('session-param','mrootid')) or ($soNavigationId=$soCmRootId or $soNavigationId=key('session-param','mrootid'))">true</xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- </xsl:template>
-
- <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
- <!-- Template to build the consumer-root item when not defined in spec -->
- <xsl:template name="setConsumerRoot">
- <item name="consumer-root"><xsl:value-of select="string(key('env-param','so.consumerRoot'))"/></item>
- </xsl:template>
- </xsl:stylesheet>
|