123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: cogadmin
- (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:uic="http://developer.cognos.com/schemas/uic/presentation/markup/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:muws2="http://docs.oasis-open.org/wsdm/muws2-2.xsd" xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:resource-prop="http://developer.cognos.com/admin/properties" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:ns1="http://docs.oasis-open.org/wsdm/muws1-2.xsd" xmlns:admui="http://developer.cognos.com/schemas/xts/admui" xmlns:wsrf-rp="http://docs.oasis-open.org/wsrf/rp-2" exclude-result-prefixes="wsrf-rp resource-prop admui xtsext xsl ns1 uic SOAP-ENV muws2 xts">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
- <xsl:template match="/root" priority="2">
- <uic:fragment>
- <xsl:variable name="impersonateTenantResponse" select="/root/response//*[local-name() = 'selectTenantsResponse']"/>
- <xsl:variable name="terminateSessionsResponse" select="/root/response/*[local-name() = 'terminateSessionsResponse']"/>
- <xsl:variable name="cancelInteractiveActivitiesResponse" select="/root/response/*[local-name() = 'CancelInteractiveActivitiesResponse']"/>
- <xsl:choose>
- <!-- a fault happened that we caught -->
- <xsl:when test="/root/response/actionFault">
- <script>
- <xsl:variable name="cmError" select="string(/root/response/actionFault/fault/*[local-name()='exception']/*[local-name()='exceptionDetail']/*[local-name()='exception']/*[local-name()='message']/*)"/>
- <xsl:variable name="isDeleteTenantsError" select="contains($cmError, 'CM-REQ-4403') or contains($cmError, 'CM-REQ-4407') or contains($cmError, 'CM-REQ-4412')"/>
- <xsl:variable name="isPersonalDataSetLOBError" select="contains($cmError, 'MSR-LOB-')"/>
- <xsl:choose>
- <xsl:when test="$isDeleteTenantsError or $isPersonalDataSetLOBError">
- alert('<xsl:value-of select="xtsext:javascriptencode($cmError)"/>');
- </xsl:when>
- <xsl:when test="/root/env/param[@name='groupAction'] = 'false'">
- alert('<xts:string id="IDS_SCH_ACTION_SINGLE_FAILED" encode="javascript"/>');
- </xsl:when>
- <xsl:otherwise>
- alert('<xts:string id="IDS_SCH_ACTION_FAILED" encode="javascript"/>');
- </xsl:otherwise>
- </xsl:choose>
- raiseReloadEvent(_THIS_);
- </script>
- </xsl:when>
- <!-- show result in a popup dialog for cancel interactive action -->
- <xsl:when test="$impersonateTenantResponse">
- <script>_F_getFragmentByID('adminconsole_xmlbookletheader').retrieve();</script>
- </xsl:when>
- <xsl:when test="$terminateSessionsResponse or $cancelInteractiveActivitiesResponse">
- <uic:body>
- <uic:table width="100%">
- <xsl:choose>
- <xsl:when test="$terminateSessionsResponse">
- <uic:header>
- <uic:row>
- <uic:column width="100%">
- <uic:text>
- <xts:string id="IDS_ADM_ACT_NUMBER_OF_TERMINATED_SESSIONS"/>
- </uic:text>
- </uic:column>
- </uic:row>
- </uic:header>
- <uic:body>
- <uic:row>
- <uic:column nowrap="nowrap">
- <uic:text>
- <xsl:value-of select="number($terminateSessionsResponse)"/>
- </uic:text>
- </uic:column>
- </uic:row>
- </uic:body>
- </xsl:when>
- <xsl:otherwise>
- <uic:header>
- <uic:row>
- <uic:column width="30%">
- <uic:text>
- <xts:string id="IDS_ADM_ACT_TABLE_HEADER_NAME"/>
- </uic:text>
- </uic:column>
- <uic:column width="70%">
- <uic:text>
- <xts:string id="IDS_ADM_ACT_TABLE_HEADER_MESSAGE"/>
- </uic:text>
- </uic:column>
- </uic:row>
- </uic:header>
- <uic:body>
- <xsl:for-each select="$cancelInteractiveActivitiesResponse/*[local-name() = 'Result']">
- <uic:row>
- <uic:column nowrap="nowrap">
- <uic:text>
- <xsl:variable name="reqId">
- <xsl:value-of select="@RequestID"/>
- </xsl:variable>
- <xsl:for-each select="/root/env/param[starts-with(@name, 'requestID_') and text() = $reqId ]">
- <xsl:variable name="nameVar">
- <xsl:value-of select="concat('reportName_', substring-after(@name, 'requestID_'))"/>
- </xsl:variable>
- <xsl:value-of select="/root/env/param[@name= $nameVar]"/>
- </xsl:for-each>
- </uic:text>
- </uic:column>
- <uic:column nowrap="nowrap">
- <uic:text>
- <xsl:value-of select="."/>
- </uic:text>
- </uic:column>
- </uic:row>
- </xsl:for-each>
- </uic:body>
- </xsl:otherwise>
- </xsl:choose>
- </uic:table>
- </uic:body>
- <!-- show ourselves -->
- <xsl:variable name="actionName">
- <xsl:choose>
- <xsl:when test="$terminateSessionsResponse">
- <xts:string id="IDS_ADM_ACT_TERMINATE_SESSIONS"/>
- </xsl:when>
- <xsl:otherwise>
- <xts:string id="IDS_CUR_CANCEL_EXECUTION"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="headerTitle">
- <xts:string id="IDS_ADM_ACT_VIEW_RESULTS_HEADER">
- <xts:param name="action">
- <xsl:value-of select="$actionName"/>
- </xts:param>
- </xts:string>
- </xsl:variable>
- <script>
- var uiDialog = showModalDialog(ui_dialog.button.OK,_THIS_.div, '<xsl:value-of select="normalize-space($headerTitle)"/>',null , 500);
- uiDialog.processCommand = function (btnType){
- raiseReloadEvent(_THIS_);
- uiDialog.destroy();
- return true;
- };
- </script>
- </xsl:when>
- <!-- for other actions, just refresh the page -->
- <xsl:otherwise>
- <script>
- raiseReloadEvent(_THIS_);
- </script>
- </xsl:otherwise>
- </xsl:choose>
- </uic:fragment>
- </xsl:template>
- <xsl:template match="node()" priority="-1">
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- <xsl:apply-templates/>
- </xsl:copy>
- </xsl:template>
- <xsl:template match="text()" priority="-1">
- <xsl:value-of select="."/>
- </xsl:template>
- </xsl:stylesheet>
|