settings.xslt 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: cogadmin
  5. (C) Copyright IBM Corp. 2005, 2017
  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:cm="http://developer.cognos.com/schemas/bibus/3/"
  15. xmlns:ui="http://developer.cognos.com/schemas/ui/presentation/markup/"
  16. xmlns:uic="http://developer.cognos.com/schemas/uic/presentation/markup/"
  17. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  18. xmlns:admui="http://developer.cognos.com/schemas/xts/admui"
  19. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  20. exclude-result-prefixes="xsl xts ui uic cm admui xtsext">
  21. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
  22. <!--xsl:key name="parameter" match="/root/config/section/parameter" use="@name"/-->
  23. <admui:variables/>
  24. <xsl:template match="/root">
  25. <uic:fragment xmlns:uic="http://developer.cognos.com/schemas/uic/presentation/markup/">
  26. <xsl:variable name="permissions">
  27. <xsl:value-of select="/root/cm:queryResponse/*/item[1]/queryResult/item/permissions/value"/>
  28. </xsl:variable>
  29. <xsl:variable name="storeid">
  30. <xsl:value-of select="/root/cm:queryResponse/*/item[1]/queryResult/item/storeID/value"/>
  31. </xsl:variable>
  32. <xsl:variable name="defaultName">
  33. <xsl:value-of select="xtsext:urlencode(string(/root/cm:queryResponse/*/item[1]/queryResult/item/defaultName/value))"/>
  34. </xsl:variable>
  35. <xsl:variable name="heightOffset">
  36. <xsl:choose>
  37. <xsl:when test="$storeid != ''"><xsl:value-of select="-62"/></xsl:when>
  38. <xsl:otherwise><xsl:value-of select="-40"/></xsl:otherwise>
  39. </xsl:choose>
  40. </xsl:variable>
  41. <script>
  42. <xsl:variable name="progressImage">
  43. <admui:imageURL image="progress.gif" type="cogadmin"/>
  44. </xsl:variable>
  45. _THIS_onCadminWindowstateChange = function (evt) {
  46. if (evt.source != _THIS_)
  47. switch (evt.payload){
  48. case "minimized":
  49. _THIS_.cogadminWindowState = "extended";
  50. setContentTableHeight ("_THIS_","extended",2);
  51. break;
  52. case "normal":
  53. _THIS_.cogadminWindowState = null;
  54. setContentTableHeight ("_THIS_","normal",2);
  55. break;
  56. default:
  57. }
  58. return true;
  59. }
  60. regFragEvent(_THIS_,"cogadmin.fragment.windowstate.change",_THIS_onCadminWindowstateChange);
  61. _THIS_onWindowstateChange = function (evt) {
  62. var winState = evt.payload.newWindowState;
  63. if (winState == "normal" &amp;&amp; _THIS_.cogadminWindowState)
  64. winState = _THIS_.cogadminWindowState;
  65. setContentTableHeight ("_THIS_",winState,2);
  66. _THIS_.raiseEvent("cogadmin.fragment.windowstate.change",evt.payload.newWindowState);
  67. return true;
  68. }
  69. regFragEvent(_THIS_,"fragment.windowstate.change",_THIS_onWindowstateChange);
  70. _THIS_adjustFrgSize = function (evt) {
  71. var winState = _THIS_.cogadminWindowState || _THIS_.windowState;
  72. setContentTableHeight ("_THIS_",winState,2);
  73. return true;
  74. }
  75. //the reason for the following line is the fragment.addEventListener won't work for fragment.resize event
  76. _THIS_.onresize = _THIS_adjustFrgSize;
  77. regFragEvent(_THIS_,"fragment.load",_THIS_adjustFrgSize);
  78. initPopup('<xsl:value-of select="xtsext:javascriptencode(string($progressImage))"/>', '<xts:string id="IDS_ADM_MESSAGE_STOP" encode="javascript"/>');
  79. function closeSettingsDialog() {
  80. ui_modal_dialog.close();
  81. raiseReloadEvent(_THIS_);
  82. }
  83. _THIS_onReloadEvent = function(evt) {
  84. if (evt.source != _THIS_) {
  85. removeReloadEventListener(_THIS_, "_THIS_onReloadEvent");
  86. _THIS_.retrieve();
  87. }
  88. }
  89. addReloadEventListener(_THIS_,"_THIS_onReloadEvent");
  90. </script>
  91. <xsl:variable name="hasReadPermission" select="contains($permissions, 'read')"/>
  92. <xsl:variable name="mclass" select="/root/cm:queryResponse/*/item[1]/queryResult/item/objectClass/value"/>
  93. <xsl:variable name="isRolapDatasource" select ="$mclass='rolapDataSource' or $mclass='rolapVirtualDataSource'"/>
  94. <xsl:if test="$hasReadPermission and $storeid != '' and not($isRolapDatasource)">
  95. <!-- construct the url -->
  96. <xsl:variable name="url" select="concat(/root/configProps/param[@name = 'cps']/property[@name ='gateway']/., '?b_action=xts.run&amp;m=portal/properties_settings.xts&amp;m_class=', $mclass, '&amp;m_path=storeID(%22', $storeid, '%22)&amp;m_obj=storeID(%22', $storeid, '%22)&amp;m_name=', $defaultName, '&amp;backURL=javascript:parent._THIS_callBack();')"/>
  97. <table width="100%" cellpadding="0" cellspacing="0">
  98. <tr>
  99. <td align="right">
  100. <uic:icon>
  101. <uic:src>
  102. <admui:imageURL image="action_properties.gif" type="common"/>
  103. </uic:src>
  104. <uic:tooltip>
  105. <xts:string id="IDS_ADM_ACT_SET_PROPERTIES_TOOLTIP"/>
  106. </uic:tooltip>
  107. <uic:onclick>ui_modal_dialog.open('<xsl:value-of select="xtsext:javascriptencode(string($url))"/>',false,true,true)</uic:onclick>
  108. </uic:icon>
  109. </td>
  110. </tr>
  111. </table>
  112. </xsl:if>
  113. <xsl:variable name="height">
  114. <xsl:choose>
  115. <xsl:when test="$storeid != ''">210px</xsl:when>
  116. <xsl:otherwise>232px</xsl:otherwise>
  117. </xsl:choose>
  118. </xsl:variable>
  119. <uic:table width="100%" id="_THIS_contentTable">
  120. <xsl:choose>
  121. <xsl:when test="$hasReadPermission or $storeid = ''">
  122. <uic:features>
  123. <uic:name>table_fragment</uic:name>
  124. <uic:scrollable/>
  125. <uic:gridView/>
  126. <uic:type>group</uic:type>
  127. <uic:hideTenant>true</uic:hideTenant>
  128. <ui:tableFeatures/>
  129. <uic:collapsed>true</uic:collapsed>
  130. <uic:aria-label>
  131. <xts:transform name="XMLEncode">
  132. <xts:string id="IDS_ADM_SET_HEADER">
  133. <xts:param name="objName"><xsl:value-of select="/root/metadata/*[local-name()='GetMultipleResourcePropertiesResponse']/*[local-name()='Caption']"/></xts:param>
  134. </xts:string>
  135. </xts:transform>
  136. </uic:aria-label>
  137. </uic:features>
  138. <uic:header>
  139. <uic:row>
  140. <uic:column width="75%">
  141. <uic:text>
  142. <xts:string id="IDS_ADM_SET_TABLE_HEADER_NAME"/>
  143. </uic:text>
  144. </uic:column>
  145. <uic:column width="25%">
  146. <uic:text>
  147. <xts:string id="IDS_ADM_SET_TABLE_HEADER_VALUE"/>
  148. </uic:text>
  149. </uic:column>
  150. </uic:row>
  151. </uic:header>
  152. <uic:body>
  153. <!-- Process each of the possible groups -->
  154. <xsl:for-each select="/root/config/*">
  155. <xsl:variable name="section" select="."/>
  156. <xsl:variable name="groupLabel" select="$section/@label"/>
  157. <xsl:variable name="groupName" select="$section/@name"/>
  158. <xsl:variable name="groupPosition" select="position()"/>
  159. <xsl:variable name="groupDesc" select="$section/@description"/>
  160. <!-- handle all the properties that belong to a group -->
  161. <xsl:for-each select="/root/cm:queryResponse/*/item[1]/queryResult/item/*[$section/parameter/@name = local-name()]">
  162. <xsl:sort select="name" order="ascending" lang="{/root/contentLocale}"/>
  163. <xsl:variable name="propertyName" select="local-name()"/>
  164. <xsl:variable name="propertyValue" select="./value"/>
  165. <xsl:variable name="propertyPosition" select="position()"/>
  166. <xsl:variable name="propertyDesc" select="$section/parameter[@name = string($propertyName)]/@description"/>
  167. <xsl:variable name="propertyType" select="@*[local-name()='type']"/>
  168. <xsl:if test="$groupName != 'advancedSettings' or ($groupName = 'advancedSettings' and count(./value/settings/*) != 0)">
  169. <xsl:if test="position() = 1">
  170. <xsl:text disable-output-escaping="yes">&lt;uic:group collapsible="true" collapsed="true" onExpand="alert('on expand function')" onCollapse="alert('on collapse function')"&gt;</xsl:text>
  171. <xsl:call-template name="settingGroup">
  172. <xsl:with-param name="name" select="$groupName"/>
  173. <xsl:with-param name="label" select="$groupLabel"/>
  174. <xsl:with-param name="position" select="$groupPosition"/>
  175. <xsl:with-param name="desc" select="$groupDesc"/>
  176. </xsl:call-template>
  177. </xsl:if>
  178. <xsl:variable name="name">
  179. <xsl:choose>
  180. <xsl:when test="$section/parameter[@name = string($propertyName)]/@label != ''">
  181. <xsl:value-of select="$section/parameter[@name = string($propertyName)]/@label"/>
  182. </xsl:when>
  183. <xsl:otherwise>
  184. <xsl:value-of select="$section/parameter[@name = string($propertyName)]/@name"/>
  185. </xsl:otherwise>
  186. </xsl:choose>
  187. </xsl:variable>
  188. <!-- replace the value by its label if found. In general, they are enumeration. -->
  189. <xsl:variable name="value">
  190. <xsl:choose>
  191. <xsl:when test="$section/parameter[@name = string($propertyName) and @ns !='']/enum[concat(../@ns,@value) = string($propertyValue)]/@label != ''">
  192. <xsl:value-of select="$section/parameter[@name = string($propertyName)]/enum[concat(../@ns,@value) = string($propertyValue)]/@label"/>
  193. </xsl:when>
  194. <xsl:when test="$section/parameter[@name = string($propertyName)]/enum[@value = string($propertyValue)]/@label != ''">
  195. <xsl:value-of select="$section/parameter[@name = string($propertyName)]/enum[@value = string($propertyValue)]/@label"/>
  196. </xsl:when>
  197. <xsl:otherwise>
  198. <xsl:value-of select="$propertyValue"/>
  199. </xsl:otherwise>
  200. </xsl:choose>
  201. </xsl:variable>
  202. <xsl:choose>
  203. <xsl:when test="$propertyName = 'advancedSettings'">
  204. <xsl:for-each select="./value/settings/*">
  205. <xsl:call-template name="settingRow">
  206. <xsl:with-param name="name" select="@name"/>
  207. <xsl:with-param name="desc" select="$propertyDesc"/>
  208. <xsl:with-param name="value" select="."/>
  209. <xsl:with-param name="position" select="concat($groupPosition,'_',$propertyPosition,'_',position())"/>
  210. </xsl:call-template>
  211. </xsl:for-each>
  212. </xsl:when>
  213. <xsl:when test="$propertyName = 'serviceDefaultOptions'"/><!--Do nothing (Skip). It's handled within 'overrideOptions' below-->
  214. <xsl:when test="$propertyName = 'overrideOptions'">
  215. <xsl:variable name="current" select="."/>
  216. <xsl:for-each select="$section/parameter[@name = string($propertyName)]/enum">
  217. <xsl:variable name="enum" select="@value"/>
  218. <xsl:variable name="serviceDefaultOptionsProp" select="/root/cm:queryResponse/*/item[1]/queryResult/item/*[local-name()='serviceDefaultOptions']/value/item[name=$enum]/value"/>
  219. <xsl:variable name="enumValue" select="count($serviceDefaultOptionsProp) &gt; 0 and $serviceDefaultOptionsProp='true'"/>
  220. <xsl:variable name="canOverride" select="count($propertyValue/item[name=$enum]/value) != 1"/>
  221. <xsl:variable name="overrideOption">
  222. <xsl:choose>
  223. <xsl:when test="$canOverride">
  224. <xsl:choose>
  225. <xsl:when test="$enumValue='true'">
  226. <uic:text><xts:string id="IDS_ADM_SET_BOOL_OVERRIDE_USER_SELECTED"/></uic:text>
  227. </xsl:when>
  228. <xsl:otherwise>
  229. <uic:text><xts:string id="IDS_ADM_SET_BOOL_OVERRIDE_USER_NOT_SELECTED"/></uic:text>
  230. </xsl:otherwise>
  231. </xsl:choose>
  232. </xsl:when>
  233. <xsl:otherwise>
  234. <xsl:choose>
  235. <xsl:when test="$enumValue='true'">
  236. <uic:text><xts:string id="IDS_ADM_SET_BOOL_OVERRIDE_ALWAYS"/></uic:text>
  237. </xsl:when>
  238. <xsl:otherwise>
  239. <uic:text><xts:string id="IDS_ADM_SET_BOOL_OVERRIDE_NEVER"/></uic:text>
  240. </xsl:otherwise>
  241. </xsl:choose>
  242. </xsl:otherwise>
  243. </xsl:choose>
  244. </xsl:variable>
  245. <xsl:call-template name="settingRow">
  246. <xsl:with-param name="name" select="@label"/>
  247. <xsl:with-param name="desc" select="$propertyDesc"/>
  248. <xsl:with-param name="value" select="$overrideOption"/>
  249. <xsl:with-param name="position" select="concat($groupPosition,'_',$propertyPosition,'_',position())"/>
  250. </xsl:call-template>
  251. </xsl:for-each>
  252. </xsl:when>
  253. <xsl:when test="$propertyName = 'qsROLAPCubeConfigurations' and ($mclass = 'configuration' or $mclass = 'configurationFolder' or $mclass = 'dispatcher')"/>
  254. <xsl:when test="$propertyName = 'qsROLAPCubeConfigurations' and not($mclass = 'configuration' or $mclass = 'configurationFolder' or $mclass = 'dispatcher')">
  255. <xsl:variable name="cubeCfgsValue">
  256. <xsl:for-each select="/root/rolapDatasources/cm:queryResponse/*/item[1]/queryResult/item/*[local-name()='defaultName']/value">
  257. <xsl:sort select="." order="ascending" lang="{/root/contentLocale}"/>
  258. <xsl:value-of select="."/>
  259. <xsl:value-of select="' '"/>
  260. </xsl:for-each>
  261. </xsl:variable>
  262. <xsl:variable name="ellipsis"><xts:string id="IDS_LIST_ELLIPSIS"/></xsl:variable>
  263. <xsl:variable name="visibleCubeCfgsValue">
  264. <xsl:choose>
  265. <xsl:when test="string-length($cubeCfgsValue) > 45">
  266. <xsl:value-of select="concat(substring($cubeCfgsValue,1,42),$ellipsis)"/>
  267. </xsl:when>
  268. <xsl:otherwise><xsl:value-of select="$cubeCfgsValue"/></xsl:otherwise>
  269. </xsl:choose>
  270. </xsl:variable>
  271. <xsl:call-template name="settingRow">
  272. <xsl:with-param name="name" select="$name"/>
  273. <xsl:with-param name="desc" select="$propertyDesc"/>
  274. <xsl:with-param name="value" select="$visibleCubeCfgsValue"/>
  275. <xsl:with-param name="position" select="concat($groupPosition,'_',$propertyPosition,'_',position())"/>
  276. </xsl:call-template>
  277. </xsl:when>
  278. <xsl:when test="$propertyName = 'jmxProxyHostDispatchers'">
  279. <xsl:variable name="url-safe-searchPath" select="xtsext:protect(xtsext:urlencode(concat('storeID(&quot;',$storeid,'&quot;)')),'url','searchPath','getData')"/>
  280. <xsl:variable name="url" select="concat('?b_action=xts.run&amp;m=portal/settings_jmxProxyHostDispatchers.xts&amp;m=cogadmin/settings.xts&amp;controller_state=readonly&amp;m_class=', $mclass, '&amp;m_path=',$url-safe-searchPath,'&amp;m_obj=',$url-safe-searchPath,'&amp;m_name=', $defaultName, '&amp;backURL=javascript:parent._THIS_callBack();')"/>
  281. <xsl:call-template name="settingRow">
  282. <xsl:with-param name="name" select="$name"/>
  283. <xsl:with-param name="desc" select="$propertyDesc"/>
  284. <xsl:with-param name="guiType" select="'link'"/>
  285. <xsl:with-param name="value">
  286. <xsl:if test="count(./value/item) &gt; 0">
  287. <text><xts:string id="IDS_ADM_SET_LINK_VIEW"/></text>
  288. <onclick>ui_modal_dialog.open('<xsl:value-of select="xtsext:javascriptencode(string($url))"/>',false,true,true)</onclick>
  289. </xsl:if>
  290. </xsl:with-param>
  291. <xsl:with-param name="position" select="concat($groupPosition,'_',$propertyPosition,'_',position())"/>
  292. </xsl:call-template>
  293. </xsl:when>
  294. <xsl:otherwise>
  295. <xsl:call-template name="settingRow">
  296. <xsl:with-param name="name" select="$name"/>
  297. <xsl:with-param name="desc" select="$propertyDesc"/>
  298. <xsl:with-param name="value" select="$value"/>
  299. <xsl:with-param name="position" select="concat($groupPosition,'_',$propertyPosition)"/>
  300. <xsl:with-param name="type" select="$section/parameter[@name = string($propertyName)]/@type"/>
  301. <xsl:with-param name="guiType" select="$section/parameter[@name = string($propertyName)]/@guiType"/>
  302. <xsl:with-param name="propType" select="$propertyType"/>
  303. </xsl:call-template>
  304. </xsl:otherwise>
  305. </xsl:choose>
  306. <xsl:if test="position() = last()">
  307. <xsl:text disable-output-escaping="yes">&lt;/uic:group&gt;</xsl:text>
  308. </xsl:if>
  309. </xsl:if>
  310. </xsl:for-each>
  311. </xsl:for-each>
  312. </uic:body>
  313. </xsl:when>
  314. <xsl:otherwise>
  315. <uic:body>
  316. <uic:row>
  317. <uic:column>
  318. <uic:text><xts:string id="IDS_ADM_SET_NO_PERMISSION"/></uic:text>
  319. </uic:column>
  320. </uic:row>
  321. </uic:body>
  322. </xsl:otherwise>
  323. </xsl:choose>
  324. <uic:footer displayLastUpdate="true" />
  325. </uic:table>
  326. </uic:fragment>
  327. </xsl:template>
  328. <xsl:template name="settingRow">
  329. <xsl:param name="name" select="''"/>
  330. <xsl:param name="desc" select="''"/>
  331. <xsl:param name="value" select="''"/>
  332. <xsl:param name="position" select="''"/>
  333. <xsl:param name="type" select="''"/>
  334. <xsl:param name="guiType" select="''"/>
  335. <xsl:param name="propType" select="''"/>
  336. <xsl:variable name="displayValue">
  337. <xsl:choose>
  338. <xsl:when test="$guiType = 'nilInt' and $value=''">
  339. <uic:text>
  340. <xts:string id="IDS_ADM_SET_PROPERTIES_UNLIMITED_VALUE"/>
  341. </uic:text>
  342. </xsl:when>
  343. <xsl:when test="$propType='cm:durationProp'">
  344. <xsl:variable name="daysDisplay"><xts:string id="IDS_PROP_DAYS"/></xsl:variable>
  345. <xsl:variable name="monthsDisplay"><xts:string id="IDS_PROP_MONTHS"/></xsl:variable>
  346. <xsl:variable name="hoursDisplay"><xts:string id="IDS_PROP_SETTINGS_UNITS_HOUR"/></xsl:variable>
  347. <xsl:variable name="minutesDisplay"><xts:string id="IIDS_PROP_SETTINGS_UNITS_MIN"/></xsl:variable>
  348. <xsl:variable name="secondsDisplay"><xts:string id="IDS_PROP_SETTINGS_UNITS_SEC"/></xsl:variable>
  349. <xsl:variable name="days">
  350. <xsl:value-of select="substring-before(substring-after($value,'P'),'D')"/>
  351. </xsl:variable>
  352. <xsl:variable name="months">
  353. <xsl:value-of select="substring-before(substring-after($value,'P'),'M')"/>
  354. </xsl:variable>
  355. <xsl:variable name="hours">
  356. <xsl:value-of select="substring-before(substring-after($value,'T'),'H')"/>
  357. </xsl:variable>
  358. <xsl:variable name="minutes">
  359. <xsl:value-of select="substring-before(substring-after($value,'T'),'M')"/>
  360. </xsl:variable>
  361. <xsl:variable name="seconds">
  362. <xsl:value-of select="substring-before(substring-after($value,'T'),'S')"/>
  363. </xsl:variable>
  364. <uic:text>
  365. <xsl:choose>
  366. <xsl:when test="$days!=''"><xsl:value-of select="concat($days,' ',$daysDisplay)"/></xsl:when>
  367. <xsl:when test="$months!=''"><xsl:value-of select="concat($months,' ',$monthsDisplay)"/></xsl:when>
  368. <xsl:when test="$hours!=''"><xsl:value-of select="concat($hours,' ',$hoursDisplay)"/></xsl:when>
  369. <xsl:when test="$minutes!=''"><xsl:value-of select="concat($minutes,' ',$minutesDisplay)"/></xsl:when>
  370. <xsl:when test="$seconds!=''"><xsl:value-of select="concat($seconds,' ',$secondsDisplay)"/></xsl:when>
  371. </xsl:choose>
  372. </uic:text>
  373. </xsl:when>
  374. <xsl:when test="$propType='cm:floatProp'">
  375. <uic:text>
  376. <xsl:variable name="numberPattern">
  377. <xsl:value-of select="string('#,##0.0################')"/>
  378. </xsl:variable>
  379. <xsl:value-of select="xtsext:formatNumber($value,$numberPattern,string($contentLocale), number(1))"/>
  380. </uic:text>
  381. </xsl:when>
  382. <xsl:otherwise>
  383. <uic:text>
  384. <xsl:value-of select="$value"/>
  385. </uic:text>
  386. </xsl:otherwise>
  387. </xsl:choose>
  388. </xsl:variable>
  389. <uic:row>
  390. <uic:column height="15">
  391. <uic:name>
  392. <xsl:choose>
  393. <xsl:when test="xtsext:javascriptencode(string($desc)) = ''">
  394. <uic:text>
  395. <xsl:value-of select="$name"/>
  396. </uic:text>
  397. </xsl:when>
  398. <xsl:otherwise>
  399. <script>
  400. var g__THIS_<xsl:value-of select="$position"/>_itemcaption = new ui_tooltip(
  401. {
  402. id: '<xsl:value-of select="xtsext:javascriptencode(string($position))"/>',
  403. items: [
  404. new captionTooltipRenderer('<xts:string id="IDS_ADM_TOO_DESCRIPTION" encode="javascript"/>','<xsl:value-of select="xtsext:javascriptencode(string($desc))"/>')
  405. ]
  406. });
  407. </script>
  408. <uic:tooltipText id="{concat($position,'_itemcaption')}" onmouseover="g__THIS_{$position}_itemcaption.show(event);" onmouseout="g__THIS_{$position}_itemcaption.hide(event);" onmousemove="g__THIS_{$position}_itemcaption.mousemove(event);">
  409. <xsl:value-of select="$name"/>
  410. </uic:tooltipText>
  411. </xsl:otherwise>
  412. </xsl:choose>
  413. </uic:name>
  414. </uic:column>
  415. <uic:column nowrap="nowrap">
  416. <xsl:choose>
  417. <xsl:when test="$type = 'xsd:boolean'">
  418. <uic:icon>
  419. <uic:tooltip>
  420. <xsl:choose>
  421. <xsl:when test="$value = 'true'">
  422. <xts:string id="IDS_FLT_STATUS_ENABLED"/>
  423. </xsl:when>
  424. <xsl:otherwise>
  425. <xts:string id="IDS_FLT_STATUS_DISABLED"/>
  426. </xsl:otherwise>
  427. </xsl:choose>
  428. </uic:tooltip>
  429. <uic:src>
  430. <xsl:choose>
  431. <xsl:when test="$value = 'true'">
  432. <admui:imageURL image="checkbox_checked.gif" type="common"/>
  433. </xsl:when>
  434. <xsl:otherwise>
  435. <admui:imageURL image="checkbox_unchecked.gif" type="common"/>
  436. </xsl:otherwise>
  437. </xsl:choose>
  438. </uic:src>
  439. </uic:icon>
  440. </xsl:when>
  441. <xsl:when test="$guiType='link' and $value/text">
  442. <uic:link>
  443. <uic:text><xsl:value-of select="$value/text"/></uic:text>
  444. <uic:href>#</uic:href>
  445. <uic:onclick>
  446. <xsl:value-of select="$value/onclick"/>
  447. </uic:onclick>
  448. </uic:link>
  449. </xsl:when>
  450. <xsl:otherwise>
  451. <uic:text>
  452. <xsl:choose>
  453. <xsl:when test="$displayValue!=''">
  454. <xsl:value-of select="$displayValue"/>
  455. </xsl:when>
  456. <xsl:otherwise>
  457. <xts:string id="IDS_ADM_SET_EMPTY"/>
  458. </xsl:otherwise>
  459. </xsl:choose>
  460. </uic:text>
  461. </xsl:otherwise>
  462. </xsl:choose>
  463. </uic:column>
  464. </uic:row>
  465. </xsl:template>
  466. <xsl:template name="settingGroup">
  467. <xsl:param name="name" select="''"/>
  468. <xsl:param name="label" select="''"/>
  469. <xsl:param name="position" select="''"/>
  470. <xsl:param name="desc" select="''"/>
  471. <xsl:variable name="dspName">
  472. <xsl:choose>
  473. <xsl:when test="$label = ''">
  474. <xsl:value-of select="$name"/>
  475. </xsl:when>
  476. <xsl:otherwise>
  477. <xsl:value-of select="$label"/>
  478. </xsl:otherwise>
  479. </xsl:choose>
  480. </xsl:variable>
  481. <uic:name>
  482. <xsl:choose>
  483. <xsl:when test="xtsext:javascriptencode(string($desc)) = ''">
  484. <xsl:value-of select="$dspName"/>
  485. </xsl:when>
  486. <xsl:otherwise>
  487. <script>
  488. var g__THIS_<xsl:value-of select="$position"/>_groupcaption = new ui_tooltip(
  489. {
  490. id: '<xsl:value-of select="xtsext:javascriptencode(string($position))"/>',
  491. items: [
  492. new captionTooltipRenderer('<xts:string id="IDS_ADM_TOO_DESCRIPTION" encode="javascript"/>','<xsl:value-of select="xtsext:javascriptencode(string($desc))"/>')
  493. ]
  494. });
  495. </script>
  496. <uic:tooltipText id="{concat($position,'_groupcaption')}" onmouseover="g__THIS_{$position}_groupcaption.show(event);" onmouseout="g__THIS_{$position}_groupcaption.hide(event);" onmousemove="g__THIS_{$position}_groupcaption.mousemove(event);">
  497. <xsl:value-of select="$dspName"/>
  498. </uic:tooltipText>
  499. </xsl:otherwise>
  500. </xsl:choose>
  501. </uic:name>
  502. </xsl:template>
  503. </xsl:stylesheet>