toollogic.xslt 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884
  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" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  13. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  14. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  15. xmlns:mt="http://developer.cognos.com/schemas/xts/logicsheets/presentation/main/mt"
  16. xmlns:mf="http://developer.cognos.com/schemas/xts/logicsheets/presentation/main/mf"
  17. xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
  18. xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
  19. xmlns:tool="http://developer.cognos.com/schemas/xts/logicsheets/xslt/toollogic/"
  20. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  21. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:out="dummy-uri">
  22. <xsl:output method="xml" encoding="UTF-8" indent="no"/>
  23. <xsl:namespace-alias stylesheet-prefix="out" result-prefix="xsl"/>
  24. <xsl:variable name="tool-namespace-uri" select="'http://developer.cognos.com/schemas/xts/logicsheets/xslt/toollogic/'"/>
  25. <!--
  26. ===============================================================================================
  27. xsl:stylesheet - adds the templates that are called within this logic sheet
  28. available global variables:
  29. $cur-obj : Content Manager node of current object (e.g. /Directory/DataSource1)
  30. $m_class : Content Manager class of $cur-obj
  31. $m_name : Name of $cur-obj, may also contains the display name (e.g. All Data Sources)
  32. ===============================================================================================
  33. -->
  34. <xsl:template match="xsl:stylesheet">
  35. <xsl:copy>
  36. <xsl:copy-of select="@*"/>
  37. <pf:variables/>
  38. <out:variable name="tool-search">
  39. <out:choose>
  40. <out:when test="/root/search">true</out:when>
  41. <out:otherwise>false</out:otherwise>
  42. </out:choose>
  43. </out:variable>
  44. <out:variable name="tool-stateParams">
  45. <xsl:value-of select="concat(' ', //tool:page/@stateParams, ' backURL tool_tab ')"/>
  46. </out:variable>
  47. <!-- Global portal variables -->
  48. <mf:variables>
  49. <mf:stateParams>
  50. <out:choose>
  51. <out:when test="$tool-search = 'true'">
  52. <out:value-of select="concat($tool-stateParams, 'search stext sscope smethod sfield sstatus stype smodified sshortcuts stime m_searchsection m_pagerfromsearch m_pagertosearch ')"/>
  53. </out:when>
  54. <out:otherwise>
  55. <out:value-of select="$tool-stateParams"/>
  56. </out:otherwise>
  57. </out:choose>
  58. </mf:stateParams>
  59. </mf:variables>
  60. <xsl:variable name="form-name" select="//tool:page/@formName"/>
  61. <out:variable name="cmd-form">
  62. <xsl:value-of select="concat('c', $form-name)"/>
  63. </out:variable>
  64. <!-- Required -->
  65. <out:variable name="edit-form">
  66. <xsl:value-of select="concat('p', $form-name)"/>
  67. </out:variable>
  68. <!-- Required -->
  69. <!-- Tool specific variables -->
  70. <out:variable name="cur-obj" select="/root/path/cm:queryResponse/*"/>
  71. <out:variable name="m_class" select="local-name($cur-obj)"/>
  72. <out:variable name="tool-back-url"><out:value-of select="xtsext:protect(xtsext:urlencode(string(/root/env/param[@name = 'backURL'])),'url','url','getdata')"/></out:variable>
  73. <out:variable name="tool-path"><out:value-of select="xtsext:protect(xtsext:urlencode(string(/root/env/param[@name='m_path'])),'url','searchPath','getdata')"/></out:variable>
  74. <out:variable name="showTenantInfo" select="/root/session/param[@name='e_showTenantInfo']='true'"/>
  75. <xsl:apply-templates/>
  76. <!-- Insert common templates -->
  77. <mt:actions mode="tools"/>
  78. <pf:gen-action/>
  79. <pf:gen-icon/>
  80. <pf:gen-url/>
  81. </xsl:copy>
  82. </xsl:template>
  83. <!--
  84. ===============================================================================================
  85. tool:page -
  86. ===============================================================================================
  87. -->
  88. <xsl:template match="tool:page" priority="1">
  89. <html encodeDocType="false">
  90. <out:attribute name="lang"><out:value-of select="$productLocale"/></out:attribute>
  91. <head>
  92. <pf:meta/>
  93. <!-- Standard meta tags -->
  94. <title>
  95. <xsl:choose>
  96. <xsl:when test="./tool:name">
  97. <out:text/>
  98. <xsl:copy-of select="./tool:name/child::node()"/>
  99. <out:text/>
  100. </xsl:when>
  101. <xsl:otherwise>
  102. <xts:string id="IDS_COGNOS_REPORTS"/>
  103. </xsl:otherwise>
  104. </xsl:choose>
  105. </title>
  106. <mt:stylesheet/>
  107. <!-- add the theme style sheet -->
  108. <mf:head/>
  109. <!-- Common framework logic for Cognos Central main view -->
  110. <pf:help context="{@helpid}"/>
  111. <!-- Help system -->
  112. <pf:launch/>
  113. <!-- adds functions to launch the studios.... -->
  114. <xsl:apply-templates select="tool:script"/>
  115. </head>
  116. <mt:page>
  117. <xsl:if test="tool:regionLabel">
  118. <mt:regionLabel>
  119. <xsl:copy-of select="./tool:regionLabel/@id"/>
  120. <xsl:copy-of select="./tool:regionLabel/child::node()"/>
  121. </mt:regionLabel>
  122. </xsl:if>
  123. <xsl:if test="tool:tabs">
  124. <out:variable name="tool-tab">
  125. <xsl:copy-of select="tool:tabs/child::node()"/>
  126. </out:variable>
  127. </xsl:if>
  128. <xsl:if test="@hideHeaders!='true'">
  129. <mt:h1>
  130. <mt:title>
  131. <xsl:copy-of select="./tool:title/child::node()"/>
  132. </mt:title>
  133. </mt:h1>
  134. <xsl:choose>
  135. <xsl:when test="tool:tabs">
  136. <xsl:call-template name="gen-tabs">
  137. <xsl:with-param name="tabset-name" select="tool:tabs/@tabset-name"/>
  138. </xsl:call-template>
  139. </xsl:when>
  140. <xsl:otherwise>
  141. <mt:h3/>
  142. </xsl:otherwise>
  143. </xsl:choose>
  144. </xsl:if>
  145. <out:choose>
  146. <out:when test="$tool-search = 'true'">
  147. <mt:h4>
  148. <mt:path>
  149. <xsl:apply-templates select="tool:pathSearch/child::node()"/>
  150. <out:if test="$tool-search = 'true'">
  151. <xsl:text/>&#160;&#160;-&#160;<span class="bold"><xts:string id="IDS_SEARCH"/></span>
  152. <xsl:text/>
  153. </out:if>
  154. </mt:path>
  155. <xsl:if test="not (tool:search/@toolBar) or tool:search/@toolBar = 'true'">
  156. <mt:toolbar>
  157. <out:variable name="hideEditButton">
  158. <xsl:choose>
  159. <xsl:when test="tool:hideEditToolbarButtons/@test">
  160. <out:choose>
  161. <out:when test="{tool:hideEditToolbarButtons/@test}">true</out:when>
  162. <out:otherwise>false</out:otherwise>
  163. </out:choose>
  164. </xsl:when>
  165. <xsl:otherwise>false</xsl:otherwise>
  166. </xsl:choose>
  167. </out:variable>
  168. <!-- Show the toolbar when we have data to display -->
  169. <out:choose>
  170. <out:when test="count(/root/cm:queryResponse/*) > 0">
  171. <!-- only show the edit toolbar buttons if we're in the cognos namespace or we're not looking at the UGR tab -->
  172. <out:if test="$hideEditButton='false'">
  173. <mt:tool-group hideDivider="true">
  174. <out:if test="{not(tool:hideCopyToolbarButton/@test)}">
  175. <mt:tool name="copy"/>
  176. </out:if>
  177. <xsl:choose>
  178. <!-- The 'config' param will allow the tool to check if we are deleting configurationFolder -->
  179. <xsl:when test="tool:search/@type='config'">
  180. <mt:tool name="delete" type="config" mode="tools"/>
  181. </xsl:when>
  182. <xsl:otherwise>
  183. <mt:tool name="delete" mode="tools"/>
  184. </xsl:otherwise>
  185. </xsl:choose>
  186. </mt:tool-group>
  187. </out:if>
  188. </out:when>
  189. <out:otherwise>
  190. <!-- only show the edit toolbar buttons if we're in the cognos namespace or we're not looking at the UGR tab -->
  191. <out:if test="$hideEditButton='false'">
  192. <mt:tool-group hideDivider="true">
  193. <out:choose>
  194. <out:when test="contains(string(key('session-param','edit')),'copy')"><mt:tool name="copy"/></out:when>
  195. <out:when test="{not(tool:hideCopyToolbarButton/@test)}"><mt:tool name="copy" disable="true"/></out:when>
  196. </out:choose>
  197. <mt:tool name="delete" disable="true"/>
  198. </mt:tool-group>
  199. </out:if>
  200. </out:otherwise>
  201. </out:choose>
  202. </mt:toolbar>
  203. </xsl:if>
  204. </mt:h4>
  205. </out:when>
  206. <out:otherwise>
  207. <mt:h4 cogadmin="true">
  208. <mt:path>
  209. <xsl:apply-templates select="tool:path/child::node()"/>
  210. </mt:path>
  211. <xsl:apply-templates select="tool:actions/child::node()"/>
  212. </mt:h4>
  213. </out:otherwise>
  214. </out:choose>
  215. <out:if test="$tool-search = 'true'">
  216. <xsl:apply-templates select="tool:search"/>
  217. </out:if>
  218. <form method="post" onload="if (window.init) init();">
  219. <xsl:attribute name="name"><xsl:value-of select="'{$edit-form}'"/></xsl:attribute>
  220. <xsl:attribute name="action"><xsl:value-of select="'{$gateway}'"/></xsl:attribute>
  221. <xsl:apply-templates select="*[not(self::tool:script or self::tool:path or self::tool:actions or self::tool:search)]"/>
  222. <mf:edit-vars mode="tools"/>
  223. <!-- standard set of form variables used to process commands like actions, new ... -->
  224. </form>
  225. <form method="post">
  226. <xsl:attribute name="name"><xsl:value-of select="'{$cmd-form}'"/></xsl:attribute>
  227. <xsl:attribute name="action"><xsl:value-of select="'{$gateway}'"/></xsl:attribute>
  228. <mf:cmd-vars/>
  229. <input type="hidden" name="from_tool" value="true"/>
  230. </form>
  231. </mt:page>
  232. </html>
  233. </xsl:template>
  234. <xsl:template match="tool:script" priority="1">
  235. <script language="javascript">
  236. <xsl:apply-templates/>
  237. </script>
  238. </xsl:template>
  239. <xsl:template match="tool:contents" priority="1">
  240. <xsl:apply-templates/>
  241. </xsl:template>
  242. <!--
  243. ===============================================================================================
  244. tool:search - generate search dialog
  245. ===============================================================================================
  246. -->
  247. <xsl:template match="tool:search" priority="1">
  248. <xsl:variable name="modExists">
  249. <xsl:choose>
  250. <xsl:when test="@mod"><xsl:value-of select="@mod"/></xsl:when>
  251. <xsl:otherwise><xsl:value-of select="false()"/></xsl:otherwise>
  252. </xsl:choose>
  253. </xsl:variable>
  254. <out:choose>
  255. <out:when test="{$modExists}">
  256. <mt:search type="tools" modified="no">
  257. <xsl:apply-templates/>
  258. </mt:search>
  259. </out:when>
  260. <out:otherwise>
  261. <mt:search type="tools">
  262. <xsl:apply-templates/>
  263. </mt:search>
  264. </out:otherwise>
  265. </out:choose>
  266. </xsl:template>
  267. <!--
  268. ===============================================================================================
  269. tool:browser -
  270. ===============================================================================================
  271. -->
  272. <xsl:template match="tool:browser" priority="1">
  273. <out:variable name="containers">
  274. <xsl:apply-templates select="tool:containers"/>
  275. </out:variable>
  276. <!-- The extra leading and trailing spaces in this variable allow us to omit a concat that
  277. would be repeated for every row. Don't remove them or collapse them. -->
  278. <out:variable name="hierarchy-objects">
  279. <xsl:text> </xsl:text>
  280. <xsl:apply-templates select="tool:hierarchy-objects"/>
  281. <xsl:text> </xsl:text>
  282. </out:variable>
  283. <out:variable name="isConfig">
  284. <xsl:choose>
  285. <xsl:when test="@type='config'">true</xsl:when>
  286. <xsl:otherwise>false</xsl:otherwise>
  287. </xsl:choose>
  288. </out:variable>
  289. <out:variable name="selectables">
  290. <xsl:apply-templates select="tool:selectables"/>
  291. </out:variable>
  292. <out:variable name="hasSearchToolBar">
  293. <xsl:choose>
  294. <xsl:when test="not (//tool:page/tool:search/@toolBar) or //tool:page/tool:search/@toolBar = 'true' ">true</xsl:when>
  295. <xsl:otherwise>false</xsl:otherwise>
  296. </xsl:choose>
  297. </out:variable>
  298. <out:choose>
  299. <!-- Empty search query. -->
  300. <out:when test="/root/search/emptySearchExpression">
  301. <mt:objectNoneFound id="IDS_EMPTY_QUERY"/>
  302. </out:when>
  303. <!-- show the page or search results -->
  304. <out:when test="/root/search/expression or not(/root/search)">
  305. <xsl:variable name="vPage" select="@virtualPage"/>
  306. <cf:main-pager-section virtualPage="{$vPage}">
  307. <cf:param name="target">concat($app,'/',$mname)</cf:param>
  308. <cf:param name="item-path">
  309. <xsl:choose>
  310. <xsl:when test="@useQueryReply='true'">/root/cm:queryResponse/cm:queryReply[1]/*</xsl:when>
  311. <xsl:otherwise>/root/cm:queryResponse/*</xsl:otherwise>
  312. </xsl:choose>
  313. </cf:param>
  314. <cf:param name="lines-per-page">
  315. <out:value-of select="key('session-param', 'linesPerPage')"/>
  316. </cf:param>
  317. <cf:param name="rows">
  318. <!-- First define the columns -->
  319. <cp:tableHeader>
  320. <xsl:attribute name="session-name">
  321. <xsl:value-of select="tool:columnHeaders/@session-name"/>
  322. </xsl:attribute>
  323. <out:choose>
  324. <out:when test="$tool-search = 'true'">
  325. <cp:columnHeader width="16" toggleName="checkbox_" noLabel="true">
  326. <cp:columnHeaderForm><out:value-of select="$edit-form"/></cp:columnHeaderForm>
  327. </cp:columnHeader>
  328. <cp:columnHeader width="20"/>
  329. <cp:columnHeader width="100%">
  330. <img height="5" width="1" border="0"><out:attribute name="src"><out:value-of select="$webcontent"/>/images/space.gif</out:attribute></img>
  331. <out:text/><xts:string id="IDS_PATH_INDICATOR"/><out:text>&#160;</out:text>
  332. <img height="5" width="1" border="0"><out:attribute name="src"><out:value-of select="$webcontent"/>/images/space.gif</out:attribute></img>
  333. <xts:string id="IDS_NAME"/>
  334. </cp:columnHeader>
  335. <cp:columnHeader width="100">
  336. <xsl:if test="@valign and @valign!=''">
  337. <xsl:attribute name="valign">
  338. <xsl:value-of select="@valign"/>
  339. </xsl:attribute>
  340. </xsl:if>
  341. <cp:columnCondition><out:value-of select="$showTenantInfo"/></cp:columnCondition>
  342. <xts:string id="IDS_OBJ_TENANT"/>
  343. </cp:columnHeader>
  344. <xsl:if test="@hideActions != 'true'">
  345. <cp:columnHeader width="150">
  346. <xts:string id="IDS_HEADING_ACTIONS"/>
  347. </cp:columnHeader>
  348. </xsl:if>
  349. </out:when>
  350. <out:otherwise>
  351. <xsl:if test="not(tool:columnHeaders[@session-name='monitor-sort'])">
  352. <cp:columnHeader width="16" toggleName="checkbox_" noLabel="true">
  353. <cp:columnHeaderForm><out:value-of select="$edit-form"/></cp:columnHeaderForm>
  354. </cp:columnHeader>
  355. </xsl:if>
  356. <xsl:if test="not(tool:columnHeaders)">
  357. <cp:columnHeader width="20"/>
  358. <cp:columnHeader width="200">
  359. <xts:string id="IDS_NAME"/>
  360. </cp:columnHeader>
  361. <cp:columnHeader width="200">
  362. <xts:string id="IDS_MODIFIED"/>
  363. </cp:columnHeader>
  364. </xsl:if>
  365. <xsl:apply-templates select="tool:columnHeaders/*"/>
  366. <cp:columnHeader width="100">
  367. <xsl:if test="@valign and @valign!=''">
  368. <xsl:attribute name="valign">
  369. <xsl:value-of select="@valign"/>
  370. </xsl:attribute>
  371. </xsl:if>
  372. <cp:columnCondition><out:value-of select="$showTenantInfo"/></cp:columnCondition>
  373. <xts:string id="IDS_OBJ_TENANT"/>
  374. </cp:columnHeader>
  375. <xsl:if test="@hideActions != 'true'">
  376. <cp:columnHeader width="100%">
  377. <xsl:if test="@valign and @valign!=''">
  378. <xsl:attribute name="valign">
  379. <xsl:value-of select="@valign"/>
  380. </xsl:attribute>
  381. </xsl:if>
  382. <xts:string id="IDS_HEADING_ACTIONS"/>
  383. </cp:columnHeader>
  384. </xsl:if>
  385. </out:otherwise>
  386. </out:choose>
  387. </cp:tableHeader>
  388. <!-- Then define the column contents -->
  389. <cp:tableContent>
  390. <out:choose>
  391. <out:when test="$tool-search = 'true'">
  392. <cp:columnContent>
  393. <out:choose>
  394. <out:when test="$selectables='allObjects' or (contains(concat(' ', $selectables, ' '), concat(' ', cm:objectClass, ' ')) and $hasSearchToolBar = 'true') ">
  395. <input type="checkbox">
  396. <out:attribute name="value"><out:value-of select="xtsext:urlencode(string(cm:searchPath))"/></out:attribute>
  397. <out:attribute name="aria-label"><xts:string id="IDS_SELECTION_FOR_PAGER_ITEM" encode="html"><xts:param name="pagerItemName"><out:value-of select="xtsext:htmlencode(cm:defaultName)"/></xts:param></xts:string></out:attribute>
  398. <out:choose>
  399. <out:when test="cm:objectClass = 'configurationFolder' and $isConfig='true'">
  400. <out:choose>
  401. <out:when test="cm:hasChildren and cm:hasChildren != ''">
  402. <out:attribute name="name">checkbox_<out:value-of select="cm:objectClass"/>_<out:value-of select="cm:hasChildren"/>_<out:value-of select="position()"/></out:attribute>
  403. <out:if test="key('env-param',concat('checkbox_' , cm:objectClass , '_' , cm:hasChildren , '_' , position()))">
  404. <out:attribute name="checked">checked</out:attribute>
  405. </out:if>
  406. </out:when>
  407. <out:otherwise>
  408. <out:attribute name="name">checkbox_<out:value-of select="cm:objectClass"/>_<out:value-of select="position()"/></out:attribute>
  409. <out:if test="key('env-param',concat('checkbox_' , cm:objectClass , '_' , position()))">
  410. <out:attribute name="checked">checked</out:attribute>
  411. </out:if>
  412. </out:otherwise>
  413. </out:choose>
  414. </out:when>
  415. <out:otherwise>
  416. <out:attribute name="name">checkbox_<out:value-of select="position()"/></out:attribute>
  417. <out:if test="key('env-param',concat('checkbox_' , position()))">
  418. <out:attribute name="checked">checked</out:attribute>
  419. </out:if>
  420. </out:otherwise>
  421. </out:choose>
  422. </input>
  423. </out:when>
  424. <out:otherwise>&#160;</out:otherwise>
  425. </out:choose>
  426. </cp:columnContent>
  427. <cp:columnContent>
  428. <out:call-template name="gen-icon">
  429. <out:with-param name="hiddenObject" select="cm:hidden"/>
  430. </out:call-template>
  431. </cp:columnContent>
  432. <cp:columnContent scope="row">
  433. <img width="20" height="16" align="absmiddle" src="{'{$skin_images}'}path.gif">
  434. <out:attribute name="alt">
  435. <cf:do-the-path-link>
  436. <cf:param name="familytree">cm:ancestors</cf:param>
  437. <cf:param name="familymember">cm:defaultName</cf:param>
  438. <cf:param name="onlyAncestors">true</cf:param>
  439. </cf:do-the-path-link>
  440. </out:attribute>
  441. </img><xsl:text>&#160;</xsl:text>
  442. <out:choose>
  443. <out:when test="contains(concat(' ', $containers, ' '), concat(' ', cm:objectClass, ' ')) and contains(concat(' ', cm:permissions, ' '), ' traverse ')">
  444. <a>
  445. <out:attribute name="href">
  446. <out:call-template name="gen-url"/>
  447. </out:attribute>
  448. <out:value-of select="cm:defaultName"/>
  449. <out:if test="cm:userName != ''">
  450. <out:text> (</out:text>
  451. <out:value-of select="cm:userName"/>
  452. <out:text>)</out:text>
  453. </out:if>
  454. </a>
  455. </out:when>
  456. <out:when test="contains($hierarchy-objects, concat(' ', cm:objectClass, ' ')) and cm:hasChildren = 'true' and contains(concat(' ', cm:permissions, ' '), ' traverse ')">
  457. <a>
  458. <out:attribute name="href">
  459. <out:call-template name="gen-url"/>
  460. </out:attribute>
  461. <out:value-of select="cm:defaultName"/>
  462. <out:if test="cm:userName != ''">
  463. <out:text> (</out:text>
  464. <out:value-of select="cm:userName"/>
  465. <out:text>)</out:text>
  466. </out:if>
  467. </a>
  468. </out:when>
  469. <out:otherwise>
  470. <out:value-of select="cm:defaultName"/>
  471. <out:if test="cm:userName != ''">
  472. <out:text> (</out:text>
  473. <out:value-of select="cm:userName"/>
  474. <out:text>)</out:text>
  475. </out:if>
  476. </out:otherwise>
  477. </out:choose>
  478. <!-- Render the disabled icon if this entry is disabled -->
  479. <out:choose>
  480. <out:when test="cm:disabled = 'true'">
  481. <img height="16" width="16" hspace="4" align="absmiddle" src="{'{$image_root}'}state_disabled.gif">
  482. <out:attribute name="alt"><xts:string id="IDS_DISABLED"/></out:attribute>
  483. </img>
  484. </out:when>
  485. <out:when test="cm:target/*/cm:disabled = 'true' or cm:base/*/cm:disabled = 'true'">
  486. <img height="16" width="16" hspace="4" align="absmiddle" src="{'{$image_root}'}state_source_disabled.gif">
  487. <out:attribute name="alt"><xts:string id="IDS_DISABLED"/></out:attribute>
  488. </img>
  489. </out:when>
  490. </out:choose>
  491. </cp:columnContent>
  492. <cp:columnContent>
  493. <cp:columnCondition><out:value-of select="$showTenantInfo"/></cp:columnCondition>
  494. <out:value-of select="cm:tenantName"/>
  495. </cp:columnContent>
  496. <xsl:if test="@hideActions != 'true'">
  497. <cp:columnContent>
  498. <out:call-template name="action-properties">
  499. <xsl:for-each select="tool:row-actions/tool:action">
  500. <out:with-param>
  501. <xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute>
  502. <xsl:attribute name="select"><xsl:choose><xsl:when test="@test and @test != ''"><xsl:value-of select="@test"/></xsl:when><xsl:otherwise><xsl:value-of select="'true()'"/></xsl:otherwise></xsl:choose></xsl:attribute>
  503. </out:with-param>
  504. </xsl:for-each>
  505. </out:call-template>
  506. </cp:columnContent>
  507. </xsl:if>
  508. </out:when>
  509. <out:otherwise>
  510. <cp:columnContent>
  511. <out:choose>
  512. <out:when test="$selectables='allObjects' or (contains(concat(' ', $selectables, ' '), concat(' ', cm:objectClass, ' ')))">
  513. <input type="checkbox">
  514. <out:attribute name="value"><out:value-of select="xtsext:urlencode(string(cm:searchPath))"/></out:attribute>
  515. <out:attribute name="aria-label"><xts:string id="IDS_SELECTION_FOR_PAGER_ITEM" encode="html"><xts:param name="pagerItemName"><out:value-of select="xtsext:htmlencode(cm:defaultName)"/></xts:param></xts:string></out:attribute>
  516. <out:choose>
  517. <out:when test="cm:objectClass = 'dispatcher' or cm:objectClass = 'configurationFolder' ">
  518. <out:choose>
  519. <out:when test="cm:hasChildren and cm:hasChildren != ''">
  520. <out:attribute name="name">checkbox_<out:value-of select="cm:objectClass"/>_<out:value-of select="cm:hasChildren"/>_<out:value-of select="position()"/></out:attribute>
  521. <out:if test="key('env-param',concat('checkbox_' , cm:objectClass , '_' , cm:hasChildren , '_' , position()))">
  522. <out:attribute name="checked">checked</out:attribute>
  523. </out:if>
  524. </out:when>
  525. <out:otherwise>
  526. <out:attribute name="name">checkbox_<out:value-of select="cm:objectClass"/>_<out:value-of select="position()"/></out:attribute>
  527. <out:if test="key('env-param',concat('checkbox_' , cm:objectClass , '_' , position()))">
  528. <out:attribute name="checked">checked</out:attribute>
  529. </out:if>
  530. </out:otherwise>
  531. </out:choose>
  532. </out:when>
  533. <out:otherwise>
  534. <out:attribute name="name">checkbox_<out:value-of select="position()"/></out:attribute>
  535. <out:if test="key('env-param',concat('checkbox_' , position()))">
  536. <out:attribute name="checked">checked</out:attribute>
  537. </out:if>
  538. </out:otherwise>
  539. </out:choose>
  540. </input>
  541. </out:when>
  542. <out:otherwise>&#160;</out:otherwise>
  543. </out:choose>
  544. </cp:columnContent>
  545. <cp:columnContent>
  546. <out:variable name="class">
  547. <out:if test="cm:objectClass='shortcut'">
  548. <out:value-of select="*[local-name()='target']/*/*[local-name()='objectClass']"/>
  549. </out:if>
  550. </out:variable>
  551. <out:call-template name="gen-icon">
  552. <out:with-param name="hiddenObject" select="cm:hidden"/>
  553. <out:with-param name="class" select="$class"/>
  554. </out:call-template>
  555. </cp:columnContent>
  556. <xsl:if test="not(tool:columnContents)">
  557. <cp:columnContent scope="row">
  558. <out:choose>
  559. <out:when test="contains(concat(' ', $containers, ' '), concat(' ', cm:objectClass, ' ')) and contains(concat(' ', cm:permissions, ' '), ' traverse ')">
  560. <a>
  561. <out:attribute name="href">
  562. <out:call-template name="gen-url"/>
  563. </out:attribute>
  564. <out:value-of select="cm:defaultName"/>
  565. <out:if test="cm:userName != ''">
  566. <out:text> (</out:text>
  567. <out:value-of select="cm:userName"/>
  568. <out:text>)</out:text>
  569. </out:if>
  570. </a>
  571. </out:when>
  572. <out:when test="contains($hierarchy-objects, concat(' ', cm:objectClass, ' ')) and cm:hasChildren = 'true' and contains(concat(' ', cm:permissions, ' '), ' traverse ')">
  573. <a>
  574. <out:attribute name="href">
  575. <out:call-template name="gen-url"/>
  576. </out:attribute>
  577. <out:value-of select="cm:defaultName"/>
  578. <out:if test="cm:userName != ''">
  579. <out:text> (</out:text>
  580. <out:value-of select="cm:userName"/>
  581. <out:text>)</out:text>
  582. </out:if>
  583. </a>
  584. </out:when>
  585. <out:otherwise>
  586. <out:value-of select="cm:defaultName"/>
  587. <out:if test="cm:userName != ''">
  588. <out:text> (</out:text>
  589. <out:value-of select="cm:userName"/>
  590. <out:text>)</out:text>
  591. </out:if>
  592. </out:otherwise>
  593. </out:choose>
  594. <!-- Render the disabled icon if this entry is disabled -->
  595. <out:choose>
  596. <out:when test="cm:disabled = 'true'">
  597. <img height="16" width="16" hspace="4" align="absmiddle" src="{'{$image_root}'}state_disabled.gif">
  598. <out:attribute name="alt"><xts:string id="IDS_DISABLED"/></out:attribute>
  599. </img>
  600. </out:when>
  601. <out:when test="cm:target/*/cm:disabled = 'true' or cm:base/*/cm:disabled = 'true'">
  602. <img height="16" width="16" hspace="4" align="absmiddle" src="{'{$image_root}'}state_source_disabled.gif">
  603. <out:attribute name="alt"><xts:string id="IDS_DISABLED"/></out:attribute>
  604. </img>
  605. </out:when>
  606. </out:choose>
  607. </cp:columnContent>
  608. <cp:columnContent>
  609. <out:choose>
  610. <out:when test="cm:modificationTime!=''">
  611. <out:value-of select="xtsext:formatDateFromUTC(string(cm:modificationTime), number('2'), number('3'), string($timeZone), string($contentLocale))"/>
  612. </out:when>
  613. <out:otherwise>&#160;</out:otherwise>
  614. </out:choose>
  615. </cp:columnContent>
  616. </xsl:if>
  617. <xsl:apply-templates select="tool:columnContents/*"/>
  618. <cp:columnContent>
  619. <cp:columnCondition><out:value-of select="$showTenantInfo"/></cp:columnCondition>
  620. <out:value-of select="cm:tenantName"/>
  621. </cp:columnContent>
  622. <xsl:if test="@hideActions != 'true'">
  623. <cp:columnContent>
  624. <out:call-template name="action-properties">
  625. <xsl:for-each select="tool:row-actions/tool:action">
  626. <out:with-param>
  627. <xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute>
  628. <xsl:attribute name="select">
  629. <xsl:choose>
  630. <xsl:when test="@test and @test != ''">
  631. <xsl:value-of select="@test"/>
  632. </xsl:when>
  633. <xsl:otherwise><xsl:value-of select="'true()'"/></xsl:otherwise>
  634. </xsl:choose>
  635. </xsl:attribute>
  636. </out:with-param>
  637. </xsl:for-each>
  638. </out:call-template>
  639. </cp:columnContent>
  640. </xsl:if>
  641. </out:otherwise>
  642. </out:choose>
  643. </cp:tableContent>
  644. <cp:tableFooter>
  645. <xsl:apply-templates select="tool:columnFooters/*"/>
  646. </cp:tableFooter>
  647. </cf:param>
  648. </cf:main-pager-section>
  649. </out:when>
  650. </out:choose>
  651. <xsl:apply-templates select="*[not(self::tool:columns or self::tool:row-actions or self::tool:containers or self::tool:selectables or self::tool:hierarchy-objects)]"/>
  652. </xsl:template>
  653. <xsl:template match="tool:containers" priority="1">
  654. <xsl:apply-templates/>
  655. </xsl:template>
  656. <xsl:template match="tool:selectables" priority="1">
  657. <xsl:apply-templates/>
  658. </xsl:template>
  659. <xsl:template match="tool:hierarchy-objects" priority="1">
  660. <xsl:apply-templates/>
  661. </xsl:template>
  662. <xsl:template match="tool:row-actions" priority="1">
  663. <xsl:apply-templates/>
  664. </xsl:template>
  665. <xsl:template match="tool:action" priority="1">
  666. <xsl:apply-templates/>
  667. <out:text>&#160;</out:text>
  668. </xsl:template>
  669. <!--
  670. ===============================================================================================
  671. retrieve the name attribute or child tool:name element from the given node.
  672. ===============================================================================================
  673. -->
  674. <xsl:template name="get-tool-name">
  675. <xsl:param name="node"/>
  676. <xsl:choose>
  677. <xsl:when test="$node/@name">
  678. <out:text/>
  679. <xsl:value-of select="$node/@name"/>
  680. <out:text/>
  681. </xsl:when>
  682. <xsl:when test="$node/tool:name">
  683. <out:text/>
  684. <xsl:copy-of select="$node/tool:name/child::node()"/>
  685. <out:text/>
  686. </xsl:when>
  687. </xsl:choose>
  688. </xsl:template>
  689. <!--
  690. ===============================================================================================
  691. retrieve the name attribute or child tool:name element from the given node.
  692. ===============================================================================================
  693. -->
  694. <xsl:template name="gen-tabs">
  695. <xsl:param name="selected"/>
  696. <xsl:param name="tabset-name"/>
  697. <out:variable name="selected">
  698. <xsl:value-of select="$selected"/>
  699. </out:variable>
  700. <xsl:if test="$tabset-name != ''">
  701. <mt:h3>
  702. <mt:tabs>
  703. <out:variable name="tabs">
  704. <xsl:choose>
  705. <!-- Directory Tool tabs: (u) Users, Groups, and Roles; (d) Data Sources; (l) Distribution Lists and Contacts; (p) Printers. -->
  706. <xsl:when test="$tabset-name = 'directory'">
  707. <tab>
  708. <out:choose>
  709. <out:when test="not($tool-tab) or $tool-tab='u'">
  710. <out:attribute name="selected">true</out:attribute>
  711. <xts:string id="IDS_DIRECTORY_UGR_TAB"/>
  712. </out:when>
  713. <out:otherwise>
  714. <a class="tabAnchor">
  715. <xsl:attribute name="href">
  716. <xsl:value-of select="'{$gateway}'"/>?b_action=xts.run<xsl:text/>
  717. <xsl:text/>&amp;m=<xsl:value-of select="'{$app}'"/><xsl:value-of select="'/tools_directory.xts'"/><xsl:text/>
  718. <xsl:text/>&amp;m_path=<xsl:value-of select="'/directory'"/><xsl:text/>
  719. <xsl:text/>&amp;tool_tab=u&amp;backURL=<xsl:value-of select="'{$tool-back-url}'"/><xsl:text/>
  720. </xsl:attribute>
  721. <xts:string id="IDS_DIRECTORY_UGR_TAB"/>
  722. </a>
  723. </out:otherwise>
  724. </out:choose>
  725. </tab>
  726. <tab>
  727. <out:choose>
  728. <out:when test="$tool-tab='d'">
  729. <out:attribute name="selected">true</out:attribute>
  730. <xts:string id="IDS_DIRECTORY_DATASOURCE_TAB"/>
  731. </out:when>
  732. <out:otherwise>
  733. <a class="tabAnchor">
  734. <xsl:attribute name="href">
  735. <xsl:value-of select="'{$gateway}'"/>?b_action=xts.run<xsl:text/>
  736. <xsl:text/>&amp;m=<xsl:value-of select="'{$app}'"/><xsl:value-of select="'/tools_directory.xts'"/><xsl:text/>
  737. <xsl:text/>&amp;m_path={xtsext:protect(xtsext:urlencode('CAMID(&quot;:&quot;)'),'url','searchPath','getdata')}<xsl:text/>
  738. <xsl:text/>&amp;tool_tab=d&amp;backURL=<xsl:value-of select="'{$tool-back-url}'"/><xsl:text/>
  739. </xsl:attribute>
  740. <xts:string id="IDS_DIRECTORY_DATASOURCE_TAB"/>
  741. </a>
  742. </out:otherwise>
  743. </out:choose>
  744. </tab>
  745. <tab>
  746. <out:choose>
  747. <out:when test="$tool-tab='l'">
  748. <out:attribute name="selected">true</out:attribute>
  749. <xts:string id="IDS_DIRECTORY_DISTRLIST_TAB"/>
  750. </out:when>
  751. <out:otherwise>
  752. <a class="tabAnchor">
  753. <xsl:attribute name="href">
  754. <xsl:value-of select="'{$gateway}'"/>?b_action=xts.run<xsl:text/>
  755. <xsl:text/>&amp;m=<xsl:value-of select="'{$app}'"/><xsl:value-of select="'/tools_directory.xts'"/><xsl:text/>
  756. <xsl:text/>&amp;m_path={xtsext:protect(xtsext:urlencode('CAMID(&quot;:&quot;)'),'url','searchPath','getdata')}<xsl:text/>
  757. <xsl:text/>&amp;tool_tab=l&amp;backURL=<xsl:value-of select="'{$tool-back-url}'"/><xsl:text/>
  758. </xsl:attribute>
  759. <xts:string id="IDS_DIRECTORY_DISTRLIST_TAB"/>
  760. </a>
  761. </out:otherwise>
  762. </out:choose>
  763. </tab>
  764. <tab>
  765. <out:choose>
  766. <out:when test="$tool-tab='p'">
  767. <out:attribute name="selected">true</out:attribute>
  768. <xts:string id="IDS_DIRECTORY_PRINTER_TAB"/>
  769. </out:when>
  770. <out:otherwise>
  771. <a class="tabAnchor">
  772. <xsl:attribute name="href">
  773. <xsl:value-of select="'{$gateway}'"/>?b_action=xts.run<xsl:text/>
  774. <xsl:text/>&amp;m=<xsl:value-of select="'{$app}'"/><xsl:value-of select="'/tools_directory.xts'"/><xsl:text/>
  775. <xsl:text/>&amp;m_path={xtsext:protect(xtsext:urlencode('CAMID(&quot;:&quot;)'),'url','searchPath','getdata')}<xsl:text/>
  776. <xsl:text/>&amp;tool_tab=p&amp;backURL=<xsl:value-of select="'{$tool-back-url}'"/><xsl:text/>
  777. </xsl:attribute>
  778. <xts:string id="IDS_DIRECTORY_PRINTER_TAB"/>
  779. </a>
  780. </out:otherwise>
  781. </out:choose>
  782. </tab>
  783. </xsl:when>
  784. <!-- Server Administration tabs: (m) Monitor; (c) Configure. -->
  785. <xsl:when test="$tabset-name = 'server'">
  786. <tab>
  787. <out:choose>
  788. <out:when test="not($tool-tab) or $tool-tab='m'">
  789. <out:attribute name="selected">true</out:attribute>
  790. <xts:string id="IDS_SERVICE_MONITOR"/>
  791. </out:when>
  792. <out:otherwise>
  793. <a class="tabAnchor">
  794. <xsl:attribute name="href">
  795. <xsl:value-of select="'{$gateway}'"/>?b_action=xts.run<xsl:text/>
  796. <xsl:text/>&amp;m=<xsl:value-of select="'{$app}'"/><xsl:value-of select="'/tools_service_monitor.xts'"/><xsl:text/>
  797. <xsl:text/>&amp;m_path=<xsl:value-of select="'{$tool-path}'"/><xsl:text/>
  798. <xsl:text/>&amp;backURL=<xsl:value-of select="'{$tool-back-url}'"/><xsl:text/>
  799. </xsl:attribute>
  800. <cp:label><xts:string id="IDS_SERVICE_MONITOR"/></cp:label>
  801. </a>
  802. </out:otherwise>
  803. </out:choose>
  804. </tab>
  805. <tab>
  806. <out:choose>
  807. <out:when test="not($tool-tab) or $tool-tab='c'">
  808. <out:attribute name="selected">true</out:attribute>
  809. <xts:string id="IDS_SERVICE_CONFIG"/>
  810. </out:when>
  811. <out:otherwise>
  812. <a class="tabAnchor">
  813. <xsl:attribute name="href">
  814. <xsl:value-of select="'{$gateway}'"/>?b_action=xts.run<xsl:text/>
  815. <xsl:text/>&amp;m=<xsl:value-of select="'{$app}'"/><xsl:value-of select="'/tools_service_config.xts'"/><xsl:text/>
  816. <xsl:text/>&amp;m_path=<xsl:value-of select="'{$tool-path}'"/><xsl:text/>
  817. <xsl:text/>&amp;backURL=<xsl:value-of select="'{$tool-back-url}'"/><xsl:text/>
  818. </xsl:attribute>
  819. <cp:label><xts:string id="IDS_SERVICE_CONFIG"/></cp:label>
  820. </a>
  821. </out:otherwise>
  822. </out:choose>
  823. </tab>
  824. </xsl:when>
  825. </xsl:choose>
  826. </out:variable>
  827. <out:call-template name="renderTabs">
  828. <out:with-param name="tabs" select="$tabs"/>
  829. <out:with-param name="scroll" select="false()"/>
  830. </out:call-template>
  831. </mt:tabs>
  832. </mt:h3>
  833. </xsl:if>
  834. </xsl:template>
  835. <!--
  836. ===============================================================================================
  837. Generate path string from ancestors property.
  838. ===============================================================================================
  839. -->
  840. <xsl:template match="tool:gen-path-str" priority="1">
  841. <out:template name="gen-path-str">
  842. <out:param name="ancestorsInfo"/>
  843. <out:for-each select="$ancestorsInfo/child::cm:ancestorInfo">
  844. <out:choose>
  845. <out:when test="following-sibling::*">
  846. <out:value-of select="concat(string(./cm:title), ' > ')"/>
  847. </out:when>
  848. <out:otherwise>
  849. <out:value-of select="./cm:title"/>
  850. </out:otherwise>
  851. </out:choose>
  852. </out:for-each>
  853. </out:template>
  854. </xsl:template>
  855. <!--
  856. ===============================================================================================
  857. The main engine
  858. ===============================================================================================
  859. -->
  860. <xsl:template match="*[namespace-uri() = $tool-namespace-uri]" priority="0">
  861. <xsl:comment>Ignoring <xsl:value-of select="name()"/> element.</xsl:comment>
  862. </xsl:template>
  863. <xsl:template match="*">
  864. <xsl:copy>
  865. <xsl:copy-of select="@*"/>
  866. <xsl:apply-templates/>
  867. </xsl:copy>
  868. </xsl:template>
  869. </xsl:stylesheet>