Cybersecurity
DevOps Cloud
IT Operations Cloud
<?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!--
Initial Settings - Prompt Style Sheet
=====================================
This style sheet handles initial settings prompts. It pre-populates the
fields with existing values.
The prompt style sheet is applied to the XML representation of the prompts
(GCV's) for this prompt resource before the prompts are displayed for
input.
Updated: 20100714
-->
<!--
defsDoc
=======
XML document containing the prompts (configuration value definitions)
including their values that were entered for this prompt page.
Sample document:
<configuration-values>
<definitions>
<header display-name="Authentication"/>
<definition display-name="SAP User ID" mandatory="true" name="shim-auth-id" type="string">
<description>The ID of the User this driver will use for SAP Logon. This is referred to as 'User' in the SAP Logon screen.</description>
<value>idmdriver</value>
</definition>
<definition display-name="SAP User Password" mandatory="true" name="shim-auth-id" type="password-ref">
<description>The User password this driver will use for SAP Logon. This is referred to as 'Password' in the SAP Logon screen.</description>
<value>shim-auth-password</value>
</definition>
</definitions>
</configuration-values>
-->
<xsl:param name="defsDoc"/>
<!--
curDoc
======
In the case of an upgrade or downgrade, this parameter contains the XML
content of the currently installed prompt target.
Sample document (only an excerpt, these docs are rather large):
<ds-attributes>
<ds-attribute ds-attr-name="shim-auth-id">
<ds-value>idmdriver</ds-value>
</ds-attribute>
<ds-attribute ds-attr-name="shim-auth-server">
<ds-value>127.0.0.1</ds-value>
</ds-attribute>
<ds-attribute ds-attr-name="driver-start-option">
<ds-value>2</ds-value>
</ds-attribute>
</ds-attributes>
-->
<xsl:param name="curDoc"/>
<!--
npDoc
=====
In the case of an upgrade or downgrade, this parameter contains an XML
representation of all named password available on the prompt target.
Note:
Only the names of existing passwords are available, not their values. If a
named password has been set through a prompt, both its name and value are
available.
Note2:
To set a named password, append the following structure to the target
(target must support named passwords):
<ds-attribute ds-attr-name="named-password">
<ds-value display-name="Password 1" name="pwd1">1</ds-value>
<ds-value display-name="Password 2" name="pwd2">2</ds-value>
</ds-attribute>
Sample document:
<named-passwords>
<named-password name="promptedPwd">promptedValue</named-password>
<named-password name="existingPwd"/>
</named-passwords>
-->
<xsl:param name="npDoc"/>
<!--
propertyWizard
==============
Flag (true or false) indicating if the installation is from the package
installation wizard (PIW, launched from the "Packages" property page) or
from the driver configuration wizard (DCW, launched by installing a new
driver). This flag can be useful to show or hide prompts or to set or not
set values based on which wizard is being run.
E.g. the driver name should only be prompted for in the DCW, not in the
PIW where the driver already exists.
Possible values:
'true' -> PIW
'false' -> DCW
-->
<xsl:param name="propertyWizard"/>
<xsl:template match="header[@driver-name='true']">
<xsl:if test="$propertyWizard='false'">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:if>
</xsl:template>
<xsl:template match="definition[@driver-name='true']">
<xsl:if test="$propertyWizard='false'">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:if>
</xsl:template>
<!-- pre-populate prompts with existing values -->
<xsl:template match="definition/value">
<xsl:variable name="name" select="../@name"/>
<xsl:variable name="curVal">
<xsl:choose>
<xsl:when test="$curDoc//ds-value[../@ds-attr-name=$name]/text()">
<xsl:value-of select="$curDoc//ds-value[../@ds-attr-name=$name]/text()"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$curDoc//value[../@name=$name]/text()"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<!-- backfilling from current value -->
<xsl:when test="$curVal">
<xsl:variable name="checkRemote">
<xsl:choose>
<xsl:when test="$name='shim-auth-server' or $name='shim-auth-password'">
<xsl:value-of select="'true'"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="'false'"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<xsl:when test="$checkRemote='true' and starts-with($curVal, 'REMOTE')">
<value>
<xsl:value-of select="substring-after($curVal, ')')"/>
</value>
</xsl:when>
<xsl:otherwise>
<value>
<xsl:value-of select="$curVal"/>
</value>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<!-- no current value found -->
<xsl:otherwise>
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- identity transformation template -->
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
defsDoc
=======
XML document containing the prompts (configuration value definitions)
including their values that were entered for this prompt page.
<xsl:template match="header[@driver-name='true']">
<xsl:if test="$propertyWizard='false'">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:if>
</xsl:template>
<!-- pre-populate prompts with existing values -->
<xsl:template match="definition/value">
<xsl:variable name="name" select="../@name"/>
<xsl:variable name="curVal">
<xsl:choose>
<xsl:when test="$curDoc//ds-value[../@ds-attr-name=$name]/text()">
<xsl:value-of select="$curDoc//ds-value[../@ds-attr-name=$name]/text()"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$curDoc//value[../@name=$name]/text()"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<!-- backfilling from current value -->
<xsl:when test="$curVal">
<xsl:variable name="checkRemote">
<xsl:choose>
<xsl:when test="$name='shim-auth-server' or $name='shim-auth-password'">
<xsl:value-of select="'true'"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="'false'"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<xsl:when test="$checkRemote='true' and starts-with($curVal, 'REMOTE')">
<value>
<xsl:value-of select="substring-after($curVal, ')')"/>
</value>
</xsl:when>
<xsl:otherwise>
<value>
<xsl:value-of select="$curVal"/>
</value>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<!-- no current value found -->
<xsl:otherwise>
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<configuration-values>
<definitions>
<definition display-name="xlfid(TEST.idmresource.TestGCVPrompt.gcv.Structure.GCV.Test)Test Structured GCV" instance-separator=":" name="Structure.GCV.Test" type="structured" value-separator=";">
<template>
<definition display-name="Class of the object" name="objectClass" type="string">
<description/>
</definition>
<definition display-name="List of attributes to filter" item-separator="," name="filterList" type="list">
<description/>
</definition>
<definition display-name="DN of workflow to call" dn-space="dirxml" dn-type="ldap" name="workflowDN" type="dn">
<description/>
</definition>
</template>
<value>
<instance>
<definition display-name="Class of the object" name="objectClass" type="string">
<description/>
<value>User</value>
</definition>
<definition display-name="List of attributes to filter" item-separator="," name="filterList" type="list">
<description/>
<value>
<item>Given Name</item>
<item>Surname</item>
</value>
</definition>
<definition display-name="DN of workflow to call" dn-space="dirxml" dn-type="ldap" name="workflowDN" type="dn">
<description/>
<value>cn=test,ou=AppConfig,ou=Driver,ou=DriverSet,o=Oname</value>
</definition>
</instance>
</value>
<description/>
</definition>
</definitions>
</configuration-values>
<ds-attributes>
<ds-attribute ds-attr-name="shim-auth-id">
<ds-value>idmdriver</ds-value>
</ds-attribute>
<ds-attribute ds-attr-name="shim-auth-server">
<ds-value>127.0.0.1</ds-value>
</ds-attribute>
<ds-attribute ds-attr-name="driver-start-option">
<ds-value>2</ds-value>
</ds-attribute>
</ds-attributes>
<xsl:when test="$curDoc//ds-value[../@ds-attr-name=$name]/text()">
<xsl:value-of select="$curDoc//ds-value[../@ds-attr-name=$name]/text()"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$curDoc//value[../@name=$name]/text()"/>
</xsl:otherwise>