getCubeViewsTransform.xslt 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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="soapenv:Body/listCubeViewsResponse/listCubeViewsReturn/children/children"/>
  16. </atom:feed>
  17. </xsl:template>
  18. <xsl:template match="children">
  19. <atom:entry xmlns:atom="http://www.w3.org/2005/Atom">
  20. <xsl:variable name="webroot" select="/root/WebRootURL"/>
  21. <xsl:variable name="cubeName" select="xtsext:urlencode(xtsext:urlencode(/root/cubeName))"/>
  22. <xsl:variable name="gateway" select="/root/GatewayURL"/>
  23. <xsl:variable name="jsessionid" select="/root/JSESSIONID"/>
  24. <xsl:variable name="sessionToken" select="/root/sessionToken"/>
  25. <xsl:variable name="treeId" select="/root/TREEID"/>
  26. <xsl:variable name="tm1weburl" select="/root/TM1WebURL"/>
  27. <xsl:variable name="tm1webvirtualdirectory" select="/root/TM1WebVirtualDirectory"/>
  28. <xsl:variable name="tm1serverhost" select="/root/TM1Host"/>
  29. <xsl:variable name="tm1servername" select="/root/TM1DataServer"/>
  30. <xsl:variable name="tm1username" select="/root/TM1username"/>
  31. <xsl:variable name="tm1pass" select="/root/TM1pass"/>
  32. <xsl:variable name="filterpackages" select="/root/FilterPackages"/>
  33. <xsl:variable name="tm1cubeview" select="xtsext:urlencode(xtsext:urlencode(name))"/>
  34. <atom:id><xsl:value-of select="id"/></atom:id>
  35. <atom:title xml:lang="en"><xsl:value-of select="name"/></atom:title>
  36. <atom:summary xml:lang="en"><xsl:value-of select="description"/></atom:summary>
  37. <atom:updated>2009-11-04T13:22:49Z </atom:updated>
  38. <atom:author>
  39. <name>Marianne</name>
  40. <email>badams@example.com</email>
  41. </atom:author>
  42. <xsl:choose>
  43. <xsl:when test="string(type) = 'OBJ_VIEW'">
  44. <atom:link rel="icon" type="image/gif" href="{$webroot}/tm1/bux/images/views.gif"/>
  45. <atom:link rel="thumbnail" type="image/gif" href="{$webroot}/tm1/bux/images/views_64.gif"/>
  46. <atom:link rel="alternate" type="application/x-iwidget+xml" href="{$webroot}/tm1/bux/iWidgets/102RP2/TM1WebCubeViewerWidget.xml?iwparam=tm1Host%3d{$tm1serverhost}%26tm1Server%3d{$tm1servername}%26tm1UserName%3d{$tm1username}%26tm1Password%3d{$tm1pass}%26tm1WebURL%3d{$tm1weburl}%2F{$tm1webvirtualdirectory}%26tm1CubeView%3d{$tm1cubeview}%26tm1Cube%3d{$cubeName}%26FilterPackages%3d{$filterpackages}%26AccessType%3dPUBLIC"/>
  47. </xsl:when>
  48. <xsl:otherwise>
  49. <atom:link rel="icon" type="image/gif" href="{$webroot}/tm1/bux/images/view-private.gif"/>
  50. <atom:link rel="thumbnail" type="image/gif" href="{$webroot}/tm1/bux/images/view-private_64.gif"/>
  51. <atom:link rel="alternate" type="application/x-iwidget+xml" href="{$webroot}/tm1/bux/iWidgets/102RP2/TM1WebCubeViewerWidget.xml?iwparam=tm1Host%3d{$tm1serverhost}%26tm1Server%3d{$tm1servername}%26tm1UserName%3d{$tm1username}%26tm1Password%3d{$tm1pass}%26tm1WebURL%3d{$tm1weburl}%2F{$tm1webvirtualdirectory}%26tm1CubeView%3d{$tm1cubeview}%26tm1Cube%3d{$cubeName}%26FilterPackages%3d{$filterpackages}%26AccessType%3dPRIVATE"/>
  52. </xsl:otherwise>
  53. </xsl:choose>
  54. </atom:entry>
  55. </xsl:template>
  56. </xsl:stylesheet>