reset_event_list.xts 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. <xts:morphlet xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="messages/AGS.xml,messages/portal.xml,messages/portalRL.xml" requiredCapability="canUseEventStudio">
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: AGS
  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. ===============================================================================================
  10. formlogic_init - standard form logic initialization dependency="storePreviousTab"
  11. ===============================================================================================
  12. -->
  13. <xts:block id="formlogic_init" type="exec" mode="interpret" processor="XSLT" path="/logicsheets/formlogic_init.xslt"/>
  14. <xts:block id="decode_agent_definition" processor="XSLT" type="exec">
  15. <xts:logicsheet path="logicsheets/presentation/dialog/templates.xsl"/>
  16. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  17. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt">
  18. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  19. <xsl:template match="/">
  20. <xts:sequence>
  21. <xsl:choose>
  22. <xsl:when test="/root/env/param[@name = 'agent_definition_blob']">
  23. <!-- decode the agent items -->
  24. <xts:append select="/root">
  25. <xsl:value-of select="xtsext:web64decode( xtsext:cafaction('sign_unwrap_settemplatename_decodeagentdefinition_settemplateid_presave001', string( /root/env/param[@name = 'agent_definition_blob'])), true() )" disable-output-escaping="yes"/>
  26. </xts:append>
  27. </xsl:when>
  28. </xsl:choose>
  29. </xts:sequence>
  30. </xsl:template>
  31. </xsl:stylesheet>
  32. </xts:block>
  33. <!--
  34. ===========================================================================
  35. checkForEventOutput
  36. ===========================================================================
  37. -->
  38. <xts:block id="checkForEventOutput" dependency="decode_agent_definition" processor="XSLT" condition="/root/agent_definition/agentDefinition" mandatory="false" type="exec">
  39. <xts:logicsheet path="logicsheets/portal.xsl"/>
  40. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  41. <xsl:stylesheet version="1.0"
  42. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  43. xmlns:form="http://developer.cognos.com/schemas/xts/ags/iFrmCmd/1/"
  44. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
  45. xmlns:xtscm="http://developer.cognos.com/schemas/xts-cm/1/"
  46. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  47. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  48. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  49. xmlns:x="x" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
  50. xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  51. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  52. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  53. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  54. exclude-result-prefixes="form send xtscm pf bus cm x SOAP-ENC SOAP-ENV xsi xts xtsext">
  55. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  56. <xsl:template match="/">
  57. <xts:sequence>
  58. <xts:append>
  59. <outputResponse>
  60. <send:request provider="cm" outputHeader="true" responseEnvelope="true" requester="AGS:reset_event_list">
  61. <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
  62. <cm:query>
  63. <cm:search>/transientStateFolder/agentState[containsReferences(@definition, <xsl:value-of select="/root/agent_definition/agentDefinition"/>)]/reportView/reportVersion/*</cm:search>
  64. <cm:properties>
  65. <cm:property name="searchPath"/>
  66. </cm:properties>
  67. </cm:query>
  68. </xts:transform>
  69. </send:request>
  70. </outputResponse>
  71. </xts:append>
  72. </xts:sequence>
  73. </xsl:template>
  74. </xsl:stylesheet>
  75. </xts:block>
  76. <!--
  77. ===========================================================================
  78. doResetEventList
  79. ===========================================================================
  80. -->
  81. <xts:block id="doResetEventList" dependency="checkForEventOutput" processor="XSLT" condition=".[/root/agent_definition/agentDefinition and count(/root/outputResponse//*[local-name()='queryResponse']//*[local-name()='item']) > 0 and (not(/root/outputResponse/soapFault) or not(/root/outputResponse/authenticationFault)) ]" mandatory="false" type="exec">
  82. <xts:logicsheet path="logicsheets/portal.xsl"/>
  83. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  84. <xsl:stylesheet version="1.0"
  85. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  86. xmlns:form="http://developer.cognos.com/schemas/xts/ags/iFrmCmd/1/"
  87. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
  88. xmlns:xtscm="http://developer.cognos.com/schemas/xts-cm/1/"
  89. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  90. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  91. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  92. xmlns:x="x" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
  93. xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  94. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  95. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  96. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  97. exclude-result-prefixes="form send xtscm pf bus cm x SOAP-ENC SOAP-ENV xsi xts xtsext">
  98. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  99. <xsl:template match="/">
  100. <xts:sequence>
  101. <xts:append>
  102. <resetEventListResponse>
  103. <xts:request href="bus://dispatcher" protocol="BUS" responseEnvelope="true" option="xml-multipart" outputHeader="true">
  104. <xsl:attribute name="soapAction"><xsl:text>http://www.ibm.com/xmlns/prod/cognos/agentService/201505/</xsl:text></xsl:attribute>
  105. <SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
  106. <SOAP-ENV:Header>
  107. <bus:biBusHeader xsi:type="bus:biBusHeader">
  108. <xsl:copy-of select="/root/header/bus:biBusHeader/*"/>
  109. </bus:biBusHeader>
  110. </SOAP-ENV:Header>
  111. <SOAP-ENV:Body>
  112. <bus:deleteHotList xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  113. <objectPath xsi:type="bus:searchPathSingleObject">
  114. <xsl:value-of select="/root/agent_definition/agentDefinition"/>
  115. </objectPath>
  116. </bus:deleteHotList>
  117. </SOAP-ENV:Body>
  118. </SOAP-ENV:Envelope>
  119. </xts:request>
  120. </resetEventListResponse>
  121. </xts:append>
  122. </xts:sequence>
  123. </xsl:template>
  124. </xsl:stylesheet>
  125. </xts:block>
  126. <!--
  127. ===============================================================================================
  128. processResult - add the results of the request into the right place
  129. ===============================================================================================
  130. -->
  131. <xts:block id="processResult" mode="output" mimeType="application/xml; charset=utf-8" processor="XSLT" type="exec" dependency="doResetEventList" mandatory="false">
  132. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  133. <xts:logicsheet path="logicsheets/portal.xsl"/>
  134. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
  135. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  136. xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  137. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  138. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  139. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
  140. xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/"
  141. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  142. xmlns:xos="http://developer.cognos.com/schemas/xts/output/"
  143. exclude-result-prefixes="xtsext SOAP-ENV pf bus send cml xsi xos">
  144. <xsl:output method="xml" version="1.0" encoding="UTF-8"/>
  145. <xsl:template match="/root">
  146. <xsl:choose>
  147. <xsl:when test="not(./agent_definition/agentDefinition) or ./agent_definition/agentDefinition = ''">
  148. <xsl:variable name="msg1">
  149. <xts:string id="SAVE_AGENT_FIRST"/>
  150. </xsl:variable>
  151. <message><xsl:value-of select="normalize-space(xtsext:javascriptencode($msg1))"/></message>
  152. </xsl:when>
  153. <xsl:when test="./agent_definition/agentDefinition and ./agent_definition/agentDefinition != '' and count(./outputResponse//*[local-name()='queryResponse']//*[local-name()='item']) > 0 ">
  154. <xsl:variable name="msg2">
  155. <xts:string id="RESET_AGENT_SUCCESSFUL"/>
  156. </xsl:variable>
  157. <message><xsl:value-of select="normalize-space(xtsext:javascriptencode($msg2))"/></message>
  158. </xsl:when>
  159. <xsl:when test="./agent_definition/agentDefinition and ./agent_definition/agentDefinition != '' and count(./outputResponse//*[local-name()='queryResponse']//*[local-name()='item']) = 0 ">
  160. <xsl:variable name="msg3">
  161. <xts:string id="RUN_AGENT_FIRST"/>
  162. </xsl:variable>
  163. <message><xsl:value-of select="normalize-space(xtsext:javascriptencode($msg3))"/></message>
  164. </xsl:when>
  165. </xsl:choose>
  166. </xsl:template>
  167. </xsl:stylesheet>
  168. </xts:block>
  169. </xts:morphlet>