activities_current_interactive.xslt 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: cogadmin
  5. (C) Copyright IBM Corp. 2005, 2014
  6. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. -->
  8. <!--
  9. Copyright (C) 2008 Cognos ULC, an IBM Company. All rights reserved.
  10. Cognos (R) is a trademark of Cognos ULC, (formerly Cognos Incorporated).
  11. -->
  12. <xsl:stylesheet version="1.0"
  13. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  14. xmlns:ui="http://developer.cognos.com/schemas/ui/presentation/markup/"
  15. xmlns:uic="http://developer.cognos.com/schemas/uic/presentation/markup/"
  16. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  17. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  18. xmlns:admui="http://developer.cognos.com/schemas/xts/admui"
  19. xmlns:pgr="http://developer.cognos.com/schemas/uic/presentation/cogadminpager/"
  20. exclude-result-prefixes="ui uic xts xtsext admui">
  21. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
  22. <!-- display variables -->
  23. <admui:variables/>
  24. <!-- common pager variables -->
  25. <admui:pagerVariables pagerName="current_interactive"/>
  26. <!-- templates -->
  27. <pgr:cogadminPagerTemplates/>
  28. <ui:runnableTemplates/>
  29. <!-- action templates-->
  30. <ui:commonActions/>
  31. <xsl:template match="/root">
  32. <uic:fragment>
  33. <!-- add the reload event listener, and override the default fragment.refresh -->
  34. <ui:standardReloadListener/>
  35. <uic:fragmentHeader>
  36. <uic:title><xts:string id="IDS_CUR_INTERACTIVE_TITLE"/></uic:title>
  37. <uic:headerActions>
  38. <ui:groupActionMsgs/>
  39. <xsl:choose>
  40. <xsl:when test="key('env-param', 'frag-view') = 'details'">
  41. <ui:groupAction action="show_details" state="details"/>
  42. <ui:groupAction action="hide_details" state="details"/>
  43. </xsl:when>
  44. <xsl:otherwise>
  45. <ui:groupAction action="show_details" state="hide"/>
  46. <ui:groupAction action="hide_details" state="hide"/>
  47. </xsl:otherwise>
  48. </xsl:choose>
  49. <uic:headerSeperator/>
  50. <ui:groupAction action="cancel_interactive" tablename="current_interactive"/>
  51. </uic:headerActions>
  52. </uic:fragmentHeader>
  53. <script>
  54. var entriesArray = new Array(
  55. <xsl:for-each select="/root/response/*[local-name() = 'GetInteractiveActivitiesResponse']/*[local-name() = 'Activity']">
  56. <xsl:variable name="repName">
  57. <xsl:choose>
  58. <xsl:when test="*[local-name() = 'Property' and @name='RequestDefaultName'] != ''">
  59. <xsl:value-of select="*[local-name() = 'Property' and @name='RequestDefaultName']"/>
  60. </xsl:when>
  61. <xsl:otherwise><xts:string id="IDS_CUR_TABLE_NAME_NEW"/></xsl:otherwise>
  62. </xsl:choose>
  63. </xsl:variable>
  64. new Array('<xsl:value-of select="xtsext:javascriptencode(*[local-name() = 'Property' and @name='RequestID'])"/>', '<xsl:value-of select="xtsext:javascriptencode(*[local-name() = 'Property' and @name='DispatcherName'])"/>', '<xsl:value-of select="xtsext:javascriptencode($repName)"/>')
  65. <xsl:if test="position()!=last()">,</xsl:if>
  66. </xsl:for-each>
  67. );
  68. </script>
  69. <uic:filterInitScript filterName="currentactivities"/>
  70. <!-- display the chart at the top -->
  71. <uic:barChart/>
  72. <uic:table width="100%">
  73. <uic:features>
  74. <uic:name>current_interactive</uic:name>
  75. <uic:summary><xts:string id="IDS_CUR_INTERACTIVE_TABLE_SUMMARY"/></uic:summary>
  76. <uic:scrollable/>
  77. <uic:type>checkbox</uic:type>
  78. <ui:tableFeatures/>
  79. </uic:features>
  80. <!-- pager: entries, goto, first, previous, next, last-->
  81. <xsl:call-template name="pgr:cogadminPager">
  82. <xsl:with-param name="pagerName" select="$pagerName"/>
  83. <xsl:with-param name="pageStart" select="/root/response/*[local-name() = 'GetInteractiveActivitiesResponse']/*[local-name() = 'PageInfo']/*[local-name() = 'PageProperty' and @name ='start']"/>
  84. <xsl:with-param name="pageEnd" select="/root/response/*[local-name() = 'GetInteractiveActivitiesResponse']/*[local-name() = 'PageInfo']/*[local-name() = 'PageProperty' and @name = 'end']"/>
  85. <xsl:with-param name="pageMax" select="/root/response/*[local-name() = 'GetInteractiveActivitiesResponse']/*[local-name() = 'PageInfo']/*[local-name() = 'PageProperty' and @name = 'maxObjects']"/>
  86. <xsl:with-param name="pageMore" select="/root/response/*[local-name() = 'GetInteractiveActivitiesResponse']/*[local-name() = 'PageInfo']/*[local-name() = 'PageProperty' and @name = 'more']"/>
  87. <xsl:with-param name="linesPerPage" select="$linesPerPage"/>
  88. </xsl:call-template>
  89. <uic:header>
  90. <uic:row>
  91. <!-- TODO: replace style with CSS class -->
  92. <uic:column nowrap="nowrap"/>
  93. <uic:column width="100%" nowrap="nowrap">
  94. <uic:text>
  95. <xts:string id="IDS_CUR_TABLE_NAME"/>
  96. </uic:text>
  97. </uic:column>
  98. <uic:column nowrap="nowrap" sort="RequestTime">
  99. <uic:text>
  100. <xts:string id="IDS_CUR_TABLE_REQUEST_TIME"/>
  101. </uic:text>
  102. </uic:column>
  103. <uic:column nowrap="nowrap">
  104. <uic:text>
  105. <xts:string id="IDS_CUR_TABLE_RAN_BY"/>
  106. </uic:text>
  107. </uic:column>
  108. <uic:column nowrap="nowrap" sort="Status">
  109. <uic:text>
  110. <xts:string id="IDS_CUR_TABLE_STATUS"/>
  111. </uic:text>
  112. </uic:column>
  113. </uic:row>
  114. </uic:header>
  115. <uic:body>
  116. <xsl:for-each select="/root/response/*[local-name() = 'GetInteractiveActivitiesResponse']/*[local-name() = 'Activity']">
  117. <xsl:variable name="repName">
  118. <xsl:choose>
  119. <xsl:when test="*[local-name() = 'Property' and @name='RequestDefaultName'] != ''">
  120. <xsl:value-of select="*[local-name() = 'Property' and @name='RequestDefaultName']"/>
  121. </xsl:when>
  122. <xsl:otherwise><xts:string id="IDS_CUR_TABLE_NAME_NEW"/></xsl:otherwise>
  123. </xsl:choose>
  124. </xsl:variable>
  125. <xsl:variable name="isHidden">
  126. <xsl:value-of select="*[local-name() = 'Property' and @name='hidden']"/>
  127. </xsl:variable>
  128. <xsl:variable name="activityStatus" select="*[local-name() = 'Property' and @name='Status']"/>
  129. <xsl:variable name="processId" select="*[local-name() = 'Property' and @name='ProcessID']"/>
  130. <uic:row label="{xtsext:htmlencode($repName)}">
  131. <uic:column align="center">
  132. <admui:gen-runnable-icon>
  133. <admui:objectClass><xsl:value-of select="*[local-name() = 'Property' and @name='ObjectClass']"/></admui:objectClass>
  134. <admui:defaultName><xsl:value-of select="$repName"/></admui:defaultName>
  135. <admui:screenTip><xsl:value-of select="*[local-name() = 'Property' and @name='ScreenTip']"/></admui:screenTip>
  136. <admui:disabled><xsl:value-of select="$isHidden"/></admui:disabled>
  137. </admui:gen-runnable-icon>
  138. </uic:column>
  139. <uic:column scope="row" abbr="{xtsext:htmlencode($repName)}">
  140. <xsl:variable name="supportGetProp">
  141. <xsl:choose>
  142. <xsl:when test="*[local-name() = 'Property' and @name='StoreID'] != ''">true</xsl:when>
  143. <xsl:otherwise>false</xsl:otherwise>
  144. </xsl:choose>
  145. </xsl:variable>
  146. <uic:text>
  147. <xsl:value-of select="$repName"/>
  148. </uic:text>
  149. <!-- show the actions menu: set properties, cancel -->
  150. <xsl:call-template name="ui:menuActions">
  151. <xsl:with-param name="obj-class" select="*[local-name() = 'Property' and @name='ObjectClass']"/>
  152. <xsl:with-param name="obj-id" select="*[local-name() = 'Property' and @name='StoreID']"/>
  153. <xsl:with-param name="obj-name" select="$repName"/>
  154. <xsl:with-param name="obj-path" select="*[local-name() = 'Property' and @name='StoreID']"/>
  155. <xsl:with-param name="req-id" select="*[local-name() = 'Property' and @name='RequestID']"/>
  156. <xsl:with-param name="disp-name" select="*[local-name() = 'Property' and @name='DispatcherName']"/>
  157. <xsl:with-param name="supportSetProperties" select="$supportGetProp"/>
  158. <xsl:with-param name="supportCancelInteractiveActivities" select="true()"/>
  159. </xsl:call-template>
  160. </uic:column>
  161. <uic:column nowrap="nowrap">
  162. <uic:text>
  163. <xsl:value-of select="xtsext:formatDateFromUTC( string(*[local-name() = 'Property' and @name='RequestTime'] ), number( '2' ), number( '3' ), string( $timeZone ), string( $contentLocale ) )"/>
  164. </uic:text>
  165. </uic:column>
  166. <uic:column nowrap="nowrap">
  167. <uic:text>
  168. <xsl:choose>
  169. <xsl:when test="(*[local-name() = 'Property' and @name='UserID'] != '') or (*[local-name() = 'Property' and @name='UserName'] != '')">
  170. <xsl:value-of select="*[local-name() = 'Property' and @name='UserName']"/>
  171. <xsl:if test="*[local-name() = 'Property' and @name='UserID'] != ''">
  172. <xsl:value-of select="concat(' (', *[local-name() = 'Property' and @name='UserID'], ')')"/>
  173. </xsl:if>
  174. </xsl:when>
  175. <xsl:otherwise>
  176. <xts:string id="IDS_ADM_USER_UNAVAILABLE"/>
  177. </xsl:otherwise>
  178. </xsl:choose>
  179. </uic:text>
  180. </uic:column>
  181. <uic:column nowrap="nowrap">
  182. <xsl:call-template name="ui:filterStatus">
  183. <xsl:with-param name="filterStatus" select="*[local-name() = 'Property' and @name='Status']"/>
  184. </xsl:call-template>
  185. </uic:column>
  186. </uic:row>
  187. <uic:rowDetails>
  188. <xsl:if test="key('env-param', 'frag-view') = 'details'">
  189. <xsl:attribute name="expanded">true</xsl:attribute>
  190. </xsl:if>
  191. <uic:column/>
  192. <uic:column colspan="5">
  193. <uic:disabledText>
  194. <xts:string id="IDS_TABLE_DETAILS_DISPATCHER">
  195. <xts:param name="dispatcher"><xsl:value-of select="*[local-name() = 'Property' and @name='DispatcherName']"/></xts:param>
  196. </xts:string>
  197. <!--
  198. Ignore the processId for pending state
  199. -->
  200. <xsl:if test="$activityStatus = 'running' and $processId != ''">
  201. <xts:string id="IDS_TABLE_DETAILS_PROCESS_ID">
  202. <xts:param name="processId"><xsl:value-of select="*[local-name() = 'Property' and @name='ProcessID']"/></xts:param>
  203. </xts:string>
  204. </xsl:if>
  205. <xts:string id="IDS_TABLE_DETAILS_START_TIME">
  206. <xts:param name="startTime"><xsl:value-of select="xtsext:formatDateFromUTC( string(*[local-name() = 'Property' and @name='StartTime'] ), number( '2' ), number( '3' ), string( $timeZone ), string( $contentLocale ) )"/></xts:param>
  207. </xts:string>
  208. </uic:disabledText>
  209. </uic:column>
  210. </uic:rowDetails>
  211. </xsl:for-each>
  212. </uic:body>
  213. <uic:footer displayLastUpdate="true" />
  214. </uic:table>
  215. </uic:fragment>
  216. </xsl:template>
  217. </xsl:stylesheet>