123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: ps
- (C) Copyright IBM Corp. 2005, 2013
- 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:pf="http://developer.cognos.com/schemas/xts/pf"
- xmlns:mt="http://developer.cognos.com/schemas/xts/logicsheets/presentation/main/mt"
- xmlns:mf="http://developer.cognos.com/schemas/xts/logicsheets/presentation/main/mf"
- xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
- xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
- xmlns:tool="http://developer.cognos.com/schemas/xts/logicsheets/xslt/toollogic/"
- xmlns:out="dummy-uri"
- exclude-result-prefixes="tool">
- <xsl:output method="xml" encoding="UTF-8" indent="no"/>
- <xsl:namespace-alias stylesheet-prefix="out" result-prefix="xsl"/>
- <xsl:variable name="tool-namespace-uri" select="'http://developer.cognos.com/schemas/xts/logicsheets/xslt/toollogic/'"/>
- <!--
- ===============================================================================================
- tool:variables - define commonly used variables
- ===============================================================================================
- -->
- <xsl:template match="tool:variables" priority="1">
- <pf:variables/>
- <out:variable name="tool-search">
- <out:choose>
- <out:when test="/root/search">true</out:when>
- <out:otherwise>false</out:otherwise>
- </out:choose>
- </out:variable>
- <xsl:if test="@useEnvParams">
- <out:variable name="tool-stateEnvParams" select="{@useEnvParams}"/>
- </xsl:if>
- <out:variable name="tool-stateParams" select="'{concat(' ', @stateParams, ' backURL tool_tab ')}'"/>
-
- <mf:variables>
- <xsl:if test="string(@type)='drillthru'">
- <mf:toolsdrillthru>true</mf:toolsdrillthru>
- </xsl:if>
- <mf:stateParams>
- <out:choose>
- <xsl:if test="@useEnvParams">
- <out:when test="$tool-stateEnvParams != ''">
- <out:value-of select="concat(' ',string($tool-stateEnvParams),' backURL tool_tab ')"/>
- <out:if test="$tool-search = 'true'">
- <out:value-of select="'search stext sscope smethod sfield sstatus stype smodified sshortcuts stime m_searchsection m_pagerfromsearch m_pagertosearch '"/>
- </out:if>
- </out:when>
- </xsl:if>
- <out:when test="$tool-search = 'true'">
- <out:value-of select="concat($tool-stateParams, 'search stext sscope smethod sfield sstatus stype smodified sshortcuts stime m_searchsection m_pagerfromsearch m_pagertosearch ')"/>
- </out:when>
- <out:otherwise>
- <out:value-of select="$tool-stateParams"/>
- </out:otherwise>
- </out:choose>
- </mf:stateParams>
- </mf:variables>
- <out:variable name="tool-back-url"><out:value-of select="xtsext:protect(xtsext:urlencode(string(/root/env/param[@name = 'backURL'])),'url','url','getdata')"/></out:variable>
- <out:variable name="cmd-form" select="'{concat('c', @formName)}'"/>
- <out:variable name="edit-form" select="'{concat('p', @formName)}'"/>
- </xsl:template>
- <!--
- ===============================================================================================
- tool:head - generate the head of the HTML page
- ===============================================================================================
- -->
- <xsl:template match="tool:head" priority="1">
- <head>
- <!-- Standard meta tags -->
- <pf:meta/>
- <title>
- <xsl:choose>
- <xsl:when test="@title and @tab">
- <out:variable name="tab"><xts:string id="{@tab}"/></out:variable>
- <out:variable name="tool"><xts:string id="{@title}"/></out:variable>
- <xts:string id="IDS_TOOLS_TITLE">
- <xts:param name="toolTab"><out:value-of select="$tab"/></xts:param>
- <xts:param name="toolName"><out:value-of select="$tool"/></xts:param>
- </xts:string>
- </xsl:when>
- <xsl:when test="@title">
- <out:text><xts:string id="{@title}"/></out:text>
- </xsl:when>
- <xsl:otherwise>
- <out:text><xts:string id="IDS_COGNOS_REPORTS"/></out:text>
- </xsl:otherwise>
- </xsl:choose>
- </title>
- <!-- add the theme style sheet -->
- <mt:stylesheet/>
- <!-- Common framework logic for Cognos Central main view -->
- <mf:head/>
- <!-- Help system -->
- <pf:help context="{@helpid}"/>
- <!-- adds functions to launch the studios.... -->
- <pf:launch/>
- <xsl:if test="tool:script">
- <script language="javascript">
- <xsl:copy-of select="tool:script/node()"/>
- </script>
- </xsl:if>
- </head>
- </xsl:template>
- <!--
- ===============================================================================================
- tool:banner - generate the top banner for tools
- ===============================================================================================
- -->
- <xsl:template match="tool:banner" priority="1">
- <xsl:if test="@hideHeaders!='true'">
- <mt:h1>
- <xsl:if test="@id != ''">
- <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
- </xsl:if>
- <mt:title>
- <xsl:if test="@title">
- <out:text><xts:string id="{@title}"/></out:text>
- </xsl:if>
- </mt:title>
- </mt:h1>
- <xsl:choose>
- <xsl:when test="tool:tabs">
- <out:variable name="tool-tab">
- <xsl:copy-of select="tool:tabs/child::node()"/>
- </out:variable>
- <xsl:call-template name="tool-gen-tabs">
- <xsl:with-param name="tabset-name" select="tool:tabs/@tabset-name"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <mt:h3/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- <mt:h4 cogadmin="true">
- <mt:path>
- <xsl:apply-templates select="tool:path/child::node()"/>
- </mt:path>
- <xsl:apply-templates select="tool:actions/child::node()"/>
- </mt:h4>
- </xsl:template>
- <!--
- ===============================================================================================
- tool:banner - generate the top banner for tools
- ===============================================================================================
- -->
- <xsl:template match="tool:banner[@mode]" priority="1">
- <xsl:if test="@hideHeaders!='true'">
- <mt:h1 mode="{@mode}">
- <xsl:if test="@id != ''">
- <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
- </xsl:if>
- <mt:title>
- <xsl:if test="@title">
- <out:text><xts:string id="{@title}"/></out:text>
- </xsl:if>
- </mt:title>
- </mt:h1>
- <xsl:choose>
- <xsl:when test="tool:tabs">
- <out:variable name="tool-tab">
- <xsl:copy-of select="tool:tabs/child::node()"/>
- </out:variable>
- <xsl:call-template name="tool-gen-tabs">
- <xsl:with-param name="tabset-name" select="tool:tabs/@tabset-name"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <mt:h3/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- <mt:h4>
- <xsl:if test="@jumpToMain != ''">
- <xsl:attribute name="jumpToMain"><xsl:value-of select="@jumpToMain"/></xsl:attribute>
- </xsl:if>
- <mt:path>
- <xsl:apply-templates select="tool:path/child::node()"/>
- </mt:path>
- <xsl:apply-templates select="tool:actions/child::node()"/>
- </mt:h4>
- </xsl:template>
- <!--
- ===============================================================================================
- tool:content - generate the main content for tools
- ===============================================================================================
- -->
- <xsl:template match="tool:content" priority="1">
- <xsl:variable name="evMode">
- <xsl:if test="not(@nomode)">tools</xsl:if>
- </xsl:variable>
- <form method="post" name="p{@formName}">
- <xsl:attribute name="action"><xsl:value-of select="'{$gateway}'"/></xsl:attribute>
- <xsl:copy-of select="*"/>
- <mf:edit-vars mode="{@evMode}">
- <xsl:if test="@tool:excludeVars">
- <xsl:attribute name="mf:excludeVars">
- <xsl:value-of select="@tool:excludeVars"/>
- </xsl:attribute>
- </xsl:if>
- </mf:edit-vars>
-
- <!-- standard set of form variables used to process commands like actions, new ... -->
- </form>
- <form method="post" name="c{@formName}">
- <xsl:attribute name="action"><xsl:value-of select="'{$gateway}'"/></xsl:attribute>
- <mf:cmd-vars/>
- <input type="hidden" name="from_tool" value="true"/>
- <xsl:choose>
- <xsl:when test="@tool='portaladmin'">
- <input type="hidden" name="m_p_canCustomize"/>
- </xsl:when>
- <xsl:when test="@tool='contentadmin'">
- <input type="hidden" name="m_deploymentWizardPage" value=""/>
- <input type="hidden" name="contentTaskType" value=""/>
- </xsl:when>
- <xsl:when test="@tool='schedule'">
- <!-- from_schedule_tool parameter is needed by the run schedule once dialog. -->
- <input type="hidden" name="from_schedule_tool" value="true"/>
- </xsl:when>
- <xsl:when test="@addViewOutput = 'true'">
- <input type="hidden" name="reportVersionPath" value=""/>
- <input type="hidden" name="runHistoryRequestedTime" value=""/>
- </xsl:when>
- </xsl:choose>
- </form>
- </xsl:template>
- <!--
- ===============================================================================================
- tool-gen-tabs: retrieve the name attribute or child tool:name element from the given node.
- ===============================================================================================
- -->
- <xsl:template name="tool-gen-tabs">
- <xsl:param name="selected"/>
- <xsl:param name="tabset-name"/>
- <out:variable name="selected">
- <xsl:value-of select="$selected"/>
- </out:variable>
- <xsl:if test="$tabset-name != ''">
- <mt:h3>
- <mt:tabs>
- <out:variable name="tabs">
- <xsl:choose>
- <!-- Schedule Tool tabs: (a) Activity; (s) Schedules. -->
- <xsl:when test="$tabset-name = 'schedule'">
- <out:variable name="scope">
- <out:choose>
- <out:when test="not(key('env-param','scope')) or key('env-param','scope')=''">own_entries</out:when>
- <out:otherwise>
- <out:value-of select="xtsext:protect(xtsext:urlencode(string(key('env-param','scope'))),'url','searchPath','getdata')"/>
- </out:otherwise>
- </out:choose>
- </out:variable>
- <tab>
- <out:choose>
- <out:when test="not($tool-tab) or $tool-tab='a'">
- <out:attribute name="selected">true</out:attribute>
- <xts:string id="IDS_SCHEDULE_ACTIVITY_TAB"/>
- </out:when>
- <out:otherwise>
- <a class="tabAnchor">
- <xsl:attribute name="href">
- <xsl:value-of select="'{$gateway}'"/>?b_action=xts.run<xsl:text/>
- <xsl:text/>&m=<xsl:value-of select="'{$app}'"/><xsl:value-of select="'/tools_activity.xts'"/><xsl:text/>
- <xsl:text/>&scope=<xsl:value-of select="'{$scope}'"/><xsl:text/>
- <xsl:text/>&tool_tab=a&backURL=<xsl:value-of select="'{$tool-back-url}'"/><xsl:text/>
- </xsl:attribute>
- <xts:string id="IDS_SCHEDULE_ACTIVITY_TAB"/>
- </a>
- </out:otherwise>
- </out:choose>
- </tab>
- <tab>
- <out:choose>
- <out:when test="$tool-tab='s'">
- <out:attribute name="selected">true</out:attribute>
- <xts:string id="IDS_SCHEDULE_SCHEDULE_TAB"/>
- </out:when>
- <out:otherwise>
- <a class="tabAnchor">
- <xsl:attribute name="href">
- <xsl:value-of select="'{$gateway}'"/>?b_action=xts.run<xsl:text/>
- <xsl:text/>&m=<xsl:value-of select="'{$app}'"/><xsl:value-of select="'/tools_schedule.xts'"/><xsl:text/>
- <xsl:text/>&scope=<xsl:value-of select="'{$scope}'"/><xsl:text/>
- <xsl:text/>&tool_tab=s&backURL=<xsl:value-of select="'{$tool-back-url}'"/><xsl:text/>
- </xsl:attribute>
- <xts:string id="IDS_SCHEDULE_SCHEDULE_TAB"/>
- </a>
- </out:otherwise>
- </out:choose>
- </tab>
- </xsl:when>
- <xsl:when test="$tabset-name = 'portalAdmin'">
- <tab>
- <out:choose>
- <out:when test="not($tool-tab) or $tool-tab='p'">
- <out:attribute name="selected">true</out:attribute>
- <xts:string id="IDS_TOOLS_PORTAL_ADMIN_PORTLETS_TAB"/>
- </out:when>
- <out:otherwise>
- <a class="tabAnchor">
- <xsl:attribute name="href">
- <xsl:value-of select="'{$gateway}'"/>?b_action=xts.run<xsl:text/>
- <xsl:text/>&m=<xsl:value-of select="'{$app}'"/><xsl:value-of select="'/tools_portaladmin.xts'"/><xsl:text/>
- <xsl:text/>&backURL=<xsl:value-of select="'{$tool-back-url}'"/><xsl:text/>
- </xsl:attribute>
- <xts:string id="IDS_TOOLS_PORTAL_ADMIN_PORTLETS_TAB"/>
- </a>
- </out:otherwise>
- </out:choose>
- </tab>
- <tab>
- <out:choose>
- <out:when test="$tool-tab='s'">
- <out:attribute name="selected">true</out:attribute>
- <xts:string id="IDS_TOOLS_PORTAL_ADMIN_STYLE_TAB"/>
- </out:when>
- <out:otherwise>
- <a class="tabAnchor">
- <xsl:attribute name="href">
- <xsl:value-of select="'{$gateway}'"/>?b_action=xts.run<xsl:text/>
- <xsl:text/>&m=<xsl:value-of select="'{$app}'"/><xsl:value-of select="'/tools_skinadmin.xts'"/><xsl:text/>
- <xsl:text/>&backURL=<xsl:value-of select="'{$tool-back-url}'"/><xsl:text/>
- </xsl:attribute>
- <xts:string id="IDS_TOOLS_PORTAL_ADMIN_STYLE_TAB"/>
- </a>
- </out:otherwise>
- </out:choose>
- </tab>
- </xsl:when>
- </xsl:choose>
- </out:variable>
- <out:call-template name="renderTabs">
- <out:with-param name="tabs" select="$tabs"/>
- <out:with-param name="scroll" select="false()"/>
- </out:call-template>
- </mt:tabs>
- </mt:h3>
- </xsl:if>
- </xsl:template>
- <!--
- ===============================================================================================
- The main engine
- ===============================================================================================
- -->
- <xsl:template match="*[namespace-uri() = $tool-namespace-uri]" priority="0">
- <xsl:comment>Ignoring <xsl:value-of select="name()"/> element.</xsl:comment>
- </xsl:template>
- <xsl:template match="*">
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- <xsl:apply-templates/>
- </xsl:copy>
- </xsl:template>
- </xsl:stylesheet>
|