system_upgrade.xslt 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: ps
  5. (C) Copyright IBM Corp. 2005, 2013
  6. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. -->
  8. <!--
  9. Copyright (C) 2008 Cognos ULC, an IBM Company. All rights reserved.
  10. Cognos (R) is a trademark of Cognos ULC, (formerly Cognos Incorporated).
  11. -->
  12. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  13. <xsl:output method="xml" encoding="UTF-8" indent="yes" />
  14. <!-- Load the old portal's system.xml from the baltic install -->
  15. <xsl:variable name="portal_crn_system" select="document('portal/system.xml')/system"/>
  16. <xsl:variable name="system_version">
  17. <xsl:choose>
  18. <xsl:when test="string(/system/@version) = ''">
  19. <xsl:text>2.0</xsl:text>
  20. </xsl:when>
  21. <xsl:otherwise>
  22. <xsl:value-of select="/system/@version"/>
  23. </xsl:otherwise>
  24. </xsl:choose>
  25. </xsl:variable>
  26. <xsl:template match="/">
  27. <xsl:comment>
  28. Licensed Materials - Property of IBM
  29. IBM Cognos Products: ps
  30. (C) Copyright IBM Corp. 2005, 2013
  31. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  32. Copyright (C) 2008 Cognos ULC, an IBM Company. All rights reserved.
  33. Cognos (R) is a trademark of Cognos ULC, (formerly Cognos Incorporated).
  34. </xsl:comment>
  35. <system version="4.4">
  36. <!-- The upgrade templates add new params that are in the current system but were never in the system being upgraded from.
  37. -->
  38. <xsl:if test="$system_version &lt; 2.1">
  39. <xsl:call-template name="upgrade_from_2_0"/>
  40. </xsl:if>
  41. <xsl:if test="$system_version &lt; 3.0">
  42. <xsl:call-template name="upgrade_from_2_0_to_2_2"/>
  43. </xsl:if>
  44. <xsl:if test="$system_version &lt; 3.1">
  45. <xsl:call-template name="upgrade_from_2_0_to_3_0"/>
  46. </xsl:if>
  47. <xsl:if test="$system_version &lt; 4.0">
  48. <xsl:call-template name="upgrade_from_2_0_to_4_0"/>
  49. </xsl:if>
  50. <xsl:if test="$system_version &lt; 4.3">
  51. <xsl:call-template name="upgrade_from_2_0_to_4_3"/>
  52. </xsl:if>
  53. <xsl:apply-templates select="system/child::node()"/>
  54. </system>
  55. </xsl:template>
  56. <!-- Remove deprecated params. This is safe to be done unconditionally for all upgrade paths. -->
  57. <xsl:template match="param[@name='default-skin']"/>
  58. <xsl:template match="param[@name='webcontent']"/>
  59. <xsl:template match="param[@name='skin-root']"/>
  60. <xsl:template match="param[@name='pat-url']"/>
  61. <xsl:template match="param[@name='defaultPortalPreferences']/pref[@name='refresh']"/>
  62. <!-- Ensure param[@name='series7']/encoding has a value. If no value is present, a default of UTF-8 is used.
  63. This is safe to be done unconditionally for all upgrade paths -->
  64. <xsl:template match="param[@name='series7']/encoding">
  65. <encoding>
  66. <xsl:choose>
  67. <xsl:when test="string(.) != ''">
  68. <xsl:value-of select="string(.)"/>
  69. </xsl:when>
  70. <xsl:otherwise>UTF-8</xsl:otherwise>
  71. </xsl:choose>
  72. </encoding>
  73. </xsl:template>
  74. <!-- =================================================================================== -->
  75. <xsl:template name="upgrade_from_2_0">
  76. <xsl:if test="not(/system/param[@name='COGNOSHome'])">
  77. <xsl:comment>This is the query string required to redirect to the users home</xsl:comment>
  78. <param name="COGNOSHome">b_action=xts.run&amp;m=portal/main.xts</param>
  79. </xsl:if>
  80. </xsl:template>
  81. <!-- =================================================================================== -->
  82. <xsl:template name="upgrade_from_2_0_to_2_2">
  83. <xsl:comment>Supported document formats </xsl:comment>
  84. <param name="documentFormats">
  85. <format id="application/vnd.coc-wd" extension="doc"/>
  86. <format id="application/vnd.coc-xl" extension="xls"/>
  87. <format id="application/vnd.coc-pp" extension="ppt"/>
  88. <format id="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" extension="xlsx"/>
  89. <format id="application/vnd.openxmlformats-officedocument.presentationml.presentation" extension="pptx"/>
  90. <format id="application/vnd.openxmlformats-officedocument.wordprocessingml.document" extension="docx"/>
  91. <format id="application/vnd.coc-xl.2007.macroEnabled" extension="xlsm"/>
  92. <format id="application/vnd.coc-wd.2007.macroEnabled" extension="docm"/>
  93. <format id="application/vnd.coc-pp.2007.macroEnabled" extension="pptm"/>
  94. <format id="application/vnd.ms-excel.sheet.binary.macroEnabled.12" extension="xlsb"/>
  95. <format id="application/vnd.ms-excel.sheet.macroEnabled.12" extension="xlsm"/>
  96. </param>
  97. </xsl:template>
  98. <!-- =================================================================================== -->
  99. <xsl:template name="upgrade_from_2_0_to_3_0">
  100. <param name="capabilities">
  101. <capability name="canUseEventStudio" browser="ie moz"/>
  102. <capability name="canUseAnalysisStudio" browser="ie moz"/>
  103. <capability name="canUseControllerStudio" browser="ie"/>
  104. <capability name="canUseMetricsManager" browser="ie moz"/>
  105. <capability name="canUseMetricsManagerAdministration" browser="ie moz"/>
  106. <capability name="canUseQueryStudio" browser="ie moz"/>
  107. <capability name="canUseAdaptiveAnalyticsAdministration" browser="ie moz"/>
  108. <capability name="canUseReportStudio" browser="ie moz"/>
  109. <capability name="canUseDashboardViewer" browser="ie moz chrome safari"/>
  110. <capability name="canUsePowerPlay" browser="ie moz"/>
  111. <capability name="canUseAdministrationPortal" browser="ie moz"/>
  112. <capability name="canUseMyActivitiesAndSchedule" browser="ie moz"/>
  113. <capability name="canUseMyInbox" browser="ie moz"/>
  114. <capability name="canUseAdaptiveAnalytics" browser="ie moz"/>
  115. <capability name="canUseEV" browser="ie moz"/>
  116. </param>
  117. <param name="cognosNowCubeFileSuffix">/now/RelXMLAProvider.jsp</param>
  118. <param name="integerMaximumValue">2147483647</param>
  119. <!-- was missed in 3.0 (present in all other versions) so if upgrading from 3.0 need to add
  120. <xsl:if test="not(/system/param[@name='pdfDrilBaltic'])">-->
  121. <xsl:comment> To enable drillthrough support for Baltic saved PDF add the following pdfDrilBaltic param and set it to true
  122. param name="pdfDrilBaltic">true</xsl:comment>
  123. </xsl:template>
  124. <!-- =================================================================================== -->
  125. <xsl:template name="upgrade_from_2_0_to_4_3">
  126. <xsl:comment>Set this to false to force CC to launch active reports as standalone application (10.2 default), not in expanded mode.</xsl:comment>
  127. <param name="allowExpandedMHT">true</param>
  128. <xsl:comment>Set this to false to show the expanded active report in the same window as cognos connection. Ignored if allowExpandedMHT is false</xsl:comment>
  129. <param name="expandMHTnewWindow">true</param>
  130. </xsl:template>
  131. <!-- =================================================================================== -->
  132. <xsl:template name="upgrade_from_2_0_to_4_0">
  133. <xsl:comment> Custom login/logoff configurations</xsl:comment>
  134. <param name="custom-auth">
  135. <logoff enabled="false">
  136. <xsl:comment> URL to direct to upon logoff. Note: the 'redirect-url' url specified is subject to validation at runtime </xsl:comment>
  137. <redirect-url></redirect-url>
  138. </logoff>
  139. <logon enabled="false">
  140. <xsl:comment>
  141. At runtime, template name is constructed as base-template-name_'productLocale'.
  142. If base-template-name_'productLocale' does not exist, base-template-name is used.
  143. Note 1: Template filename extension is expected to be .xhtml
  144. Note 2: Template is relative to ../webcontent/ps/login
  145. </xsl:comment>
  146. <base-template-name></base-template-name> <xsl:comment>e.g.: my_customtemplate_1 </xsl:comment>
  147. </logon>
  148. </param>
  149. </xsl:template>
  150. <!-- =================================================================================== -->
  151. <!-- Update reportFormats (attributes and objects) ================================================= -->
  152. <xsl:template match="param[@name='reportFormats']/format[@id='HTML']">
  153. <format>
  154. <xsl:choose>
  155. <xsl:when test="$system_version &lt; 4.1">
  156. <xsl:copy-of select="@*[name()!='downloadable']"/>
  157. <xsl:if test="@*[name()='downloadable' and string(.)!='false']">
  158. <xsl:copy-of select="@*[name()='downloadable']"/>
  159. </xsl:if>
  160. </xsl:when>
  161. <xsl:otherwise><xsl:copy-of select="@*"/></xsl:otherwise>
  162. </xsl:choose>
  163. </format>
  164. </xsl:template>
  165. <xsl:template match="param[@name='reportFormats']/format[@id='XHTML']">
  166. <format>
  167. <xsl:choose>
  168. <xsl:when test="$system_version &lt; 4.1">
  169. <xsl:copy-of select="@*[name()!='downloadable']"/>
  170. <xsl:if test="@*[name()='downloadable' and string(.)!='false']">
  171. <xsl:copy-of select="@*[name()='downloadable']"/>
  172. </xsl:if>
  173. </xsl:when>
  174. <xsl:otherwise><xsl:copy-of select="@*"/></xsl:otherwise>
  175. </xsl:choose>
  176. </format>
  177. </xsl:template>
  178. <xsl:template match="param[@name='reportFormats']/format[@id='singleXLS']">
  179. <format>
  180. <xsl:choose>
  181. <xsl:when test="$system_version &lt; 4.0">
  182. <attribute name="id">singleXLS</attribute>
  183. <attribute name="browserHide">safari</attribute>
  184. <attribute name="downloadable">true</attribute>
  185. <attribute name="appMode"/> <!--Updating appMode to empty-->
  186. <attribute name="extension">xls</attribute>
  187. </xsl:when>
  188. <xsl:otherwise>
  189. <xsl:copy-of select="@*"/>
  190. </xsl:otherwise>
  191. </xsl:choose>
  192. </format>
  193. </xsl:template>
  194. <xsl:template match="param[@name='reportFormats']/format[@id='XLS']">
  195. <format>
  196. <xsl:choose>
  197. <xsl:when test="$system_version &lt; 4.0">
  198. <attribute name="id">XLS</attribute>
  199. <attribute name="browserHide">safari moz other</attribute>
  200. <attribute name="downloadable">false</attribute>
  201. <attribute name="appMode"/> <!--Updating appMode to empty-->
  202. <attribute name="cafaction">true</attribute>
  203. </xsl:when>
  204. <xsl:otherwise>
  205. <xsl:copy-of select="@*"/>
  206. </xsl:otherwise>
  207. </xsl:choose>
  208. </format>
  209. </xsl:template>
  210. <xsl:template match="param[@name='reportFormats']/format[@id='PDF']">
  211. <format>
  212. <xsl:copy-of select="@*"/>
  213. <xsl:if test="$system_version &lt; 3.0">
  214. <attribute name="extension">pdf</attribute>
  215. </xsl:if>
  216. </format>
  217. </xsl:template>
  218. <xsl:template match="param[@name='reportFormats']/format[@id='XLWA']">
  219. <format>
  220. <xsl:copy-of select="@*"/>
  221. <xsl:if test="$system_version &lt; 3.0">
  222. <attribute name="extension">xls</attribute>
  223. <attribute name="mime">application/vnd.ms-excel</attribute>
  224. </xsl:if>
  225. </format>
  226. </xsl:template>
  227. <xsl:template match="param[@name='reportFormats']/format[@id='XML']">
  228. <format>
  229. <xsl:copy-of select="@*"/>
  230. <xsl:if test="$system_version &lt; 3.0">
  231. <attribute name="extension">xml</attribute>
  232. </xsl:if>
  233. </format>
  234. </xsl:template>
  235. <xsl:template match="param[@name='reportFormats']/format[@id='CSV']">
  236. <format>
  237. <xsl:copy-of select="@*"/>
  238. <xsl:if test="$system_version &lt; 3.0">
  239. <attribute name="extension">csv</attribute>
  240. </xsl:if>
  241. </format>
  242. </xsl:template>
  243. <xsl:template match="param[@name='reportFormats']">
  244. <param name="reportFormats">
  245. <xsl:if test="$system_version &lt; 4.2">
  246. <format id="xlsxData" browserHide="safari" downloadable="true" appMode="basic adv rv" extension="xlsx" />
  247. </xsl:if>
  248. <xsl:if test="$system_version &lt; 3.0">
  249. <format id="spreadsheetML" browserHide="safari" downloadable="true" appMode="basic adv rv" extension="xlsx"/>
  250. </xsl:if>
  251. <xsl:apply-templates/>
  252. </param>
  253. </xsl:template>
  254. <!-- End of update reportFormats (attributes and objects) ================================================= -->
  255. <!-- =========== Update capabilities =============================================================== -->
  256. <!-- This will only catch capabilities if they are in the system xml -->
  257. <xsl:template match="param[@name='capabilities']">
  258. <param name="capabilities">
  259. <xsl:if test="$system_version &gt;= 4.3">
  260. <xsl:copy-of select="*"/>
  261. </xsl:if>
  262. <xsl:if test="$system_version &lt; 4.3">
  263. <xsl:copy-of select="*[@name!='canUseReportStudio']"/>
  264. <capability name="canUseReportStudio" browser="ie moz chrome safari"/>
  265. </xsl:if>
  266. <!-- need to add moz to browser for canUseEV and chrome|safari for dashboard for certain versions -->
  267. <xsl:if test="$system_version &lt; 4.2">
  268. <xsl:copy-of select="*[@name!='canUseEV' and @name!='canUseDashboardViewer']"/>
  269. <capability name="canUseDashboardViewer" browser="ie moz chrome safari"/>
  270. <capability name="canUseEV" browser="ie moz"/>
  271. </xsl:if>
  272. <xsl:if test="$system_version &lt; 4.2">
  273. <capability name="canUsePowerPlay" browser="ie moz"/>
  274. <capability name="canUseCognosInsight" browser="ie moz chrome safari"/>
  275. </xsl:if>
  276. <xsl:if test="$system_version &lt; 4.1">
  277. <capability name="canUseReportStudio" browser="ie moz"/>
  278. <capability name="canUseAdministrationPortal" browser="ie moz"/>
  279. <capability name="canUseMyActivitiesAndSchedule" browser="ie moz"/>
  280. <capability name="canUseMyInbox" browser="ie moz"/>
  281. </xsl:if>
  282. <xsl:if test="$system_version &lt; 4.0">
  283. <capability name="canUseAdaptiveAnalytics" browser="ie moz"/>
  284. </xsl:if>
  285. </param>
  286. </xsl:template>
  287. <xsl:template match="param[@name='documentFormats']">
  288. <param name="documentFormats">
  289. <xsl:copy-of select="*"/>
  290. <xsl:if test="$system_version &lt; 4.0">
  291. <format id="application/vnd.coc-xl.2007.macroEnabled" extension="xlsm"/>
  292. <format id="application/vnd.coc-wd.2007.macroEnabled" extension="docm"/>
  293. <format id="application/vnd.coc-pp.2007.macroEnabled" extension="pptm"/>
  294. </xsl:if>
  295. <xsl:if test="$system_version &lt; 4.1">
  296. <!-- New for 4.1 2010 macro-enabled -->
  297. <format id="application/vnd.ms-excel.sheet.binary.macroEnabled.12" extension="xlsb"/>
  298. <format id="application/vnd.ms-excel.sheet.macroEnabled.12" extension="xlsm"/>
  299. </xsl:if>
  300. </param>
  301. </xsl:template>
  302. <!-- ======================================================================================================================= -->
  303. <xsl:template match="param[@name='CCHome']">
  304. <xsl:choose>
  305. <xsl:when test="$system_version &lt; 2.1">
  306. <param name="CCHome">b_action=xts.run&amp;m=portal/cc.xts</param>
  307. </xsl:when>
  308. <xsl:otherwise>
  309. <param>
  310. <xsl:copy-of select="@*"/>
  311. <xsl:apply-templates/>
  312. </param>
  313. </xsl:otherwise>
  314. </xsl:choose>
  315. </xsl:template>
  316. <!-- Copy everything else -->
  317. <xsl:template match="* | comment()">
  318. <xsl:copy>
  319. <xsl:copy-of select="@*"/>
  320. <xsl:apply-templates/>
  321. </xsl:copy>
  322. </xsl:template>
  323. </xsl:stylesheet>