terminateSessions.xts 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. 2013
  6. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. -->
  8. <xts:morphlet xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:create="http://developer.cognos.com/schemas/xts/portal/iFrmCmd/1/" xmlns:cms="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cms/1/">
  9. <xts:block id="doFormCommand" processor="XSLT" type="exec">
  10. <xts:logicsheet path="portal/iFrmCmd/logicsheets/cm-save.xsl"/>
  11. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  12. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
  13. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  14. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
  15. xmlns:form="http://developer.cognos.com/schemas/xts/portal/iFrmCmd/1/"
  16. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  17. exclude-result-prefixes="xsl xts send form xtsext">
  18. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  19. <xsl:template match="/root/command/form:terminateSessions/form:env">
  20. <xts:sequence>
  21. <xts:append>
  22. <send:request provider="cam">
  23. <cam:terminateSessions xmlns:cam="http://developer.cognos.com/schemas/saCAMService/1" 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">
  24. <search>
  25. <xsl:variable name="tenants">
  26. <xsl:choose>
  27. <xsl:when test="(form:param[@name = 'm_obj'] and (form:param[@name = 'm_obj'] != ''))">
  28. <!-- Single object delete. -->
  29. <id><xsl:value-of select="form:param[@name = 'm_obj']"/></id>
  30. </xsl:when>
  31. <xsl:otherwise>
  32. <!-- Group object delete. -->
  33. <xsl:for-each select="form:param[starts-with(@name, 'checkbox_')]">
  34. <id><xsl:value-of select="."/></id>
  35. </xsl:for-each>
  36. </xsl:otherwise>
  37. </xsl:choose>
  38. </xsl:variable>
  39. <xsl:for-each select="$tenants/id">
  40. <xsl:variable name="sq">'</xsl:variable>
  41. <!-- must escape the ' to '' to make the search expression CM safe. -->
  42. <xsl:variable name="cmEncodedObjTenantId" select="xtsext:replace(string(.), string($sq), concat($sq,$sq)) "/>
  43. <xsl:choose>
  44. <xsl:when test="position()=1">/session/*[</xsl:when>
  45. <xsl:otherwise> or </xsl:otherwise>
  46. </xsl:choose>
  47. @tenantID='<xsl:value-of select="$cmEncodedObjTenantId"/>'
  48. <xsl:if test="position()=last()">]</xsl:if>
  49. </xsl:for-each>
  50. </search>
  51. </cam:terminateSessions>
  52. </send:request>
  53. </xts:append>
  54. </xts:sequence>
  55. </xsl:template>
  56. </xsl:stylesheet>
  57. </xts:block>
  58. <!-- operation results -->
  59. <xts:block id="commandResults" processor="XSLT" type="exec" mode="output" mimeType="text/xml" dependency="doFormCommand">
  60. <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
  61. <xsl:stylesheet version="1.0"
  62. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  63. xmlns:cam="http://developer.cognos.com/schemas/saCAMService/1"
  64. exclude-result-prefixes="xsl">
  65. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  66. <xsl:template match="/root">
  67. <xsl:choose>
  68. <xsl:when test="cam:terminateSessionsResponse"><xsl:copy-of select="cam:terminateSessionsResponse"/></xsl:when>
  69. <xsl:otherwise><error/></xsl:otherwise>
  70. </xsl:choose>
  71. </xsl:template>
  72. <xsl:template match="text()"/>
  73. </xsl:stylesheet>
  74. </xts:block>
  75. </xts:morphlet>