123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: cpscrn
- (C) Copyright IBM Corp. 2005, 2011
- 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="init" type="exec" mode="interpret" processor="XML" condition=".[/root/env/param[@name='s7'] = '1']" mandatory="false">
- <xts:sequence>
- <xts:append>
- <!-- If we are dealing with a series7 object, we read the gateway from the configuration instead of calculating it. This is to support "https" if it is used.-->
- <xts:function name="getConfiguration">
- <xts:param name="gateway"/>
- </xts:function>
- </xts:append>
- </xts:sequence>
- </xts:block>
- <xts:block id="render" dependency="init" type="exec" mode="output" processor="XSLT" mimeType="text/html">
- <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="url" select="/root/env/param[@name='url']"/>
- <xsl:variable name="is-url-base64encoded" select ="/root/env/param[@name='urlEncoded'] = 'true'"/>
- <xsl:variable name="action" select="/root/env/param[@name='action']"/>
- <xsl:variable name="series7" select="/root/env/param[@name='s7'] = '1'"/>
- <xsl:variable name="skin">
- <xsl:choose>
- <xsl:when test="root/user/param[@name='skin']"><xsl:value-of select="root/user/param[@name='skin']"/></xsl:when>
- <xsl:otherwise>corporate</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:variable name="skin_root" select="concat(/root/system/param[@name='skin-root'], '/', $skin )"/>
- <xsl:variable name="skin_style" select="concat($skin_root, '/', /root/system/param[@name='app-portal-ref'], '/default.css')"/>
- <xsl:variable name="skin_font" select="concat($skin_root, '/fonts.css')"/>
-
- <xsl:variable name="image-root" select="/root/system/param[@name='img-root']"/>
- <xsl:variable name="images" select="concat($image-root,'/portlets/nav/images/')"/>
- <html>
- <head>
- <meta name="Copyright" content="(C) Copyright IBM Corp. 2005, 2011"/>
- <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>
- <link rel="stylesheet" type="text/css" href="{$skin_style}"/>
- <link rel="stylesheet" type="text/css" href="{$skin_font}"/>
- </head>
- <body>
- <xsl:choose>
- <xsl:when test="$action='close'">
- <xsl:attribute name="onload">close();</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <script language="javascript">
- <xsl:if test="$url">
- function getRedirectUrl(){
- <xsl:variable name="request-uri">
- <xsl:choose>
- <xsl:when test="$series7">
- <xsl:value-of select="/root/configuration/property[@name = 'gateway']"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="/root/http/param[@name='SCRIPT_NAME']"/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text>?b_action=xts.run&m=/cps4/common/back.xts&urlEncoded=</xsl:text>
- <xsl:value-of select="$is-url-base64encoded"/>
- <xsl:if test="$url">
- <xsl:text>&url=</xsl:text>
- <xsl:value-of select="xtsext:urlencode($url)"/>
- </xsl:if>
- <xsl:if test="$action">
- <xsl:text>&action=</xsl:text>
- <xsl:value-of select="$action"/>
- </xsl:if>
- <xsl:if test="$series7">
- <xsl:text>&s7=1</xsl:text>
- </xsl:if>
- </xsl:variable>
-
-
-
- <xsl:variable name="new-url">
- <xsl:choose>
- <xsl:when test="$is-url-base64encoded">
- <xsl:value-of select="xtsext:web64decode($url, true())"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$url"/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="$series7">
- <xsl:text>&BACK=</xsl:text>
- <xsl:value-of select="xtsext:urlencode($request-uri)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>&ui.backURL=</xsl:text>
- <xsl:value-of select="xtsext:protect(xtsext:urlencode($request-uri),'url','url','getdata')"/>
- </xsl:otherwise>
- </xsl:choose>
-
- </xsl:variable>
-
- <!-- Used for unit testing -->
- <xsl:if test="/root/unitTest = 'true'">
- <xsl:text>/*</xsl:text>
- <requestUri><xsl:value-of select="$request-uri"/></requestUri>
- <redirectUrl><xsl:value-of select="$new-url"/></redirectUrl>
- <xsl:text>*/</xsl:text>
- </xsl:if>
-
-
- return "<xsl:value-of select="xtsext:javascriptencode($new-url)"/>";
- }
- </xsl:if>
- function redirect(){
- <xsl:if test="$url ">
- location.href=getRedirectUrl();
- </xsl:if>
- }
-
- </script>
- <div class="boxbody">
- <table border="0" cellspacing="0" cellpadding="0" width="100%">
- <tr>
- <td class="portlet-font" align="center" valign="middle" height="100">
- <xsl:choose>
- <xsl:when test="$action = 'run'">
- <xts:string id="IDS_NAV_VEW_CLICK_RUN"/><br/>
- <a href="#" onclick="redirect()">
- <img src="{$images}action_run_report_20.gif" border="0" >
- <xsl:attribute name="alt"><xts:string id="IDS_NAV_VEW_RUN_NOW"/></xsl:attribute>
- </img>
- </a>
- </xsl:when>
- <xsl:otherwise>
- <xts:string id="IDS_NAV_VEW_CLICK_VIEW"/><br/>
- <a href="#" onclick="redirect()">
- <img src="{$images}action_view_report_20.gif" border="0">
- <xsl:attribute name="alt"><xts:string id="IDS_NAV_VEW_VIEW_NOW"/></xsl:attribute>
- </img>
- </a>
- </xsl:otherwise>
- </xsl:choose>
- </td>
- </tr>
- </table>
- </div>
- </xsl:otherwise>
- </xsl:choose>
- </body>
- </html>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- </xts:morphlet>
|