renderPage.xslt 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: HTS
  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:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  11. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  12. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  13. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  14. xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
  15. xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
  16. exclude-result-prefixes="xsl cm xtsext xts pf cf cp">
  17. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
  18. <pf:variables/>
  19. <xsl:template match="/root">
  20. <html>
  21. <head>
  22. <title>Loading Access Information</title>
  23. <script language="JavaScript">
  24. // the entries array is generated by the
  25. // server script, and populated with the
  26. // entries selected by he user in the CM wizard
  27. //
  28. function Entry()
  29. {
  30. var path;
  31. var objectClass;
  32. var defaultName;
  33. var iconURI;
  34. var key;
  35. var type;
  36. var img;
  37. }
  38. var g_vEntries = new Array();
  39. <xsl:choose>
  40. <xsl:when test="/root/morphletResponse/canceled">
  41. var cmd= 'canceled';
  42. </xsl:when>
  43. <xsl:otherwise>
  44. var cmd = 'ok';
  45. <xsl:for-each select="/root/newEntries/*">
  46. <xsl:variable name="fullPath">
  47. <cf:do-the-path-link>
  48. <cf:param name="familytree">*[local-name()='ancestors']</cf:param>
  49. <cf:param name="familymember">*[local-name()='defaultName']</cf:param>
  50. <cf:param name="onlyAncestors">true</cf:param>
  51. </cf:do-the-path-link>
  52. </xsl:variable>
  53. <xsl:variable name="type">
  54. <xsl:for-each select="*[local-name()='type']">
  55. <xsl:value-of select="xtsext:javascriptencode(string(.))"/>
  56. <xsl:if test="position()!=last()">,</xsl:if>
  57. </xsl:for-each>
  58. </xsl:variable>
  59. <xsl:variable name="i" select="position()-1"/>
  60. g_vEntries[<xsl:value-of select="$i"/>] = new Entry();
  61. g_vEntries[<xsl:value-of select="$i"/>].key = '<xsl:value-of select="xtsext:javascriptencode(string(*[local-name()='storeID']))"/>';
  62. g_vEntries[<xsl:value-of select="$i"/>].objectClass = '<xsl:value-of select="xtsext:javascriptencode(string(*[local-name()='objectClass']))"/>';
  63. g_vEntries[<xsl:value-of select="$i"/>].path = '<xsl:value-of select="xtsext:javascriptencode(string($fullPath))"/>';
  64. g_vEntries[<xsl:value-of select="$i"/>].iconURI = '<xsl:value-of select="xtsext:javascriptencode(string(*[local-name()='iconURI']))"/>';
  65. g_vEntries[<xsl:value-of select="$i"/>].defaultName = '<xsl:value-of select="xtsext:javascriptencode(string(*[local-name()='defaultName']))"/>';
  66. g_vEntries[<xsl:value-of select="$i"/>].searchPath = '<xsl:value-of select="xtsext:javascriptencode(string(*[local-name()='searchPath']))"/>';
  67. g_vEntries[<xsl:value-of select="$i"/>].type = '<xsl:value-of select="xtsext:javascriptencode(string($type))"/>';
  68. g_vEntries[<xsl:value-of select="$i"/>].img = '<xsl:value-of select="xtsext:javascriptencode(string(*[local-name()='img']))"/>';
  69. </xsl:for-each>
  70. </xsl:otherwise>
  71. </xsl:choose>
  72. <![CDATA[
  73. parent.ccModalCallBack(cmd, g_vEntries);
  74. ]]>
  75. </script>
  76. </head>
  77. <body>
  78. </body>
  79. </html>
  80. </xsl:template>
  81. </xsl:stylesheet>