datasets.xslt 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  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:xsi="http://www.w3.org/2001/XMLSchema-instance"
  18. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  19. xmlns:admui="http://developer.cognos.com/schemas/xts/admui"
  20. xmlns:pgr="http://developer.cognos.com/schemas/uic/presentation/cogadminpager/"
  21. xmlns:cm="http://developer.cognos.com/schemas/bibus/3/"
  22. xmlns:nav="http://developer.cognos.com/schemas/cps/navigation/1/"
  23. xmlns:exslt="http://exslt.org/common"
  24. exclude-result-prefixes="ui uic xts xtsext admui nav cm exslt">
  25. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
  26. <xsl:key name="ownedBy" match="/root/ownedBy/*[local-name()='queryResponse']/returns/item" use="queryResult/item/searchPath/value"/>
  27. <!-- display variables -->
  28. <admui:variables/>
  29. <!-- common pager variables -->
  30. <admui:pagerVariables pagerName="datasets"/>
  31. <!-- pager templates -->
  32. <pgr:cogadminPagerTemplates/>
  33. <!-- action templates-->
  34. <ui:commonActions/>
  35. <xsl:template match="/root">
  36. <uic:fragment>
  37. <!-- add the reload event listener -->
  38. <ui:standardReloadListener/>
  39. <uic:filterInitScript filterName="datasets"/>
  40. <uic:fragmentHeader>
  41. <uic:title><xts:string id="IDS_DST_TITLE"/></uic:title>
  42. <uic:headerActions>
  43. <ui:groupActionMsgs/>
  44. <ui:groupAction action="deleteDataset" tablename="datasets"/>
  45. </uic:headerActions>
  46. </uic:fragmentHeader>
  47. <!-- display the chart at the top -->
  48. <uic:barChart/>
  49. <uic:table width="100%">
  50. <uic:features>
  51. <uic:name>datasets</uic:name>
  52. <uic:scrollable/>
  53. <uic:type>checkbox</uic:type>
  54. <uic:summary><xts:string id="IDS_DST_TABLE_SUMMARY"/></uic:summary>
  55. <ui:tableFeatures/>
  56. </uic:features>
  57. <!-- pager: entries, goto, first, previous, next, last-->
  58. <xsl:call-template name="pgr:cogadminPager">
  59. <xsl:with-param name="pagerName" select="$pagerName"/>
  60. <xsl:with-param name="pageStart" select="nav:searchResponse/nav:content/@start"/>
  61. <xsl:with-param name="pageEnd" select="nav:searchResponse/nav:content/@end"/>
  62. <xsl:with-param name="pageMax" select="nav:searchResponse/nav:content/@max"/>
  63. <xsl:with-param name="pageMore" select="nav:searchResponse/nav:content/@more"/>
  64. <xsl:with-param name="linesPerPage" select="$linesPerPage"/>
  65. </xsl:call-template>
  66. <uic:header>
  67. <uic:row>
  68. <!-- TODO: replace style with CSS class -->
  69. <uic:column nowrap="nowrap"/>
  70. <uic:column width="100%" nowrap="nowrap" sort="name">
  71. <uic:text>
  72. <xts:string id="IDS_HEADING_NAME"/>
  73. </uic:text>
  74. </uic:column>
  75. <uic:column nowrap="nowrap">
  76. <uic:text>
  77. <xts:string id="IDS_DST_HEADING_OWNED_BY"/>
  78. </uic:text>
  79. </uic:column>
  80. <uic:column nowrap="nowrap" sort="dataModificationTime">
  81. <uic:text>
  82. <xts:string id="IDS_DST_HEADING_REFRESHED"/>
  83. </uic:text>
  84. </uic:column>
  85. <uic:column nowrap="nowrap" sort="dataSetSize">
  86. <uic:text>
  87. <xts:string id="IDS_DST_HEADING_SIZE"/>
  88. </uic:text>
  89. </uic:column>
  90. <uic:column nowrap="nowrap">
  91. <uic:text>
  92. <xts:string id="IDS_DST_HEADING_ROW_COUNT"/>
  93. </uic:text>
  94. </uic:column>
  95. </uic:row>
  96. </uic:header>
  97. <uic:body>
  98. <xsl:for-each select="/root/nav:searchResponse/nav:content/nav:item">
  99. <uic:row label="{xtsext:htmlencode(string(nav:name))}">
  100. <xsl:attribute name="value">
  101. <xsl:value-of select="xtsext:urlencode(nav:internalId)"/>
  102. </xsl:attribute>
  103. <uic:column align="center" nowrap="nowrap">
  104. <uic:icon>
  105. <xsl:if test="nav:hidden='true'">
  106. <xsl:attribute name="disabled">true</xsl:attribute>
  107. </xsl:if>
  108. <uic:src>
  109. <admui:imageURL type="nav">
  110. <admui:image><xsl:value-of select="nav:imgURL"/></admui:image>
  111. </admui:imageURL>
  112. </uic:src>
  113. <uic:tooltip>
  114. <xsl:value-of select="nav:screenTip"/>
  115. </uic:tooltip>
  116. </uic:icon>
  117. </uic:column>
  118. <uic:column scope="row" abbr="{xtsext:htmlencode(nav:name)}" nowrap="nowrap">
  119. <uic:text>
  120. <xsl:value-of select="nav:name"/>
  121. </uic:text>
  122. <!-- add the drop down menu -->
  123. <xsl:variable name="permissions" select="nav:permissions"/>
  124. <xsl:call-template name="ui:menuActions">
  125. <xsl:with-param name="obj-class" select="nav:type"/>
  126. <xsl:with-param name="obj-id" select="nav:internalId"/>
  127. <xsl:with-param name="obj-name" select="nav:name"/>
  128. <xsl:with-param name="obj-path" select="nav:searchPath"/>
  129. <xsl:with-param name="obj-parent" select="nav:searchPath"/>
  130. <xsl:with-param name="priority" select="nav:priority"/>
  131. <xsl:with-param name="canRead" select="contains($permissions, 'read')"/>
  132. <xsl:with-param name="canWrite" select="contains($permissions, 'write')"/>
  133. <xsl:with-param name="canExecute" select="contains($permissions, 'execute')"/>
  134. <xsl:with-param name="canTraverse" select="contains($permissions, 'traverse')"/>
  135. </xsl:call-template>
  136. </uic:column>
  137. <uic:column nowrap="nowrap">
  138. <xsl:variable name="userInfo" select="key('ownedBy',nav:owner/nav:searchPath)/queryResult/item"/>
  139. <xsl:variable name="isDefaultNameCAMID" select="($userInfo/defaultName != '') and not(contains($userInfo/searchPath, '::Anonymous')) and contains($userInfo/searchPath, normalize-space($userInfo/defaultName))"/>
  140. <uic:text>
  141. <xsl:choose>
  142. <xsl:when test="$userInfo/userName/value != '' or ($userInfo/defaultName/value != '' and not($isDefaultNameCAMID))">
  143. <xsl:value-of select="$userInfo/defaultName/value"/>
  144. <xsl:if test="$userInfo/userName/value != ''">
  145. <xsl:value-of select="concat(' (', $userInfo/userName/value, ')')"/>
  146. </xsl:if>
  147. </xsl:when>
  148. <xsl:otherwise>
  149. <xts:string id="IDS_ADM_USER_UNAVAILABLE"/>
  150. </xsl:otherwise>
  151. </xsl:choose>
  152. </uic:text>
  153. </uic:column>
  154. <uic:column nowrap="nowrap">
  155. <uic:text>
  156. <xsl:value-of select="nav:dataModificationTime"/>
  157. </uic:text>
  158. </uic:column>
  159. <uic:column nowrap="nowrap">
  160. <uic:text>
  161. <xsl:variable name="dataSize" select="round((number(nav:dataSetSize) div 1024)+.499)"/>
  162. <xsl:value-of select="xtsext:formatNumber(string($dataSize),string('#,##0'),string($contentLocale), number(1))"/>
  163. </uic:text>
  164. </uic:column>
  165. <uic:column nowrap="nowrap">
  166. <uic:text>
  167. <xsl:variable name="rowCount" select="number(nav:specification/pdSpec/dataSet/rowCount)"/>
  168. <xsl:value-of select="xtsext:formatNumber(string($rowCount), string($contentLocale), number(2))"/>
  169. </uic:text>
  170. </uic:column>
  171. </uic:row>
  172. </xsl:for-each>
  173. </uic:body>
  174. <uic:footer displayLastUpdate="true" />
  175. </uic:table>
  176. </uic:fragment>
  177. </xsl:template>
  178. </xsl:stylesheet>