getServerTransform.xslt 6.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xsl:stylesheet version="1.0"
  3. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  4. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  5. xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
  6. xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  7. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  8. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt">
  9. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
  10. <xsl:template match="/root">
  11. <atom:feed xmlns:atom="http://www.w3.org/2005/Atom">
  12. <atom:id>TM1 root ID</atom:id>
  13. <atom:title xml:lang="en">TM1 Root Feed</atom:title>
  14. <xsl:variable name="gateway" select="/root/GatewayURL"/>
  15. <xsl:apply-templates select="loginServerCAMResponse/loginServerCAMReturn"/>
  16. <xsl:apply-templates select="loginServerResponse/loginServerReturn"/>
  17. </atom:feed>
  18. </xsl:template>
  19. <xsl:template match="loginServerCAMReturn">
  20. <xsl:variable name="webroot" select="/root/WebRootURL"/>
  21. <xsl:variable name="gateway" select="/root/GatewayURL"/>
  22. <xsl:variable name="jsessionid" select="/root/JSESSIONID"/>
  23. <xsl:variable name="sessionToken" select="sessionToken"/>
  24. <xsl:variable name="tm1weburl" select="/root/TM1WebURL"/>
  25. <xsl:variable name="tm1webvirtualdirectory" select="/root/TM1WebVirtualDirectory"/>
  26. <xsl:variable name="tm1serverhost" select="/root/TM1Host"/>
  27. <xsl:variable name="tm1servername" select="/root/TM1DataServer"/>
  28. <xsl:variable name="tm1displayviews" select="/root/TM1DisplayViews"/>
  29. <xsl:variable name="tm1username" select="/root/TM1username"/>
  30. <xsl:variable name="tm1pass" select="/root/TM1pass"/>
  31. <xsl:variable name="filterpackages" select="/root/FilterPackages"/>
  32. <atom:entry xmlns:atom="http://www.w3.org/2005/Atom">
  33. <atom:id>root1</atom:id>
  34. <atom:title xml:lang="en">Applications</atom:title>
  35. <atom:link rel="alternate" type="application/atom+xml" href="{$gateway}/icd/feeds/cm/system/xts.run?m=tm1/102RP2/getApplicationNodes.xts&amp;JSESSIONID={$jsessionid}&amp;sessionToken={$sessionToken}&amp;TM1WebURL={$tm1weburl}&amp;TM1WebVirtualDirectory={$tm1webvirtualdirectory}&amp;TM1Host={$tm1serverhost}&amp;TM1DataServer={$tm1servername}&amp;TM1username={$tm1username}&amp;TM1pass={$tm1pass}&amp;FilterPackages={$filterpackages}" title="">
  36. </atom:link>
  37. <atom:link rel="icon" type="image/gif" href="{$webroot}/tm1/bux/images/apps.gif"/>
  38. <atom:link rel="thumbnail" type="image/gif" href="{$webroot}/tm1/bux/images/apps_64.gif"/>
  39. </atom:entry>
  40. <xsl:choose>
  41. <xsl:when test="$tm1displayviews = 'N'">
  42. </xsl:when>
  43. <xsl:otherwise>
  44. <atom:entry xmlns:atom="http://www.w3.org/2005/Atom">
  45. <atom:id>Root1b</atom:id>
  46. <atom:title xml:lang="en">Views</atom:title>
  47. <atom:link rel="alternate" type="application/atom+xml" href="{$gateway}/icd/feeds/cm/system/xts.run?m=tm1/102RP2/getCubes.xts&amp;JSESSIONID={$jsessionid}&amp;sessionToken={$sessionToken}&amp;TM1WebURL={$tm1weburl}&amp;TM1WebVirtualDirectory={$tm1webvirtualdirectory}&amp;TM1Host={$tm1serverhost}&amp;TM1DataServer={$tm1servername}&amp;TM1username={$tm1username}&amp;TM1pass={$tm1pass}&amp;FilterPackages={$filterpackages}" title="">
  48. </atom:link>
  49. <atom:link rel="icon" type="image/gif" href="{$webroot}/tm1/bux/images/views.gif"/>
  50. <atom:link rel="thumbnail" type="image/gif" href="{$webroot}/tm1/bux/images/views_64.gif"/>
  51. </atom:entry>
  52. </xsl:otherwise>
  53. </xsl:choose>
  54. </xsl:template>
  55. <xsl:template match="loginServerReturn">
  56. <xsl:variable name="webroot" select="/root/WebRootURL"/>
  57. <xsl:variable name="gateway" select="/root/GatewayURL"/>
  58. <xsl:variable name="jsessionid" select="/root/JSESSIONID"/>
  59. <xsl:variable name="sessionToken" select="sessionToken"/>
  60. <xsl:variable name="tm1weburl" select="/root/TM1WebURL"/>
  61. <xsl:variable name="tm1webvirtualdirectory" select="/root/TM1WebVirtualDirectory"/>
  62. <xsl:variable name="tm1serverhost" select="/root/TM1Host"/>
  63. <xsl:variable name="tm1servername" select="/root/TM1DataServer"/>
  64. <xsl:variable name="tm1displayviews" select="/root/TM1DisplayViews"/>
  65. <xsl:variable name="tm1username" select="/root/TM1username"/>
  66. <xsl:variable name="tm1pass" select="/root/TM1pass"/>
  67. <xsl:variable name="filterpackages" select="/root/FilterPackages"/>
  68. <atom:entry xmlns:atom="http://www.w3.org/2005/Atom">
  69. <atom:id>root1</atom:id>
  70. <atom:title xml:lang="en">Applications</atom:title>
  71. <atom:link rel="alternate" type="application/atom+xml" href="{$gateway}/icd/feeds/cm/system/xts.run?m=tm1/102RP2/getApplicationNodes.xts&amp;JSESSIONID={$jsessionid}&amp;sessionToken={$sessionToken}&amp;TM1WebURL={$tm1weburl}&amp;TM1WebVirtualDirectory={$tm1webvirtualdirectory}&amp;TM1Host={$tm1serverhost}&amp;TM1DataServer={$tm1servername}&amp;TM1username={$tm1username}&amp;TM1pass={$tm1pass}&amp;FilterPackages={$filterpackages}" title="">
  72. </atom:link>
  73. <atom:link rel="icon" type="image/gif" href="{$webroot}/tm1/bux/images/apps.gif"/>
  74. <atom:link rel="thumbnail" type="image/gif" href="{$webroot}/tm1/bux/images/apps_64.gif"/>
  75. </atom:entry>
  76. <xsl:choose>
  77. <xsl:when test="$tm1displayviews = 'N'">
  78. </xsl:when>
  79. <xsl:otherwise>
  80. <atom:entry xmlns:atom="http://www.w3.org/2005/Atom">
  81. <atom:id>Root1b</atom:id>
  82. <atom:title xml:lang="en">Views</atom:title>
  83. <atom:link rel="alternate" type="application/atom+xml" href="{$gateway}/icd/feeds/cm/system/xts.run?m=tm1/102RP2/getCubes.xts&amp;JSESSIONID={$jsessionid}&amp;sessionToken={$sessionToken}&amp;TM1WebURL={$tm1weburl}&amp;TM1WebVirtualDirectory={$tm1webvirtualdirectory}&amp;TM1Host={$tm1serverhost}&amp;TM1DataServer={$tm1servername}&amp;TM1username={$tm1username}&amp;TM1pass={$tm1pass}&amp;FilterPackages={$filterpackages}" title="">
  84. </atom:link>
  85. <atom:link rel="icon" type="image/gif" href="{$webroot}/tm1/bux/images/views.gif"/>
  86. <atom:link rel="thumbnail" type="image/gif" href="{$webroot}/tm1/bux/images/views_64.gif"/>
  87. </atom:entry>
  88. </xsl:otherwise>
  89. </xsl:choose>
  90. </xsl:template>
  91. </xsl:stylesheet>