123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: ps
- (C) Copyright IBM Corp. 2005, 2013
- 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:xts="http://developer.cognos.com/schemas/xts/" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:key name="env-param" match="/root/env/param" use="@name"/>
- <xsl:template match="/">
- <xts:sequence>
- <!-- deal with the password fields -->
- <xsl:if test="(key('env-param','m_connection_password') != '' or key('env-param','test_password') !='') and not(key('env-param','passwordEncrypted')) or key('env-param','passwordEncrypted') = ''">
- <xts:delete select="/root/env/param[@name='passwordEncrypted']"/>
-
- <xts:append select="/root/env">
- <param name="passwordEncrypted">
- <xsl:choose>
- <xsl:when test="key('env-param','test_password') !='' and key('env-param','test_password')/@format='encrypted'">
- <xsl:value-of select="key('env-param','test_password')"/>
- </xsl:when>
- <xsl:when test="key('env-param','m_connection_password') !='' and key('env-param','m_connection_password')/@format='encrypted'">
- <xsl:value-of select="key('env-param','m_connection_password')"/>
- </xsl:when>
- <xsl:otherwise>
- <xts:encrypt>
- <xts:param name="provider">cognos.cam</xts:param>
- <xts:param name="source">
- <xsl:choose>
- <xsl:when test="key('env-param','test_password') != ''">
- <xsl:value-of select="key('env-param','test_password')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="key('env-param','m_connection_password')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xts:param>
- </xts:encrypt>
- </xsl:otherwise>
- </xsl:choose>
- </param>
- </xts:append>
-
- <xts:delete select="/root/env/param[@name='m_connection_password' or @name='m_connection_confirm_password' or @name='test_password']"/>
- </xsl:if>
- <!-- deal with the proxy password fields -->
- <xsl:if test="(key('env-param','m_connection_proxy_password') != '')">
- <xts:delete select="/root/env/param[@name='proxyPasswordEncrypted']"/>
- <xts:append select="/root/env">
- <param name="proxyPasswordEncrypted">
- <xsl:if test="key('env-param','m_connection_proxy_password')/@format='encrypted'">
- <xsl:value-of select="key('env-param','m_connection_proxy_password')"/>
- </xsl:if>
- </param>
- </xts:append>
- <xts:delete select="/root/env/param[@name='m_connection_proxy_password']"/>
- </xsl:if>
- <!-- deal with the cube password -->
- <xsl:if test="(key('env-param','test_cube_password')!= '' or key('env-param','m_cube_password') != '') and (not(key('env-param','cubePasswordEncrypted')) or key('env-param','cubePasswordEncrypted') = '')">
- <xts:delete select="/root/env/param[@name='cubePasswordEncrypted']"/>
-
- <xts:append select="/root/env">
- <param name="cubePasswordEncrypted">
- <xsl:choose>
- <xsl:when test="key('env-param','test_cube_password') !='' and key('env-param','test_cube_password')/@format='encrypted'">
- <xsl:value-of select="key('env-param','test_cube_password')"/>
- </xsl:when>
- <xsl:when test="key('env-param','m_cube_password') !='' and key('env-param','m_cube_password')/@format='encrypted'">
- <xsl:value-of select="key('env-param','m_cube_password')"/>
- </xsl:when>
- <xsl:otherwise>
- <xts:encrypt>
- <xts:param name="provider">cognos.cam</xts:param>
- <xts:param name="source">
- <xsl:choose>
- <xsl:when test="key('env-param','test_cube_password') != ''">
- <xsl:value-of select="key('env-param','test_cube_password')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="key('env-param','m_cube_password')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xts:param>
- </xts:encrypt>
- </xsl:otherwise>
- </xsl:choose>
- </param>
- </xts:append>
-
- <xts:delete select="/root/env/param[@name='m_cube_password' or @name='test_cube_password' or @name='m_cube_confirm_password']"/>
- </xsl:if>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
|