capabilities.xslt 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  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. xmlns:cm="http://developer.cognos.com/schemas/bibus/3/"
  21. xmlns:nav="http://developer.cognos.com/schemas/cps/navigation/1/"
  22. exclude-result-prefixes="ui uic xts xtsext admui nav cm">
  23. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
  24. <!-- Display variables -->
  25. <admui:variables/>
  26. <!-- Pager variables -->
  27. <admui:pagerVariables pagerName="capabilities"/>
  28. <xsl:variable name="displayFolderId" select="string(/root/env/param[@name='display_folder'])"/>
  29. <xsl:variable name="showEditFeatures" select="false()"/>
  30. <!-- Uncomment and delete previous line to enable tenant capability actions. -->
  31. <!--
  32. <xsl:variable name="showEditFeatures" select="key('session-param', 'e_showTenantInfo')='true'"/>
  33. -->
  34. <xsl:variable name="containerId" select="/root/nav:getContainerResponse/nav:container/nav:internalId"/>
  35. <!-- Pager templates -->
  36. <pgr:cogadminPagerTemplates/>
  37. <!-- Action templates-->
  38. <ui:commonActions/>
  39. <xsl:template match="/root">
  40. <xsl:variable name="tooltip"><xts:string id="IDS_SORT_TOOLTIP"/></xsl:variable>
  41. <uic:fragment>
  42. <!-- add the reload event listener -->
  43. <ui:standardReloadListener/>
  44. <xsl:if test="/root/updatedPath != ''">
  45. <script>
  46. var list =[];
  47. var transUpdate = {};
  48. transUpdate.name = 'capability_path';
  49. transUpdate.scope = 'page';
  50. transUpdate.value = '<xsl:value-of select="/root/updatedPath"/>';
  51. list[i] = transUpdate;
  52. _THIS_.transientUpdateList(list, true);
  53. </script>
  54. </xsl:if>
  55. <uic:fragmentHeader>
  56. <uic:pathControl>
  57. <xsl:for-each select="nav:getContainerResponse/nav:container/nav:fullPath/nav:pathStep//nav:pathStep">
  58. <uic:breadcrumb>
  59. <xsl:if test="$productLocale != $contentLocale">
  60. <xsl:attribute name="lang"><xsl:value-of select="$contentLocale"/></xsl:attribute>
  61. </xsl:if>
  62. <uic:text uic:noSpace="true">
  63. <uic:link>
  64. <uic:text><xsl:value-of select="nav:name"/></uic:text>
  65. <uic:href>#</uic:href>
  66. <uic:onclick>_THIS_.transientUpdate('capability_path', '<xsl:value-of select="nav:id"/>','page')</uic:onclick>
  67. </uic:link>
  68. </uic:text>
  69. </uic:breadcrumb>
  70. </xsl:for-each>
  71. <uic:breadcrumb>
  72. <xsl:if test="$productLocale != $contentLocale">
  73. <xsl:attribute name="lang"><xsl:value-of select="$contentLocale"/></xsl:attribute>
  74. </xsl:if>
  75. <uic:text uic:noSpace="true">
  76. <xsl:value-of select="nav:getContainerResponse/nav:container/nav:name"/>
  77. </uic:text>
  78. </uic:breadcrumb>
  79. </uic:pathControl>
  80. <uic:headerActions>
  81. <ui:groupActionMsgs/>
  82. <xsl:if test="$showEditFeatures">
  83. <ui:groupAction action="newFolder" navContainerXPath="nav:getContainerResponse/nav:container" newObjectType="capability"/>
  84. <uic:headerSeperator/>
  85. <ui:groupAction action="deleteCapability" tablename="capabilities"/>
  86. <uic:headerSeperator/>
  87. </xsl:if>
  88. <ui:groupAction action="setContainerProperties" navContainerXPath="nav:getContainerResponse/nav:container"/>
  89. </uic:headerActions>
  90. </uic:fragmentHeader>
  91. <uic:table width="100%">
  92. <uic:features>
  93. <uic:name>capabilities</uic:name>
  94. <uic:summary><xts:string id="IDS_ADM_CAPABILITIES_SUMMARY"/></uic:summary>
  95. <uic:scrollable/>
  96. <xsl:if test="$showEditFeatures">
  97. <uic:type>checkbox</uic:type>
  98. </xsl:if>
  99. <ui:tableFeatures/>
  100. </uic:features>
  101. <xsl:call-template name="pgr:cogadminPager">
  102. <xsl:with-param name="pagerName" select="$pagerName"/>
  103. <xsl:with-param name="pageStart" select="nav:getContainerResponse/nav:container/nav:content/@start"/>
  104. <xsl:with-param name="pageEnd" select="nav:getContainerResponse/nav:container/nav:content/@end"/>
  105. <xsl:with-param name="pageMax" select="nav:getContainerResponse/nav:container/nav:content/@max"/>
  106. <xsl:with-param name="pageMore" select="nav:getContainerResponse/nav:container/nav:content/@more"/>
  107. <xsl:with-param name="linesPerPage" select="$linesPerPage"/>
  108. </xsl:call-template>
  109. <uic:header>
  110. <uic:row>
  111. <uic:column nowrap="nowrap" />
  112. <uic:column width="100%" nowrap="nowrap" sort="name" iconTooltip="{$tooltip}">
  113. <uic:text>
  114. <xts:string id="IDS_HEADING_NAME"/>
  115. </uic:text>
  116. </uic:column>
  117. <uic:column nowrap="nowrap" sort="lastModifiedDate" iconTooltip="{$tooltip}">
  118. <uic:text>
  119. <xts:string id="IDS_HEADING_MODIFIED"/>
  120. </uic:text>
  121. </uic:column>
  122. </uic:row>
  123. </uic:header>
  124. <uic:body>
  125. <xsl:apply-templates select="nav:getContainerResponse/nav:container/nav:content/*"/>
  126. </uic:body>
  127. <uic:footer displayLastUpdate="true"/>
  128. </uic:table>
  129. </uic:fragment>
  130. </xsl:template>
  131. <xsl:template match="nav:item | nav:container">
  132. <uic:row value="{nav:searchPath}" label="{xtsext:htmlencode(string(nav:name))}">
  133. <xsl:if test="$productLocale != $contentLocale">
  134. <xsl:attribute name="lang"><xsl:value-of select="$contentLocale"/></xsl:attribute>
  135. </xsl:if>
  136. <uic:column nowrap="nowrap">
  137. <uic:icon>
  138. <uic:src>
  139. <admui:imageURL type="nav">
  140. <admui:image><xsl:value-of select="nav:imgURL"/></admui:image>
  141. </admui:imageURL>
  142. </uic:src>
  143. <uic:tooltip>
  144. <xsl:value-of select="nav:screenTip"/>
  145. </uic:tooltip>
  146. <xsl:if test="nav:hidden='true'">
  147. <uic:class>hiddenEntryIcon</uic:class>
  148. </xsl:if>
  149. </uic:icon>
  150. </uic:column>
  151. <uic:column nowrap="nowrap" scope="row" abbr="{xtsext:htmlencode(nav:name)}">
  152. <uic:text>
  153. <xsl:choose>
  154. <xsl:when test="(nav:hasChildren = 'true' or nav:type = 'capability') and contains(string(nav:permissions), 'traverse')">
  155. <uic:link>
  156. <uic:text>
  157. <xsl:value-of select="nav:name"/>
  158. </uic:text>
  159. <uic:href>#</uic:href>
  160. <uic:onclick>filterCapabilties(_THIS_, '<xsl:value-of select="xtsext:javascriptencode(nav:name)"/>', '<xsl:value-of select="xtsext:javascriptencode(nav:id)"/>')</uic:onclick>
  161. </uic:link>
  162. </xsl:when>
  163. <xsl:otherwise>
  164. <xsl:value-of select="nav:name"/>
  165. </xsl:otherwise>
  166. </xsl:choose>
  167. </uic:text>
  168. <!-- Render the disabled icon if this entry is disabled -->
  169. <xsl:if test="nav:icon/nav:name = 'disabled'">
  170. <uic:icon height="16" width="16" valign="middle">
  171. <uic:src>
  172. <admui:imageURL type="nav">
  173. <admui:image><xsl:value-of select="nav:icon/nav:imgURL"/></admui:image>
  174. </admui:imageURL>
  175. </uic:src>
  176. <uic:tooltip>
  177. <xsl:value-of select="nav:icon/nav:alt"/>
  178. </uic:tooltip>
  179. </uic:icon>
  180. </xsl:if>
  181. <xsl:variable name="permissions" select="nav:permissions"/>
  182. <xsl:variable name="parentPermissions" select="../../nav:permissions"/>
  183. <xsl:call-template name="ui:menuActions">
  184. <xsl:with-param name="obj-class" select="nav:type"/>
  185. <xsl:with-param name="obj-id" select="nav:internalId"/>
  186. <xsl:with-param name="obj-name" select="nav:name"/>
  187. <xsl:with-param name="obj-path" select="nav:internalId"/>
  188. <xsl:with-param name="obj-parent" select="$containerId"/>
  189. <xsl:with-param name="supportSetProperties" select="true()"/>
  190. <xsl:with-param name="supportViewPermissions" select="true()"/>
  191. <xsl:with-param name="supportMove" select="$showEditFeatures"/>
  192. <xsl:with-param name="supportCopy" select="$showEditFeatures"/>
  193. <xsl:with-param name="supportDelete" select="$showEditFeatures"/>
  194. <xsl:with-param name="canRead" select="contains($permissions, 'read')"/>
  195. <xsl:with-param name="canWrite" select="contains($permissions, 'write')"/>
  196. <xsl:with-param name="canWriteOnParent" select="contains($parentPermissions, 'write')"/>
  197. <xsl:with-param name="canExecute" select="contains($permissions, 'execute')"/>
  198. <xsl:with-param name="canTraverse" select="contains($permissions, 'traverse')"/>
  199. <xsl:with-param name="canSetPolicy" select="contains($permissions, 'setPolicy')"/>
  200. </xsl:call-template>
  201. </uic:column>
  202. <uic:column nowrap="nowrap">
  203. <uic:text>
  204. <xsl:value-of select="nav:lastModifiedDate"/>
  205. </uic:text>
  206. </uic:column>
  207. </uic:row>
  208. </xsl:template>
  209. </xsl:stylesheet>