123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- <?xml version="1.0"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: fmmd
- (C) Copyright IBM Corp. 2003, 2013
- US Government Users Restricted Rights - Use, duplication or disclosure
- restricted by GSA ADP Schedule Contract with IBM Corp.
- -->
- <!--
- ===============================================================================
- Model Upgrade 59 to 60 Notes:
- This is an XSLT transformation from a Blacksea schema version 59 model to a Blacksea
- schema version 60 model
- This Upgrade is required to accomodate the following Model Schema changes made in Blacksea:
- * new shortcut property treatAs
- In FM a shortcut to a query subject or dimension can mean one of two things to RQP.
- If a query subject shortcut is in the same folder as the target query subject then it implies that
- the shortcut will be represented as an alias table in the generated sql. If the query subject
- shortcut and target query subject are in different folders then the shortcut is treated as a
- real shortcut and no alias table is generated in the resultant sql.
- While the rules governing this behavior are pretty simple it is very obscure from the point of
- view of an FM modeler. It is also considered somewhat limiting since we rely on the location
- of the shortcut to control the use of an alias table. In BlackSea this behavior will be made
- more apparent and selectable by the FM modeler.
- Shortcut objects will have a new optional property called treatAs with two possible
- values: alias and reference.
- alias - shortcut will be treated as an alias table in the generated sql
- reference - (default)shortcut will be treated as a simple reference to the target object.
- Blaring models will be upgrade by adding the governor shortcutProcessing = automatic. This
- will retain the old Blaring shortcut behaviour. New models will not have the governor added
- and therefore implies shortcut processing is explict. An upgrade summary message will be
- displayed after upgrade informing the user that the governor has been set to retain the
- old shortcut behaviour and should be reviewed using verify model. (Same thing we did for
- the data type/metadata callback governor upgrade)
- ===============================================================================
- -->
- <xsl:stylesheet xmlns="http://www.developer.cognos.com/schemas/bmt/60/0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:fmfunc="http://www.developer.cognos.com/bmt" xmlns:xalan="http://xml.apache.org/xalan" exclude-result-prefixes="fmfunc xalan">
- <xsl:include href="fmmd_generalTemplates.xsl"/>
- <xsl:strip-space elements="*"/>
- <xsl:output encoding="utf-8" method="xml" indent="no"/>
- <!-- ============================================================================== -->
- <!-- Step 1: Insert the new governor "shortcutProcessing = automatic".
- -->
- <!-- Template: Insert the new governor -->
- <xsl:template match="/*[local-name()='project']/*[local-name()='parameterMaps']/*[local-name()='parameterMap' and *[local-name() = 'name' and . = '_governor']]/*[local-name() = 'name' or local-name() = 'property' or local-name() = 'defaultValue' or local-name()='parameterMapEntry'][last()]">
- <!-- Copy the anchor element -->
- <xsl:call-template name="myCopy"/>
- <!-- Check the model is a relational based model -->
- <xsl:if test="$bIsRelational">
- <!-- Ok, assume it's a relational model -->
- <!-- Insert the governor "shortcutProcessing" for CQE to generate dynamic dimensional information as per the old Baltic style query generation. -->
- <xsl:element name="parameterMapEntry">
- <xsl:element name="key">shortcutProcessing</xsl:element>
- <xsl:element name="value">automatic</xsl:element>
- </xsl:element>
- <xsl:call-template name="annotate">
- <xsl:with-param name="value" select="$strWarnShortcutProcessing"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:template>
- <!-- =============================================================================== -->
- <!-- Global variables: -->
- <!-- =============================================================================== -->
- <xsl:variable name="sEmptyNamespace" select="string(document('')/*/namespace::*[name()=''])"/>
- <xsl:variable name="nNewSchema" select="number(substring-before(substring-after($sEmptyNamespace, 'http://www.developer.cognos.com/schemas/bmt/'), '/'))"/>
- <xsl:variable name="nOldSchema" select="$nNewSchema - 1"/>
- <xsl:variable name="bIsRelational" select="/*[local-name()='project']/*[local-name()='dataSources']/*[local-name()='dataSource']/*[local-name()='type']/*[local-name()='queryType' and .='relational']"/>
- <xsl:variable name="strWarnShortcutProcessing">
- <xsl:call-template name="getLocalizedString">
- <xsl:with-param name="stringID" select="$MODELUPGRADE_WARN_SHORTCUT_PROCESSING"/>
- <xsl:with-param name="localeVal" select="$defaultLocale"/>
- </xsl:call-template>
- </xsl:variable>
- </xsl:stylesheet>
|