pp2atom.xsl 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: CCS
  5. (c) Copyright IBM Corp. 2005, 2010
  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:cog8="http://developer.cognos.com/schemas/report/5.0/" xmlns:ccs="com.cognos.ccs.xslt.XSLTFunctions" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:cm="http://developer.cognos.com/schemas/bibus/3/">
  9. <xsl:output method="xml" omit-xml-declaration="yes" encoding="UTF-8" version="1.0"/>
  10. <xsl:template match="/">
  11. <atom:feed>
  12. <atom:id>
  13. <xsl:value-of select="concat('tag:cognos.com,2007:','@report_id@')"/>
  14. </atom:id>
  15. <atom:title>@report_title@</atom:title>
  16. <atom:updated>@report_updated@</atom:updated>
  17. <atom:author>
  18. <atom:name>Cognos</atom:name>
  19. </atom:author>
  20. <atom:link rel="self" type="application/atom+xml" href="@report_gateway@/rds/atom/path/@report_id@?v=@requestversion@"/>
  21. <atom:link rel="alternate" type="text/xml" href="@report_gateway@/rds/@output@/path/@report_id@?v=@requestversion@"/>
  22. <xsl:if test="data/tab/crosstab">
  23. <xsl:call-template name="atomEntry">
  24. <xsl:with-param name="entryID">dimLine</xsl:with-param>
  25. <xsl:with-param name="entryType">textframe</xsl:with-param>
  26. </xsl:call-template>
  27. <xsl:call-template name="atomEntry">
  28. <xsl:with-param name="entryID">2</xsl:with-param>
  29. <xsl:with-param name="entryType">crosstab</xsl:with-param>
  30. </xsl:call-template>
  31. </xsl:if>
  32. <xsl:if test="data/tab/status_line/@status">
  33. <xsl:call-template name="atomEntry">
  34. <xsl:with-param name="entryID">3</xsl:with-param>
  35. <xsl:with-param name="entryType">textframe</xsl:with-param>
  36. </xsl:call-template>
  37. </xsl:if>
  38. </atom:feed>
  39. </xsl:template>
  40. <xsl:template match="*">
  41. <!--Unknown element. Ignore-->
  42. </xsl:template>
  43. <xsl:template name="atomEntry">
  44. <xsl:param name="entryID"/>
  45. <xsl:param name="entryIcon"/>
  46. <xsl:param name="entryType"/>
  47. <atom:entry>
  48. <atom:id>
  49. <xsl:choose>
  50. <xsl:when test="function-available('ccs:encodeID')">
  51. <xsl:value-of select="concat('tag:cognos.com,2007:@report_id@/',ccs:encodeID($entryID))"/>
  52. </xsl:when>
  53. <xsl:otherwise>
  54. <xsl:value-of select="concat('tag:cognos.com,2007:@report_id@/',$entryID)"/>
  55. </xsl:otherwise>
  56. </xsl:choose>
  57. </atom:id>
  58. <atom:title>
  59. <xsl:value-of select="$entryID"/>
  60. </atom:title>
  61. <atom:updated>@report_updated@</atom:updated>
  62. <atom:link>
  63. <xsl:attribute name="rel">icon</xsl:attribute>
  64. <xsl:attribute name="type">image/gif</xsl:attribute>
  65. <xsl:attribute name="href"><xsl:value-of select="concat('@webcontent_root@/ccs/images/', $entryType,'_icon.gif')"/></xsl:attribute>
  66. </atom:link>
  67. <atom:link>
  68. <xsl:attribute name="rel">alternate</xsl:attribute>
  69. <xsl:attribute name="type">application/x-ldx+xml</xsl:attribute>
  70. <xsl:attribute name="href"><xsl:choose><xsl:when test="function-available('ccs:encodeID')"><xsl:value-of select="concat('@report_gateway@/rds/@output@/path/@report_id@?selection=',ccs:encodeID($entryID),'&amp;v=@requestversion@')"/></xsl:when><xsl:otherwise><xsl:value-of select="concat('@report_gateway@/rds/@output@/path/@report_id@?selection=',$entryID,'&amp;v=@requestversion@')"/></xsl:otherwise></xsl:choose></xsl:attribute>
  71. </atom:link>
  72. <cm:objectClass>reportpart</cm:objectClass>
  73. </atom:entry>
  74. </xsl:template>
  75. </xsl:stylesheet>