pagers.xsl 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805
  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:aep="http://developer.cognos.com/schemas/xts/portal/addEntries/logicsheets/pagers/"
  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:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
  19. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  20. xmlns:nav="http://developer.cognos.com/schemas/cps/navigation/1/"
  21. xmlns:out="dummy-uri"
  22. exclude-result-prefixes="xts xsl aep cp dp cf cm ">
  23. <xsl:output method="xml" encoding="UTF-8" indent="no"/>
  24. <xsl:namespace-alias stylesheet-prefix="out" result-prefix="xsl"/>
  25. <!-- navigation pager (left side of page) -->
  26. <xsl:template match="aep:navigatePager">
  27. <out:variable name="currentNavigation">
  28. <out:choose>
  29. <out:when test="contains(key('request-param','requestState'),'|')">
  30. <out:value-of select="substring-before(key('request-param','requestState'),'|')"/>
  31. </out:when>
  32. <out:otherwise>
  33. <out:value-of select="key('request-param','requestState')"/>
  34. </out:otherwise>
  35. </out:choose>
  36. </out:variable>
  37. <out:choose>
  38. <out:when test="key('request-param','addEntriesUI')='portlet' and /root/*[local-name()='response']/*[local-name()='content']/*[local-name()='queryResponse']/*[local-name()='queryReply'][1]/*/*[local-name()='objectClass']='portlet'">
  39. <cf:main-pager-section name="navpager" form="pform" virtualPage="true" width="100%">
  40. <cf:param name="label">
  41. <out:if test="key('request-param','requestState') = 'search'">
  42. <xts:string id="IDS_ADDENTRIES_SEARCH_RESULTS"/>
  43. </out:if>
  44. </cf:param>
  45. <cf:param name="pagerSummary"><xts:string id="IDS_ADDENTRIES_AVAILABLE_ENTRIES"/></cf:param>
  46. <cf:param name="item-path">/root/*[local-name()='response']/*[local-name()='content']/cm:queryResponse/cm:queryReply[position()='1']/*</cf:param>
  47. <cf:param name="target">key('request-param','defaultTarget')</cf:param>
  48. <cf:param name="lines-per-page">
  49. <out:choose>
  50. <out:when test="key('session-param','linesPerPage')!=''">
  51. <out:value-of select="key('session-param','linesPerPage')"/>
  52. </out:when>
  53. <out:otherwise>
  54. <out:value-of select="/root/system/param[@name='defaultPortalPreferences']/pref[@name='lines']"/>
  55. </out:otherwise>
  56. </out:choose>
  57. </cf:param>
  58. <cf:param name="rows">
  59. <cp:tableHeader>
  60. <xsl:call-template name="navigatePagerColumns"/>
  61. <cp:columnHeader><xts:string id="IDS_HEADING_ACTIONS"/></cp:columnHeader>
  62. </cp:tableHeader>
  63. <cp:tableContent>
  64. <xsl:call-template name="navigatePagerContent">
  65. <xsl:with-param name="isPortlet" select="true()"/>
  66. </xsl:call-template>
  67. </cp:tableContent>
  68. </cf:param>
  69. </cf:main-pager-section>
  70. </out:when>
  71. <out:when test="$currentNavigation='search' and $allowedBurgandySearch and (key('env-param','search_find')='b' or key('env-param','search_find')='') ">
  72. <cf:main-pager-section name="navpager" navContent="true" form="pform" virtualPage="true" width="100%">
  73. <cf:param name="noGoto">false</cf:param>
  74. <cf:param name="navContext"><out:value-of select="{'/root/navContent/nav:searchResponse/nav:context'}"/></cf:param>
  75. <cf:param name="label">
  76. <out:if test="key('request-param','requestState') = 'search'">
  77. <xts:string id="IDS_ADDENTRIES_SEARCH_RESULTS"/>
  78. </out:if>
  79. </cf:param>
  80. <cf:param name="pagerSummary"><xts:string id="IDS_ADDENTRIES_AVAILABLE_ENTRIES"/></cf:param>
  81. <cf:param name="item-path">/root/*[local-name()='navContent']/nav:searchResponse/nav:content/*</cf:param>
  82. <cf:param name="target">key('request-param','defaultTarget')</cf:param>
  83. <cf:param name="lines-per-page">
  84. <out:choose>
  85. <out:when test="key('session-param','linesPerPage')!=''">
  86. <out:value-of select="key('session-param','linesPerPage')"/>
  87. </out:when>
  88. <out:otherwise>
  89. <out:value-of select="/root/system/param[@name='defaultPortalPreferences']/pref[@name='lines']"/>
  90. </out:otherwise>
  91. </out:choose>
  92. </cf:param>
  93. <cf:param name="rows">
  94. <cp:tableHeader>
  95. <xsl:call-template name="navigatePagerColumns"/>
  96. </cp:tableHeader>
  97. <cp:tableContent>
  98. <xsl:call-template name="navigateIndexPagerContent"/>
  99. </cp:tableContent>
  100. </cf:param>
  101. </cf:main-pager-section>
  102. </out:when>
  103. <out:otherwise>
  104. <cf:main-pager-section name="navpager" form="pform" virtualPage="true" width="100%">
  105. <cf:param name="label">
  106. <out:if test="key('request-param','requestState') = 'search'">
  107. <xts:string id="IDS_ADDENTRIES_SEARCH_RESULTS"/>
  108. </out:if>
  109. </cf:param>
  110. <cf:param name="pagerSummary"><xts:string id="IDS_ADDENTRIES_AVAILABLE_ENTRIES"/></cf:param>
  111. <cf:param name="item-path">/root/*[local-name()='response']/*[local-name()='content']/cm:queryResponse/cm:queryReply[position()='1']/*</cf:param>
  112. <cf:param name="target">key('request-param','defaultTarget')</cf:param>
  113. <cf:param name="lines-per-page">
  114. <out:choose>
  115. <out:when test="key('session-param','linesPerPage')!=''">
  116. <out:value-of select="key('session-param','linesPerPage')"/>
  117. </out:when>
  118. <out:otherwise>
  119. <out:value-of select="/root/system/param[@name='defaultPortalPreferences']/pref[@name='lines']"/>
  120. </out:otherwise>
  121. </out:choose>
  122. </cf:param>
  123. <cf:param name="rows">
  124. <cp:tableHeader>
  125. <xsl:call-template name="navigatePagerColumns"/>
  126. </cp:tableHeader>
  127. <cp:tableContent>
  128. <xsl:call-template name="navigatePagerContent"/>
  129. </cp:tableContent>
  130. </cf:param>
  131. </cf:main-pager-section>
  132. </out:otherwise>
  133. </out:choose>
  134. </xsl:template>
  135. <!-- Standard content for navigation pager -->
  136. <xsl:template name="navigateIndexPagerContent">
  137. <cp:columnContent>
  138. <out:variable name="isRoot" select='/root/*[local-name()="containerInfo"]/*[local-name()="queryResponse"]/*[local-name()="queryReply"]/*[local-name()="root"]'/>
  139. <out:variable name="isRootSelectable" select='key("request-param","selectableRootObjects")="true"'/>
  140. <out:choose>
  141. <out:when test='(contains($selectable-classes, concat("&apos;",cm:objectClass,"&apos;")) or ($isRootSelectable and $isRoot)) and not(not($isRootSelectable) and $isRoot)'>
  142. <input type="checkbox" name="nav_checkbox" value="{'{nav:searchPath}'}"/>
  143. </out:when>
  144. <out:otherwise>
  145. <out:text>&#160;</out:text>
  146. </out:otherwise>
  147. </out:choose>
  148. </cp:columnContent>
  149. <cp:columnContent>
  150. <out:variable name="overrideObjectClass">
  151. <out:choose>
  152. <out:when test="nav:type='folder' and (key('env-param','select_path')='/' or (not(key('env-param','select_path')) and key('request-param','defaultSearchPath')='/'))">pfr</out:when>
  153. <out:when test="nav:type='namespace' and (key('request-param','addEntriesUI')='packagesAndLocations' or key('request-param','addEntriesUI')='indexUpdateLocations')">pfr</out:when>
  154. <out:otherwise><out:value-of select="nav:type"/></out:otherwise>
  155. </out:choose>
  156. </out:variable>
  157. <out:variable name="defaultAction" select="nav:defaultAction/nav:imgURL"/>
  158. <img height="16" width="16">
  159. <out:attribute name="title">
  160. <out:value-of select="nav:screenTip"/>
  161. </out:attribute>
  162. <out:attribute name="alt">
  163. <out:text>&#160;</out:text>
  164. <out:value-of select="nav:fullName"/>
  165. </out:attribute>
  166. <out:attribute name="src"><out:value-of select="nav:imgURL"/></out:attribute>
  167. </img>
  168. <out:if test="$defaultAction != ''">
  169. <img height="16" width="12">
  170. <out:attribute name="src">
  171. <out:value-of select="$defaultAction"/>
  172. </out:attribute>
  173. </img>
  174. </out:if>
  175. </cp:columnContent>
  176. <cp:columnContent>
  177. <img width="20" height="16" align="absmiddle" src="{'{$skin_images}'}path.gif">
  178. <out:attribute name="alt">
  179. <out:text>&#160;</out:text>
  180. <out:value-of select="nav:fullName"/>
  181. </out:attribute>
  182. </img>
  183. <out:text>&#160;</out:text>
  184. <out:choose>
  185. <out:when test="(contains($folder-classes, concat(' ', nav:type, ' ')) or (contains(' group role ', concat(' ', nav:type, ' ')) and nav:hasChildren='true')) and contains(concat(' ', nav:permissions, ' '), ' traverse ')">
  186. <out:variable name="encodedPath" select="xtsext:javascriptencode(string(nav:searchPath))"/>
  187. <a href="#">
  188. <out:attribute name="onclick">clearPagerVariables();document.pform.select_path.value = '<out:value-of select="$encodedPath"/>'; controller_submitForm('default');</out:attribute>
  189. <out:value-of select="nav:name"/>
  190. </a>
  191. </out:when>
  192. <out:otherwise>
  193. <out:choose>
  194. <!-- special case when displaying namespaces in the select packages, locations and deployment objects dialog -->
  195. <out:when test="nav:type='namespace' and (key('request-param','addEntriesUI')='packagesAndLocations' or key('request-param','addEntriesUI')='indexUpdateLocations' or key('request-param','addEntriesUI')='deploymentObjects')">
  196. <xts:string id="IDS_ADDENTRIES_PACKAGES_LOCATIONS_NAMESPACE_PREFIX">
  197. <xts:param name="namespaceName"><out:value-of select="nav:name"/></xts:param>
  198. </xts:string>
  199. </out:when>
  200. <out:otherwise>
  201. <out:value-of select="nav:name"/>
  202. </out:otherwise>
  203. </out:choose>
  204. <out:if test="nav:name != ''">
  205. <out:text> (</out:text>
  206. <out:value-of select="nav:name"/>
  207. <out:text>)</out:text>
  208. </out:if>
  209. </out:otherwise>
  210. </out:choose>
  211. </cp:columnContent>
  212. </xsl:template>
  213. <!-- Standard columns for navigation pager -->
  214. <xsl:template name="navigatePagerColumns">
  215. <cp:columnHeader width="16" toggleName="nav_checkbox" noLabel="true"/>
  216. <cp:columnHeader width="16"></cp:columnHeader>
  217. <cp:columnHeader width="100%">
  218. <out:if test="key('request-param','requestState') = 'search'">
  219. <!-- All of this is to align the header (...> Name) with the contents of the table-->
  220. <img height="5" width="1" border="0" alt=""><out:attribute name="src"><out:value-of select="$webcontent"/>/images/space.gif</out:attribute></img>
  221. <out:text/><xts:string id="IDS_PATH_INDICATOR"/><out:text>&#160;</out:text>
  222. <img height="5" width="1" border="0" alt=""><out:attribute name="src"><out:value-of select="$webcontent"/>/images/space.gif</out:attribute></img>
  223. </out:if>
  224. <out:text/><xts:string id="IDS_NAME"/><out:text/>
  225. </cp:columnHeader>
  226. </xsl:template>
  227. <!-- Standard content for navigation pager -->
  228. <xsl:template name="navigatePagerContent">
  229. <xsl:param name="isPortlet"/>
  230. <!-- checkbox column -->
  231. <out:if test="not(key('request-param','addEntriesUI')='deploymentObjects' and cm:objectClass='namespace' and cm:defaultName='Cognos')">
  232. <cp:columnContent>
  233. <out:variable name="isRoot" select='/root/*[local-name()="containerInfo"]/*[local-name()="queryResponse"]/*[local-name()="queryReply"]/*[local-name()="root"]'/>
  234. <out:variable name="isRootSelectable" select='key("request-param","selectableRootObjects")="true"'/>
  235. <out:choose>
  236. <out:when test='(contains($selectable-classes, concat("&apos;",cm:objectClass,"&apos;")) or ($isRootSelectable and $isRoot)) and not(not($isRootSelectable) and $isRoot)'>
  237. <input type="checkbox" name="nav_checkbox" value="{'{cm:searchPath}'}">
  238. <out:attribute name="aria-label"><out:value-of select="xtsext:htmlencode(*[local-name()='defaultName'])"/></out:attribute>
  239. <out:attribute name="id"><out:value-of select="concat('nav_checkbox',position())"/></out:attribute>
  240. </input>
  241. </out:when>
  242. <out:otherwise>
  243. <out:text>&#160;</out:text>
  244. </out:otherwise>
  245. </out:choose>
  246. </cp:columnContent>
  247. <!-- icon column -->
  248. <cp:columnContent>
  249. <out:variable name="overrideObjectClass">
  250. <out:choose>
  251. <out:when test="cm:objectClass='folder' and (key('env-param','select_path')='/' or (not(key('env-param','select_path')) and key('request-param','defaultSearchPath')='/'))">pfr</out:when>
  252. <out:when test="cm:objectClass='namespace' and (key('request-param','addEntriesUI')='packagesAndLocations' or key('request-param','addEntriesUI')='indexUpdateLocations')">pfr</out:when>
  253. <out:otherwise><out:value-of select="cm:objectClass"/></out:otherwise>
  254. </out:choose>
  255. </out:variable>
  256. <out:variable name="overrideHidden">
  257. <out:choose>
  258. <out:when test="(key('request-param','addEntriesUI')='deploymentObjects' and cm:objectClass='account')">
  259. <out:value-of select="cm:hasChildren='false'"/>
  260. </out:when>
  261. <out:otherwise>
  262. <out:value-of select="cm:hidden"/>
  263. </out:otherwise>
  264. </out:choose>
  265. </out:variable>
  266. <out:call-template name="gen-icon">
  267. <out:with-param name="showAction" select="false()"/>
  268. <out:with-param name="class" select="$overrideObjectClass"/>
  269. <out:with-param name="userInterfaces" select="cm:userInterfaces/cm:uiComponentEnum"/>
  270. <out:with-param name="isDangling" select="cm:base/@nil='true'"/>
  271. <out:with-param name="hiddenObject" select="$overrideHidden"/>
  272. </out:call-template>
  273. </cp:columnContent>
  274. <!-- name column -->
  275. <cp:columnContent>
  276. <out:if test="key('request-param','requestState') = 'search'">
  277. <img width="20" height="16" align="absmiddle" src="{'{$skin_images}'}path.gif">
  278. <out:attribute name="alt">
  279. <cf:do-the-path-link>
  280. <cf:param name="familytree">*[local-name()='ancestors']</cf:param>
  281. <cf:param name="familymember">*[local-name()='defaultName']</cf:param>
  282. <cf:param name="onlyAncestors">true</cf:param>
  283. </cf:do-the-path-link>
  284. </out:attribute>
  285. </img>
  286. </out:if>
  287. <out:text>&#160;</out:text>
  288. <out:choose>
  289. <out:when test="(contains($folder-classes, concat(' ', cm:objectClass, ' ')) or (contains(' group role ', concat(' ', cm:objectClass, ' ')) and cm:hasChildren='true')) and contains(concat(' ', cm:permissions, ' '), ' traverse ')">
  290. <out:variable name="encodedPath" select="xtsext:javascriptencode(string(cm:searchPath))"/>
  291. <a href="#">
  292. <out:attribute name="onclick">clearPagerVariables();document.pform.select_path.value = '<out:value-of select="$encodedPath"/>'; controller_submitForm('default');</out:attribute>
  293. <out:if test="$isBidiEnabled = 'true'">
  294. <out:attribute name="dir">
  295. <out:value-of select="xtsext:getBTD(cm:defaultName, $baseTextDirection, $productLocale)"/>
  296. </out:attribute>
  297. </out:if>
  298. <out:value-of select="cm:defaultName"/>
  299. </a>
  300. </out:when>
  301. <out:otherwise>
  302. <out:choose>
  303. <!-- special case when displaying namespaces in the select packages and locations dialog -->
  304. <out:when test="cm:objectClass='namespace' and (key('request-param','addEntriesUI')='packagesAndLocations' or key('request-param','addEntriesUI')='indexUpdateLocations')">
  305. <xts:string id="IDS_ADDENTRIES_PACKAGES_LOCATIONS_NAMESPACE_PREFIX">
  306. <xts:param name="namespaceName"><out:value-of select="cm:defaultName"/></xts:param>
  307. </xts:string>
  308. </out:when>
  309. <out:otherwise>
  310. <out:value-of select="xtsext:enforceBTD(cm:defaultName, $baseTextDirection, $productLocale, boolean($isBidiEnabled='true'))"/>
  311. </out:otherwise>
  312. </out:choose>
  313. <out:if test="cm:userName != ''">
  314. <out:text> (</out:text>
  315. <out:value-of select="xtsext:enforceBTD(cm:userName, $baseTextDirection, $productLocale, boolean($isBidiEnabled='true'))"/>
  316. <out:text>)</out:text>
  317. </out:if>
  318. </out:otherwise>
  319. </out:choose>
  320. </cp:columnContent>
  321. <!-- Action column -->
  322. <xsl:if test="$isPortlet">
  323. <cp:columnContent>
  324. <out:call-template name="action-properties">
  325. <out:with-param name="obj-name" select="cm:defaultName"/>
  326. <out:with-param name="obj-path" select="cm:searchPath"/>
  327. <out:with-param name="obj-id" select="cm:storeID"/>
  328. <out:with-param name="obj-class" select="cm:objectClass"/>
  329. <out:with-param name="supportPreviewPortlet" select="cm:objectClass='portlet'"/>
  330. <out:with-param name="supportAllActionsAction" select="false()"/>
  331. </out:call-template>
  332. </cp:columnContent>
  333. </xsl:if>
  334. </out:if>
  335. </xsl:template>
  336. <xsl:template match="aep:selectedEntriesPager">
  337. <out:variable name="selectedEntriesPager_remove_onClick">
  338. <out:value-of select="concat(key('request-param','requestState'), '|remove')"/>
  339. </out:variable>
  340. <script language="javascript" src="{'{$webcontent}'}/{'{$app}'}/js/utilities.js"/>
  341. <out:choose>
  342. <!-- recipients added entries pager -->
  343. <out:when test="key('request-param','addEntriesUI') = 'recipients' and key('request-param','withCC') = 'false'">
  344. <input type="hidden" name="typeChanged" value=""/>
  345. <cf:main-pager-section name="listpager" form="pform" width="100%" genDelete="yes">
  346. <cf:param name="pagerSummary"><xts:string id="IDS_ADDENTRIES_SELECTED_ENTRIES"/></cf:param>
  347. <cf:param name="item-path">/root/*[local-name()='response']/*[local-name()='selectedEntries']/*</cf:param>
  348. <cf:param name="target">key('request-param','defaultTarget')</cf:param>
  349. <cf:param name="lines-per-page">
  350. <out:choose>
  351. <out:when test="key('session-param','linesPerPage')!=''">
  352. <out:value-of select="key('session-param','linesPerPage')"/>
  353. </out:when>
  354. <out:otherwise>
  355. <out:value-of select="/root/system/param[@name='defaultPortalPreferences']/pref[@name='lines']"/>
  356. </out:otherwise>
  357. </out:choose>
  358. </cf:param>
  359. <cf:param name="actions">
  360. <cp:action>
  361. <a href="#">
  362. <out:attribute name="onclick">
  363. <out:text>if(!isSelected('list_checkbox_')){alert("<xts:string id="IDS_REMOVE_WARNING" encode="javascript"/>");return;}</out:text>
  364. <out:text>controller_changeState('</out:text>
  365. <out:value-of select="$selectedEntriesPager_remove_onClick"/>
  366. <out:text>'); controller_submitForm('default');</out:text>
  367. </out:attribute>
  368. <xts:string id="IDS_REMOVE"/>
  369. </a>
  370. </cp:action>
  371. </cf:param>
  372. <cf:param name="rows">
  373. <cp:tableHeader>
  374. <cp:columnHeader width="16" toggleName="list_checkbox" noLabel="true"/>
  375. <cp:columnHeader width="16"><label style="display:none" for="control_list_checkbox"><xts:string id="IDS_SELECT_DESELECT_ALL"/></label></cp:columnHeader>
  376. <cp:columnHeader width="100%">
  377. <!-- All of this is to align the header (...> Name) with the contents of the table-->
  378. <img height="5" width="1" border="0" alt=""><out:attribute name="src"><out:value-of select="$webcontent"/>/images/space.gif</out:attribute></img>
  379. <xsl:text/><xts:string id="IDS_PATH_INDICATOR"/><xsl:text>&#160;</xsl:text>
  380. <img height="5" width="1" border="0" alt=""><out:attribute name="src"><out:value-of select="$webcontent"/>/images/space.gif</out:attribute></img>
  381. <xsl:text/><xts:string id="IDS_NAME"/><xsl:text/>
  382. </cp:columnHeader>
  383. </cp:tableHeader>
  384. <cp:tableContent>
  385. <cp:columnContent>
  386. <!-- need to use preceding-sibling since the pager ends up doing a xsl:for-each. If we used
  387. position(), we would end up getting the position in the xsl:for-each which won't give us
  388. the overall position if the user isn't on the first page. -->
  389. <out:variable name="precedingSiblingCount" select="count(preceding-sibling::*)"/>
  390. <input type="checkbox">
  391. <out:attribute name="name">
  392. <out:value-of select="concat('list_checkbox_',$precedingSiblingCount)"/>
  393. </out:attribute>
  394. <out:attribute name="id">
  395. <out:value-of select="concat('list_checkbox',position())"/>
  396. </out:attribute>
  397. <out:attribute name="value">
  398. <out:value-of select="$precedingSiblingCount"/>
  399. </out:attribute>
  400. <out:attribute name="aria-label"><out:value-of select="xtsext:htmlencode(*[local-name()='defaultName'])"/></out:attribute>
  401. </input>
  402. </cp:columnContent>
  403. <cp:columnContent>
  404. <out:variable name="overrideObjectClass">
  405. <out:if test="cm:objectClass='folder' and key('env-param','select_path')='/'">pfr</out:if>
  406. </out:variable>
  407. <out:call-template name="gen-icon">
  408. <out:with-param name="showAction" select="false()"/>
  409. <out:with-param name="class" select="$overrideObjectClass"/>
  410. <out:with-param name="hiddenObject" select="cm:hidden"/>
  411. </out:call-template>
  412. </cp:columnContent>
  413. <cp:columnContent>
  414. <img width="20" height="16" align="absmiddle" src="{'{$skin_images}'}path.gif">
  415. <out:attribute name="alt">
  416. <cf:do-the-path-link>
  417. <cf:param name="familytree">*[local-name()='ancestors']</cf:param>
  418. <cf:param name="familymember">*[local-name()='defaultName']</cf:param>
  419. <cf:param name="onlyAncestors">true</cf:param>
  420. </cf:do-the-path-link>
  421. </out:attribute>
  422. </img>
  423. <xsl:text>&#160;</xsl:text>
  424. <out:value-of select="xtsext:enforceBTD(cm:defaultName, $baseTextDirection, $productLocale, boolean($isBidiEnabled='true'))"/>
  425. <out:if test="cm:userName != ''">
  426. <out:text> (</out:text>
  427. <out:value-of select="xtsext:enforceBTD(cm:userName, $baseTextDirection, $productLocale, boolean($isBidiEnabled='true'))"/>
  428. <out:text>)</out:text>
  429. </out:if>
  430. </cp:columnContent>
  431. </cp:tableContent>
  432. </cf:param>
  433. </cf:main-pager-section>
  434. </out:when>
  435. <out:when test="key('request-param','addEntriesUI') = 'recipients' or key('request-param','addEntriesUI') = 'humanTask' ">
  436. <input type="hidden" name="typeChanged" value=""/>
  437. <cf:main-pager-section name="listpager" form="pform" width="100%" genDelete="yes">
  438. <cf:param name="item-path">/root/*[local-name()='response']/*[local-name()='selectedEntries']/*</cf:param>
  439. <cf:param name="pagerSummary"><xts:string id="IDS_ADDENTRIES_SELECTED_ENTRIES"/></cf:param>
  440. <cf:param name="target">key('request-param','defaultTarget')</cf:param>
  441. <cf:param name="lines-per-page">
  442. <out:choose>
  443. <out:when test="key('session-param','linesPerPage')!=''">
  444. <out:value-of select="key('session-param','linesPerPage')"/>
  445. </out:when>
  446. <out:otherwise>
  447. <out:value-of select="/root/system/param[@name='defaultPortalPreferences']/pref[@name='lines']"/>
  448. </out:otherwise>
  449. </out:choose>
  450. </cf:param>
  451. <cf:param name="actions">
  452. <cp:action>
  453. <a href="#">
  454. <out:attribute name="onclick">
  455. <out:text>if(!isSelected('list_checkbox_')){alert("<xts:string id="IDS_REMOVE_WARNING" encode="javascript"/>");return;}</out:text>
  456. <out:text>controller_changeState('</out:text>
  457. <out:value-of select="$selectedEntriesPager_remove_onClick"/>
  458. <out:text>'); controller_submitForm('default');</out:text>
  459. </out:attribute>
  460. <xts:string id="IDS_REMOVE"/>
  461. </a>
  462. </cp:action>
  463. </cf:param>
  464. <cf:param name="rows">
  465. <cp:tableHeader>
  466. <cp:columnHeader width="16" toggleName="list_checkbox" noLabel="true"/>
  467. <cp:columnHeader width="16"><label style="display:none" for="control_list_checkbox"><xts:string id="IDS_SELECT_DESELECT_ALL"/></label></cp:columnHeader>
  468. <cp:columnHeader width="100%">
  469. <!-- All of this is to align the header (...> Name) with the contents of the table-->
  470. <img height="5" width="1" border="0" alt=""><out:attribute name="src"><out:value-of select="$webcontent"/>/images/space.gif</out:attribute></img>
  471. <xsl:text/><xts:string id="IDS_PATH_INDICATOR"/><xsl:text>&#160;</xsl:text>
  472. <img height="5" width="1" border="0" alt=""><out:attribute name="src"><out:value-of select="$webcontent"/>/images/space.gif</out:attribute></img>
  473. <xsl:text/><xts:string id="IDS_NAME"/><xsl:text/>
  474. </cp:columnHeader>
  475. <out:choose>
  476. <out:when test="key('request-param','addEntriesUI') = 'humanTask'">
  477. <cp:columnHeader>
  478. <xts:string id="IDS_ADD_RECIPIENTS_POTENTIAL_OWNER"/>
  479. </cp:columnHeader>
  480. <cp:columnHeader noSep="T">
  481. <xts:string id="IDS_ADD_RECIPIENTS_STAKEHOLDER"/>
  482. </cp:columnHeader>
  483. <cp:columnHeader/>
  484. </out:when>
  485. <out:otherwise>
  486. <cp:columnHeader>
  487. <xts:string id="IDS_ADD_RECIPIENTS_TO"/>
  488. </cp:columnHeader>
  489. <cp:columnHeader>
  490. <xts:string id="IDS_ADD_RECIPIENTS_CC"/>
  491. </cp:columnHeader>
  492. <cp:columnHeader>
  493. <out:if test="key('request-param','withBCC') = 'true'">
  494. <xts:string id="IDS_ADD_RECIPIENTS_BCC"/>
  495. </out:if>
  496. </cp:columnHeader>
  497. </out:otherwise>
  498. </out:choose>
  499. </cp:tableHeader>
  500. <cp:tableContent>
  501. <cp:columnContent>
  502. <!-- need to use preceding-sibling since the pager ends up doing a xsl:for-each. If we used
  503. position(), we would end up getting the position in the xsl:for-each which won't give us
  504. the overall position if the user isn't on the first page. -->
  505. <out:variable name="precedingSiblingCount" select="count(preceding-sibling::*)"/>
  506. <input type="checkbox">
  507. <out:attribute name="name">
  508. <out:value-of select="concat('list_checkbox_',$precedingSiblingCount)"/>
  509. </out:attribute>
  510. <out:attribute name="id">
  511. <out:value-of select="concat('list_checkbox',position())"/>
  512. </out:attribute>
  513. <out:attribute name="value">
  514. <out:value-of select="$precedingSiblingCount"/>
  515. </out:attribute>
  516. <out:attribute name="aria-label"><out:value-of select="xtsext:htmlencode(*[local-name()='defaultName'])"/></out:attribute>
  517. </input>
  518. </cp:columnContent>
  519. <cp:columnContent>
  520. <out:variable name="overrideObjectClass">
  521. <out:if test="cm:objectClass='folder' and key('env-param','select_path')='/'">pfr</out:if>
  522. </out:variable>
  523. <out:call-template name="gen-icon">
  524. <out:with-param name="showAction" select="false()"/>
  525. <out:with-param name="class" select="$overrideObjectClass"/>
  526. <out:with-param name="hiddenObject" select="cm:hidden"/>
  527. </out:call-template>
  528. </cp:columnContent>
  529. <cp:columnContent>
  530. <img width="20" height="16" align="absmiddle" src="{'{$skin_images}'}path.gif">
  531. <out:attribute name="alt">
  532. <cf:do-the-path-link>
  533. <cf:param name="familytree">*[local-name()='ancestors']</cf:param>
  534. <cf:param name="familymember">*[local-name()='defaultName']</cf:param>
  535. <cf:param name="onlyAncestors">true</cf:param>
  536. </cf:do-the-path-link>
  537. </out:attribute>
  538. </img>
  539. <xsl:text>&#160;</xsl:text>
  540. <out:value-of select="xtsext:enforceBTD(cm:defaultName, $baseTextDirection, $productLocale, boolean($isBidiEnabled='true'))"/>
  541. <out:if test="cm:userName != ''">
  542. <out:text> (</out:text>
  543. <out:value-of select="xtsext:enforceBTD(cm:userName, $baseTextDirection, $productLocale, boolean($isBidiEnabled='true'))"/>
  544. <out:text>)</out:text>
  545. </out:if>
  546. </cp:columnContent>
  547. <!-- to -->
  548. <cp:columnContent>
  549. <input type="checkbox">
  550. <out:attribute name="onclick">
  551. <xsl:text>javascript:document.pform.typeChanged.value = 'true';</xsl:text>
  552. </out:attribute>
  553. <out:attribute name="name">
  554. <out:value-of select="concat('to_type_checkbox',position())"/>
  555. </out:attribute>
  556. <out:attribute name="id">
  557. <out:value-of select="concat('to_type_checkbox',position())"/>
  558. </out:attribute>
  559. <out:if test="*[local-name()='type'] = 'to'">
  560. <out:attribute name="checked"><xsl:value-of select="checked"/></out:attribute>
  561. </out:if>
  562. <out:attribute name="value">
  563. <out:value-of select="cm:searchPathForURL"/>
  564. </out:attribute>
  565. </input>
  566. <label style="display:none">
  567. <out:attribute name="for"><out:value-of select="concat('to_type_checkbox',position())"/></out:attribute>
  568. <out:choose>
  569. <out:when test="key('request-param','addEntriesUI') = 'humanTask'">
  570. <xts:string id="IDS_ADD_RECIPIENTS_POTENTIAL_OWNER"/>
  571. </out:when>
  572. <out:otherwise>
  573. <xts:string id="IDS_ADD_RECIPIENTS_TO"/>
  574. </out:otherwise>
  575. </out:choose>
  576. </label>
  577. </cp:columnContent>
  578. <!-- cc -->
  579. <cp:columnContent>
  580. <input type="checkbox">
  581. <out:attribute name="onclick">
  582. <xsl:text>javascript:document.pform.typeChanged.value = 'true';</xsl:text>
  583. </out:attribute>
  584. <out:attribute name="name">
  585. <out:value-of select="concat('cc_type_checkbox',position())"/>
  586. </out:attribute>
  587. <out:attribute name="id">
  588. <out:value-of select="concat('cc_type_checkbox',position())"/>
  589. </out:attribute>
  590. <out:if test="*[local-name()='type'] = 'cc'">
  591. <out:attribute name="checked"><xsl:value-of select="checked"/></out:attribute>
  592. </out:if>
  593. <out:attribute name="value">
  594. <out:value-of select="cm:searchPathForURL"/>
  595. </out:attribute>
  596. </input>
  597. <label style="display:none">
  598. <out:attribute name="for"><out:value-of select="concat('cc_type_checkbox',position())"/></out:attribute>
  599. <out:choose>
  600. <out:when test="key('request-param','addEntriesUI') = 'humanTask'">
  601. <xts:string id="IDS_ADD_RECIPIENTS_STAKEHOLDER"/>
  602. </out:when>
  603. <out:otherwise>
  604. <xts:string id="IDS_ADD_RECIPIENTS_CC"/>
  605. </out:otherwise>
  606. </out:choose>
  607. </label>
  608. </cp:columnContent>
  609. <!-- bcc-->
  610. <cp:columnContent>
  611. <out:if test="key('request-param','addEntriesUI') = 'recipients' and key('request-param','withBCC') = 'true'">
  612. <input type="checkbox">
  613. <out:attribute name="onclick">
  614. <out:text>javascript:document.pform.typeChanged.value = 'true';</out:text>
  615. </out:attribute>
  616. <out:attribute name="name">
  617. <out:value-of select="concat('bcc_type_checkbox',position())"/>
  618. </out:attribute>
  619. <out:attribute name="id">
  620. <out:value-of select="concat('bcc_type_checkbox',position())"/>
  621. </out:attribute>
  622. <out:if test="*[local-name()='type'] = 'bcc'">
  623. <out:attribute name="checked"><xsl:value-of select="checked"/></out:attribute>
  624. </out:if>
  625. <out:attribute name="value">
  626. <out:value-of select="cm:searchPathForURL"/>
  627. </out:attribute>
  628. </input>
  629. <label style="display:none">
  630. <out:attribute name="for"><out:value-of select="concat('bcc_type_checkbox',position())"/></out:attribute>
  631. <xts:string id="IDS_ADD_RECIPIENTS_BCC"/>
  632. </label>
  633. </out:if>
  634. </cp:columnContent>
  635. </cp:tableContent>
  636. </cf:param>
  637. </cf:main-pager-section>
  638. </out:when>
  639. <out:otherwise>
  640. <cf:main-pager-section name="listpager" form="pform" width="100%" genDelete="yes">
  641. <cf:param name="item-path">/root/*[local-name()='response']/*[local-name()='selectedEntries']/*</cf:param>
  642. <cf:param name="target">key('request-param','defaultTarget')</cf:param>
  643. <cf:param name="pagerSummary"><xts:string id="IDS_ADDENTRIES_SELECTED_ENTRIES"/></cf:param>
  644. <cf:param name="lines-per-page">
  645. <out:choose>
  646. <out:when test="key('session-param','linesPerPage')!=''">
  647. <out:value-of select="key('session-param','linesPerPage')"/>
  648. </out:when>
  649. <out:otherwise>
  650. <out:value-of select="/root/system/param[@name='defaultPortalPreferences']/pref[@name='lines']"/>
  651. </out:otherwise>
  652. </out:choose>
  653. </cf:param>
  654. <cf:param name="actions">
  655. <cp:action>
  656. <a href="#">
  657. <out:attribute name="onclick">
  658. <out:text>if(!isSelected('list_checkbox_')){alert("<xts:string id="IDS_REMOVE_WARNING" encode="javascript"/>");return;}</out:text>
  659. <out:text>controller_changeState('</out:text>
  660. <out:value-of select="$selectedEntriesPager_remove_onClick"/>
  661. <out:text>'); controller_submitForm('default');</out:text>
  662. </out:attribute>
  663. <xts:string id="IDS_REMOVE"/>
  664. </a>
  665. </cp:action>
  666. </cf:param>
  667. <cf:param name="rows">
  668. <cp:tableHeader>
  669. <cp:columnHeader width="16" toggleName="list_checkbox" noLabel="true"/>
  670. <cp:columnHeader width="16"/>
  671. <cp:columnHeader width="100%">
  672. <!-- All of this is to align the header (...> Name) with the contents of the table-->
  673. <out:if test="key('request-param','addEntriesUI')!='packagesAndLocations' and key('request-param','addEntriesUI')!='indexUpdateLocations'">
  674. <img height="5" width="1" border="0" alt=""><out:attribute name="src"><out:value-of select="$webcontent"/>/images/space.gif</out:attribute></img>
  675. <xsl:text/><xts:string id="IDS_PATH_INDICATOR"/><xsl:text>&#160;</xsl:text>
  676. <img height="5" width="1" border="0" alt=""><out:attribute name="src"><out:value-of select="$webcontent"/>/images/space.gif</out:attribute></img>
  677. </out:if>
  678. <xsl:text/><xts:string id="IDS_NAME"/><xsl:text/>
  679. </cp:columnHeader>
  680. </cp:tableHeader>
  681. <cp:tableContent>
  682. <cp:columnContent>
  683. <!-- need to use preceding-sibling since the pager ends up doing a xsl:for-each. If we used
  684. position(), we would end up getting the position in the xsl:for-each which won't give us
  685. the overall position if the user isn't on the first page. -->
  686. <out:variable name="precedingSiblingCount" select="count(preceding-sibling::*)"/>
  687. <input type="checkbox">
  688. <out:attribute name="name">
  689. <out:value-of select="concat('list_checkbox_',$precedingSiblingCount)"/>
  690. </out:attribute>
  691. <out:attribute name="value">
  692. <out:value-of select="$precedingSiblingCount"/>
  693. </out:attribute>
  694. <out:attribute name="aria-label"><out:value-of select="xtsext:htmlencode(*[local-name()='defaultName'])"/></out:attribute>
  695. </input>
  696. </cp:columnContent>
  697. <cp:columnContent>
  698. <out:variable name="overrideObjectClass">
  699. <out:choose>
  700. <out:when test="cm:objectClass='folder' and starts-with(cm:searchPath, 'CAMID(&quot;')">pfr</out:when>
  701. <out:when test="cm:objectClass='namespace' and (key('request-param','addEntriesUI')='packagesAndLocations' or key('request-param','addEntriesUI')='indexUpdateLocations' or key('request-param','addEntriesUI')='deploymentObjects')">pfr</out:when>
  702. <out:otherwise><out:value-of select="cm:objectClass"/></out:otherwise>
  703. </out:choose>
  704. </out:variable>
  705. <out:call-template name="gen-icon">
  706. <out:with-param name="showAction" select="false()"/>
  707. <out:with-param name="class" select="$overrideObjectClass"/>
  708. <out:with-param name="userInterfaces" select="cm:userInterfaces/cm:uiComponentEnum"/>
  709. <out:with-param name="isDangling" select="cm:base/@nil='true'"/>
  710. <out:with-param name="hiddenObject" select="cm:hidden"/>
  711. </out:call-template>
  712. </cp:columnContent>
  713. <cp:columnContent>
  714. <out:if test="key('request-param','addEntriesUI')!='packagesAndLocations' and key('request-param','addEntriesUI')!='indexUpdateLocations'">
  715. <out:variable name="privateFolderId">
  716. <xsl:if test="@mode='properties'">
  717. <out:value-of select="$privateFolder/cm:storeID"/>
  718. </xsl:if>
  719. </out:variable>
  720. <out:if test="not(key('session-param','mrootid') = cm:storeID or key('session-param','prootid') = cm:storeID or ($privateFolderId != '' and $privateFolderId = cm:storeID))">
  721. <out:variable name="object-start-at-path">
  722. <out:choose>
  723. <!-- Do not provide a path for contact otherwise invalid path displayed for logged on user -->
  724. <out:when test="starts-with(cm:searchPath, '~') or starts-with(cm:searchPath,key('session-param', 'e_hp'))">
  725. <out:value-of select="concat(key('session-param', 'e_hp'), '/folder')"/>
  726. </out:when>
  727. <out:when test="starts-with(cm:searchPath,'/content')">
  728. <out:value-of select="/content"/>
  729. </out:when>
  730. </out:choose>
  731. </out:variable>
  732. <span style="padding-left: 1px; padding-right: 1px;">
  733. <img border="0" align="absmiddle" height="16" width="20" src="{'{$skin_images}'}path.gif">
  734. <out:attribute name="alt">
  735. <cf:do-the-path-link>
  736. <cf:param name="familytree">cm:ancestors</cf:param>
  737. <cf:param name="home">
  738. <out:value-of select="{'$object-start-at-path'}"/>
  739. </cf:param>
  740. <cf:param name="familymember">cm:defaultName</cf:param>
  741. <cf:param name="onlyAncestors">true</cf:param>
  742. </cf:do-the-path-link>
  743. </out:attribute>
  744. </img>
  745. &#160;
  746. </span>
  747. </out:if>
  748. </out:if>
  749. <out:choose>
  750. <!-- special case when displaying namespaces in the select packages and locations dialog -->
  751. <out:when test="cm:objectClass='namespace' and (key('request-param','addEntriesUI')='packagesAndLocations' or key('request-param','addEntriesUI')='indexUpdateLocations')">
  752. <xts:string id="IDS_ADDENTRIES_PACKAGES_LOCATIONS_NAMESPACE_PREFIX">
  753. <xts:param name="namespaceName"><out:value-of select="cm:defaultName"/></xts:param>
  754. </xts:string>
  755. </out:when>
  756. <out:otherwise>
  757. <out:value-of select="xtsext:enforceBTD(cm:defaultName, $baseTextDirection, $productLocale, boolean($isBidiEnabled='true'))"/>
  758. </out:otherwise>
  759. </out:choose>
  760. <out:if test="cm:userName != ''">
  761. <out:text> (</out:text>
  762. <out:value-of select="cm:userName"/>
  763. <out:text>)</out:text>
  764. </out:if>
  765. </cp:columnContent>
  766. </cp:tableContent>
  767. </cf:param>
  768. </cf:main-pager-section>
  769. </out:otherwise>
  770. </out:choose>
  771. </xsl:template>
  772. <!-- The main engine -->
  773. <xsl:template match="*">
  774. <xsl:copy>
  775. <xsl:copy-of select="@*"/>
  776. <xsl:apply-templates/>
  777. </xsl:copy>
  778. </xsl:template>
  779. </xsl:stylesheet>