123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: cogadmin
- (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: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"/>
- <!-- display variables -->
- <admui:variables/>
- <xsl:template match="/root" priority="2">
- <uic:fragment>
- <!-- build the table for the relationships view -->
- <uic:table height="214px" width="760px" cellpadding="0" border="0" cellspacing="0">
- <uic:features>
- <uic:tablePadding>1</uic:tablePadding>
- <uic:aria-label><xts:string id="IDS_ADM_ACT_VIEW_RESULTS_HEADER"><xts:param name="action"><xsl:value-of select="key('env-param','actionLabel')"/></xts:param></xts:string></uic:aria-label>
- </uic:features>
- <uic:header>
- <uic:row>
- <uic:column/>
- <uic:column width="30%">
- <uic:text>
- <xts:string id="IDS_ADM_ACT_TABLE_HEADER_NAME"/>
- </uic:text>
- </uic:column>
- <uic:column width="30%">
- <uic:text>
- <xts:string id="IDS_ADM_ACT_TABLE_HEADER_STATUS"/>
- </uic:text>
- </uic:column>
- <uic:column width="40%">
- <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="/root/response">
- <xsl:sort select="displayInfo/wsrf-rp:GetMultipleResourcePropertiesResponse/resource-prop:Caption" lang="{/root/contentLocale}"/>
- <xsl:apply-templates select="."/>
- </xsl:for-each>
- </uic:body>
- </uic:table>
- <script>
-
- <xsl:variable name="exception" select="//actionFault//*[local-name()='exception']"/>
- <xsl:choose>
- <xsl:when test="not(/root/response/displayInfo/*[local-name()='GetMultipleResourcePropertiesResponse'])">
- <!-- Do nothing. The action doesn't require a results dialog -->
- </xsl:when>
- <xsl:when test="$exception//*[local-name()='exceptionDetail']">
- var title='<xts:string id="IDS_ADM_ACT_VIEW_ERROR_RESULTS_HEADER" encode="javascript"><xts:param name="action"><xsl:value-of select="xtsext:javascriptencode(key('env-param','actionLabel'))"/></xts:param><xts:param name="resourceId"><xsl:value-of select="xtsext:javascriptencode(/root/response/displayInfo/wsrf-rp:GetMultipleResourcePropertiesResponse/resource-prop:Caption)"/></xts:param></xts:string>';
- var msg = '<xsl:value-of select="xtsext:javascriptencode($exception/*[local-name()='exceptionMsg'])"/>';
- var errorDetails = [];
- <xsl:for-each select="set:distinct($exception//*[local-name()='exceptionDetail'])" xmlns:set="http://exslt.org/sets">
- <xsl:sort select="."/>
- errorDetails[errorDetails.length]='<xsl:value-of select="xtsext:javascriptencode(.)"/>';
- </xsl:for-each>
- var recovery =
- {
- 'recoverable':<xsl:value-of select="boolean($exception//*[local-name()='exceptionRecoverable'])"/>,
- 'msg':'<xts:string id="IDS_ADM_ACT_CONTINUE" encode="javascript"/>'
- };
- _THIS_.parent.relationshipsObj.showDetailedError(title, msg, errorDetails, recovery);
-
- </xsl:when>
- <xsl:otherwise>
- <!-- display the popup -->
- var title='<xts:string id="IDS_ADM_ACT_VIEW_RESULTS_HEADER" encode="javascript"><xts:param name="action"><xsl:value-of select="xtsext:javascriptencode(key('env-param','actionLabel'))"/></xts:param></xts:string>';
- var uiDialog = showModalDialog(ui_dialog.button.OK,_THIS_.div, title, null, 810);
- uiDialog.processCommand = function (btnType){
- raiseReloadEvent(_THIS_,'<xsl:value-of select="key('env-param','actionResourceID')"/>');
- uiDialog.destroy();
- return true;
- };
- </xsl:otherwise>
- </xsl:choose>
- </script>
- </uic:fragment>
- </xsl:template>
- <!-- build the rows for the table -->
- <xsl:template match="response">
- <xsl:variable name="jsEncodedResourceLabel" select="displayInfo/wsrf-rp:GetMultipleResourcePropertiesResponse/resource-prop:Caption"/>
- <xsl:variable name="jsEncodedIconTooltip" select="displayInfo/wsrf-rp:GetMultipleResourcePropertiesResponse/resource-prop:IconTooltip"/>
- <xsl:variable name="jsEncodedAncestors" select="displayInfo/wsrf-rp:GetMultipleResourcePropertiesResponse/resource-prop:Ancestors"/>
- <xsl:variable name="hidden" select="displayInfo/wsrf-rp:GetMultipleResourcePropertiesResponse/resource-prop:Hidden"/>
- <uic:row>
- <uic:column nowrap="nowrap">
- <uic:icon disabled="{$hidden}" tabIndex="-1">
- <uic:src>
- <admui:imageURL type="server">
- <admui:image>
- <xsl:value-of select="displayInfo/wsrf-rp:GetMultipleResourcePropertiesResponse/resource-prop:Icon"/>
- </admui:image>
- </admui:imageURL>
- </uic:src>
- <uic:tooltip>
- <xsl:choose>
- <xsl:when test="$jsEncodedIconTooltip != ''">
- <xsl:value-of select="concat($jsEncodedResourceLabel,' - ',$jsEncodedIconTooltip)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$jsEncodedResourceLabel"/>
- </xsl:otherwise>
- </xsl:choose>
- </uic:tooltip>
- </uic:icon>
- </uic:column>
- <uic:column nowrap="nowrap">
- <uic:icon valign="middle">
- <uic:src>
- <admui:imageURL image="path.gif" type="skin"/>
- </uic:src>
- <uic:tooltip>
- <xsl:value-of select="$jsEncodedAncestors"/>
- </uic:tooltip>
- </uic:icon>
- <uic:text>
- <xsl:value-of select="$jsEncodedResourceLabel"/>
- </uic:text>
- </uic:column>
- <uic:column>
- <uic:text>
- <xsl:choose>
- <xsl:when test="actionResponse/actionFault[@partialSuccess='true']">
- <xts:string id="IDS_ADM_ACT_STATUS_PARTIALLY_SUCCEEDED"/>
- </xsl:when>
- <xsl:when test="actionResponse/actionFault">
- <xts:string id="IDS_ADM_ACT_STATUS_FAILED"/>
- </xsl:when>
- <xsl:otherwise>
- <xts:string id="IDS_ADM_ACT_STATUS_SUCCEEDED"/>
- </xsl:otherwise>
- </xsl:choose>
- </uic:text>
- </uic:column>
- <uic:column>
- <uic:text>
- <xsl:apply-templates select="actionResponse/actionFault"/>
- <xsl:value-of select="actionResponse/*[local-name()='ExecuteResourceActionResponse']/*[local-name()='Details']/*[local-name()='Detail']"/>
- </uic:text>
- </uic:column>
- </uic:row>
- </xsl:template>
- <!--
- Get the appropriate fault message to display
- -->
- <xsl:template match="actionFault[.//xts:exception]">
- <!--
- XTS BUS Request error handling
- -->
- <xsl:for-each select=".//xts:exception/*[local-name()='exceptionDetail']/*[local-name()='exception']">
- <xsl:if test="@errorCode != ''">
- <xsl:value-of select="@errorCode"/>
- <xsl:text>-</xsl:text>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="@errorCodeString != ''">
- <xsl:value-of select="@errorCodeString"/>
- </xsl:when>
- <xsl:when test="./*[local-name()='message']/*[local-name()='messageString']">
- <xsl:value-of select="./*[local-name()='message']/*[local-name()='messageString']"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="./*[local-name()='message']"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- <!--
- XTS standard error handling
- TODO: investigate proper way to support standard xts error messages without appending to fault msgs already identified above
- This was initially added for trakker 562864
- -->
- <!--xsl:for-each select=".//xts:exception">
- <xsl:if test="xts:exceptionMsg">
- <xsl:value-of select="xts:exceptionMsg"/>
- </xsl:if>
- <xsl:if test="xts:exceptionStackTrace">
- <xsl:value-of select="xts:exceptionStackTrace"/>
- </xsl:if>
- </xsl:for-each-->
-
- </xsl:template>
- <!--
- Get the appropriate fault message to display
- -->
- <xsl:template match="actionFault[not (.//xts:exception) and not (//*[local-name()='deleteResponse']/@count=0)]">
- <xsl:value-of select="./*[local-name()='pingResponse']/*"/>
- </xsl:template>
- <!--
- Get the appropriate fault message to display
- -->
- <xsl:template match="actionFault[not (.//xts:exception) and (//*[local-name()='deleteResponse']/@count=0)] ">
- <xts:string id="IDS_ERR_NO_DATA"/>
- </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>
|