set_suspend.xts 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  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, 2013
  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/cogadminuimsgs.xml" resolverBase="cogadmin">
  13. <!--
  14. clickedOkUpdateCurrentActivitiess - executed once the user hit the OK button on the Suspend popup dialog to update the schedules
  15. -->
  16. <xts:block id="frag_init" nodelist="env, credential" type="exec" mode="interpret" processor="XSLT" path="cogadmin/logicsheets/fragment_init.xslt" condition=".[not(/root/env/param[@name='frag-directive']='meta-only')]" mandatory="true"/>
  17. <!--
  18. clickedOk to update current background activities - executed once the user hit the OK button on the suspend popup dialog to update the current background activities
  19. -->
  20. <xts:block id="clickedOkUpdateCurrentActivities" dependency="frag_init" type="exec" nodelist="env, header, user, system" processor="XSLT" mandatory="false" condition=".[/root/env/param[@name='userClickedOk']='true']">
  21. <xts:logicsheet path="/cogadmin/logicsheets/presentation/common.xslt"/>
  22. <xts:logicsheet path="/cogadmin/logicsheets/buslogic.xslt"/>
  23. <xsl:stylesheet version="1.0"
  24. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  25. xmlns:ui="http://developer.cognos.com/schemas/ui/presentation/markup/"
  26. xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
  27. xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  28. xmlns:xos="http://developer.cognos.com/schemas/xts/output/"
  29. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
  30. xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  31. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  32. xmlns:es="http://developer.cognos.com/schemas/eventManagementService/1"
  33. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  34. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  35. xmlns:uic="http://developer.cognos.com/schemas/uic/presentation/markup/"
  36. exclude-result-prefixes="xsl ui SOAP-ENC SOAP-ENV xos send xsd cm es xtsext xsi uic">
  37. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  38. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  39. <xsl:template match="/">
  40. <!-- update the upcoming_activities with the selected suspend criteria (from upcoming_activities) -->
  41. <xts:sequence>
  42. <xts:append>
  43. <result>
  44. <xsl:variable name="xsl_UTC_until">
  45. <xsl:value-of select="xtsext:formatDateToUTC( string( /root/env/param[@name='release'] ), string( /root/user/param[@name='timeZoneID'] ) )"/>
  46. </xsl:variable>
  47. <send:request provider="eventManagementService" faultBlock="faultHandler">
  48. <xsl:choose>
  49. <xsl:when test="not($xsl_UTC_until='')">
  50. <delayEventsUntil>
  51. <eventIDs xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:string[{count(/root/env/param[contains(@name, '_checkbox_')])}]">
  52. <xsl:for-each select="/root/env/param[contains(@name, '_checkbox_')]">
  53. <item xsi:type="xsd:string"><xsl:value-of select="."/></item>
  54. </xsl:for-each>
  55. </eventIDs>
  56. <until xsi:type="xsd:dateTime"><xsl:value-of select="$xsl_UTC_until"/></until>
  57. </delayEventsUntil>
  58. </xsl:when>
  59. <xsl:otherwise>
  60. <holdEvents>
  61. <eventIDs xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:string[{count(/root/env/param[contains(@name, '_checkbox_')])}]">
  62. <xsl:for-each select="/root/env/param[contains(@name, '_checkbox_')]">
  63. <item xsi:type="xsd:string"><xsl:value-of select="."/></item>
  64. </xsl:for-each>
  65. </eventIDs>
  66. </holdEvents>
  67. </xsl:otherwise>
  68. </xsl:choose>
  69. </send:request>
  70. </result>
  71. </xts:append>
  72. </xts:sequence>
  73. </xsl:template>
  74. </xsl:stylesheet>
  75. </xts:block>
  76. <!--
  77. checkResult - check result of request
  78. -->
  79. <xts:block id="checkResult" type="exec" dependency="frag_init clickedOkUpdateCurrentActivities" nodelist="env, header, user, system, result" processor="XSLT" mandatory="false" condition=".[/root/env/param[@name='userClickedOk']='true']">
  80. <xts:logicsheet path="/cogadmin/logicsheets/presentation/common.xslt"/>
  81. <xts:logicsheet path="/cogadmin/logicsheets/buslogic.xslt"/>
  82. <xsl:stylesheet version="1.0"
  83. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  84. xmlns:ui="http://developer.cognos.com/schemas/ui/presentation/markup/"
  85. xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
  86. xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  87. xmlns:xos="http://developer.cognos.com/schemas/xts/output/"
  88. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
  89. xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  90. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  91. xmlns:es="http://developer.cognos.com/schemas/eventManagementService/1"
  92. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  93. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  94. xmlns:uic="http://developer.cognos.com/schemas/uic/presentation/markup/"
  95. exclude-result-prefixes="xsl ui SOAP-ENC SOAP-ENV xos send xsd cm es xtsext xsi uic">
  96. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  97. <xsl:template match="/">
  98. <xts:sequence>
  99. <!-- create an empty fragment to run javascript -->
  100. <xts:append select="/root/output">
  101. <xos:part>
  102. <xos:entityHeader>
  103. <xos:param name="Content-Type">text/xml; charset=utf-8</xos:param>
  104. </xos:entityHeader>
  105. <xos:entityBody>
  106. <fragment>
  107. <markup>
  108. <mimeType>text/html</mimeType>
  109. <markupXml>
  110. <script>
  111. <!-- Display alert when a fault was returned -->
  112. <xsl:if test="/root/result/actionFault">
  113. <xsl:variable name="errorMessageString">
  114. <xsl:variable name="faultIdMarker" select="'CNC-EVE-3125'"/>
  115. <xsl:variable name="faultMessage" select="/root/result/actionFault//*[local-name()='messageString' and contains(.,$faultIdMarker)]"/>
  116. <xsl:choose>
  117. <xsl:when test="$faultMessage != ''">
  118. <xsl:value-of select="substring-after($faultMessage, $faultIdMarker)"/>
  119. </xsl:when>
  120. <xsl:otherwise>
  121. <xts:string id="IDS_SPD_PRIORITY_INFO"/>
  122. </xsl:otherwise>
  123. </xsl:choose>
  124. </xsl:variable>
  125. alert('<xsl:value-of select="xtsext:javascriptencode($errorMessageString)"/>');
  126. </xsl:if>
  127. _THIS_.uiDialog.destroy();
  128. raiseReloadEvent(_THIS_);
  129. </script>
  130. </markupXml>
  131. </markup>
  132. </fragment>
  133. </xos:entityBody>
  134. </xos:part>
  135. </xts:append>
  136. </xts:sequence>
  137. </xsl:template>
  138. </xsl:stylesheet>
  139. </xts:block>
  140. <xts:block id="getMeta" type="exec" mode="interpret" nodelist="env" processor="XSLT" mandatory="false" condition=".[not(/root/env/param[@name='userClickedOk']='true')]">
  141. <xsl:stylesheet version="1.0"
  142. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  143. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  144. xmlns:xos="http://developer.cognos.com/schemas/xts/output/"
  145. exclude-result-prefixes="xsl xts xos xtsext">
  146. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  147. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  148. <xsl:template match="/">
  149. <xts:sequence>
  150. <xts:append select="/root/output">
  151. <xos:part>
  152. <xos:entityHeader>
  153. <xos:param name="Content-Type">text/xml; charset=utf-8</xos:param>
  154. </xos:entityHeader>
  155. <xos:entityBody>
  156. <fragment>
  157. <info>
  158. <title>IDS_SSD_TITLE</title>
  159. </info>
  160. <globalValidator>
  161. <parameter>
  162. <name>userClickedOk</name>
  163. <ruleRef id="fragment-cogadmin:boolean"/>
  164. </parameter>
  165. </globalValidator>
  166. <meta/>
  167. </fragment>
  168. </xos:entityBody>
  169. </xos:part>
  170. </xts:append>
  171. </xts:sequence>
  172. </xsl:template>
  173. </xsl:stylesheet>
  174. </xts:block>
  175. <!--
  176. render - renders the Set the suspend schedule popup dialog
  177. -->
  178. <xts:block id="renderMarkup" type="exec" dependency="frag_init getMeta clickedOkUpdateCurrentActivities checkResult" nodelist="env, header, user, system" processor="XSLT" mandatory="false" condition=".[not(/root/env/param[@name='userClickedOk'])]">
  179. <xts:logicsheet path="cogadmin/logicsheets/presentation/filters.xslt"/>
  180. <xsl:stylesheet version="1.0"
  181. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  182. xmlns:ui="http://developer.cognos.com/schemas/ui/presentation/markup/"
  183. xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  184. xmlns:xos="http://developer.cognos.com/schemas/xts/output/"
  185. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  186. xmlns:flt="http://developer.cognos.com/schemas/uic/presentation/filters/"
  187. xmlns:uic="http://developer.cognos.com/schemas/uic/presentation/markup/"
  188. xmlns:val="http://developer.cognos.com/schemas/validator/1/"
  189. xmlns:fragment="urn:cognos:fragments:validator"
  190. xmlns:fragment-cogadmin="urn:cognos:fragments:validator:cogadmin"
  191. exclude-result-prefixes="xsl ui xos xtsext SOAP-ENV uic">
  192. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  193. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  194. <xsl:template match="/">
  195. <xts:sequence>
  196. <xts:append select="/root/output/xos:part/xos:entityBody/fragment">
  197. <markup>
  198. <library type="text/javascript" href="$WEB$/prompting/PRMTcompiled.js"/>
  199. <library type="text/javascript" href="$WEB$/prompting/properties.js"/>
  200. <library type="text/javascript" href="$WEB$/ps/j2html/js/j2html.js"/>
  201. <library type="text/javascript" href="$WEB$/ps/cogadmin/js/extension/Suspend.js"/>
  202. <mimeType>text/html</mimeType>
  203. <markupXml>
  204. <!-- render the HTML -->
  205. <xts:transform src="/cogadmin/transforms/presentation/renderFragment.xslt" processor="XSLT">
  206. <xts:param name="messageBase">/messages/cogadminuimsgs.xml</xts:param>
  207. <xts:param name="logicsheet">/cogadmin/logicsheets/admin.xslt</xts:param>
  208. <root>
  209. <uic:fragment>
  210. <!-- body -->
  211. <uic:header modal="true">
  212. <uic:width>400</uic:width>
  213. <uic:height>185</uic:height>
  214. <uic:title><xts:string id="IDS_SSD_TITLE"/></uic:title>
  215. <uic:description><xts:string id="IDS_SSD_DESCRIPTION"/></uic:description>
  216. </uic:header>
  217. <uic:body>
  218. <form name="pform">
  219. <uic:choice role="radiogroup" aria-labelledby="_THIS_suspend_label">
  220. <uic:label id="_THIS_suspend_label"><xts:string id="IDS_SSD_SUSPEND"/></uic:label>
  221. <uic:control>
  222. <input type="radio" name="_THIS_suspend_period" id="_THIS_suspend_indefinite">
  223. <xsl:if test="not(key('env-param','_SP_filter_suspend_finite') = 'true')">
  224. <xsl:attribute name="checked"/>
  225. </xsl:if>
  226. </input>
  227. </uic:control>
  228. <uic:controlContext><label for="_THIS_suspend_indefinite"><xts:string id="IDS_SSD_INDEFINATELY"/></label></uic:controlContext>
  229. <uic:control>
  230. <input type="radio" name="_THIS_suspend_period" id="_THIS_suspend_finite">
  231. <xsl:if test="key('env-param','_SP_filter_suspend_finite') = 'true'">
  232. <xsl:attribute name="checked"/>
  233. </xsl:if>
  234. </input>
  235. </uic:control>
  236. <uic:controlContext><label for="_THIS_suspend_finite"><xts:string id="IDS_SSD_UNTIL"/></label></uic:controlContext>
  237. <uic:control/>
  238. <uic:controlContext>
  239. <uic:choice>
  240. <uic:control>
  241. <div id="selectDate_THIS_endDate"/>
  242. <div id="selectTime_THIS_endTime"/>
  243. <script>
  244. _THIS_.env = {};
  245. _THIS_.env.fragment = _THIS_;
  246. <!-- add the selected checkboxes to a variable for passing into the retrieve() function-->
  247. _THIS_.env.context = {
  248. <xsl:for-each select="/root/env/param[contains(@name, '_checkbox_')]">
  249. '<xsl:value-of select="@name"/>':'<xsl:value-of select="xtsext:urlencode(.)"/>'<xsl:if test="position()!=last()">,</xsl:if>
  250. </xsl:for-each>
  251. };
  252. _THIS_.env.i18n = {'IDS_FLT_MSG_INVALID_DATE':'<xts:string id="IDS_FLT_MSG_INVALID_DATE" encode="javascript"/>','IDS_FLT_MSG_INVALID_TIME':'<xts:string id="IDS_FLT_MSG_INVALID_TIME" encode="javascript"/>'}
  253. _THIS_.Suspend = new com.cognos.admin.extension.Suspend(_THIS_.env);
  254. </script>
  255. </uic:control>
  256. </uic:choice>
  257. </uic:controlContext>
  258. </uic:choice>
  259. </form>
  260. </uic:body>
  261. </uic:fragment>
  262. <xts:queryNode select="/root/system | /root/session"/>
  263. </root>
  264. </xts:transform>
  265. </markupXml>
  266. </markup>
  267. </xts:append>
  268. </xts:sequence>
  269. </xsl:template>
  270. </xsl:stylesheet>
  271. </xts:block>
  272. <!--
  273. Fault handler: If a fault happens during an action, then we need to catch it and process it.
  274. -->
  275. <xts:block id="faultHandler" type="fault" processor="XSLT">
  276. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  277. <xsl:output method="xml"/>
  278. <xsl:template match="/root/fault">
  279. <actionFault>
  280. <xsl:copy-of select="."/>
  281. </actionFault>
  282. </xsl:template>
  283. <xsl:template match="text()"/>
  284. </xsl:stylesheet>
  285. </xts:block>
  286. </xts:morphlet>