serverContentTransform.xslt 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  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:xtsext="xalan://com.cognos.xts.ext.XTSExt">
  6. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
  7. <xsl:template match="/root">
  8. <atom:feed xmlns:atom="http://www.w3.org/2005/Atom">
  9. <atom:id>TM1 root ID</atom:id>
  10. <atom:title xml:lang="en">TM1 Root Feed</atom:title>
  11. <xsl:variable name="gateway" select="/root/GatewayURL"/>
  12. <xsl:choose>
  13. <xsl:when test="/root/Id != ''">
  14. <xsl:variable name="id" select="/root/Id"/>
  15. <xsl:apply-templates select="//*[@Id=$id]/Folder|//*[@Id=$id]/Cube|//*[@Id=$id]/Cubeviewer|//*[@Id=$id]/Websheet"/>
  16. </xsl:when>
  17. <xsl:otherwise>
  18. <xsl:apply-templates select="NavigationTree/*"/>
  19. </xsl:otherwise>
  20. </xsl:choose>
  21. </atom:feed>
  22. </xsl:template>
  23. <xsl:template match="Folder">
  24. <atom:entry xmlns:atom="http://www.w3.org/2005/Atom">
  25. <xsl:variable name="tm1weburl" select="/root/TM1WebURL"/>
  26. <xsl:variable name="tm1webvirtualdirectory" select="/root/TM1WebVirtualDirectory"/>
  27. <xsl:variable name="tm1serverhost" select="/root/TM1Host"/>
  28. <xsl:variable name="tm1servername" select="/root/TM1DataServer"/>
  29. <xsl:variable name="tm1username" select="/root/TM1username"/>
  30. <xsl:variable name="tm1pass" select="/root/TM1pass"/>
  31. <xsl:variable name="webroot" select="/root/WebRootURL"/>
  32. <xsl:variable name="gateway" select="/root/GatewayURL"/>
  33. <xsl:variable name="tm1toolbar" select="/root/TM1Toolbar"/>
  34. <xsl:variable name="aspsessionid" select="/root/ASPSessionId"/>
  35. <atom:id><xsl:value-of select="@Id"/></atom:id>
  36. <atom:title xml:lang="en"><xsl:value-of select="Name"/></atom:title>
  37. <atom:link rel="alternate" type="application/atom+xml" href="{$gateway}/icd/feeds/cm/system/xts.run?m=/tm1/PRE102/serverContent.xts&amp;Id={@Id}&amp;TM1WebURL={$tm1weburl}&amp;TM1WebVirtualDirectory={$tm1webvirtualdirectory}&amp;TM1Host={$tm1serverhost}&amp;TM1DataServer={$tm1servername}&amp;TM1username={$tm1username}&amp;TM1pass={$tm1pass}&amp;TM1Toolbar={$tm1toolbar}&amp;ASPSessionId={$aspsessionid}">
  38. </atom:link>
  39. <atom:link rel="icon" type="image/gif" href="{$webroot}/icd/feeds/images/icon_ldx_folder.gif"/>
  40. <atom:link rel="thumbnail" type="image/gif" href="{$webroot}/icd/feeds/images/icon_ldx_folder_64.gif"/>
  41. </atom:entry>
  42. </xsl:template>
  43. <xsl:template match="Cube">
  44. <atom:entry xmlns:atom="http://www.w3.org/2005/Atom">
  45. <xsl:variable name="tm1weburl" select="/root/TM1WebURL"/>
  46. <xsl:variable name="tm1webvirtualdirectory" select="/root/TM1WebVirtualDirectory"/>
  47. <xsl:variable name="tm1serverhost" select="/root/TM1Host"/>
  48. <xsl:variable name="tm1servername" select="/root/TM1DataServer"/>
  49. <xsl:variable name="tm1username" select="/root/TM1username"/>
  50. <xsl:variable name="tm1pass" select="/root/TM1pass"/>
  51. <xsl:variable name="webroot" select="/root/WebRootURL"/>
  52. <xsl:variable name="gateway" select="/root/GatewayURL"/>
  53. <xsl:variable name="tm1toolbar" select="/root/TM1Toolbar"/>
  54. <xsl:variable name="aspsessionid" select="/root/ASPSessionId"/>
  55. <atom:id>
  56. <xsl:value-of select="@Id"/>
  57. </atom:id>
  58. <atom:title xml:lang="en">
  59. <xsl:value-of select="Name"/>
  60. </atom:title>
  61. <atom:link rel="alternate" type="application/atom+xml" href="{$gateway}/icd/feeds/cm/system/xts.run?m=/tm1/PRE102/serverContent.xts&amp;Id={@Id}&amp;TM1WebURL={$tm1weburl}&amp;TM1WebVirtualDirectory={$tm1webvirtualdirectory}&amp;TM1Host={$tm1serverhost}&amp;TM1DataServer={$tm1servername}&amp;TM1username={$tm1username}&amp;TM1pass={$tm1pass}&amp;TM1Toolbar={$tm1toolbar}&amp;ASPSessionId={$aspsessionid}">
  62. </atom:link>
  63. <atom:link rel="icon" type="image/gif" href="{$webroot}/tm1/bux/images/cube.gif"/>
  64. <atom:link rel="thumbnail" type="image/gif" href="{$webroot}/tm1/bux/images/cube_64.gif"/>
  65. </atom:entry>
  66. </xsl:template>
  67. <xsl:template match="Cubeviewer">
  68. <atom:entry xmlns:atom="http://www.w3.org/2005/Atom">
  69. <xsl:variable name="tm1weburl" select="/root/TM1WebURL"/>
  70. <xsl:variable name="tm1webvirtualdirectory" select="/root/TM1WebVirtualDirectory"/>
  71. <xsl:variable name="tm1serverhost" select="/root/TM1Host"/>
  72. <xsl:variable name="tm1servername" select="/root/TM1DataServer"/>
  73. <xsl:variable name="tm1username" select="/root/TM1username"/>
  74. <xsl:variable name="tm1pass" select="/root/TM1pass"/>
  75. <xsl:variable name="webroot" select="/root/WebRootURL"/>
  76. <xsl:variable name="tm1toolbar" select="/root/TM1Toolbar"/>
  77. <xsl:variable name="aspsessionid" select="/root/ASPSessionId"/>
  78. <atom:id>
  79. <xsl:value-of select="@Id"/>
  80. </atom:id>
  81. <atom:title xml:lang="en">
  82. <xsl:value-of select="Description"/>
  83. </atom:title>
  84. <atom:summary xml:lang="en">
  85. <xsl:value-of select="Description"/>
  86. </atom:summary>
  87. <atom:link rel="alternate" type="application/x-iwidget+xml" href="{$webroot}/tm1/bux/iWidgets/PRE102/tm1ContentCubeViewerWidget.xml?iwparam=tm1Host%3d{$tm1serverhost}%26tm1Server%3d{$tm1servername}%26tm1UserName%3d{$tm1username}%26tm1Password%3d{$tm1pass}%26tm1WebURL%3d{$tm1weburl}%2F{$tm1webvirtualdirectory}%26tm1ServerCubeView%3d{Name}%26TM1Toolbar%3d{$tm1toolbar}%26ASPSessionId%3d{$aspsessionid}"/>
  88. <xsl:choose>
  89. <xsl:when test="string(Private) != 'false'">
  90. <atom:link rel="icon" type="image/gif" href="{$webroot}/tm1/bux/images/view-private.gif"/>
  91. <atom:link rel="thumbnail" type="image/gif" href="{$webroot}/tm1/bux/images/view-private_64.gif"/>
  92. </xsl:when>
  93. <xsl:otherwise>
  94. <atom:link rel="icon" type="image/gif" href="{$webroot}/tm1/bux/images/views.gif"/>
  95. <atom:link rel="thumbnail" type="image/gif" href="{$webroot}/tm1/bux/images/views_64.gif"/>
  96. </xsl:otherwise>
  97. </xsl:choose>
  98. </atom:entry>
  99. </xsl:template>
  100. <xsl:template match="Websheet">
  101. <atom:entry xmlns:atom="http://www.w3.org/2005/Atom">
  102. <xsl:variable name="tm1weburl" select="/root/TM1WebURL"/>
  103. <xsl:variable name="tm1webvirtualdirectory" select="/root/TM1WebVirtualDirectory"/>
  104. <xsl:variable name="tm1serverhost" select="/root/TM1Host"/>
  105. <xsl:variable name="tm1servername" select="/root/TM1DataServer"/>
  106. <xsl:variable name="tm1username" select="/root/TM1username"/>
  107. <xsl:variable name="tm1pass" select="/root/TM1pass"/>
  108. <xsl:variable name="webroot" select="/root/WebRootURL"/>
  109. <xsl:variable name="tm1toolbar" select="/root/TM1Toolbar"/>
  110. <xsl:variable name="aspsessionid" select="/root/ASPSessionId"/>
  111. <atom:id>
  112. <xsl:value-of select="@Id"/>
  113. </atom:id>
  114. <atom:title xml:lang="en">
  115. <xsl:value-of select="Name"/>
  116. </atom:title>
  117. <atom:summary xml:lang="en">
  118. <xsl:value-of select="Description"/>
  119. </atom:summary>
  120. <atom:link rel="alternate" type="application/x-iwidget+xml" href="{$webroot}/tm1/bux/iWidgets/PRE102/tm1ContentWebSheetViewerWidget.xml?iwparam=tm1Host%3d{$tm1serverhost}%26tm1Server%3d{$tm1servername}%26tm1UserName%3d{$tm1username}%26tm1Password%3d{$tm1pass}%26tm1WebURL%3d{$tm1weburl}%2F{$tm1webvirtualdirectory}%26tm1CubeView%3d{xtsext:urlencode(Source)}%26TM1Toolbar%3d{$tm1toolbar}%26ASPSessionId%3d{$aspsessionid}"/>
  121. <xsl:choose>
  122. <xsl:when test="string(Private) != 'false'">
  123. <atom:link rel="icon" type="image/gif" href="{$webroot}/tm1/bux/images/excel-private.gif"/>
  124. <atom:link rel="thumbnail" type="image/gif" href="{$webroot}/tm1/bux/images/excel-private_64.gif"/>
  125. </xsl:when>
  126. <xsl:otherwise>
  127. <atom:link rel="icon" type="image/gif" href="{$webroot}/tm1/bux/images/excel.gif"/>
  128. <atom:link rel="thumbnail" type="image/gif" href="{$webroot}/tm1/bux/images/excel_64.gif"/>
  129. </xsl:otherwise>
  130. </xsl:choose>
  131. </atom:entry>
  132. </xsl:template>
  133. <xsl:template match="Application">
  134. <atom:entry xmlns:atom="http://www.w3.org/2005/Atom">
  135. <xsl:variable name="tm1weburl" select="/root/TM1WebURL"/>
  136. <xsl:variable name="tm1webvirtualdirectory" select="/root/TM1WebVirtualDirectory"/>
  137. <xsl:variable name="tm1serverhost" select="/root/TM1Host"/>
  138. <xsl:variable name="tm1servername" select="/root/TM1DataServer"/>
  139. <xsl:variable name="tm1username" select="/root/TM1username"/>
  140. <xsl:variable name="tm1pass" select="/root/TM1pass"/>
  141. <xsl:variable name="webroot" select="/root/WebRootURL"/>
  142. <xsl:variable name="gateway" select="/root/GatewayURL"/>
  143. <xsl:variable name="tm1toolbar" select="/root/TM1Toolbar"/>
  144. <xsl:variable name="aspsessionid" select="/root/ASPSessionId"/>
  145. <atom:id>
  146. <xsl:value-of select="@Id"/>
  147. </atom:id>
  148. <atom:title xml:lang="en">
  149. <xsl:value-of select="Name"/>
  150. </atom:title>
  151. <atom:link rel="alternate" type="application/atom+xml" href="{$gateway}/icd/feeds/cm/system/xts.run?m=/tm1/PRE102/serverContent.xts&amp;Id={@Id}&amp;TM1WebURL={$tm1weburl}&amp;TM1WebVirtualDirectory={$tm1webvirtualdirectory}&amp;TM1Host={$tm1serverhost}&amp;TM1DataServer={$tm1servername}&amp;TM1username={$tm1username}&amp;TM1pass={$tm1pass}&amp;TM1Toolbar={$tm1toolbar}&amp;ASPSessionId={$aspsessionid}">
  152. </atom:link>
  153. <atom:link rel="icon" type="image/gif" href="{$webroot}/tm1/bux/images/apps.gif"/>
  154. <atom:link rel="thumbnail" type="image/gif" href="{$webroot}/tm1/bux/images/apps_64.gif"/>
  155. </atom:entry>
  156. </xsl:template>
  157. <xsl:template match="Server">
  158. <atom:entry xmlns:atom="http://www.w3.org/2005/Atom">
  159. <xsl:variable name="tm1weburl" select="/root/TM1WebURL"/>
  160. <xsl:variable name="tm1webvirtualdirectory" select="/root/TM1WebVirtualDirectory"/>
  161. <xsl:variable name="tm1serverhost" select="/root/TM1Host"/>
  162. <xsl:variable name="tm1servername" select="/root/TM1DataServer"/>
  163. <xsl:variable name="tm1username" select="/root/TM1username"/>
  164. <xsl:variable name="tm1pass" select="/root/TM1pass"/>
  165. <xsl:variable name="webroot" select="/root/WebRootURL"/>
  166. <xsl:variable name="gateway" select="/root/GatewayURL"/>
  167. <xsl:variable name="tm1toolbar" select="/root/TM1Toolbar"/>
  168. <xsl:variable name="aspsessionid" select="/root/ASPSessionId"/>
  169. <atom:id>
  170. <xsl:value-of select="@Id"/>
  171. </atom:id>
  172. <atom:title xml:lang="en"><xts:string id="TM1_VIEWS"/></atom:title>
  173. <atom:link rel="alternate" type="application/atom+xml" href="{$gateway}/icd/feeds/cm/system/xts.run?m=/tm1/PRE102/serverContent.xts&amp;Id={@Id}&amp;TM1WebURL={$tm1weburl}&amp;TM1WebVirtualDirectory={$tm1webvirtualdirectory}&amp;TM1Host={$tm1serverhost}&amp;TM1DataServer={$tm1servername}&amp;TM1username={$tm1username}&amp;TM1pass={$tm1pass}&amp;TM1Toolbar={$tm1toolbar}&amp;ASPSessionId={$aspsessionid}">
  174. </atom:link>
  175. <atom:link rel="icon" type="image/gif" href="{$webroot}/tm1/bux/images/views.gif"/>
  176. <atom:link rel="thumbnail" type="image/gif" href="{$webroot}/tm1/bux/images/views_64.gif"/>
  177. </atom:entry>
  178. </xsl:template>
  179. <xsl:template match="Administration">
  180. </xsl:template>
  181. </xsl:stylesheet>