processSuppression.xslt 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: AGS
  5. (C) Copyright IBM Corp. 2005, 2008
  6. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. -->
  8. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:agsad="http://developer.cognos.com/schemas/xts/logicsheets/xslt/ags/agentDefinition/" xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/" xmlns:xts="http://developer.cognos.com/schemas/xts/" exclude-result-prefixes="xsl agsad dp xts">
  9. <xsl:output method="xml" encoding="utf-8" indent="no"/>
  10. <xsl:template match="/">
  11. <xsl:variable name="tabSelectedID" select="/root/sb/param[@name='tabSelectedID']"/>
  12. <xsl:variable name="type">
  13. <xsl:value-of select="/root/agent_definition/items/item[./id= $tabSelectedID]/type"/>
  14. </xsl:variable>
  15. <xsl:variable name="displayDetails">
  16. <xsl:call-template name="displayDetails">
  17. <xsl:with-param name="type">
  18. <xsl:value-of select="$type"/>
  19. </xsl:with-param>
  20. </xsl:call-template>
  21. </xsl:variable>
  22. <xsl:variable name="eventList">
  23. <xsl:call-template name="chopText">
  24. <xsl:with-param name="text">
  25. <xsl:call-template name="getTaskSuppressionStateText">
  26. <xsl:with-param name="suppression-node" select="/root/agent_definition/items/item[./id = $tabSelectedID]/suppression"/>
  27. </xsl:call-template>
  28. </xsl:with-param>
  29. </xsl:call-template>
  30. </xsl:variable>
  31. <xsl:variable name="runOnFailure">
  32. <xsl:value-of select="/root/agent_definition/items/item[./id= $tabSelectedID ]/runCondition = 'runOnFailure'"/>
  33. </xsl:variable>
  34. <xsl:variable name="display">
  35. <xsl:if test="$runOnFailure != 'true' and $eventList = ''">none</xsl:if>
  36. </xsl:variable>
  37. <xts:sequence>
  38. <xts:append select="/root">
  39. <suppressionDetails>
  40. <xsl:attribute name="isCurrentFailureTask"><xsl:value-of select="$runOnFailure"/></xsl:attribute>
  41. <xts:transform name="XMLEncode">
  42. <dp:list>
  43. <xsl:attribute name="id">eventListTable</xsl:attribute>
  44. <xsl:attribute name="style">display:<xsl:value-of select="$display"/></xsl:attribute>
  45. <dp:section>
  46. <dp:label>
  47. <xsl:choose>
  48. <xsl:when test="$runOnFailure = 'true' ">
  49. <xts:string id="DIALOG_SUPPRESSION_SUMMARY_TEXT_HEADING_ON_FAILURE">
  50. <xts:param name="taskType">
  51. <xsl:value-of select="$displayDetails/text"/>
  52. </xts:param>
  53. </xts:string>
  54. </xsl:when>
  55. <xsl:otherwise>
  56. <xts:string id="DIALOG_SUPPRESSION_SUMMARY_TEXT_HEADING">
  57. <xts:param name="taskType">
  58. <xsl:value-of select="$displayDetails/text"/>
  59. </xts:param>
  60. </xts:string>
  61. </xsl:otherwise>
  62. </xsl:choose>
  63. </dp:label>
  64. </dp:section>
  65. <dp:section>
  66. <dp:text wrap="true" nospace="true">
  67. <xsl:value-of select="$eventList"/>
  68. </dp:text>
  69. </dp:section>
  70. </dp:list>
  71. </xts:transform>
  72. </suppressionDetails>
  73. </xts:append>
  74. </xts:sequence>
  75. </xsl:template>
  76. <agsad:taskSuppressionStateText/>
  77. <agsad:displayDetails/>
  78. </xsl:stylesheet>