123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: ps
- (C) Copyright IBM Corp. 2005, 2016
- US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- -->
- <!--
- Expects the following
- <root>
- <env>
- ...
- </env>
- <optionsList>
- <runOptions nameType="bus:runOptionEnum">
- <option name="burst" optionType="bus:runOptionBoolean" type="xsd:boolean" envName="m_ro_burst" comp="simple"/>
- ...
- </runOptions>
- </optionsList>
- <deliveryOptions>
- deliveryOptions already formated to be sent to CM
- </deliveryOptions>
- <mobileOptions>
- mobileOptions already formated to be sent to CM
- </mobileOptions>
- <contentLocale>en-us</contentLocale> **only needed if you want to build the runOptions saveAs**
- <optionType>...</optionType> What options should be used in option.xml. If not specified, then all the options will be used
- <genDefaults>false</genDefaults> Should defaults from option.xml be used. If not specified, defaults will be generated
- <reportOptions>false</reportOptions> Are we building the options array to save on a report?
- <jobDefaultSaveOutputOption> The job's saveOutput option
- </root>
- -->
- <xsl:stylesheet version="1.0"
- xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xts="http://developer.cognos.com/schemas/xts/"
- xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
- exclude-result-prefixes="bus xsi xsl xts SOAP-ENC">
-
- <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="options" match="/root/optionsList/*/option" use="concat(local-name(parent::*), '-', @name)"/>
- <xsl:variable name="env" select="/root/env"/>
- <xsl:variable name="promptCacheMode" select="string($env/param[@name='m_ro_promptCacheMode'])"/>
- <xsl:variable name="reportOptions" select="/root/reportOptions = 'true'"/>
- <xsl:template match="/root" priority="3">
- <xsl:choose>
- <xsl:when test="/root/*[local-name()='optionType'] != ''">
- <xsl:for-each select="/root/*[local-name()='optionType']">
- <xsl:variable name="optionType" select="."/>
- <xsl:apply-templates select="/root/optionsList/*[local-name()=$optionType]/option[not(@complex='T')]" mode="simpleOptions"/>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="/root/optionsList/*/option[not(@complex='T')]" mode="simpleOptions"/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:call-template name="buildComplexOptions"/>
-
-
- <!-- handle deliveryOptions -->
- <xsl:if test="key('env-param','m_ro_email') = 'true'">
- <xsl:variable name="deliveryOptions" select="/root/*[local-name()='deliveryOptions']/*[local-name()='options']/*[local-name()='value']/*[*[local-name()='name']/@xsi:type='bus:deliveryOptionEnum']"/>
- <xsl:choose>
- <xsl:when test="key('env-param','m_ro_burst') = 'true' and not(key('env-param','run_options_visited'))">
- <!-- remove any recipients that were specified -->
- <xsl:copy-of select="$deliveryOptions[local-name()='item' and *[local-name()='name' and (.!='toAddress' and .!='ccAddress' and .!='bccAddress' and .!='to' and .!='cc' and .!='bcc')]]"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:copy-of select="$deliveryOptions"/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="/root/*[local-name()='optionType'] = 'powerPlay8Options'">
- <xsl:copy-of select="/root/*[local-name()='deliveryOptions']/*[local-name()='options']/*[local-name()='value']/*[*[local-name()='name']/@xsi:type='bus:powerPlay8OptionEnum']"/>
- </xsl:when>
- <xsl:when test="/root/*[local-name()='optionType'] = 'powerPlay8JobOptions' and /root/*[local-name()='optionType'] = 'runOptions'">
- <xsl:copy-of select="/root/*[local-name()='deliveryOptions']/*[local-name()='options']/*[local-name()='value']/*[*[local-name()='name']/@xsi:type!='bus:deliveryOptionEnum']"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:copy-of select="/root/*[local-name()='deliveryOptions']/*[local-name()='options']/*[local-name()='value']/*[*[local-name()='name']/@xsi:type='bus:runOptionEnum']"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- <!-- handle mobileOptions -->
- <xsl:if test="key('env-param','m_ro_mobile') = 'true'">
- <xsl:copy-of select="/root/*[local-name()='mobileOptions']/*[local-name()='options']/*[local-name()='value']/*"/>
- </xsl:if>
- </xsl:template>
- <!-- special handling for the printers -->
- <xsl:template match="*[local-name()='option' and @envName = 'm_ro_printer' or @envName = 'm_ro_printerAddress']" mode="simpleOptions" priority="2">
- <xsl:if test="key('env-param','ro_printer_kw') = @name and key('env-param','m_ro_print')='true'">
- <item xsi:type="{@optionType}">
- <name xsi:type="{../@nameType}"><xsl:value-of select="@name"/></name>
- <value xsi:type="{@type}"><xsl:value-of select="key('env-param',@envName)"/></value>
- </item>
- </xsl:if>
- </xsl:template>
- <!-- special handling for the selectionBasedFeatures -->
- <xsl:template match="*[local-name()='option' and @envName = 'm_ro_selectionBasedFeatures']" mode="simpleOptions" priority="2">
- <xsl:if test="key('env-param','m_ro_selectionBasedFeatures') != ''">
- <item xsi:type="{@optionType}">
- <name xsi:type="{../@nameType}"><xsl:value-of select="@name"/></name>
- <value xsi:type="{@type}"><xsl:value-of select="key('env-param',@envName)"/></value>
- </item>
- </xsl:if>
- </xsl:template>
- <!-- special handling for the saveOutput runOption -->
- <xsl:template match="*[local-name()='option' and @envName = 'm_ro_saveOutput']" mode="simpleOptions" priority="2">
- <!-- save the saveOutput runoption under the following conditions
- - if we're not building the options array for a report
- - if the default options are overriden and we're refreshing the report cache-->
- <xsl:if test="not($reportOptions) or (key('env-param','override_default_options')='true' and $promptCacheMode='refresh')">
- <item xsi:type="{@optionType}">
- <name xsi:type="{../@nameType}"><xsl:value-of select="@name"/></name>
- <value xsi:type="{@type}">
- <xsl:choose>
- <xsl:when test="$promptCacheMode='create' and @ifClearPromptCache!=''"><xsl:value-of select="@ifClearPromptCache"/></xsl:when>
- <!-- check override-default-reportoptions is un-checked and that we are visiting schedule properties -->
- <xsl:when test="key('env-param','changed_override_default_reportOptions') and not(key('env-param','override_default_reportOptions')) and key('env-param','visited_schedule_properties')='true'">true</xsl:when>
- <xsl:when test="key('env-param','override_outputFormat_option')='true'">true</xsl:when>
- <!-- force saveOutput to true (or the job's default setting) if the user didn't override the default job options -->
- <xsl:when test="key('env-param','changed_override_default_options') and not(key('env-param','override_default_options')) and (key('env-param','run_options_visited')='true' or key('env-param','step_options_visited')='true')">
- <xsl:choose>
- <xsl:when test="/root/jobDefaultSaveOutputOption"><xsl:value-of select="/root/jobDefaultSaveOutputOption"/></xsl:when>
- <xsl:otherwise>true</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="key('env-param','m_ro_saveOutput')='true' and (not(key('env-param','save_how')) or key('env-param','save_how')!='new_entry')">true</xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </value>
- </item>
- </xsl:if>
- </xsl:template>
- <!-- special handling for the promptCacheMode runOption for job steps: when set to none, don't save it this allows the default to be picked up from the report -->
- <xsl:template match="*[local-name()='option' and @envName = 'm_ro_promptCacheMode' and $promptCacheMode='none' and (key('env-param','run_options_visited')='true' or key('env-param','step_options_visited')='true')]" mode="simpleOptions" priority="2"/>
- <!-- special handling for the contentTask (check options) -->
- <xsl:template match="*[local-name()='option' and @envName = 'cto_consistency_check']" mode="simpleOptions" priority="2">
- <xsl:choose>
- <xsl:when test="key('env-param','ctro_runoption')='fix'">
- <item xsi:type="{@optionType}">
- <name xsi:type="{../@nameType}"><xsl:value-of select="@name"/></name>
- <value xsi:type="{@type}"><xsl:value-of select="'false'"/></value>
- </item>
- </xsl:when>
- <xsl:when test="key('env-param','ctro_runoption')='find'">
- <item xsi:type="{@optionType}">
- <name xsi:type="{../@nameType}"><xsl:value-of select="@name"/></name>
- <value xsi:type="{@type}">
- <xsl:choose>
- <xsl:when test="@name = 'checkInternalInconsistencies' and key('env-param','cto_consistency_check')='internalRef'"><xsl:value-of select="'true'"/></xsl:when>
- <xsl:when test="@name = 'checkSecurityReferences' and key('env-param','cto_consistency_check')='internalRef'"><xsl:value-of select="'false'"/></xsl:when>
- <xsl:when test="@name = 'checkInternalInconsistencies' and key('env-param','cto_consistency_check')='externalRef'"><xsl:value-of select="'false'"/></xsl:when>
- <xsl:when test="@name = 'checkSecurityReferences' and key('env-param','cto_consistency_check')='externalRef'"><xsl:value-of select="'true'"/></xsl:when>
- </xsl:choose>
- </value>
- </item>
- </xsl:when>
- </xsl:choose>
- </xsl:template>
-
- <!-- special handling for the contentTask (repair options) -->
- <xsl:template match="*[local-name()='option' and @envName = 'ctro_runoption']" mode="simpleOptions" priority="2">
- <xsl:choose>
- <xsl:when test="key('env-param','ctro_runoption')='find'">
- <item xsi:type="{@optionType}">
- <name xsi:type="{../@nameType}"><xsl:value-of select="@name"/></name>
- <value xsi:type="{@type}"><xsl:value-of select="'false'"/></value>
- </item>
- </xsl:when>
- <xsl:when test="key('env-param','ctro_runoption')='fix'">
- <item xsi:type="{@optionType}">
- <name xsi:type="{../@nameType}"><xsl:value-of select="@name"/></name>
- <value xsi:type="{@type}">
- <xsl:choose>
- <xsl:when test="@name = 'repairInternalInconsistencies' and key('env-param','cto_consistency_check')='internalRef'"><xsl:value-of select="'true'"/></xsl:when>
- <xsl:when test="@name = 'repairSecurityReferences' and key('env-param','cto_consistency_check')='internalRef'"><xsl:value-of select="'false'"/></xsl:when>
- <xsl:when test="@name = 'repairInternalInconsistencies' and key('env-param','cto_consistency_check')='externalRef'"><xsl:value-of select="'false'"/></xsl:when>
- <xsl:when test="@name = 'repairSecurityReferences' and key('env-param','cto_consistency_check')='externalRef'"><xsl:value-of select="'true'"/></xsl:when>
- </xsl:choose>
- </value>
- </item>
- </xsl:when>
- </xsl:choose>
- </xsl:template>
-
- <!-- handle all the boolean, int and string options -->
- <!-- note: we handle these types: xmlEncodedXML, portalListSeparatorEnum here for now -->
- <xsl:template match="*[local-name()='option' and @envName!='m_io_includedObjects']" mode="simpleOptions" priority="1">
- <xsl:choose>
- <xsl:when test="key('env-param',@envName) != '' or (@type = 'xsd:boolean' and not(key('env-param',@envName)) and key('env-param',concat('changed_', @envName)) = '1')">
- <item xsi:type="{@optionType}">
- <name xsi:type="{../@nameType}"><xsl:value-of select="@name"/></name>
- <value xsi:type="{@type}">
- <xsl:choose>
- <xsl:when test="$promptCacheMode='create' and @ifClearPromptCache!=''"><xsl:value-of select="@ifClearPromptCache"/></xsl:when>
- <xsl:when test="@type = 'xsd:boolean' and not(key('env-param',@envName)) and key('env-param',concat('changed_', @envName)) = '1'">false</xsl:when>
- <xsl:otherwise><xsl:value-of select="key('env-param',@envName)"/></xsl:otherwise>
- </xsl:choose>
- </value>
- </item>
-
- </xsl:when>
- <!-- build a default option if a default is specified, or force is set to true -->
- <xsl:when test="(@default != '' and (not(/root/genDefaults) or /root/genDefaults = 'true')) or @forceDefault='true' or (@envName='m_ro_data' and not($reportOptions))">
- <item xsi:type="{@optionType}">
- <name xsi:type="{../@nameType}"><xsl:value-of select="@name"/></name>
- <value xsi:type="{@type}">
- <xsl:choose>
- <xsl:when test="$promptCacheMode='create' and @ifClearPromptCache!=''">
- <xsl:value-of select="@ifClearPromptCache"/>
- </xsl:when>
- <xsl:when test="/root/batchOptions = 'true' and @batchDefault">
- <xsl:value-of select="@batchDefault"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="@default"/>
- </xsl:otherwise>
- </xsl:choose>
- </value>
- </item>
- </xsl:when>
- </xsl:choose>
- </xsl:template>
- <!--
- Need special handling to build complex options
- -->
- <xsl:template name="buildComplexOptions">
- <!-- outputFormat -->
- <xsl:if test="$env/*[starts-with(@name,'m_ro_outputFormat')]">
- <xsl:call-template name="buildOptionArray">
- <xsl:with-param name="type" select="'runOptions'"/>
- <xsl:with-param name="name" select="'outputFormat'"/>
- </xsl:call-template>
- </xsl:if>
- <!-- outputLocale -->
- <xsl:if test="key('env-param','m_ro_outputLocale')">
- <!-- When generating options for a job, we want to save the outputLocales as both runOptions and powerPlay8JobOptions, so run through this code multiple times -->
- <xsl:for-each select="/root/*[local-name()='optionType']">
- <xsl:call-template name="buildOptionArray">
- <xsl:with-param name="type" select="."/>
- <xsl:with-param name="name" select="'outputLocale'"/>
- </xsl:call-template>
- </xsl:for-each>
- </xsl:if>
-
- <!-- saveAs -->
- <xsl:if test="key('env-param','save_how')='new_entry' and (key('env-param','m_ro_saveOutput')='true' or not(key('env-param','m_ro_saveOutput')))">
- <item xsi:type="bus:runOptionSaveAs">
- <name xsi:type="bus:runOptionEnum">saveAs</name>
- <objectClass xsi:type="bus:reportSaveAsEnum"><xsl:value-of select="key('env-param','m_ro_saveAsType')"/></objectClass>
- <objectName xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:multilingualToken[1]">
- <item xsi:type="bus:multilingualToken">
- <locale xsi:type="xsd:string"><xsl:value-of select="/root/*[local-name()='contentLocale']"/></locale>
- <value xsi:type="xsd:string"><xsl:value-of select="key('env-param','m_ro_saveAsName')"/></value>
- </item>
- </objectName>
- <parentSearchPath xsi:type="xsd:string">
- <xsl:choose>
- <xsl:when test="key('env-param','m_ro_saveAsPath')!=''">
- <xsl:value-of select="key('env-param','m_ro_saveAsPath')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="key('env-param','m_path')"/>
- </xsl:otherwise>
- </xsl:choose>
- </parentSearchPath>
- </item>
- </xsl:if>
-
-
- <xsl:if test="(/root/optionType='contentTaskProperties')">
- <xsl:choose>
- <!-- report upgrade -->
- <xsl:when test="$env/param[@name='contentTaskType']='reportUpgrade'">
- <!-- upgradeClassesContext -->
- <xsl:call-template name="buildOptionArray">
- <xsl:with-param name="type" select="'contentTaskProperties'"/>
- <xsl:with-param name="name" select="'upgradeClasses'"/>
- </xsl:call-template>
- <!-- upgradeClassesContext -->
- <xsl:call-template name="buildOptionArray">
- <xsl:with-param name="type" select="'contentTaskProperties'"/>
- <xsl:with-param name="name" select="'upgradeClassesContext'"/>
- </xsl:call-template>
- <!-- upgradeClassesReferenceContext -->
- <xsl:call-template name="buildOptionArray">
- <xsl:with-param name="type" select="'contentTaskProperties'"/>
- <xsl:with-param name="name" select="'upgradeClassesReferenceContext'"/>
- </xsl:call-template>
- </xsl:when>
- <!-- content utilization -->
- <xsl:when test="$env/param[@name='contentTaskType']='createContentUtilizationInfo'">
- <xsl:variable name="optionDef" select="key('options', 'contentTaskOptions-createContentStoreUtilizationInfo')"/>
- <xsl:variable name="itemType" select="$optionDef/@optionType"/>
- <item xsi:type="bus:contentTaskOptionCSUtilizationConfiguration">
- <name xsi:type="bus:contentTaskOptionEnum">createContentStoreUtilizationInfo</name>
- <value xsi:type="bus:contentStoreUtilizationConfiguration">
- <xsl:variable name="filePerTenant" select="/root/env/param[@name='cto_filePerTenant']"/>
- <xsl:if test="$filePerTenant!=''">
- <filePerTenant xsi:type="xs:boolean"><xsl:value-of select="$filePerTenant"/></filePerTenant>
- </xsl:if>
- <tenantFilter xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xs:string[]">
- <xsl:for-each select="/root/env/param[@name='selectedTenants']">
- <item xsi:type="xs:string"><xsl:value-of select="."/></item>
- </xsl:for-each>
- <xsl:if test="/root/env/param[@name='selectPublicTenant']='true'">
- <item xsi:type="xs:string"/>
- </xsl:if>
- </tenantFilter>
- <xsl:variable name="granularity" select="/root/env/param[@name='cto_granularity']"/>
- <xsl:if test="$granularity!=''">
- <granularity xsi:type="xs:string"><xsl:value-of select="$granularity"/></granularity>
- </xsl:if>
- </value>
- </item>
- </xsl:when>
- <!-- consistency check -->
- <xsl:otherwise>
- <!-- contentTask search path array -->
- <xsl:if test="$env/param[@name='cto_consistency_check']='internalRef'">
- </xsl:if>
- <xsl:if test="$env/param[starts-with(@name,'m_namespace_')]">
- <xsl:call-template name="buildOptionArray">
- <xsl:with-param name="type" select="'contentTaskProperties'"/>
- <xsl:with-param name="name" select="'securityReferencesContext'"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- <xsl:if test="(/root/optionType='indexOptions')">
- <xsl:call-template name="buildOptionArray">
- <xsl:with-param name="type" select="'indexOptions'"/>
- <xsl:with-param name="name" select="'includedObjects'"/>
- </xsl:call-template>
- <xsl:call-template name="buildOptionArray">
- <xsl:with-param name="type" select="'indexOptions'"/>
- <xsl:with-param name="name" select="'excludedObjects'"/>
- </xsl:call-template>
- </xsl:if>
- <xsl:if test="(/root/optionType='contentTaskOptions')">
- <xsl:call-template name="buildOptionArray">
- <xsl:with-param name="type" select="'contentTaskOptions'"/>
- <xsl:with-param name="name" select="'cleanupContentContext'"/>
- </xsl:call-template>
- <xsl:call-template name="buildRetentionRuleArray">
- <xsl:with-param name="type" select="'contentTaskOptions'"/>
- <xsl:with-param name="name" select="'cleanupContentRetentionRules'"/>
- </xsl:call-template>
- </xsl:if>
-
- <xsl:if test="(/root/optionType='deploymentOptions')">
- <xsl:call-template name="buildOptionArray">
- <xsl:with-param name="type" select="'deploymentOptions'"/>
- <xsl:with-param name="name" select="'upgradeClasses'"/>
- <xsl:with-param name="allowEmptyArrays" select="'true'"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:template>
-
- <!-- builds a standard options array -->
- <xsl:template name="buildOptionArray">
- <xsl:param name="type"/>
- <xsl:param name="name"/>
- <xsl:param name="allowEmptyArrays" select="'false'"/>
-
- <!-- All the required information about the option can be found in the option list (from options.xml) -->
- <xsl:variable name="optionDef" select="key('options', concat($type, '-', $name))"/>
- <xsl:variable name="itemType" select="$optionDef/@optionType"/>
- <xsl:variable name="nameType">
- <xsl:choose>
- <xsl:when test="$optionDef/@nameType!=''"><xsl:value-of select="$optionDef/@nameType"/></xsl:when>
- <xsl:otherwise><xsl:value-of select="$optionDef/parent::*/@nameType"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="valueType" select="$optionDef/@type"/>
- <xsl:variable name="envName" select="$optionDef/@envName"/>
- <xsl:if test="($envName !='') and ($allowEmptyArrays='true' or ($env/*[starts-with(@name, $envName) and string(.) !='']))">
- <item xsi:type="{$itemType}">
- <name xsi:type="{$nameType}"><xsl:value-of select="$name"/></name>
- <value xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="{$valueType}[{ count( $env/*[starts-with(@name, $envName) and string(.) != ''] ) }]">
- <xsl:for-each select="$env/*[starts-with(@name, $envName) and string(.) !='']">
- <item xsi:type="{$valueType}"><xsl:value-of select="."/></item>
- </xsl:for-each>
- </value>
- </item>
- </xsl:if>
- </xsl:template>
-
- <!-- builds a retention rule array -->
- <xsl:template name="buildRetentionRuleArray">
- <xsl:param name="type"/>
- <xsl:param name="name"/>
-
- <!-- All the required information about the option can be found in the option list (from options.xml) -->
- <xsl:variable name="optionDef" select="key('options', concat($type, '-', $name))"/>
- <xsl:variable name="itemType" select="$optionDef/@optionType"/>
- <xsl:variable name="nameType">
- <xsl:choose>
- <xsl:when test="$optionDef/@nameType!=''"><xsl:value-of select="$optionDef/@nameType"/></xsl:when>
- <xsl:otherwise><xsl:value-of select="$optionDef/parent::*/@nameType"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="valueType" select="$optionDef/@type"/>
- <xsl:variable name="envName" select="$optionDef/@envName"/>
-
- <xsl:if test="($envName !='') and ($env/*[starts-with(@name, $envName) and string(.) !=''])">
- <item xsi:type="{$itemType}">
- <name xsi:type="{$nameType}"><xsl:value-of select="$name"/></name>
- <value xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:retentionRule[{count($env/*[starts-with(@name, $envName) and string(.) !=''])}]">
- <xsl:for-each select="$env/*[starts-with(@name, $envName) and string(.) !='']">
- <xsl:variable name="className" select="substring-after(@name, $envName)"/>
- <xsl:variable name="maxObjects" select="string($env/*[@name=concat('cto_maxNumber_',$className)])"/>
- <xsl:variable name="durationValue" select="string($env/*[@name=concat('cto_duration_',$className)])"/>
- <xsl:variable name="durationUnits" select="string($env/*[@name=concat('cto_durationSelect_',$className)])"/>
- <xsl:variable name="maxDuration">
- <xsl:choose>
- <xsl:when test="$durationUnits='seconds'">
- <xsl:value-of select="concat('PT',$durationValue,'S')"/>
- </xsl:when>
- <xsl:when test="$durationUnits='minutes'">
- <xsl:value-of select="concat('PT',$durationValue,'M')"/>
- </xsl:when>
- <xsl:when test="$durationUnits='hours'">
- <xsl:value-of select="concat('PT',$durationValue,'H')"/>
- </xsl:when>
- <xsl:when test="$durationUnits='days'">
- <xsl:value-of select="concat('P',$durationValue,'D')"/>
- </xsl:when>
- <xsl:when test="$durationUnits='months'">
- <xsl:value-of select="concat('P',$durationValue,'M')"/>
- </xsl:when>
- <xsl:otherwise><xsl:value-of select="''"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <item xsi:type="bus:retentionRule">
- <objectClass xsi:type="bus:classEnum"><xsl:value-of select="$className"/></objectClass>
- <prop xsi:type="bus:propEnum">creationTime</prop>
- <xsl:choose>
- <xsl:when test="$maxObjects != ''">
- <maxObjects xsi:type="xsd:integer"><xsl:value-of select="$maxObjects"/></maxObjects>
- </xsl:when>
- <xsl:otherwise>
- <maxObjects xsi:type="xsd:integer">0</maxObjects>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="$maxDuration != ''">
- <maxDuration xsi:type="xsd:string"><xsl:value-of select="$maxDuration"/></maxDuration>
- </xsl:when>
- <xsl:otherwise>
- <maxDuration xsi:type="xsd:string"><xsl:value-of select="''"/></maxDuration>
- </xsl:otherwise>
- </xsl:choose>
- </item>
- </xsl:for-each>
- </value>
- </item>
- </xsl:if>
- </xsl:template>
- </xsl:stylesheet>
|