group_actions.xts 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  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. <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"/>
  14. <!--
  15. Cancel the selected interactive activities
  16. -->
  17. <xts:block id="cancelInteractiveActivities" dependency="frag_init" nodelist="env, header" type="exec" mode="interpret" processor="XSLT" condition=".[/root/env/param[@name='group_action'] = 'cancel_interactive']" mandatory="false">
  18. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:admui="http://developer.cognos.com/schemas/xts/admui" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="xsl xts SOAP-ENV bus xtsext">
  19. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  20. <xsl:template match="/">
  21. <xts:sequence>
  22. <xts:append select="/root">
  23. <response>
  24. <xts:request protocol="CancelInteractiveActivities" responseEnvelope="false" faultBlock="faultHandler">
  25. <SOAP-ENV:Envelope xmlns:nemo="http://developer.cognos.com/nemo" xmlns:wsrf-rp="http://docs.oasis-open.org/wsrf/rp-2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  26. <SOAP-ENV:Header>
  27. <xsl:copy-of select="/root/header/bus:biBusHeader"/>
  28. <nemo:cogadminHeader>
  29. <nemo:ResourceIdentifier>cm:system</nemo:ResourceIdentifier>
  30. </nemo:cogadminHeader>
  31. </SOAP-ENV:Header>
  32. <SOAP-ENV:Body>
  33. <resource-prop:CancelInteractiveActivities xmlns:resource-prop="http://developer.cognos.com/admin/properties">
  34. <xsl:for-each select="/root/env/param[starts-with(@name, 'requestID_')]">
  35. <xsl:variable name="dispNameVar"><xsl:value-of select="concat('dispatcherName_', substring-after(@name, 'requestID_'))"/></xsl:variable>
  36. <resource-prop:Activity>
  37. <resource-prop:Property name="RequestID"><xsl:value-of select="."/></resource-prop:Property>
  38. <resource-prop:Property name="DispatcherName"><xsl:value-of select="/root/env/param[@name = $dispNameVar]"/></resource-prop:Property>
  39. </resource-prop:Activity>
  40. </xsl:for-each>
  41. </resource-prop:CancelInteractiveActivities>
  42. </SOAP-ENV:Body>
  43. </SOAP-ENV:Envelope>
  44. </xts:request>
  45. </response>
  46. </xts:append>
  47. </xts:sequence>
  48. </xsl:template>
  49. </xsl:stylesheet>
  50. </xts:block>
  51. <!--
  52. Do schudule actions (iFrmcmd) : enable, disable, suspend, release, cancel
  53. -->
  54. <xts:block id="doScheduleActions" dependency="frag_init" nodelist="env, header" type="exec" mode="interpret" processor="XSLT" condition=".[/root/env/param[@name='ifrmcmd'] and not(/root/env/param[@name='ifrmcmd'] = '')]" mandatory="false">
  55. <xts:logicsheet path="/cogadmin/logicsheets/buslogic.xslt"/>
  56. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:admui="http://developer.cognos.com/schemas/xts/admui" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="xsl xts SOAP-ENV bus xtsext">
  57. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  58. <xsl:template match="/">
  59. <xts:sequence>
  60. <xts:append select="/root">
  61. <response>
  62. <send:request provider="xts" faultBlock="faultHandler">
  63. <xsl:element name="{/root/env/param[@name='ifrmcmd']}" namespace="http://developer.cognos.com/schemas/xts/portal/iFrmCmd/1/">
  64. <env xmlns="http://developer.cognos.com/schemas/xts/portal/iFrmCmd/1/">
  65. <param name="action">
  66. <xsl:value-of select="/root/env/param[@name='group_action']"/>
  67. </param>
  68. <xsl:for-each select="/root/env/*[starts-with(@name, 'm_')]">
  69. <param name="{@name}">
  70. <xsl:value-of select="."/>
  71. </param>
  72. </xsl:for-each>
  73. <xsl:for-each select="/root/env/*[starts-with(@name, 'checkbox_')]">
  74. <param name="{@name}">
  75. <xsl:value-of select="."/>
  76. </param>
  77. </xsl:for-each>
  78. </env>
  79. </xsl:element>
  80. </send:request>
  81. </response>
  82. </xts:append>
  83. </xts:sequence>
  84. </xsl:template>
  85. </xsl:stylesheet>
  86. </xts:block>
  87. <!--
  88. Do actions for upcoming activities: cancel, schedule
  89. -->
  90. <xts:block id="doEventActions" dependency="frag_init" nodelist="env, header" type="exec" mode="interpret" processor="XSLT" condition=".[/root/env/param[@name='group_action'] = 'cancel_upcoming' or /root/env/param[@name='group_action'] = 'schedule_upcoming']" mandatory="false">
  91. <xts:logicsheet path="/cogadmin/logicsheets/buslogic.xslt"/>
  92. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:admui="http://developer.cognos.com/schemas/xts/admui" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:es="http://developer.cognos.com/schemas/eventManagementService/1" exclude-result-prefixes="xsl xts SOAP-ENV bus xtsext">
  93. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  94. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  95. <xsl:template match="/">
  96. <xts:sequence>
  97. <xts:append>
  98. <actionResponse>
  99. <send:request provider="eventManagementService" faultBlock="faultHandler">
  100. <xsl:choose>
  101. <xsl:when test="key('env-param','group_action')='cancel_upcoming'">
  102. <es:cancelEvents>
  103. <xsl:call-template name="requestBody"/>
  104. </es:cancelEvents>
  105. </xsl:when>
  106. <xsl:when test="key('env-param','group_action')='schedule_upcoming'">
  107. <es:scheduleEvents>
  108. <xsl:call-template name="requestBody"/>
  109. </es:scheduleEvents>
  110. </xsl:when>
  111. </xsl:choose>
  112. </send:request>
  113. </actionResponse>
  114. </xts:append>
  115. </xts:sequence>
  116. </xsl:template>
  117. <xsl:template name="requestBody">
  118. <eventIDs xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:string[{count(/root/env/param[starts-with(@name,'checkbox_')])}]">
  119. <xsl:for-each select="/root/env/param[starts-with(@name,'checkbox_')]">
  120. <item xsi:type="xsd:string"><xsl:value-of select="."/></item>
  121. </xsl:for-each>
  122. </eventIDs>
  123. </xsl:template>
  124. </xsl:stylesheet>
  125. </xts:block>
  126. <!--
  127. Fault handler: If a fault happens during an action, then we need to catch it and process it.
  128. -->
  129. <xts:block id="faultHandler" dependency="frag_init" type="fault" processor="XSLT">
  130. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  131. <xsl:output method="xml"/>
  132. <xsl:template match="/root/fault">
  133. <actionFault>
  134. <xsl:copy-of select="."/>
  135. </actionFault>
  136. </xsl:template>
  137. <xsl:template match="text()"/>
  138. </xsl:stylesheet>
  139. </xts:block>
  140. <xts:block id="getMeta" type="exec" mode="interpret" nodelist="env" processor="XSLT">
  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:template match="/">
  148. <xts:sequence>
  149. <xts:append select="/root/output">
  150. <xos:part>
  151. <xos:entityHeader>
  152. <xos:param name="Content-Type">text/xml; charset=utf-8</xos:param>
  153. </xos:entityHeader>
  154. <xos:entityBody>
  155. <fragment>
  156. <info>
  157. <title>IDS_SPD_TITLE</title>
  158. </info>
  159. <meta/>
  160. </fragment>
  161. </xos:entityBody>
  162. </xos:part>
  163. </xts:append>
  164. </xts:sequence>
  165. </xsl:template>
  166. </xsl:stylesheet>
  167. </xts:block>
  168. <!--
  169. render - renders the result dialog or refresh the fragment
  170. -->
  171. <xts:block id="renderMarkup" type="exec" dependency="frag_init getMeta cancelInteractiveActivities doScheduleActions doEventActions" nodelist="env, header, user, system, response" processor="XSLT" mandatory="false">
  172. <xsl:stylesheet version="1.0"
  173. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  174. xmlns:ui="http://developer.cognos.com/schemas/ui/presentation/markup/"
  175. xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  176. xmlns:xos="http://developer.cognos.com/schemas/xts/output/"
  177. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  178. xmlns:uic="http://developer.cognos.com/schemas/uic/presentation/markup/"
  179. exclude-result-prefixes="xsl ui xos xtsext SOAP-ENV uic">
  180. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  181. <xsl:template match="/">
  182. <xts:sequence>
  183. <xts:append select="/root/output/*[local-name()='part']/*[local-name()='entityBody']/fragment">
  184. <markup>
  185. <mimeType>text/html</mimeType>
  186. <markupXml>
  187. <!-- render the HTML -->
  188. <xts:transform src="/cogadmin/transforms/presentation/renderFragment.xslt" processor="XSLT">
  189. <xts:param name="messageBase">/messages/cogadminuimsgs.xml</xts:param>
  190. <xts:param name="logicsheet">/cogadmin/logicsheets/admin.xslt</xts:param>
  191. <root>
  192. <!-- Generate UI markup using the response -->
  193. <xts:transform src="/cogadmin/controls/transforms/gen-ui-markup/group_actions.xslt" processor="XSLT">
  194. <xts:param name="messageBase">/messages/cogadminuimsgs.xml</xts:param>
  195. <xts:param name="logicsheet">/cogadmin/logicsheets/presentation/common.xslt</xts:param>
  196. <xts:param name="logicsheet">/cogadmin/logicsheets/admin.xslt</xts:param>
  197. <root>
  198. <xts:queryNode select="/root/response | /root/session | /root/env"/>
  199. </root>
  200. </xts:transform>
  201. <xts:queryNode select="/root/system | /root/session"/>
  202. </root>
  203. </xts:transform>
  204. </markupXml>
  205. </markup>
  206. </xts:append>
  207. </xts:sequence>
  208. </xsl:template>
  209. </xsl:stylesheet>
  210. </xts:block>
  211. </xts:morphlet>