tools_service_monitor.xts 59 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294
  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. <xts:morphlet xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="messages/portal.xml, messages/portalRL.xml" requiredCapability="canUseAdministrationPortal">
  13. <!--
  14. ===============================================================================================
  15. If external backURLs are not allowed then verify the backURL is in the crn domain and replace it if it isn't
  16. ===============================================================================================
  17. -->
  18. <xts:block id="secureBackURL" path="portal/secureBackURL.xml" processor="XSLT" type="exec" condition=".[/root/system/param[@name = 'allowExternalURLs'] = 'false']" mandatory="false"/>
  19. <!--
  20. ===============================================================================================
  21. Saves cut/copied entries in a user session - Only executes after a cut or a copy operation.
  22. ===============================================================================================
  23. -->
  24. <xts:block id="groupEdit" path="portal/set_clipboard.xml" processor="XSLT" type="exec" mandatory="false" condition=".[/root/env/param[@name='editentries']]">
  25. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  26. <xts:logicsheet path="logicsheets/portal.xsl"/>
  27. </xts:block>
  28. <!-- ======================================================== -->
  29. <!-- Session Management -->
  30. <!-- ======================================================== -->
  31. <!-- Reads session-sensitive info from CM -->
  32. <xts:block processor="XSLT" type="exec" mandatory="false"
  33. id="refreshSession"
  34. path="portal/cc/read_session.xml"
  35. condition=".[
  36. string(/root/cookies/cookie[@name = 'cc_session']) = ''
  37. or /root/env/param[@name='m_reload']
  38. or /root/env/param[@name='m_root'] ]">
  39. <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
  40. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  41. </xts:block>
  42. <!-- Update the <session> element for this request. -->
  43. <xts:block id="buildSession" path="portal/session.xml" dependency="refreshSession secureBackURL" processor="XSLT" type="exec"
  44. condition=".[
  45. /root/newSession
  46. or /root/env/param[@name='ui']
  47. or /root/env/param[@name='d']
  48. or /root/env/param[starts-with(@name,'m_s_')]
  49. or /root/env/param[@name = 'resetSort'] ]"
  50. mandatory="false"/>
  51. <!-- Save changes to the state info in a cookie -->
  52. <xts:block mode="interpret" processor="XSLT" type="exec"
  53. id="setSession"
  54. path="portal/set_session.xml"
  55. dependency="buildSession groupEdit getContent"
  56. condition=".[/root/updateSession]"
  57. mandatory="false"/>
  58. <!--
  59. ===============================================================================================
  60. Load class names map
  61. ===============================================================================================
  62. -->
  63. <xts:block id="getClassNames" type="exec" mode="input" processor="XML" path="/portal/uiExtensions.xml">
  64. <xts:logicsheet path="/logicsheets/uiobjects/uiobjects_names.xslt"/>
  65. </xts:block>
  66. <!--
  67. ===============================================================================================
  68. generateSearchExp - Generate the search expression
  69. ===============================================================================================
  70. -->
  71. <xts:block id="generateSearchExp" processor="XSLT" type="exec" dependency="buildSession" condition=".[/root/env/param[@name='search']]" mandatory="false">
  72. <xts:logicsheet path="logicsheets/searchlogic.xslt"/>
  73. <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
  74. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  75. xmlns:search="http://developer.cognos.com/schemas/xts/logicsheets/xslt/searchlogic/"
  76. xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/"
  77. exclude-result-prefixes="search cml">
  78. <xsl:output method="xml" version="1.0" encoding="UTF-8" omit-xml-declaration="yes" indent="no"/>
  79. <cml:object-predicates/>
  80. <xsl:template match="root">
  81. <xsl:variable name="path">
  82. <xsl:choose>
  83. <xsl:when test="/root/env/param[@name = 'm_path'] and /root/env/param[@name = 'm_path'] != ''">
  84. <xsl:value-of select="/root/env/param[@name = 'm_path']"/>
  85. </xsl:when>
  86. <xsl:otherwise>/configuration</xsl:otherwise>
  87. </xsl:choose>
  88. </xsl:variable>
  89. <xts:sequence>
  90. <search:gen-search-exp defaultRoot="configuration">
  91. <search:defaultTypes>
  92. <search:defaultType>service</search:defaultType>
  93. <search:defaultType>dispatcher</search:defaultType>
  94. </search:defaultTypes>
  95. </search:gen-search-exp>
  96. </xts:sequence>
  97. </xsl:template>
  98. </xsl:stylesheet>
  99. </xts:block>
  100. <!--
  101. ===============================================================================================
  102. ckFilterChange:
  103. When the filter changes, the 'm_page' variables must be deleted before recalculating maxObjects and skipObjects.
  104. ===============================================================================================
  105. -->
  106. <xts:block id="ckFilterChange" processor="XSLT" type="exec" dependency="generateSearchExp" mandatory="false" condition=".[/root/env/param[@name = 'm_FilterChange'] and .[/root/env/param[@name = 'm_FilterChange'] ='true']]">
  107. <xsl:stylesheet xmlns:adm="http://developer.cognos.com/schemas/xts/logicsheets/contentadmin/" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  108. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  109. <xsl:template match="/">
  110. <xts:sequence>
  111. <xts:delete select="/root/env/param[@name='m_pagerfrom' or @name='m_pagerto' or @name='m_pagerfrom_d' or @name='m_pagerto_d' or @name='m_section' or @name='m_pg_e' or @name='m_FilterChange']"/>
  112. </xts:sequence>
  113. </xsl:template>
  114. </xsl:stylesheet>
  115. </xts:block>
  116. <!--
  117. ===============================================================================================
  118. getContent - get information from CM.
  119. ===============================================================================================
  120. -->
  121. <xts:block id="getContent" processor="XSLT" type="exec" dependency="generateSearchExp ckFilterChange">
  122. <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
  123. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  124. <xts:logicsheet path="logicsheets/portal.xsl"/>
  125. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  126. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  127. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
  128. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  129. xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/"
  130. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  131. exclude-result-prefixes="xsl pf send cm cml xtsext">
  132. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  133. <pf:variables/>
  134. <cml:object-predicates/>
  135. <xsl:key name="env-params" match="/root/env/param" use="@name"/>
  136. <xsl:variable name="m_sort">
  137. <xsl:choose>
  138. <xsl:when test="key('env-params', 'm_monitor_type') and key('env-params', 'm_monitor_type') != 'dispatcher'">
  139. <xsl:value-of select="/root/session/param[@name='s_serv']"/>
  140. </xsl:when>
  141. <xsl:otherwise>
  142. <xsl:value-of select="/root/session/param[@name='s_disp']"/>
  143. </xsl:otherwise>
  144. </xsl:choose>
  145. </xsl:variable>
  146. <xsl:variable name="m_class">
  147. <xsl:choose>
  148. <xsl:when test="key('env-params', 'm_monitor_type')">
  149. <xsl:value-of select="key('env-params', 'm_monitor_type')"/>
  150. </xsl:when>
  151. <xsl:otherwise>
  152. <xsl:value-of select="'dispatcher'"/>
  153. </xsl:otherwise>
  154. </xsl:choose>
  155. </xsl:variable>
  156. <xsl:variable name="m_service_type">
  157. <xsl:choose>
  158. <xsl:when test="key('env-params', 'm_service_type')">
  159. <xsl:value-of select="key('env-params', 'm_service_type')"/>
  160. </xsl:when>
  161. <xsl:otherwise>
  162. <xsl:value-of select="'allServices'"/>
  163. </xsl:otherwise>
  164. </xsl:choose>
  165. </xsl:variable>
  166. <xsl:variable name="all_services_filter">
  167. <xsl:text>[</xsl:text>
  168. <xsl:for-each select="/root/system/param[@name='ui_objects']/object[@service='T'][position()!=last()]">
  169. <xsl:value-of select="concat('@objectClass=&quot;', @class, '&quot; or ')"/>
  170. </xsl:for-each>
  171. <xsl:text>@objectClass="</xsl:text>
  172. <xsl:value-of select="/root/system/param[@name='ui_objects']/object[@service='T'][position()=last()]/@class"/>
  173. <xsl:text>"]</xsl:text>
  174. </xsl:variable>
  175. <xsl:template match="/">
  176. <xts:sequence>
  177. <xts:append>
  178. <!-- Don't need to query CM if we are in search dialog without running a search query. -->
  179. <xsl:if test="/root/search/expression or not(/root/search)">
  180. <data>
  181. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  182. <send:request provider="cm">
  183. <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
  184. <cm:query>
  185. <cm:requests>
  186. <xsl:choose>
  187. <!-- query the content for search page -->
  188. <xsl:when test="/root/search/expression">
  189. <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  190. <cm:search>
  191. <xsl:value-of select="/root/search/expression"/>
  192. </cm:search>
  193. <cm:properties>
  194. <cm:property name="ancestors"/>
  195. <cm:property name="searchPath"/>
  196. <cm:property name="defaultName"/>
  197. <cm:property name="objectClass"/>
  198. <cm:property name="modificationTime"/>
  199. <cm:property name="defaultScreenTip"/>
  200. <cm:property name="disabled"/>
  201. <cm:property name="hidden"/>
  202. <cm:property name="runningState"/>
  203. <cm:property name="startAsActive"/>
  204. <cm:property name="iconURI"/>
  205. </cm:properties>
  206. <cm:sortBy>
  207. <xsl:choose>
  208. <xsl:when test="$m_sort = 'na'">
  209. <cm:sort name="defaultName" order="ascending"/>
  210. </xsl:when>
  211. <xsl:when test="$m_sort = 'nd'">
  212. <cm:sort name="defaultName" order="descending"/>
  213. </xsl:when>
  214. <xsl:otherwise>
  215. <cm:sort name="defaultName"/>
  216. </xsl:otherwise>
  217. </xsl:choose>
  218. </cm:sortBy>
  219. </cm:query>
  220. </xsl:when>
  221. <xsl:when test="$m_class = 'service'">
  222. <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  223. <xsl:choose>
  224. <xsl:when test="$m_service_type = 'allServices'">
  225. <cm:search>/configuration//dispatcher/*<xsl:value-of select="concat($all_services_filter, $visibility-predicate)"/>
  226. </cm:search>
  227. </xsl:when>
  228. <xsl:otherwise>
  229. <cm:search>/configuration//*[@objectClass='<xsl:value-of select="$m_service_type"/>']<xsl:value-of select="$visibility-predicate"/>
  230. </cm:search>
  231. </xsl:otherwise>
  232. </xsl:choose>
  233. <cm:properties>
  234. <cm:property name="ancestors"/>
  235. <cm:property name="searchPath"/>
  236. <cm:property name="defaultName"/>
  237. <cm:property name="objectClass"/>
  238. <cm:property name="rsMaximumProcesses"/>
  239. <cm:property name="rsQueueLimit"/>
  240. <cm:property name="brsMaximumProcesses"/>
  241. <cm:property name="defaultScreenTip"/>
  242. <cm:property name="disabled"/>
  243. <cm:property name="hidden"/>
  244. <cm:property name="runningState"/>
  245. <cm:property name="startAsActive"/>
  246. <cm:property name="iconURI"/>
  247. </cm:properties>
  248. <cm:sortBy>
  249. <xsl:choose>
  250. <xsl:when test="$m_sort = 'na'">
  251. <cm:sort name="defaultName" order="ascending"/>
  252. </xsl:when>
  253. <xsl:when test="$m_sort = 'nd'">
  254. <cm:sort name="defaultName" order="descending"/>
  255. </xsl:when>
  256. <xsl:when test="$m_sort = 'ta'">
  257. <cm:sort name="objectClass" order="ascending"/>
  258. </xsl:when>
  259. <xsl:when test="$m_sort = 'td'">
  260. <cm:sort name="objectClass" order="descending"/>
  261. </xsl:when>
  262. <xsl:otherwise>
  263. <cm:sort name="defaultName"/>
  264. </xsl:otherwise>
  265. </xsl:choose>
  266. </cm:sortBy>
  267. </cm:query>
  268. <cm:query>
  269. <xsl:choose>
  270. <xsl:when test="$m_service_type = 'allServices'">
  271. <cm:search>/configuration//dispatcher/*[@objectClass != 'runTimeState']<xsl:value-of select="$visibility-predicate"/>/runTimeState[permission('read')]</cm:search>
  272. </xsl:when>
  273. <xsl:otherwise>
  274. <cm:search>/configuration//*[@objectClass='<xsl:value-of select="$m_service_type"/>']<xsl:value-of select="$visibility-predicate"/>/runTimeState[permission('read')]</cm:search>
  275. </xsl:otherwise>
  276. </xsl:choose>
  277. <cm:properties>
  278. <cm:property name="state"/>
  279. <cm:property name="ancestors"/>
  280. <cm:property name="modificationTime"/>
  281. </cm:properties>
  282. </cm:query>
  283. </xsl:when>
  284. <!-- query dispatcher list-->
  285. <xsl:otherwise>
  286. <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  287. <cm:search>/configuration//dispatcher<xsl:value-of select="$visibility-predicate"/>
  288. </cm:search>
  289. <cm:properties>
  290. <cm:property name="ancestors"/>
  291. <cm:property name="searchPath"/>
  292. <cm:property name="defaultName"/>
  293. <cm:property name="objectClass"/>
  294. <cm:property name="capacity"/>
  295. <cm:property name="defaultScreenTip"/>
  296. <cm:property name="disabled"/>
  297. <cm:property name="hidden"/>
  298. <cm:property name="runningState"/>
  299. <cm:property name="iconURI"/>
  300. </cm:properties>
  301. <cm:sortBy>
  302. <xsl:choose>
  303. <xsl:when test="$m_sort = 'na'">
  304. <cm:sort name="defaultName" order="ascending"/>
  305. </xsl:when>
  306. <xsl:when test="$m_sort = 'nd'">
  307. <cm:sort name="defaultName" order="descending"/>
  308. </xsl:when>
  309. <xsl:otherwise>
  310. <cm:sort name="defaultName"/>
  311. </xsl:otherwise>
  312. </xsl:choose>
  313. </cm:sortBy>
  314. </cm:query>
  315. <cm:query>
  316. <cm:search>/configuration//dispatcher/runTimeState<xsl:value-of select="$visibility-predicate"/>
  317. </cm:search>
  318. <cm:properties>
  319. <cm:property name="state"/>
  320. <cm:property name="ancestors"/>
  321. <cm:property name="modificationTime"/>
  322. </cm:properties>
  323. </cm:query>
  324. </xsl:otherwise>
  325. </xsl:choose>
  326. <cm:query>
  327. <cm:search>~~</cm:search>
  328. <cm:properties>
  329. <cm:property name="modificationTime"/>
  330. </cm:properties>
  331. </cm:query>
  332. <cm:query>
  333. <cm:search>/configuration</cm:search>
  334. <cm:properties>
  335. <cm:property name="permissions"/>
  336. <cm:property name="defaultName"/>
  337. </cm:properties>
  338. </cm:query>
  339. <cm:query>
  340. <cm:search>/configuration//dispatcher/installedComponent</cm:search>
  341. <cm:properties>
  342. <cm:property name="componentID"/>
  343. </cm:properties>
  344. </cm:query>
  345. </cm:requests>
  346. </cm:query>
  347. </xts:transform>
  348. </send:request>
  349. </xts:transform>
  350. </data>
  351. </xsl:if>
  352. </xts:append>
  353. </xts:sequence>
  354. <xts:sequence>
  355. <xts:delete select="/root/env/param[starts-with(@name, 'checkbox_')]"/>
  356. </xts:sequence>
  357. </xsl:template>
  358. </xsl:stylesheet>
  359. </xts:block>
  360. <!--
  361. ===============================================================================================
  362. getResults - get all the results for display.
  363. ===============================================================================================
  364. -->
  365. <xts:block id="getResults" dependency="getContent getClassNames" mode="interpret" processor="XSLT" type="exec">
  366. <xts:logicsheet path="logicsheets/toollogic.xslt"/>
  367. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:tool="http://developer.cognos.com/schemas/xts/logicsheets/xslt/toollogic/" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" exclude-result-prefixes="tool cm">
  368. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  369. <tool:gen-path-str/>
  370. <!-- the portal.xsl has too many dependencies and all we need is the content locale -->
  371. <xsl:variable name="userPreferences" select="/root/header/bus:biBusHeader/*[local-name() = 'userPreferenceVars']"/>
  372. <xsl:variable name="contentLocale">
  373. <xsl:choose>
  374. <xsl:when test="$userPreferences/*[name='contentLocale' and value != '']">
  375. <xsl:value-of select="$userPreferences/*[name='contentLocale']/value"/>
  376. </xsl:when>
  377. <xsl:otherwise>
  378. <xsl:value-of select="/root/system/param[@name='contentLocale']"/>
  379. </xsl:otherwise>
  380. </xsl:choose>
  381. </xsl:variable>
  382. <xsl:variable name="sort-key">
  383. <xsl:choose>
  384. <xsl:when test="/root/env/param[@name='m_monitor_type'] and /root/env/param[@name='m_monitor_type'] != 'dispatcher'">
  385. <xsl:value-of select="/root/session/param[@name='s_serv']"/>
  386. </xsl:when>
  387. <xsl:otherwise>
  388. <xsl:value-of select="/root/session/param[@name='s_disp']"/>
  389. </xsl:otherwise>
  390. </xsl:choose>
  391. </xsl:variable>
  392. <xsl:template match="/">
  393. <xts:sequence>
  394. <xts:append select="/root">
  395. <xts:transform src="transforms/portal/config/sort.xslt" processor="XSLT">
  396. <results>
  397. <sortkey>
  398. <xsl:value-of select="$sort-key"/>
  399. </sortkey>
  400. <result>
  401. <xsl:for-each select="/root/data/cm:queryResponse/cm:queryReply[1]/*[cm:runningState != 'disabled']">
  402. <xsl:variable name="thePath" select="cm:searchPath"/>
  403. <xsl:variable name="theStateObj" select="/root/data/cm:queryResponse/cm:queryReply[2]/cm:runTimeState[./cm:ancestors/child::*[position() = last()]/cm:searchPath = $thePath]"/>
  404. <xsl:variable name="stateModTime" select="$theStateObj/cm:modificationTime"/>
  405. <xsl:variable name="currentServerTime" select="/root/data/cm:queryResponse/cm:queryReply[3]/cm:session/cm:modificationTime"/>
  406. <xsl:variable name="theRunTimeInfoObj" select="$theStateObj/cm:state/*"/>
  407. <xsl:variable name="interval" select="./cm:perfmonUpdateInterval"/>
  408. <xsl:variable name="updateInterval">
  409. <xsl:choose>
  410. <xsl:when test="$interval != ''">
  411. <xsl:value-of select="$interval"/>
  412. </xsl:when>
  413. <!-- by default, the update interval is 30 seconds -->
  414. <xsl:otherwise>30</xsl:otherwise>
  415. </xsl:choose>
  416. </xsl:variable>
  417. <!-- By default, the sample interval is 30 seconds. -->
  418. <xsl:variable name="sampleInterval">30</xsl:variable>
  419. <xsl:variable name="isStateLatest">
  420. <xsl:choose>
  421. <xsl:when test="$stateModTime != '' and xtsext:dateTimeOffsetCmp(string($stateModTime), string($currentServerTime), $updateInterval * 2 ) &lt; 0">false</xsl:when>
  422. <xsl:otherwise>true</xsl:otherwise>
  423. </xsl:choose>
  424. </xsl:variable>
  425. <xsl:variable name="obj-name" select="local-name()"/>
  426. <xsl:variable name="obj-class" select="cm:objectClass"/>
  427. <xsl:element name="{$obj-name}" xmlns="http://developer.cognos.com/schemas/xts-cm/1/">
  428. <xsl:copy-of select="./*"/>
  429. <!-- Needed for the sorting block -->
  430. <pathSorting>
  431. <xsl:choose>
  432. <xsl:when test="cm:objectClass = 'dispatcher' ">
  433. <xsl:call-template name="gen-path-str">
  434. <xsl:with-param name="ancestorsInfo" select="cm:ancestors"/>
  435. </xsl:call-template>
  436. </xsl:when>
  437. <xsl:otherwise>
  438. <xsl:call-template name="gen-parent-path-str">
  439. <xsl:with-param name="ancestorsInfo" select="cm:ancestors"/>
  440. </xsl:call-template>
  441. </xsl:otherwise>
  442. </xsl:choose>
  443. </pathSorting>
  444. <nameSorting>
  445. <xsl:choose>
  446. <xsl:when test="cm:objectClass = 'dispatcher' ">
  447. <xsl:value-of select="cm:defaultName"/>
  448. </xsl:when>
  449. <xsl:otherwise>
  450. <xsl:value-of select="concat(cm:ancestors/child::cm:ancestorInfo[position() = last()]/cm:title, ' > ', cm:defaultName)"/>
  451. </xsl:otherwise>
  452. </xsl:choose>
  453. </nameSorting>
  454. <localizedServiceType>
  455. <xsl:value-of select="/root/objectClass/class[@name=string($obj-class)]"/>
  456. </localizedServiceType>
  457. <status>
  458. <xsl:variable name="status" select="cm:runningState/cm:value"/>
  459. <xsl:choose>
  460. <xsl:when test="$status != '' and $isStateLatest = 'true' ">
  461. <xsl:value-of select="$status"/>
  462. </xsl:when>
  463. <xsl:otherwise>unknown</xsl:otherwise>
  464. </xsl:choose>
  465. </status>
  466. <dispCapacity>
  467. <xsl:choose>
  468. <xsl:when test="cm:capacity != ''">
  469. <xsl:value-of select="xtsext:formatNumber(string(cm:capacity),string('#,##0.0##'),string($contentLocale), number(1))"/>
  470. </xsl:when>
  471. <xsl:otherwise>
  472. <xts:string id="IDS_MISSING_VALUE"/>
  473. </xsl:otherwise>
  474. </xsl:choose>
  475. </dispCapacity>
  476. <process>
  477. <xsl:variable name="maxProc" select="./*[contains( local-name(), 'MaximumProcesses')]"/>
  478. <xsl:variable name="maxProcVal">
  479. <xsl:choose>
  480. <xsl:when test="$maxProc != ''">
  481. <xsl:value-of select="xtsext:formatNumber(string($maxProc), string($contentLocale), number(1))"/>
  482. </xsl:when>
  483. <xsl:otherwise>
  484. <xts:string id="IDS_MISSING_VALUE"/>
  485. </xsl:otherwise>
  486. </xsl:choose>
  487. </xsl:variable>
  488. <xsl:variable name="curProc" select="$theRunTimeInfoObj/cm:processCount/@value"/>
  489. <xsl:variable name="curProcVal">
  490. <xsl:choose>
  491. <xsl:when test="$curProc != '' and $isStateLatest = 'true'">
  492. <xsl:value-of select="xtsext:formatNumber(string($curProc), string($contentLocale), number(1))"/>
  493. </xsl:when>
  494. <xsl:otherwise>
  495. <xts:string id="IDS_MISSING_VALUE"/>
  496. </xsl:otherwise>
  497. </xsl:choose>
  498. </xsl:variable>
  499. <xsl:value-of select="concat($curProcVal, '/', $maxProcVal)"/>
  500. </process>
  501. <latency>
  502. <xsl:variable name="maxLat" select="./*[contains( local-name(), 'QueueLimit')]"/>
  503. <xsl:variable name="maxLatVal">
  504. <xsl:choose>
  505. <xsl:when test="$maxLat != ''">
  506. <xsl:value-of select="xtsext:formatNumber(string($maxLat), string($contentLocale), number(1))"/>
  507. </xsl:when>
  508. <xsl:otherwise>
  509. <xts:string id="IDS_MISSING_VALUE"/>
  510. </xsl:otherwise>
  511. </xsl:choose>
  512. </xsl:variable>
  513. <xsl:variable name="curLat" select="$theRunTimeInfoObj/cm:requestQueue/@averageDuration"/>
  514. <xsl:variable name="curLatVal">
  515. <xsl:choose>
  516. <xsl:when test="$curLat != '' and $isStateLatest = 'true'">
  517. <xsl:value-of select="xtsext:formatNumber(string($curLat div 1000), string($contentLocale), number(1))"/>
  518. </xsl:when>
  519. <xsl:otherwise>
  520. <xts:string id="IDS_MISSING_VALUE"/>
  521. </xsl:otherwise>
  522. </xsl:choose>
  523. </xsl:variable>
  524. <xsl:value-of select="concat($curLatVal, '/', $maxLatVal)"/>
  525. </latency>
  526. <secPerHit>
  527. <xsl:variable name="secPerHit" select="$theRunTimeInfoObj/cm:requestProcess/@averageDuration"/>
  528. <xsl:choose>
  529. <xsl:when test="$secPerHit != '' and $isStateLatest = 'true'">
  530. <xsl:value-of select="xtsext:formatNumber(string($secPerHit div 1000), string($contentLocale), number(1))"/>
  531. </xsl:when>
  532. <xsl:otherwise>
  533. <xts:string id="IDS_MISSING_VALUE"/>
  534. </xsl:otherwise>
  535. </xsl:choose>
  536. </secPerHit>
  537. <reqPerMin>
  538. <xsl:variable name="reqPerSampleInterval" select="$theRunTimeInfoObj/cm:requestProcess/@count"/>
  539. <xsl:choose>
  540. <xsl:when test="$reqPerSampleInterval != '' and $isStateLatest = 'true'">
  541. <xsl:value-of select="xtsext:formatNumber(string(($reqPerSampleInterval div $sampleInterval) * 60), string($contentLocale), number(1))"/>
  542. </xsl:when>
  543. <xsl:otherwise>
  544. <xts:string id="IDS_MISSING_VALUE"/>
  545. </xsl:otherwise>
  546. </xsl:choose>
  547. </reqPerMin>
  548. <updateInterval>
  549. <xsl:choose>
  550. <xsl:when test="$interval != ''">
  551. <xsl:value-of select="xtsext:formatNumber(string($interval div 1000), string($contentLocale), number(1))"/>
  552. </xsl:when>
  553. <xsl:otherwise>
  554. <xts:string id="IDS_MISSING_VALUE"/>
  555. </xsl:otherwise>
  556. </xsl:choose>
  557. </updateInterval>
  558. </xsl:element>
  559. </xsl:for-each>
  560. </result>
  561. </results>
  562. </xts:transform>
  563. </xts:append>
  564. <xts:delete select="/root/env/param[@name='pagerto']"/>
  565. <xts:delete select="/root/env/param[@name='pagerfrom']"/>
  566. <xts:delete select="/root/env/param[@name='pagerto_d']"/>
  567. <xts:delete select="/root/env/param[@name='pagerfrom_d']"/>
  568. </xts:sequence>
  569. </xsl:template>
  570. <xsl:template name="gen-parent-path-str">
  571. <xsl:param name="ancestorsInfo"/>
  572. <xsl:for-each select="$ancestorsInfo/child::cm:ancestorInfo[position() != last()]">
  573. <xsl:choose>
  574. <xsl:when test="position() &lt; last()">
  575. <xsl:value-of select="concat(string(./cm:title), ' > ')"/>
  576. </xsl:when>
  577. <xsl:otherwise>
  578. <xsl:value-of select="./cm:title"/>
  579. </xsl:otherwise>
  580. </xsl:choose>
  581. </xsl:for-each>
  582. </xsl:template>
  583. </xsl:stylesheet>
  584. </xts:block>
  585. <!--
  586. ===============================================================================================
  587. final - Final output block.
  588. ===============================================================================================
  589. -->
  590. <xts:block id="final" dependency="getContent getResults" mode="output" processor="XSLT" type="exec" mimeType="text/html">
  591. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  592. <xts:logicsheet path="logicsheets/toollogic.xslt"/>
  593. <!-- Cognos Central main behaviour logic -->
  594. <xts:logicsheet path="logicsheets/portal.xsl"/>
  595. <xts:logicsheet path="logicsheets/presentation/main/framework.xsl"/>
  596. <xts:logicsheet path="logicsheets/presentation/main/presentation.xsl"/>
  597. <xts:logicsheet path="logicsheets/presentation/main/search.xsl"/>
  598. <!-- Cognos Central controls logic -->
  599. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  600. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  601. <!-- Generic logicsheets -->
  602. <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
  603. <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
  604. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  605. <xts:logicsheet path="logicsheets/validation.xslt"/> <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
  606. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:tool="http://developer.cognos.com/schemas/xts/logicsheets/xslt/toollogic/" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:mt="http://developer.cognos.com/schemas/xts/logicsheets/presentation/main/mt" xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/" xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/" xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/" xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/" xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/" xmlns:mf="http://developer.cognos.com/schemas/xts/logicsheets/presentation/main/mf" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="bus tool cm mt lyt dp cf cp xtsext df">
  607. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  608. <!-- current file name -->
  609. <xsl:variable name="mname" select="'legacy_tools/tools_service_monitor.xts'"/>
  610. <xsl:variable name="servicesType">
  611. <xsl:text> </xsl:text>
  612. <xsl:for-each select="/root/system/param[@name='ui_objects']/object[@service='T']">
  613. <xsl:value-of select="concat(@class, ' ')"/>
  614. </xsl:for-each>
  615. </xsl:variable>
  616. <xsl:variable name="query-values" select="/root/env/param"/>
  617. <!-- add any theme variables -->
  618. <df:variables/>
  619. <!-- Used to modify the appearance according to the currently viewed class -->
  620. <xsl:variable name="tool_name">
  621. <xsl:choose>
  622. <xsl:when test="$query-values[@name='m_monitor_type']!=''">
  623. <xsl:value-of select="$query-values[@name='m_monitor_type']"/>
  624. </xsl:when>
  625. <xsl:otherwise>
  626. <xsl:value-of select="'dispatcher'"/>
  627. </xsl:otherwise>
  628. </xsl:choose>
  629. </xsl:variable>
  630. <xsl:key name="installedComponents" match="/root/data/cm:queryResponse/cm:queryReply[5]/cm:installedComponent" use="cm:componentID/cm:value"/>
  631. <cp:flyoutControl/>
  632. <!-- start the output -->
  633. <xsl:template match="/root">
  634. <xsl:variable name="tab"><xts:string id="IDS_SERVICE_MONITOR"/></xsl:variable>
  635. <xsl:variable name="toolName"><xts:string id="IDS_TOOLS_SERVER_ADMINISTRATION"/></xsl:variable>
  636. <tool:page formName="frmEntryAdmin" stateParams="m_monitor_type m_service_type m_section m_pagerfrom m_pagerto" helpid="HID_SERVERS_MONITOR" hideHeaders="true">
  637. <!-- To track filter change so we can delete 'm_pager' values -->
  638. <input type="hidden" name="m_FilterChange" value="false"/>
  639. <tool:name>
  640. <xts:string id="IDS_TOOLS_TITLE">
  641. <xts:param name="toolTab"><xsl:value-of select="$tab"/></xts:param>
  642. <xts:param name="toolName"><xsl:value-of select="$toolName"/></xts:param>
  643. </xts:string>
  644. </tool:name>
  645. <tool:title><xsl:value-of select="$toolName"/></tool:title>
  646. <tool:hideEditToolbarButtons test="true()"/>
  647. <tool:search toolBar="true" mod="true()">
  648. <mt:stypes>
  649. <mt:stype name="dispatcher">
  650. <xts:string id="IDS_OBJ_DISPATCHER"/>
  651. </mt:stype>
  652. <mt:stype name="service">
  653. <xts:string id="IDS_SERVICE"/>
  654. </mt:stype>
  655. </mt:stypes>
  656. <mt:close-params>
  657. <param>backURL</param>
  658. <param>tool_tab</param>
  659. <param>m_path</param>
  660. <param>m_monitor_type</param>
  661. <param>m_service_type</param>
  662. <param>m_section</param>
  663. </mt:close-params>
  664. </tool:search>
  665. <tool:script>
  666. var MSG_ERR_NO_SELECTION = &quot;<xts:string id="IDS_ERR_NO_SELECTION" encode="javascript"/>&quot;;
  667. var MSG_CONF_UNREGISTER = &quot;<xts:string id="IDS_CONF_UNREGISTER" encode="javascript"/>&quot;;
  668. var appPath = "<xsl:value-of select="$app"/>";
  669. var backURL="<xsl:value-of select="xtsext:javascriptencode(string($back-url))"/>";
  670. <![CDATA[
  671. <!-- Returns a list of paths of those entries whose checkboxes are checked -->
  672. function getSelectionList()
  673. {
  674. var slist = "";
  675. var items = document.forms[frmEditForm].elements.length;
  676. for (var i=0; i<items; i++)
  677. {
  678. if (document.forms[frmEditForm].elements[i].name)
  679. {
  680. if (document.forms[frmEditForm].elements[i].name.substring(0,9) == "checkbox_" && document.forms[frmEditForm].elements[i].checked)
  681. {
  682. slist = slist + document.forms[frmEditForm].elements[i].value + sDelimiter;
  683. }
  684. }
  685. }
  686. return slist;
  687. }
  688. function doAction( action, isImmediately )
  689. {
  690. var m_sIDList = getSelectionList();
  691. <!-- check for no selection -->
  692. if (m_sIDList.length == 0 || (m_sIDList.length == 8 && m_sIDList == "service*") || (m_sIDList.length == 11 && m_sIDList == "dispatcher*"))
  693. {
  694. alert(MSG_ERR_NO_SELECTION);
  695. return;
  696. }
  697. <!-- Perform the action -->
  698. if ( action == 'unregister')
  699. {
  700. if (confirm(MSG_CONF_UNREGISTER))
  701. {
  702. document.forms[frmEditForm].ifrmcmd.value = 'unregister';
  703. document.forms[frmEditForm].m.value = appPath + "/dialog_action_result.xts";
  704. document.forms[frmEditForm].backURL.value = backURL;
  705. document.forms[frmEditForm].submit();
  706. }
  707. }
  708. else
  709. {
  710. document.forms[frmEditForm].ifrmcmd.value = action;
  711. document.forms[frmEditForm].m_smt_imm.value = isImmediately;
  712. document.forms[frmEditForm].m.value = appPath + "/dialog_action_result.xts";
  713. document.forms[frmEditForm].backURL.value = backURL;
  714. document.forms[frmEditForm].submit();
  715. }
  716. }
  717. function setMonitorType (type)
  718. {
  719. var items = document.forms[frmEditForm].elements.length;
  720. if (document.forms[frmEditForm].m_FilterChange)
  721. document.forms[frmEditForm].m_FilterChange.value = 'true';
  722. for (var i=0; i<items; i++)
  723. {
  724. var e = document.forms[frmEditForm].elements[i];
  725. if (e.name == "m_monitor_type" && e.value == type)
  726. {
  727. e.checked = true;
  728. setTimeout('showMonitoringPage();', 1)
  729. break;
  730. }
  731. }
  732. }
  733. ]]>
  734. function showMonitoringPage( )
  735. {
  736. var sURL = "<xsl:value-of select="xtsext:javascriptencode(string(concat($gateway, '?b_action=xts.run&amp;m=', $app, '/', $mname)))"/>";
  737. var monitorType;
  738. var serviceType = "allServices";
  739. for (var i=0; i &lt;2; i++)
  740. {
  741. var e = document.forms[frmEditForm].m_monitor_type[i];
  742. if (e.checked == true)
  743. {
  744. monitorType = e.value;
  745. break;
  746. }
  747. }
  748. var selectedService = document.forms[frmEditForm].m_service_type.selectedIndex;
  749. var serviceType = document.forms[frmEditForm].m_service_type.options[selectedService].value;
  750. sURL += "&amp;backURL=" + "<xsl:value-of select="xtsext:protect(xtsext:urlencode(string(/root/env/param[@name='backURL'])),'url','url','getdata')"/>";
  751. sURL += "&amp;m_monitor_type=" + monitorType + "&amp;m_service_type=" + serviceType;
  752. document.location.href = sURL;
  753. }
  754. function doActivate(path)
  755. {
  756. if ( confirm("<xts:string id="IDS_ACTION_CONFIRM_ACTIVATE" encode="javascript"/>"))
  757. {
  758. document.forms[frmEditForm].ifrmcmd.value = 'activate';
  759. document.forms[frmEditForm].m.value = appPath + "/dialog_action_result.xts";
  760. document.forms[frmEditForm].m_obj.value = path;
  761. document.forms[frmEditForm].backURL.value = backURL;
  762. document.forms[frmEditForm].submit();
  763. }
  764. }
  765. function init()
  766. {
  767. var pForm = document.forms[frmEditForm];
  768. <xsl:variable name="monitorType">
  769. <xsl:choose>
  770. <xsl:when test="$query-values[@name='m_monitor_type'] and $query-values[@name='m_monitor_type'] !=''">
  771. <xsl:value-of select="$query-values[@name='m_monitor_type']"/>
  772. </xsl:when>
  773. <xsl:otherwise>
  774. <xsl:value-of select="'dispatcher'"/>
  775. </xsl:otherwise>
  776. </xsl:choose>
  777. </xsl:variable>
  778. if ('<xsl:value-of select="$monitorType"/>' == 'dispatcher')
  779. {
  780. pForm.m_monitor_type[0].checked = true;
  781. }
  782. else
  783. {
  784. pForm.m_monitor_type[1].checked = true;
  785. }
  786. <xsl:variable name="serviceType">
  787. <xsl:choose>
  788. <xsl:when test="$query-values[@name='m_service_type'] and $query-values[@name='m_service_type'] !=''">
  789. <xsl:value-of select="$query-values[@name='m_service_type']"/>
  790. </xsl:when>
  791. <xsl:otherwise>
  792. <xsl:value-of select="'allServices'"/>
  793. </xsl:otherwise>
  794. </xsl:choose>
  795. </xsl:variable>
  796. pForm.m_service_type.value = '<xsl:value-of select="xtsext:javascriptencode(string($serviceType))"/>';
  797. }
  798. function showCogadminInfo(event) {
  799. if (event.altKey)
  800. {
  801. if (getSessionValue("frag") != "1")
  802. setStateValue("frag", "1");
  803. else
  804. setStateValue("frag", "0");
  805. location.reload();
  806. }
  807. }
  808. </tool:script>
  809. <tool:pathSearch>
  810. <mt:directPath>
  811. <mt:searchLabel>IDS_SERVICE_MONITOR</mt:searchLabel>
  812. <mt:close-params>
  813. <param>backURL</param>
  814. <param>tool_tab</param>
  815. <param>m_path</param>
  816. <param>m_monitor_type</param>
  817. <param>m_service_type</param>
  818. </mt:close-params>
  819. </mt:directPath>
  820. </tool:pathSearch>
  821. <tool:path>
  822. <!-- this will represent the root with the given label -->
  823. <xsl:variable name="section_label">
  824. <xts:string id="IDS_MONITOR_DESCRIPTION"/>
  825. </xsl:variable>
  826. <span><xsl:value-of select="$section_label"/></span>
  827. </tool:path>
  828. <tool:tabs tabset-name="server">m</tool:tabs>
  829. <tool:actions>
  830. <mt:toolbar>
  831. <mt:tool-group>
  832. <xsl:if test="$tool_name = 'dispatcher'">
  833. <mt:tool>
  834. <a href="javascript:doAction('unregister', false)">
  835. <img height="16" width="16" border="0">
  836. <xsl:attribute name="src"><xsl:value-of select="concat($image_root, 'action_unregister.gif')"/></xsl:attribute>
  837. <xsl:attribute name="alt"><xts:string id="IDS_ACTION_UNREGISTER"/></xsl:attribute>
  838. </img>
  839. </a>
  840. </mt:tool>
  841. <mt:tool>
  842. <a href="javascript:doAction('test', false)">
  843. <img height="16" width="16" border="0">
  844. <xsl:attribute name="src"><xsl:value-of select="concat($image_root, 'action_test.gif')"/></xsl:attribute>
  845. <xsl:attribute name="alt"><xts:string id="IDS_ACTION_TEST"/></xsl:attribute>
  846. </img>
  847. </a>
  848. </mt:tool>
  849. </xsl:if>
  850. <mt:tool>
  851. <a href="javascript:doAction('start', false)">
  852. <img height="16" width="16" border="0">
  853. <xsl:attribute name="src"><xsl:value-of select="concat($image_root, 'action_start.gif')"/></xsl:attribute>
  854. <xsl:attribute name="alt"><xts:string id="IDS_ACTION_START"/></xsl:attribute>
  855. </img>
  856. </a>
  857. </mt:tool>
  858. <mt:tool>
  859. <a href="javascript:doAction('stop', true)">
  860. <img height="16" width="16" border="0">
  861. <xsl:attribute name="src"><xsl:value-of select="concat($image_root, 'action_stop.gif')"/></xsl:attribute>
  862. <xsl:attribute name="alt"><xts:string id="IDS_ACTION_STOP_IMMEDIATELY"/></xsl:attribute>
  863. </img>
  864. </a>
  865. </mt:tool>
  866. <mt:tool>
  867. <a href="javascript:doAction('stop', false)">
  868. <img height="16" width="16" border="0">
  869. <xsl:attribute name="src"><xsl:value-of select="concat($image_root, 'action_stop_after_queue_processed.gif')"/></xsl:attribute>
  870. <xsl:attribute name="alt"><xts:string id="IDS_ACTION_STOP_QUEUE"/></xsl:attribute>
  871. </img>
  872. </a>
  873. </mt:tool>
  874. </mt:tool-group>
  875. <mt:tool-group>
  876. <mt:tool name="search"/>
  877. </mt:tool-group>
  878. </mt:toolbar>
  879. </tool:actions>
  880. <tool:contents>
  881. <xsl:if test="not(/root/search)">
  882. <table width="100%">
  883. <tr>
  884. <td width="30%">
  885. <dp:list>
  886. <dp:section>
  887. <dp:label><xts:string id="IDS_MONITOR_TYPE"/></dp:label>
  888. </dp:section>
  889. </dp:list>
  890. <dp:choice>
  891. <dp:section1>
  892. <input type="radio" name="m_monitor_type" value="dispatcher" onClick="javascript:showMonitoringPage()">
  893. <xsl:if test="not ($query-values[@name='m_monitor_type']) or ($query-values[@name='m_monitor_type'] = 'dispatcher') or ($query-values[@name='m_monitor_type']='')">
  894. <xsl:attribute name="checked">checked</xsl:attribute>
  895. </xsl:if>
  896. </input>
  897. </dp:section1>
  898. <dp:section2>
  899. <xts:string id="IDS_DISPATCHERS"/>
  900. </dp:section2>
  901. <dp:section1>
  902. <input type="radio" name="m_monitor_type" value="service" onClick="javascript:showMonitoringPage()">
  903. <xsl:if test="$query-values[@name='m_monitor_type'] = 'service'">
  904. <xsl:attribute name="checked">checked</xsl:attribute>
  905. </xsl:if>
  906. </input>
  907. </dp:section1>
  908. <dp:section2>
  909. <xts:string id="IDS_SERVICES"/>
  910. </dp:section2>
  911. <dp:section3>
  912. <select size="1" name="m_service_type" onChange="javascript:setMonitorType('service')">
  913. <option value="allServices">
  914. <xsl:if test="$query-values[@name='m_service_type'] = 'allServices'">
  915. <xsl:attribute name="selected">selected</xsl:attribute>
  916. </xsl:if>
  917. <xts:string id="IDS_ALL_SERVICES"/>
  918. </option>
  919. <xsl:for-each select="/root/objectClass/class">
  920. <xsl:sort select="." lang="$productLocale"/>
  921. <xsl:variable name="localized_classname" select="."/>
  922. <xsl:variable name="classname" select="@name"/>
  923. <xsl:if test="/root/system/param[@name='ui_objects']/object[@class=string($classname) and @service='T' and key('installedComponents', @class)]">
  924. <option value="{$classname}">
  925. <xsl:value-of select="$localized_classname"/>
  926. </option>
  927. </xsl:if>
  928. </xsl:for-each>
  929. </select>
  930. </dp:section3>
  931. </dp:choice>
  932. </td>
  933. </tr>
  934. </table>
  935. </xsl:if>
  936. <xsl:choose>
  937. <xsl:when test="$tool_name = 'dispatcher'">
  938. <tool:browser>
  939. <tool:containers>dispatcher</tool:containers>
  940. <tool:selectables><xsl:if test="not(/root/search/expression)">dispatcher<xsl:value-of select="$servicesType"/></xsl:if></tool:selectables>
  941. <tool:columnHeaders session-name="monitor-sort">
  942. <cp:columnHeader width="16" toggleName="checkbox_dispatcher_" form="pfrmEntryAdmin"/>
  943. <cp:columnHeader width="10"/>
  944. <!-- Path-Name Column -->
  945. <cp:columnHeader width="100%" sort="n">
  946. <cp:sortHref>
  947. <xsl:value-of select="$back-url"/>&amp;m_s_disp=<xsl:text/>
  948. <xsl:choose>
  949. <xsl:when test="key('session-param', 's_disp') = 'na' ">nd</xsl:when>
  950. <xsl:when test="key('session-param', 's_disp') = 'nd' "/>
  951. <xsl:otherwise>na</xsl:otherwise>
  952. </xsl:choose>
  953. </cp:sortHref>
  954. <!-- All of this is to align the header (...> Name) with the contents of the table-->
  955. <img height="5" width="1" border="0" src="{$webcontent}/images/space.gif"/>
  956. <xsl:text/>
  957. <xts:string id="IDS_PATH_INDICATOR"/>
  958. <xsl:text>&#160;</xsl:text>
  959. <img height="5" width="1" border="0" src="{$webcontent}/images/space.gif"/>
  960. <xsl:text/>
  961. <xts:string id="IDS_NAME"/>
  962. <xsl:text/>
  963. </cp:columnHeader>
  964. <cp:columnHeader sort="s">
  965. <cp:sortHref>
  966. <xsl:value-of select="$back-url"/>&amp;m_s_disp=<xsl:text/>
  967. <xsl:choose>
  968. <xsl:when test="key('session-param', 's_disp') = 'sa' ">sd</xsl:when>
  969. <xsl:when test="key('session-param', 's_disp') = 'sd' "/>
  970. <xsl:otherwise>sa</xsl:otherwise>
  971. </xsl:choose>
  972. </cp:sortHref>
  973. <xsl:text/>
  974. <xts:string id="IDS_HEADING_STATUS"/>
  975. <xsl:text/>
  976. </cp:columnHeader>
  977. <cp:columnHeader>
  978. <xsl:attribute name="title"><xts:string id="IDS_HEADING_CAPACITY"/></xsl:attribute>
  979. <xsl:text/>
  980. <xts:string id="IDS_HEADING_CAPACITY"/>
  981. <xsl:text/>
  982. </cp:columnHeader>
  983. </tool:columnHeaders>
  984. <tool:columnContents>
  985. <xsl:variable name="state_tool_tip">
  986. <xsl:choose>
  987. <xsl:when test="./cm:status='started' or ./cm:status='running'">
  988. <xsl:text/><xts:string id="IDS_TOOLS_SERVER_ADMINISTRATION_STATE_RUNNING"/><xsl:text/>
  989. </xsl:when>
  990. <xsl:when test="./cm:status='stopped' or ./cm:status='suspended'">
  991. <xsl:text/><xts:string id="IDS_TOOLS_SERVER_ADMINISTRATION_STATE_STOPPED"/><xsl:text/>
  992. </xsl:when>
  993. <xsl:when test="./cm:status='stopping'">
  994. <xsl:text/><xts:string id="IDS_TOOLS_SERVER_ADMINISTRATION_STATE_STOPPING"/><xsl:text/>
  995. </xsl:when>
  996. <xsl:when test="./cm:status='standby'">
  997. <xsl:text/><xts:string id="IDS_TOOLS_SERVER_ADMINISTRATION_STATE_STANDBY"/><xsl:text/>
  998. </xsl:when>
  999. <xsl:otherwise>
  1000. <xsl:text/><xts:string id="IDS_TOOLS_SERVER_ADMINISTRATION_STATE_UNKNOWN"/><xsl:text/>
  1001. </xsl:otherwise>
  1002. </xsl:choose>
  1003. </xsl:variable>
  1004. <!-- Path-Name Column -->
  1005. <cp:columnContent scope="row">
  1006. <img height="16" width="20" align="absmiddle" src="{$skin_images}path.gif">
  1007. <xsl:attribute name="alt"><xsl:value-of select="cm:pathSorting"/></xsl:attribute>
  1008. </img>
  1009. <xsl:text> </xsl:text>
  1010. <xsl:value-of select="cm:nameSorting"/>
  1011. <!-- Render the disabled icon if this entry is disabled -->
  1012. <xsl:if test="cm:disabled = 'true'">
  1013. <img height="16" width="16" hspace="4" align="absmiddle" src="{$image_root}state_disabled.gif">
  1014. <xsl:attribute name="alt"><xts:string id="IDS_DISABLED"/></xsl:attribute>
  1015. </img>
  1016. </xsl:if>
  1017. <xsl:text>&#160;&#160;</xsl:text>
  1018. </cp:columnContent>
  1019. <cp:columnContent>
  1020. <xsl:variable name="image">
  1021. <xsl:choose>
  1022. <xsl:when test="./cm:status='started' or ./cm:status='running'">
  1023. <xsl:text>component_running.gif</xsl:text>
  1024. </xsl:when>
  1025. <xsl:when test="./cm:status='stopped' or ./cm:status='suspended'">
  1026. <xsl:text>component_stopped.gif</xsl:text>
  1027. </xsl:when>
  1028. <xsl:when test="./cm:status='stopping'">
  1029. <xsl:text>component_stopping.gif</xsl:text>
  1030. </xsl:when>
  1031. <xsl:otherwise>
  1032. <xsl:text>component_unknown.gif</xsl:text>
  1033. </xsl:otherwise>
  1034. </xsl:choose>
  1035. </xsl:variable>
  1036. <img width="16" height="16">
  1037. <xsl:attribute name="src"><xsl:value-of select="concat($image_root, $image)"/></xsl:attribute>
  1038. <xsl:attribute name="alt"><xsl:value-of select="$state_tool_tip"/></xsl:attribute>
  1039. </img>
  1040. </cp:columnContent>
  1041. <cp:columnContent>
  1042. <xsl:value-of select="cm:dispCapacity"/>
  1043. </cp:columnContent>
  1044. </tool:columnContents>
  1045. <tool:columnFooters session-name="s_dir">
  1046. <cp:columnFooter width="100%" colspan="15" timezone="string(/root/user/param[@name='timeZoneID'])">
  1047. <!-- display the current timestamp -->
  1048. <xsl:variable name="time_now" select="xtsext:getCurrentDateTime(string(/root/user/param[@name='timeZoneID']))"/>
  1049. <xts:string id="IDS_LAST_UPDATED"/>: <xsl:value-of select="xtsext:formatDateFromUTC(string($time_now), number('2'), number('3'), string(/root/timezone), string(/root/contentLocale))"/>
  1050. </cp:columnFooter>
  1051. </tool:columnFooters>
  1052. <tool:row-actions>
  1053. <tool:action name="supportPropertiesAction"/>
  1054. <tool:action name="supportActivateAction" test="cm:status='standby'"/>
  1055. <tool:action name="supportAllActionsAction"/>
  1056. </tool:row-actions>
  1057. </tool:browser>
  1058. </xsl:when>
  1059. <xsl:when test="$tool_name = 'service'">
  1060. <tool:browser valign="top">
  1061. <tool:containers>dispatcher</tool:containers>
  1062. <tool:selectables><xsl:if test="not(/root/search/expression)">dispatcher<xsl:value-of select="$servicesType"/></xsl:if></tool:selectables>
  1063. <tool:columnHeaders session-name="monitor-sort">
  1064. <cp:columnHeader width="16" tallDivider="t" toggleName="checkbox_" form="pfrmEntryAdmin"/>
  1065. <cp:columnHeader width="10" tallDivider="t"/>
  1066. <!-- Path-Name Column -->
  1067. <cp:columnHeader width="100%" sort="n" wrap="wrap" tallDivider="t" valign="top">
  1068. <cp:sortHref>
  1069. <xsl:value-of select="$back-url"/>&amp;m_s_serv=<xsl:text/>
  1070. <xsl:choose>
  1071. <xsl:when test="key('session-param', 's_serv') = 'na' ">nd</xsl:when>
  1072. <xsl:when test="key('session-param', 's_serv') = 'nd' "/>
  1073. <xsl:otherwise>na</xsl:otherwise>
  1074. </xsl:choose>
  1075. </cp:sortHref>
  1076. <!-- All of this is to align the header (...> Name) with the contents of the table-->
  1077. <img height="5" width="1" border="0">
  1078. <xsl:attribute name="src"><xsl:value-of select="$webcontent"/>/images/space.gif</xsl:attribute>
  1079. </img>
  1080. <xsl:text/>
  1081. <xts:string id="IDS_PATH_INDICATOR"/>
  1082. <xsl:text>&#160;</xsl:text>
  1083. <img height="5" width="1" border="0">
  1084. <xsl:attribute name="src"><xsl:value-of select="$webcontent"/>/images/space.gif</xsl:attribute>
  1085. </img>
  1086. <xsl:text/>
  1087. <xts:string id="IDS_NAME"/>
  1088. <xsl:text/>
  1089. </cp:columnHeader>
  1090. <cp:columnHeader wrap="wrap" tallDivider="t" valign="top">
  1091. <xsl:text/>
  1092. <xts:string id="IDS_SERVICE"/>
  1093. <xsl:text/>
  1094. </cp:columnHeader>
  1095. <cp:columnHeader sort="s" wrap="wrap" tallDivider="t" valign="top">
  1096. <cp:sortHref>
  1097. <xsl:value-of select="$back-url"/>&amp;m_s_serv=<xsl:text/>
  1098. <xsl:choose>
  1099. <xsl:when test="key('session-param', 's_serv') = 'sa' ">sd</xsl:when>
  1100. <xsl:when test="key('session-param', 's_serv') = 'sd' "/>
  1101. <xsl:otherwise>sa</xsl:otherwise>
  1102. </xsl:choose>
  1103. </cp:sortHref>
  1104. <xsl:text/>
  1105. <xts:string id="IDS_HEADING_STATUS"/>
  1106. <xsl:text/>
  1107. </cp:columnHeader>
  1108. <cp:columnHeader wrap="wrap" tallDivider="t" valign="top">
  1109. <xsl:attribute name="title"><xts:string id="IDS_TOOLTIP_PROCESS"/></xsl:attribute>
  1110. <xsl:text/>
  1111. <xts:string id="IDS_HEADING_PROCESS"/>
  1112. <xsl:text/>
  1113. </cp:columnHeader>
  1114. <cp:columnHeader wrap="wrap" tallDivider="t" valign="top">
  1115. <xsl:attribute name="title"><xts:string id="IDS_TOOLTIP_LATENCY"/></xsl:attribute>
  1116. <xsl:text/>
  1117. <xts:string id="IDS_HEADING_LATENCY"/>
  1118. <xsl:text/>
  1119. </cp:columnHeader>
  1120. <cp:columnHeader wrap="wrap" tallDivider="t" valign="top">
  1121. <xsl:attribute name="title"><xts:string id="IDS_HEADING_SEC_HIT"/></xsl:attribute>
  1122. <xsl:text/>
  1123. <xts:string id="IDS_HEADING_SEC_HIT"/>
  1124. <xsl:text/>
  1125. </cp:columnHeader>
  1126. <cp:columnHeader wrap="wrap" tallDivider="t" valign="top">
  1127. <xsl:attribute name="title"><xts:string id="IDS_HEADING_HITS_MIN"/></xsl:attribute>
  1128. <xsl:text/>
  1129. <xts:string id="IDS_HEADING_HITS_MIN"/>
  1130. <xsl:text/>
  1131. </cp:columnHeader>
  1132. <cp:columnHeader wrap="wrap" tallDivider="t" valign="top">
  1133. <xsl:attribute name="title"><xts:string id="IDS_TOOLTIP_UPDATE_INTERVAL"/></xsl:attribute>
  1134. <xsl:text/>
  1135. <xts:string id="IDS_HEADING_UPDATE_INTERVAL"/>
  1136. <xsl:text/>
  1137. </cp:columnHeader>
  1138. </tool:columnHeaders>
  1139. <tool:columnContents>
  1140. <xsl:variable name="state_tool_tip">
  1141. <xsl:choose>
  1142. <xsl:when test="./cm:status='started' or ./cm:status='running'">
  1143. <xsl:text/><xts:string id="IDS_TOOLS_SERVER_ADMINISTRATION_STATE_RUNNING"/><xsl:text/>
  1144. </xsl:when>
  1145. <xsl:when test="./cm:status='stopped' or ./cm:status='suspended'">
  1146. <xsl:text/><xts:string id="IDS_TOOLS_SERVER_ADMINISTRATION_STATE_STOPPED"/><xsl:text/>
  1147. </xsl:when>
  1148. <xsl:when test="./cm:status='stopping'">
  1149. <xsl:text/><xts:string id="IDS_TOOLS_SERVER_ADMINISTRATION_STATE_STOPPING"/><xsl:text/>
  1150. </xsl:when>
  1151. <xsl:when test="./cm:status='standby'">
  1152. <xsl:text/><xts:string id="IDS_TOOLS_SERVER_ADMINISTRATION_STATE_STANDBY"/><xsl:text/>
  1153. </xsl:when>
  1154. <xsl:otherwise>
  1155. <xsl:text/><xts:string id="IDS_TOOLS_SERVER_ADMINISTRATION_STATE_UNKNOWN"/><xsl:text/>
  1156. </xsl:otherwise>
  1157. </xsl:choose>
  1158. </xsl:variable>
  1159. <!-- Path-Name Column -->
  1160. <cp:columnContent wrap="wrap">
  1161. <img height="16" width="20" align="absmiddle" src="{$skin_images}path.gif">
  1162. <xsl:attribute name="alt"><xsl:value-of select="cm:pathSorting"/></xsl:attribute>
  1163. </img>
  1164. <xsl:text> </xsl:text>
  1165. <xsl:value-of select="cm:nameSorting"/>
  1166. <!-- Render the disabled icon if this entry is disabled -->
  1167. <xsl:if test="cm:disabled = 'true'">
  1168. <img height="16" width="16" hspace="4" align="absmiddle" src="{$image_root}state_disabled.gif">
  1169. <xsl:attribute name="alt"><xts:string id="IDS_DISABLED"/></xsl:attribute>
  1170. </img>
  1171. </xsl:if>
  1172. </cp:columnContent>
  1173. <cp:columnContent wrap="wrap">
  1174. <xsl:value-of select="./cm:localizedServiceType"/>
  1175. </cp:columnContent>
  1176. <cp:columnContent>
  1177. <xsl:variable name="image">
  1178. <xsl:choose>
  1179. <xsl:when test="./cm:status='started' or ./cm:status='running'">
  1180. <xsl:text>component_running.gif</xsl:text>
  1181. </xsl:when>
  1182. <xsl:when test="./cm:status='stopped' or ./cm:status='suspended'">
  1183. <xsl:text>component_stopped.gif</xsl:text>
  1184. </xsl:when>
  1185. <xsl:when test="./cm:status='stopping'">
  1186. <xsl:text>component_stopping.gif</xsl:text>
  1187. </xsl:when>
  1188. <xsl:when test="./cm:status='standby'">
  1189. <xsl:text>component_standby.gif</xsl:text>
  1190. </xsl:when>
  1191. <xsl:otherwise>
  1192. <xsl:text>component_unknown.gif</xsl:text>
  1193. </xsl:otherwise>
  1194. </xsl:choose>
  1195. </xsl:variable>
  1196. <img width="16" height="16">
  1197. <xsl:attribute name="src"><xsl:value-of select="concat($image_root, $image)"/></xsl:attribute>
  1198. <xsl:attribute name="alt"><xsl:value-of select="$state_tool_tip"/></xsl:attribute>
  1199. </img>
  1200. </cp:columnContent>
  1201. <cp:columnContent>
  1202. <xsl:value-of select="./cm:process"/>
  1203. </cp:columnContent>
  1204. <cp:columnContent>
  1205. <xsl:value-of select="./cm:latency"/>
  1206. </cp:columnContent>
  1207. <cp:columnContent>
  1208. <xsl:value-of select="./cm:secPerHit"/>
  1209. </cp:columnContent>
  1210. <cp:columnContent>
  1211. <xsl:value-of select="./cm:reqPerMin"/>
  1212. </cp:columnContent>
  1213. <cp:columnContent>
  1214. <xsl:value-of select="./cm:updateInterval"/>
  1215. </cp:columnContent>
  1216. </tool:columnContents>
  1217. <tool:columnFooters session-name="s_dir">
  1218. <cp:columnFooter width="100%" colspan="39" timezone="string(/root/user/param[@name='timeZoneID'])">
  1219. <!-- display the current timestamp -->
  1220. <xsl:variable name="time_now" select="xtsext:getCurrentDateTime(string(/root/user/param[@name='timeZoneID']))"/>
  1221. <xts:string id="IDS_LAST_UPDATED"/>: <xsl:value-of select="xtsext:formatDateFromUTC(string($time_now), number('2'), number('3'), string(/root/timezone), string(/root/contentLocale))"/>
  1222. </cp:columnFooter>
  1223. </tool:columnFooters>
  1224. <tool:row-actions>
  1225. <tool:action name="supportPropertiesAction"/>
  1226. <tool:action name="supportActivateAction" test="cm:status='standby'"/>
  1227. <tool:action name="supportAllActionsAction"/>
  1228. </tool:row-actions>
  1229. </tool:browser>
  1230. </xsl:when>
  1231. </xsl:choose>
  1232. </tool:contents>
  1233. <!-- for action "stop immediatelyl" -->
  1234. <input type="hidden" name="m_smt_imm" value=""/>
  1235. <!-- for action "activate" -->
  1236. <input type="hidden" name="m_obj" value=""/>
  1237. </tool:page>
  1238. </xsl:template>
  1239. <!--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-->
  1240. <xsl:template match="text()"/>
  1241. <!--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-->
  1242. <mf:tweak-url/>
  1243. <cp:tabControl/>
  1244. </xsl:stylesheet>
  1245. </xts:block>
  1246. <!--
  1247. ===============================================================================================
  1248. debug - display the debug info.
  1249. ===============================================================================================
  1250. -->
  1251. <xts:block id="debug" dependency="final" condition=".[/root/env/param[@name='d'] = '1' or /root/session/param[@name='debug'] = '1']" type="exec" mode="output" processor="XSLT" mandatory="false" mimeType="text/html">
  1252. <!-- get the debug logic sheet -->
  1253. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  1254. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dbg="http://developer.cognos.com/schemas/xts/logicsheets/xslt/debug/" exclude-result-prefixes="dbg">
  1255. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  1256. <xsl:template match="/">
  1257. <dbg:dumpxml select="/root"/>
  1258. </xsl:template>
  1259. </xsl:stylesheet>
  1260. </xts:block>
  1261. </xts:morphlet>