getServerTransform.xslt 5.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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/*"/>
  16. <xsl:apply-templates select="loginServerResponse/*"/>
  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="tm1weburl" select="/root/TM1WebURL"/>
  24. <xsl:variable name="tm1webvirtualdirectory" select="/root/TM1WebVirtualDirectory"/>
  25. <xsl:variable name="tm1serverhost" select="/root/TM1Host"/>
  26. <xsl:variable name="tm1servername" select="/root/TM1DataServer"/>
  27. <xsl:variable name="tm1displayviews" select="/root/TM1DisplayViews"/>
  28. <xsl:variable name="tm1username" select="/root/TM1username"/>
  29. <xsl:variable name="tm1pass" select="/root/TM1pass"/>
  30. <xsl:variable name="filterpackages" select="/root/FilterPackages"/>
  31. <atom:entry xmlns:atom="http://www.w3.org/2005/Atom">
  32. <atom:id>root1</atom:id>
  33. <atom:title xml:lang="en">Applications</atom:title>
  34. <atom:link rel="alternate" type="application/atom+xml" href="{$gateway}/icd/feeds/cm/system/xts.run?m=tm1/102FP1/getApplicationNodes.xts&amp;JSESSIONID={$jsessionid}&amp;TM1WebURL={$tm1weburl}&amp;TM1WebVirtualDirectory={$tm1webvirtualdirectory}&amp;TM1Host={$tm1serverhost}&amp;TM1DataServer={$tm1servername}&amp;TM1username={$tm1username}&amp;TM1pass={$tm1pass}&amp;FilterPackages={$filterpackages}" title="">
  35. </atom:link>
  36. <atom:link rel="icon" type="image/gif" href="{$webroot}/tm1/bux/images/apps.gif"/>
  37. <atom:link rel="thumbnail" type="image/gif" href="{$webroot}/tm1/bux/images/apps_64.gif"/>
  38. </atom:entry>
  39. <xsl:choose>
  40. <xsl:when test="$tm1displayviews = 'N'">
  41. </xsl:when>
  42. <xsl:otherwise>
  43. <atom:entry xmlns:atom="http://www.w3.org/2005/Atom">
  44. <atom:id>Root1b</atom:id>
  45. <atom:title xml:lang="en">Views</atom:title>
  46. <atom:link rel="alternate" type="application/atom+xml" href="{$gateway}/icd/feeds/cm/system/xts.run?m=tm1/102FP1/getCubes.xts&amp;JSESSIONID={$jsessionid}&amp;TM1WebURL={$tm1weburl}&amp;TM1WebVirtualDirectory={$tm1webvirtualdirectory}&amp;TM1Host={$tm1serverhost}&amp;TM1DataServer={$tm1servername}&amp;TM1username={$tm1username}&amp;TM1pass={$tm1pass}&amp;FilterPackages={$filterpackages}" title="">
  47. </atom:link>
  48. <atom:link rel="icon" type="image/gif" href="{$webroot}/tm1/bux/images/views.gif"/>
  49. <atom:link rel="thumbnail" type="image/gif" href="{$webroot}/tm1/bux/images/views_64.gif"/>
  50. </atom:entry>
  51. </xsl:otherwise>
  52. </xsl:choose>
  53. </xsl:template>
  54. <xsl:template match="loginServerReturn">
  55. <xsl:variable name="webroot" select="/root/WebRootURL"/>
  56. <xsl:variable name="gateway" select="/root/GatewayURL"/>
  57. <xsl:variable name="jsessionid" select="/root/JSESSIONID"/>
  58. <xsl:variable name="tm1weburl" select="/root/TM1WebURL"/>
  59. <xsl:variable name="tm1webvirtualdirectory" select="/root/TM1WebVirtualDirectory"/>
  60. <xsl:variable name="tm1serverhost" select="/root/TM1Host"/>
  61. <xsl:variable name="tm1servername" select="/root/TM1DataServer"/>
  62. <xsl:variable name="tm1displayviews" select="/root/TM1DisplayViews"/>
  63. <xsl:variable name="tm1username" select="/root/TM1username"/>
  64. <xsl:variable name="tm1pass" select="/root/TM1pass"/>
  65. <xsl:variable name="filterpackages" select="/root/FilterPackages"/>
  66. <atom:entry xmlns:atom="http://www.w3.org/2005/Atom">
  67. <atom:id>root1</atom:id>
  68. <atom:title xml:lang="en">Applications</atom:title>
  69. <atom:link rel="alternate" type="application/atom+xml" href="{$gateway}/icd/feeds/cm/system/xts.run?m=tm1/102FP1/getApplicationNodes.xts&amp;JSESSIONID={$jsessionid}&amp;TM1WebURL={$tm1weburl}&amp;TM1WebVirtualDirectory={$tm1webvirtualdirectory}&amp;TM1Host={$tm1serverhost}&amp;TM1DataServer={$tm1servername}&amp;TM1username={$tm1username}&amp;TM1pass={$tm1pass}&amp;FilterPackages={$filterpackages}" title="">
  70. </atom:link>
  71. <atom:link rel="icon" type="image/gif" href="{$webroot}/tm1/bux/images/apps.gif"/>
  72. <atom:link rel="thumbnail" type="image/gif" href="{$webroot}/tm1/bux/images/apps_64.gif"/>
  73. </atom:entry>
  74. <xsl:choose>
  75. <xsl:when test="$tm1displayviews = 'N'">
  76. </xsl:when>
  77. <xsl:otherwise>
  78. <atom:entry xmlns:atom="http://www.w3.org/2005/Atom">
  79. <atom:id>Root1b</atom:id>
  80. <atom:title xml:lang="en">Views</atom:title>
  81. <atom:link rel="alternate" type="application/atom+xml" href="{$gateway}/icd/feeds/cm/system/xts.run?m=tm1/102FP1/getCubes.xts&amp;JSESSIONID={$jsessionid}&amp;TM1WebURL={$tm1weburl}&amp;TM1WebVirtualDirectory={$tm1webvirtualdirectory}&amp;TM1Host={$tm1serverhost}&amp;TM1DataServer={$tm1servername}&amp;TM1username={$tm1username}&amp;TM1pass={$tm1pass}&amp;FilterPackages={$filterpackages}" title="">
  82. </atom:link>
  83. <atom:link rel="icon" type="image/gif" href="{$webroot}/tm1/bux/images/views.gif"/>
  84. <atom:link rel="thumbnail" type="image/gif" href="{$webroot}/tm1/bux/images/views_64.gif"/>
  85. </atom:entry>
  86. </xsl:otherwise>
  87. </xsl:choose>
  88. </xsl:template>
  89. </xsl:stylesheet>