profileAdministration.xslt 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  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:nav="http://developer.cognos.com/schemas/cps/navigation/1/"
  21. exclude-result-prefixes="ui uic xts xtsext admui nav">
  22. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
  23. <!-- display variables -->
  24. <admui:variables/>
  25. <!-- common pager variables -->
  26. <admui:pagerVariables pagerName="profileAdm"/>
  27. <!-- pager templates -->
  28. <pgr:cogadminPagerTemplates/>
  29. <!-- action templates-->
  30. <ui:commonActions/>
  31. <xsl:template match="/root/response">
  32. <xsl:variable name="isNewUIMode" select="key('env-param','mode') = 'new'"/>
  33. <xsl:variable name="tooltip"><xts:string id="IDS_SORT_TOOLTIP"/></xsl:variable>
  34. <uic:fragment>
  35. <!-- add the reload event listener -->
  36. <ui:standardReloadListener/>
  37. <uic:fragmentHeader>
  38. <uic:title><xts:string id="IDS_UIP_TITLE"/></uic:title>
  39. <uic:headerActions>
  40. <ui:groupActionMsgs/>
  41. <xsl:if test="not($isNewUIMode)">
  42. <xsl:variable name="UIPEFeatureEnabled" select="/root/advancedSettings/configuration/property[@name='COGADMIN.UIPROFILES.ENABLE_IMPORT']"/>
  43. <xsl:if test="not($UIPEFeatureEnabled='false') and count(/root/response/nav:requestResponse/nav:queryReplies/nav:queryReply/nav:getItemResponse/nav:item/*) = 0">
  44. <ui:groupAction action="importUIProfiles" tablename="profileAdm"/>
  45. </xsl:if>
  46. <ui:groupAction action="container_permissions" navContainerXPath="/root/response/nav:requestResponse/nav:queryReplies/nav:queryReply/nav:getContainerResponse/nav:container" containerLabel="IDS_UIP_TITLE"/>
  47. </xsl:if>
  48. </uic:headerActions>
  49. </uic:fragmentHeader>
  50. <uic:table width="100%">
  51. <uic:features>
  52. <uic:name>profileAdm</uic:name>
  53. <uic:summary><xts:string id="IDS_ADM_PROFILES_SUMMARY"/></uic:summary>
  54. <uic:scrollable/>
  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:requestResponse/nav:queryReplies/nav:queryReply/nav:getContainerResponse/nav:container/nav:content/@start"/>
  61. <xsl:with-param name="pageEnd" select="nav:requestResponse/nav:queryReplies/nav:queryReply/nav:getContainerResponse/nav:container/nav:content/@end"/>
  62. <xsl:with-param name="pageMax" select="nav:requestResponse/nav:queryReplies/nav:queryReply/nav:getContainerResponse/nav:container/nav:content/@max"/>
  63. <xsl:with-param name="pageMore" select="nav:requestResponse/nav:queryReplies/nav:queryReply/nav:getContainerResponse/nav:container/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 align="center" nowrap="nowrap"/>
  70. <uic:column width="100%" nowrap="nowrap" sort="name" iconTooltip="{$tooltip}">
  71. <uic:text><xts:string id="IDS_HEADING_NAME"/></uic:text>
  72. </uic:column>
  73. <uic:column nowrap="nowrap" sort="lastModifiedDate" iconTooltip="{$tooltip}">
  74. <uic:text><xts:string id="IDS_HEADING_MODIFIED"/></uic:text>
  75. </uic:column>
  76. <uic:column>
  77. <uic:text><xts:string id="IDS_UIP_HEADING_COMPONENT"/></uic:text>
  78. </uic:column>
  79. </uic:row>
  80. </uic:header>
  81. <uic:body>
  82. <xsl:variable name="defaultProfilesList" select="'|Cognos Workspace Do More|Cognos Workspace Advanced|Report Studio Professional|'"/>
  83. <xsl:for-each select="/root/response/nav:requestResponse/nav:queryReplies/nav:queryReply/nav:getContainerResponse/nav:container/nav:content/nav:item">
  84. <xsl:variable name="itemSearchPath" select="nav:searchPath"/>
  85. <xsl:variable name="containerObj" select="/root/parentResponse/nav:getContainerResponse/nav:container/nav:content/nav:container[starts-with($itemSearchPath,nav:searchPath)]"/>
  86. <uic:row groupActionList="delete" value="{concat('storeID(&quot;', string(nav:internalId), '&quot;)')}" label="{xtsext:htmlencode(string(nav:name))}">
  87. <xsl:if test="$productLocale != $contentLocale">
  88. <xsl:attribute name="lang"><xsl:value-of select="$contentLocale"/></xsl:attribute>
  89. </xsl:if>
  90. <uic:column align="center">
  91. <uic:icon>
  92. <uic:src>
  93. <xsl:value-of select="nav:imgURL"/>
  94. </uic:src>
  95. <uic:tooltip>
  96. <xsl:value-of select="nav:screenTip"/>
  97. </uic:tooltip>
  98. <xsl:if test="nav:hidden='true'">
  99. <uic:class>hiddenEntryIcon</uic:class>
  100. </xsl:if>
  101. </uic:icon>
  102. </uic:column>
  103. <uic:column nowrap="nowrap" scope="row" abbr="{xtsext:htmlencode(nav:name)}">
  104. <uic:text>
  105. <xsl:value-of select="nav:name"/>
  106. </uic:text>
  107. <!-- Render the disabled icon if this entry is disabled -->
  108. <xsl:if test="nav:icon/nav:name = 'disabled'">
  109. <uic:icon height="16" width="16" valign="middle">
  110. <uic:src>
  111. <admui:imageURL type="nav">
  112. <admui:image><xsl:value-of select="nav:icon/nav:imgURL"/></admui:image>
  113. </admui:imageURL>
  114. </uic:src>
  115. <uic:tooltip>
  116. <xsl:value-of select="nav:icon/nav:alt"/>
  117. </uic:tooltip>
  118. </uic:icon>
  119. </xsl:if>
  120. <!-- add the drop down menu -->
  121. <xsl:variable name="permissions" select="nav:permissions"/>
  122. <xsl:variable name="isDefaultProfile" select="contains($defaultProfilesList, concat('|',nav:names,'|'))"/>
  123. <xsl:variable name="isDevMode" select="/root/advancedSettings/configuration/property[@name='COGADMIN.UIPROFILES.DEVELOPER_MODE']='true'"/>
  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:internalId"/>
  129. <xsl:with-param name="obj-parent" select="$containerObj/nav:internalId"/>
  130. <xsl:with-param name="supportSetProperties" select="$isNewUIMode and ($isDevMode or not($isDefaultProfile))"/>
  131. <xsl:with-param name="supportSetPermissions" select="not($isNewUIMode) or (not($isDevMode) and $isNewUIMode and $isDefaultProfile)"/>
  132. <xsl:with-param name="supportViewPermissions" select="true()"/>
  133. <xsl:with-param name="supportCopy" select="$isNewUIMode"/>
  134. <xsl:with-param name="supportDelete" select="$isNewUIMode and ($isDevMode or not($isDefaultProfile))"/>
  135. <xsl:with-param name="supportEditUIProfile" select="$isNewUIMode and ($isDevMode or not($isDefaultProfile))"/>
  136. <xsl:with-param name="canRead" select="contains($permissions, 'read')"/>
  137. <xsl:with-param name="canWrite" select="contains($permissions, 'write')"/>
  138. <xsl:with-param name="canExecute" select="contains($permissions, 'execute')"/>
  139. <xsl:with-param name="canTraverse" select="contains($permissions, 'traverse')"/>
  140. </xsl:call-template>
  141. </uic:column>
  142. <uic:column nowrap="nowrap">
  143. <uic:text>
  144. <xsl:value-of select="nav:lastModifiedDate"/>
  145. </uic:text>
  146. </uic:column>
  147. <uic:column nowrap="nowrap">
  148. <uic:text>
  149. <xsl:choose>
  150. <xsl:when test="key('env-param','mode') = 'new'">
  151. <xsl:value-of select="$containerObj/nav:name"/>
  152. </xsl:when>
  153. <xsl:otherwise>
  154. <xsl:variable name="id" select="nav:userInterface"/>
  155. <xsl:value-of select="/root/components/nav:getItemTypesResponse/nav:items/nav:itemType[nav:id=$id]/nav:description"/>
  156. </xsl:otherwise>
  157. </xsl:choose>
  158. </uic:text>
  159. </uic:column>
  160. </uic:row>
  161. </xsl:for-each>
  162. </uic:body>
  163. <uic:footer displayLastUpdate="true" />
  164. </uic:table>
  165. </uic:fragment>
  166. </xsl:template>
  167. </xsl:stylesheet>