123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: ps
- (C) Copyright IBM Corp. 2005, 2014
- 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']"/>
-
- <!-- custom login -->
- <xsl:variable name="custom-auth" select="/fault/settings/param[@name='custom-auth']"/>
- <xsl:variable name="isLoginCustomizationEnabled" select="/fault/login and $custom-auth/logon[@enabled = 'true']"/>
- <xsl:variable name="referenceableIds">
- <layout>
- <entry name="header">CL_HEADER</entry>
- <entry name="prompt">CL_PROMPT</entry>
- <entry name="footer">CL_FOOTER</entry>
- </layout>
- <prompts>
- <entry name="CAMNamespace">CL_PROMPT_namespace</entry>
- <entry name="CAMNamespaceDisplayName">CL_PROMPT_namespace</entry>
- <entry name="CAMUsername">CL_PROMPT_username</entry>
- <entry name="CAMPassword">CL_PROMPT_password</entry>
- <entry name="CAMUserNameForDisplay">CL_PROMPT_username</entry>
- <entry name="CAMOldPassword">CL_PROMPT_oldPassword</entry>
- <entry name="CAMNewPassword">CL_PROMPT_newPassword</entry>
- <entry name="CAMNewPassword2">CL_PROMPT_newPasswordConfirm</entry>
- </prompts>
- <captions>
- <entry name="general">CL_PROMPT_general_caption</entry>
- <entry name="selectNamespace">CL_PROMPT_selectNamespace_caption</entry>
- <entry name="enterCredentials">CL_PROMPT_enterCredentials_caption</entry>
- <entry name="badCredentialsEntered">CL_PROMPT_badCredentialsEntered_caption</entry>
- <entry name="passwordExpiry">CL_PROMPT_passwordExpiry_caption</entry>
- </captions>
- </xsl:variable>
-
- <xsl:template match="/">
- <xsl:choose>
- <xsl:when test="fault/settings/param[@name='redirect'] != ''">
- <xsl:text disable-output-escaping='yes'><!DOCTYPE html></xsl:text>
- <html lang="{$locale}">
- <head>
- <title><xsl:value-of select="fault/presentation/browserTitle"/></title>
- <meta http-equiv="expires" content="0"/>
- <script language="javascript">
- window.location.href = "<xsl:value-of select="xtsext:javascriptencode(fault/settings/param[@name='redirect'])"/>";
- </script>
- </head>
- </html>
- </xsl:when>
- <xsl:otherwise>
- <html lang="{$locale}">
- <head>
- <meta http-equiv="expires" content="0"/>
- <link rel="stylesheet" type="text/css" href="{$webcontent}/login/styles.css"/>
-
- <xsl:if test="not($isLoginCustomizationEnabled)">
- <link rel="stylesheet" type="text/css" href="{$webcontent}/login/ibm.css"/>
- </xsl:if>
-
- <!-- 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(){});
- }
- </script>
- <title><xsl:value-of select="fault/presentation/browserTitle"/></title>
- </head>
- <body role="main" onload="if (typeof handleCustomization == 'function') handleCustomization(); if (window.init) init();">
- <form style="margin:0px;padding:0px;" method="post" action="{concat($gateway,$pathInfo)}" name="pform">
- <xsl:call-template name="render"/>
- </form>
- </body>
- </html>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template name="render">
- <xsl:choose>
- <xsl:when test="$isLoginCustomizationEnabled">
- <div id="{$referenceableIds/layout/entry[@name='header']}" style="display:none">
- <xsl:call-template name="renderHeader"/>
- </div>
- <div id="{$referenceableIds/layout/entry[@name='prompt']}" style="display:none">
- <xsl:call-template name="renderPrompt"/>
- </div>
- <div id="{$referenceableIds/layout/entry[@name='footer']}" style="display:none">
- <xsl:call-template name="renderFooter"/>
- </div>
-
- <!-- Perform customization to the login page -->
- <xsl:call-template name="doAuthCustomization"/>
- </xsl:when>
- <xsl:otherwise>
- <div id="loginBoxWithShadow" cellpadding="0" cellspacing="0" border="0">
- <div id="loginBox">
- <div id="loginBoxInner">
- <xsl:call-template name="renderHeader"/>
- <table class="loginBody" width="100%" cellspacing="0" cellpadding="1" role="presentation">
- <tbody>
- <tr>
- <td width="35%">
- <div id="loginIcon"/>
- </td>
- <td>
- <xsl:call-template name="renderPrompt"/>
- <xsl:call-template name="renderFooter"/>
- </td>
- <td width="5%">
- </td>
- </tr>
- </tbody>
- </table>
-
- <xsl:if test="fault[login]">
- <table class="loginFooter" width="100%" cellspacing="0" cellpadding="1" role="presentation">
- <tbody>
- <tr>
- <td>
- <div id="ibmLogo"/>
- </td>
- <td>
- <div class="loginCopyright" id="loginCopyright">
- <xsl:value-of select="fault/presentation/resources/message[@id='IDS_PROPERTY_IBM']"/><br/>
- <xsl:value-of select="fault/presentation/resources/message[@id='IDS_COPYRIGHT']"/><br/>
- <xsl:value-of select="fault/presentation/resources/message[@id='IDS_TRADEMARK']"/>
- </div>
- </td>
- </tr>
- </tbody>
- </table>
- </xsl:if>
- </div>
- </div>
- </div>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template name="renderHeader">
- <!-- ******************* -->
- <!-- Generate the header -->
- <!-- ******************* -->
- <table border="0" width="100%" cellspacing="0" cellpadding="0" class="loginHeader" role="presentation">
- <tr>
- <td width="100%"></td>
- <xsl:if test="fault/presentation/actions/action[@type='help']">
- <td class="loginHeaderLink" nowrap="nowrap">
- <a href="javascript:{fault/presentation/actions/action[@type='help']/default-command}" class="loginHeaderLinkAnchor" role="button" wairole="button" id="logonHelp">
- <xsl:attribute name="onkeypress">if(event.keyCode==9)return true; else if (event.keyCode==13 || event.keyCode==32 || event.charCode==32) <xsl:value-of select="fault/presentation/actions/action[@type='help']/default-command"/>; return false;</xsl:attribute>
- <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="loginHeaderLink loginClose">
- <div class="loginHeaderCloseIcon">
- <a href="javascript:{fault/presentation/actions/action[@type='close']/default-command}" class="loginHeaderLinkAnchor" role="button" wairole="button" >
- <xsl:attribute name="onkeypress">if(event.keyCode==9)return true; else if (event.keyCode==13 || event.keyCode==32 || event.charCode==32) <xsl:value-of select="fault/presentation/actions/action[@type='close']/default-command"/>; return false;</xsl:attribute>
- <xsl:attribute name="title">
- <xsl:value-of select="fault/presentation/actions/action[@type='close']/label"/>
- </xsl:attribute>
- <img height="28" width="28" vspace="2" border="0"
- src="{$skin_images}popup_close_28.png" role="button">
- <xsl:attribute name="alt">
- <xsl:value-of select="fault/presentation/actions/action[@type='close']/label"/>
- </xsl:attribute>
- </img>
- </a>
- </div>
- </td>
- </xsl:if>
- </tr>
- </table>
- </xsl:template>
-
- <xsl:template name="renderPrompt">
- <!-- ******************* -->
- <!-- Generate the prompt body -->
- <!-- ******************* -->
- <xsl:apply-templates/>
- </xsl:template>
-
- <xsl:template name="renderFooter">
- <!-- ******************* -->
- <!-- Generate the footer -->
- <!-- ******************* -->
- <table class="loginFooter" width="100%" cellpadding="1" cellspacing="0" role="presentation">
- <tr>
- <xsl:if test="fault/presentation/actions/action[@type='ok']">
- <td>
- <input id="cmdOK"
- type="submit" class="loginFooterButton" onmouseover="this.className='loginFooterButtonOver'"
- onmouseout="this.className='loginFooterButton'"
- value="{fault/presentation/actions/action[@type='ok']/label}"
- onclick="javascript:{fault/presentation/actions/action[@type='ok']/default-command}; return false;"/>
- </td>
- </xsl:if>
- <xsl:if test="fault/presentation/actions/action[@type='cancel']">
- <td>
- <input id="cmdCancel"
- type="button" class="loginFooterButton"
- onmouseover="this.className='loginFooterButtonOver'"
- onmouseout="this.className='loginFooterButton'"
- value="{fault/presentation/actions/action[@type='cancel']/label}"
- onclick="javascript:{fault/presentation/actions/action[@type='cancel']/default-command}; return false;">
- <xsl:attribute name="onkeypress">javascript:if(event.keyCode==9) <xsl:text>{</xsl:text> if(event.shiftKey==true) return true; else <xsl:text>{</xsl:text> if(document.getElementById("logonHelp")) <xsl:text>{</xsl:text>document.getElementById("logonHelp").focus(); return false; <xsl:text>}</xsl:text> <xsl:text>}</xsl:text> <xsl:text>}</xsl:text> return true;</xsl:attribute>
- </input>
- </td>
- </xsl:if>
- <xsl:if test="fault/presentation/actions/action[@type='yes']">
- <td>
- <input id="cmdYes"
- type="submit" class="loginFooterButton" onmouseover="this.className='loginFooterButtonOver'"
- onmouseout="this.className='loginFooterButton'"
- value="{fault/presentation/actions/action[@type='yes']/label}"
- onclick="javascript:{fault/presentation/actions/action[@type='yes']/default-command}; return false;" role="button" wairole="button"/>
- </td>
- </xsl:if>
- <xsl:if test="fault/presentation/actions/action[@type='no']">
- <td>
- <input id="cmdNo"
- type="button" class="loginFooterButton"
- onmouseover="this.className='loginFooterButtonOver'"
- onmouseout="this.className='loginFooterButton'"
- value="{fault/presentation/actions/action[@type='no']/label}"
- onclick="javascript:{fault/presentation/actions/action[@type='no']/default-command}; return false;" role="button" wairole="button">
- <xsl:attribute name="onkeypress">
- javascript:if(event.keyCode==9) <xsl:text>{</xsl:text> if(event.shiftKey==true) return true; else <xsl:text>{</xsl:text> if(document.getElementById("logonHelp")) <xsl:text>{</xsl:text>document.getElementById("logonHelp").focus(); return false; <xsl:text>}</xsl:text> <xsl:text>}</xsl:text> <xsl:text>}</xsl:text> return true;
- </xsl:attribute>
- </input>
- </td>
- </xsl:if>
-
- <td width="100%"/>
- </tr>
- </table>
- </xsl:template>
-
- <!-- custom login -->
- <xsl:template name="clTranslateName">
- <xsl:variable name="promptTable" select="$referenceableIds/prompts"/>
-
- <xsl:if test="./*[local-name() = 'type'] != 'hidden'">
- <xsl:variable name="name">
- <xsl:value-of select="./*[local-name() = 'name']"/>
- <xsl:variable name="multiples" select="count(preceding-sibling::node()[local-name() = 'item' and *[local-name() = 'name'] = current()/*[local-name()='name']]) + 1"/>
- <xsl:if test="$multiples > 1">
- <xsl:value-of select="$multiples"/>
- </xsl:if>
- </xsl:variable>
- <xsl:variable name="clName">
- <xsl:choose>
- <xsl:when test="$promptTable/entry[@name=$name]">
- <xsl:value-of select="$promptTable/entry[@name=$name]"/>
- </xsl:when>
- <xsl:otherwise><xsl:value-of select="$name"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:value-of select="$clName"/>
- </xsl:if>
- </xsl:template>
- <xsl:template name="clBuildCaption">
- <xsl:param name="promptInfo"/>
- <!--
- - Please select a namespace for authentication.
- - Please type your credentials for authentication.
- - A user name was not entered. Please type your credentials for authentication.
- - The provided credentials are invalid. Please type your credentials for authentication.
- - Your password has expired. Please change it. Please type your credentials for authentication.
- - The specified old password is not correct. Your password has expired. Please change it. Please type your credentials for authentication.
- -->
-
- <xsl:variable name="messages" select="$promptInfo/../*[local-name() = 'messages']/*[local-name() = 'item']/*[local-name() = 'messageString']"/>
- <xsl:variable name="item" select="$promptInfo/*[local-name() = 'displayObjects']/*[local-name() = 'item']"/>
- <xsl:variable name="clCaptionTable" select="$referenceableIds/captions"/>
-
- <xsl:choose>
- <xsl:when test="$item[*[local-name() = 'name']='CAMNamespace' and *[local-name() = 'type']='singleselect']">
- <xsl:value-of select="$clCaptionTable/entry[@name='selectNamespace']"/>
- </xsl:when>
- <xsl:when test="$item[*[local-name() = 'name']='CAMNewPassword']">
- <xsl:value-of select="$clCaptionTable/entry[@name='passwordExpiry']"/>
- </xsl:when>
- <xsl:when test="$item[*[local-name() = 'name']='CAMNamespace' and *[local-name() = 'type']='hidden']">
- <xsl:choose>
- <xsl:when test="contains($messages, 'CAM-AAA-')"><xsl:value-of select="$clCaptionTable/entry[@name='badCredentialsEntered']"/></xsl:when>
- <xsl:otherwise><xsl:value-of select="$clCaptionTable/entry[@name='enterCredentials']"/></xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise><xsl:value-of select="$clCaptionTable/entry[@name='general']"/></xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="doAuthCustomization">
- <xsl:if test="$isLoginCustomizationEnabled">
- <xsl:variable name="base-template-name" select="$custom-auth/logon/base-template-name"/>
- <script language="javascript" src="{$webcontent}/{$app}/js/ajaxutils.js"></script>
- <script language="javascript" src="{$webcontent}/{$app}/js/customlogin.js"></script>
- <script language="JavaScript">
- var cl_templatePath = g_PS_webContent + "/login";
- var cl_baseTemplateName = "<xsl:value-of select="xtsext:javascriptencode($base-template-name)"/>";
- var cl_templateDefaultExtension = ".xhtml";
- var cl_locale = g_PS_locale;
-
- function handleCustomization() {
- doCustomization();
- }
- </script>
-
- <!-- General all supported and referenceable entities for customization -->
- <script language="JavaScript">
- <!-- Layout entries -->
- var clLayoutArray = [
- <xsl:variable name="clLayoutTable" select="$referenceableIds/layout"/>
- <xsl:for-each select="$clLayoutTable/entry">
- <xsl:if test="position() > 1">,</xsl:if>
- '<xsl:value-of select="."/>'
- </xsl:for-each>
- ];
-
- <!-- Message replacement entries -->
- var clMessageReplaceArray = [
- <!-- Captions -->
- <xsl:variable name="clCaptionTable" select="$referenceableIds/captions"/>
- <xsl:for-each select="$clCaptionTable/entry">
- <xsl:if test="position() > 1">,</xsl:if>
- '<xsl:value-of select="."/>'
- </xsl:for-each>
- <!-- Prompts -->
- <xsl:variable name="promptTable" select="$referenceableIds/prompts"/>
- <xsl:for-each select="$promptTable/entry">
- <xsl:if test="not(preceding-sibling::node()[.=current()/.])">
- <xsl:if test="position() > 1 or count($promptTable/entry) > 0">,</xsl:if>
- '<xsl:value-of select="."/>_label'
- </xsl:if>
- </xsl:for-each>
- ];
- </script>
- </xsl:if>
- </xsl:template>
-
- <!-- -->
- <!-- Render LOGIN fault -->
- <!-- -->
- <xsl:template match="fault[login]">
- <div id="loginInput">
- <!-- original request -->
- <xsl:apply-templates select="redirect-form/*" mode="scripts-and-form"/>
- <div class="loginPrompt">
- <xsl:variable name="promptInfo" select="login/*[local-name() = 'CAM']/*[local-name() = 'exception']/*[local-name() = 'promptInfo']"/>
-
- <!-- custom login -->
- <xsl:variable name="clCaption">
- <xsl:call-template name="clBuildCaption">
- <xsl:with-param name="promptInfo" select="$promptInfo"/>
- </xsl:call-template>
- </xsl:variable>
-
- <div class="loginHeaderTitle" nowrap="nowrap">
- <xsl:value-of select="/fault/presentation/title"/>
- </div>
- <div id="{$clCaption}" class="loginPromptCaption">
- <xsl:for-each select="$promptInfo/*[local-name() = 'captions']/*">
- <xsl:value-of select="concat(., ' ')"/>
- </xsl:for-each>
- </div>
-
- <div>
- <xsl:for-each select="$promptInfo/*[local-name() = 'displayObjects']/*[local-name() = 'item'][@xsi:type = 'bus:displayObject']">
- <!-- custom login -->
- <xsl:variable name="clName"><xsl:call-template name="clTranslateName"/></xsl:variable>
- <xsl:choose>
- <!-- Hidden fields -->
- <xsl:when test="*[local-name() = 'type'] = 'hidden'">
- <input type="hidden" name="{*[local-name() = 'name']}" value="{*[local-name() = 'value']}"/>
- </xsl:when>
-
- <xsl:when test="*[local-name() = 'type'] = 'singleselect'">
- <div id="{$clName}_container">
- <div id="{$clName}_label" class="loginPromptInputLabel" style="padding-top:10px;"><xsl:value-of select="*[local-name() = 'caption']"/></div>
- <div id="{$clName}_input">
- <select name="{*[local-name() = 'name']}" id="{*[local-name() = 'name']}" onkeypress="submitThis(event)" aria-labelledby="{$clName}_label">
- <xsl:if test="count(preceding-sibling::*/*[local-name() = 'type' and (. = 'singleselect' or .='text' or .= 'textnoecho')]) = 0">
- <xsl:attribute name="aria-describedby"><xsl:value-of select="$clCaption"/></xsl:attribute>
- </xsl:if>
- <xsl:for-each select="*[local-name() = 'promptOptions']/*">
- <option value="{*[local-name() = 'id']}">
- <xsl:if test="*[local-name() = 'default'] = 'true'">
- <xsl:attribute name="selected">selected</xsl:attribute>
- </xsl:if>
- <xsl:value-of select="*[local-name() = 'value']"/>
- </option>
- </xsl:for-each>
- </select>
- <script language="JavaScript">
- function submitThis(e)
- {
- var sKey = null;
- if (window.event) //IE, Safari
- sKey = window.event.keyCode;
- else
- sKey = e.which; //Moz
- if ((sKey == '13') || (sKey=='32'))
- window.document.pform.submit();
- }
- </script>
- </div>
- </div>
- </xsl:when>
-
- <!-- Static display fields -->
- <xsl:when test="*[local-name() = 'type'] = 'display'">
- <div id="{$clName}_container">
- <div id="{$clName}_label" class="loginPromptInputLabel" style="padding-top:10px;"><xsl:value-of select="*[local-name() = 'caption']"/></div>
- <div id="{$clName}_input" class="loginPromptInputStaticText"><xsl:value-of select="*[local-name() = 'value']"/></div>
- </div>
- </xsl:when>
-
- <!-- Password/Text fields -->
- <xsl:otherwise>
- <div id="{$clName}_container">
- <div id="{$clName}_label" class="loginPromptInputLabel" style="padding-top:5px;"><xsl:value-of select="*[local-name() = 'caption']"/></div>
- <div id="{$clName}_input">
- <input class="loginPromptInputText" name="{*[local-name() = 'name']}" id="{*[local-name() = 'name']}" value="{*[local-name() = 'value']}" aria-labelledby="{$clName}_label">
- <xsl:if test="count(preceding-sibling::*/*[local-name() = 'type' and (. = 'singleselect' or .='text' or .= 'textnoecho')]) = 0 ">
- <xsl:attribute name="aria-describedby"><xsl:value-of select="$clCaption"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="contains(*[local-name() = 'type'], 'textnoecho')">
- <xsl:attribute name="type">password</xsl:attribute>
- <xsl:attribute name="autocomplete">off</xsl:attribute>
- </xsl:if>
- <xsl:if test="*[local-name() = 'type']='text'">
- <xsl:attribute name="type">text</xsl:attribute>
- </xsl:if>
- </input>
- </div>
- </div>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </div>
- </div>
- </div>
- </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>
|