info2atom_ds.xsl 23 KB

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