123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: cpscrn
- (C) Copyright IBM Corp. 2005, 2014
- US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- -->
- <xts:morphlet version="1.0" xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="/cps4/portlets/nav/messages/cpsnavmsgs.xml">
- <xts:block id="getconfig" type="exec" mode="interpret" processor="XSLT">
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <xsl:template match="/">
- <xts:sequence>
- <xts:append>
- <xts:function name="getConfiguration">
- <xts:param name="CPSPropagatePassport"/>
- </xts:function>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
-
- <xts:block id="render" type="exec" mode="output" processor="XSLT" mimeType="text/html" dependency="getconfig">
- <xsl:stylesheet version="1.0" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xts="http://developer.cognos.com/schemas/xts/">
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="/">
-
- <xsl:variable name="context" select="/root/env/param[@name='context']"/>
- <xsl:variable name="sinfo" select="xtsext:javascriptencode(/root/env/param[@name='sinfo'])"/>
- <xsl:variable name="target" select="/root/env/param[@name='target']"/>
- <xsl:variable name="is-target-valid" select="xtsext:cafaction('checkurlhostdomain_null', $target) = 'true'"/>
- <xsl:variable name="cookies">
- <xsl:for-each select="/root/cookies/cookie">
- <xsl:if test="position() > 1">
- <xsl:text>,</xsl:text>
- </xsl:if>
-
- <xsl:choose>
- <xsl:when test="/root/configuration/property[@name='CPSPropagatePassport'] = 'true'">
- <xsl:if test="@name != 'cam_passport'">
- <xsl:value-of select="@name"/>
- <xsl:text>=</xsl:text>
- <xsl:value-of select="xtsext:javascriptencode(.)"/>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="@name"/>
- <xsl:text>=</xsl:text>
- <xsl:value-of select="xtsext:javascriptencode(.)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </xsl:variable>
-
- <html>
- <head>
- <meta name="Copyright" content="(C) Copyright IBM Corp. 2005, 2014"/>
- <meta name="Trademark" content="Licensed Material - Property of IBM Corp. IBM, the IBM logo, and Cognos are trademarks of IBM Corp., registered in many jurisdictions worldwide."/>
- <title></title>
- <script language="javascript">
- function loaded(){
-
- <xsl:choose>
- <xsl:when test="$sinfo">
- <xsl:if test="$context">
- if (window.parent) {
- var context = window.parent["<xsl:value-of select="xtsext:javascriptencode($context)"/>"];
- <!-- communication session result -->
- if (context){
- context.sessionInfo = "<xsl:value-of select="xtsext:javascriptencode($sinfo)"/>";
- }
- }
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <!-- retrieve session info and send it to the trusted target -->
- <xsl:choose>
- <xsl:when test="$is-target-valid">
- var formElement = document.createElement("form");
- formElement.setAttribute("method","POST");
- formElement.setAttribute("action","<xsl:value-of select="xtsext:javascriptencode($target)"/>");
-
- hiddenElement = document.createElement("input");
- hiddenElement.setAttribute("type","hidden");
- hiddenElement.setAttribute("name","sinfo");
- hiddenElement.setAttribute("value","<xsl:value-of select="xtsext:javascriptencode($cookies)"/>");
- formElement.appendChild(hiddenElement);
-
- document.body.appendChild(formElement);
- formElement.submit();
- document.body.removeChild(formElement);
- formElement = null;
- </xsl:when>
- <xsl:otherwise>
- alert("<xts:string id="IDS_DOMAIN_NOT_TRUSTED"/>");
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- }
- </script>
- </head>
- <body onload="loaded()">
- </body>
- </html>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- </xts:morphlet>
|