123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: ps
- (C) Copyright IBM Corp. 2012, 2016
- US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- -->
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- version="1.0" xmlns:xts="http://developer.cognos.com/schemas/xts/"
- xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
- xmlns:dpl="http://developer.cognos.com/schemas/xts/logicsheets/deployment/"
- xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- exclude-result-prefixes="pf dpl cm xtsext">
- <xsl:output method="xml" version="1.0" encoding="UTF-8"
- indent="no" />
- <pf:variables />
- <dpl:variables />
- <xsl:template match="/root">
- <xts:sequence>
- <xsl:variable name="isExportDeployment" select="$deployment-method='export'"/>
- <xsl:variable name="isImportDeployment" select="$deployment-method='import'"/>
- <xsl:variable name="onMethodPage" select="key('env-param', 'm_deploymentWizardPage') = 'method'"/>
- <xsl:variable name="onPackagesPage" select="key('env-param', 'm_deploymentWizardPage') = 'packages'"/>
- <!--[580601] Delete the search path if we are on the deployment
- method page of the export wizard.. -->
- <xsl:if test="($isExportDeployment and $onMethodPage) or ($isImportDeployment and $onPackagesPage)">
- <xts:delete select="/root/env/param[@name='so.searchPath']" />
- </xsl:if>
- <xts:append select="/root/env">
- <xsl:for-each select="/root/cm:deploymentOptionsUI/cm:deploymentOption">
- <!-- Convenience variables for ease of readability -->
- <xsl:variable name="optionName" select="@name" />
- <xsl:variable name="isOptionOfInterest" select="contains(' dataSourceSignonSelect packageOutputs packageDatasetOutputs packageHistories personalDataSelect entireContentStoreSelect packageSchedules tenants ', concat(' ', $optionName, ' '))"/>
- <xsl:variable name="isConflictResolutionOption" select="contains($optionName, 'ConflictResolution')"/>
- <xsl:if test="$isOptionOfInterest or $isConflictResolutionOption">
- <xsl:choose>
- <xsl:when test="$optionName='tenants'">
- <xsl:for-each select="cm:value[.!='']">
- <xsl:variable name="tenantID" select="."/>
- <xsl:if test="not(key('env-param','selectedTenants')[.=$tenantID])">
- <param name="selectedTenants">
- <xsl:value-of select="$tenantID"/>
- </param>
- </xsl:if>
- </xsl:for-each>
- <xsl:if test="cm:value[.='']">
- <param name="selectPublicTenant">true</param>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="@enabled='false'">
- <xsl:variable name="disabledVariableName" select="concat('m_disabled_',$optionName)" />
- <xsl:if test="not(key('env-param',$disabledVariableName))">
- <param name="{$disabledVariableName}"/>
- </xsl:if>
- </xsl:if>
- <xsl:variable name="lastValueVariableName" select="concat('m_last_value_',$optionName)" />
- <xsl:variable name="lastValue" select="."/>
- <xsl:if test="not(key('env-param',$lastValueVariableName))">
- <param name="{$lastValueVariableName}">
- <xsl:value-of select="$lastValue" />
- </param>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:for-each>
- <!-- add hidden variables for personalDataSelect and entireContentStoreSelect -->
- <xsl:choose>
- <xsl:when test="$isExportDeployment and not(/root/cm:deploymentOptionsUI)">
- <xsl:if test="not(key('env-param','m_last_value_personalDataSelect'))">
- <param name="m_last_value_personalDataSelect">
- <xsl:choose>
- <xsl:when test="key('env-param','m_personalDataSelect')">true</xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </param>
- </xsl:if>
- <xsl:if test="not(key('env-param','m_last_value_entireContentStoreSelect'))">
- <param name="m_last_value_entireContentStoreSelect">
- <xsl:choose>
- <xsl:when test="key('env-param','m_entireContentStoreSelect')">
- <xsl:value-of select="key('env-param','m_entireContentStoreSelect')" />
- </xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </param>
- </xsl:if>
- </xsl:when>
- <xsl:when test="$isImportDeployment and not(/root/cm:deploymentOptionsUI) and /root/archiveOptions">
- <xsl:if test="not(key('env-param','m_last_value_personalDataSelect'))">
- <param name="m_last_value_personalDataSelect">
- <xsl:value-of select="/root/archiveOptions/cm:getDeploymentOptionsResponse/cm:deploymentOptions/cm:deploymentOption[@name='personalDataSelect']" />
- </param>
- </xsl:if>
- <xsl:if test="not(key('env-param','m_last_value_entireContentStoreSelect'))">
- <param name="m_last_value_entireContentStoreSelect">
- <xsl:value-of select="/root/archiveOptions/cm:getDeploymentOptionsResponse/cm:deploymentOptions/cm:deploymentOption[@name='entireContentStoreSelect']" />
- </param>
- </xsl:if>
- </xsl:when>
- </xsl:choose>
- </xts:append>
- <!-- Add hidden variable for export method -->
- <xsl:if test="not(key('env-param','m_exportMethod'))">
- <xsl:variable name="entireContentStoreOption" select="/root/cm:deploymentOptionsUI/cm:deploymentOption[@name='entireContentStoreSelect']"/>
- <xsl:variable name="personalDataSelectOption" select="/root/cm:deploymentOptionsUI/cm:deploymentOption[@name='personalDataSelect']"/>
- <xsl:variable name="entireContentStoreEnvParam" select="key('env-param','m_entireContentStoreSelect') or $entireContentStoreOption='true'"/>
- <xsl:variable name="personalDataSelectParam" select="key('env-param','m_personalDataSelect') or $personalDataSelectOption='true'"/>
- <xsl:variable name="isEntireContentStoreMethod" select="$entireContentStoreEnvParam='true' or (not($entireContentStoreEnvParam) and $entireContentStoreOption='true')"/>
- <xsl:variable name="hasTenants" select="count(/root/cm:deploymentOptionsUI/cm:deploymentOption[@name='tenants']/*) > 0"/>
- <xts:append select="/root/env">
- <xsl:choose>
- <xsl:when test="$isEntireContentStoreMethod and not($hasTenants)">
- <param name="m_exportMethod">entireContentStore</param>
- <param name="m_entireContentStoreSelect">true</param>
- <param name="m_personalDataSelect"><xsl:value-of select="$personalDataSelectParam"/></param>
- </xsl:when>
- <xsl:when test="$isEntireContentStoreMethod and $hasTenants">
- <param name="m_exportMethod">selectTenants</param>
- <param name="m_entireContentStoreSelect">true</param>
- <param name="m_personalDataSelect"><xsl:value-of select="$personalDataSelectParam"/></param>
- </xsl:when>
- <xsl:otherwise>
- <param name="m_exportMethod">selectContent</param>
- <param name="m_entireContentStoreSelect">false</param>
- <param name="m_personalDataSelect">false</param>
- </xsl:otherwise>
- </xsl:choose>
- </xts:append>
- </xsl:if>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
|