pagers.xsl 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: ps
  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:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
  15. xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
  16. xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
  17. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  18. xmlns:sos="http://developer.cognos.com/schemas/xts/logicsheets/xslt/sos/"
  19. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  20. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  21. xmlns:pm="http://developer.cognos.com/schemas/xts/pm"
  22. xmlns:mf="http://developer.cognos.com/schemas/xts/logicsheets/presentation/main/mf"
  23. xmlns:out="dummy-uri"
  24. exclude-result-prefixes="xts xsl cp dp cf cm mf pm sos">
  25. <xsl:output method="xml" encoding="UTF-8" indent="no"/>
  26. <xsl:namespace-alias stylesheet-prefix="out" result-prefix="xsl"/>
  27. <!-- Generate the 3 flavours of the pagers:
  28. NAVIGATE: checkbox, icon, name
  29. SEARCH: checkbox, icon, fullpath, name
  30. LAUNCH: icon, name -->
  31. <xsl:template match="sos:pagers">
  32. <cf:main-pager-section width="100%" form="pform" virtualPage="true" role="main" id="maincontent">
  33. <cf:param name="pagerSummary"><xts:string id="IDS_MAINPAGER_SUMMARY"/></cf:param>
  34. <cf:param name="item-path">cm:queryResponse/cm:queryReply[2]/*</cf:param>
  35. <cf:param name="target">concat(concat($app,'/'),$mname)</cf:param>
  36. <cf:param name="lines-per-page">
  37. <out:value-of select="$lines"/>
  38. </cf:param>
  39. <cf:param name="noGoto"><out:value-of select="$noGoto"/></cf:param>
  40. <cf:param name="navContext"><out:value-of select="$navContext"/></cf:param>
  41. <xsl:if test="string(@modes)='launch' and not(string(@type)='search')">
  42. <cf:param name="displayPath"><out:copy-of select="$displayPath"/></cf:param>
  43. </xsl:if>
  44. <cf:param name="rows">
  45. <cp:tableHeader session-name="s_so">
  46. <xsl:if test="not(string(@modes)='launch')">
  47. <cp:columnHeader width="16"/>
  48. </xsl:if>
  49. <cp:columnHeader width="20" aria-labelledby="sosItemTypeColumnHeader">
  50. <span id="sosItemTypeColumnHeader" style="position: absolute;margin-top: -9999px;margin-left: -9999px; ">Item Type</span>
  51. </cp:columnHeader>
  52. <cp:columnHeader width="100%">
  53. <xsl:if test="not(string(@noSort)='true')"><xsl:attribute name="sort">n</xsl:attribute></xsl:if>
  54. <xsl:if test="string(@modes)='search' or string(@type)='search'">
  55. <img height="5" width="1" border="0"><out:attribute name="src"><out:value-of select="$webcontent"/>/images/space.gif</out:attribute></img>
  56. <out:text/><xts:string id="IDS_PATH_INDICATOR"/><out:text>&#160;</out:text>
  57. <img height="5" width="1" border="0"><out:attribute name="src"><out:value-of select="$webcontent"/>/images/space.gif</out:attribute></img>
  58. </xsl:if>
  59. <xsl:if test="not(string(@noSort)='true')">
  60. <cp:sortHref>
  61. <out:text/>javascript:resetItem();reSort('<out:choose>
  62. <out:when test="key('session-param', 's_so') = 'na' ">nd</out:when>
  63. <out:when test="key('session-param', 's_so') = 'nd' ">sa</out:when>
  64. <out:otherwise>na</out:otherwise>
  65. </out:choose>')<out:text/>
  66. </cp:sortHref>
  67. </xsl:if>
  68. <out:variable name="sortOrderMessage">
  69. <out:choose>
  70. <out:when test="key('session-param', 's_so') = 'na' "><xts:string id="IDS_SORT_ASCENDING"/></out:when>
  71. <out:when test="key('session-param', 's_so') = 'nd' "><xts:string id="IDS_SORT_DESCENDING"/></out:when>
  72. <out:otherwise><xts:string id="IDS_SORT_NONE"/></out:otherwise>
  73. </out:choose>
  74. </out:variable>
  75. <xts:string id="IDS_NAME"/>
  76. </cp:columnHeader>
  77. </cp:tableHeader>
  78. <cp:tableContent>
  79. <xsl:if test="not(string(@modes)='launch')">
  80. <cp:columnContent>
  81. <out:choose>
  82. <out:when test="cm:radio">
  83. <out:variable name="title">
  84. <out:choose>
  85. <out:when test="cm:launch or cm:noActionLaunch">
  86. <out:choose>
  87. <out:when test="cm:launch"><out:value-of select="cm:launch/@name"/></out:when>
  88. <out:otherwise><out:value-of select="cm:noActionLaunch/@name"/></out:otherwise>
  89. </out:choose>
  90. </out:when>
  91. <out:when test="cm:drill"><out:value-of select="cm:drill/@name"/></out:when>
  92. <out:otherwise><out:value-of select="cm:defaultName"/></out:otherwise>
  93. </out:choose>
  94. </out:variable>
  95. <span style="position: absolute;margin-top: -9999px;margin-left: -9999px; " >
  96. <out:attribute name="id">selectRB_<out:value-of select="position()"/></out:attribute>
  97. <xts:string id="IDS_SELECT_RADIO_DESC"><xts:param name="name"><out:value-of select="$title"/></xts:param></xts:string>
  98. </span>
  99. <input type="radio" name="pageitem">
  100. <out:attribute name="aria-labelledBy">selectRB_<out:value-of select="position()"/></out:attribute>
  101. <out:attribute name="value"><out:value-of select="cm:storeID"/></out:attribute>
  102. <out:attribute name="id"><out:value-of select="cm:storeID"/></out:attribute>
  103. <out:if test="cm:radio/@checked">
  104. <out:attribute name="checked">checked</out:attribute>
  105. </out:if>
  106. <out:attribute name="title">
  107. <out:value-of select="xtsext:enforceBTD($title, $baseTextDirection, $productLocale, boolean($isBidiEnabled='true'))"/>
  108. </out:attribute>
  109. </input>
  110. <out:call-template name="genJSInline_setItemReturnArray">
  111. <out:with-param name="curnode" select="."/>
  112. </out:call-template>
  113. </out:when>
  114. <out:otherwise>
  115. <img height="18" width="18" hspace="1">
  116. <out:attribute name="src"><out:value-of select="$webcontent"/>/images/space.gif</out:attribute>
  117. </img>
  118. </out:otherwise>
  119. </out:choose>
  120. </cp:columnContent>
  121. </xsl:if>
  122. <cp:columnContent width="20">
  123. <out:attribute name="aria-describedby">sosItemTypeColumnHeader</out:attribute>
  124. <out:variable name="curObjEntry" select="."/>
  125. <out:variable name="overRideTooltipEntry">
  126. <out:choose>
  127. <out:when test="/root/objectClass/class[@name=string($curObjEntry/cm:objectClass)][not($curObjEntry/cm:userInterfaces) or $curObjEntry/cm:userInterfaces/@nil or @userInterface=string($curObjEntry/cm:userInterfaces/cm:uiComponentEnum)]">
  128. <out:value-of select="/root/objectClass/class[@name=string($curObjEntry/cm:objectClass)][not($curObjEntry/cm:userInterfaces) or $curObjEntry/cm:userInterfaces/@nil or @userInterface=string($curObjEntry/cm:userInterfaces/cm:uiComponentEnum)]"/>
  129. </out:when>
  130. <out:otherwise>
  131. <out:value-of select="/root/objectClass/class[@name=string($curObjEntry/cm:objectClass)]"/>
  132. </out:otherwise>
  133. </out:choose>
  134. </out:variable>
  135. <out:choose>
  136. <out:when test="cm:genIcon/@type='default'">
  137. <out:call-template name="gen-icon">
  138. <out:with-param name="userInterfaces" select="cm:userInterfaces/cm:uiComponentEnum"/>
  139. <out:with-param name="hiddenObject" select="cm:hidden"/>
  140. <out:with-param name="tooltipOverride" select="$overRideTooltipEntry"/>
  141. </out:call-template>
  142. </out:when>
  143. <out:when test="cm:genIcon/@type='myFolders'">
  144. <out:call-template name="gen-icon">
  145. <out:with-param name="class" select="'pfr'"/>
  146. </out:call-template>
  147. </out:when>
  148. <out:otherwise>
  149. <out:call-template name="gen-icon">
  150. <out:with-param name="class" select="cm:objectClass"/>
  151. <out:with-param name="isDangling" select="cm:base/@nil='true'"/>
  152. <out:with-param name="hiddenObject" select="cm:hidden"/>
  153. </out:call-template>
  154. </out:otherwise>
  155. </out:choose>
  156. </cp:columnContent>
  157. <cp:columnContent width="100%">
  158. <out:choose>
  159. <out:when test="cm:launch or cm:noActionLaunch">
  160. <xsl:if test="string(@type)='search'">
  161. <xsl:call-template name="path_gif"/>
  162. </xsl:if>
  163. <out:choose>
  164. <out:when test="cm:launch">
  165. <out:variable name="cmLaunchName">
  166. <out:value-of select="cm:launch/@name"/>
  167. </out:variable>
  168. <!-- BASED ON WO2070 -->
  169. <a href="javascript:document.returnform.submit();" onclick="launch('{'{cm:launch}'}')">
  170. <out:if test="$isBidiEnabled = 'true'">
  171. <out:attribute name="dir"><out:value-of select="xtsext:getBTD($cmLaunchName, $baseTextDirection, $productLocale)"/></out:attribute>
  172. </out:if>
  173. <out:value-of select="$cmLaunchName"/>
  174. </a>
  175. </out:when>
  176. <out:otherwise>
  177. <out:variable name="cmNoLaunchName">
  178. <out:value-of select="cm:noActionLaunch/@name"/>
  179. </out:variable>
  180. <out:text/>
  181. <out:value-of select="xtsext:enforceBTD($cmNoLaunchName, $baseTextDirection, $productLocale, boolean($isBidiEnabled='true'))"/>
  182. <out:text/>
  183. </out:otherwise>
  184. </out:choose>
  185. <xsl:if test="string(@type)!='search'">
  186. <out:if test="cm:drill">
  187. <img class="dialogNavigationIndicator" tabindex="0" role="link" onclick="resetItem();resetPager();drill('{'{cm:drill}'}','{'{cm:objectClass}'}')" src="{'{$image_root}'}action_open_package.gif">
  188. <out:attribute name="alt"><xts:string id="IDS_SELECT_VIEW_PACKAGE_AND_FOLDERS"><xts:param name="objectName"><out:value-of select="cm:drill/@name"/></xts:param></xts:string></out:attribute>
  189. </img>
  190. </out:if>
  191. </xsl:if>
  192. <out:call-template name="genJSInline_setItemReturnArray">
  193. <out:with-param name="curnode" select="."/>
  194. </out:call-template>
  195. </out:when>
  196. <!-- Only hyperlink a container if:
  197. user has traverse access to it
  198. and ( it is not the same container a "move" operation is being performed on (if we are doing a move op)
  199. or object is a signon and we're listing dataSources )
  200. -->
  201. <out:when test="cm:drill">
  202. <xsl:if test="string(@modes)='search' or string(@type)='search'">
  203. <xsl:call-template name="path_gif"/>
  204. </xsl:if>
  205. <out:variable name="cmDrillName">
  206. <out:value-of select="cm:drill/@name"/>
  207. </out:variable>
  208. <a onclick="resetItem();resetPager();drill('{'{cm:drill}'}','{'{cm:objectClass}'}')" href="#">
  209. <out:if test="$isBidiEnabled = 'true'">
  210. <out:attribute name="dir"><out:value-of select="xtsext:getBTD($cmDrillName, $baseTextDirection, $productLocale)"/></out:attribute>
  211. </out:if>
  212. <out:value-of select="$cmDrillName"/>
  213. </a>
  214. </out:when>
  215. <out:otherwise>
  216. <xsl:if test="string(@modes)='search'">
  217. <xsl:call-template name="path_gif"/>
  218. </xsl:if>
  219. <out:variable name="cmDefaultName">
  220. <out:value-of select="cm:defaultName"/>
  221. </out:variable>
  222. <out:value-of select="xtsext:enforceBTD($cmDefaultName, $baseTextDirection, $productLocale, boolean($isBidiEnabled='true'))"/>
  223. </out:otherwise>
  224. </out:choose>
  225. </cp:columnContent>
  226. </cp:tableContent>
  227. <!-- Show the "New Folder" option -->
  228. </cf:param>
  229. <cf:param name="actions">
  230. <cp:action>
  231. <out:if test="$actionNew">
  232. <a align="right" href="javascript:doNew()"><out:text/><out:value-of select="$actionNew/cm:selectionActionLink"/><out:text/></a>
  233. </out:if>
  234. </cp:action>
  235. </cf:param>
  236. </cf:main-pager-section>
  237. </xsl:template>
  238. <!-- path_gif template-->
  239. <xsl:template name="path_gif">
  240. <img width="20" height="16" align="absmiddle" src="{'{$skin_images}'}path.gif">
  241. <out:attribute name="alt">
  242. <out:choose>
  243. <out:when test="cm:fullName">
  244. <out:value-of select="cm:fullName"/>
  245. </out:when>
  246. <out:otherwise>
  247. <out:variable name="object-start-at-path">
  248. <out:if test="starts-with(cm:searchPath,'/content')">
  249. <out:value-of select="$defaultContentRoot"/>
  250. </out:if>
  251. </out:variable>
  252. <cf:do-the-path-link>
  253. <cf:param name="familytree">cm:ancestors</cf:param>
  254. <cf:param name="familymember">cm:defaultName</cf:param>
  255. <cf:param name="home"><out:value-of select="$object-start-at-path"/></cf:param>
  256. <cf:param name="onlyAncestors">true</cf:param>
  257. </cf:do-the-path-link>
  258. </out:otherwise>
  259. </out:choose>
  260. </out:attribute>
  261. </img><xsl:text>&#160;</xsl:text>
  262. </xsl:template>
  263. <!-- The main engine -->
  264. <xsl:template match="*">
  265. <xsl:copy>
  266. <xsl:copy-of select="@*"/>
  267. <xsl:apply-templates/>
  268. </xsl:copy>
  269. </xsl:template>
  270. </xsl:stylesheet>