spec2atom_ds.xsl 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752
  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="useLocalizedNames" select="false"/>
  11. <xsl:param name="userLocale" select="en"/>
  12. <xsl:param name="hexEncodeUnderscores" select="true()"/>
  13. <xsl:template match="/">
  14. <xsl:comment> Copyright (C) 2008 Cognos ULC, an IBM Company. All rights reserved.
  15. Cognos (R) is a trademark of Cognos ULC, (formerly Cognos Incorporated)</xsl:comment>
  16. <atom:feed>
  17. <atom:id>
  18. <xsl:value-of select="concat('tag:cognos.com,2007:','@report_id@')"/>
  19. </atom:id>
  20. <atom:title>@report_title@</atom:title>
  21. <atom:updated>@report_updated@</atom:updated>
  22. <atom:author>
  23. <atom:name>@report_author@</atom:name>
  24. @report_author_email@
  25. </atom:author>
  26. <atom:link rel="self" type="application/atom+xml" href="@report_gateway@/rds/atom_ds/report/@report_storeid@?v=@requestversion@"/>
  27. <atom:link rel="alternate" type="text/xml" href="@report_gateway@/rds/reportData/report/@report_storeid@?version=LATEST&amp;v=@requestversion@"/>
  28. <atom:link rel="alternate" type="application/x-pagedldx+xml" href="@report_gateway@/rds/pagedReportData/path/@report_id@?v=@requestversion@"/>
  29. <xsl:apply-templates select="/report/layouts/layout/reportPages/*"/>
  30. <xsl:apply-templates select="/report/layouts/layout/promptPages/*"/>
  31. </atom:feed>
  32. </xsl:template>
  33. <xsl:template priority="2" match="*[contains(style/CSS/@value, 'visibility:hidden') ]"/>
  34. <xsl:template match="pageSet">
  35. <xsl:apply-templates select="./pageOverallGroup/headerPages/*"/>
  36. <xsl:apply-templates select="./detailPages/*"/>
  37. <xsl:apply-templates select="./pageOverallGroup/footerPages/*"/>
  38. <xsl:for-each select="./pageGroups/pageGroup">
  39. <xsl:apply-templates select="headerPages/*"/>
  40. <xsl:apply-templates select="footerPages/*"/>
  41. </xsl:for-each>
  42. </xsl:template>
  43. <xsl:template match="page">
  44. <xsl:call-template name="atomPageEntry">
  45. <xsl:with-param name="entryID">
  46. <xsl:value-of select="@name"/>
  47. </xsl:with-param>
  48. <xsl:with-param name="entryType">page</xsl:with-param>
  49. <xsl:with-param name="entryIcon">folder</xsl:with-param>
  50. </xsl:call-template>
  51. <xsl:element name="subFeed">
  52. <xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute>
  53. <xsl:attribute name="type">page</xsl:attribute>
  54. <atom:feed>
  55. <atom:id>
  56. <xsl:value-of select="concat('tag:cognos.com,2007:','@report_id@/', @name)"/>
  57. </atom:id>
  58. <atom:title>
  59. <xsl:value-of select="@name"/>
  60. </atom:title>
  61. <atom:updated>@report_updated@</atom:updated>
  62. <atom:author>
  63. <atom:name>@report_author@</atom:name>@report_author_email@
  64. </atom:author>
  65. <atom:link rel="self" type="application/atom+xml">
  66. <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>
  67. </atom:link>
  68. <xsl:if test="pageHeader/contents/*">
  69. <xsl:call-template name="atomVirtualEntry">
  70. <xsl:with-param name="entryID">
  71. <xsl:value-of select="@name"/>
  72. </xsl:with-param>
  73. <xsl:with-param name="entryType">header</xsl:with-param>
  74. <xsl:with-param name="entryIcon">folder</xsl:with-param>
  75. <xsl:with-param name="entryName">@header_title@</xsl:with-param>
  76. </xsl:call-template>
  77. </xsl:if>
  78. <xsl:apply-templates select="pageBody/contents/*"/>
  79. <xsl:if test="pageFooter/contents/*">
  80. <xsl:call-template name="atomVirtualEntry">
  81. <xsl:with-param name="entryID">
  82. <xsl:value-of select="@name"/>
  83. </xsl:with-param>
  84. <xsl:with-param name="entryType">footer</xsl:with-param>
  85. <xsl:with-param name="entryIcon">folder</xsl:with-param>
  86. <xsl:with-param name="entryName">@footer_title@</xsl:with-param>
  87. </xsl:call-template>
  88. </xsl:if>
  89. </atom:feed>
  90. </xsl:element>
  91. <xsl:if test="pageHeader/contents/*">
  92. <xsl:element name="subFeed">
  93. <xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute>
  94. <xsl:attribute name="type">header</xsl:attribute>
  95. <atom:feed>
  96. <atom:id>
  97. <xsl:value-of select="concat('tag:cognos.com,2007:','@report_id@/', @name, ':header')"/>
  98. </atom:id>
  99. <atom:title>@header_title@</atom:title>
  100. <atom:updated>@report_updated@</atom:updated>
  101. <atom:author>
  102. <atom:name>@report_author@</atom:name>
  103. </atom:author>
  104. <atom:link rel="self" type="application/atom+xml">
  105. <xsl:attribute name="href"><xsl:value-of select="concat('@report_gateway@/rds/atom_ds/report/@report_storeid@?selection=',@name,'&amp;eltype=header','&amp;v=@requestversion@')"/></xsl:attribute>
  106. </atom:link>
  107. <xsl:apply-templates select="pageHeader/contents/*"/>
  108. </atom:feed>
  109. </xsl:element>
  110. </xsl:if>
  111. <xsl:if test="pageFooter/contents/*">
  112. <xsl:element name="subFeed">
  113. <xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute>
  114. <xsl:attribute name="type">footer</xsl:attribute>
  115. <atom:feed>
  116. <atom:id>
  117. <xsl:value-of select="concat('tag:cognos.com,2007:','@report_id@/', @name, ':footer')"/>
  118. </atom:id>
  119. <atom:title>@footer_title@</atom:title>
  120. <atom:updated>@report_updated@</atom:updated>
  121. <atom:author>
  122. <atom:name>@report_author@</atom:name>
  123. </atom:author>
  124. <atom:link rel="self" type="application/atom+xml">
  125. <xsl:attribute name="href"><xsl:value-of select="concat('@report_gateway@/rds/atom_ds/report/@report_storeid@?selection=',@name,'&amp;eltype=footer','&amp;v=@requestversion@')"/></xsl:attribute>
  126. </atom:link>
  127. <xsl:apply-templates select="pageFooter/contents/*"/>
  128. </atom:feed>
  129. </xsl:element>
  130. </xsl:if>
  131. </xsl:template>
  132. <xsl:template match="table">
  133. <xsl:apply-templates select="tableRows/tableRow"/>
  134. </xsl:template>
  135. <xsl:template match="tableRow">
  136. <xsl:apply-templates select="tableCells/tableCell"/>
  137. </xsl:template>
  138. <xsl:template match="tableCell">
  139. <xsl:apply-templates select="contents/*"/>
  140. </xsl:template>
  141. <xsl:template match="block">
  142. <xsl:apply-templates select="contents/*"/>
  143. </xsl:template>
  144. <xsl:template match="list">
  145. <xsl:if test="@name">
  146. <xsl:call-template name="atomEntry">
  147. <xsl:with-param name="entryID">
  148. <xsl:value-of select="@name"/>
  149. </xsl:with-param>
  150. <xsl:with-param name="entryType">list</xsl:with-param>
  151. </xsl:call-template>
  152. </xsl:if>
  153. </xsl:template>
  154. <xsl:template match="TOC">
  155. <xsl:if test="@tocName">
  156. <xsl:call-template name="atomEntry">
  157. <xsl:with-param name="entryID">
  158. <xsl:value-of select="@name"/>
  159. </xsl:with-param>
  160. <xsl:with-param name="entryType">toc</xsl:with-param>
  161. </xsl:call-template>
  162. </xsl:if>
  163. </xsl:template>
  164. <xsl:template match="textItem">
  165. <xsl:if test="@name">
  166. <xsl:call-template name="atomEntry">
  167. <xsl:with-param name="entryID">
  168. <xsl:value-of select="@name"/>
  169. </xsl:with-param>
  170. <xsl:with-param name="entryType">textframe</xsl:with-param>
  171. </xsl:call-template>
  172. </xsl:if>
  173. </xsl:template>
  174. <xsl:template match="image">
  175. <xsl:if test="@name">
  176. <xsl:call-template name="atomEntry">
  177. <xsl:with-param name="entryID">
  178. <xsl:value-of select="@name"/>
  179. </xsl:with-param>
  180. <xsl:with-param name="entryType">image</xsl:with-param>
  181. </xsl:call-template>
  182. </xsl:if>
  183. </xsl:template>
  184. <xsl:template match="crosstab">
  185. <xsl:if test="@name">
  186. <xsl:call-template name="atomEntry">
  187. <xsl:with-param name="entryID">
  188. <xsl:value-of select="@name"/>
  189. </xsl:with-param>
  190. <xsl:with-param name="entryType">crosstab</xsl:with-param>
  191. </xsl:call-template>
  192. </xsl:if>
  193. </xsl:template>
  194. <xsl:template match="repeaterTable">
  195. <xsl:if test="@name">
  196. <xsl:call-template name="atomEntry">
  197. <xsl:with-param name="entryID">
  198. <xsl:value-of select="@name"/>
  199. </xsl:with-param>
  200. <xsl:with-param name="entryType">repeater_table</xsl:with-param>
  201. <xsl:with-param name="entryIcon">repeatertable</xsl:with-param>
  202. </xsl:call-template>
  203. </xsl:if>
  204. </xsl:template>
  205. <xsl:template match="repeater">
  206. <xsl:if test="@name">
  207. <xsl:call-template name="atomEntry">
  208. <xsl:with-param name="entryID">
  209. <xsl:value-of select="@name"/>
  210. </xsl:with-param>
  211. <xsl:with-param name="entryType">repeater</xsl:with-param>
  212. </xsl:call-template>
  213. </xsl:if>
  214. </xsl:template>
  215. <xsl:template match="hyperlink">
  216. <xsl:if test="@name">
  217. <xsl:call-template name="atomEntry">
  218. <xsl:with-param name="entryID">
  219. <xsl:value-of select="@name"/>
  220. </xsl:with-param>
  221. <xsl:with-param name="entryType">hyperlink</xsl:with-param>
  222. </xsl:call-template>
  223. </xsl:if>
  224. </xsl:template>
  225. <xsl:template match="HTMLItem">
  226. <xsl:if test="@name">
  227. <xsl:call-template name="atomEntry">
  228. <xsl:with-param name="entryID">
  229. <xsl:value-of select="@name"/>
  230. </xsl:with-param>
  231. <xsl:with-param name="entryType">html</xsl:with-param>
  232. </xsl:call-template>
  233. </xsl:if>
  234. </xsl:template>
  235. <xsl:template match="richTextItem">
  236. <xsl:if test="@name">
  237. <xsl:call-template name="atomEntry">
  238. <xsl:with-param name="entryID">
  239. <xsl:value-of select="@name"/>
  240. </xsl:with-param>
  241. <xsl:with-param name="entryType">richtext</xsl:with-param>
  242. </xsl:call-template>
  243. </xsl:if>
  244. </xsl:template>
  245. <xsl:template match="customContent">
  246. <!--Custom content items are mapped to Richtext in LDX -->
  247. <xsl:if test="@name">
  248. <xsl:call-template name="atomEntry">
  249. <xsl:with-param name="entryID">
  250. <xsl:value-of select="@name"/>
  251. </xsl:with-param>
  252. <xsl:with-param name="entryType">richtext</xsl:with-param>
  253. </xsl:call-template>
  254. </xsl:if>
  255. </xsl:template>
  256. <xsl:template match="bookmark">
  257. <xsl:if test="@name">
  258. <xsl:call-template name="atomEntry">
  259. <xsl:with-param name="entryID">
  260. <xsl:value-of select="@name"/>
  261. </xsl:with-param>
  262. <xsl:with-param name="entryType">bookmark</xsl:with-param>
  263. </xsl:call-template>
  264. </xsl:if>
  265. </xsl:template>
  266. <xsl:template match="TOCEntry">
  267. <xsl:if test="@name">
  268. <xsl:call-template name="atomEntry">
  269. <xsl:with-param name="entryID">
  270. <xsl:value-of select="@name"/>
  271. </xsl:with-param>
  272. <xsl:with-param name="entryType">bookmark</xsl:with-param>
  273. </xsl:call-template>
  274. </xsl:if>
  275. </xsl:template>
  276. <xsl:template match="textBox">
  277. <xsl:if test="@name">
  278. <xsl:call-template name="atomEntry">
  279. <xsl:with-param name="entryID">
  280. <xsl:value-of select="@name"/>
  281. </xsl:with-param>
  282. <xsl:with-param name="entryType">textBox</xsl:with-param>
  283. <xsl:with-param name="entryIcon">textbox</xsl:with-param>
  284. </xsl:call-template>
  285. </xsl:if>
  286. </xsl:template>
  287. <xsl:template match="selectDate">
  288. <xsl:if test="@name">
  289. <xsl:call-template name="atomEntry">
  290. <xsl:with-param name="entryID">
  291. <xsl:value-of select="@name"/>
  292. </xsl:with-param>
  293. <xsl:with-param name="entryType">selectDate</xsl:with-param>
  294. <xsl:with-param name="entryIcon">selectdate</xsl:with-param>
  295. </xsl:call-template>
  296. </xsl:if>
  297. </xsl:template>
  298. <xsl:template match="selectDateTime">
  299. <xsl:if test="@name">
  300. <xsl:call-template name="atomEntry">
  301. <xsl:with-param name="entryID">
  302. <xsl:value-of select="@name"/>
  303. </xsl:with-param>
  304. <xsl:with-param name="entryType">selectDateTime</xsl:with-param>
  305. <xsl:with-param name="entryIcon">selectdatetime</xsl:with-param>
  306. </xsl:call-template>
  307. </xsl:if>
  308. </xsl:template>
  309. <xsl:template match="selectTime">
  310. <xsl:if test="@name">
  311. <xsl:call-template name="atomEntry">
  312. <xsl:with-param name="entryID">
  313. <xsl:value-of select="@name"/>
  314. </xsl:with-param>
  315. <xsl:with-param name="entryType">selectTime</xsl:with-param>
  316. <xsl:with-param name="entryIcon">selecttime</xsl:with-param>
  317. </xsl:call-template>
  318. </xsl:if>
  319. </xsl:template>
  320. <xsl:template match="selectInterval">
  321. <xsl:if test="@name">
  322. <xsl:call-template name="atomEntry">
  323. <xsl:with-param name="entryID">
  324. <xsl:value-of select="@name"/>
  325. </xsl:with-param>
  326. <xsl:with-param name="entryType">selectInterval</xsl:with-param>
  327. <xsl:with-param name="entryIcon">selectinterval</xsl:with-param>
  328. </xsl:call-template>
  329. </xsl:if>
  330. </xsl:template>
  331. <xsl:template match="selectValue">
  332. <xsl:if test="@name">
  333. <xsl:call-template name="atomEntry">
  334. <xsl:with-param name="entryID">
  335. <xsl:value-of select="@name"/>
  336. </xsl:with-param>
  337. <xsl:with-param name="entryType">selectValue</xsl:with-param>
  338. <xsl:with-param name="entryIcon">selectvalue</xsl:with-param>
  339. </xsl:call-template>
  340. </xsl:if>
  341. </xsl:template>
  342. <xsl:template match="selectWithSearch">
  343. <xsl:if test="@name">
  344. <xsl:call-template name="atomEntry">
  345. <xsl:with-param name="entryID">
  346. <xsl:value-of select="@name"/>
  347. </xsl:with-param>
  348. <xsl:with-param name="entryType">selectWithSearch</xsl:with-param>
  349. <xsl:with-param name="entryIcon">selectwithsearch</xsl:with-param>
  350. </xsl:call-template>
  351. </xsl:if>
  352. </xsl:template>
  353. <xsl:template match="selectWithTree">
  354. <xsl:if test="@name">
  355. <xsl:call-template name="atomEntry">
  356. <xsl:with-param name="entryID">
  357. <xsl:value-of select="@name"/>
  358. </xsl:with-param>
  359. <xsl:with-param name="entryType">selectWithTree</xsl:with-param>
  360. <xsl:with-param name="entryIcon">selectwithtree</xsl:with-param>
  361. </xsl:call-template>
  362. </xsl:if>
  363. </xsl:template>
  364. <xsl:template match="generatedPrompt">
  365. <xsl:if test="@name">
  366. <xsl:call-template name="atomEntry">
  367. <xsl:with-param name="entryID">
  368. <xsl:value-of select="@name"/>
  369. </xsl:with-param>
  370. <xsl:with-param name="entryType">generatedPrompt</xsl:with-param>
  371. <xsl:with-param name="entryIcon">generatedprompt</xsl:with-param>
  372. </xsl:call-template>
  373. </xsl:if>
  374. </xsl:template>
  375. <xsl:template match="fieldSet">
  376. <xsl:apply-templates select="contents/*"/>
  377. </xsl:template>
  378. <xsl:template match="conditionalBlocks">
  379. <xsl:variable name="conditionalBlocksNum">
  380. <xsl:value-of select="1+count(preceding::conditionalBlocks)" />
  381. </xsl:variable>
  382. <xsl:if test="conditionalBlockDefault/contents">
  383. <xsl:variable name="blockName">
  384. <xsl:value-of select="concat('defaultBlock_',$conditionalBlocksNum)"/>
  385. </xsl:variable>
  386. <xsl:variable name="blockTitle">
  387. <xsl:choose>
  388. <xsl:when test="function-available('ccs:getLocalizedName')">
  389. <xsl:value-of select="ccs:getLocalizedName('DEFAULT_BLOCK', $userLocale)"/>
  390. </xsl:when>
  391. <xsl:otherwise>DEFAULT_BLOCK</xsl:otherwise>
  392. </xsl:choose>
  393. </xsl:variable>
  394. <xsl:element name="subFeed">
  395. <xsl:attribute name="name"><xsl:value-of select="$blockName"/></xsl:attribute>
  396. <xsl:attribute name="type">conditionalBlock</xsl:attribute>
  397. <atom:feed>
  398. <atom:id>
  399. <xsl:value-of select="concat('tag:cognos.com,2007:','@report_id@/', $blockName, ':conditionalBlock')"/>
  400. </atom:id>
  401. <atom:title>
  402. <xsl:value-of select="$blockTitle"/>
  403. </atom:title>
  404. <atom:updated>@report_updated@</atom:updated>
  405. <atom:author>
  406. <atom:name>@report_author@</atom:name>
  407. </atom:author>
  408. <atom:link rel="self" type="application/atom+xml">
  409. <xsl:attribute name="href"><xsl:value-of select="concat('@report_gateway@/rds/atom_ds/report/@report_storeid@?selection=',$blockName,'&amp;eltype=conditionalBlock','&amp;v=@requestversion@')"/></xsl:attribute>
  410. </atom:link>
  411. <xsl:apply-templates select="conditionalBlockDefault/contents/*"/>
  412. </atom:feed>
  413. </xsl:element>
  414. <xsl:call-template name="atomVirtualEntry">
  415. <xsl:with-param name="entryID">
  416. <xsl:value-of select="$blockName"/>
  417. </xsl:with-param>
  418. <xsl:with-param name="entryType">conditionalBlock</xsl:with-param>
  419. <xsl:with-param name="entryIcon">conditionalblock</xsl:with-param>
  420. <xsl:with-param name="entryName">
  421. <xsl:value-of select="$blockTitle"/>
  422. </xsl:with-param>
  423. </xsl:call-template>
  424. </xsl:if>
  425. <xsl:for-each select="./conditionalBlockCases/conditionalBlock">
  426. <xsl:variable name="blockName">
  427. <xsl:value-of select="concat('conditionalBlock_',../@refVariable,'_',@refVariableValue,'_',$conditionalBlocksNum)"/>
  428. </xsl:variable>
  429. <xsl:element name="subFeed">
  430. <xsl:attribute name="name"><xsl:value-of select="$blockName"/></xsl:attribute>
  431. <xsl:attribute name="type">conditionalBlock</xsl:attribute>
  432. <atom:feed>
  433. <atom:id>
  434. <xsl:value-of select="concat('tag:cognos.com,2007:','@report_id@/', @name, ':conditionalBlock')"/>
  435. </atom:id>
  436. <atom:title>
  437. <xsl:value-of select="@refVariableValue"/>
  438. </atom:title>
  439. <atom:updated>@report_updated@</atom:updated>
  440. <atom:author>
  441. <atom:name>@report_author@</atom:name>
  442. </atom:author>
  443. <atom:link rel="self" type="application/atom+xml">
  444. <xsl:attribute name="href"><xsl:value-of select="concat('@report_gateway@/rds/atom_ds/report/@report_storeid@?selection=',$blockName,'&amp;eltype=conditionalBlock','&amp;v=@requestversion@')"/></xsl:attribute>
  445. </atom:link>
  446. <xsl:apply-templates select="contents/*"/>
  447. </atom:feed>
  448. </xsl:element>
  449. <xsl:call-template name="atomVirtualEntry">
  450. <xsl:with-param name="entryID">
  451. <xsl:value-of select="$blockName"/>
  452. </xsl:with-param>
  453. <xsl:with-param name="entryType">conditionalBlock</xsl:with-param>
  454. <xsl:with-param name="entryIcon">conditionalblock</xsl:with-param>
  455. <xsl:with-param name="entryName">
  456. <xsl:value-of select="@refVariableValue"/>
  457. </xsl:with-param>
  458. </xsl:call-template>
  459. </xsl:for-each>
  460. </xsl:template>
  461. <xsl:template match="layoutComponentRef">
  462. <xsl:if test="@name">
  463. <xsl:call-template name="atomEntry">
  464. <xsl:with-param name="entryID">
  465. <xsl:value-of select="concat(@name, '_REF')"/>
  466. </xsl:with-param>
  467. <xsl:with-param name="entryType">layout_component_ref</xsl:with-param>
  468. </xsl:call-template>
  469. </xsl:if>
  470. </xsl:template>
  471. <xsl:template match="CMMMap">
  472. <xsl:if test="@name">
  473. <xsl:call-template name="atomEntry">
  474. <xsl:with-param name="entryID">
  475. <xsl:value-of select="@name"/>
  476. </xsl:with-param>
  477. <xsl:with-param name="entryType">image</xsl:with-param>
  478. </xsl:call-template>
  479. </xsl:if>
  480. </xsl:template>
  481. <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">
  482. <xsl:if test="@name">
  483. <xsl:variable name="chartName">
  484. <xsl:choose>
  485. <xsl:when test="local-name()='viz'">extviz</xsl:when>
  486. <xsl:otherwise>
  487. <xsl:value-of select="local-name()"/>
  488. </xsl:otherwise>
  489. </xsl:choose>
  490. </xsl:variable>
  491. <xsl:call-template name="atomEntry">
  492. <xsl:with-param name="entryID">
  493. <xsl:value-of select="@name"/>
  494. </xsl:with-param>
  495. <xsl:with-param name="entryIcon">
  496. <xsl:choose>
  497. <xsl:when test="function-available('ccs:toLower')">
  498. <xsl:value-of select="ccs:toLower($chartName)"/>
  499. </xsl:when>
  500. <xsl:otherwise>
  501. <xsl:value-of select="$chartName"/>
  502. </xsl:otherwise>
  503. </xsl:choose>
  504. </xsl:with-param>
  505. <xsl:with-param name="entryType">chart</xsl:with-param>
  506. </xsl:call-template>
  507. </xsl:if>
  508. </xsl:template>
  509. <xsl:template match="singleton">
  510. <xsl:call-template name="atomEntry">
  511. <xsl:with-param name="entryID">
  512. <xsl:choose>
  513. <xsl:when test="contents/textItem/@name">
  514. <xsl:value-of select="contents/textItem/@name"/>
  515. </xsl:when>
  516. <xsl:when test="@name">
  517. <xsl:value-of select="@name"/>
  518. </xsl:when>
  519. <xsl:otherwise>
  520. <xsl:value-of select="local-name()"/>
  521. </xsl:otherwise>
  522. </xsl:choose>
  523. </xsl:with-param>
  524. <xsl:with-param name="entryType">singleton</xsl:with-param>
  525. <xsl:with-param name="entryIcon">singleton</xsl:with-param>
  526. </xsl:call-template>
  527. </xsl:template>
  528. <xsl:template match="*">
  529. <!--Unknown element. Ignore-->
  530. <!--Unknown element. Ignore-->
  531. </xsl:template>
  532. <xsl:template name="atomEntry">
  533. <xsl:param name="entryID"/>
  534. <xsl:param name="entryIcon"/>
  535. <xsl:param name="entryType"/>
  536. <atom:entry>
  537. <atom:id>
  538. <xsl:choose>
  539. <xsl:when test="function-available('ccs:encodeID')">
  540. <xsl:value-of select="concat('tag:cognos.com,2007:@report_id@/',ccs:encodeID($entryID))"/>
  541. </xsl:when>
  542. <xsl:otherwise>
  543. <xsl:value-of select="concat('tag:cognos.com,2007:@report_id@/',$entryID)"/>
  544. </xsl:otherwise>
  545. </xsl:choose>
  546. </atom:id>
  547. <atom:title>
  548. <xsl:choose>
  549. <xsl:when test="$useLocalizedNames = 'true'">
  550. <xsl:choose>
  551. <xsl:when test="function-available('ccs:getLocalizedPartName')">
  552. <xsl:value-of select="ccs:getLocalizedPartName($entryID,$entryType,position(),$userLocale)"/>
  553. </xsl:when>
  554. <xsl:otherwise>
  555. <xsl:value-of select="concat($entryType, position())"/>
  556. </xsl:otherwise>
  557. </xsl:choose>
  558. </xsl:when>
  559. <xsl:otherwise>
  560. <xsl:value-of select="$entryID"/>
  561. </xsl:otherwise>
  562. </xsl:choose>
  563. </atom:title>
  564. <atom:author>
  565. </atom:author>
  566. <atom:author>
  567. <atom:name>@report_author@</atom:name>@report_author_email@
  568. </atom:author>@report_contributor@@report_description@<atom:updated>@report_updated@</atom:updated>
  569. <atom:link>
  570. <xsl:attribute name="rel">http://www.ibm.com/xmlns/prod/cognos/rel/icon16</xsl:attribute>
  571. <xsl:attribute name="type">image/gif</xsl:attribute>
  572. <xsl:choose>
  573. <xsl:when test="$entryIcon">
  574. <xsl:attribute name="href"><xsl:value-of select="concat('@webcontent_root@/icd/feeds/images/', 'icon_',$entryIcon,'.gif')"/></xsl:attribute>
  575. </xsl:when>
  576. <xsl:otherwise>
  577. <xsl:attribute name="href"><xsl:value-of select="concat('@webcontent_root@/icd/feeds/images/', 'icon_',$entryType,'.gif')"/></xsl:attribute>
  578. </xsl:otherwise>
  579. </xsl:choose>
  580. </atom:link>
  581. <atom:link>
  582. <xsl:attribute name="rel">http://www.ibm.com/xmlns/prod/cognos/rel/icon64</xsl:attribute>
  583. <xsl:attribute name="type">image/gif</xsl:attribute>
  584. <xsl:choose>
  585. <xsl:when test="$entryIcon">
  586. <xsl:attribute name="href"><xsl:value-of select="concat('@webcontent_root@/icd/feeds/images/', 'icon_',$entryIcon,'_64.gif')"/></xsl:attribute>
  587. </xsl:when>
  588. <xsl:otherwise>
  589. <xsl:attribute name="href"><xsl:value-of select="concat('@webcontent_root@/icd/feeds/images/', 'icon_',$entryType,'_64.gif')"/></xsl:attribute>
  590. </xsl:otherwise>
  591. </xsl:choose>
  592. </atom:link>
  593. <atom:link>
  594. <xsl:attribute name="rel">http://www.ibm.com/xmlns/prod/cognos/rel/thumbnail</xsl:attribute>
  595. <xsl:attribute name="type">image/gif</xsl:attribute>
  596. <xsl:choose>
  597. <xsl:when test="$entryIcon">
  598. <xsl:attribute name="href">
  599. <xsl:choose>
  600. <xsl:when test="function-available('ccs:uriEncodeID')">
  601. <xsl:value-of select="concat('@report_gateway@/rds/thumbnail/report/@report_storeid@?deficon=icon_',$entryIcon,'_64.gif&amp;selection=',ccs:uriEncodeID($entryID,$hexEncodeUnderscores),'&amp;v=@requestversion@')"/>
  602. </xsl:when>
  603. <xsl:otherwise>
  604. <xsl:value-of select="concat('@report_gateway@/rds/thumbnail/report/@report_storeid@?deficon=icon_',$entryIcon,'_64.gif&amp;selection=',$entryID,'&amp;v=@requestversion@')"/>
  605. </xsl:otherwise>
  606. </xsl:choose>
  607. </xsl:attribute>
  608. </xsl:when>
  609. <xsl:otherwise>
  610. <xsl:attribute name="href">
  611. <xsl:choose>
  612. <xsl:when test="function-available('ccs:uriEncodeID')">
  613. <xsl:value-of select="concat('@report_gateway@/rds/thumbnail/report/@report_storeid@?deficon=icon_',$entryType,'_64.gif&amp;selection=',ccs:uriEncodeID($entryID,$hexEncodeUnderscores),'&amp;v=@requestversion@')"/>
  614. </xsl:when>
  615. <xsl:otherwise>
  616. <xsl:value-of select="concat('@report_gateway@/rds/thumbnail/report/@report_storeid@?deficon=icon_',$entryType,'_64.gif&amp;selection=',$entryID,'&amp;v=@requestversion@')"/>
  617. </xsl:otherwise>
  618. </xsl:choose>
  619. </xsl:attribute>
  620. </xsl:otherwise>
  621. </xsl:choose>
  622. </atom:link>
  623. <atom:link>
  624. <xsl:attribute name="rel">alternate</xsl:attribute>
  625. <xsl:attribute name="type">application/x-ldx+xml</xsl:attribute>
  626. <xsl:attribute name="href"><xsl:choose><xsl:when test="function-available('ccs:uriEncodeID')"><xsl:value-of select="concat('@report_gateway@/rds/reportData/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/reportData/report/@report_storeid@?selection=',$entryID,'&amp;version=LATEST','&amp;v=@requestversion@')"/></xsl:otherwise></xsl:choose></xsl:attribute>
  627. </atom:link>
  628. <atom:link>
  629. <xsl:attribute name="rel">alternate</xsl:attribute>
  630. <xsl:attribute name="type">application/x-pagedldx+xml</xsl:attribute>
  631. <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>
  632. </atom:link>
  633. <cm:objectClass>reportpart</cm:objectClass>
  634. <cm:location>
  635. <xsl:value-of select="concat('@report_location@ > ', $entryID)"/>
  636. </cm:location>
  637. <d:type>
  638. <xsl:value-of select="$entryType"/>
  639. </d:type>
  640. <d:storeID>@report_storeid@</d:storeID>
  641. <d:partID>
  642. <xsl:value-of select="$entryID"/>
  643. </d:partID>
  644. </atom:entry>
  645. </xsl:template>
  646. <xsl:template name="atomVirtualEntry">
  647. <xsl:param name="entryID"/>
  648. <xsl:param name="entryIcon"/>
  649. <xsl:param name="entryType"/>
  650. <xsl:param name="entryName"/>
  651. <atom:entry>
  652. <atom:id>
  653. <xsl:choose>
  654. <xsl:when test="function-available('ccs:encodeID')">
  655. <xsl:value-of select="concat('tag:cognos.com,2007:@report_id@/',ccs:encodeID($entryID), ':', $entryType)"/>
  656. </xsl:when>
  657. <xsl:otherwise>
  658. <xsl:value-of select="concat('tag:cognos.com,2007:@report_id@/',$entryID, ':', $entryType)"/>
  659. </xsl:otherwise>
  660. </xsl:choose>
  661. </atom:id>
  662. <atom:title>
  663. <xsl:value-of select="$entryName"/>
  664. </atom:title>
  665. <atom:author>
  666. <atom:name>@report_author@</atom:name>@report_author_email@
  667. </atom:author>@report_contributor@@report_description@<atom:updated>@report_updated@</atom:updated>
  668. <atom:link>
  669. <xsl:attribute name="rel">http://www.ibm.com/xmlns/prod/cognos/rel/icon16</xsl:attribute>
  670. <xsl:attribute name="type">image/gif</xsl:attribute>
  671. <xsl:attribute name="href"><xsl:value-of select="concat('@webcontent_root@/icd/feeds/images/', 'icon_',$entryIcon,'.gif')"/></xsl:attribute>
  672. </atom:link>
  673. <atom:link>
  674. <xsl:attribute name="rel">http://www.ibm.com/xmlns/prod/cognos/rel/icon64</xsl:attribute>
  675. <xsl:attribute name="type">image/gif</xsl:attribute>
  676. <xsl:attribute name="href"><xsl:value-of select="concat('@webcontent_root@/icd/feeds/images/', 'icon_',$entryIcon,'_64.gif')"/></xsl:attribute>
  677. </atom:link>
  678. <atom:link>
  679. <xsl:attribute name="rel">alternate</xsl:attribute>
  680. <xsl:attribute name="type">application/atom+xml</xsl:attribute>
  681. <xsl:attribute name="href"><xsl:choose><xsl:when test="function-available('ccs:uriEncodeID')"><xsl:value-of select="concat('@report_gateway@/rds/atom_ds/report/@report_storeid@?selection=',ccs:uriEncodeID($entryID,$hexEncodeUnderscores),'&amp;eltype=',$entryType,'&amp;v=@requestversion@')"/></xsl:when><xsl:otherwise><xsl:value-of select="concat('@report_gateway@/rds/atom_ds/report/@report_storeid@?selection=',$entryID,'&amp;eltype=',$entryType,'&amp;v=@requestversion@')"/></xsl:otherwise></xsl:choose></xsl:attribute>
  682. </atom:link>
  683. <atom:link>
  684. <xsl:attribute name="rel">alternate</xsl:attribute>
  685. <xsl:attribute name="type">application/x-pagedldx+xml</xsl:attribute>
  686. <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>
  687. </atom:link>
  688. <d:type>
  689. <xsl:value-of select="$entryType"/>
  690. </d:type>
  691. <d:storeID>@report_storeid@</d:storeID>
  692. <d:partID>
  693. <xsl:value-of select="$entryID"/>
  694. </d:partID>
  695. </atom:entry>
  696. </xsl:template>
  697. <xsl:template name="atomPageEntry">
  698. <xsl:param name="entryID"/>
  699. <xsl:param name="entryIcon"/>
  700. <atom:entry>
  701. <atom:id>
  702. <xsl:choose>
  703. <xsl:when test="function-available('ccs:encodeID')">
  704. <xsl:value-of select="concat('tag:cognos.com,2007:@report_id@/',ccs:encodeID($entryID))"/>
  705. </xsl:when>
  706. <xsl:otherwise>
  707. <xsl:value-of select="concat('tag:cognos.com,2007:@report_id@/',$entryID)"/>
  708. </xsl:otherwise>
  709. </xsl:choose>
  710. </atom:id>
  711. <atom:title>
  712. <xsl:value-of select="$entryID"/>
  713. </atom:title>
  714. <atom:author>
  715. <atom:name>@report_author@</atom:name>@report_author_email@
  716. </atom:author>@report_contributor@@report_description@<atom:updated>@report_updated@</atom:updated>
  717. <atom:link>
  718. <xsl:attribute name="rel">http://www.ibm.com/xmlns/prod/cognos/rel/icon16</xsl:attribute>
  719. <xsl:attribute name="type">image/gif</xsl:attribute>
  720. <xsl:attribute name="href"><xsl:value-of select="concat('@webcontent_root@/icd/feeds/images/', 'icon_',$entryIcon,'.gif')"/></xsl:attribute>
  721. </atom:link>
  722. <atom:link>
  723. <xsl:attribute name="rel">http://www.ibm.com/xmlns/prod/cognos/rel/icon64</xsl:attribute>
  724. <xsl:attribute name="type">image/gif</xsl:attribute>
  725. <xsl:attribute name="href"><xsl:value-of select="concat('@webcontent_root@/icd/feeds/images/', 'icon_',$entryIcon,'_64.gif')"/></xsl:attribute>
  726. </atom:link>
  727. <atom:link>
  728. <xsl:attribute name="rel">alternate</xsl:attribute>
  729. <xsl:attribute name="type">application/atom+xml</xsl:attribute>
  730. <xsl:attribute name="href"><xsl:choose><xsl:when test="function-available('ccs:uriEncodeID')"><xsl:value-of select="concat('@report_gateway@/rds/atom_ds/report/@report_storeid@?selection=',ccs:uriEncodeID($entryID,$hexEncodeUnderscores),'&amp;eltype=page','&amp;v=@requestversion@')"/></xsl:when><xsl:otherwise><xsl:value-of select="concat('@report_gateway@/rds/atom_ds/report/@report_storeid@?selection=',$entryID,'&amp;eltype=page','&amp;v=@requestversion@')"/></xsl:otherwise></xsl:choose></xsl:attribute>
  731. </atom:link>
  732. <atom:link>
  733. <xsl:attribute name="rel">alternate</xsl:attribute>
  734. <xsl:attribute name="type">application/x-ldx+xml</xsl:attribute>
  735. <xsl:attribute name="href"><xsl:choose><xsl:when test="function-available('ccs:uriEncodeID')"><xsl:value-of select="concat('@report_gateway@/rds/reportData/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/reportData/report/@report_storeid@?selection=',$entryID,'&amp;version=LATEST','&amp;v=@requestversion@')"/></xsl:otherwise></xsl:choose></xsl:attribute>
  736. </atom:link>
  737. <atom:link>
  738. <xsl:attribute name="rel">alternate</xsl:attribute>
  739. <xsl:attribute name="type">application/x-pagedldx+xml</xsl:attribute>
  740. <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>
  741. </atom:link>
  742. <d:type>page</d:type>
  743. <d:storeID>@report_storeid@</d:storeID>
  744. <d:partID>
  745. <xsl:value-of select="$entryID"/>
  746. </d:partID>
  747. </atom:entry>
  748. </xsl:template>
  749. </xsl:stylesheet>