scheduleVars.xsl 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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. <!-- This stylesheet defines global portal variables and templates. -->
  13. <xsl:stylesheet version="1.0"
  14. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  15. xmlns:out="dummy-uri"
  16. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  17. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  18. xmlns:rui="http://developer.cognos.com/schemas/xts/logicsheet/xslt/presentation/dialog/recurrenceUI/"
  19. exclude-result-prefixes="xsl xts cm rui">
  20. <xsl:output method="xml" encoding="UTF-8" indent="no"/>
  21. <xsl:namespace-alias stylesheet-prefix="out" result-prefix="xsl"/>
  22. <!--
  23. Template - rui:variables:
  24. This template defines global variables used in the schudule dialog
  25. -->
  26. <xsl:template match="rui:variables">
  27. <out:variable name="scheduleCredentialSearchPathProperty">
  28. <out:choose>
  29. <out:when test="/root/cm:queryResponse/cm:queryReply/cm:schedule/cm:credential/cm:credential/cm:searchPath">
  30. <out:value-of select="/root/cm:queryResponse/cm:queryReply/cm:schedule/cm:credential/cm:credential/cm:searchPath"/>
  31. </out:when>
  32. <out:when test="/root/scheduleCredentials/credential/cm:credential/cm:searchPath">
  33. <out:value-of select="/root/scheduleCredentials/credential/cm:credential/cm:searchPath"/>
  34. </out:when>
  35. <out:otherwise>unavailable</out:otherwise>
  36. </out:choose>
  37. </out:variable>
  38. <out:variable name="userCredentialSearchPathProperty">
  39. <out:choose>
  40. <out:when test="/root/cm:queryResponse/cm:queryReply/cm:credential/cm:searchPath">
  41. <out:value-of select="/root/cm:queryResponse/cm:queryReply/cm:credential/cm:searchPath"/>
  42. </out:when>
  43. <out:otherwise>unavailable</out:otherwise>
  44. </out:choose>
  45. </out:variable>
  46. <out:variable name="scheduleCredentialDefaultName">
  47. <out:choose>
  48. <out:when test="root/credentialInfo/cm:queryResponse/cm:queryReply[2]/cm:account/cm:defaultName">
  49. <out:value-of select="root/credentialInfo/cm:queryResponse/cm:queryReply[2]/cm:account/cm:defaultName"/>
  50. <out:if test="root/credentialInfo/cm:queryResponse/cm:queryReply[2]/cm:account/cm:userName!=''">
  51. <out:value-of select="concat(' (',root/credentialInfo/cm:queryResponse/cm:queryReply[2]/cm:account/cm:userName,')')"/>
  52. </out:if>
  53. </out:when>
  54. </out:choose>
  55. </out:variable>
  56. <out:variable name="userCredentialDefaultName">
  57. <out:choose>
  58. <out:when test="root/credentialInfo/cm:queryResponse/cm:queryReply[1]/cm:account/cm:defaultName">
  59. <out:value-of select="root/credentialInfo/cm:queryResponse/cm:queryReply[1]/cm:account/cm:defaultName"/>
  60. <out:if test="root/credentialInfo/cm:queryResponse/cm:queryReply[1]/cm:account/cm:userName!=''">
  61. <out:value-of select="concat(' (',root/credentialInfo/cm:queryResponse/cm:queryReply[1]/cm:account/cm:userName,')')"/>
  62. </out:if>
  63. </out:when>
  64. </out:choose>
  65. </out:variable>
  66. <out:variable name="scheduleExists">
  67. <out:choose>
  68. <out:when test="/root/cm:queryResponse/cm:queryReply/cm:schedule">true</out:when>
  69. <out:otherwise>false</out:otherwise>
  70. </out:choose>
  71. </out:variable>
  72. <out:variable name="userCredentialsExist">
  73. <out:choose>
  74. <out:when test="$userCredentialSearchPathProperty='unavailable'">false</out:when>
  75. <out:otherwise>true</out:otherwise>
  76. </out:choose>
  77. </out:variable>
  78. <out:variable name="scheduleCredentialsExist">
  79. <out:choose>
  80. <out:when test="$scheduleCredentialSearchPathProperty='unavailable'">false</out:when>
  81. <out:otherwise>true</out:otherwise>
  82. </out:choose>
  83. </out:variable>
  84. <out:variable name="scheduleCredentialDetailsUnavailable">
  85. <out:choose>
  86. <out:when test="$scheduleCredentialsExist='true' and (not(root/credentialInfo/cm:queryResponse/cm:queryReply[2]/cm:account/cm:defaultName) or root/credentialInfo/cm:queryResponse/cm:queryReply[2]/cm:account/cm:defaultName='')">true</out:when>
  87. <out:otherwise>false</out:otherwise>
  88. </out:choose>
  89. </out:variable>
  90. </xsl:template>
  91. <xsl:template match="*">
  92. <xsl:copy>
  93. <xsl:copy-of select="@*"/>
  94. <xsl:apply-templates/>
  95. </xsl:copy>
  96. </xsl:template>
  97. </xsl:stylesheet>