getCubesTransform.xslt 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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="listCubesResponse/listCubesReturn/*"/>
  16. </atom:feed>
  17. </xsl:template>
  18. <xsl:template match="listCubesReturn">
  19. <atom:entry xmlns:atom="http://www.w3.org/2005/Atom">
  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="/root/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="tm1username" select="/root/TM1username"/>
  29. <xsl:variable name="tm1pass" select="/root/TM1pass"/>
  30. <xsl:variable name="filterpackages" select="/root/FilterPackages"/>
  31. <atom:id><xsl:value-of select="id"/></atom:id>
  32. <atom:title xml:lang="en"><xsl:value-of select="name"/></atom:title>
  33. <atom:summary xml:lang="en"><xsl:value-of select="name"/></atom:summary>
  34. <atom:updated>2009-11-04T13:22:49Z </atom:updated>
  35. <atom:author>
  36. <name>Marianne</name>
  37. <email>badams@example.com</email>
  38. </atom:author>
  39. <atom:link rel="icon" type="image/gif" href="{$webroot}/tm1/bux/images/cube.gif"/>
  40. <atom:link rel="thumbnail" type="image/gif" href="{$webroot}/tm1/bux/images/cube_64.gif"/>
  41. <atom:link rel="alternate" type="application/atom+xml" href="{$gateway}/icd/feeds/cm/system/xts.run?m=/tm1/102RP2/getCubeViews.xts&amp;cubeId={id}&amp;cubeName={xtsext:urlencode(name)}&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}">
  42. </atom:link>
  43. </atom:entry>
  44. </xsl:template>
  45. </xsl:stylesheet>