123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: ps
- (C) Copyright IBM Corp. 2005, 2011
- 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).
- -->
- <xts:morphlet xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="messages/portal.xml, messages/portalRL.xml" requiredCapability="canUseAdministrationPortal">
- <!-- form logic stuff ============================================================== -->
- <xts:block id="formlogic_init" type="exec" mode="interpret" processor="XSLT" path="/logicsheets/formlogic_init.xslt" nodelist="env,credential,system,http"/>
- <!--======================================================================
- Name: executeCommand
- Comments: Execute form command.
- For service list page, the command could be:
- - start
- - stop
- - test (ping)
- For dispatcher list page, the command could be:
- - unregister
- - test (ping)
- ======================================================================-->
- <xts:block id="executeCommand" type="exec" mode="interpret" processor="XSLT" dependency="formlogic_init">
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
-
- <xsl:variable name="query-values" select="/root/env/param"/>
- <xsl:variable name="prefix" select="'checkbox_'"/>
- <xsl:variable name="action">
- <xsl:choose>
- <xsl:when test="$query-values[@name='c']">
- <xsl:value-of select="$query-values[@name='c']"/>
- </xsl:when>
- <xsl:when test="$query-values[@name='ifrmcmd']">
- <xsl:value-of select="$query-values[@name='ifrmcmd']"/>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:template match="/">
- <xts:sequence>
- <xts:append>
- <cmResponse>
- <xsl:choose>
- <!-- ==================================================
- = perform actions from tools monitor page. =
- ===================================================-->
- <xsl:when test="$query-values[starts-with(@name,$prefix)] and not($action='activate')">
- <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
- <send:request provider="cm">
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
- <cm:requests>
- <xsl:for-each select="$query-values[starts-with(@name,$prefix)]">
- <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
- <cm:search>
- <xsl:value-of select="xtsext:urldecode(string(.))"/>
- </cm:search>
- <cm:properties>
- <cm:property name="searchPath"/>
- <cm:property name="ancestors"/>
- <cm:property name="defaultName"/>
- <cm:property name="iconURI"/>
- </cm:properties>
- <cm:options continueOnError="true" schemaInfo="false"/>
- </cm:query>
- </xsl:for-each>
- </cm:requests>
- </cm:query>
- </xts:transform>
- </send:request>
- </xts:transform>
- </xsl:when>
- <!-- ==================================================
- = perform actions from actions page =
- ===================================================-->
- <xsl:otherwise>
- <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
- <send:request provider="cm">
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
- <cm:search>
- <xsl:value-of select="$query-values[@name ='m_obj']"/>
- </cm:search>
- <cm:properties>
- <cm:property name="searchPath"/>
- <cm:property name="ancestors"/>
- <cm:property name="defaultName"/>
- <cm:property name="iconURI"/>
- <cm:property name="startAsActive"/>
- <cm:property name="runningState"/>
- </cm:properties>
- <cm:options continueOnError="true" schemaInfo="false"/>
- </cm:query>
- </xts:transform>
- </send:request>
- </xts:transform>
- </xsl:otherwise>
- </xsl:choose>
- </cmResponse>
- </xts:append>
- <xts:append>
- <actionResponse>
- <xsl:attribute name="action"><xsl:value-of select="$action"/></xsl:attribute>
- <send:request provider="xts">
- <xsl:element name="monitor" namespace="http://developer.cognos.com/schemas/xts/portal/iFrmCmd/1/">
- <env xmlns="http://developer.cognos.com/schemas/xts/portal/iFrmCmd/1/">
- <xsl:for-each select="/root/env/param">
- <param>
- <xsl:copy-of select="@*"/>
- <xsl:value-of select="."/>
- </param>
- </xsl:for-each>
- </env>
- </xsl:element>
- </send:request>
- </actionResponse>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- <xsl:template match="text()"/>
- </xsl:stylesheet>
- </xts:block>
- <!-- ==========================================================================
- = Name: listResult =
- = Comment: put cm:class into each status element. Sort objects according to m_sort. =
- ============================================================================-->
- <xts:block id="listResult" processor="XSLT" type="exec" dependency="executeCommand">
- <xts:logicsheet path="logicsheets/toollogic.xslt"/>
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:tool="http://developer.cognos.com/schemas/xts/logicsheets/xslt/toollogic/" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/" xmlns:smt="http://developer.cognos.com/schemas/xts/admin/iServerManagement/1/" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <tool:gen-path-str/>
- <xsl:template match="/">
- <xsl:apply-templates select="/root/actionResponse"/>
- </xsl:template>
- <xsl:template match="actionResponse" priority="1">
- <xts:sequence>
- <xts:append>
- <actionResult>
- <xsl:copy-of select="@*"/>
- <xsl:apply-templates/>
- </actionResult>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- <xsl:template match="*[local-name() = 'status']" priority="1">
- <xsl:variable name="m_sort" select="/root/env/param[@name='m_sort']"/>
- <xsl:variable name="path" select="*[local-name()='path']"/>
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- <xsl:copy-of select="child::*"/>
- <xsl:copy-of select="/root/cmResponse/cm:queryResponse//*[./cm:searchPath=$path]/cm:objectClass"/>
- <xsl:copy-of select="/root/cmResponse/cm:queryResponse//*[./cm:searchPath=$path]/cm:startAsActive"/>
- <xsl:copy-of select="/root/cmResponse/cm:queryResponse//*[./cm:searchPath=$path]/cm:runningState"/>
- <xsl:copy-of select="/root/cmResponse/cm:queryResponse//*[./cm:searchPath=$path]/cm:ancestors"/>
- <xsl:copy-of select="/root/cmResponse/cm:queryResponse//*[./cm:searchPath=$path]/cm:defaultName"/>
- <pathSorting>
- <xsl:call-template name="gen-path-str">
- <xsl:with-param name="ancestorsInfo" select="/root/cmResponse/cm:queryResponse//*[./cm:searchPath=$path]/cm:ancestors"/>
- </xsl:call-template>
- </pathSorting>
- </xsl:copy>
- </xsl:template>
- <xsl:template match="*">
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- <xsl:apply-templates/>
- </xsl:copy>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--======================================================================
- Name: resultPage
- Comments: Render the action result page. It's a dialog page with Close button.
- ======================================================================-->
- <xts:block id="resultPage" mode="output" processor="XSLT" type="exec" mimeType="text/html" dependency="listResult formlogic_init">
- <!-- get the new theme stuff -->
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
- <!-- apply the form logic -->
- <xts:logicsheet path="logicsheets/formlogic.xslt"/>
- <xts:logicsheet path="logicsheets/validation.xslt"/> <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
- xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/"
- xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
- xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/"
- 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:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/"
- xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
- xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
- xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/"
- xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:smt="http://developer.cognos.com/schemas/xts/admin/iServerManagement/1/"
- xmlns:tool="http://developer.cognos.com/schemas/xts/logicsheets/xslt/toollogic/"
- exclude-result-prefixes="xsl cm cml bus utml send xtsext smt tool">
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
- <!-- current file name -->
- <xsl:variable name="mname" select="'dialog_action_result.xts'"/>
- <!-- add any theme variables -->
- <pf:variables/>
- <!-- back-url must be defined, but not used -->
- <xsl:variable name="back-url" select="''"/>
- <xsl:template match="/root">
- <xsl:variable name="actTitle">
- <xsl:choose>
- <xsl:when test="/root/actionResult/@action = 'start'">
- <xts:string id="IDS_ACTION_START"/>
- </xsl:when>
- <xsl:when test="/root/actionResult/@action = 'stop'">
- <xts:string id="IDS_ACTION_STOP"/>
- </xsl:when>
- <xsl:when test="/root/actionResult/@action = 'test'">
- <xts:string id="IDS_ACTION_TEST"/>
- </xsl:when>
- <xsl:when test="/root/actionResult/@action = 'unregister'">
- <xts:string id="IDS_ACTION_UNREGISTER"/>
- </xsl:when>
- <xsl:when test="/root/actionResult/@action = 'activate'">
- <xts:string id="IDS_ACTION_ACTIVATE"/>
- </xsl:when>
- <xsl:when test="/root/actionResult/@action = 'set_default_active'">
- <xts:string id="IDS_ACT_SET_DEFAULT_ACTIVE"/>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="browserTitle">
- <xsl:choose>
- <xsl:when test="$actTitle != ''">
- <xts:string id="IDS_VIEW_ACTION_RESULTS_TITLE1"><xts:param name="objectName"><xsl:value-of select="$actTitle"/></xts:param></xts:string>
- </xsl:when>
- <xsl:otherwise>
- <xts:string id="IDS_VIEW_ACTION_RESULTS_TITLE2"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:text disable-output-escaping='yes'><!DOCTYPE html></xsl:text><dp:page longTitle="$browserTitle">
- <dp:meta>
- <pf:meta/> <!-- Standard meta tags -->
- </dp:meta>
- <dp:script>
- <pf:help context="HID_SERVERS_CONFIGURE"/> <!-- Help system -->
- </dp:script>
- <utml:form name="pform" method="post" action="{$gateway}">
- <!-- dialog header -->
- <dp:header>
- <!-- header titles-->
- <dp:title showName="false">
- <xsl:value-of select="$browserTitle"/>
- </dp:title>
- </dp:header>
- <!-- layout-->
- <lyt:layout style="1" border="no">
- <lyt:section>
- <cp:table iterate="/root/actionResult//*[local-name() ='status']" width="100%" align="left">
- <cp:tableHeader>
- <cp:columnHeader width="16"/>
- <!-- Path-Name Column -->
- <cp:columnHeader width="120">
- <!-- All of this is to align the header (...> Name) with the contents of the table-->
- <img height="5" width="1" border="0"><xsl:attribute name="src"><xsl:value-of select="$webcontent"/>/images/space.gif</xsl:attribute></img>
- <xsl:text/><xts:string id="IDS_PATH_INDICATOR"/><xsl:text> </xsl:text>
- <img height="5" width="1" border="0"><xsl:attribute name="src"><xsl:value-of select="$webcontent"/>/images/space.gif</xsl:attribute></img>
- <xsl:text/><xts:string id="IDS_NAME"/><xsl:text/>
- </cp:columnHeader>
- <cp:columnHeader width="100">
- <xts:string id="IDS_HEADING_STATUS"/>
- </cp:columnHeader>
- <xsl:if test="/root/actionResult/@action = 'test'">
- <cp:columnHeader width="80">
- <xsl:attribute name="title"><xts:string id="IDS_HEADING_VERSION"/></xsl:attribute>
- <xts:string id="IDS_HEADING_VERSION"/>
- </cp:columnHeader>
- <cp:columnHeader width="100">
- <xsl:attribute name="title"><xts:string id="IDS_TOOLTIP_UPTIME"/></xsl:attribute>
- <xts:string id="IDS_HEADING_UPTIME"/>
- </cp:columnHeader>
- </xsl:if>
- <cp:columnHeader width="100%">
- <xts:string id="IDS_HEADING_ERROR_MESSAGE"/>
- </cp:columnHeader>
- </cp:tableHeader>
- <!-- Column contents -->
- <cp:tableContent>
- <cp:columnContent>
- <xsl:call-template name="gen-icon"/>
- </cp:columnContent>
- <!-- Path-Name Column -->
- <cp:columnContent>
- <img height="16" width="20" align="absmiddle">
- <xsl:attribute name="alt"><xsl:value-of select="*[local-name()='pathSorting']"/></xsl:attribute>
- <xsl:attribute name="src"><xsl:value-of select="$skin_images"/>path.gif</xsl:attribute>
- </img>
- <xsl:text> </xsl:text>
- <xsl:choose>
- <xsl:when test="cm:objectClass = 'dispatcher' ">
- <xsl:value-of select="cm:defaultName"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat(cm:ancestors/child::cm:ancestorInfo[position() = last()]/cm:title, ' > ', cm:defaultName)"/>
- </xsl:otherwise>
- </xsl:choose>
- </cp:columnContent>
- <cp:columnContent>
- <xsl:choose>
- <xsl:when test="@success='true'">
- <xts:string id="IDS_JOB_STATUS_SUCCEEDED"/>
- </xsl:when>
- <xsl:otherwise>
- <xts:string id="IDS_JOB_STATUS_FAILED"/>
- </xsl:otherwise>
- </xsl:choose>
- </cp:columnContent>
- <xsl:if test="/root/actionResult/@action = 'test'">
- <cp:columnContent>
- <xsl:value-of select="*[local-name()='version']"/>
- </cp:columnContent>
- <cp:columnContent>
- <xsl:value-of select="xtsext:formatDuration(number(*[local-name()='upTime']),boolean('true'),string('1'),number('2'))"/>
- </cp:columnContent>
- </xsl:if>
- <cp:columnContent>
- <xsl:if test="@success='false'">
- <xsl:choose>
- <xsl:when test="@count = 0">
- <xts:string id="IDS_ERR_NO_DATA"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:for-each select="./*[local-name() = 'detail']/*[local-name() = 'error']">
- <xsl:value-of select="."/>
- <br/>
- </xsl:for-each>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </cp:columnContent>
- </cp:tableContent>
- </cp:table>
- </lyt:section>
- </lyt:layout>
- <dp:footer>
- <df:button df:id="IDS_CLOSE" df:style="back-url"/>
- </dp:footer>
- </utml:form>
- </dp:page>
- </xsl:template>
- <!-- Insert common templates -->
- <pf:gen-icon/>
- </xsl:stylesheet>
- </xts:block>
- <!--======================================================================
- Name: debug
- Comments: display the debug info.
- ======================================================================-->
- <xts:block id="debug" dependency="resultPage" condition=".[/root/session/param[@name='debug']='1']" type="exec" mode="output" processor="XSLT" mandatory="false" mimeType="text/html">
- <!-- get the debug logic sheet -->
- <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dbg="http://developer.cognos.com/schemas/xts/logicsheets/xslt/debug/" exclude-result-prefixes="dbg">
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
- <xsl:template match="/">
- <dbg:dumpxml select="/root"/>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- </xts:morphlet>
|