12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- <?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).
- -->
- <xts:morphlet xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="messages/portal.xml, messages/portalRL.xml" includeConfig="true">
-
- <xts:block id="renderPage" type="exec" mode="interpret" dependency="" processor="XSLT" mimeType="text/html" mandatory="true">
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xsl:stylesheet version="1.0" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:xos="http://developer.cognos.com/schemas/xts/output/" xmlns:xts="http://developer.cognos.com/schemas/xts/" exclude-result-prefixes="xts xtsext">
- <pf:variables/>
- <xsl:template match="/">
- <xts:sequence>
- <xts:append select="/root/output">
- <xos:part>
- <xos:entityHeader>
- <xos:param name="Content-Type">application/javascript; charset=utf-8</xos:param>
- </xos:entityHeader>
- <xos:entityBody>
- <xsl:variable name="fromDate" select="concat(xtsext:substringBeforeLast(/root/env/param[@name='fromDate'], 'T'), 'T00:00:01')"/>
- <xsl:variable name="output_from_date" select="xtsext:formatDateToUTC($fromDate, /root/user/param[@name='timeZoneID'])"/>
- <xsl:variable name="output_from_date_value" select="xtsext:formatDateOnlyFromUTC( string( $output_from_date ), number( '2' ), string( $timeZone ), string( $contentLocale ) )"/>
- <xsl:variable name="dateString">
- <xsl:choose>
- <xsl:when test="string(/root/env/param[@name='datePeriod']) = 'day'">
- <xsl:text/><xsl:value-of select="xtsext:enforceBTD($output_from_date_value, 'auto', $productLocale, boolean($isBidiEnabled='true'))"/><xsl:text/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="toDate" select="concat(xtsext:substringBeforeLast(/root/env/param[@name='toDate'], 'T'), 'T23:59:59')"/>
- <xsl:variable name="output_to_date" select="xtsext:formatDateToUTC($toDate, /root/user/param[@name='timeZoneID'])"/>
- <xsl:variable name="output_to_date_value" select="xtsext:formatDateOnlyFromUTC( string( $output_to_date ), number( '2' ), string( $timeZone ), string( $contentLocale ) )"/>
- <xts:string id="IDS_PREVIOUS_VERSION_ARCHIVED_TAB_DATE_RANGE_VALUE">
- <xts:param name="from"><xsl:value-of select="xtsext:enforceBTD($output_from_date_value, 'auto', $productLocale, boolean($isBidiEnabled='true'))"/></xts:param>
- <xts:param name="to"><xsl:value-of select="xtsext:enforceBTD($output_to_date_value, 'auto', $productLocale, boolean($isBidiEnabled='true'))"/></xts:param>
- </xts:string>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="period"> <!-- variable here to ensure that period is only day or range so that there is no possiblity of a js injection -->
- <xsl:choose>
- <xsl:when test="string(/root/env/param[@name='datePeriod']) = 'day'">day</xsl:when>
- <xsl:otherwise>range</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:text/>{"period":"<xsl:value-of select="$period"/>","formatedString":"<xsl:value-of select="normalize-space($dateString)"/>"}<xsl:text/>
- </xos:entityBody>
- </xos:part>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- </xts:morphlet>
|