123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387 |
- <?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:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- 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="."/>
- <!-- 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>
- <!-- add the reload event listener, and override the default fragment.refresh -->
- <ui:standardReloadListener/>
- <ui:leavingCogadminListener/>
- <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) {
- _THIS_.retrieve('secondaryRequest=' + request);
- }
- </script>
- <uic:filterInitScript filterName="upcomingactivities"/>
- <xsl:choose>
- <xsl:when test="/root/asyncRequestResponse/status = 'working' or /root/asyncRequestResponse/status = 'stillWorking'">
- TODO
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="currentDateTime">
- <xsl:choose>
- <xsl:when test="key('env-param', 'upcoming_filter_date[]') and key('env-param', 'upcoming_filter_date[]') != ''">
- <xsl:value-of select="key('env-param', 'upcoming_filter_date[]')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="xtsext:getCurrentDateTime(string($timeZone))"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <!-- Important notes:
- - Setting "" for the timezone means using GMT for the formatting
- - currentDateTime is a local date and time but GMT timezone is used for the formatting
- -->
- <xsl:variable name="currentDateDsp">
- <xsl:value-of select="xtsext:formatDateOnlyFromUTC( string( $currentDateTime ), number('3'), string(''), string( $productLocale ))"/>
- </xsl:variable>
- <xsl:variable name="currentTimeDsp">
- <xsl:value-of select="xtsext:formatDateFromUTC( string( $currentDateTime ), string('ha'), string(''), string( $productLocale ))"/>
- </xsl:variable>
- <uic:fragmentHeader>
- <uic:title><xts:string id="IDS_UAC_TITLE"/></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/>
- <xsl:if test="not(key('env-param', 'upcoming_filter_status[]')) or key('env-param', 'upcoming_filter_status[]') != 'cancelled'">
- <ui:groupAction action="cancel_upcoming" tablename="upcoming_activities" />
- </xsl:if>
- <xsl:if test="not(key('env-param', 'upcoming_filter_status[]')) or key('env-param', 'upcoming_filter_status[]') = 'scheduled'">
- <ui:groupAction action="suspend" dialog="true" tablename="upcoming_activities" setPriorityMode="updateCurrentActivities">
- <ui:fragmentLocation>cogadmin/controls/set_suspend.xts</ui:fragmentLocation>
- </ui:groupAction>
- </xsl:if>
- <xsl:if test="key('env-param', 'upcoming_filter_status[]') and key('env-param', 'upcoming_filter_status[]') = 'suspended'">
- <ui:groupAction action="release" tablename="upcoming_activities" />
- </xsl:if>
- <xsl:if test="key('env-param', 'upcoming_filter_status[]') and key('env-param', 'upcoming_filter_status[]') = 'cancelled'">
- <ui:groupAction action="schedule_upcoming" tablename="upcoming_activities" />
- </xsl:if>
- <ui:groupAction action="set_priority" tablename="upcoming_activities" setPriorityMode="updateCurrentActivities">
- <ui:fragmentLocation>cogadmin/controls/set_priority.xts</ui:fragmentLocation>
- </ui:groupAction>
- </uic:headerActions>
- </uic:fragmentHeader>
- <!-- bulid the chart -->
- <uic:barChart/>
- <uic:table>
- <uic:features>
- <uic:name>upcoming_activities</uic:name>
- <uic:scrollable/>
- <uic:type>checkbox</uic:type>
- <uic:summary><xts:string id="IDS_UAC_TABLE_SUMMARY"/></uic:summary>
- <ui:tableFeatures/>
- </uic:features>
- <uic:filterSummary>
- <!-- Day -->
- <item>
- <label><xts:string id="IDS_FLT_DAY"/></label>
- <value><xsl:value-of select="$currentDateDsp"/></value>
- </item>
- <!-- Time -->
- <xsl:if test="key('env-param','upcoming_filter_granularity[]') and key('env-param','upcoming_filter_granularity[]') = 'hour'">
- <item>
- <label><xts:string id="IDS_FLT_HOUR"/></label>
- <value><xsl:value-of select="$currentTimeDsp"/></value>
- </item>
- </xsl:if>
- <!-- Scheduled by -->
- <xsl:if test="key('env-param', 'upcoming_filter_scheduled_by[]') and key('env-param', 'upcoming_filter_scheduled_by[]') != ''">
- <item>
- <label><xts:string id="IDS_FLT_SCHEDULED"/></label>
- <value><xsl:value-of select="key('env-param', 'upcoming_filter_scheduled_by_dsp[]')"/></value>
- </item>
- </xsl:if>
- <!-- Status -->
- <item>
- <label><xts:string id="IDS_FLT_STATUS"/></label>
- <xsl:choose>
- <xsl:when test="key('env-param', 'upcoming_filter_status[]') and key('env-param', 'upcoming_filter_status[]') != ''">
- <value><xsl:value-of select="key('env-param', 'upcoming_filter_status_dsp[]')"/></value>
- </xsl:when>
- <xsl:otherwise>
- <value><xts:string id="IDS_ADM_STATUS_SCHEDULED"/></value>
- </xsl:otherwise>
- </xsl:choose>
- </item>
- <!-- Priority -->
- <xsl:if test="key('env-param', 'upcoming_filter_priority[]') and key('env-param', 'upcoming_filter_priority[]') != ''">
- <item>
- <label><xts:string id="IDS_FLT_PRIORITY"/></label>
- <value><xsl:value-of select="key('env-param', 'upcoming_filter_priority[]')"/></value>
- </item>
- </xsl:if>
- <!-- Tenant -->
- <xsl:if test="key('env-param', 'upcoming_filter_tenantid[]') and key('env-param', 'upcoming_filter_tenantid[]') != ''">
- <item>
- <label><xts:string id="IDS_FLT_TENANT"/></label>
- <value><xsl:value-of select="key('env-param', 'upcoming_filter_tenantidName[]')"/></value>
- </item>
- </xsl:if>
- <!-- Owned by -->
- <xsl:if test="key('env-param', 'upcoming_filter_owned_by[]') and key('env-param', 'upcoming_filter_owned_by[]') != ''">
- <item>
- <label><xts:string id="IDS_FLT_OWNED_BY3"/></label>
- <value><xsl:value-of select="key('env-param', 'upcoming_filter_owned_by_dsp[]')"/></value>
- </item>
- </xsl:if>
- <!-- Type -->
- <xsl:if test="key('env-param', 'upcoming_filter_type[]') and key('env-param', 'upcoming_filter_type[]') != ''">
- <item>
- <label><xts:string id="IDS_FLT_TYPE"/></label>
- <value><xsl:value-of select="key('env-param', 'upcoming_filter_type_dsp[]')"/></value>
- </item>
- </xsl:if>
- <!-- Scope -->
- <xsl:if test="key('env-param', 'upcoming_filter_scope[]') and key('env-param', 'upcoming_filter_scope[]') != ''">
- <item>
- <label><xts:string id="IDS_FLT_SCOPE"/></label>
- <value><xsl:value-of select="key('env-param', 'upcoming_filter_scope_dsp[]')"/></value>
- </item>
- </xsl:if>
- </uic:filterSummary>
- <uic:paginations>
- <uic:title>
- <xts:string id="IDS_PAG_ITEMS"/>
- </uic:title>
- <uic:fromLabel><xts:string id="IDS_PAGER_FROM"/></uic:fromLabel>
- <uic:from><xsl:value-of select="$asynchDetailEventRecord[1]/runnable/*/position/value"/></uic:from>
- <uic:toLabel><xts:string id="IDS_PAGER_TO"/></uic:toLabel>
- <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>
- <xsl:variable name="sortTooltip"><xts:string id="IDS_SORT_TOOLTIP"/></xsl:variable>
- <uic:header>
- <uic:row>
- <uic:column align="center" nowrap="nowrap"/>
- <uic:column width="100%">
- <uic:text>
- <xts:string id="IDS_UAC_TABLE_NAME"/>
- </uic:text>
- </uic:column>
- <uic:column nowrap="nowrap" sort="startTime" iconTooltip="{$sortTooltip}">
- <uic:text>
- <xsl:choose>
- <xsl:when test="key('env-param', 'upcoming_filter_status') = 'suspended'">
- <xts:string id="IDS_UAC_TABLE_ORIGINAL_REQUEST_TIME"/>
- </xsl:when>
- <xsl:otherwise>
- <xts:string id="IDS_UAC_TABLE_REQUEST_TIME"/>
- </xsl:otherwise>
- </xsl:choose>
- </uic:text>
- </uic:column>
- <xsl:if test="not($personalOnly)">
- <uic:column nowrap="nowrap">
- <uic:text>
- <xts:string id="IDS_UAC_TABLE_SCHEDULED_BY"/>
- </uic:text>
- </uic:column>
- </xsl:if>
- <uic:column nowrap="nowrap" sort="priority" iconTooltip="{$sortTooltip}">
- <uic:text>
- <xts:string id="IDS_UAC_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="{xtsext:htmlencode($runnable/*[local-name()='defaultName']))}">
- <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'])}">
- <uic:text>
- <xsl:value-of select="$runnable/*[local-name()='defaultName']"/>
- </uic:text>
- <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="status" select="*[local-name()='status']"/>
- <xsl:with-param name="priority" select="*[local-name()='priority']"/>
- <xsl:with-param name="setPriorityMode">updateCurrentActivities</xsl:with-param>
- <xsl:with-param name="event-id" select="*[local-name()='eventID']"/>
- <xsl:with-param name="supportSetPriority" select="true()"/>
- <xsl:with-param name="supportSetProperties" select="false()"/>
- <xsl:with-param name="supportCancelUpcoming" select="true()"/>
- <xsl:with-param name="supportScheduleUpcoming" select="true()"/>
- <xsl:with-param name="supportSuspendUpcoming" select="true()"/>
- </xsl:call-template>
- </uic:column>
- <!-- request time -->
- <uic:column nowrap="nowrap">
- <uic:text>
- <xsl:variable name="scheduledStartTime" select="xtsext:formatDateFromUTC(string(*[local-name()='scheduledStartTime']), number( '2' ), number( '3' ), string( $timeZone ), string( $contentLocale ) )"/>
- <xsl:variable name="requestedStartTime" select="xtsext:formatDateFromUTC(string(*[local-name()='requestedStartTime']), number( '2' ), number( '3' ), string( $timeZone ), string( $contentLocale ) )"/>
- <xsl:choose>
- <xsl:when test="key('env-param', 'upcoming_filter_status') = 'suspended'">
- <xsl:value-of select="$scheduledStartTime"/>
- </xsl:when>
- <xsl:otherwise>
- <span>
- <xsl:value-of select="$requestedStartTime"/>
- <xsl:if test="not($scheduledStartTime = $requestedStartTime)">
- <xsl:variable name="scheduledStartTimeMsg">
- <xts:string id="IDS_UAC_TABLE_ORIGINAL_REQUEST_TIME_TIP">
- <xts:param name="origTime"><xsl:value-of select="$scheduledStartTime"/></xts:param>
- </xts:string>
- </xsl:variable>
- <img style="vertical-align:middle" alt="{normalize-space($scheduledStartTimeMsg)}" title="{normalize-space($scheduledStartTimeMsg)}" src="{$webRoot}/ps/portal/images/msg_information_8.gif"/>
- </xsl:if>
- </span>
- </xsl:otherwise>
- </xsl:choose>
- </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>
- <!-- 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:column>
- <uic:column colspan="4">
- <uic:disabledText>
- <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>
|