123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332 |
- <?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.
- -->
- <!--
- Copyright (C) 2008 Cognos ULC, an IBM Company. All rights reserved.
- Cognos (R) is a trademark of Cognos ULC, (formerly Cognos Incorporated).
- -->
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xts="http://developer.cognos.com/schemas/xts/"
- xmlns:encode="java:com.cognos.portal.utils.EncodingUtils"
- exclude-result-prefixes="encode">
- <xsl:attribute-set name="hover">
- <xsl:attribute name="class">cogstyle-portlet-action</xsl:attribute>
- <xsl:attribute name="onmouseover">caption.prototype.mouseOver(this)</xsl:attribute>
- <xsl:attribute name="onmouseout">caption.prototype.mouseOut(this)</xsl:attribute>
- <xsl:attribute name="align">center</xsl:attribute>
- <xsl:attribute name="valign">middle</xsl:attribute>
- <xsl:attribute name="tabindex">0</xsl:attribute>
- <xsl:attribute name="role">button</xsl:attribute>
- </xsl:attribute-set>
- <xsl:variable name="layout-id" select="/root/id"/>
- <xsl:variable name="is-ie" select="contains(/root/settings/browserAgent , 'MSIE')"/>
-
-
- <xsl:template match="layout">
- <xsl:param name="pageType"/>
- <xsl:variable name="use-fixed-tables-value">
- <xsl:choose>
- <xsl:when test="layoutProperties/param[@name='fixed']">
- <xsl:value-of select="layoutProperties/param[@name='fixed']"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="/root/settings/pageFixed"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:variable name="use-fixed-tables" select="not(layoutProperties/param[@name='flexibleColumnLayout'] = 'true') and $use-fixed-tables-value = 'true'"/>
-
- <script>
- var <xsl:value-of select="/root/id"/>
- <xsl:text>distributionList = [</xsl:text>
- <xsl:for-each select="/root/fragment">
- <xsl:value-of select="concat('"', id, '"')"/>
- <xsl:if test="position() != last()">, </xsl:if>
- </xsl:for-each>
- <xsl:text>]; </xsl:text>
- <xsl:text>function </xsl:text>
- <xsl:value-of select="/root/id"/>distributor(evt)
- {
- _F_Event.distribute(<xsl:value-of select="/root/id"/>distributionList, evt);
- }
- <xsl:value-of select="/root/id"/>.addEventListener("*", "<xsl:value-of select="/root/id"/>distributor", true);
- </script>
- <div id="{$layout-id}normal">
- <xsl:if test="$pageType = 'page'">
- <xsl:attribute name="role">main</xsl:attribute>
- </xsl:if>
- <xsl:apply-templates>
- <xsl:with-param name="use-fixed-tables" select="$use-fixed-tables"/>
- </xsl:apply-templates>
- </div>
- <div id="{$layout-id}maximized" style="display:none">
- </div>
-
- </xsl:template>
- <xsl:template match="layoutProperties">
- </xsl:template>
-
- <xsl:template match="row">
- <xsl:param name="use-fixed-tables" select="true()"/>
- <table border="0" cellpadding="0" cellspacing="0" width="100%" role="presentation">
- <xsl:if test="$use-fixed-tables">
- <xsl:attribute name="style">table-layout:fixed</xsl:attribute>
- </xsl:if>
- <tr>
- <xsl:apply-templates>
- <xsl:with-param name="use-fixed-tables" select="$use-fixed-tables"/>
- </xsl:apply-templates>
- </tr>
- </table>
- </xsl:template>
- <xsl:template match="column">
- <xsl:param name="use-fixed-tables" select="true()"/>
- <td valign="top">
- <xsl:if test="@width">
- <xsl:attribute name="width"><xsl:value-of select="@width"/></xsl:attribute>
- </xsl:if>
- <xsl:apply-templates>
- <xsl:with-param name="use-fixed-tables" select="$use-fixed-tables"/>
- </xsl:apply-templates>
- </td>
- </xsl:template>
- <xsl:template match="fragment">
- <xsl:param name="use-fixed-tables" select="true()"/>
- <xsl:variable name="frag" select="/root/fragment[id = current()/@refid]"/>
- <xsl:variable name="layout-properties" select="layoutProperties/param"/>
- <xsl:variable name="show-borders" select="not($layout-properties[@name='borders']='false')"/>
- <xsl:variable name="show-margins" select="not($layout-properties[@name='margins']='false')"/>
- <xsl:variable name="show-caption" select="not($layout-properties[@name='caption']='false')"/>
- <xsl:variable name="show-paddings" select="not($layout-properties[@name='paddings']='false')"/>
- <xsl:variable name="height" select="$layout-properties[@name='height']"/>
- <xsl:variable name="overflow" select="$layout-properties[@name='overflow']"/>
- <xsl:variable name="meta-modes">
- <xsl:text>|</xsl:text>
- <xsl:for-each select="$frag/meta/modes">
- <xsl:value-of select="."/>
- <xsl:text>|</xsl:text>
- </xsl:for-each>
- </xsl:variable>
- <div id="{$frag/id}frame">
- <xsl:attribute name="style">
- <xsl:text>overflow-x:hidden</xsl:text>
- <!-- This is to fix problems in IE where absolute content is rendered inside the content div (e.g. search portlet popup menu)-->
- <!-- temporary: only do this for now when we have a wsrp portlet, other wise cogadmin will break : COGCQ00266449-->
- <xsl:if test="$is-ie and $frag/meta/customProperties[@name='wsrp_portlet_context']">
- <xsl:text>;position:relative</xsl:text>
- </xsl:if>
- </xsl:attribute>
- <xsl:if test="$show-margins">
- <xsl:attribute name="class">cogstyle-portlet-frame</xsl:attribute>
- </xsl:if>
- <table border="0" cellpadding="0" cellspacing="0" width="100%" role="presentation">
- <xsl:if test="$use-fixed-tables">
- <xsl:attribute name="style">table-layout:fixed</xsl:attribute>
- </xsl:if>
- <xsl:variable name="css-paddings">
- <xsl:if test="$show-paddings">cogstyle-portlet-content</xsl:if>
- </xsl:variable>
- <xsl:variable name="css-borders">
- <xsl:if test="$show-borders">
- <xsl:choose>
- <xsl:when test="$show-caption"> cogstyle-portlet-borders</xsl:when>
- <xsl:otherwise> cogstyle-portlet-borders-nocaption</xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$show-caption">
- <tr role="heading" aria-label="{$frag/info/title}">
- <td>
- <xsl:apply-templates select="$frag/info/title">
- <xsl:with-param name="layout-properties" select="$layout-properties"/>
- <xsl:with-param name="preferred-title" select="$frag/preferredTitle"/>
- <xsl:with-param name="meta-modes" select="$meta-modes"/>
- </xsl:apply-templates>
- <xsl:apply-templates select="$frag/menu"/>
- </td>
- </tr>
- </xsl:when>
- <xsl:otherwise>
- <tr id="{$frag/id}caption_restore" style="display:none">
- <td align="right">
- <a class="cognos-anchor" href="javascript:noop()">
- <xsl:attribute name="alt"><xts:string id="IDS_GEN_ACTIONS_RETURN"><xts:param><xsl:value-of select="$title"/></xts:param></xts:string></xsl:attribute>
- <xsl:text/><xts:string id="IDS_GEN_ACTIONS_RETURN"/><xsl:text/>
- </a>
- </td>
- </tr>
- </xsl:otherwise>
- </xsl:choose>
- <tr>
- <td class="{$css-paddings}{$css-borders}">
- <xsl:if test="$height">
- <xsl:attribute name="style">height:<xsl:value-of select="$height"/></xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="$frag/markup">
- <xsl:with-param name="overflow" select="$overflow"/>
- <xsl:with-param name="use-fixed-tables" select="$use-fixed-tables"/>
- </xsl:apply-templates>
- </td>
- </tr>
- </table>
- </div>
- <script type="text/javascript">
- var <xsl:value-of select="$frag/id"/>caption = new caption('<xsl:value-of select="$frag/id"/>', '<xsl:value-of select="$layout-id"/>');
- </script>
- </xsl:template>
- <xsl:template match="fragment[@page='true']">
- <xsl:variable name="frag" select="/root/fragment[id = current()/@refid]"/>
- <xsl:variable name="nodes" select="$frag/markup"/>
- <xsl:apply-templates select="$nodes"/>
- </xsl:template>
- <xsl:template match="title">
- <xsl:param name="id" select="../../id"/>
- <xsl:param name="preferred-title"/>
- <xsl:param name="layout-properties"/>
- <xsl:param name="meta-modes"/>
- <xsl:variable name="web" select="/root/settings/contextPath"/>
- <table class="cogstyle-portlet-caption-bar" border="0" cellpadding="0" cellspacing="0" width="100%" role="presentation">
- <tr>
- <td class="cogstyle-portlet-caption">
- <xsl:variable name="title">
- <xsl:choose>
- <xsl:when test="$preferred-title != ''">
- <xsl:value-of select="normalize-space($preferred-title)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="normalize-space(.)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <div id="{$id}caption" style="float:left">
- <xsl:value-of select="$title"/>
- </div>
- <div style="float:right">
- <table class="cogstyle-portlet-actions" cellpadding="0" cellspacing="2" border="0" role="presentation">
- <tr>
- <xsl:if test="../../menu">
- <td id="{$id}caption_menu" xsl:use-attribute-sets="hover" onclick="ui_menuShow(event,menu_{../../menu/@id})" onkeypress="if(event.keyCode==9)return true;ui_menuShow(event,menu_{../../menu/@id})">
- <img src="{$web}/fragments/common/images/menudrop.gif">
- <xsl:attribute name="alt"><xts:string id="IDS_GEN_ACTIONS_MORE"><xts:param><xsl:value-of select="$title"/></xts:param></xts:string></xsl:attribute>
- <xsl:attribute name="title"><xts:string id="IDS_GEN_ACTIONS_MORE"><xts:param><xsl:value-of select="$title"/></xts:param></xts:string></xsl:attribute>
- </img>
- </td>
- </xsl:if>
- <xsl:if test="not ($layout-properties[@name='nohelp'] = 'true' ) and contains($meta-modes, '|help|')">
- <td id="{$id}caption_help" xsl:use-attribute-sets="hover">
- <img src="{$web}/fragments/portlet/images/portlet_action_help.gif">
- <xsl:attribute name="alt"><xts:string id="IDS_GEN_ACTIONS_HELP"><xts:param name="title"><xsl:value-of select="$title"/></xts:param></xts:string></xsl:attribute>
- <xsl:attribute name="title"><xts:string id="IDS_GEN_ACTIONS_HELP"><xts:param name="title"><xsl:value-of select="$title"/></xts:param></xts:string></xsl:attribute>
- </img>
- </td>
- </xsl:if>
- <td id="{$id}caption_refresh" xsl:use-attribute-sets="hover">
- <img src="{$web}/fragments/portlet/images/portlet_action_refresh.gif">
- <xsl:attribute name="alt"><xts:string id="IDS_GEN_ACTIONS_REFRESH"><xts:param name="title"><xsl:value-of select="$title"/></xts:param></xts:string></xsl:attribute>
- <xsl:attribute name="title"><xts:string id="IDS_GEN_ACTIONS_REFRESH"><xts:param name="title"><xsl:value-of select="$title"/></xts:param></xts:string></xsl:attribute>
- </img>
- </td>
- <xsl:if test="not ($layout-properties[@name='noreset'] = 'true' )">
- <td id="{$id}caption_reset" xsl:use-attribute-sets="hover" style="display:none">
- <img src="{$web}/fragments/portlet/images/portlet_action_reset.gif" border="0">
- <xsl:attribute name="alt"><xts:string id="IDS_GEN_ACTIONS_RESET"><xts:param name="title"><xsl:value-of select="$title"/></xts:param></xts:string></xsl:attribute>
- <xsl:attribute name="title"><xts:string id="IDS_GEN_ACTIONS_RESET"><xts:param name="title"><xsl:value-of select="$title"/></xts:param></xts:string></xsl:attribute>
- </img>
- </td>
- </xsl:if>
- <xsl:if test="not ($layout-properties[@name='noedit'] = 'true' )">
- <td id="{$id}caption_edit" xsl:use-attribute-sets="hover">
- <img src="{$web}/fragments/portlet/images/portlet_action_edit.gif">
- <xsl:attribute name="alt"><xts:string id="IDS_GEN_ACTIONS_EDIT"><xts:param name="title"><xsl:value-of select="$title"/></xts:param></xts:string></xsl:attribute>
- <xsl:attribute name="title"><xts:string id="IDS_GEN_ACTIONS_EDIT"><xts:param name="title"><xsl:value-of select="$title"/></xts:param></xts:string></xsl:attribute>
- </img>
- </td>
- </xsl:if>
- <td id="{$id}caption_view" xsl:use-attribute-sets="hover" style="display:none">
- <img src="{$web}/fragments/portlet/images/portlet_action_view.gif">
- <xsl:attribute name="alt"><xts:string id="IDS_GEN_ACTIONS_VIEW"><xts:param name="title"><xsl:value-of select="$title"/></xts:param></xts:string></xsl:attribute>
- <xsl:attribute name="title"><xts:string id="IDS_GEN_ACTIONS_VIEW"><xts:param name="title"><xsl:value-of select="$title"/></xts:param></xts:string></xsl:attribute>
- </img>
- </td>
- <xsl:if test="not ($layout-properties[@name='nominimize'] = 'true' )">
- <td id="{$id}caption_minimize" xsl:use-attribute-sets="hover">
- <img src="{$web}/fragments/portlet/images/portlet_action_minimize.gif">
- <xsl:attribute name="alt"><xts:string id="IDS_GEN_ACTIONS_MINIMIZE"><xts:param name="title"><xsl:value-of select="$title"/></xts:param></xts:string></xsl:attribute>
- <xsl:attribute name="title"><xts:string id="IDS_GEN_ACTIONS_MINIMIZE"><xts:param name="title"><xsl:value-of select="$title"/></xts:param></xts:string></xsl:attribute>
- </img>
- </td>
- </xsl:if>
- <td id="{$id}caption_restore" xsl:use-attribute-sets="hover" style="display:none">
- <img src="{$web}/fragments/portlet/images/portlet_action_restore.gif">
- <xsl:attribute name="alt"><xts:string id="IDS_GEN_ACTIONS_RESTORE"><xts:param name="title"><xsl:value-of select="$title"/></xts:param></xts:string></xsl:attribute>
- <xsl:attribute name="title"><xts:string id="IDS_GEN_ACTIONS_RESTORE"><xts:param name="title"><xsl:value-of select="$title"/></xts:param></xts:string></xsl:attribute>
- </img>
- </td>
- <xsl:if test="not ($layout-properties[@name='nomaximize'] = 'true' )">
- <td id="{$id}caption_maximize" xsl:use-attribute-sets="hover">
- <img src="{$web}/fragments/portlet/images/portlet_action_maximize.gif">
- <xsl:attribute name="alt"><xts:string id="IDS_GEN_ACTIONS_MAXIMIZE"><xts:param name="title"><xsl:value-of select="$title"/></xts:param></xts:string></xsl:attribute>
- <xsl:attribute name="title"><xts:string id="IDS_GEN_ACTIONS_MAXIMIZE"><xts:param name="title"><xsl:value-of select="$title"/></xts:param></xts:string></xsl:attribute>
- </img>
- </td>
- </xsl:if>
- </tr>
- </table>
- </div>
- </td>
- </tr>
- </table>
- </xsl:template>
- <xsl:template match="markup">
- <xsl:param name="use-fixed-tables" select="true()"/>
- <xsl:param name="overflow"/>
- <xsl:variable name="css-overflow">
- <xsl:choose>
- <xsl:when test="$overflow">
- <xsl:value-of select="$overflow"/>
- </xsl:when>
- <xsl:otherwise>auto</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <div id="{../id}content" aria-live="polite">
- <xsl:attribute name="style">
- <xsl:if test="$use-fixed-tables">
- <xsl:text>overflow-x:</xsl:text>
- <xsl:value-of select="$css-overflow"/>
- <!-- This to fix problems in IE where absolute content is rendered inside the content div (e.g. search portlet popup menu)-->
- <!-- temporary: only do this for now when we have a wsrp portlet, other wise cogadmin will break : COGCQ00266449-->
- <xsl:if test="$is-ie and ../meta/customProperties[@name='wsrp_portlet_context']">
- <xsl:text>;position:relative</xsl:text>
- </xsl:if>
- <xsl:text>;</xsl:text>
- </xsl:if>
- <xsl:text>width:100%;</xsl:text>
- </xsl:attribute>
- <xsl:value-of select="markupString" disable-output-escaping="yes"/>
- </div>
- </xsl:template>
- </xsl:stylesheet>
|