123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149 |
- <?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). -->
- <!-- Transform that takes markup and produces an HTML page The input to the
- transform should be the following <root> <morphletResponse> <markup>Markup
- to be displayed</markup> <browserTitle>Title for the browser</browserTitle>
- <request_stack_0>stack information that will get added as hidden inputs</request_stack_0>
- ... <request_stack_x>stack information</request_stack_x> </morphletResponse>
- <env> ... </env> <system> ... </system> <http> ... </http> </root> -->
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
- xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- exclude-result-prefixes="xsl xts xtsext">
- <xsl:output method="html" version="1.0" encoding="UTF-8"
- indent="no" omit-xml-declaration="yes" />
- <xsl:key name="system-param" match="/*[local-name()='root']/system/param"
- use="@name" />
- <xsl:key name="env-param" match="/*[local-name()='root']/env/param"
- use="@name" />
- <xsl:key name="user-param" match="/*[local-name()='root']/user/param"
- use="@name" />
- <pf:variables />
- <xsl:template
- match="/*[local-name()='root']/*[local-name()='morphletResponse']/*[local-name()='markup']"
- priority="1">
- <xsl:variable name="webRoot">
- <xsl:choose>
- <xsl:when test="/root/http/param[@name='WEB_CONTENT_ROOT']">
- <xsl:value-of select="string(/root/http/param[@name='WEB_CONTENT_ROOT'])" />
- </xsl:when>
- <!-- No official config param is present. Make this relative. -->
- <xsl:otherwise>
- ..
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="app" select="key('system-param', 'app')" />
- <xsl:variable name="gateway"
- select="string(/root/http/param[@name='SCRIPT_NAME'])" />
- <xsl:variable name="user_skin">
- <xsl:choose>
- <xsl:when test="key('user-param', 'skin') != ''">
- <xsl:value-of select="key('user-param', 'skin')" />
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of
- select="key('system-param', 'defaultPortalPreferences')/pref[@name='skin']" />
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="skin_root"
- select="concat($webRoot, '/skins', '/', $user_skin)" />
- <xsl:variable name="skin_style"
- select="concat($skin_root, '/', $app, '/default.css')" />
- <xsl:variable name="skin_fonts" select="concat($skin_root, '/fonts.css')" />
- <xsl:variable name="skin_banner"
- select="concat($skin_root, '/shared/banner.css')" />
- <xsl:variable name="skin_portlet"
- select="concat($skin_root, '/fragments/portlet.css')" />
- <xsl:variable name="skin_shared_images"
- select="concat($skin_root, '/shared/images/')" />
- <!-- produce the HTML to be displayed -->
- <xsl:text disable-output-escaping='yes'><!DOCTYPE html></xsl:text>
- <html lang="{$productLocale}">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <meta name="copyright">
- <xsl:attribute name="content"><xts:string id="IDS_COPYRIGHT" /></xsl:attribute>
- </meta>
- <meta name="trademark">
- <xsl:attribute name="content"><xts:string id="IDS_TRADEMARK" /></xsl:attribute>
- </meta>
- <meta name="template">
- <xsl:attribute name="content"><xsl:value-of
- select="key('env-param', 'm')" /></xsl:attribute>
- </meta>
- <meta content="IE=edge" http-equiv="X-UA-Compatible"/>
- <meta http-equiv="Expires" content="0" />
- <title>
- <xsl:value-of select="../*[local-name()='browserTitle']" />
- </title>
- <link rel="stylesheet" type="text/css">
- <xsl:attribute name="href">
- <xsl:value-of select="$skin_style" />
- </xsl:attribute>
- </link>
- <link rel="stylesheet" type="text/css" href="{$skin_fonts}" />
- </head>
- <body onload="if (window.init) init();" onscroll="do_onScroll()"
- style="overflow: auto;" role="region" aria-label="{../*[local-name()='browserTitle']}">
- <xsl:choose>
- <xsl:when
- test="/*[local-name()='root']/*[local-name()='morphletResponse']/*[local-name()='isPopup'] = 'true'">
- <xsl:attribute name="topmargin">0</xsl:attribute>
- <xsl:attribute name="bottommargin">0</xsl:attribute>
- <xsl:attribute name="marginheight">0</xsl:attribute>
- <xsl:attribute name="rightmargin">0</xsl:attribute>
- <xsl:attribute name="leftmargin">0</xsl:attribute>
- <xsl:attribute name="marginwidth">0</xsl:attribute>
- <xsl:attribute name="class">body_dialog_modal</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="topmargin">3</xsl:attribute>
- <xsl:attribute name="bottommargin">0</xsl:attribute>
- <xsl:attribute name="marginheight">3</xsl:attribute>
- <xsl:attribute name="rightmargin">3</xsl:attribute>
- <xsl:attribute name="leftmargin">3</xsl:attribute>
- <xsl:attribute name="marginwidth">3</xsl:attribute>
- <xsl:attribute name="class">dialogBody</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <script language="javascript">
- function do_onScroll()
- {
- modalDiv = document.getElementById('makeModalDiv')
- if (modalDiv && modalDiv.style.display == 'block')
- {
- modalDiv.style.left = document.body.scrollLeft;
- modalDiv.style.top = document.body.scrollTop;
- }
- }
- </script>
- <form name="pform" method="post" action="{$gateway}">
- <xsl:copy-of select="*" />
- <xsl:copy-of
- select="/*[local-name()='root']/*[local-name()='formFields']/*" />
- </form>
- <xsl:if test="../*[local-name()='debugDump']">
- <xsl:copy-of select="../*[local-name()='debugDump']" />
- </xsl:if>
- </body>
- </html>
- </xsl:template>
- <xsl:template match="text()" priority="0" />
- </xsl:stylesheet>
|