catalogFeed.xslt 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: cpscrn
  5. (C) Copyright IBM Corp. 2005, 2016
  6. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. -->
  8. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  9. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  10. xmlns:atom="http://www.w3.org/2005/Atom"
  11. exclude-result-prefixes="xtsext">
  12. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  13. <xsl:variable name="script-name" select="/root/http/param[@name = 'SCRIPT_NAME']"/>
  14. <xsl:variable name="webcontent" select="/root/http/param[@name = 'WEB_CONTENT_ROOT']"/>
  15. <xsl:variable name="iwidget-uri" select="concat($script-name, '/iwidget/bridge')"/>
  16. <!-- -=-=-=-=-=-=-=- -->
  17. <xsl:template match="/">
  18. <xsl:apply-templates select="/root/catalog"/>
  19. </xsl:template>
  20. <xsl:template match="catalog">
  21. <atom:feed xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/">
  22. <atom:id>tag:com:ibm:cognos:catalog:iwidget</atom:id>
  23. <atom:title type="text">IBM Cognos iWidget Catalog</atom:title>
  24. <atom:updated>2009-03-24T22:01:37Z</atom:updated>
  25. <atom:author>
  26. <atom:name>Sample User1</atom:name>
  27. <atom:email>email1@companyname.com</atom:email>
  28. </atom:author>
  29. <atom:contributor>
  30. <atom:name>Sample User2</atom:name>
  31. <atom:email>email2@companyname.com</atom:email>
  32. </atom:contributor>
  33. <atom:contributor>
  34. <atom:name>Sample User3</atom:name>
  35. <atom:email>email3@companyname.com</atom:email>
  36. </atom:contributor>
  37. <atom:contributor>
  38. <atom:name>Sample User4</atom:name>
  39. <atom:email>email4@companyname.com</atom:email>
  40. </atom:contributor>
  41. <xsl:apply-templates select="entry"/>
  42. </atom:feed>
  43. </xsl:template>
  44. <xsl:template match="entry">
  45. <atom:entry xmlns="http://www.w3.org/2005/Atom">
  46. <xsl:call-template name="atom-properties">
  47. <xsl:with-param name="is-entry" select="true()"/>
  48. </xsl:call-template>
  49. <xsl:call-template name="links"/>
  50. </atom:entry>
  51. </xsl:template>
  52. <xsl:template name="atom-properties">
  53. <xsl:param name="is-entry"/>
  54. <atom:id>
  55. <xsl:value-of select="concat('tag:ibm:cognos:catalog:iwidget:', position())"/>
  56. </atom:id>
  57. <atom:title type="text">
  58. <xsl:value-of select="title"/>
  59. </atom:title>
  60. <atom:updated>2009-03-24T22:01:37Z</atom:updated>
  61. <xsl:if test="$is-entry">
  62. <atom:published>2009-03-24T22:01:37Z</atom:published>
  63. <xsl:if test="description != ''">
  64. <atom:summary>
  65. <xsl:value-of select="description"/>
  66. </atom:summary>
  67. </xsl:if>
  68. </xsl:if>
  69. </xsl:template>
  70. <xsl:template name="links">
  71. <xsl:param name="item" select="."/>
  72. <xsl:param name="rel" select="'alternate'"/>
  73. <!--
  74. <atom:link rel="fragment" type="application/x-fragment+xml" href="{ $dashboard-uri }{ $item/path }"/>
  75. <atom:link rel="{ $rel }" type="application/xml" href="{ $iwidget-uri }{ $item/path }"/>
  76. -->
  77. <atom:link rel="{ $rel }" type="application/x-iwidget+xml" href="{ $iwidget-uri }{ $item/path }"/>
  78. <atom:link rel="iwidget" type="application/x-iwidget+xml" href="{ $iwidget-uri }{ $item/path }"/>
  79. <xsl:if test="$item/icon">
  80. <atom:link rel="icon" type="{ $item/icon/@type }" href="{ $webcontent }{ $item/icon }"/>
  81. </xsl:if>
  82. <xsl:if test="$item/thumbnail">
  83. <atom:link rel="thumbnail" type="{ $item/thumbnail/@type }" href="{ $webcontent }{ $item/thumbnail }"/>
  84. </xsl:if>
  85. </xsl:template>
  86. </xsl:stylesheet>