getApplicationNodesTransform.xslt 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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:choose>
  16. <xsl:when test="/root/Id != ''">
  17. <xsl:variable name="id" select="/root/Id"/>
  18. <xsl:apply-templates select="//*[@Id=$id]/Folder|//*[@Id=$id]/Cube|//*[@Id=$id]/Cubeviewer|//*[@Id=$id]/Websheet"/>
  19. </xsl:when>
  20. <xsl:otherwise>
  21. <xsl:apply-templates select="soapenv:Body/getApplicationsTreeResponse/getApplicationsTreeReturn/children/children"/>
  22. </xsl:otherwise>
  23. </xsl:choose>
  24. </atom:feed>
  25. </xsl:template>
  26. <xsl:template match="children">
  27. <atom:entry xmlns:atom="http://www.w3.org/2005/Atom">
  28. <xsl:variable name="webroot" select="/root/WebRootURL"/>
  29. <xsl:variable name="gateway" select="/root/GatewayURL"/>
  30. <xsl:variable name="jsessionid" select="/root/JSESSIONID"/>
  31. <xsl:variable name="sessionToken" select="/root/sessionToken"/>
  32. <xsl:variable name="treeId" select="/root/soapenv:Body/getApplicationsTreeResponse/getApplicationsTreeReturn/id"/>
  33. <xsl:variable name="tm1weburl" select="/root/TM1WebURL"/>
  34. <xsl:variable name="tm1webvirtualdirectory" select="/root/TM1WebVirtualDirectory"/>
  35. <xsl:variable name="tm1serverhost" select="/root/TM1Host"/>
  36. <xsl:variable name="tm1servername" select="/root/TM1DataServer"/>
  37. <xsl:variable name="tm1username" select="/root/TM1username"/>
  38. <xsl:variable name="tm1pass" select="/root/TM1pass"/>
  39. <xsl:variable name="filterpackages" select="/root/FilterPackages"/>
  40. <xsl:variable name="foldername" select="/root/TM1FolderName"/>
  41. <atom:id><xsl:value-of select="id"/></atom:id>
  42. <atom:title xml:lang="en"><xsl:value-of select="name"/></atom:title>
  43. <atom:summary xml:lang="en">
  44. <xsl:value-of select="description"/>
  45. <xsl:value-of select="$treeId"/>
  46. </atom:summary>
  47. <atom:updated>2009-11-04T13:22:49Z </atom:updated>
  48. <atom:author>
  49. <name>Marianne</name>
  50. <email>badams@example.com</email>
  51. </atom:author>
  52. <xsl:choose>
  53. <xsl:when test="string(isPrivate) != 'OBJ_FOLDER'">
  54. <atom:link rel="icon" type="image/gif" href="{$webroot}/icd/feeds/images/icon_ldx_folder.gif"/>
  55. <atom:link rel="thumbnail" type="image/gif" href="{$webroot}/icd/feeds/images/icon_ldx_folder_64.gif"/>
  56. </xsl:when>
  57. <xsl:otherwise>
  58. <atom:link rel="icon" type="image/gif" href="{$webroot}/tm1/bux/images/excel.gif"/>
  59. <atom:link rel="thumbnail" type="image/gif" href="{$webroot}/tm1/bux/images/excel_64.gif"/>
  60. </xsl:otherwise>
  61. </xsl:choose>
  62. <atom:link rel="alternate" type="application/atom+xml" href="{$gateway}/icd/feeds/cm/system/xts.run?m=/tm1/102RP2/getApplicationsNodeChildren.xts&amp;TM1WebURL={$tm1weburl}&amp;TM1WebVirtualDirectory={$tm1webvirtualdirectory}&amp;TM1Host={$tm1serverhost}&amp;TM1DataServer={$tm1servername}&amp;nodeId={id}&amp;folderName={$foldername}/{name}&amp;treeId={$treeId}&amp;JSESSIONID={$jsessionid}&amp;sessionToken={$sessionToken}&amp;TM1username={$tm1username}&amp;TM1pass={$tm1pass}&amp;FilterPackages={$filterpackages}">
  63. </atom:link>
  64. </atom:entry>
  65. </xsl:template>
  66. </xsl:stylesheet>