123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675 |
- <?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:ui="http://developer.cognos.com/schemas/ui/presentation/markup/"
- 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:cogadminext="xalan://com.cognos.admin.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"
- xmlns:nemo="http://developer.cognos.com/nemo"
- exclude-result-prefixes="wsrf-rp nemo resource-prop admui xtsext xsl ns1 ui uic SOAP-ENV muws2 xts">
-
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
- <xsl:key name="properties" match="/root/wsrf-rp:GetMultipleResourcePropertiesResponse/*" use="local-name()"/>
- <xsl:key name="groupIDs" match="/root/metadata/wsrf-rp:GetMultipleResourcePropertiesResponse/nemo:MetadataDescriptor/nemo:PropertiesGroups/nemo:PropertiesGroup" use="nemo:URI"/>
- <xsl:variable name="metadataDescriptor" select="/root/metadata/wsrf-rp:GetMultipleResourcePropertiesResponse/nemo:MetadataDescriptor"/>
- <xsl:key name="property-metadata" match="/root/metadata/wsrf-rp:GetMultipleResourcePropertiesResponse/nemo:MetadataDescriptor/nemo:Property" use="nemo:Name"/>
- <xsl:key name="property-metadata-by-group" match="/root/metadata/wsrf-rp:GetMultipleResourcePropertiesResponse/nemo:MetadataDescriptor/nemo:Property" use="nemo:MetricGroup"/>
- <xsl:variable name="resourceID" select="xtsext:javascriptencode(xtsext:urlencode(string(/root/resourceID)))"/>
- <!-- display variables -->
- <admui:variables/>
- <ui:commonTemplates/>
- <xsl:template match="/root">
- <uic:fragment>
- <xsl:variable name="properties" select="/root/wsrf-rp:GetMultipleResourcePropertiesResponse/*"/>
- <xsl:variable name="goodCount" select="count($properties[@Health='Good'])"/>
- <xsl:variable name="averageCount" select="count($properties[@Health='Average'])"/>
- <xsl:variable name="poorCount" select="count($properties[@Health='Poor'])"/>
- <xsl:variable name="metricsFilter">
- <xsl:choose>
- <xsl:when test="key('env-param', 'metricsFilter') != ''">
- <xsl:value-of select="key('env-param', 'metricsFilter')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="':None:Poor:Average:Good:NotApplicable::'"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <div style="padding-top:5px; padding-bottom:5px">
- <xsl:call-template name="healthSummary">
- <xsl:with-param name="poorCount" select="$poorCount"/>
- <xsl:with-param name="averageCount" select="$averageCount"/>
- <xsl:with-param name="goodCount" select="$goodCount"/>
- <xsl:with-param name="filter" select="true()"/>
- <xsl:with-param name="metricsFilter" select="$metricsFilter"/>
- </xsl:call-template>
- </div>
- <script>
- _THIS_onCadminWindowstateChange = function (evt) {
- if (evt.source != _THIS_)
- switch (evt.payload){
- case "minimized":
- _THIS_.cogadminWindowState = "extended";
- setContentTableHeight ("_THIS_","extended",2);
- break;
- case "normal":
- _THIS_.cogadminWindowState = null;
- setContentTableHeight ("_THIS_","normal",2);
- break;
- default:
- }
- return true;
- }
- regFragEvent(_THIS_,"cogadmin.fragment.windowstate.change",_THIS_onCadminWindowstateChange);
-
- _THIS_onReloadEvent = function(evt) {
- if (evt.source != _THIS_) {
- removeReloadEventListener(_THIS_, "_THIS_onReloadEvent");
- raiseReloadEvent(_THIS_, null, true);
- _THIS_retrieve();
- }
- }
- addReloadEventListener(_THIS_, "_THIS_onReloadEvent");
-
- _THIS_onWindowstateChange = function (evt) {
- var winState = evt.payload.newWindowState;
- if (winState == "normal" && _THIS_.cogadminWindowState)
- winState = _THIS_.cogadminWindowState;
-
- setContentTableHeight ("_THIS_",winState,2);
- _THIS_.raiseEvent("cogadmin.fragment.windowstate.change",evt.payload.newWindowState);
- return true;
- }
- regFragEvent(_THIS_,"fragment.windowstate.change",_THIS_onWindowstateChange);
-
- _THIS_adjustFrgSize = function (evt) {
- var winState = _THIS_.cogadminWindowState || _THIS_.windowState;
- setContentTableHeight ("_THIS_",winState,2);
- return true;
- }
- //the reason for the following line is the fragment.addEventListener won't work for fragment.resize event
- _THIS_.onresize = _THIS_adjustFrgSize;
-
- regFragEvent(_THIS_,"fragment.load",_THIS_adjustFrgSize);
-
- _THIS_.getGroupDescription = function(groupNum) {
-
- return window['g__THIS_'+groupNum+'_groupcaption'].tooltipdef.items[0].value;
- };
- </script>
- <!-- the exaggerated height for this table is a hack to avoid the flashing in firefox when navigating in Relationship -->
- <uic:table width="100%" id="_THIS_contentTable" height="2000px">
- <uic:features>
- <uic:name>table_fragment</uic:name>
- <uic:aria-label>
- <xts:transform name="XMLEncode">
- <xts:string id="IDS_ADM_MET_HEADER">
- <xts:param name="0">
- <xsl:value-of select="/root/metadata/*[local-name()='GetMultipleResourcePropertiesResponse']/*[local-name()='Caption']"/>
- </xts:param>
- </xts:string>
- </xts:transform>
- </uic:aria-label>
- <uic:scrollable y="40"/>
- <uic:gridView/>
- <uic:type>group</uic:type>
- <uic:hideTenant>true</uic:hideTenant>
- <uic:collapsed><xsl:value-of select="not(contains(key('env-param', 'expandedGroups'),'toggleHeader'))"/></uic:collapsed>
- <ui:tableFeatures/>
- </uic:features>
- <uic:header>
- <uic:row>
- <!-- TODO: replace style with CSS class -->
- <uic:column width="75%" nowrap="nowrap">
- <uic:text>
- <xts:string id="IDS_ADM_SET_TABLE_HEADER_NAME"/>
- </uic:text>
- </uic:column>
- <uic:column width="5%" align="center">
- <uic:icon>
- <uic:src>
- <admui:imageURL image="icon_streetlight.gif" type="cogadmin"/>
- </uic:src>
- <uic:tooltip>
- <xts:string id="IDS_ADM_TOP_HEALTH_TOOLTIP"/>
- </uic:tooltip>
- </uic:icon>
- </uic:column>
- <uic:column width="20%">
- <uic:text>
- <xts:string id="IDS_ADM_SET_TABLE_HEADER_VALUE"/>
- </uic:text>
- </uic:column>
- </uic:row>
- </uic:header>
- <uic:body>
- <xsl:for-each select="/root/wsrf-rp:GetMultipleResourcePropertiesResponse/*">
- <xsl:sort select="key('property-metadata', string(local-name()))/nemo:Caption" order="ascending" lang="{/root/contentLocale}"/>
- <xsl:variable name="propertyName" select="local-name()"/>
- <xsl:variable name="metadataPropertyInfo" select="key('property-metadata', string($propertyName))"/>
- <xsl:variable name="groupPosition" select="position()"/>
- <!-- if the property has a metric group, but the group URI doesn't match any of the groups in the metadata -->
- <xsl:if test="$metadataPropertyInfo/nemo:MetricGroup and not($metadataPropertyInfo[key('groupIDs',nemo:MetricGroup)])">
- <uic:row>
- <uic:column>
- <uic:text>
- <xts:string id="IDS_ADM_MET_UNKNOWN_GROUP">
- <xts:param name="group">
- <xsl:value-of select="$metadataPropertyInfo/nemo:MetricGroup"/>
- </xts:param>
- </xts:string>
- </uic:text>
- </uic:column>
- </uic:row>
- <xsl:variable name="caption">
- <xsl:choose>
- <xsl:when test="$metadataPropertyInfo/nemo:Caption != ''">
- <xsl:value-of select="$metadataPropertyInfo/nemo:Caption"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$propertyName"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:call-template name="metricRow">
- <xsl:with-param name="caption" select="$caption"/>
- <xsl:with-param name="desc" select="$metadataPropertyInfo/nemo:Description"/>
- <xsl:with-param name="name" select="$propertyName"/>
- <xsl:with-param name="value" select="."/>
- <xsl:with-param name="groupNum" select="$groupPosition"/>
- <xsl:with-param name="rowID" select="concat($groupPosition, '_unkownGroup')"/>
- <xsl:with-param name="metricsFilter" select="$metricsFilter"/>
- </xsl:call-template>
- </xsl:if>
- <xsl:if test="not($metadataPropertyInfo/nemo:MetricGroup) and starts-with(string($metadataPropertyInfo/nemo:Capability),'http://docs.oasis-open.org/wsdm/2004/12/muws/capabilities/Metrics')">
- <!-- if the property does not belong to a metric group -->
- <xsl:variable name="caption">
- <xsl:choose>
- <xsl:when test="$metadataPropertyInfo/nemo:Caption != ''">
- <xsl:value-of select="$metadataPropertyInfo/nemo:Caption"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$propertyName"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:call-template name="metricRow">
- <xsl:with-param name="caption" select="$caption"/>
- <xsl:with-param name="desc" select="$metadataPropertyInfo/nemo:Description"/>
- <xsl:with-param name="name" select="$propertyName"/>
- <xsl:with-param name="value" select="."/>
- <xsl:with-param name="groupNum" select="$groupPosition"/>
- <xsl:with-param name="rowID" select="concat($groupPosition, '_unkownGroup')"/>
- <xsl:with-param name="metricsFilter" select="$metricsFilter"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:for-each>
- <!--xsl:variable name="expandedGroups">/3/7/9</xsl:variable-->
- <!-- Process each of the possible groups -->
- <xsl:for-each select="$metadataDescriptor/nemo:PropertiesGroups/nemo:PropertiesGroup">
- <xsl:sort select="nemo:Caption" order="ascending" lang="{/root/contentLocale}"/>
- <xsl:variable name="groupID" select="nemo:URI"/>
- <xsl:variable name="groupCaption" select="nemo:Caption"/>
- <xsl:variable name="groupDesc" select="nemo:Description"/>
- <xsl:variable name="groupPosition" select="position()"/>
- <!-- handle all the properties that belong to a group -->
- <xsl:variable name="groupMetrics" select="key('property-metadata-by-group', string($groupID))[key('properties', nemo:Name)]"/>
- <xsl:for-each select="$groupMetrics">
- <xsl:sort select="nemo:Caption" order="ascending" lang="{/root/contentLocale}"/>
- <xsl:variable name="propertyPosition" select="position()"/>
- <xsl:variable name="metricGrpActions" select="/root/wsrf-rp:GetMultipleResourcePropertiesResponse/*[local-name() = 'SupportedMetricGroupActions']/*[local-name() = 'Action']"/>
- <xsl:if test="count(key('properties', $groupMetrics/nemo:Name)[contains($metricsFilter,concat(':',@Health,':'))]) > 0">
- <xsl:if test="position() = 1">
- <xsl:text disable-output-escaping="yes"><uic:group groupNum="</xsl:text><xsl:value-of select="$groupPosition"/>"<xsl:text> key="</xsl:text>
- <xsl:value-of select="$groupID"/>
- <xsl:text disable-output-escaping="yes">" collapsible="true" collapsed="</xsl:text>
- <xsl:value-of select="not(contains(key('env-param', 'expandedGroups'),$groupID))"/>
- <xsl:text disable-output-escaping="yes">"></xsl:text>
- <uic:name>
- <script>
- var g__THIS_<xsl:value-of select="$groupPosition"/>_groupcaption = new ui_tooltip(
- {
- id: '<xsl:value-of select="xtsext:javascriptencode(string($groupPosition))"/>',
- items: [
- new captionTooltipRenderer('<xts:string id="IDS_ADM_TOO_DESCRIPTION" encode="javascript"/>','<xsl:value-of select="xtsext:javascriptencode(string($groupDesc))"/>')
-
- ]
- });
- </script>
- <uic:tooltipText onmouseover="g__THIS_{$groupPosition}_groupcaption.show(event);" onmouseout="g__THIS_{$groupPosition}_groupcaption.hide(event);" onmousemove="g__THIS_{$groupPosition}_groupcaption.mousemove(event);"><xsl:value-of select="$groupCaption"/></uic:tooltipText>
- </uic:name>
- <xsl:variable name="canBeReset" select="count($groupMetrics[nemo:CanBeReset = 'true']) > 0"/>
- <xsl:if test="$canBeReset">
- <!-- loop through all the actions -->
- <xsl:for-each select="$metricGrpActions">
- <xsl:variable name="actionName" select="."/>
- <xsl:for-each select="$metadataDescriptor/nemo:Action[nemo:Name = $actionName]">
- <!-- FOR NOW, THERE SHOULD ONLY BE 1 -->
- <xsl:variable name="encodedAction" select="xtsext:javascriptencode(string(nemo:Name))"/>
- <xsl:variable name="caption">
- <xsl:choose>
- <xsl:when test="nemo:Caption != ''">
- <xsl:value-of select="nemo:Caption"/>
- </xsl:when>
- <xsl:otherwise><xsl:value-of select="resource-prop:Name"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="encodedCaption" select="xtsext:javascriptencode($caption)"/>
- <uic:icon id="{concat($groupPosition,'_groupicon')}" valign="middle" aria-labelledBy="{concat('_THIS_',$groupPosition,'_groupcaption',' ',$groupPosition,'_groupicon')}">
- <uic:src>
- <admui:imageURL>
- <admui:image><xsl:value-of select="nemo:Icon"/></admui:image>
- </admui:imageURL>
- </uic:src>
- <uic:tooltip><xsl:value-of select="$caption"/></uic:tooltip>
- <uic:onclick>var cr = new cogadmin_relationships(_THIS_, '_THIS_', null,'<xsl:value-of select="$resourceID"/>'); cr.doAction({action:'<xsl:value-of select="$encodedAction"/>',actionLabel:'<xsl:value-of select="$encodedCaption"/> [<xsl:value-of select="xtsext:javascriptencode($groupCaption)"/>]',capability:'<xsl:value-of select="xtsext:urlencode(nemo:Capability)"/>',argument:'<xsl:value-of select="xtsext:urlencode($groupID)"/>'})</uic:onclick>
- </uic:icon>
- </xsl:for-each>
- </xsl:for-each>
- </xsl:if>
- <uic:summary>
- <xsl:call-template name="healthSummary">
- <xsl:with-param name="poorCount" select="count(key('properties', $groupMetrics/nemo:Name)[@Health = 'Poor'])"/>
- <xsl:with-param name="averageCount" select="count(key('properties', $groupMetrics/nemo:Name)[@Health = 'Average'])"/>
- <xsl:with-param name="goodCount" select="count(key('properties', $groupMetrics/nemo:Name)[@Health = 'Good'])"/>
- <xsl:with-param name="groupPosition" select="$groupPosition"/>
- <xsl:with-param name="metricsFilter" select="$metricsFilter"/>
- </xsl:call-template>
- </uic:summary>
- </xsl:if>
- <xsl:variable name="caption">
- <xsl:choose>
- <xsl:when test="nemo:Caption != ''">
- <xsl:value-of select="nemo:Caption"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="nemo:Name"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:call-template name="metricRow">
- <xsl:with-param name="caption" select="$caption"/>
- <xsl:with-param name="desc" select="nemo:Description"/>
- <xsl:with-param name="name" select="nemo:Name"/>
- <xsl:with-param name="value" select="key('properties', nemo:Name)"/>
- <xsl:with-param name="groupNum" select="$groupPosition"/>
- <xsl:with-param name="rowID" select="concat($groupPosition, '_', $propertyPosition)"/>
- <xsl:with-param name="grpCaption" select="$groupCaption"/>
- <xsl:with-param name="metricsFilter" select="$metricsFilter"/>
- <xsl:with-param name="canExecuteActions" select="count($metricGrpActions) > 0"/>
- </xsl:call-template>
- <xsl:if test="position() = last()">
- <xsl:text disable-output-escaping="yes"></uic:group></xsl:text>
- </xsl:if>
- </xsl:if>
- </xsl:for-each>
- </xsl:for-each>
- </uic:body>
- <uic:footer displayLastUpdate="true" />
- </uic:table>
- <!-- this is the div that will hold the threshold fragment -->
- <div id="_THIS_thresholdcontent" style="overflow:auto; background-color: #ffffff; border: #e3e9f3 3px outset; display: none; position: absolute;"/>
- <script>
-
- var _THIS_filter = '<xsl:value-of select="$metricsFilter"/>';
-
- _THIS_onRefresh = function(evt) {
- evt.preventDefault();
- _THIS_retrieve();
- }
- regFragEvent(_THIS_,"fragment.refresh",_THIS_onRefresh);
-
- <!-- create the fragment to handle the threshold -->
- var _THIS_threshold = createFragment('_THIS_threshold', null, '<xsl:value-of select="xtsext:javascriptencode(string('/cogadmin/controls/threshold.xts'))"/>');
-
- function _THIS_openDialog(grpCaption, objCaption, name, type) {
- var params = 'thresholdGroupName='+ grpCaption +'&thresholdPropertyCaption='+ objCaption +'&thresholdPropertyName='+ name +'&thresholdResourceID=<xsl:value-of select="$resourceID"/>&propertyType='+type+'&style=dialog';
- _THIS_threshold.retrieve(params);
- }
-
- function _THIS_setFilter(health, enabled) {
- if (enabled) {
- _THIS_filter+=health;
- } else {
- _THIS_filter = _THIS_filter.replace(health,'');
- }
- _THIS_retrieve('metricsFilter='+_THIS_filter);
- }
-
- function _THIS_retrieve(params) {
- var expandedGroups = getExpandedTableGroups($('_THIS_contentTable'));
- if (expandedGroups.length > 0) {
- params=generateQueryString(params,'expandedGroups',expandedGroups);
- }
- scrollTop=$('_THIS_contentTable').scrollTop;
- params=generateQueryString(params,'scrollPos',scrollTop);
- _THIS_.retrieve(params);
- }
-
- <xsl:if test="key('env-param', 'scrollPos') != ''">
- function _THIS_afterRetrieve(evt) {
- if (evt.eventPhase == evt.AT_TARGET) {
- $('_THIS_contentTable').scrollTop = <xsl:value-of select="key('env-param', 'scrollPos')"/>;
- }
- }
- regFragEvent(_THIS_,"fragment.retrieve.after",_THIS_afterRetrieve);
- </xsl:if>
- </script>
- </uic:fragment>
- </xsl:template>
-
- <xsl:template name="metricRow">
- <xsl:param name="caption" select="''"/>
- <xsl:param name="desc" select="''"/>
- <xsl:param name="name" select="''"/>
- <xsl:param name="value" select="''"/>
- <xsl:param name="groupNum" select="''"/>
- <xsl:param name="rowID" select="''"/>
- <xsl:param name="grpCaption" select="''"/>
- <xsl:param name="metricsFilter" select="''"/>
- <xsl:param name="canExecuteActions" select="''"/>
- <xsl:variable name="lastResetAt" select="key('properties', $name)/@ResetAt"/>
- <xsl:variable name="lastUpdate" select="key('properties', $name)/@LastUpdated"/>
- <xsl:variable name="health" select="key('properties', $name)/@Health"/>
- <xsl:variable name="currentProperty" select="key('property-metadata', string($name))"/>
- <xsl:variable name="canSetThreshold" select="$canExecuteActions and ($currentProperty/nemo:CanSetThreshold = 'true')"/>
- <xsl:if test="contains($metricsFilter,concat(':',$health,':'))">
- <uic:row name="{$health}">
-
- <xsl:variable name="displayValue">
- <xsl:call-template name="updateMetricValue">
- <xsl:with-param name="value" select="$value"/>
- <xsl:with-param name="rowID" select="$rowID"/>
- <xsl:with-param name="name" select="$name"/>
- </xsl:call-template>
- </xsl:variable>
-
- <!-- build the tooltip -->
- <script>
- var g__THIS_<xsl:value-of select="$rowID"/>_caption = new ui_tooltip(
- {
- id: '<xsl:value-of select="xtsext:javascriptencode(string($rowID))"/>',
- items: [
- new captionTooltipRenderer('<xts:string id="IDS_ADM_TOO_DESCRIPTION" encode="javascript"/>','<xsl:value-of select="xtsext:javascriptencode(string($desc))"/>')
-
- ]
- });
-
- <xsl:variable name="values">
- [
- <xsl:for-each select="$value/value | $displayValue[not($value/value)]">
- '<xsl:value-of select="xtsext:javascriptencode(string(.))"/>'
- <xsl:if test="position() != last()">,</xsl:if>
- </xsl:for-each>
- ]
- </xsl:variable>
- var g__THIS_<xsl:value-of select="$rowID"/>_value = new ui_tooltip(
- {
- id: '<xsl:value-of select="xtsext:javascriptencode(string($rowID))"/>',
- expandText: '<xts:string id="IDS_ADM_EXPAND_TOOLTIP" encode="javascript"/>',
- webcontent: '<admui:imageURL type="skin"/>',
- expandStyle: 'append',
- expandIdx: 1,
- items: [
- new attrValueTooltipRenderer('<xts:string id="IDS_ADM_TOO_NAME" encode="javascript"/>','<xsl:value-of select="xtsext:javascriptencode(string($caption))"/>'),
- new attrValueTooltipRenderer('<xts:string id="IDS_ADM_TOO_VALUE" encode="javascript"/>',<xsl:value-of select="$values"/>)
- <xsl:if test="$lastResetAt != ''">
- ,new attrValueTooltipRenderer( '<xts:string id="IDS_ADM_TOO_LAST_RESET_TIME" encode="javascript"/>','<xsl:value-of select="xtsext:javascriptencode(string(xtsext:formatDateFromUTC(string($lastResetAt), number('2'), number('3'), string(/root/timezone), string(/root/contentLocale))))"/>')
- </xsl:if>
- <xsl:if test="$lastUpdate != ''">
- ,new attrValueTooltipRenderer('<xts:string id="IDS_ADM_TOO_LAST_UPDATE_TIME" encode="javascript"/>', '<xsl:value-of select="xtsext:javascriptencode(string(xtsext:formatDateFromUTC(string($lastUpdate), number('2'), number('3'), string(/root/timezone), string(/root/contentLocale))))"/>')
- </xsl:if>
- <xsl:if test="$canSetThreshold">
- ,new thresholdsTooltipRenderer('_THIS_threshTooltip','<xts:string id="IDS_ADM_THR_SCORE_CALC" encode="javascript"/>','<xsl:value-of select="$resourceID"/>','<xsl:value-of select="xtsext:javascriptencode($name)"/>', '<xsl:value-of select="xtsext:javascriptencode($value)"/>','<xsl:value-of select="xtsext:javascriptencode($currentProperty/nemo:Type)"/>',<xsl:value-of select="$health != 'NotApplicable'"/>)
- </xsl:if>
- ]
-
- });
- </script>
-
- <uic:column scope="row">
- <uic:tooltipText id="{concat($rowID,'_caption')}" onmouseover="g__THIS_{$rowID}_caption.show(event);" onmouseout="g__THIS_{$rowID}_caption.hide(event);" onmousemove="g__THIS_{$rowID}_caption.mousemove(event);">
- <xsl:value-of select="$caption"/>
- </uic:tooltipText>
- <xsl:if test="$canSetThreshold">
- <uic:icon valign="middle" aria-labelledBy="{concat('_THIS_',$groupNum,'_groupcaption',' ', $rowID,'_caption',' ',$rowID,'_icon')}" id="{concat($rowID,'_icon')}">
- <uic:src>
- <admui:imageURL image="action_edit.gif" type="common"/>
- </uic:src>
- <uic:tooltip>
- <xts:string id="IDS_ADM_THR_EDIT_DIALOG_TIP"/>
- </uic:tooltip>
- <xsl:variable name="urlEncodedGrpCaption" select="xtsext:urlencode($grpCaption)"/>
- <xsl:variable name="urlEncodedCaption" select="xtsext:urlencode($caption)"/>
- <uic:onclick>_THIS_openDialog('<xsl:value-of select="xtsext:javascriptencode(string($urlEncodedGrpCaption))"/>', '<xsl:value-of select="xtsext:javascriptencode($urlEncodedCaption)"/>', '<xsl:value-of select="xtsext:javascriptencode($name)"/>','<xsl:value-of select="xtsext:javascriptencode($currentProperty/nemo:Type)"/>');</uic:onclick>
- </uic:icon>
- </xsl:if>
- </uic:column>
- <uic:column id="{concat($rowID,'_health')}" align="left" style="padding:0px" scope="row">
- <xsl:call-template name="ui:Health">
- <xsl:with-param name="health" select="$health"/>
- <xsl:with-param name="canSetThreshold" select="$canSetThreshold"/>
- </xsl:call-template>
- </uic:column>
- <uic:column id="{concat($rowID,'_value')}" nowrap="nowrap" onmouseover="g__THIS_{$rowID}_value.show(event);" onmouseout="g__THIS_{$rowID}_value.hide(event);" onmousemove="g__THIS_{$rowID}_value.mousemove(event);">
- <uic:text>
- <xsl:value-of select="$displayValue"/>
- </uic:text>
- </uic:column>
- </uic:row>
- </xsl:if>
- </xsl:template>
-
- <xsl:template name="healthSummary">
- <xsl:param name="poorCount" select="0"/>
- <xsl:param name="averageCount" select="0"/>
- <xsl:param name="goodCount" select="0"/>
- <xsl:param name="groupPosition" select="''"/>
- <xsl:param name="metricsFilter" select="''"/>
- <xsl:param name="filter" select="false()"/>
- <table cellpadding="0" border="0" cellspacing="0" role="presentation">
- <xsl:attribute name="name">healthSummary<xsl:value-of select="$groupPosition"/></xsl:attribute>
- <xsl:attribute name="id">healthSummary<xsl:value-of select="$groupPosition"/></xsl:attribute>
- <tr>
- <xsl:if test="boolean($filter) or not($metricsFilter= 'None')">
- <xsl:if test="boolean($filter) or contains($metricsFilter,'Poor')">
- <xsl:call-template name="HealthSummaryItem">
- <xsl:with-param name="health" select="'Poor'"/>
- <xsl:with-param name="counter" select="$poorCount"/>
- <xsl:with-param name="filter" select="$filter"/>
- <xsl:with-param name="metricsFilter" select="$metricsFilter"/>
- <xsl:with-param name="filterLabel"><xts:string id="IDS_ADM_MET_FILTER_POOR_LABEL"/></xsl:with-param>
- </xsl:call-template>
- </xsl:if>
- <xsl:if test="boolean($filter) or contains($metricsFilter,'Average')">
- <xsl:call-template name="HealthSummaryItem">
- <xsl:with-param name="health" select="'Average'"/>
- <xsl:with-param name="counter" select="$averageCount"/>
- <xsl:with-param name="filter" select="$filter"/>
- <xsl:with-param name="metricsFilter" select="$metricsFilter"/>
- <xsl:with-param name="filterLabel"><xts:string id="IDS_ADM_MET_FILTER_AVERAGE_LABEL"/></xsl:with-param>
- </xsl:call-template>
- </xsl:if>
- <xsl:if test="boolean($filter) or contains($metricsFilter,'Good')">
- <xsl:call-template name="HealthSummaryItem">
- <xsl:with-param name="health" select="'Good'"/>
- <xsl:with-param name="counter" select="$goodCount"/>
- <xsl:with-param name="filter" select="$filter"/>
- <xsl:with-param name="metricsFilter" select="$metricsFilter"/>
- <xsl:with-param name="filterLabel"><xts:string id="IDS_ADM_MET_FILTER_GOOD_LABEL"/></xsl:with-param>
- </xsl:call-template>
- </xsl:if>
- <xsl:if test="boolean($filter)">
- <td nowrap="nowrap">
- <input id="_THIS_filterNotApplicable" type="checkbox" onclick="_THIS_setFilter('NotApplicable::', this.checked);">
- <xsl:if test="contains($metricsFilter,'NotApplicable')">
- <xsl:attribute name="checked"/>
- </xsl:if>
- <xsl:attribute name="title"><xts:string id="IDS_ADM_MET_FILTER_OTHER"/></xsl:attribute>
- </input>
- </td>
- <td><label for="_THIS_filterNotApplicable"><xts:string id="IDS_ADM_MET_FILTER_OTHER"/></label></td>
- </xsl:if>
- </xsl:if>
- </tr>
- </table>
- </xsl:template>
-
- <xsl:template name="HealthSummaryItem">
- <xsl:param name="health" select="''"/>
- <xsl:param name="counter" select="0"/>
- <xsl:param name="filter" select="''"/>
- <xsl:param name="metricsFilter" select="''"/>
- <xsl:param name="filterLabel" select="''"/>
- <xsl:if test="boolean($filter)">
- <td nowrap="nowrap">
- <input id="{concat('_THIS_filter',$health)}" name="{concat('_THIS_filter',$health)}" aria-label="{$filterLabel}" title="{$filterLabel}" type="checkbox" onclick="{concat('_THIS_setFilter("',$health,':",this.checked);')}">
- <xsl:if test="contains($metricsFilter,$health)">
- <xsl:attribute name="checked"/>
- </xsl:if>
- </input>
- </td>
- </xsl:if>
- <td nowrap="nowrap">
- <xsl:call-template name="ui:Health">
- <xsl:with-param name="health" select="$health"/>
- <xsl:with-param name="disabled" select="$counter = 0"/>
- </xsl:call-template>
- </td>
- <td nowrap="nowrap" style="padding-right:10px">
- <uic:text>
- <xsl:value-of select="$counter"/>
- </uic:text>
- </td>
- </xsl:template>
-
- <xsl:template name="updateMetricValue">
- <xsl:param name="value" select="''"/>
- <xsl:param name="rowID" select="''"/>
- <xsl:param name="name" select="''"/>
- <xsl:variable name="lastResetAt" select="key('properties', $name)/@ResetAt"/>
- <xsl:variable name="lastUpdate" select="key('properties', $name)/@LastUpdated"/>
- <xsl:variable name="health" select="key('properties', $name)/@Health"/>
- <xsl:variable name="currentProperty" select="key('property-metadata', string($name))"/>
- <xsl:variable name="canSetThreshold" select="$currentProperty/nemo:CanSetThreshold = 'true'"/>
- <!-- does the value need to be formated -->
-
- <xsl:variable name="displayValue">
- <xsl:choose>
- <!-- date/time -->
- <xsl:when test="$value != '' and $currentProperty/nemo:Type = 'xs:dateTime'">
- <xsl:value-of select="xtsext:formatDateFromUTC(string($value), number('2'), number('3'), string(/root/timezone), string(/root/contentLocale))"/>
- </xsl:when>
- <!-- unsignedLong -->
- <xsl:when test="$value != '' and $currentProperty/nemo:Type = 'xs:unsignedLong'">
- <xsl:value-of select="xtsext:formatNumber(string($value), string(/root/contentLocale), number('2'))"/>
- </xsl:when>
- <!-- percentage -->
- <xsl:when test="$value != '' and $currentProperty/nemo:Type = 'cdm:percentage'">
- <xsl:value-of select="cogadminext:formatPercentage(string($value), string(/root/contentLocale))"/>
- </xsl:when>
- <!-- duration -->
- <xsl:when test="$value != '' and $currentProperty/nemo:Type = 'xs:duration'">
- <xsl:value-of select="xtsext:formatDuration($value,string(/root/contentLocale),number('2'))"/>
- </xsl:when>
- <!-- Pair of values to be formatted as a ratio (x/y) -->
- <xsl:when test="$value != '' and $currentProperty/nemo:Type = 'xs:numericRatio'">
- <xsl:value-of select="xtsext:formatNumber(substring-before($value,' '),string(/root/contentLocale),number('1'))"/>
- <xsl:value-of select="string('/')"/>
- <xsl:value-of select="xtsext:formatNumber(substring-after($value,' '),string(/root/contentLocale),number('1'))"/>
- </xsl:when>
- <!-- enum -->
- <xsl:when test="$value != '' and $currentProperty/nemo:Enumeration">
- <xsl:choose>
- <xsl:when test="$currentProperty/nemo:Enumeration/nemo:Enum[@value = string($value)]">
- <xsl:value-of select="$currentProperty/nemo:Enumeration/nemo:Enum[@value = string($value)]/nemo:Caption"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$value != '' and $currentProperty/nemo:Type = 'xs:list'">
- <xsl:choose>
- <xsl:when test="count($value/value) > 1">
- <xts:string id="IDS_ADM_MET_VALUE_ABBR">
- <xts:param name="value">
- <xsl:value-of select="$value/value"/>
- </xts:param>
- </xts:string>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$value/value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:value-of select="$displayValue"/>
- </xsl:template>
-
- <xsl:template name="updateToolTip">
- <xsl:param name="rowID" select="''"/>
- <xsl:param name="lastResetAt" select="''"/>
- <xsl:param name="lastUpdate" select="''"/>
- <xsl:param name="name" select="''"/>
- <xsl:variable name="health" select="key('properties', $name)/@Health"/>
-
- var renderers = g__THIS_<xsl:value-of select="$rowID"/>_value.updateableRenderers;
- if (renderers) {
- var lrtRenderer = renderers['<xts:string id="IDS_ADM_TOO_LAST_RESET_TIME" encode="javascript"/>'];
- if (lrtRenderer) {
- lrtRenderer.update('<xsl:value-of select="xtsext:javascriptencode(string(xtsext:formatDateFromUTC(string($lastResetAt), number('2'), number('3'), string(/root/timezone), string(/root/contentLocale))))"/>');
- }
- var lutRenderer = renderers['<xts:string id="IDS_ADM_TOO_LAST_UPDATE_TIME" encode="javascript"/>'];
- if (lutRenderer) {
- lutRenderer.update('<xsl:value-of select="xtsext:javascriptencode(string(xtsext:formatDateFromUTC(string($lastUpdate), number('2'), number('3'), string(/root/timezone), string(/root/contentLocale))))"/>');
- }
- var threshRenderer = renderers['<xts:string id="IDS_ADM_THR_SCORE_CALC" encode="javascript"/>'];
- if (threshRenderer) {
- threshRenderer.update(<xsl:value-of select="$health != 'NotApplicable'"/>);
- }
- }
- </xsl:template>
-
- <xsl:template name="updateHealth">
- <xsl:param name="rowID" select="''"/>
- <xsl:param name="name" select="''"/>
- <xsl:param name="canSetThreshold" select="''"/>
- <xsl:variable name="health" select="key('properties', $name)/@Health"/>
- <xsl:variable name="healthWidget">
- <xsl:call-template name="ui:Health"><xsl:with-param name="health" select="$health"/><xsl:with-param name="canSetThreshold" select="$canSetThreshold"/></xsl:call-template>
- </xsl:variable>
- <xsl:copy-of select="$healthWidget"/>
- </xsl:template>
- </xsl:stylesheet>
|