123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335 |
- <?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:xts="http://developer.cognos.com/schemas/xts/"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:admui="http://developer.cognos.com/schemas/xts/admui"
- exclude-result-prefixes="ui uic xts xtsext admui xsi">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
- <xsl:key name="secondary-requests" match="/root/asyncRequestResponse/response/*/*[local-name()='result']/*[local-name()='secondaryRequests']/*[contains(@xsi:type,':asynchSecondaryRequest')]/*[local-name()='name']" use="."/>
- <xsl:key name="dispatchers" match="/root/*[local-name()='dispatchers']/*[local-name()='queryResponse']/*[local-name()='dispatcher']" use="*[local-name()='dispatcherID']"/>
- <!-- display variables -->
- <admui:variables/>
- <xsl:variable name="asynchDetailEventRecord" select="/root/asyncRequestResponse/response/*/result/details/*[contains(@xsi:type, ':asynchDetailEventRecord')]"/>
- <xsl:variable name="personalOnly" select="key('env-param', 'personalOnly') ='true'"/>
- <ui:runnableTemplates/>
- <!-- action templates-->
- <ui:commonActions/>
- <xsl:template match="/root">
- <uic:fragment>
- <uic:filterInitScript filterName="currentactivities"/>
- <!-- add the reload event listener, and override the default fragment.refresh -->
- <ui:standardReloadListener/>
- <ui:leavingCogadminListener/>
- <uic:fragmentHeader>
- <uic:title>
- <xsl:choose>
- <xsl:when test="$personalOnly"><xts:string id="IDS_CUR_BACKGROUND_SHORT_TITLE"/></xsl:when>
- <xsl:otherwise><xts:string id="IDS_CUR_BACKGROUND_TITLE"/></xsl:otherwise>
- </xsl:choose>
- </uic:title>
- <uic:headerActions>
- <ui:groupActionMsgs/>
- <xsl:choose>
- <xsl:when test="key('env-param', 'frag-view') = 'details'">
- <ui:groupAction action="show_details" state="details"/>
- <ui:groupAction action="hide_details" state="details"/>
- </xsl:when>
- <xsl:otherwise>
- <ui:groupAction action="show_details" state="hide"/>
- <ui:groupAction action="hide_details" state="hide"/>
- </xsl:otherwise>
- </xsl:choose>
- <uic:headerSeperator/>
- <ui:groupAction action="cancel" tablename="current_activities_background" />
- <ui:groupAction action="suspend" tablename="current_activities_background" />
- <ui:groupAction action="release" tablename="current_activities_background" />
- <ui:groupAction action="set_priority" tablename="current_activities_background" setPriorityMode="updateCurrentActivities">
- <ui:fragmentLocation>cogadmin/controls/set_priority.xts</ui:fragmentLocation>
- </ui:groupAction>
- </uic:headerActions>
- </uic:fragmentHeader>
- <script>
- <!-- create a json array of priority criteria for all the rows so that we can determine the priority of the selected entries in javascript-->
- var _THIS_entriesArray = [
- <xsl:for-each select="$asynchDetailEventRecord">
- {'priority':'<xsl:value-of select="priority"/>'}<xsl:if test="position()!=last()">,</xsl:if>
- </xsl:for-each>
- ];
- function _THIS_secondaryRequest(request) {
- params = '&secondaryRequest=' + request;
- _THIS_.retrieve(params);
- }
- </script>
- <xsl:choose>
- <xsl:when test="/root/asyncRequestResponse/status = 'working' or /root/asyncRequestResponse/status = 'stillWorking'">
- TODO
- </xsl:when>
- <xsl:otherwise>
- <!-- bulid the chart -->
- <uic:barChart/>
- <uic:table width="100%">
- <uic:features>
- <uic:name>current_activities_background</uic:name>
- <uic:summary><xts:string id="IDS_CUR_BACKGROUND_TABLE_SUMMARY"/></uic:summary>
- <uic:scrollable/>
- <uic:type>checkbox</uic:type>
- <ui:tableFeatures/>
- </uic:features>
- <uic:paginations>
- <uic:title>
- <xts:string id="IDS_PAG_ITEMS"/>
- </uic:title>
- <uic:fromLabel>
- <xts:string id="IDS_PAGER_FROM"/>
- </uic:fromLabel>
- <uic:toLabel>
- <xts:string id="IDS_PAGER_TO"/>
- </uic:toLabel>
- <uic:from><xsl:value-of select="$asynchDetailEventRecord[1]/runnable/*/position/value"/></uic:from>
- <uic:to><xsl:value-of select="$asynchDetailEventRecord[position()=last()]/runnable/*/position/value"/></uic:to>
- <uic:goto/>
- <uic:first>
- <xsl:if test="not(key('secondary-requests','firstPage'))">
- <uic:disabled>true</uic:disabled>
- </xsl:if>
- <uic:link>_THIS_secondaryRequest('firstPage');</uic:link>
- </uic:first>
- <uic:previous>
- <xsl:if test="not(key('secondary-requests','previousPage'))">
- <uic:disabled>true</uic:disabled>
- </xsl:if>
- <uic:link>_THIS_secondaryRequest('previousPage');</uic:link>
- </uic:previous>
- <uic:next>
- <xsl:if test="not(key('secondary-requests','nextPage'))">
- <uic:disabled>true</uic:disabled>
- </xsl:if>
- <uic:link>_THIS_secondaryRequest('nextPage');</uic:link>
- </uic:next>
- <uic:last>
- <xsl:if test="not(key('secondary-requests','lastPage'))">
- <uic:disabled>true</uic:disabled>
- </xsl:if>
- <uic:link>_THIS_secondaryRequest('lastPage');</uic:link>
- </uic:last>
- </uic:paginations>
- <uic:header>
- <uic:row>
- <uic:column align="center" nowrap="nowrap"/>
- <uic:column width="100%" nowrap="nowrap">
- <uic:text>
- <xts:string id="IDS_CUR_TABLE_NAME"/>
- </uic:text>
- </uic:column>
- <uic:column nowrap="nowrap" sort="startTime">
- <uic:text>
- <xts:string id="IDS_CUR_TABLE_REQUEST_TIME"/>
- </uic:text>
- </uic:column>
- <xsl:if test="not($personalOnly)">
- <uic:column nowrap="nowrap">
- <uic:text>
- <xts:string id="IDS_CUR_TABLE_RAN_BY"/>
- </uic:text>
- </uic:column>
- </xsl:if>
- <uic:column nowrap="nowrap" sort="status">
- <uic:text>
- <xts:string id="IDS_CUR_TABLE_STATUS"/>
- </uic:text>
- </uic:column>
- <uic:column nowrap="nowrap" sort="priority">
- <uic:text>
- <xts:string id="IDS_CUR_TABLE_PRIORITY"/>
- </uic:text>
- </uic:column>
- </uic:row>
- </uic:header>
- <uic:body>
- <!-- loop through the asynchDetailEventRecord -->
- <xsl:for-each select="$asynchDetailEventRecord">
- <xsl:variable name="runnable" select="*[local-name()='runnable']/*"/>
- <!-- extract the last Execution time value from the activityHistory where the paths match -->
- <xsl:variable name="lastExecutionTime" select="/root/*[local-name()='activityHistory']/*[local-name()='schedule'][*[local-name()='path']=$runnable/searchPath/value]/*[local-name()='lastExecutionTime']"/>
- <uic:row label="{$runnable/*[local-name()='defaultName']/*[local-name()='value']}">
- <xsl:attribute name="value">
- <xsl:value-of select="*[local-name()='eventID']"/>
- </xsl:attribute>
- <uic:column>
- <admui:gen-runnable-icon>
- <admui:objectClass><xsl:value-of select="$runnable/*[local-name()='objectClass']/*[local-name()='value']"/></admui:objectClass>
- <!-- todo: need to pass in the iconURI once the API supports getting it -->
- <admui:iconURI/>
- <admui:defaultName><xsl:value-of select="$runnable/defaultName/value"/></admui:defaultName>
- <admui:screenTip><xsl:value-of select="$runnable/defaultScreenTip/value"/></admui:screenTip>
- <admui:disabled><xsl:value-of select="$runnable/hidden/value"/></admui:disabled>
- </admui:gen-runnable-icon>
- </uic:column>
- <!-- name -->
- <uic:column scope="row" abbr="{xtsext:htmlencode($runnable/*[local-name()='defaultName']/*[local-name()='value'])}">
- <uic:text>
- <xsl:value-of select="$runnable/*[local-name()='defaultName']/*[local-name()='value']"/>
- </uic:text>
- <!-- show the actions menu -->
- <!-- todo: pass in the permission once they get returned in the response by MS -->
- <!-- todo: view detailed history -->
- <xsl:call-template name="ui:menuActions">
- <xsl:with-param name="obj-class" select="$runnable/*[local-name()='objectClass']/*[local-name()='value']"/>
- <xsl:with-param name="obj-id" select="$runnable/*[local-name()='storeID']/*[local-name()='value']"/>
- <xsl:with-param name="obj-name" select="$runnable/*[local-name()='defaultName']/*[local-name()='value']"/>
- <xsl:with-param name="obj-path" select="$runnable/*[local-name()='storeID']/*[local-name()='value']"/>
- <xsl:with-param name="priority" select="*[local-name()='priority']"/>
- <xsl:with-param name="supportSetPriority" select="true()"/>
- <xsl:with-param name="setPriorityMode">updateCurrentActivities</xsl:with-param>
- <xsl:with-param name="event-id" select="./history/*[contains(@xsi:type, ':history')]/eventID/value"/>
- <xsl:with-param name="supportMonitorServiceHistoryDetails" select="true()"/>
- <xsl:with-param name="status" select="*[local-name()='status']"/>
- <xsl:with-param name="supportScheduleActions" select="true()"/>
- </xsl:call-template>
- </uic:column>
- <!-- request time -->
- <uic:column nowrap="nowrap">
- <uic:text>
- <xsl:value-of select="xtsext:formatDateFromUTC( string( *[local-name()='requestedStartTime'] ), number( '2' ), number( '3' ), string( $timeZone ), string( $contentLocale ) )"/>
- </uic:text>
- </uic:column>
- <!-- scheduled by -->
- <xsl:if test="not($personalOnly)">
- <uic:column nowrap="nowrap">
- <uic:text>
- <xsl:variable name="userInfo" select="*[local-name()='user']/*[contains(@xsi:type,':account')]"/>
- <xsl:choose>
- <xsl:when test="$userInfo/*[local-name()='userName' or local-name()='defaultName']/*[local-name()='value'] != ''">
- <xsl:value-of select="$userInfo/*[local-name()='defaultName']/*[local-name()='value']"/>
- <xsl:if test="$userInfo/*[local-name()='userName']/*[local-name()='value'] != ''">
- <xsl:value-of select="concat(' (', $userInfo/*[local-name()='userName']/*[local-name()='value'], ')')"/>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <xts:string id="IDS_ADM_USER_UNAVAILABLE"/>
- </xsl:otherwise>
- </xsl:choose>
- </uic:text>
- </uic:column>
- </xsl:if>
- <!-- status -->
- <uic:column nowrap="nowrap">
- <xsl:call-template name="ui:filterStatus">
- <xsl:with-param name="filterStatus" select="*[local-name()='status']"/>
- </xsl:call-template>
- </uic:column>
- <!-- priority -->
- <uic:column>
- <uic:text><xsl:value-of select="*[local-name()='priority']"/></uic:text>
- </uic:column>
- </uic:row>
- <uic:rowDetails>
- <xsl:if test="key('env-param', 'frag-view') = 'details'">
- <xsl:attribute name="expanded">true</xsl:attribute>
- </xsl:if>
- <uic:column/>
- <uic:column colspan="1">
- <xsl:call-template name="ui:myFolderShortPath">
- <xsl:with-param name="myFolderStoreID" select="/root/session/param[@name = 'mrootid']"/>
- <xsl:with-param name="ancestors" select="$runnable/ancestors/value/*[contains(@xsi:type,':ancestorInfo')]"/>
- </xsl:call-template>
- <uic:disabledText>
- <xsl:variable name="dispID" select="normalize-space(history/*[contains(@xsi:type,':history')]/dispatcherID/value)"/>
- <xsl:if test="$dispID != '' and not($personalOnly)">
- <xsl:variable name="dispatcherPath">
- <xsl:choose>
- <xsl:when test="key('dispatchers',$dispID)">
- <xsl:value-of select="key('dispatchers',$dispID)/*[local-name()='dispatcherPath']"/>
- </xsl:when>
- <xsl:otherwise><xts:string id="IDS_ADM_DISPTACHER_UNAVAILABLE"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xts:string id="IDS_TABLE_DETAILS_DISPATCHER">
- <xts:param name="dispatcher"><xsl:value-of select="$dispatcherPath"/></xts:param>
- </xts:string>
- </xsl:if>
- <xsl:if test="processID != '' and not($personalOnly)">
- <xsl:variable name="objectClass" select="$runnable/*[local-name()='objectClass']/*[local-name()='value']"/>
- <xsl:variable name="processID">
- <xsl:choose>
- <xsl:when test="processID = 0 or processID = -1">
- <xsl:choose>
- <xsl:when test="$objectClass = 'jobDefinition'">
- <xts:string id="IDS_CUR_PROCESSID_UNAVAILABLE"/>
- </xsl:when>
- <xsl:otherwise>
- <xts:string id="IDS_CUR_PROCESSID_UNKNOWN"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="processID"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xts:string id="IDS_TABLE_DETAILS_PROCESS_ID">
- <xts:param name="processId"><xsl:value-of select="$processID"/></xts:param>
- </xts:string>
- </xsl:if>
- </uic:disabledText>
- </uic:column>
- <xsl:variable name="detailsSecondColSpan">
- <xsl:choose>
- <xsl:when test="not($personalOnly)">4</xsl:when>
- <xsl:otherwise>3</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <uic:column>
- <xsl:attribute name="colspan"><xsl:value-of select="$detailsSecondColSpan"/></xsl:attribute>
- <uic:disabledText>
- <xsl:if test="history/*[contains(@xsi:type,':history')]/actualExecutionTime/value != ''">
- <xts:string id="IDS_TABLE_DETAILS_START_TIME">
- <xts:param name="startTime"><xsl:value-of select="xtsext:formatDateFromUTC( string( history/*[contains(@xsi:type,':history')]/actualExecutionTime/value ), number( '2' ), number( '3' ), string( $timeZone ), string( $contentLocale ) )"/></xts:param>
- </xts:string>
- </xsl:if>
- <xts:string id="IDS_SCH_TABLE_LAST_EXECUTION_TIME"/><xsl:value-of select="$lastExecutionTime"/>
- </uic:disabledText>
- </uic:column>
- </uic:rowDetails>
- </xsl:for-each>
- </uic:body>
- <uic:footer displayLastUpdate="true" />
- </uic:table>
- </xsl:otherwise>
- </xsl:choose>
- </uic:fragment>
- </xsl:template>
- </xsl:stylesheet>
|