123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: ps
- (C) Copyright IBM Corp. 2005, 2011
- 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:xsl="http://www.w3.org/1999/XSL/Transform">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
-
- <xsl:template match="myroot/layout">
- <xsl:variable name="userContentLocale" select="../userLocale"/>
- <!-- Determine the language we want to set focus to
- If one of the languages set matches the use's current content locale then give focus to it.
- Otherwize give focus to the first language.
- -->
- <xsl:variable name="lang">
- <xsl:choose>
- <xsl:when test="title/value[@xml:lang = $userContentLocale]">
- <xsl:value-of select="title/value[@xml:lang = $userContentLocale]/@xml:lang"/>
- </xsl:when>
- <xsl:when test="title/value[1][@xml:lang != '']">
- <xsl:value-of select="title/value[1]/@xml:lang"/>
- </xsl:when>
- <!-- There are no languages entered for the title field start a new field using the usr's content locale -->
- <xsl:otherwise>
- <xsl:value-of select="$userContentLocale"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:if test="layoutProperties/param[@name='flexibleColumnLayout']">
- <param name="m_mp_flexibleColWidth"><xsl:value-of select="layoutProperties/param[@name='flexibleColumnLayout']"/></param>
- </xsl:if>
- <!-- titles -->
- <xsl:if test="title/@hidden = 'true'">
- <param name="m_mp_hideTitle">true</param>
- </xsl:if>
-
- <xsl:if test="title/@font">
- <param name="m_mp_titleFont"><xsl:value-of select="title/@font"/></param>
- </xsl:if>
-
- <xsl:if test="title/@size">
- <param name="m_mp_titleFontSize"><xsl:value-of select="title/@size"/></param>
- </xsl:if>
-
- <xsl:if test="title/@colour">
- <param name="m_mp_titleColour"><xsl:value-of select="title/@colour"/></param>
- </xsl:if>
-
- <xsl:if test="title/@bold">
- <param name="m_mp_titleBold"><xsl:value-of select="title/@bold"/></param>
- </xsl:if>
-
- <xsl:if test="title/@align">
- <param name="m_mp_titleAlign"><xsl:value-of select="title/@align"/></param>
- </xsl:if>
-
- <xsl:if test="title/@italic">
- <param name="m_mp_titleItalic"><xsl:value-of select="title/@italic"/></param>
- </xsl:if>
-
- <xsl:if test="title/@underline">
- <param name="m_mp_titleUnderline"><xsl:value-of select="title/@underline"/></param>
- </xsl:if>
-
- <param name="m_mp_titleStyle">
- <xsl:choose>
- <xsl:when test="title/@colour and title/@colour != ''">custom</xsl:when>
- <xsl:otherwise>default</xsl:otherwise>
- </xsl:choose>
- </param>
-
- <xsl:for-each select="title/value[@xml:lang != $lang]">
- <param name="m_mp_title_{@xml:lang}"><xsl:value-of select="."/></param>
- </xsl:for-each>
-
- <!-- instructions -->
- <xsl:if test="instructions/@hidden = 'true'">
- <param name="m_mp_hideInstructions">true</param>
- </xsl:if>
-
- <xsl:if test="instructions/@font">
- <param name="m_mp_instructionsFont"><xsl:value-of select="instructions/@font"/></param>
- </xsl:if>
-
- <xsl:if test="instructions/@size">
- <param name="m_mp_instructionsFontSize"><xsl:value-of select="instructions/@size"/></param>
- </xsl:if>
-
- <xsl:if test="instructions/@colour">
- <param name="m_mp_instructionsColour"><xsl:value-of select="instructions/@colour"/></param>
- </xsl:if>
-
- <xsl:if test="instructions/@bold">
- <param name="m_mp_instructionsBold"><xsl:value-of select="instructions/@bold"/></param>
- </xsl:if>
-
- <xsl:if test="instructions/@italic">
- <param name="m_mp_instructionsItalic"><xsl:value-of select="instructions/@italic"/></param>
- </xsl:if>
-
- <xsl:if test="instructions/@underline">
- <param name="m_mp_instructionsUnderline"><xsl:value-of select="instructions/@underline"/></param>
- </xsl:if>
-
- <xsl:if test="instructions/@align">
- <param name="m_mp_instructionsAlign"><xsl:value-of select="instructions/@align"/></param>
- </xsl:if>
-
- <param name="m_mp_instructionsStyle">
- <xsl:choose>
- <xsl:when test="instructions/@colour and instructions/@colour != ''">custom</xsl:when>
- <xsl:otherwise>default</xsl:otherwise>
- </xsl:choose>
- </param>
-
- <xsl:for-each select="instructions/value[@xml:lang != $lang]">
- <param name="m_mp_instructions_{@xml:lang}"><xsl:value-of select="."/></param>
- </xsl:for-each>
-
- <!-- portlet options -->
- <xsl:if test="portletOptions/@hideBorders = 'true'">
- <param name="m_mp_hideBorders">true</param>
- </xsl:if>
- <xsl:if test="portletOptions/@hideTitleBars = 'true'">
- <param name="m_mp_hideTitleBars">true</param>
- </xsl:if>
- <xsl:if test="portletOptions/@hideEditMode = 'true'">
- <param name="m_mp_hideEditMode">true</param>
- </xsl:if>
-
- <!-- Unpack the column layout XML into form fields when handling 1.0 layouts -->
- <xsl:if test="@version = 1.0">
- <param name="m_mp_columns"><xsl:value-of select="count(column)"/></param>
- <param name="m_mp_firstColumnWidth"><xsl:value-of select="column[1]/@width"/></param>
- <xsl:if test="column[2]">
- <param name="m_mp_secondColumnWidth"><xsl:value-of select="column[2]/@width"/></param>
- </xsl:if>
- <xsl:if test="column[3]">
- <param name="m_mp_thirdColumnWidth"><xsl:value-of select="column[3]/@width"/></param>
- </xsl:if>
- <xsl:for-each select="column[1]/portlet">
- <param name="m_mp_col1sort"><xsl:value-of select="concat(position(), ',', @id)"/></param>
- </xsl:for-each>
- <xsl:for-each select="column[2]/portlet">
- <param name="m_mp_col2sort"><xsl:value-of select="concat(position(), ',', @id)"/></param>
- </xsl:for-each>
- <xsl:for-each select="column[3]/portlet">
- <param name="m_mp_col3sort"><xsl:value-of select="concat(position(), ',', @id)"/></param>
- </xsl:for-each>
- </xsl:if>
-
- <!-- language and edit fields -->
- <param name="m_mp_language"><xsl:value-of select="$lang"/></param>
- <param name="m_mp_mlt_title_{$lang}"><xsl:value-of select="title/value[@xml:lang = $lang]"/></param>
- <param name="m_mp_mlt_instructions_{$lang}"><xsl:value-of select="instructions/value[@xml:lang = $lang]"/></param>
- </xsl:template>
-
- <!-- Remove the userLocale element -->
- <xsl:template match="myroot/userLocale"/>
- </xsl:stylesheet>
|