dialog_action_result.xts 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379
  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, 2011
  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. <!-- form logic stuff ============================================================== -->
  14. <xts:block id="formlogic_init" type="exec" mode="interpret" processor="XSLT" path="/logicsheets/formlogic_init.xslt" nodelist="env,credential,system,http"/>
  15. <!--======================================================================
  16. Name: executeCommand
  17. Comments: Execute form command.
  18. For service list page, the command could be:
  19. - start
  20. - stop
  21. - test (ping)
  22. For dispatcher list page, the command could be:
  23. - unregister
  24. - test (ping)
  25. ======================================================================-->
  26. <xts:block id="executeCommand" type="exec" mode="interpret" processor="XSLT" dependency="formlogic_init">
  27. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  28. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt">
  29. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  30. <xsl:variable name="query-values" select="/root/env/param"/>
  31. <xsl:variable name="prefix" select="'checkbox_'"/>
  32. <xsl:variable name="action">
  33. <xsl:choose>
  34. <xsl:when test="$query-values[@name='c']">
  35. <xsl:value-of select="$query-values[@name='c']"/>
  36. </xsl:when>
  37. <xsl:when test="$query-values[@name='ifrmcmd']">
  38. <xsl:value-of select="$query-values[@name='ifrmcmd']"/>
  39. </xsl:when>
  40. </xsl:choose>
  41. </xsl:variable>
  42. <xsl:template match="/">
  43. <xts:sequence>
  44. <xts:append>
  45. <cmResponse>
  46. <xsl:choose>
  47. <!-- ==================================================
  48. = perform actions from tools monitor page. =
  49. ===================================================-->
  50. <xsl:when test="$query-values[starts-with(@name,$prefix)] and not($action='activate')">
  51. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  52. <send:request provider="cm">
  53. <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
  54. <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  55. <cm:requests>
  56. <xsl:for-each select="$query-values[starts-with(@name,$prefix)]">
  57. <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  58. <cm:search>
  59. <xsl:value-of select="xtsext:urldecode(string(.))"/>
  60. </cm:search>
  61. <cm:properties>
  62. <cm:property name="searchPath"/>
  63. <cm:property name="ancestors"/>
  64. <cm:property name="defaultName"/>
  65. <cm:property name="iconURI"/>
  66. </cm:properties>
  67. <cm:options continueOnError="true" schemaInfo="false"/>
  68. </cm:query>
  69. </xsl:for-each>
  70. </cm:requests>
  71. </cm:query>
  72. </xts:transform>
  73. </send:request>
  74. </xts:transform>
  75. </xsl:when>
  76. <!-- ==================================================
  77. = perform actions from actions page =
  78. ===================================================-->
  79. <xsl:otherwise>
  80. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  81. <send:request provider="cm">
  82. <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
  83. <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  84. <cm:search>
  85. <xsl:value-of select="$query-values[@name ='m_obj']"/>
  86. </cm:search>
  87. <cm:properties>
  88. <cm:property name="searchPath"/>
  89. <cm:property name="ancestors"/>
  90. <cm:property name="defaultName"/>
  91. <cm:property name="iconURI"/>
  92. <cm:property name="startAsActive"/>
  93. <cm:property name="runningState"/>
  94. </cm:properties>
  95. <cm:options continueOnError="true" schemaInfo="false"/>
  96. </cm:query>
  97. </xts:transform>
  98. </send:request>
  99. </xts:transform>
  100. </xsl:otherwise>
  101. </xsl:choose>
  102. </cmResponse>
  103. </xts:append>
  104. <xts:append>
  105. <actionResponse>
  106. <xsl:attribute name="action"><xsl:value-of select="$action"/></xsl:attribute>
  107. <send:request provider="xts">
  108. <xsl:element name="monitor" namespace="http://developer.cognos.com/schemas/xts/portal/iFrmCmd/1/">
  109. <env xmlns="http://developer.cognos.com/schemas/xts/portal/iFrmCmd/1/">
  110. <xsl:for-each select="/root/env/param">
  111. <param>
  112. <xsl:copy-of select="@*"/>
  113. <xsl:value-of select="."/>
  114. </param>
  115. </xsl:for-each>
  116. </env>
  117. </xsl:element>
  118. </send:request>
  119. </actionResponse>
  120. </xts:append>
  121. </xts:sequence>
  122. </xsl:template>
  123. <xsl:template match="text()"/>
  124. </xsl:stylesheet>
  125. </xts:block>
  126. <!-- ==========================================================================
  127. = Name: listResult =
  128. = Comment: put cm:class into each status element. Sort objects according to m_sort. =
  129. ============================================================================-->
  130. <xts:block id="listResult" processor="XSLT" type="exec" dependency="executeCommand">
  131. <xts:logicsheet path="logicsheets/toollogic.xslt"/>
  132. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:tool="http://developer.cognos.com/schemas/xts/logicsheets/xslt/toollogic/" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/" xmlns:smt="http://developer.cognos.com/schemas/xts/admin/iServerManagement/1/" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/">
  133. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  134. <tool:gen-path-str/>
  135. <xsl:template match="/">
  136. <xsl:apply-templates select="/root/actionResponse"/>
  137. </xsl:template>
  138. <xsl:template match="actionResponse" priority="1">
  139. <xts:sequence>
  140. <xts:append>
  141. <actionResult>
  142. <xsl:copy-of select="@*"/>
  143. <xsl:apply-templates/>
  144. </actionResult>
  145. </xts:append>
  146. </xts:sequence>
  147. </xsl:template>
  148. <xsl:template match="*[local-name() = 'status']" priority="1">
  149. <xsl:variable name="m_sort" select="/root/env/param[@name='m_sort']"/>
  150. <xsl:variable name="path" select="*[local-name()='path']"/>
  151. <xsl:copy>
  152. <xsl:copy-of select="@*"/>
  153. <xsl:copy-of select="child::*"/>
  154. <xsl:copy-of select="/root/cmResponse/cm:queryResponse//*[./cm:searchPath=$path]/cm:objectClass"/>
  155. <xsl:copy-of select="/root/cmResponse/cm:queryResponse//*[./cm:searchPath=$path]/cm:startAsActive"/>
  156. <xsl:copy-of select="/root/cmResponse/cm:queryResponse//*[./cm:searchPath=$path]/cm:runningState"/>
  157. <xsl:copy-of select="/root/cmResponse/cm:queryResponse//*[./cm:searchPath=$path]/cm:ancestors"/>
  158. <xsl:copy-of select="/root/cmResponse/cm:queryResponse//*[./cm:searchPath=$path]/cm:defaultName"/>
  159. <pathSorting>
  160. <xsl:call-template name="gen-path-str">
  161. <xsl:with-param name="ancestorsInfo" select="/root/cmResponse/cm:queryResponse//*[./cm:searchPath=$path]/cm:ancestors"/>
  162. </xsl:call-template>
  163. </pathSorting>
  164. </xsl:copy>
  165. </xsl:template>
  166. <xsl:template match="*">
  167. <xsl:copy>
  168. <xsl:copy-of select="@*"/>
  169. <xsl:apply-templates/>
  170. </xsl:copy>
  171. </xsl:template>
  172. </xsl:stylesheet>
  173. </xts:block>
  174. <!--======================================================================
  175. Name: resultPage
  176. Comments: Render the action result page. It's a dialog page with Close button.
  177. ======================================================================-->
  178. <xts:block id="resultPage" mode="output" processor="XSLT" type="exec" mimeType="text/html" dependency="listResult formlogic_init">
  179. <!-- get the new theme stuff -->
  180. <xts:logicsheet path="logicsheets/portal.xsl"/>
  181. <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
  182. <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
  183. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  184. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  185. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  186. <!-- apply the form logic -->
  187. <xts:logicsheet path="logicsheets/formlogic.xslt"/>
  188. <xts:logicsheet path="logicsheets/validation.xslt"/> <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
  189. <xsl:stylesheet version="1.0"
  190. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  191. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  192. xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/"
  193. xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
  194. xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/"
  195. xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
  196. xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
  197. xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/"
  198. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  199. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  200. xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/"
  201. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
  202. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  203. xmlns:smt="http://developer.cognos.com/schemas/xts/admin/iServerManagement/1/"
  204. xmlns:tool="http://developer.cognos.com/schemas/xts/logicsheets/xslt/toollogic/"
  205. exclude-result-prefixes="xsl cm cml bus utml send xtsext smt tool">
  206. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  207. <!-- current file name -->
  208. <xsl:variable name="mname" select="'dialog_action_result.xts'"/>
  209. <!-- add any theme variables -->
  210. <pf:variables/>
  211. <!-- back-url must be defined, but not used -->
  212. <xsl:variable name="back-url" select="''"/>
  213. <xsl:template match="/root">
  214. <xsl:variable name="actTitle">
  215. <xsl:choose>
  216. <xsl:when test="/root/actionResult/@action = 'start'">
  217. <xts:string id="IDS_ACTION_START"/>
  218. </xsl:when>
  219. <xsl:when test="/root/actionResult/@action = 'stop'">
  220. <xts:string id="IDS_ACTION_STOP"/>
  221. </xsl:when>
  222. <xsl:when test="/root/actionResult/@action = 'test'">
  223. <xts:string id="IDS_ACTION_TEST"/>
  224. </xsl:when>
  225. <xsl:when test="/root/actionResult/@action = 'unregister'">
  226. <xts:string id="IDS_ACTION_UNREGISTER"/>
  227. </xsl:when>
  228. <xsl:when test="/root/actionResult/@action = 'activate'">
  229. <xts:string id="IDS_ACTION_ACTIVATE"/>
  230. </xsl:when>
  231. <xsl:when test="/root/actionResult/@action = 'set_default_active'">
  232. <xts:string id="IDS_ACT_SET_DEFAULT_ACTIVE"/>
  233. </xsl:when>
  234. </xsl:choose>
  235. </xsl:variable>
  236. <xsl:variable name="browserTitle">
  237. <xsl:choose>
  238. <xsl:when test="$actTitle != ''">
  239. <xts:string id="IDS_VIEW_ACTION_RESULTS_TITLE1"><xts:param name="objectName"><xsl:value-of select="$actTitle"/></xts:param></xts:string>
  240. </xsl:when>
  241. <xsl:otherwise>
  242. <xts:string id="IDS_VIEW_ACTION_RESULTS_TITLE2"/>
  243. </xsl:otherwise>
  244. </xsl:choose>
  245. </xsl:variable>
  246. <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html></xsl:text><dp:page longTitle="$browserTitle">
  247. <dp:meta>
  248. <pf:meta/> <!-- Standard meta tags -->
  249. </dp:meta>
  250. <dp:script>
  251. <pf:help context="HID_SERVERS_CONFIGURE"/> <!-- Help system -->
  252. </dp:script>
  253. <utml:form name="pform" method="post" action="{$gateway}">
  254. <!-- dialog header -->
  255. <dp:header>
  256. <!-- header titles-->
  257. <dp:title showName="false">
  258. <xsl:value-of select="$browserTitle"/>
  259. </dp:title>
  260. </dp:header>
  261. <!-- layout-->
  262. <lyt:layout style="1" border="no">
  263. <lyt:section>
  264. <cp:table iterate="/root/actionResult//*[local-name() ='status']" width="100%" align="left">
  265. <cp:tableHeader>
  266. <cp:columnHeader width="16"/>
  267. <!-- Path-Name Column -->
  268. <cp:columnHeader width="120">
  269. <!-- All of this is to align the header (...> Name) with the contents of the table-->
  270. <img height="5" width="1" border="0"><xsl:attribute name="src"><xsl:value-of select="$webcontent"/>/images/space.gif</xsl:attribute></img>
  271. <xsl:text/><xts:string id="IDS_PATH_INDICATOR"/><xsl:text>&#160;</xsl:text>
  272. <img height="5" width="1" border="0"><xsl:attribute name="src"><xsl:value-of select="$webcontent"/>/images/space.gif</xsl:attribute></img>
  273. <xsl:text/><xts:string id="IDS_NAME"/><xsl:text/>
  274. </cp:columnHeader>
  275. <cp:columnHeader width="100">
  276. <xts:string id="IDS_HEADING_STATUS"/>
  277. </cp:columnHeader>
  278. <xsl:if test="/root/actionResult/@action = 'test'">
  279. <cp:columnHeader width="80">
  280. <xsl:attribute name="title"><xts:string id="IDS_HEADING_VERSION"/></xsl:attribute>
  281. <xts:string id="IDS_HEADING_VERSION"/>
  282. </cp:columnHeader>
  283. <cp:columnHeader width="100">
  284. <xsl:attribute name="title"><xts:string id="IDS_TOOLTIP_UPTIME"/></xsl:attribute>
  285. <xts:string id="IDS_HEADING_UPTIME"/>
  286. </cp:columnHeader>
  287. </xsl:if>
  288. <cp:columnHeader width="100%">
  289. <xts:string id="IDS_HEADING_ERROR_MESSAGE"/>
  290. </cp:columnHeader>
  291. </cp:tableHeader>
  292. <!-- Column contents -->
  293. <cp:tableContent>
  294. <cp:columnContent>
  295. <xsl:call-template name="gen-icon"/>
  296. </cp:columnContent>
  297. <!-- Path-Name Column -->
  298. <cp:columnContent>
  299. <img height="16" width="20" align="absmiddle">
  300. <xsl:attribute name="alt"><xsl:value-of select="*[local-name()='pathSorting']"/></xsl:attribute>
  301. <xsl:attribute name="src"><xsl:value-of select="$skin_images"/>path.gif</xsl:attribute>
  302. </img>
  303. <xsl:text> </xsl:text>
  304. <xsl:choose>
  305. <xsl:when test="cm:objectClass = 'dispatcher' ">
  306. <xsl:value-of select="cm:defaultName"/>
  307. </xsl:when>
  308. <xsl:otherwise>
  309. <xsl:value-of select="concat(cm:ancestors/child::cm:ancestorInfo[position() = last()]/cm:title, ' > ', cm:defaultName)"/>
  310. </xsl:otherwise>
  311. </xsl:choose>
  312. </cp:columnContent>
  313. <cp:columnContent>
  314. <xsl:choose>
  315. <xsl:when test="@success='true'">
  316. <xts:string id="IDS_JOB_STATUS_SUCCEEDED"/>
  317. </xsl:when>
  318. <xsl:otherwise>
  319. <xts:string id="IDS_JOB_STATUS_FAILED"/>
  320. </xsl:otherwise>
  321. </xsl:choose>
  322. </cp:columnContent>
  323. <xsl:if test="/root/actionResult/@action = 'test'">
  324. <cp:columnContent>
  325. <xsl:value-of select="*[local-name()='version']"/>
  326. </cp:columnContent>
  327. <cp:columnContent>
  328. <xsl:value-of select="xtsext:formatDuration(number(*[local-name()='upTime']),boolean('true'),string('1'),number('2'))"/>
  329. </cp:columnContent>
  330. </xsl:if>
  331. <cp:columnContent>
  332. <xsl:if test="@success='false'">
  333. <xsl:choose>
  334. <xsl:when test="@count = 0">
  335. <xts:string id="IDS_ERR_NO_DATA"/>
  336. </xsl:when>
  337. <xsl:otherwise>
  338. <xsl:for-each select="./*[local-name() = 'detail']/*[local-name() = 'error']">
  339. <xsl:value-of select="."/>
  340. <br/>
  341. </xsl:for-each>
  342. </xsl:otherwise>
  343. </xsl:choose>
  344. </xsl:if>
  345. </cp:columnContent>
  346. </cp:tableContent>
  347. </cp:table>
  348. </lyt:section>
  349. </lyt:layout>
  350. <dp:footer>
  351. <df:button df:id="IDS_CLOSE" df:style="back-url"/>
  352. </dp:footer>
  353. </utml:form>
  354. </dp:page>
  355. </xsl:template>
  356. <!-- Insert common templates -->
  357. <pf:gen-icon/>
  358. </xsl:stylesheet>
  359. </xts:block>
  360. <!--======================================================================
  361. Name: debug
  362. Comments: display the debug info.
  363. ======================================================================-->
  364. <xts:block id="debug" dependency="resultPage" condition=".[/root/session/param[@name='debug']='1']" type="exec" mode="output" processor="XSLT" mandatory="false" mimeType="text/html">
  365. <!-- get the debug logic sheet -->
  366. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  367. <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">
  368. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  369. <xsl:template match="/">
  370. <dbg:dumpxml select="/root"/>
  371. </xsl:template>
  372. </xsl:stylesheet>
  373. </xts:block>
  374. </xts:morphlet>