123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: ps
- (C) Copyright IBM Corp. 2005, 2019
- US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- -->
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:xos="http://developer.cognos.com/schemas/xts/output/"
- xmlns:xts="http://developer.cognos.com/schemas/xts/"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
- exclude-result-prefixes="xsl xsi xos xts bus xtsext">
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
-
- <!-- general -->
- <xsl:variable name="webcontent" select="/fault/settings/param[@name='webcontent']"/>
- <xsl:variable name="app" select="/fault/settings/param[@name='app']"/>
- <xsl:variable name="skin" select="/fault/settings/param[@name='skin']"/>
- <xsl:variable name="web" select="/fault/settings/param[@name='web']"/>
- <xsl:variable name="gateway" select="/fault/settings/param[@name='gateway']"/>
- <xsl:variable name="pathInfo" select="/fault/settings/param[@name='pathInfo']"/>
- <xsl:variable name="browser" select="/fault/settings/param[@name='browser']"/>
- <xsl:variable name="skin_images" select="/fault/settings/param[@name='skin_images']"/>
- <xsl:variable name="isModal" select="/fault/settings/param[@name='isModal']"/>
- <xsl:variable name="locale" select="/fault/settings/param[@name='locale']"/>
-
- <xsl:template match="/">
- <xsl:text disable-output-escaping='yes'><!DOCTYPE html></xsl:text>
- <html lang="{$locale}">
- <head>
- <meta http-equiv="expires" content="0"/>
- <link rel="stylesheet" type="text/css" href="{$web}/skins/{$skin}/portal/default.css"/>
- <link rel="stylesheet" type="text/css" href="{$web}/skins/{$skin}/fonts.css"/>
-
- <!-- Copy over the helper scripts and any associated form(s) -->
- <xsl:apply-templates select="fault/presentation/scripts/*" mode="scripts-and-form"/>
-
- <script language="JavaScript">
- if (document.addEventListener) {
- window.addEventListener("beforeunload", function(){}, false);
- } else if (document.attachEvent) {
- window.attachEvent("onbeforeunload", function(){});
- }
- <xsl:apply-templates select="fault[error]" mode="notify"/>
- </script>
- <title><xsl:value-of select="fault/presentation/title"/></title>
- </head>
-
- <body onload="if (window.init) init();" style="margin:3px;" role="region" aria-labelledby="IDS_ERROR_DIALOG_TITLE">
- <span id="IDS_ERROR_DIALOG_TITLE" style="position: absolute;margin-left: -9999px; margin-top: -9999px; "><xsl:value-of select="fault/presentation/resources/message[@id='IDS_FAULT_DIALOG_TITLE']"/></span>
- <form style="margin:0px;padding:0px;" method="post" action="{concat($gateway,$pathInfo)}" name="pform">
- <a href="#maincontent" tabindex="0" class="showOnFocus"><xsl:value-of select="fault/presentation/resources/message[@id='IDS_SECTION508_JUMPTOMAIN']"/></a>
- <xsl:call-template name="render"/>
- </form>
- </body>
- </html>
- </xsl:template>
-
- <!-- -->
- <!-- Render ERROR fault -->
- <!-- -->
- <xsl:template name="render">
- <!-- ******************* -->
- <!-- Render the header -->
- <!-- ******************* -->
- <table border="0" width="100%" cellspacing="0" cellpadding="0" class="dialogHeader" style="height:28px;" role="presentation">
- <tr>
- <td class="dialogHeaderTitle" nowrap="nowrap">
- <xsl:value-of select="fault/presentation/title"/>
- </td>
- <td width="100%"></td>
- <xsl:if test="fault/presentation/actions/action[@type='help']">
- <td class="dialogHeaderLink" nowrap="nowrap">
- <a href="javascript:{fault/presentation/actions/action[@type='help']/default-command}" class="dialogHeaderLinkColor">
- <xsl:value-of select="fault/presentation/actions/action[@type='help']/label"/>
- </a>
- </td>
- </xsl:if>
- <xsl:if test="fault/presentation/actions/action[@type='close']">
- <td class="dialogHeaderLink">
- <a href="javascript:{fault/presentation/actions/action[@type='close']/default-command}" class="dialogHeaderLinkColor">
- <img height="16" width="16" vspace="2" border="0" class="dialogHeaderCloseButton"
- onmouseover="this.className = 'dialogHeaderCloseButtonOver'"
- onmouseout="this.className = 'dialogHeaderCloseButton'"
- src="{$skin_images}close.gif" role="button">
- <xsl:attribute name="alt">
- <xsl:value-of select="fault/presentation/actions/action[@type='close']/label"/>
- </xsl:attribute>
- <xsl:attribute name="title">
- <xsl:value-of select="fault/presentation/actions/action[@type='close']/label"/>
- </xsl:attribute>
- </img>
- </a>
- </td>
- </xsl:if>
- </tr>
- </table>
-
- <!-- ******************* -->
- <!-- Render the error body -->
- <!-- ******************* -->
- <xsl:apply-templates select="fault[error]"/>
-
- <!-- ******************* -->
- <!-- Render the footer -->
- <!-- ******************* -->
- <table role="presentation" class="dialogButtonBar" width="100%" cellpadding="0" cellspacing="0" style="margin-top:20px;height:50px;">
- <tr>
- <xsl:if test="fault/presentation/actions/action[@type='ok']">
- <td>
- <input id="cmdOK" style="width:70px;"
- type="submit" class="cmdButton" onmouseover="this.className='cmdButtonOver'"
- onmouseout="this.className='cmdButton'"
- value="{fault/presentation/actions/action[@type='ok']/label}"
- onclick="javascript:{fault/presentation/actions/action[@type='ok']/default-command}; return false;"/>
- </td>
- </xsl:if>
- <td width="100%"/>
- </tr>
- </table>
- </xsl:template>
-
- <xsl:template match="fault[error]">
- <!-- Include the error as a comment so it can be parsed by clients that don't care about the html response (e.g. ajax client) -->
- <xsl:text disable-output-escaping="yes"><!--</xsl:text>
- <ERROR_COMPONENT>ps</ERROR_COMPONENT>
- <ERROR_CODE><xsl:value-of select="./error/errorCodeString"/></ERROR_CODE>
- <ERROR_MSG><xsl:value-of select="./error/message"/></ERROR_MSG>
- <xsl:text disable-output-escaping="yes">--></xsl:text>
-
- <table width="100%" border="0" cellspacing="0" cellpadding="0" role="presentation">
- <tr>
- <td>
- <img src="{$webcontent}/images/space.gif" alt="" width="1" height="10"/>
- </td>
- </tr>
- </table>
-
- <table width="100%" border="0" cellspacing="0" cellpadding="0" style="padding-left:5px;" role="presentation">
- <tr>
- <td class="dialogHeaderText">
- <xsl:value-of select="./error/errorCodeString"/>
- </td>
- </tr>
- </table>
-
- <table width="100%" border="0" cellspacing="0" cellpadding="0" role="presentation">
- <tr>
- <td>
- <img src="{$webcontent}/images/space.gif" alt="" width="1" height="10"/>
- </td>
- </tr>
- </table>
-
- <table width="100%" border="0" cellspacing="0" cellpadding="0" role="presentation">
- <tr>
- <td>
- <table width="100%" border="0" cellspacing="0" cellpadding="3" role="presentation">
- <tr>
- <td width="1" height="1">
- <img src="{$webcontent}/images/space.gif" width="1" height="1" alt=""/>
- </td>
- <td width="100%">
- <table border="0" cellspacing="0" cellpadding="0" role="presentation">
- <tr>
- <td>
- <img src="{$webcontent}/{$app}/images/msg_error.gif" alt="" width="32" height="32" border="0"/>
- </td>
- <td class="formText">   </td>
- <td class="formText" valign="top">
- <xsl:call-template name="format-error">
- <xsl:with-param name="msg" select="./error/message"/>
- </xsl:call-template>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
-
- <xsl:if test="count(./error/details) > 0">
- <script type="text/javascript" language="JavaScript">
- var imgExpand = new Image();
- var imgCollapse = new Image();
- imgExpand.alt = "<xsl:value-of select="presentation/resources/message[@id='IDS_SECTION_EXPAND']"/>";
- imgExpand.title = "<xsl:value-of select="presentation/resources/message[@id='IDS_SECTION_EXPAND']"/>";
- imgExpand.src = "<xsl:value-of select="xtsext:javascriptencode($skin_images)"/>prompt_option_expand.gif";
- imgCollapse.src = "<xsl:value-of select="xtsext:javascriptencode($skin_images)"/>prompt_option_collapse.gif";
- imgCollapse.alt = "<xsl:value-of select="presentation/resources/message[@id='IDS_SECTION_COLLAPSE']"/>";
- imgCollapse.title = "<xsl:value-of select="presentation/resources/message[@id='IDS_SECTION_COLLAPSE']"/>";
-
- function toggleDynamicSection(name) {
- var img = document.getElementById("img_" + name);
-
- if(document.getElementById(name).style.display == 'none') {
- document.getElementById(name).style.display = "";
- img.src = imgCollapse.src;
- } else {
- document.getElementById(name).style.display = "none";
- img.src = imgExpand.src;
- }
- }
- </script>
-
- <table border="0" cellpadding="0" cellspacing="0" style="margin:10px" role="presentation">
- <tr>
- <td>
- <img src="{$webcontent}/images/space.gif" alt="" width="30" height="30" border="0"/>
- </td>
- <td class="formText">   </td>
- <td>
- <table role="presentation">
- <tr>
- <td class="formText" valign="bottom" nowrap="nowrap">
- <a href="javascript:toggleDynamicSection('errorPanel')" role="main" id="maincontent">
- <xsl:value-of select="presentation/resources/message[@id='IDS_FAULT_DETAILS']"/>
- </a>
- <a href="javascript:toggleDynamicSection('errorPanel');{@onclick}">
- <img name="img_errorPanel" id="img_errorPanel" border="0">
- <xsl:attribute name="src"><xsl:value-of select="$skin_images"/>prompt_option_expand.gif</xsl:attribute>
- <xsl:attribute name="alt"><xsl:value-of select="presentation/resources/message[@id='IDS_SECTION_EXPAND']"/></xsl:attribute>
- <xsl:attribute name="title"><xsl:value-of select="presentation/resources/message[@id='IDS_SECTION_EXPAND']"/></xsl:attribute>
- </img>
- </a>
- </td>
- </tr>
- <tr>
- <td>
- <div id="errorPanel" class="errorPanel" style="display:none">
- <xsl:call-template name="format-error">
- <xsl:with-param name="msg" select="./error/details"/>
- </xsl:call-template>
- </div>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
-
- </xsl:if>
- </td>
- </tr>
- </table>
- </xsl:template>
- <xsl:template match="fault[error]" mode="notify">
- <!-- Notify parent window (if it cares) that an error was displayed -->
- if (parent.OnErrorPage) {
- parent.OnErrorPage("<xsl:value-of select="./error/errorCodeString"/>","<xsl:value-of select="xtsext:javascriptencode(./error/message)"/>",[<xsl:call-template name="format-details"><xsl:with-param name="javascriptencode" select="true()"/></xsl:call-template>]);
- }
- </xsl:template>
-
- <xsl:template name="format-error">
- <xsl:param name="msg"/>
- <xsl:param name="suffix" select="'<br/>'"/>
- <xsl:param name="quot" select="''"/>
- <xsl:param name="javascriptencode" select="false()"/>
-
- <xsl:choose>
- <xsl:when test="contains($msg, ' ')">
- <xsl:variable name="errorDetail" select="substring-before($msg, ' ')"/>
- <xsl:value-of select="$quot"/>
- <xsl:choose>
- <xsl:when test="$javascriptencode = 'true'">
- <xsl:value-of select="xtsext:javascriptencode($errorDetail)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$errorDetail"/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:value-of select="$quot"/><xsl:value-of select="$suffix"/>
- <xsl:call-template name="format-error">
- <xsl:with-param name="msg" select="substring-after($msg, ' ')"/>
- <xsl:with-param name="suffix" select="$suffix"/>
- <xsl:with-param name="quot" select="$quot"/>
- <xsl:with-param name="javascriptencode" select="$javascriptencode"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$quot"/>
- <xsl:choose>
- <xsl:when test="$javascriptencode = 'true'">
- <xsl:value-of select="xtsext:javascriptencode($msg)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$msg"/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:value-of select="$quot"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-
- <xsl:template name="format-details">
- <xsl:param name="javascriptencode" select="false()"/>
- <xsl:if test="count(./error/details) > 0">
- <xsl:call-template name="format-error">
- <xsl:with-param name="msg" select="./error/details"/>
- <xsl:with-param name="suffix" select="','"/>
- <xsl:with-param name="quot" select="'"'"/>
- <xsl:with-param name="javascriptencode" select="$javascriptencode"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:template>
- <xsl:template match="*" mode="scripts-and-form">
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- <xsl:apply-templates mode="scripts-and-form"/>
- </xsl:copy>
- </xsl:template>
-
- <xsl:template match="input" mode="scripts-and-form">
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- <xsl:attribute name="value"><xsl:value-of select="."/></xsl:attribute>
- </xsl:copy>
- </xsl:template>
-
- <xsl:template match="text()"/>
- </xsl:stylesheet>
|