spec2atom.xsl 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542
  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, 2014
  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: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/" xmlns:d="@extensionnamespace@">
  9. <xsl:output method="xml" omit-xml-declaration="yes" encoding="UTF-8" version="1.0"/>
  10. <xsl:param name="hexEncodeUnderscores" select="true()"/>
  11. <xsl:template match="/">
  12. <xsl:comment> Copyright (C) 2008 Cognos ULC, an IBM Company. All rights reserved.
  13. Cognos (R) is a trademark of Cognos ULC, (formerly Cognos Incorporated)</xsl:comment>
  14. <atom:feed>
  15. <atom:id>
  16. <xsl:value-of select="concat('tag:cognos.com,2007:','@report_id@')"/>
  17. </atom:id>
  18. <atom:title>@report_title@</atom:title>
  19. <atom:updated>@report_updated@</atom:updated>
  20. <atom:author>
  21. <atom:name>@report_author@</atom:name>@report_author_email@
  22. </atom:author>
  23. <atom:link rel="self" type="application/atom+xml" href="@report_gateway@/rds/atom/path/@report_id@?v=@requestversion@"/>
  24. <atom:link rel="alternate" type="text/xml" href="@report_gateway@/rds/reportData/path/@report_id@?v=@requestversion@"/>
  25. <atom:link rel="alternate" type="application/x-pagedldx+xml" href="@report_gateway@/rds/pagedReportData/path/@report_id@?v=@requestversion@"/>
  26. <d:owner>@report_author@</d:owner>
  27. <d:ownerEmail>@report_owner_email@</d:ownerEmail>
  28. <d:contact>@report_contact_name@</d:contact>
  29. <d:contactEmail>@report_contact_email@</d:contactEmail>
  30. <d:location>@report_location@</d:location>
  31. <d:description>@report_description_text@</d:description>
  32. <d:thumbnailURL>@report_gateway@/rds/thumbnail/report/@report_storeid@?v=@requestversion@</d:thumbnailURL>
  33. <xsl:apply-templates select="/report/layouts/layout/reportPages/*"/>
  34. </atom:feed>
  35. </xsl:template>
  36. <xsl:template priority="2" match="*[contains(style/CSS/@value, 'visibility:hidden') ]"/>
  37. <xsl:template match="pageSet">
  38. <xsl:apply-templates select="./pageOverallGroup/headerPages/*"/>
  39. <xsl:apply-templates select="./detailPages/*"/>
  40. <xsl:apply-templates select="./pageOverallGroup/footerPages/*"/>
  41. <xsl:for-each select="./pageGroups/pageGroup">
  42. <xsl:apply-templates select="headerPages/*"/>
  43. <xsl:apply-templates select="footerPages/*"/>
  44. </xsl:for-each>
  45. </xsl:template>
  46. <xsl:template match="page">
  47. <xsl:call-template name="atomPageEntry">
  48. <xsl:with-param name="entryID">
  49. <xsl:value-of select="@name"/>
  50. </xsl:with-param>
  51. <xsl:with-param name="entryType">page</xsl:with-param>
  52. <xsl:with-param name="entryIcon">folder</xsl:with-param>
  53. </xsl:call-template>
  54. <xsl:element name="subFeed">
  55. <xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute>
  56. <xsl:attribute name="type">page</xsl:attribute>
  57. <atom:feed>
  58. <atom:id>
  59. <xsl:value-of select="concat('tag:cognos.com,2007:','@report_id@/', @name)"/>
  60. </atom:id>
  61. <atom:title>
  62. <xsl:value-of select="@name"/>
  63. </atom:title>
  64. <atom:updated>@report_updated@</atom:updated>
  65. <atom:author>
  66. <atom:name>@report_author@</atom:name>
  67. @report_author_email@
  68. </atom:author>
  69. <atom:link rel="self" type="application/atom+xml">
  70. <xsl:attribute name="href"><xsl:value-of select="concat('@report_gateway@/rds/atom/path/@report_id@?selection=',@name,'&amp;eltype=page','&amp;v=@requestversion@')"/></xsl:attribute>
  71. </atom:link>
  72. <xsl:if test="pageHeader/contents/*">
  73. <xsl:call-template name="atomVirtualEntry">
  74. <xsl:with-param name="entryID">
  75. <xsl:value-of select="@name"/>
  76. </xsl:with-param>
  77. <xsl:with-param name="entryType">header</xsl:with-param>
  78. <xsl:with-param name="entryIcon">folder</xsl:with-param>
  79. <xsl:with-param name="entryName">@header_title@</xsl:with-param>
  80. </xsl:call-template>
  81. </xsl:if>
  82. <xsl:if test="pageBody/contents/*">
  83. <xsl:call-template name="atomVirtualEntry">
  84. <xsl:with-param name="entryID">
  85. <xsl:value-of select="@name"/>
  86. </xsl:with-param>
  87. <xsl:with-param name="entryType">body</xsl:with-param>
  88. <xsl:with-param name="entryIcon">folder</xsl:with-param>
  89. <xsl:with-param name="entryName">@body_title@</xsl:with-param>
  90. </xsl:call-template>
  91. </xsl:if>
  92. <xsl:if test="pageFooter/contents/*">
  93. <xsl:call-template name="atomVirtualEntry">
  94. <xsl:with-param name="entryID">
  95. <xsl:value-of select="@name"/>
  96. </xsl:with-param>
  97. <xsl:with-param name="entryType">footer</xsl:with-param>
  98. <xsl:with-param name="entryIcon">folder</xsl:with-param>
  99. <xsl:with-param name="entryName">@footer_title@</xsl:with-param>
  100. </xsl:call-template>
  101. </xsl:if>
  102. </atom:feed>
  103. </xsl:element>
  104. <xsl:if test="pageHeader/contents/*">
  105. <xsl:element name="subFeed">
  106. <xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute>
  107. <xsl:attribute name="type">header</xsl:attribute>
  108. <atom:feed>
  109. <atom:id>
  110. <xsl:value-of select="concat('tag:cognos.com,2007:','@report_id@/', @name, ':header')"/>
  111. </atom:id>
  112. <atom:title>@header_title@</atom:title>
  113. <atom:updated>@report_updated@</atom:updated>
  114. <atom:author>
  115. <atom:name>Cognos</atom:name>
  116. </atom:author>
  117. <atom:link rel="self" type="application/atom+xml">
  118. <xsl:attribute name="href"><xsl:value-of select="concat('@report_gateway@/rds/atom/path/@report_id@?selection=',@name,'&amp;eltype=header','&amp;v=@requestversion@')"/></xsl:attribute>
  119. </atom:link>
  120. <xsl:apply-templates select="pageHeader/contents/*"/>
  121. </atom:feed>
  122. </xsl:element>
  123. </xsl:if>
  124. <xsl:if test="pageBody/contents/*">
  125. <xsl:element name="subFeed">
  126. <xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute>
  127. <xsl:attribute name="type">body</xsl:attribute>
  128. <atom:feed>
  129. <atom:id>
  130. <xsl:value-of select="concat('tag:cognos.com,2007:','@report_id@/', @name, ':body')"/>
  131. </atom:id>
  132. <atom:title>@body_title@</atom:title>
  133. <atom:updated>@report_updated@</atom:updated>
  134. <atom:author>
  135. <atom:name>Cognos</atom:name>
  136. </atom:author>
  137. <atom:link rel="self" type="application/atom+xml">
  138. <xsl:attribute name="href"><xsl:value-of select="concat('@report_gateway@/rds/atom/path/@report_id@?selection=',@name,'&amp;eltype=body','&amp;v=@requestversion@')"/></xsl:attribute>
  139. </atom:link>
  140. <xsl:apply-templates select="pageBody/contents/*"/>
  141. </atom:feed>
  142. </xsl:element>
  143. </xsl:if>
  144. <xsl:if test="pageFooter/contents/*">
  145. <xsl:element name="subFeed">
  146. <xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute>
  147. <xsl:attribute name="type">footer</xsl:attribute>
  148. <atom:feed>
  149. <atom:id>
  150. <xsl:value-of select="concat('tag:cognos.com,2007:','@report_id@/', @name, ':footer')"/>
  151. </atom:id>
  152. <atom:title>@footer_title@</atom:title>
  153. <atom:updated>@report_updated@</atom:updated>
  154. <atom:author>
  155. <atom:name>Cognos</atom:name>
  156. </atom:author>
  157. <atom:link rel="self" type="application/atom+xml">
  158. <xsl:attribute name="href"><xsl:value-of select="concat('@report_gateway@/rds/atom/path/@report_id@?selection=',@name,'&amp;eltype=footer','&amp;v=@requestversion@')"/></xsl:attribute>
  159. </atom:link>
  160. <xsl:apply-templates select="pageFooter/contents/*"/>
  161. </atom:feed>
  162. </xsl:element>
  163. </xsl:if>
  164. </xsl:template>
  165. <xsl:template match="table">
  166. <xsl:apply-templates select="tableRows/tableRow"/>
  167. </xsl:template>
  168. <xsl:template match="tableRow">
  169. <xsl:apply-templates select="tableCells/tableCell"/>
  170. </xsl:template>
  171. <xsl:template match="tableCell">
  172. <xsl:apply-templates select="contents/*"/>
  173. </xsl:template>
  174. <xsl:template match="block">
  175. <xsl:apply-templates select="contents/*"/>
  176. </xsl:template>
  177. <xsl:template match="list">
  178. <xsl:if test="@name">
  179. <xsl:call-template name="atomEntry">
  180. <xsl:with-param name="entryID">
  181. <xsl:value-of select="@name"/>
  182. </xsl:with-param>
  183. <xsl:with-param name="entryType">list</xsl:with-param>
  184. </xsl:call-template>
  185. </xsl:if>
  186. </xsl:template>
  187. <xsl:template match="TOC">
  188. <xsl:if test="@tocName">
  189. <xsl:call-template name="atomEntry">
  190. <xsl:with-param name="entryID">
  191. <xsl:value-of select="@name"/>
  192. </xsl:with-param>
  193. <xsl:with-param name="entryType">toc</xsl:with-param>
  194. </xsl:call-template>
  195. </xsl:if>
  196. </xsl:template>
  197. <xsl:template match="textItem">
  198. <xsl:if test="@name">
  199. <xsl:call-template name="atomEntry">
  200. <xsl:with-param name="entryID">
  201. <xsl:value-of select="@name"/>
  202. </xsl:with-param>
  203. <xsl:with-param name="entryType">textframe</xsl:with-param>
  204. </xsl:call-template>
  205. </xsl:if>
  206. </xsl:template>
  207. <xsl:template match="image">
  208. <xsl:if test="@name">
  209. <xsl:call-template name="atomEntry">
  210. <xsl:with-param name="entryID">
  211. <xsl:value-of select="@name"/>
  212. </xsl:with-param>
  213. <xsl:with-param name="entryType">image</xsl:with-param>
  214. </xsl:call-template>
  215. </xsl:if>
  216. </xsl:template>
  217. <xsl:template match="crosstab">
  218. <xsl:if test="@name">
  219. <xsl:call-template name="atomEntry">
  220. <xsl:with-param name="entryID">
  221. <xsl:choose>
  222. <xsl:when test="function-available('ccs:getInfoPartName')">
  223. <xsl:value-of select="ccs:getInfoPartName(@name,'Crosstab')"/>
  224. </xsl:when>
  225. <xsl:otherwise>
  226. <xsl:value-of select="@name"/>
  227. </xsl:otherwise>
  228. </xsl:choose>
  229. </xsl:with-param>
  230. <xsl:with-param name="entryType">crosstab</xsl:with-param>
  231. </xsl:call-template>
  232. </xsl:if>
  233. </xsl:template>
  234. <xsl:template match="repeaterTable">
  235. <xsl:if test="@name">
  236. <xsl:call-template name="atomEntry">
  237. <xsl:with-param name="entryID">
  238. <xsl:value-of select="@name"/>
  239. </xsl:with-param>
  240. <xsl:with-param name="entryType">repeater_table</xsl:with-param>
  241. </xsl:call-template>
  242. </xsl:if>
  243. </xsl:template>
  244. <xsl:template match="repeater">
  245. <xsl:if test="@name">
  246. <xsl:call-template name="atomEntry">
  247. <xsl:with-param name="entryID">
  248. <xsl:value-of select="@name"/>
  249. </xsl:with-param>
  250. <xsl:with-param name="entryType">repeater</xsl:with-param>
  251. </xsl:call-template>
  252. </xsl:if>
  253. </xsl:template>
  254. <xsl:template match="hyperlink">
  255. <xsl:if test="@name">
  256. <xsl:call-template name="atomEntry">
  257. <xsl:with-param name="entryID">
  258. <xsl:value-of select="@name"/>
  259. </xsl:with-param>
  260. <xsl:with-param name="entryType">hyperlink</xsl:with-param>
  261. </xsl:call-template>
  262. </xsl:if>
  263. </xsl:template>
  264. <xsl:template match="HTMLItem">
  265. <xsl:if test="@name">
  266. <xsl:call-template name="atomEntry">
  267. <xsl:with-param name="entryID">
  268. <xsl:value-of select="@name"/>
  269. </xsl:with-param>
  270. <xsl:with-param name="entryType">html</xsl:with-param>
  271. </xsl:call-template>
  272. </xsl:if>
  273. </xsl:template>
  274. <xsl:template match="richTextItem">
  275. <xsl:if test="@name">
  276. <xsl:call-template name="atomEntry">
  277. <xsl:with-param name="entryID">
  278. <xsl:value-of select="@name"/>
  279. </xsl:with-param>
  280. <xsl:with-param name="entryType">richtext</xsl:with-param>
  281. </xsl:call-template>
  282. </xsl:if>
  283. </xsl:template>
  284. <xsl:template match="customContent">
  285. <!--Custom content items are mapped to Richtext in LDX -->
  286. <xsl:if test="@name">
  287. <xsl:call-template name="atomEntry">
  288. <xsl:with-param name="entryID">
  289. <xsl:value-of select="@name"/>
  290. </xsl:with-param>
  291. <xsl:with-param name="entryType">richtext</xsl:with-param>
  292. </xsl:call-template>
  293. </xsl:if>
  294. </xsl:template>
  295. <xsl:template match="bookmark">
  296. <xsl:if test="@name">
  297. <xsl:call-template name="atomEntry">
  298. <xsl:with-param name="entryID">
  299. <xsl:value-of select="@name"/>
  300. </xsl:with-param>
  301. <xsl:with-param name="entryType">bookmark</xsl:with-param>
  302. </xsl:call-template>
  303. </xsl:if>
  304. </xsl:template>
  305. <xsl:template match="TOCEntry">
  306. <xsl:if test="@name">
  307. <xsl:call-template name="atomEntry">
  308. <xsl:with-param name="entryID">
  309. <xsl:value-of select="@name"/>
  310. </xsl:with-param>
  311. <xsl:with-param name="entryType">bookmark</xsl:with-param>
  312. </xsl:call-template>
  313. </xsl:if>
  314. </xsl:template>
  315. <xsl:template match="fieldSet">
  316. <xsl:apply-templates select="contents/*"/>
  317. </xsl:template>
  318. <xsl:template match="conditionalBlocks">
  319. <xsl:apply-templates select="./conditionalBlockDefault/contents/*"/>
  320. <xsl:for-each select="./conditionalBlockCases/conditionalBlock">
  321. <xsl:apply-templates select="./contents/*"/>
  322. </xsl:for-each>
  323. </xsl:template>
  324. <xsl:template match="layoutComponentRef">
  325. <xsl:if test="@name">
  326. <xsl:call-template name="atomEntry">
  327. <xsl:with-param name="entryID">
  328. <xsl:value-of select="concat(@name, '_REF')"/>
  329. </xsl:with-param>
  330. <xsl:with-param name="entryType">layout_component_ref</xsl:with-param>
  331. </xsl:call-template>
  332. </xsl:if>
  333. </xsl:template>
  334. <xsl:template match="CMMMap">
  335. <xsl:if test="@name">
  336. <xsl:call-template name="atomEntry">
  337. <xsl:with-param name="entryID">
  338. <xsl:value-of select="@name"/>
  339. </xsl:with-param>
  340. <xsl:with-param name="entryType">image</xsl:with-param>
  341. </xsl:call-template>
  342. </xsl:if>
  343. </xsl:template>
  344. <xsl:template match="pieChart | paretoChart | scatterChart | polarChart | radarChart | progressiveChart | combinationChart | bubbleChart | threeDCombinationChart | threeDScatterChart | gaugeChart | mapChart | metricsChart | marimekkoChart | winLossChart | v2_combinationChart | v2_scatterChart | v2_pieChart | v2_gaugeChart | v2_matrixChart | v2_progressiveChart | v2_paretoChart | v2_bubbleChart | v2_repeaterChart | v2_bulletChart | viz">
  345. <xsl:if test="@name">
  346. <xsl:call-template name="atomEntry">
  347. <xsl:with-param name="entryID">
  348. <xsl:choose>
  349. <xsl:when test="function-available('ccs:getInfoPartName')">
  350. <xsl:value-of select="ccs:getInfoPartName(@name,'Chart')"/>
  351. </xsl:when>
  352. <xsl:otherwise>
  353. <xsl:value-of select="@name"/>
  354. </xsl:otherwise>
  355. </xsl:choose>
  356. </xsl:with-param>
  357. <xsl:with-param name="entryType">chart</xsl:with-param>
  358. </xsl:call-template>
  359. </xsl:if>
  360. </xsl:template>
  361. <xsl:template match="singleton">
  362. <xsl:call-template name="atomEntry">
  363. <xsl:with-param name="entryID">
  364. <xsl:choose>
  365. <xsl:when test="contents/textItem/@name">
  366. <xsl:value-of select="contents/textItem/@name"/>
  367. </xsl:when>
  368. <xsl:when test="@name">
  369. <xsl:value-of select="@name"/>
  370. </xsl:when>
  371. <xsl:otherwise>
  372. <xsl:value-of select="local-name()"/>
  373. </xsl:otherwise>
  374. </xsl:choose>
  375. </xsl:with-param>
  376. <xsl:with-param name="entryType">singleton</xsl:with-param>
  377. <xsl:with-param name="entryIcon">singleton</xsl:with-param>
  378. </xsl:call-template>
  379. </xsl:template>
  380. <xsl:template match="*">
  381. <!--Unknown element. Ignore-->
  382. </xsl:template>
  383. <xsl:template name="atomEntry">
  384. <xsl:param name="entryID"/>
  385. <xsl:param name="entryIcon"/>
  386. <xsl:param name="entryType"/>
  387. <atom:entry>
  388. <atom:id>
  389. <xsl:choose>
  390. <xsl:when test="function-available('ccs:encodeID')">
  391. <xsl:value-of select="concat('tag:cognos.com,2007:@report_id@/',ccs:encodeID($entryID))"/>
  392. </xsl:when>
  393. <xsl:otherwise>
  394. <xsl:value-of select="concat('tag:cognos.com,2007:@report_id@/',$entryID)"/>
  395. </xsl:otherwise>
  396. </xsl:choose>
  397. </atom:id>
  398. <atom:title>
  399. <xsl:value-of select="$entryID"/>
  400. </atom:title>
  401. <atom:author>
  402. <atom:name>@report_author@</atom:name>@report_author_email@
  403. </atom:author>@report_contributor@@report_description@
  404. <atom:updated>@report_updated@</atom:updated>
  405. <atom:link>
  406. <xsl:attribute name="rel">icon</xsl:attribute>
  407. <xsl:attribute name="type">image/gif</xsl:attribute>
  408. <xsl:attribute name="href"><xsl:value-of select="concat('@webcontent_root@/ccs/images/', $entryType,'_icon.gif')"/></xsl:attribute>
  409. </atom:link>
  410. <atom:link>
  411. <xsl:attribute name="rel">thumbnail</xsl:attribute>
  412. <xsl:attribute name="type">image/gif</xsl:attribute>
  413. <xsl:attribute name="href"><xsl:choose><xsl:when test="function-available('ccs:uriEncodeID')"><xsl:value-of select="concat('@report_gateway@/rds/thumbnail/report/@report_storeid@?selection=',ccs:uriEncodeID($entryID,$hexEncodeUnderscores),'&amp;v=@requestversion@')"/></xsl:when><xsl:otherwise><xsl:value-of select="concat('@report_gateway@/rds/thumbnail/report/@report_storeid@?selection=',$entryID,'&amp;v=@requestversion@')"/></xsl:otherwise></xsl:choose></xsl:attribute>
  414. </atom:link>
  415. <atom:link>
  416. <xsl:attribute name="rel">alternate</xsl:attribute>
  417. <xsl:attribute name="type">application/x-ldx+xml</xsl:attribute>
  418. <xsl:attribute name="href"><xsl:choose><xsl:when test="function-available('ccs:uriEncodeID')"><xsl:value-of select="concat('@report_gateway@/rds/reportData/path/@report_id@?includeLayout=true&amp;selection=',ccs:uriEncodeID($entryID,$hexEncodeUnderscores),'&amp;v=@requestversion@')"/></xsl:when><xsl:otherwise><xsl:value-of select="concat('@report_gateway@/rds/reportData/path/@report_id@?includeLayout=true&amp;selection=',$entryID,'&amp;v=@requestversion@')"/></xsl:otherwise></xsl:choose></xsl:attribute>
  419. </atom:link>
  420. <atom:link>
  421. <xsl:attribute name="rel">alternate</xsl:attribute>
  422. <xsl:attribute name="type">application/x-pagedldx+xml</xsl:attribute>
  423. <xsl:attribute name="href"><xsl:choose><xsl:when test="function-available('ccs:uriEncodeID')"><xsl:value-of select="concat('@report_gateway@/rds/pagedReportData/report/@report_storeid@?selection=',ccs:uriEncodeID($entryID,$hexEncodeUnderscores),'&amp;version=LATEST','&amp;v=@requestversion@')"/></xsl:when><xsl:otherwise><xsl:value-of select="concat('@report_gateway@/rds/pagedReportData/report/@report_storeid@?selection=',$entryID,'&amp;version=LATEST','&amp;v=@requestversion@')"/></xsl:otherwise></xsl:choose></xsl:attribute>
  424. </atom:link>
  425. <cm:objectClass>reportpart</cm:objectClass>
  426. <cm:location>
  427. <xsl:value-of select="concat('@report_location@ > ', $entryID)"/>
  428. </cm:location>
  429. <d:type>
  430. <xsl:value-of select="$entryType"/>
  431. </d:type>
  432. <d:storeID>@report_storeid@</d:storeID>
  433. <d:partID>
  434. <xsl:value-of select="$entryID"/>
  435. </d:partID>
  436. </atom:entry>
  437. </xsl:template>
  438. <xsl:template name="atomVirtualEntry">
  439. <xsl:param name="entryID"/>
  440. <xsl:param name="entryIcon"/>
  441. <xsl:param name="entryType"/>
  442. <xsl:param name="entryName"/>
  443. <atom:entry>
  444. <atom:id>
  445. <xsl:choose>
  446. <xsl:when test="function-available('ccs:encodeID')">
  447. <xsl:value-of select="concat('tag:cognos.com,2007:@report_id@/',ccs:encodeID($entryID), ':', $entryType)"/>
  448. </xsl:when>
  449. <xsl:otherwise>
  450. <xsl:value-of select="concat('tag:cognos.com,2007:@report_id@/',$entryID, ':', $entryType)"/>
  451. </xsl:otherwise>
  452. </xsl:choose>
  453. </atom:id>
  454. <atom:title>
  455. <xsl:value-of select="$entryName"/>
  456. </atom:title>
  457. <atom:author>
  458. <atom:name>@report_author@</atom:name>@report_author_email@
  459. </atom:author>@report_contributor@@report_description@
  460. <atom:updated>@report_updated@</atom:updated>
  461. <atom:link>
  462. <xsl:attribute name="rel">icon</xsl:attribute>
  463. <xsl:attribute name="type">image/gif</xsl:attribute>
  464. <xsl:attribute name="href"><xsl:value-of select="concat('@webcontent_root@/ccs/images/', $entryIcon,'_icon.gif')"/></xsl:attribute>
  465. </atom:link>
  466. <atom:link>
  467. <xsl:attribute name="rel">alternate</xsl:attribute>
  468. <xsl:attribute name="type">application/atom+xml</xsl:attribute>
  469. <xsl:attribute name="href"><xsl:choose><xsl:when test="function-available('ccs:uriEncodeID')"><xsl:value-of select="concat('@report_gateway@/rds/atom/path/@report_id@?selection=',ccs:uriEncodeID($entryID,$hexEncodeUnderscores),'&amp;eltype=',$entryType,'&amp;v=@requestversion@')"/></xsl:when><xsl:otherwise><xsl:value-of select="concat('@report_gateway@/rds/atom/path/@report_id@?selection=',$entryID,'&amp;eltype=',$entryType,'&amp;v=@requestversion@')"/></xsl:otherwise></xsl:choose></xsl:attribute>
  470. </atom:link>
  471. <atom:link>
  472. <xsl:attribute name="rel">alternate</xsl:attribute>
  473. <xsl:attribute name="type">application/x-pagedldx+xml</xsl:attribute>
  474. <xsl:attribute name="href"><xsl:choose><xsl:when test="function-available('ccs:uriEncodeID')"><xsl:value-of select="concat('@report_gateway@/rds/pagedReportData/report/@report_storeid@?selection=',ccs:uriEncodeID($entryID,$hexEncodeUnderscores),'&amp;version=LATEST','&amp;v=@requestversion@')"/></xsl:when><xsl:otherwise><xsl:value-of select="concat('@report_gateway@/rds/pagedReportData/report/@report_storeid@?selection=',$entryID,'&amp;version=LATEST','&amp;v=@requestversion@')"/></xsl:otherwise></xsl:choose></xsl:attribute>
  475. </atom:link>
  476. <d:type>
  477. <xsl:value-of select="$entryType"/>
  478. </d:type>
  479. <d:storeID>@report_storeid@</d:storeID>
  480. <d:partID>
  481. <xsl:value-of select="$entryID"/>
  482. </d:partID>
  483. <cm:location>
  484. <xsl:value-of select="concat('@report_location@ > ', $entryID)"/>
  485. </cm:location>
  486. </atom:entry>
  487. </xsl:template>
  488. <xsl:template name="atomPageEntry">
  489. <xsl:param name="entryID"/>
  490. <xsl:param name="entryIcon"/>
  491. <atom:entry>
  492. <atom:id>
  493. <xsl:choose>
  494. <xsl:when test="function-available('ccs:encodeID')">
  495. <xsl:value-of select="concat('tag:cognos.com,2007:@report_id@/',ccs:encodeID($entryID))"/>
  496. </xsl:when>
  497. <xsl:otherwise>
  498. <xsl:value-of select="concat('tag:cognos.com,2007:@report_id@/',$entryID)"/>
  499. </xsl:otherwise>
  500. </xsl:choose>
  501. </atom:id>
  502. <atom:title>
  503. <xsl:value-of select="$entryID"/>
  504. </atom:title>
  505. <atom:author>
  506. <atom:name>@report_author@</atom:name>@report_author_email@
  507. </atom:author>@report_contributor@@report_description@
  508. <atom:updated>@report_updated@</atom:updated>
  509. <atom:link>
  510. <xsl:attribute name="rel">icon</xsl:attribute>
  511. <xsl:attribute name="type">image/gif</xsl:attribute>
  512. <xsl:attribute name="href"><xsl:value-of select="concat('@webcontent_root@/ccs/images/', $entryIcon,'_icon.gif')"/></xsl:attribute>
  513. </atom:link>
  514. <atom:link>
  515. <xsl:attribute name="rel">alternate</xsl:attribute>
  516. <xsl:attribute name="type">application/atom+xml</xsl:attribute>
  517. <xsl:attribute name="href"><xsl:choose><xsl:when test="function-available('ccs:uriEncodeID')"><xsl:value-of select="concat('@report_gateway@/rds/atom/path/@report_id@?selection=',ccs:uriEncodeID($entryID,$hexEncodeUnderscores),'&amp;eltype=page','&amp;v=@requestversion@')"/></xsl:when><xsl:otherwise><xsl:value-of select="concat('@report_gateway@/rds/atom/path/@report_id@?selection=',$entryID,'&amp;type=page','&amp;v=@requestversion@')"/></xsl:otherwise></xsl:choose></xsl:attribute>
  518. </atom:link>
  519. <atom:link>
  520. <xsl:attribute name="rel">alternate</xsl:attribute>
  521. <xsl:attribute name="type">application/x-ldx+xml</xsl:attribute>
  522. <xsl:attribute name="href"><xsl:choose><xsl:when test="function-available('ccs:uriEncodeID')"><xsl:value-of select="concat('@report_gateway@/rds/reportData/path/@report_id@?includeLayout=true&amp;selection=',ccs:uriEncodeID($entryID,$hexEncodeUnderscores),'&amp;eltype=page','&amp;v=@requestversion@')"/></xsl:when><xsl:otherwise><xsl:value-of select="concat('@report_gateway@/rds/reportData/path/@report_id@?includeLayout=true&amp;selection=',$entryID,'&amp;v=@requestversion@')"/></xsl:otherwise></xsl:choose></xsl:attribute>
  523. </atom:link>
  524. <atom:link>
  525. <xsl:attribute name="rel">alternate</xsl:attribute>
  526. <xsl:attribute name="type">application/x-pagedldx+xml</xsl:attribute>
  527. <xsl:attribute name="href"><xsl:choose><xsl:when test="function-available('ccs:uriEncodeID')"><xsl:value-of select="concat('@report_gateway@/rds/pagedReportData/report/@report_storeid@?selection=',ccs:uriEncodeID($entryID,$hexEncodeUnderscores),'&amp;version=LATEST','&amp;v=@requestversion@')"/></xsl:when><xsl:otherwise><xsl:value-of select="concat('@report_gateway@/rds/pagedReportData/report/@report_storeid@?selection=',$entryID,'&amp;version=LATEST','&amp;v=@requestversion@')"/></xsl:otherwise></xsl:choose></xsl:attribute>
  528. </atom:link>
  529. <cm:location>
  530. <xsl:value-of select="concat('@report_location@ > ', $entryID)"/>
  531. </cm:location>
  532. <d:type>page</d:type>
  533. <d:storeID>@report_storeid@</d:storeID>
  534. <d:partID>
  535. <xsl:value-of select="$entryID"/>
  536. </d:partID>
  537. </atom:entry>
  538. </xsl:template>
  539. </xsl:stylesheet>