123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514 |
- <?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 xmlns:dt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/templates/" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt">
- <options xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:cm="http://developer.cognos.com/schemas/bibus/3/" xsi:type="cm:optionArrayProp">
- <value xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="cm:option[2]">
- <item xsi:type="cm:runOptionStringArray">
- <name xsi:type="cm:runOptionEnum">outputFormat</name>
- <value xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:string[2]">
- <item xsi:type="xsd:string">PDF</item>
- <item xsi:type="xsd:string">HTML</item>
- </value>
- </item>
- ...
- </value>
- </options>
- <reportOptions>
- <options xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:cm="http://developer.cognos.com/schemas/bibus/3/" xsi:type="cm:optionArrayProp">
- <value xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="cm:option[2]">
- ...
- </value>
- </options>
- </reportOptions>
- <deliverySection>true</deliverySection> are we dealing with a delivery section
- <obj>
- <report>
- ...
- </report>
- </obj>
- <preferences>
- <item xsi:type="bus:userPreferenceVar">
- <name xsi:type="xsd:string">timeZoneID</name>
- <value xsi:type="xsd:string">EST</value>
- </item>
- ....
- </preferences>
- <capabilities>...</capabilities>
- <saveAsPath>...</saveAsPath> override for the default saveAsPath (default is parent searchPath)
- <save_how>...</save_how> override for the default save_how (default is report)
- <basicOptions>false</basicOptions> are we building env params for a basic option dialog (dropdown menus for format and language)
- <optionList include="true | false"> can let the transform know if it should only generate params for a fixed list, or if it shouldn't generate params for the listed options
- <item>outputFormat</item>
- <item>outputLocale</item>
- ...
- </optionList>
- <defaultArchiveLocation>
- <archiveLocation>
- <searchPath type="cm:stringProp">/configuration/archiveLocation[@name='fileLocation']</searchPath>
- <defaultName type="cm:tokenProp">fileLocation</defaultName>
- </archiveLocation>
- </defaultArchiveLocation>
- </root>
- -->
- <xsl:stylesheet version="1.0"
- xmlns:cm="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:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:set="http://exslt.org/sets"
- xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
- exclude-result-prefixes="cm xsd xsi xsl xts SOAP-ENC xtsext set">
-
- <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="system-param" match="/root/system/param" use="@name"/>
- <xsl:key name="option-list" match="/root/optionList/item" use="."/>
- <xsl:variable name="env" select="/root/env"/>
- <xsl:variable name="object" select="/root/obj/*"/>
-
- <xsl:template match="/root" priority="3">
- <xsl:variable name="items" select="*[local-name()='options']/*[local-name()='value']/*[local-name()='item']"/>
- <xsl:variable name="optionGroups" select="set:distinct($items/*[local-name()='name']/@*[local-name()='type'])"/>
- <xsl:for-each select="$optionGroups">
- <xsl:variable name="groupName" select="."/>
- <xsl:call-template name="processOptions">
- <xsl:with-param name="options" select="set:distinct($items/*[local-name()='name' and @*[local-name()='type']=$groupName])/.."/>
- </xsl:call-template>
- </xsl:for-each>
-
- <xsl:variable name="allowRestrictedDefaults" select="/root/allowRestrictedDefaults"/>
- <xsl:variable name="scheduleOptionsExist" select="/root/scheduleOptionsExist"/>
- <xsl:variable name="allowPDF"><xsl:if test="/root/capabilities and not(/root/capabilities/canGeneratePDFOutput)">false</xsl:if></xsl:variable>
- <xsl:variable name="allowXML"><xsl:if test="/root/capabilities and not(/root/capabilities/canGenerateXMLOutput)">false</xsl:if></xsl:variable>
- <xsl:variable name="allowCSV"><xsl:if test="/root/capabilities and not(/root/capabilities/canGenerateCSVOutput)">false</xsl:if></xsl:variable>
- <xsl:variable name="allowXLS"><xsl:if test="/root/capabilities and not(/root/capabilities/canGenerateXLSOutput)">false</xsl:if></xsl:variable>
-
- <!-- do this when schedule options exist for a restricted user -->
- <xsl:if test="/root/scheduleOptionsExist != 'true' and ($allowPDF='false' or $allowXML='false' or $allowCSV='false' or $allowXLS='false')">
- <param name="override_outputFormat_option"><xsl:value-of select="'true'"/></param>
- </xsl:if>
-
- <!-- if we have a delivery section, then make sure we always have the appropriate env params -->
- <xsl:if test="/root/deliverySection = 'true' and not($items/*[local-name()='name'] = 'saveAs')">
- <param name="m_ro_saveAsType">reportView</param>
- <xsl:variable name="saveAsName"><xts:string id="IDS_ACT_CUSTOM_OF"><xts:param name="curName"><xsl:value-of select="$object/*[local-name()='defaultName']"/></xts:param></xts:string></xsl:variable>
- <param name="m_ro_saveAsName">
- <xsl:choose>
- <xsl:when test="string-length($saveAsName) > 256"><xsl:value-of select="substring($saveAsName,0,257)"/></xsl:when>
- <xsl:otherwise><xsl:value-of select="$saveAsName"/></xsl:otherwise>
- </xsl:choose>
- </param>
- <param name="m_ro_saveAsPath">
- <xsl:choose>
- <xsl:when test="/root/saveAsPath != ''">
- <xsl:value-of select="/root/saveAsPath"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$object/*[local-name()='parent']/*/*[local-name()='searchPath']"/>
- </xsl:otherwise>
- </xsl:choose>
- </param>
- <param name="save_how">
- <xsl:choose>
- <xsl:when test="/root/save_how != ''">
- <xsl:value-of select="/root/save_how"/>
- </xsl:when>
- <xsl:otherwise>report</xsl:otherwise>
- </xsl:choose>
- </param>
- </xsl:if>
- <!-- if we have a delivery section, then make sure we always have the default archive options -->
- <xsl:if test="/root/deliverySection = 'true' and not($items/*[local-name()='name'] = 'conflictResolution')">
- <param name="m_arc_conflictResolution">replace</param>
- <param name="m_arc_archiveLocation"><xsl:value-of select="/root/defaultArchiveLocation/*[local-name()='archiveLocation']/*[local-name()='searchPath']"/></param>
- </xsl:if>
-
- <!-- should we default the format and locale? -->
- <xsl:if test="/root/*[local-name()='defaultOptions']='true'">
- <xsl:call-template name="generateDefaults"/>
- </xsl:if>
- </xsl:template>
- <!-- handles the case where the user specified an optionList -->
- <xsl:template name="processOptions">
- <xsl:param name="options"/>
- <xsl:choose>
- <xsl:when test="/root/optionList != ''">
- <xsl:choose>
- <xsl:when test="/root/optionList[@include = 'true']">
- <xsl:apply-templates select="$options[key('option-list',*[local-name()='name'])]"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="$options[not(key('option-list',*[local-name()='name']))]"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="$options"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!--
- special handling for the printers
- -->
- <xsl:template match="*[./*[local-name()='name']='printerAddress' or ./*[local-name()='name']='printer' ]" priority="2">
- <xsl:variable name="optionName" select="./*[local-name()='name']"/>
- <param name="{concat('m_ro_',$optionName)}"><xsl:value-of select="./*[local-name()='value']"/></param>
- <xsl:choose>
- <xsl:when test="$optionName = 'printerAddress'">
- <param name="ro_printer_kw">printerAddress</param>
- </xsl:when>
- <xsl:otherwise>
- <param name="ro_printer_kw">printer</param>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- special handling for promtpCacheMode. If we're dealing with a schedule, then set to 'none' -->
- <xsl:template match="*[./*[local-name()='name']='promptCacheMode']" priority="1">
- <xsl:choose>
- <xsl:when test="/root/scheduleOptionsExist = 'true'">
- <param name="{concat('m_ro_',./*[local-name()='name'])}">none</param>
- </xsl:when>
- <xsl:otherwise>
- <param name="{concat('m_ro_',./*[local-name()='name'])}"><xsl:value-of select="./*[local-name()='value']"/></param>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- special handling for busting. If we're default step options from jobOptions then don't grab the burst run option -->
- <xsl:template match="*[./*[local-name()='name']='burst']" priority="2">
- <xsl:if test="not(/root/usingJobOptions) or /root/usingJobOptions='false' or /root/canBurst = 'true'">
- <param name="{concat('m_ro_',./*[local-name()='name'])}"><xsl:value-of select="./*[local-name()='value']"/></param>
- </xsl:if>
- </xsl:template>
-
- <!--
- pdfOptionBoolean and pdfOptionPrintQuality
- -->
- <xsl:template match="*[contains(@xsi:type,':pdfOptionBoolean') or contains(@xsi:type, ':pdfOptionPrintQuality')]" priority="1">
- <param name="{concat('m_pdf_',./*[local-name()='name'])}"><xsl:value-of select="./*[local-name()='value']"/></param>
- </xsl:template>
-
- <!--
- pdfOptionXMLEncodedXML
- -->
- <xsl:template match="*[contains(@xsi:type, ':pdfOptionXMLEncodedXML')]" priority="1">
- <param name="{concat('m_pdf_',./*[local-name()='name'], '_runOption_Encrypted')}"><xsl:value-of select="./*[local-name()='value']"/></param>
- </xsl:template>
-
- <!-- archive options -->
- <xsl:template match="*[contains(@xsi:type, ':archiveOptionConflictResolution') or contains(@xsi:type, ':archiveOptionString') or contains(@xsi:type, ':archiveOptionSearchPathSingleObject')]" priority="1">
- <param name="{concat('m_arc_',./*[local-name()='name'])}"><xsl:value-of select="./*[local-name()='value']"/></param>
- </xsl:template>
- <!--
- jobOptionBoolean
- -->
- <xsl:template match="*[contains(@xsi:type,':jobOptionBoolean')]" priority="1">
- <xsl:variable name="optionName" select="./*[local-name()='name']"/>
- <param name="{concat('m_jo_',$optionName)}"><xsl:value-of select="./*[local-name()='value']"/></param>
- </xsl:template>
-
- <!--
- monitorOptionBoolean
- -->
- <xsl:template match="*[contains(@xsi:type,':monitorOptionBoolean')]" priority="1">
- <xsl:variable name="optionName" select="./*[local-name()='name']"/>
- <param name="{concat('m_mo_',$optionName)}"><xsl:value-of select="./*[local-name()='value']"/></param>
- </xsl:template>
- <!--
- indexOptionBoolean
- -->
- <xsl:template match="*[contains(@xsi:type,':indexOptionBoolean')]" priority="1">
- <xsl:variable name="optionName" select="./*[local-name()='name']"/>
-
- <param name="{concat('m_io_',$optionName)}"><xsl:value-of select="./*[local-name()='value']"/></param>
- </xsl:template>
-
- <!--
- agentOptionBoolean
- -->
- <xsl:template match="*[contains(@xsi:type,':agentOptionBoolean')]" priority="1">
- <xsl:variable name="optionName" select="./*[local-name()='name']"/>
- <param name="{concat('m_ao_',$optionName)}"><xsl:value-of select="./*[local-name()='value']"/></param>
- </xsl:template>
-
- <!--
- genericOptionBoolean
- -->
- <xsl:template match="*[contains(@xsi:type,':genericOptionBoolean')]" priority="1">
- <xsl:variable name="optionName" select="substring-after(./*[local-name()='name'],'#')"/>
- <param name="{concat('m_go_',$optionName)}"><xsl:value-of select="./*[local-name()='value']"/></param>
- </xsl:template>
- <!--
- dataIntegrationTaskOptionBoolean
- -->
- <xsl:template match="*[contains(@xsi:type,':dataIntegrationTaskOptionBoolean')]" priority="1">
- <xsl:variable name="optionName" select="./*[local-name()='name']"/>
-
- <param name="{concat('m_mo_',$optionName)}"><xsl:value-of select="./*[local-name()='value']"/></param>
- </xsl:template>
- <!--
- outputFormat
- -->
- <xsl:template match="*[./*[local-name()='name' and . = 'outputFormat']]">
- <xsl:variable name="optionName" select="./*[local-name()='name']"/>
- <xsl:variable name="AllowPDF"><xsl:if test="/root/capabilities and not(/root/capabilities/canGeneratePDFOutput)">false</xsl:if></xsl:variable>
- <xsl:variable name="AllowXML"><xsl:if test="/root/capabilities and not(/root/capabilities/canGenerateXMLOutput)">false</xsl:if></xsl:variable>
- <xsl:variable name="AllowCSV"><xsl:if test="/root/capabilities and not(/root/capabilities/canGenerateCSVOutput)">false</xsl:if></xsl:variable>
- <xsl:variable name="AllowXLS"><xsl:if test="/root/capabilities and not(/root/capabilities/canGenerateXLSOutput)">false</xsl:if></xsl:variable>
- <xsl:choose>
- <xsl:when test="/root/basicOptions = 'true'">
- <param name="m_ro_outputFormat"><xsl:value-of select="./*[local-name()='value']/*[local-name()='item'][1]"/></param>
- </xsl:when>
- <xsl:otherwise>
- <xsl:for-each select="./*[local-name()='value']/*[local-name()='item']">
- <xsl:choose>
- <xsl:when test="contains(., 'HTML')">
- <param name="{concat('m_ro_',$optionName,'_HTML')}"><xsl:value-of select="."/></param>
- <param name="m_ro_outputF_HTML_Type">true</param>
- </xsl:when>
- <xsl:when test="contains(., 'XLS') and $AllowXLS != 'false'">
- <param name="{concat('m_ro_',$optionName,'_XLS2000')}"><xsl:value-of select="."/></param>
- <param name="m_ro_outputF_XLS2000_Type">true</param>
- </xsl:when>
- <xsl:when test="/root/allowRestrictedDefaults='true'">
- <param name="{concat('m_ro_',$optionName,'_',.)}"><xsl:value-of select="."/></param>
- </xsl:when>
- <xsl:when test="contains(., 'PDF') and $AllowPDF != 'false'">
- <param name="{concat('m_ro_',$optionName,'_',.)}"><xsl:value-of select="."/></param>
- </xsl:when>
- <xsl:when test="contains(., 'XML') and $AllowXML != 'false'">
- <param name="{concat('m_ro_',$optionName,'_',.)}"><xsl:value-of select="."/></param>
- </xsl:when>
- <xsl:when test="contains(., 'CSV') and $AllowCSV != 'false'">
- <param name="{concat('m_ro_',$optionName,'_',.)}"><xsl:value-of select="."/></param>
- </xsl:when>
- <xsl:when test="((contains(., 'spreadsheet') or contains(., 'xlsxData') or contains(., 'XLWA')) and $AllowXLS != 'false')">
- <param name="{concat('m_ro_',$optionName,'_',.)}"><xsl:value-of select="."/></param>
- </xsl:when>
- <xsl:otherwise></xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!--
- outputLocale
- -->
- <xsl:template match="*[./*[local-name()='name' and . = 'outputLocale']]">
- <xsl:variable name="jobStepClass" select="../../../obj/*/*[local-name()='objectClass']"/>
- <xsl:variable name="optionType" select="@xsi:type"/>
- <xsl:variable name="isJobDefinition" select="../../../jobDefinition='true'"/>
- <xsl:variable name="isPowerPlayJobStep" select="(not($isJobDefinition) and ($jobStepClass='powerPlay8Report' or $jobStepClass='powerPlay8ReportView'))"/>
- <xsl:variable name="isJobDefinitionWithPowerPlayOption" select="($isJobDefinition and $optionType='bus:powerPlay8OptionLanguageArray')"/>
- <xsl:variable name="isPowerPlayJobStepWithReportOption" select="($isPowerPlayJobStep and $optionType='bus:runOptionLanguageArray')"/>
- <xsl:variable name="isReportJobStepWithPowerPlayOption" select="(not($isPowerPlayJobStep) and $optionType='bus:powerPlay8OptionLanguageArray')"/>
- <xsl:if test="not(($isJobDefinitionWithPowerPlayOption) or ($isPowerPlayJobStepWithReportOption) or ($isReportJobStepWithPowerPlayOption))">
- <xsl:for-each select="./*[local-name()='value']/*[local-name()='item']">
- <param name="m_ro_outputLocale"><xsl:value-of select="."/></param>
- </xsl:for-each>
- </xsl:if>
- </xsl:template>
- <!--
- saveAs runoption
- -->
- <xsl:template match="*[./*[local-name()='name' and . = 'saveAs']]">
- <xsl:variable name="optionName" select="./*[local-name()='name']"/>
-
- <param name="saveAs">true</param>
- <param name="m_ro_saveAsType"><xsl:value-of select="./*[local-name()='objectClass']"/></param>
- <param name="m_ro_saveAsName"><xsl:value-of select="./*[local-name()='objectName']/*[local-name()='item'][1]/*[local-name()='value']"/></param>
- <param name="m_ro_saveAsPath"><xsl:value-of select="./*[local-name()='parentSearchPath']"/></param>
- <param name="save_how">new_entry</param>
- </xsl:template>
- <!--
- content task repairSecurityReferences and repairInternalInconsistencies
- -->
- <xsl:template match="*[./*[local-name()='name' and (. = 'repairSecurityReferences' or . = 'repairInternalInconsistencies')] ]">
- <xsl:if test="./*[local-name()='value' and . = 'true']">
- <param name="ctro_runoption"><xsl:value-of select="'fix'"/></param>
- </xsl:if>
- </xsl:template>
-
- <!--
- deployment upgrade
- -->
- <xsl:template match="*[./*[local-name()='name' and . = 'upgradeClasses'] ]">
- <xsl:choose>
- <xsl:when test="./*[local-name()='value' and . != '']">
- <param name="deploymentro_upgrade"><xsl:value-of select="'upgrade'"/></param>
- </xsl:when>
- <xsl:otherwise>
- <param name="deploymentro_upgrade"><xsl:value-of select="'keep'"/></param>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!--
- deployment preserveStoreIDs
- -->
- <xsl:template match="*[./*[local-name()='name' and . = 'preserveStoreIDs'] ]">
- <xsl:choose>
- <xsl:when test="./*[local-name()='value' and . != '']">
- <param name="deploymentro_preserveStoreIDs"><xsl:value-of select="./*[local-name()='value']"/></param>
- </xsl:when>
- <xsl:otherwise>
- <param name="deploymentro_preserveStoreIDs"><xsl:value-of select="'false'"/></param>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- catch all template for run options that are simple types i.e. the value element contains no sub-elements -->
- <xsl:template match="*[@xsi:type != '']" priority="-1">
- <xsl:variable name="optionName" select="./*[local-name()='name']"/>
- <xsl:if test="$optionName != '' and not(./*[local-name()='value']/*)">
- <param name="{concat('m_ro_',$optionName)}"><xsl:value-of select="./*[local-name()='value']"/></param>
- </xsl:if>
- </xsl:template>
- <!--
- generate the defaults for format and locale using the values saved on the report object or the preferences
- -->
- <xsl:template name="generateDefaults">
- <!--
- if we don't have an outputFormat, that means that no runOptions were saved. Default anything that
- we can using the options from the report or user preferences
- -->
- <xsl:if test="not(/root/*[local-name()='options']/*[local-name()='value']/*[local-name()='item' and ./*[local-name()='name'] = 'outputFormat'])">
- <!-- process all the options that were saved on the runnable -->
- <xsl:if test="/root/reportOptions/* != ''">
- <xsl:call-template name="processOptions">
- <xsl:with-param name="options" select="/root/reportOptions/*[local-name()='options']/*[local-name()='value']/*[local-name()='item']"/>
- </xsl:call-template>
- </xsl:if>
-
- <!-- last resort, use user preferences for format and locale if the runnable didn't have a outputFormat saved -->
- <xsl:if test="not(/root/reportOptions/options/value/item/name[. = 'outputFormat']) and (not(/root/optionList) or (/root/optionList[@include = 'true'] and key('option-list','outputFormat')))">
- <xsl:variable name="actualFormat">
- <xsl:value-of select="/root/*[local-name()='preferences']/*[local-name()='item' and ./*[local-name()='name']='format']/*[local-name()='value']"/>
- </xsl:variable>
- <xsl:variable name="allowPDF"><xsl:if test="/root/capabilities and not(/root/capabilities/canGeneratePDFOutput)">false</xsl:if></xsl:variable>
- <xsl:variable name="allowXML"><xsl:if test="/root/capabilities and not(/root/capabilities/canGenerateXMLOutput)">false</xsl:if></xsl:variable>
- <xsl:variable name="allowCSV"><xsl:if test="/root/capabilities and not(/root/capabilities/canGenerateCSVOutput)">false</xsl:if></xsl:variable>
- <xsl:variable name="allowXLS"><xsl:if test="/root/capabilities and not(/root/capabilities/canGenerateXLSOutput)">false</xsl:if></xsl:variable>
- <xsl:variable name="defaultFormat">
- <xsl:choose>
- <!-- These first conditions will allow to check if the format from the preferences is available in the system -->
- <xsl:when test="contains($actualFormat, 'HTML') and key('system-param', 'reportFormats')/format[@id='HTML']"><xsl:value-of select="'HTML'"/></xsl:when>
- <xsl:when test="contains($actualFormat, 'XHTML') and key('system-param', 'reportFormats')/format[@id='XHTML']"><xsl:value-of select="'XHTML'"/></xsl:when>
- <xsl:when test="contains($actualFormat, 'HTMLFragment') and key('system-param', 'reportFormats')/format[@id='HTMLFragment']"><xsl:value-of select="'HTMLFragment'"/></xsl:when>
- <xsl:when test="contains($actualFormat, 'PDF') and key('system-param', 'reportFormats')/format[@id='PDF'] and not($allowPDF='false')"><xsl:value-of select="'PDF'"/></xsl:when>
- <xsl:when test="contains($actualFormat, 'spreadsheetML') and key('system-param', 'reportFormats')/format[@id='spreadsheetML'] and not($allowXLS='false')"><xsl:value-of select="'spreadsheetML'"/></xsl:when>
- <xsl:when test="contains($actualFormat, 'xlsxData') and key('system-param', 'reportFormats')/format[@id='xlsxData'] and not($allowXLS='false')"><xsl:value-of select="'xlsxData'"/></xsl:when>
- <xsl:when test="contains($actualFormat, 'spreadsheetMLOfficeConnectionEnabled') and key('system-param', 'reportFormats')/format[@id='spreadsheetMLOfficeConnectionEnabled']"><xsl:value-of select="'spreadsheetMLOfficeConnectionEnabled'"/></xsl:when>
- <xsl:when test="contains($actualFormat, 'singleXLS') and key('system-param', 'reportFormats')/format[@id='singleXLS'] and not($allowXLS='false')"><xsl:value-of select="'singleXLS'"/></xsl:when>
- <xsl:when test="contains($actualFormat, 'XLWA') and key('system-param', 'reportFormats')/format[@id='XLWA'] and not($allowXLS='false')"><xsl:value-of select="'XLWA'"/></xsl:when>
- <xsl:when test="contains($actualFormat, 'XLS') and key('system-param', 'reportFormats')/format[@id='XLS'] and not($allowXLS='false')"><xsl:value-of select="'XLS'"/></xsl:when>
- <xsl:when test="contains($actualFormat, 'CSV') and key('system-param', 'reportFormats')/format[@id='CSV'] and not($allowCSV='false')"><xsl:value-of select="'CSV'"/></xsl:when>
- <xsl:when test="contains($actualFormat, 'XML') and key('system-param', 'reportFormats')/format[@id='XML'] and not($allowXML='false')"><xsl:value-of select="'XML'"/></xsl:when>
- <!-- Now from here. The preferences format is not available. So get the first one from the system param-->
- <xsl:when test="key('system-param', 'reportFormats')/format[@id='HTML']"><xsl:value-of select="'HTML'"/></xsl:when>
- <xsl:when test="key('system-param', 'reportFormats')/format[@id='XHTML']"><xsl:value-of select="'XHTML'"/></xsl:when>
- <xsl:when test="key('system-param', 'reportFormats')/format[@id='HTMLFragment']"><xsl:value-of select="'HTMLFragment'"/></xsl:when>
- <xsl:when test="key('system-param', 'reportFormats')/format[@id='PDF']"><xsl:value-of select="'PDF'"/></xsl:when>
- <xsl:when test="key('system-param', 'reportFormats')/format[@id='spreadsheetML']"><xsl:value-of select="'spreadsheetML'"/></xsl:when>
- <xsl:when test="key('system-param', 'reportFormats')/format[@id='xlsxData']"><xsl:value-of select="'xlsxData'"/></xsl:when>
- <xsl:when test="key('system-param', 'reportFormats')/format[@id='spreadsheetMLOfficeConnectionEnabled']"><xsl:value-of select="'spreadsheetMLOfficeConnectionEnabled'"/></xsl:when>
- <xsl:when test="key('system-param', 'reportFormats')/format[@id='singleXLS']"><xsl:value-of select="'singleXLS'"/></xsl:when>
- <xsl:when test="key('system-param', 'reportFormats')/format[@id='XLWA']"><xsl:value-of select="'XLWA'"/></xsl:when>
- <xsl:when test="key('system-param', 'reportFormats')/format[@id='XLS']"><xsl:value-of select="'XLS'"/></xsl:when>
- <xsl:when test="key('system-param', 'reportFormats')/format[@id='CSV']"><xsl:value-of select="'CSV'"/></xsl:when>
- <xsl:when test="key('system-param', 'reportFormats')/format[@id='XML']"><xsl:value-of select="'XML'"/></xsl:when>
- <xsl:otherwise><xsl:value-of select="$actualFormat"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <!-- do we actually have a format to default to -->
- <xsl:if test="$defaultFormat != ''">
- <xsl:choose>
- <!-- if we're in the report property dialog, then take the first format from the options -->
- <xsl:when test="/root/basicOptions = 'true'">
- <param name="m_ro_outputFormat"><xsl:value-of select="$defaultFormat"/></param>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="contains($defaultFormat, 'HTML') and not(/root/env/param[@name='m_ro_outputFormat_HTML'])">
- <param name="m_ro_outputFormat_HTML"><xsl:value-of select="$defaultFormat"/></param>
- <param name="m_ro_outputF_HTML_Type">true</param>
- </xsl:when>
- <xsl:when test="contains(., 'XLS') and xtsext:cafaction('get_configsignedreporturls', '') = 'false'">
- <param name="m_ro_outputFormat_XLS2000"><xsl:value-of select="$defaultFormat"/></param>
- <param name="m_ro_outputF_XLS2000_Type">true</param>
- </xsl:when>
- <xsl:when test="$defaultFormat = 'singleXLS'">
- <param name="m_ro_outputFormat_XLS2000"><xsl:value-of select="$defaultFormat"/></param>
- <param name="m_ro_outputFormat_singleXLS"><xsl:value-of select="$defaultFormat"/></param>
- <param name="m_ro_outputF_XLS2000_Type">true</param>
- </xsl:when>
- <xsl:when test="not(contains(., 'XLS'))">
- <param name="{concat('m_ro_outputFormat_',$defaultFormat)}"><xsl:value-of select="$defaultFormat"/></param>
- </xsl:when>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:if>
-
- <!-- if the runnable didn't have outputLocale saved, then try to get if from the preferences -->
- <xsl:if test="not(/root/reportOptions/options/value/item/name[. = 'outputLocale']) and (not(/root/optionList) or (/root/optionList[@include = 'true'] and key('option-list','outputLocale')))">
- <!-- outputLocale -->
- <xsl:if test="/root/*[local-name()='preferences']/*[local-name()='item' and ./*[local-name()='name']='contentLocale']/*[local-name()='value'] != ''">
- <param name="m_ro_outputLocale"><xsl:value-of select="/root/*[local-name()='preferences']/*[local-name()='item' and ./*[local-name()='name']='contentLocale']/*[local-name()='value']"/></param>
- </xsl:if>
- </xsl:if>
- <!-- if the runnable didn't have a11y option saved, then try to get if from the preferences or service defaults -->
- <xsl:variable name="a11yOptionName" select="'http://developer.cognos.com/ceba/constants/systemOptionEnum#accessibilityFeatures'"/>
- <xsl:if test="not(/root/reportOptions/options/value/item/name[. = $a11yOptionName]) and (not(/root/optionList) or (/root/optionList[@include = 'true'] and key('option-list', $a11yOptionName)))">
- <!-- accessibilityFeatures -->
- <xsl:choose>
- <xsl:when test="/root/*[local-name()='preferences']/*[local-name()='item' and ./*[local-name()='name']=$a11yOptionName]/*[local-name()='value'] != ''">
- <param name="m_go_accessibilityFeatures">
- <xsl:value-of select="/root/*[local-name()='preferences']/*[local-name()='item' and ./*[local-name()='name']=$a11yOptionName]/*[local-name()='value']"/>
- </param>
- </xsl:when>
- <xsl:when test="/root/*[local-name()='serviceDefaults']/*/*[local-name()='item' and ./*[local-name()='name']=$a11yOptionName]/*[local-name()='value'] != ''">
- <param name="m_go_accessibilityFeatures">
- <xsl:value-of select="/root/*[local-name()='serviceDefaults']/*/*[local-name()='item' and ./*[local-name()='name']=$a11yOptionName]/*[local-name()='value']"/>
- </param>
- </xsl:when>
- </xsl:choose>
- </xsl:if>
- </xsl:if>
-
- </xsl:template>
-
- <xsl:template match="text()" priority="0"/>
- </xsl:stylesheet>
|