generateDefaultSubscribeTaskOptions.xslt 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: ASV
  5. (C) Copyright IBM Corp. 2005, 2010
  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"
  9. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  10. xmlns:dlgctrl="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/controller-templates/"
  11. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  12. xmlns:req-params="http://developer.cognos.com/schemas/request/params"
  13. xmlns:rdsad="http://developer.cognos.com/schemas/xts/rdsad/"
  14. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  15. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  16. exclude-result-prefixes="xsl dlgctrl xtsext req-params xts rdsad pf">
  17. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  18. <pf:variables/>
  19. <xsl:template match="/">
  20. <!-- variables for each of the parameters for the subject -->
  21. <xsl:variable name="reportName">
  22. <xsl:value-of select="/root/env/param[@name='m_subData_periodical_producer_defaultName']"/>
  23. </xsl:variable>
  24. <!-- -->
  25. <xsl:variable name="measureName">
  26. <xsl:value-of select="/root/env/param[@name='m_subData_measure_name']"/>
  27. </xsl:variable>
  28. <!-- -->
  29. <xsl:variable name="operator">
  30. <xsl:call-template name="conditionEnumShortValue">
  31. <xsl:with-param name="conditionEnum">
  32. <xsl:value-of select="/root/env/param[@name='m_sub_operation']"/>
  33. </xsl:with-param>
  34. </xsl:call-template>
  35. </xsl:variable>
  36. <!-- -->
  37. <xsl:variable name="value1">
  38. <xsl:value-of select="/root/env/param[@name='m_sub_measure_value']"/>
  39. </xsl:variable>
  40. <!-- -->
  41. <xsl:variable name="value2">
  42. <xsl:value-of select="/root/env/param[@name='m_sub_measure_value1']"/>
  43. </xsl:variable>
  44. <!-- -->
  45. <xsl:variable name="s" select="concat(' ', key('system-param', 'ui_hide')/CC_RUN_OPTIONS_email_attachment/@show, ' ')"/>
  46. <xsl:variable name="run_with_options_allowEmailAsAttachment">
  47. <xsl:choose>
  48. <xsl:when test="
  49. not(key('system-param', 'ui_hide')/CC_RUN_OPTIONS_email_attachment)
  50. or
  51. (
  52. key('system-param', 'ui_hide')/CC_RUN_OPTIONS_email_attachment
  53. and
  54. (
  55. (contains($s, 'Administrators') and $hasAdminCapability) or
  56. (contains($s, 'QSUsers') and $hasFullQSCapability) or
  57. (contains($s, 'RSUsers') and $hasFullRSCapability) or
  58. (contains($s, 'Consumers') and $is-named='1') or
  59. (contains($s, 'Anonymous') and $is-named='0') or
  60. (key('system-param', 'ui_groups')/group[contains($s, concat(' ', @id, ' ')) and contains( key('session-param', 'uig'), concat(' ', @id, ' '))])
  61. )
  62. )">
  63. <xsl:text>true</xsl:text>
  64. </xsl:when>
  65. <xsl:otherwise>
  66. <xsl:text>false</xsl:text>
  67. </xsl:otherwise>
  68. </xsl:choose>
  69. </xsl:variable>
  70. <!-- -->
  71. <xts:sequence>
  72. <!-- make the request -->
  73. <dlgctrl:XTS2Request>
  74. <dlgctrl:target>/subscribe/taskOptions/task_options.xts</dlgctrl:target>
  75. <dlgctrl:stackName>task_options</dlgctrl:stackName>
  76. <dlgctrl:requestState>task|genDefault</dlgctrl:requestState>
  77. <dlgctrl:param name="defaultEmailAsAttachment">
  78. <xsl:value-of select="$run_with_options_allowEmailAsAttachment"/>
  79. </dlgctrl:param>
  80. <dlgctrl:param name="defaultSubject">
  81. <xsl:choose>
  82. <xsl:when test="/root/env/param[@name='m_sub_type']='nonMetric' and /root/env/param[@name='m_sub_operation']='between' "><xts:string id="IDS_CUSTSUB_DEFAULT_SUBJECT2"><xts:param name="reportName"><xsl:value-of select="$reportName"/></xts:param><xts:param name="measureName"><xsl:value-of select="$measureName"/></xts:param><xts:param name="operator"><xsl:value-of select="$operator"/></xts:param><xts:param name="value1"><xsl:value-of select="$value1"/></xts:param><xts:param name="value2"><xsl:value-of select="$value2"/></xts:param></xts:string></xsl:when>
  83. <xsl:when test="/root/env/param[@name='m_sub_type']='nonMetric' and not(/root/env/param[@name='m_sub_operation']='between') "><xts:string id="IDS_CUSTSUB_DEFAULT_SUBJECT"><xts:param name="reportName"><xsl:value-of select="$reportName"/></xts:param><xts:param name="measureName"><xsl:value-of select="$measureName"/></xts:param><xts:param name="operator"><xsl:value-of select="$operator"/></xts:param><xts:param name="value1"><xsl:value-of select="$value1"/></xts:param></xts:string></xsl:when>
  84. <xsl:when test="/root/env/param[@name='m_sub_type']='metric' "><xts:string id="IDS_CUSTSUB_DEFAULT_SUBJECT_METRIC"><xts:param name="measureName"><xsl:value-of select="$measureName"/></xts:param></xts:string></xsl:when>
  85. </xsl:choose>
  86. </dlgctrl:param>
  87. <req-params:param name="subscription">
  88. <xsl:text>true</xsl:text>
  89. </req-params:param>
  90. <req-params:param name="taskType">
  91. <xsl:text>notification</xsl:text>
  92. </req-params:param>
  93. </dlgctrl:XTS2Request>
  94. </xts:sequence>
  95. </xsl:template>
  96. <rdsad:enumTemplates/>
  97. </xsl:stylesheet>