spec2atom_dsFlat.xsl 31 KB

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