enable.xts 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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. <!--
  13. ===============================================================================================
  14. Enables a schedule in CM based on parameters passed in.
  15. ===============================================================================================
  16. -->
  17. <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/" requiredCapability="canUseScheduling canUseMonitorActivityTool or">
  18. <xts:block id="doFormCommand" processor="XSLT" type="exec">
  19. <xts:logicsheet path="portal/iFrmCmd/logicsheets/cm-save.xsl"/>
  20. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  21. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
  22. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  23. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
  24. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  25. xmlns:form="http://developer.cognos.com/schemas/xts/portal/iFrmCmd/1/"
  26. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  27. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  28. exclude-result-prefixes="xtsext">
  29. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  30. <xsl:template match="/root/command/form:enable/form:env">
  31. <xts:sequence>
  32. <xts:append>
  33. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  34. <send:request provider="cm">
  35. <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
  36. <cm:update>
  37. <cm:objects xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  38. <!-- this is the a single object -->
  39. <xsl:if test="(form:param[@name = 'm_obj'] and (form:param[@name = 'm_obj'] != ''))">
  40. <xsl:variable name="searchPath">
  41. <xsl:choose>
  42. <xsl:when test="contains(string(form:param[@name = 'm_obj']),'reportDataServiceAgentDefinition')">
  43. <xsl:value-of select="form:param[@name = 'm_obj']"/>/schedule<xsl:text/>
  44. </xsl:when>
  45. <xsl:otherwise><xsl:value-of select="form:param[@name = 'm_obj']"/></xsl:otherwise>
  46. </xsl:choose>
  47. </xsl:variable>
  48. <cm:schedule>
  49. <cm:searchPath><xsl:value-of select="$searchPath"/></cm:searchPath>
  50. <cm:active>true</cm:active>
  51. </cm:schedule>
  52. </xsl:if>
  53. <!-- Capture if object is reportDataServiceAgentDefinition -->
  54. <xsl:variable name="isRule">
  55. <xsl:choose>
  56. <xsl:when test="form:param[@name = 'm_isRule']">true</xsl:when>
  57. <xsl:otherwise>false</xsl:otherwise>
  58. </xsl:choose>
  59. </xsl:variable>
  60. <!-- this is when a list of items is sent via edit entries -->
  61. <xsl:for-each select="form:param[starts-with(@name, 'checkbox_')]">
  62. <cm:schedule>
  63. <xsl:variable name="searchPath">
  64. <xsl:choose>
  65. <xsl:when test="$isRule = 'true'">
  66. <xsl:value-of select="string(.)"/>/schedule<xsl:text/>
  67. </xsl:when>
  68. <xsl:otherwise><xsl:value-of select="string(.)"/></xsl:otherwise>
  69. </xsl:choose>
  70. </xsl:variable>
  71. <cm:searchPath><xsl:value-of select="$searchPath"/></cm:searchPath>
  72. <cm:active>true</cm:active>
  73. </cm:schedule>
  74. </xsl:for-each>
  75. </cm:objects>
  76. </cm:update>
  77. </xts:transform>
  78. </send:request>
  79. </xts:transform>
  80. </xts:append>
  81. </xts:sequence>
  82. </xsl:template>
  83. </xsl:stylesheet>
  84. </xts:block>
  85. <!-- operation results -->
  86. <xts:block id="commandResults" processor="XSLT" type="exec" mode="output" mimeType="text/xml" dependency="doFormCommand">
  87. <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
  88. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" version="1.0">
  89. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  90. <xsl:template match="/root">
  91. <response xmlns="http://developer.cognos.com/schemas/xts/portal/iFrmCmd/1/">
  92. <xsl:choose>
  93. <xsl:when test="cm:updateResponse"><xsl:copy-of select="cm:updateResponse"/></xsl:when>
  94. <xsl:otherwise><error/></xsl:otherwise>
  95. </xsl:choose>
  96. </response>
  97. </xsl:template>
  98. <xsl:template match="text()"/>
  99. </xsl:stylesheet>
  100. </xts:block>
  101. </xts:morphlet>