getApplicationNodesTransform.xslt 3.4 KB

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