qs.xsl 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. BI and PM: qs
  5. (C) Copyright IBM Corp. 2001, 2017
  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 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:rsext="xalan://com.cognos.reportserver.ext.RSExt" version="1.0" exclude-result-prefixes="xsl rsext">
  13. <xsl:param name="CVDisableDrill" select="''"/>
  14. <xsl:include href="V5environment.xsl"/>
  15. <xsl:include href="V5ReportEngine.xsl"/>
  16. <!-- Include needed for prompting -->
  17. <xsl:include href="../../ps/prompting/p_include_V5ParamSafe.xsl"/>
  18. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
  19. <xsl:variable name="promptLocale" select="$contentLocale"/>
  20. <xsl:variable name="promptFormName" select="'formWarpRequest'"/>
  21. <xsl:template match="/Document">
  22. <!-- Copyright (C) 2008 Cognos ULC, an IBM Company. All rights reserved. -->
  23. <!-- Cognos (R) is a trademark of Cognos ULC, (formerly Cognos Incorporated). -->
  24. <xsl:call-template name="chartConfig"/>
  25. <!-- Add prompt control javascript and style sheets -->
  26. <xsl:call-template name="getPromptHeadIncludes">
  27. <xsl:with-param name="promptLocale" select="$promptLocale"/>
  28. <xsl:with-param name="promptContentLocale" select="$contentLocale"/>
  29. </xsl:call-template>
  30. <xsl:apply-templates select="/Document/styleOptions"/>
  31. <xsl:call-template name="drillTargetsSetup"/>
  32. <xsl:call-template name="addSelectionController"/>
  33. <xsl:apply-templates select="META-DATA"/>
  34. <xsl:apply-templates select="CONTEXT-DATA"/>
  35. <xsl:apply-templates select="DATA"/>
  36. <xsl:call-template name="dropIndicators"/>
  37. <!--
  38. <textarea><htmlFragment><xsl:copy-of select="/"/></htmlFragment></textarea>
  39. -->
  40. </xsl:template>
  41. <xsl:template match="META-DATA">
  42. <xsl:text disable-output-escaping="yes">
  43. &lt;script type="text/javascript">
  44. </xsl:text>
  45. <xsl:for-each select="Block">
  46. <xsl:text>oCVSC</xsl:text>
  47. <xsl:value-of select="$CognosViewerID"/>
  48. <xsl:text>.addMetaData(</xsl:text>
  49. <xsl:value-of select="." disable-output-escaping="yes"/>
  50. <xsl:text>);</xsl:text>
  51. </xsl:for-each>
  52. <xsl:text>oCVSC</xsl:text>
  53. <xsl:value-of select="$CognosViewerID"/>
  54. <xsl:text>.setupMetaDataArray(</xsl:text>
  55. <xsl:text>{</xsl:text>
  56. <xsl:for-each select="DA">
  57. <xsl:text/>"<xsl:value-of select="rsext:javascriptencode(string(@uid))" disable-output-escaping="yes"/>":[<xsl:text/>
  58. <xsl:text/>"<xsl:value-of select="rsext:javascriptencode(string(@value))" disable-output-escaping="yes"/>",<xsl:text/>
  59. <xsl:text/>"<xsl:value-of select="rsext:javascriptencode(string(@vtype))" disable-output-escaping="yes"/>",<xsl:text/>
  60. <xsl:text/>"<xsl:value-of select="rsext:javascriptencode(string(@dtype))" disable-output-escaping="yes"/>",<xsl:text/>
  61. <xsl:text/>"<xsl:value-of select="rsext:javascriptencode(string(@drill))" disable-output-escaping="yes"/>",<xsl:text/>
  62. <xsl:text/>"<xsl:value-of select="rsext:javascriptencode(string(@hun))" disable-output-escaping="yes"/>",<xsl:text/>
  63. <xsl:text/>"<xsl:value-of select="rsext:javascriptencode(string(@level))" disable-output-escaping="yes"/>"]<xsl:text/>
  64. <xsl:if test="position()!=last()">
  65. <xsl:text>,</xsl:text>
  66. </xsl:if>
  67. </xsl:for-each>
  68. <xsl:text>});</xsl:text>
  69. <xsl:text disable-output-escaping="yes">
  70. &lt;/script>
  71. </xsl:text>
  72. </xsl:template>
  73. <xsl:template match="CONTEXT-DATA">
  74. <xsl:text disable-output-escaping="yes">
  75. &lt;script type="text/javascript">
  76. </xsl:text>
  77. <xsl:for-each select="Block">
  78. <xsl:text>oCVSC</xsl:text>
  79. <xsl:value-of select="$CognosViewerID"/>
  80. <xsl:text>.addContextData(</xsl:text>
  81. <xsl:value-of select="." disable-output-escaping="yes"/>
  82. <xsl:text>);</xsl:text>
  83. </xsl:for-each>
  84. <xsl:text>oCVSC</xsl:text>
  85. <xsl:value-of select="$CognosViewerID"/>
  86. <xsl:text>.setupContextDataArray(</xsl:text>
  87. <xsl:text>{</xsl:text>
  88. <xsl:for-each select="CD">
  89. <xsl:value-of select="rsext:javascriptencode(string(@ctxId))"/>
  90. <xsl:text>:[</xsl:text>
  91. <xsl:text/>"<xsl:value-of select="rsext:javascriptencode(string(@rdi))" disable-output-escaping="yes"/>",<xsl:text/>
  92. <xsl:text/>"<xsl:value-of select="rsext:javascriptencode(string(@useValue))" disable-output-escaping="yes"/>", <xsl:text/>
  93. <xsl:choose>
  94. <xsl:when test="@mun">
  95. <xsl:text/>"<xsl:value-of select="rsext:javascriptencode(string(@mun))" disable-output-escaping="yes"/>",<xsl:text/>
  96. <xsl:text/>"<xsl:value-of select="rsext:javascriptencode(string(@lun))" disable-output-escaping="yes"/>",<xsl:text/>
  97. </xsl:when>
  98. <xsl:otherwise>
  99. <xsl:text/>"","<xsl:value-of select="rsext:javascriptencode(string(@qmid))" disable-output-escaping="yes"/>",<xsl:text/>
  100. </xsl:otherwise>
  101. </xsl:choose>
  102. <xsl:text/>"<xsl:value-of select="rsext:javascriptencode(string(@qry))" disable-output-escaping="yes"/>",<xsl:text/>
  103. <xsl:text/>"<xsl:value-of select="rsext:javascriptencode(string(@dun))" disable-output-escaping="yes"/>"]<xsl:text/>
  104. <xsl:if test="position()!=last()">
  105. <xsl:text>,</xsl:text>
  106. </xsl:if>
  107. </xsl:for-each>
  108. <xsl:text>});</xsl:text>
  109. <xsl:text disable-output-escaping="yes">
  110. &lt;/script>
  111. </xsl:text>
  112. </xsl:template>
  113. <xsl:template name="addDrillEvent">
  114. <xsl:param name="app"/>
  115. <xsl:choose>
  116. <xsl:when test="name(parent::node())='drillTargets'">
  117. <xsl:call-template name="addDrillHandler">
  118. <xsl:with-param name="app"><xsl:value-of select="$app"/></xsl:with-param>
  119. </xsl:call-template>
  120. <xsl:if test="parent::node()/../@isolated='true' or parent::node()/@isolated='true'">
  121. <xsl:attribute name="isolated">true</xsl:attribute>
  122. </xsl:if>
  123. </xsl:when>
  124. <xsl:otherwise>
  125. <xsl:if test="parent::node()/@drillUp = 'true' or parent::node()/@drillDown = 'true' or ./@drillDown='true' or ./@drillUp='true' or parent::node()/../@drillUp = 'true' or parent::node()/../@drillDown = 'true'">
  126. <xsl:variable name="isIsolated">
  127. <xsl:choose>
  128. <xsl:when test="parent::node()/@isolated='true' or ./@isolated='true'">true</xsl:when>
  129. <xsl:otherwise>false</xsl:otherwise>
  130. </xsl:choose>
  131. </xsl:variable>
  132. <xsl:if test="(parent::node()/@drillDown = 'true' or ./@drillDown='true' or parent::node()/../@drillDown = 'true') and $isIsolated='false'">
  133. <xsl:call-template name="addDrillHandler">
  134. <xsl:with-param name="app"><xsl:value-of select="$app"/></xsl:with-param>
  135. </xsl:call-template>
  136. <xsl:attribute name="style">text-decoration: underline; cursor: pointer;</xsl:attribute>
  137. </xsl:if>
  138. <xsl:if test="$isIsolated='true'">
  139. <xsl:attribute name="isolated">true</xsl:attribute>
  140. </xsl:if>
  141. </xsl:if>
  142. </xsl:otherwise>
  143. </xsl:choose>
  144. </xsl:template>
  145. <xsl:template name="drillTargetsSetup"/>
  146. <!--
  147. template : GenEventHandlers
  148. This template adds event handlers to the table cells you can select.
  149. -->
  150. <xsl:template name="GenEventHandlers">
  151. <xsl:if test="@layoutClass='listColumnBody' or @layoutClass='listColumnTitle' or @layoutClass='rowCell' or @layoutClass='crosstabFactCell' or @layoutClass='crosstabNodeMember' or @layoutClass='crosstabCorner' or name()='OCHART'">
  152. <xsl:if test="@tag != ''">
  153. <xsl:attribute name="tag"><xsl:value-of select="@tag"/></xsl:attribute>
  154. </xsl:if>
  155. <xsl:if test="@cid != ''">
  156. <xsl:attribute name="cid"><xsl:value-of select="@cid"/></xsl:attribute>
  157. </xsl:if>
  158. <xsl:if test="@uid != ''">
  159. <xsl:attribute name="uid"><xsl:value-of select="@uid"/></xsl:attribute>
  160. <xsl:attribute name="name">c<xsl:value-of select="$CognosViewerID"/><xsl:value-of select="@uid"/></xsl:attribute>
  161. <xsl:if test="$isIE">
  162. <xsl:attribute name="id">c<xsl:value-of select="$CognosViewerID"/><xsl:value-of select="@uid"/></xsl:attribute>
  163. </xsl:if>
  164. <xsl:choose>
  165. <xsl:when test="$isIE">
  166. <xsl:choose>
  167. <xsl:when test="$CognosViewerID!=''">
  168. <xsl:attribute name="oncontextmenu">oCVSC<xsl:value-of select="$CognosViewerID"/>.pageContextClicked(event); return false;</xsl:attribute>
  169. </xsl:when>
  170. <xsl:otherwise>
  171. <xsl:attribute name="oncontextmenu">CF_pageContextClicked(event); return false;</xsl:attribute>
  172. </xsl:otherwise>
  173. </xsl:choose>
  174. </xsl:when>
  175. <xsl:otherwise>
  176. <xsl:choose>
  177. <xsl:when test="$CognosViewerID!=''">
  178. <xsl:attribute name="onContextMenu">oCVSC<xsl:value-of select="$CognosViewerID"/>.pageContextClicked(event); event.preventDefault();</xsl:attribute>
  179. </xsl:when>
  180. <xsl:otherwise>
  181. <xsl:attribute name="onContextMenu">CF_pageContextClicked(event);event.preventDefault();</xsl:attribute>
  182. </xsl:otherwise>
  183. </xsl:choose>
  184. </xsl:otherwise>
  185. </xsl:choose>
  186. </xsl:if>
  187. <xsl:if test="@class">
  188. <xsl:attribute name="class"><xsl:text>cutQS</xsl:text><xsl:value-of select="@cid"/><xsl:text> </xsl:text><xsl:text>c</xsl:text><xsl:value-of select="$CognosViewerID"/><xsl:value-of select="@uid"/><xsl:text> </xsl:text><xsl:value-of select="@class" disable-output-escaping="yes"/></xsl:attribute>
  189. </xsl:if>
  190. <xsl:if test="name() = 'OCHART'">
  191. <xsl:attribute name="rsvpChart">true</xsl:attribute>
  192. <xsl:if test="$isIE">
  193. <xsl:choose>
  194. <xsl:when test="$CognosViewerID!=''">
  195. <xsl:attribute name="onContextMenu">oCVSC<xsl:value-of select="$CognosViewerID"/>.chartContextMenu(event);event.cancelBubble = true; event.returnValue = false;</xsl:attribute>
  196. </xsl:when>
  197. <xsl:otherwise>
  198. <xsl:attribute name="onContextMenu">CF_chartContextMenu(event);event.cancelBubble = true; event.returnValue = false;</xsl:attribute>
  199. </xsl:otherwise>
  200. </xsl:choose>
  201. </xsl:if>
  202. </xsl:if>
  203. <xsl:if test="@type != ''">
  204. <xsl:attribute name="type"><xsl:value-of select="@type"/></xsl:attribute>
  205. </xsl:if>
  206. <xsl:if test="@ctx != ''">
  207. <xsl:attribute name="ctx"><xsl:value-of select="@ctx"/></xsl:attribute>
  208. </xsl:if>
  209. </xsl:if>
  210. <xsl:if test="(name()='OCHART' and $isIE) or (name()='OMAP' and not($isIE))">
  211. <xsl:if test="$CVDisableDrill != 'true'">
  212. <xsl:choose>
  213. <xsl:when test="$CognosViewerID!=''">
  214. <xsl:attribute name="onmouseover">oCVQS.getDrillMgr().ddc(event);</xsl:attribute>
  215. </xsl:when>
  216. <xsl:otherwise>
  217. <xsl:attribute name="onmouseover">getReportFrame().goDrillManager.ddc(event);</xsl:attribute>
  218. </xsl:otherwise>
  219. </xsl:choose>
  220. </xsl:if>
  221. </xsl:if>
  222. </xsl:template>
  223. <!-- Chart generation code. Overridden here from rsvp.xsl -->
  224. <xsl:template match="*[local-name()='OCHART']" priority="1">
  225. <span>
  226. <xsl:attribute name="tabIndex">0</xsl:attribute>
  227. <xsl:attribute name="chartContainer">true</xsl:attribute>
  228. <xsl:call-template name="GenChartImage"/>
  229. </span>
  230. </xsl:template>
  231. <!--
  232. report title
  233. -->
  234. <xsl:template match="FORM[@class='ta' and @layoutClass='block']">
  235. <div id="reportTitle">
  236. <xsl:call-template name="GenCommonAttributes"/>
  237. <span id="reportTitleLink" onmousedown="goWindowManager.getFeatureManager().launchFeature('EditTitle')" >
  238. <xsl:apply-templates/>
  239. </span>
  240. </div>
  241. </xsl:template>
  242. <!--
  243. report subtitles
  244. -->
  245. <xsl:template match="FORM[@class='ts' and @layoutClass='block']">
  246. <div id="reportSubtitle">
  247. <xsl:call-template name="GenCommonAttributes"/>
  248. <span onmousedown="goWindowManager.getFeatureManager().launchFeature('EditTitle')" class="reportSubtitleStyle">
  249. <xsl:apply-templates/>
  250. </span>
  251. </div>
  252. </xsl:template>
  253. <!-- filterSubtitle icon and place holder-->
  254. <xsl:template match="FORM[@class='ft' and @layoutClass='block']">
  255. <div width="100%">
  256. <xsl:attribute name="id">reportFilter<xsl:value-of select="count(preceding-sibling::FORM[@class='ft' and @layoutClass='block'])"/></xsl:attribute>
  257. <xsl:call-template name="GenCommonAttributes"/>
  258. <span class="fi filterSubtitleStyle">
  259. <xsl:variable name="cancelEvent">
  260. <xsl:choose>
  261. <xsl:when test="$isIE">return false</xsl:when>
  262. <xsl:otherwise>event.preventDefault()</xsl:otherwise>
  263. </xsl:choose>
  264. </xsl:variable>
  265. <xsl:choose>
  266. <xsl:when test="./WRAP/OIMG/@sort!=''">
  267. <xsl:attribute name="style">cursor:default;</xsl:attribute>
  268. <xsl:choose>
  269. <xsl:when test="$isIE">
  270. <xsl:choose>
  271. <xsl:when test="$CognosViewerID!=''">
  272. <xsl:attribute name="oncontextmenu">oCVSC<xsl:value-of select="$CognosViewerID"/>.titleAreaContextMenu(event, 'SORTICON', '<xsl:value-of select="rsext:javascriptencode(string(./WRAP/OIMG/@sort))"/>');return false;</xsl:attribute>
  273. </xsl:when>
  274. <xsl:otherwise>
  275. <xsl:attribute name="oncontextmenu">CF_titleAreaContextMenu(event, 'SORTICON', '<xsl:value-of select="rsext:javascriptencode(string(./WRAP/OIMG/@sort))"/>');return false;</xsl:attribute>
  276. </xsl:otherwise>
  277. </xsl:choose>
  278. </xsl:when>
  279. <xsl:otherwise>
  280. <xsl:choose>
  281. <xsl:when test="$CognosViewerID!=''">
  282. <xsl:attribute name="onContextMenu">oCVSC<xsl:value-of select="$CognosViewerID"/>.titleAreaContextMenu(event, 'SORTICON', '<xsl:value-of select="rsext:javascriptencode(string(./WRAP/OIMG/@sort))"/>');event.preventDefault();</xsl:attribute>
  283. </xsl:when>
  284. <xsl:otherwise>
  285. <xsl:attribute name="onContextMenu">CF_titleAreaContextMenu(event, 'SORTICON', '<xsl:value-of select="rsext:javascriptencode(string(./WRAP/OIMG/@sort))"/>');event.preventDefault();</xsl:attribute>
  286. </xsl:otherwise>
  287. </xsl:choose>
  288. </xsl:otherwise>
  289. </xsl:choose>
  290. </xsl:when>
  291. <xsl:when test="./WRAP/OIMG/@suppress!=''">
  292. <xsl:attribute name="style">cursor:default;</xsl:attribute>
  293. <xsl:choose>
  294. <xsl:when test="$isIE">
  295. <xsl:choose>
  296. <xsl:when test="$CognosViewerID!=''">
  297. <xsl:attribute name="oncontextmenu">oCVSC<xsl:value-of select="$CognosViewerID"/>.titleAreaContextMenu(event, 'SUPPRESSICON', '<xsl:value-of select="rsext:javascriptencode(string(./WRAP/OIMG/@suppress))"/>');return false;</xsl:attribute>
  298. </xsl:when>
  299. <xsl:otherwise>
  300. <xsl:attribute name="oncontextmenu">CF_titleAreaContextMenu(event, 'SUPPRESSICON', '<xsl:value-of select="rsext:javascriptencode(string(./WRAP/OIMG/@suppress))"/>');return false;</xsl:attribute>
  301. </xsl:otherwise>
  302. </xsl:choose>
  303. </xsl:when>
  304. <xsl:otherwise>
  305. <xsl:choose>
  306. <xsl:when test="$CognosViewerID!=''">
  307. <xsl:attribute name="onContextMenu">oCVSC<xsl:value-of select="$CognosViewerID"/>.titleAreaContextMenu(event, 'SUPPRESSICON', '<xsl:value-of select="rsext:javascriptencode(string(./WRAP/OIMG/@suppress))"/>');event.preventDefault();</xsl:attribute>
  308. </xsl:when>
  309. <xsl:otherwise>
  310. <xsl:attribute name="onContextMenu">CF_titleAreaContextMenu(event, 'SUPPRESSICON', '<xsl:value-of select="rsext:javascriptencode(string(./WRAP/OIMG/@suppress))"/>');event.preventDefault();</xsl:attribute>
  311. </xsl:otherwise>
  312. </xsl:choose>
  313. </xsl:otherwise>
  314. </xsl:choose>
  315. </xsl:when>
  316. <xsl:otherwise>
  317. <xsl:attribute name="onclick">goWindowManager.getFeatureManager().launchFeature('FilterComplex'<xsl:text/>
  318. <xsl:if test="./OTI/@filter!=''">
  319. <!-- Pass along one filter ID to know if it is a summary filter or a detail filter -->
  320. <xsl:text/>, ['<xsl:value-of select="rsext:javascriptencode(string(./OTI/@filter))"/>']<xsl:text/>
  321. </xsl:if>
  322. <xsl:text/>);event.cancelBubble=true;</xsl:attribute>
  323. <xsl:choose>
  324. <xsl:when test="$CognosViewerID!=''">
  325. <xsl:attribute name="oncontextmenu">oCVSC<xsl:value-of select="$CognosViewerID"/>.titleAreaContextMenu(event, 'FILTERICON', <xsl:text/>
  326. <xsl:if test="./OTI/@filter!=''">
  327. <!-- Pass along one filter ID to know if it is a summary filter or a detail filter -->
  328. <xsl:text/>'<xsl:value-of select="rsext:javascriptencode(string(./OTI/@filter))"/>'<xsl:text/>
  329. </xsl:if>
  330. <xsl:text/>);<xsl:value-of select="$cancelEvent"/>;</xsl:attribute>
  331. </xsl:when>
  332. <xsl:otherwise>
  333. <xsl:attribute name="oncontextmenu">CF_titleAreaContextMenu(event, 'FILTERICON', <xsl:text/>
  334. <xsl:if test="./OTI/@filter!=''">
  335. <!-- Pass along one filter ID to know if it is a summary filter or a detail filter -->
  336. <xsl:text/>'<xsl:value-of select="rsext:javascriptencode(string(./OTI/@filter))"/>'<xsl:text/>
  337. </xsl:if>
  338. <xsl:text/>);<xsl:value-of select="$cancelEvent"/>;</xsl:attribute>
  339. </xsl:otherwise>
  340. </xsl:choose>
  341. </xsl:otherwise>
  342. </xsl:choose>
  343. <xsl:apply-templates select="./WRAP/OIMG"/>
  344. </span>
  345. <xsl:for-each select="OTI">
  346. <xsl:call-template name="QSFilterLink"/>
  347. </xsl:for-each>
  348. </div>
  349. </xsl:template>
  350. <!-- filterSubtitle links -->
  351. <xsl:template name="QSFilterLink">
  352. <span>
  353. <xsl:call-template name="GenCommonAttributes"/>
  354. <xsl:variable name="cancelEvent">
  355. <xsl:choose>
  356. <xsl:when test="$isIE">return false</xsl:when>
  357. <xsl:otherwise>event.preventDefault()</xsl:otherwise>
  358. </xsl:choose>
  359. </xsl:variable>
  360. <xsl:choose>
  361. <xsl:when test="./@filter">
  362. <xsl:attribute name="class">filterSubtitleStyle</xsl:attribute>
  363. <xsl:attribute name="onclick">goWindowManager.getFeatureManager().launchFeature('FilterSimple',['<xsl:value-of select="rsext:javascriptencode(string(./@filter))"/>']);event.cancelBubble=true;</xsl:attribute>
  364. <xsl:choose>
  365. <xsl:when test="$CognosViewerID!=''">
  366. <xsl:attribute name="oncontextmenu">oCVSC<xsl:value-of select="$CognosViewerID"/>.titleAreaContextMenu(event, 'FILTERLINK', '<xsl:value-of select="rsext:javascriptencode(string(./@filter))"/>');<xsl:value-of select="$cancelEvent"/>;</xsl:attribute>
  367. </xsl:when>
  368. <xsl:otherwise>
  369. <xsl:attribute name="oncontextmenu">CF_titleAreaContextMenu(event, 'FILTERLINK', '<xsl:value-of select="rsext:javascriptencode(string(./@filter))"/>');<xsl:value-of select="$cancelEvent"/>;</xsl:attribute>
  370. </xsl:otherwise>
  371. </xsl:choose>
  372. </xsl:when>
  373. <xsl:when test="./@sort">
  374. <xsl:attribute name="class">filterSubtitleStyle</xsl:attribute>
  375. <xsl:attribute name="onclick">goWindowManager.getFeatureManager().launchFeature('Sort', new Array('INCOMMINGVALUE', '<xsl:value-of select="rsext:javascriptencode(string(./@sort))"/>'));event.cancelBubble=true;</xsl:attribute>
  376. <xsl:choose>
  377. <xsl:when test="$CognosViewerID!=''">
  378. <xsl:attribute name="oncontextmenu">oCVSC<xsl:value-of select="$CognosViewerID"/>.titleAreaContextMenu(event, 'SORT', '<xsl:value-of select="rsext:javascriptencode(string(./@sort))"/>');<xsl:value-of select="$cancelEvent"/>;</xsl:attribute>
  379. </xsl:when>
  380. <xsl:otherwise>
  381. <xsl:attribute name="oncontextmenu">CF_titleAreaContextMenu(event, 'SORT', '<xsl:value-of select="rsext:javascriptencode(string(./@sort))"/>');<xsl:value-of select="$cancelEvent"/>;</xsl:attribute>
  382. </xsl:otherwise>
  383. </xsl:choose>
  384. </xsl:when>
  385. <xsl:when test="./@suppress">
  386. <xsl:attribute name="class">filterSubtitleStyle</xsl:attribute>
  387. <xsl:attribute name="onclick">goWindowManager.getFeatureManager().launchFeature('Suppress');</xsl:attribute>
  388. <xsl:choose>
  389. <xsl:when test="$CognosViewerID!=''">
  390. <xsl:attribute name="oncontextmenu">oCVSC<xsl:value-of select="$CognosViewerID"/>.titleAreaContextMenu(event, 'SUPPRESS', '<xsl:value-of select="rsext:javascriptencode(string(./@suppress))"/>');<xsl:value-of select="$cancelEvent"/>;</xsl:attribute>
  391. </xsl:when>
  392. <xsl:otherwise>
  393. <xsl:attribute name="oncontextmenu">CF_titleAreaContextMenu(event, 'SUPPRESS', '<xsl:value-of select="rsext:javascriptencode(string(./@suppress))"/>');<xsl:value-of select="$cancelEvent"/>;</xsl:attribute>
  394. </xsl:otherwise>
  395. </xsl:choose>
  396. </xsl:when>
  397. </xsl:choose>
  398. <xsl:apply-templates/>
  399. </span>
  400. </xsl:template>
  401. <!-- filterSubtitleIcon -->
  402. <xsl:template match="OIMG[@class='fi']">
  403. <img>
  404. <xsl:call-template name="GenCommonAttributes"/>
  405. <xsl:if test="@src">
  406. <xsl:attribute name="src"><xsl:value-of select="@src" disable-output-escaping="yes"/></xsl:attribute>
  407. </xsl:if>
  408. <!-- Yes, this overwrites the src attribute. I cannot find a better way in the rendering engine
  409. to accomplish this. What happens is that if the image control is data driven, I will set the source
  410. attribute. This takes presedence over hard-coded src attribute
  411. -->
  412. <xsl:if test="@source">
  413. <xsl:attribute name="src"><xsl:value-of select="@source" disable-output-escaping="yes"/></xsl:attribute>
  414. </xsl:if>
  415. <xsl:if test="@URL">
  416. <xsl:attribute name="src"><xsl:value-of select="@URL" disable-output-escaping="yes"/></xsl:attribute>
  417. </xsl:if>
  418. <xsl:apply-templates/>
  419. </img>
  420. </xsl:template>
  421. <!--
  422. template : startPage
  423. -->
  424. <xsl:template name="startPage">
  425. <table id="defaultReport" class="startPageTable" cellpadding="0" cellspacing="0">
  426. <!-- <xsl:if test="$isIE"> -->
  427. <xsl:attribute name="ondragenter">if(cf.dragStartPageEnterColumn)cf.dragStartPageEnterColumn(event)</xsl:attribute>
  428. <xsl:attribute name="ondragover">if(cf.dragStartPageOverColumn)cf.dragStartPageOverColumn(event)</xsl:attribute>
  429. <xsl:attribute name="ondragleave">if(cf.dragStartPageLeaveColumn)cf.dragStartPageLeaveColumn(event)</xsl:attribute>
  430. <xsl:attribute name="ondrop">if(cf.dropColumn)cf.dropColumn(event,null);</xsl:attribute>
  431. <!-- </xsl:if> -->
  432. <tr id="defaultReportTRTop">
  433. <td id="defaultReportTDTop" name="startPageTable" style="height:20px;" class="startPageListColumnTitle">
  434. <span id="startPageDropList" class="startPageText" name="startPageText" style="font-weight:bold;"/>
  435. </td>
  436. </tr>
  437. <tr id="defaultReportTRBottom">
  438. <td id="defaultReportTDBottom" name="startPageTable" class="startPageListColumn">
  439. <table id="defaultReportInnerTable" style="border-collapse: collapse;" cellpadding="0" cellspacing="0" width="100%">
  440. <tr>
  441. <td id="defaultReportInnerTD1">
  442. <xsl:choose>
  443. <xsl:when test="$isIE">
  444. <xsl:attribute name="style">padding:15px 0px 3px;text-align:center;width:100%;</xsl:attribute>
  445. </xsl:when>
  446. <xsl:otherwise>
  447. <xsl:attribute name="style">padding:15px 0px 10px;text-align:center;width:100%;</xsl:attribute>
  448. </xsl:otherwise>
  449. </xsl:choose>
  450. <span class="startPageText" name="startPageText" id="startPageDragDropLine1"/>
  451. </td>
  452. </tr>
  453. <!-- <xsl:if test="$isIE"> -->
  454. <tr>
  455. <td id="defaultReportInnerTD2" style="padding:3px 0px 10px;text-align:center;width:100%;">
  456. <span class="startPageText" name="startPageText" id="startPageDragDropLine2"/>
  457. </td>
  458. </tr>
  459. <!-- </xsl:if> -->
  460. <tr>
  461. <td id="defaultReportInnerTD3" name="startPageTable" style="padding:10px 0px;text-align:center;width:100%;">
  462. <img id="defaultReportImg">
  463. <xsl:attribute name="src"><xsl:value-of select="$webRoot"/>/qs/images/arrow_template.gif</xsl:attribute>
  464. </img>
  465. </td>
  466. </tr>
  467. <tr>
  468. <td id="defaultReportInnerTD4" style="padding:10px 0px 3px;text-align:center;width:100%;">
  469. <span class="startPageText" name="startPageText" id="startPageTipsLine1"/>
  470. </td>
  471. </tr>
  472. <tr>
  473. <td id="defaultReportInnerTD5" style="padding:3px 0px 15px;text-align:center;width:100%;">
  474. <span class="startPageText" name="startPageText" id="startPageTipsLine2"/>
  475. </td>
  476. </tr>
  477. </table>
  478. </td>
  479. </tr>
  480. </table>
  481. </xsl:template>
  482. <xsl:template name="dropIndicators">
  483. <span id="dragDropIndicator" class="clsCaretInsert" style="position:absolute; z-index:98; display:none;">
  484. <!-- <xsl:if test="$isIE"> -->
  485. <xsl:attribute name="ondragenter">dragOver(event)</xsl:attribute>
  486. <xsl:attribute name="ondragleave">event.cancelBubble = true;</xsl:attribute>
  487. <xsl:attribute name="ondrop">if(cf.dropColumn)cf.dropColumn(event,null);</xsl:attribute>
  488. <!-- </xsl:if> -->
  489. <img style="width:100%;height:100%;">
  490. <xsl:attribute name="src"><xsl:value-of select="$webRoot"/>/qs/images/drop_caret.gif</xsl:attribute>
  491. </img>
  492. </span>
  493. <span id="xtabHorizDropZone" style="position:absolute; z-index:50; display:none;">
  494. <!-- <xsl:if test="$isIE"> -->
  495. <xsl:attribute name="ondragenter">dragOverXtabHorizDropZone(event)</xsl:attribute>
  496. <xsl:attribute name="ondragover">dragOverXtabHorizDropZone(event)</xsl:attribute>
  497. <xsl:attribute name="ondrop">if(cf&amp;&amp;cf.dropColumn)cf.dropColumn(event,'xtabHorizDropZone','pivot');</xsl:attribute>
  498. <!-- </xsl:if> -->
  499. <img style="width:100%;height:100%;">
  500. <xsl:attribute name="src"><xsl:value-of select="$webRoot"/>/common/images/spacer.gif</xsl:attribute>
  501. </img>
  502. </span>
  503. <span id="xtabVertDropZone" style="position:absolute; z-index:50; display:none;">
  504. <!-- <xsl:if test="$isIE"> -->
  505. <xsl:attribute name="ondragenter">dragOverXtabVertDropZone(event)</xsl:attribute>
  506. <xsl:attribute name="ondragover">dragOverXtabVertDropZone(event)</xsl:attribute>
  507. <xsl:attribute name="ondrop">if(cf&amp;&amp;cf.dropColumn)cf.dropColumn(event,'xtabVertDropZone','none');</xsl:attribute>
  508. <!-- </xsl:if> -->
  509. <img style="width:100%;height:100%;">
  510. <xsl:attribute name="src"><xsl:value-of select="$webRoot"/>/common/images/spacer.gif</xsl:attribute>
  511. </img>
  512. </span>
  513. <span id="xtabCornerDropZone" style="position:absolute; z-index:50; display:none;">
  514. <!-- <xsl:if test="$isIE"> -->
  515. <xsl:attribute name="ondragenter">dragOverXtabCornerDropZone(event)</xsl:attribute>
  516. <xsl:attribute name="ondragover">dragOverXtabCornerDropZone(event)</xsl:attribute>
  517. <xsl:attribute name="ondrop">if(cf&amp;&amp;cf.dropColumn)cf.dropColumn(event,'xtabCornerDropZone','none');</xsl:attribute>
  518. <!-- </xsl:if> -->
  519. <img style="width:100%;height:100%;">
  520. <xsl:attribute name="src"><xsl:value-of select="$webRoot"/>/common/images/spacer.gif</xsl:attribute>
  521. </img>
  522. </span>
  523. <span id="lastSectionDropZone" style="position:absolute; z-index:50; display:none;">
  524. <!-- <xsl:if test="$isIE"> -->
  525. <xsl:attribute name="ondragenter">dragOverLastSectionDropZone(event)</xsl:attribute>
  526. <xsl:attribute name="ondragover">dragOverLastSectionDropZone(event)</xsl:attribute>
  527. <xsl:attribute name="ondrop">if(cf&amp;&amp;cf.dropColumn)cf.dropColumn(event,'lastSectionDropZone','header');</xsl:attribute>
  528. <!-- </xsl:if> -->
  529. <img style="width:100%;height:100%;">
  530. <xsl:attribute name="src"><xsl:value-of select="$webRoot"/>/common/images/spacer.gif</xsl:attribute>
  531. </img>
  532. </span>
  533. </xsl:template>
  534. <!-- used to add events to the main page for selection -->
  535. <xsl:template match="*[@layoutClass='page']" priority="1">
  536. <xsl:if test="$CognosViewerID=''">
  537. <script language="javascript" type="text/javascript">
  538. CF_setupSelectionArrays();
  539. </script>
  540. </xsl:if>
  541. <table id="rt{$CognosViewerID}" cellpadding="0" cellspacing="0" border="0">
  542. <xsl:attribute name="onclick">oCVSC<xsl:value-of select="$CognosViewerID"/>.pageClicked(event);goWindowManager.getApplicationManager().clearMenus();</xsl:attribute>
  543. <xsl:attribute name="onmousemove">oCVSC<xsl:value-of select="$CognosViewerID"/>.pageHover(event);</xsl:attribute>
  544. <xsl:attribute name="ondblclick">pageDoubleClicked(event);</xsl:attribute>
  545. <xsl:attribute name="onkeypress">oCVSC<xsl:value-of select="$CognosViewerID"/>.pageClicked(event);</xsl:attribute>
  546. <xsl:if test="$isNS6 != 'true'">
  547. <xsl:attribute name="onmouseup">oCV<xsl:value-of select="$CognosViewerID"/>.pcc(event, true);</xsl:attribute>
  548. </xsl:if>
  549. <!-- <xsl:if test="$isIE"> -->
  550. <xsl:attribute name="ondrop">if(cf.dropColumn) {cf.dropColumn(event,null);}</xsl:attribute>
  551. <!-- </xsl:if> -->
  552. <xsl:call-template name="GenCommonAttributes"/>
  553. <xsl:apply-templates select="*"/>
  554. </table>
  555. </xsl:template>
  556. <xsl:template match="*[@layoutClass='textItem']" priority="1">
  557. <span>
  558. <xsl:attribute name="tabIndex">0</xsl:attribute>
  559. <xsl:call-template name="addDrillEvent"><xsl:with-param name="app"><xsl:text>QS</xsl:text></xsl:with-param></xsl:call-template>
  560. <xsl:call-template name="GenCommonAttributes"/>
  561. <xsl:if test="$CVDisableDrill != 'true'">
  562. <xsl:choose>
  563. <xsl:when test="name(parent::node())='drillTargets'">
  564. <xsl:if test="parent::node()/../@isolated='true' or parent::node()/@isolated='true'">
  565. <xsl:attribute name="isolated">true</xsl:attribute>
  566. </xsl:if>
  567. </xsl:when>
  568. <xsl:otherwise>
  569. <xsl:if test="parent::node()/@drillUp = 'true' or parent::node()/@drillDown = 'true' or ./@drillDown='true' or ./@drillUp='true' or parent::node()/../@drillUp = 'true' or parent::node()/../@drillDown = 'true'">
  570. <xsl:variable name="isIsolated">
  571. <xsl:choose>
  572. <xsl:when test="parent::node()/@isolated='true' or ./@isolated='true'">true</xsl:when>
  573. <xsl:otherwise>false</xsl:otherwise>
  574. </xsl:choose>
  575. </xsl:variable>
  576. <xsl:if test="(parent::node()/@drillDown = 'true' or ./@drillDown='true' or parent::node()/../@drillDown = 'true') and $isIsolated='false'">
  577. <xsl:attribute name="class"><xsl:text>dl </xsl:text><xsl:value-of select="@layoutClass" disable-output-escaping="yes"/></xsl:attribute>
  578. </xsl:if>
  579. <xsl:if test="$isIsolated='true'">
  580. <xsl:attribute name="isolated">true</xsl:attribute>
  581. </xsl:if>
  582. </xsl:if>
  583. </xsl:otherwise>
  584. <!--
  585. <xsl:when test="@ctx != ''">
  586. <xsl:attribute name="ctx"><xsl:value-of select="@ctx"/></xsl:attribute>
  587. </xsl:when>
  588. <xsl:otherwise>
  589. <xsl:attribute name="ctx">NIL</xsl:attribute>
  590. </xsl:otherwise>
  591. -->
  592. </xsl:choose>
  593. </xsl:if>
  594. <xsl:if test="@ctx != ''">
  595. <xsl:attribute name="ctx"><xsl:value-of select="@ctx"/></xsl:attribute>
  596. </xsl:if>
  597. <xsl:value-of select="rsext:htmlencode(string(.))" disable-output-escaping="yes"/>
  598. </span>
  599. </xsl:template>
  600. <xsl:template match="OAREA" priority="1">
  601. <xsl:if test="./MEMBER or ./MEASURE">
  602. <xsl:attribute name="ctx">
  603. <xsl:for-each select="./*[name()='MEASURE']">
  604. <xsl:value-of select="./@ctx"/>
  605. <xsl:if test="position()!=last()">
  606. <xsl:text>:</xsl:text>
  607. </xsl:if>
  608. </xsl:for-each>
  609. <xsl:if test="./*[name()='MEMBER'] and ./*[name()='MEASURE']">
  610. <xsl:text>::</xsl:text>
  611. </xsl:if>
  612. <xsl:for-each select="./*[name()='MEMBER']">
  613. <xsl:value-of select="./@ctx"/>
  614. <xsl:if test="position()!=last()">
  615. <xsl:text>::</xsl:text>
  616. </xsl:if>
  617. </xsl:for-each>
  618. </xsl:attribute>
  619. <xsl:choose>
  620. <xsl:when test="$CognosViewerID!=''">
  621. <xsl:attribute name="onclick">oCVQS.getDrillMgr().singleClickDrillEvent(event, 'QS');</xsl:attribute>
  622. </xsl:when>
  623. <xsl:otherwise>
  624. <xsl:attribute name="onclick">getReportFrame().goDrillManager.singleClickDrillEvent(event, 'QS');</xsl:attribute>
  625. </xsl:otherwise>
  626. </xsl:choose>
  627. <!--For IE: show a drill cursor when the mouse is over the chart, and a normal pointer when outside-->
  628. <xsl:if test="$isIE='true'">
  629. <xsl:choose>
  630. <xsl:when test="$CognosViewerID!=''">
  631. <xsl:attribute name="onmouseover">oCVQS.getDrillMgr().ddc(event);</xsl:attribute>
  632. </xsl:when>
  633. <xsl:otherwise>
  634. <xsl:attribute name="onmouseover">getReportFrame().goDrillManager.ddc(event);</xsl:attribute>
  635. </xsl:otherwise>
  636. </xsl:choose>
  637. </xsl:if>
  638. <xsl:attribute name="class"><xsl:value-of select="@layoutClass" disable-output-escaping="yes"/></xsl:attribute>
  639. </xsl:if>
  640. <xsl:if test="./@type='legendTitle'">
  641. <xsl:attribute name="isChartTitle">true</xsl:attribute>
  642. </xsl:if>
  643. <xsl:if test="./@type='ordinalAxisTitle'">
  644. <xsl:attribute name="isChartTitle">true</xsl:attribute>
  645. </xsl:if>
  646. <xsl:choose>
  647. <xsl:when test="$isIE">
  648. <xsl:choose>
  649. <xsl:when test="$CognosViewerID!=''">
  650. <xsl:attribute name="onmousedown">if(event.button==2){oCVSC<xsl:value-of select="$CognosViewerID"/>.pageClicked(event);event.cancelBubble = true;event.returnValue = false;}</xsl:attribute>
  651. </xsl:when>
  652. <xsl:otherwise>
  653. <xsl:attribute name="onmousedown">if(event.button==2){CF_pageClicked(event);event.cancelBubble = true;event.returnValue = false;}</xsl:attribute>
  654. </xsl:otherwise>
  655. </xsl:choose>
  656. </xsl:when>
  657. <xsl:otherwise>
  658. <xsl:choose>
  659. <xsl:when test="$CognosViewerID!=''">
  660. <xsl:attribute name="onContextMenu">oCVSC<xsl:value-of select="$CognosViewerID"/>.pageContextClicked(event);event.preventDefault();</xsl:attribute>
  661. </xsl:when>
  662. <xsl:otherwise>
  663. <xsl:attribute name="onContextMenu">CF_pageContextClicked(event);event.preventDefault();</xsl:attribute>
  664. </xsl:otherwise>
  665. </xsl:choose>
  666. </xsl:otherwise>
  667. </xsl:choose>
  668. </xsl:template>
  669. <xsl:template name="addSelectionController">
  670. <xsl:if test="$CognosViewerID!=''">
  671. <xsl:text disable-output-escaping="yes">&lt;script type="text/javascript"></xsl:text>
  672. <xsl:text>if(typeof oCVSC</xsl:text><xsl:value-of select="$CognosViewerID"/><xsl:text> != "undefined")</xsl:text>
  673. <xsl:text>{</xsl:text>
  674. <xsl:if test="/Document/META-DATA or /Document/CONTEXT-DATA">
  675. <xsl:text>oCVSC</xsl:text><xsl:value-of select="$CognosViewerID"/><xsl:text>.setSelectionBasedFeaturesEnabled(true);</xsl:text>
  676. </xsl:if>
  677. <xsl:if test="/Document/META-DATA/@drillUpDown='true'">
  678. <xsl:text>oCVSC</xsl:text><xsl:value-of select="$CognosViewerID"/><xsl:text>.setDrillUpDownEnabled(true);</xsl:text>
  679. </xsl:if>
  680. <xsl:if test="/Document/META-DATA/@modelBasedDrillThru='true'">
  681. <xsl:text>oCVSC</xsl:text><xsl:value-of select="$CognosViewerID"/><xsl:text>.setModelDrillThroughEnabled(true);</xsl:text>
  682. </xsl:if>
  683. <xsl:text>}</xsl:text>
  684. <xsl:text disable-output-escaping="yes">&lt;/script></xsl:text>
  685. </xsl:if>
  686. </xsl:template>
  687. <xsl:template name="addDrillHandler">
  688. <xsl:param name="app"/>
  689. <xsl:choose>
  690. <xsl:when test="$CognosViewerID!=''">
  691. <xsl:attribute name="onclick">oCVSC<xsl:value-of select="$CognosViewerID"/>.pageClicked(event);oCVQS.getDrillMgr().singleClickDrillEvent(event, 'QS');</xsl:attribute>
  692. </xsl:when>
  693. <xsl:otherwise>
  694. <xsl:attribute name="onclick">CF_pageClicked(event);getReportFrame().goDrillManager.singleClickDrillEvent(event, 'QS');</xsl:attribute>
  695. </xsl:otherwise>
  696. </xsl:choose>
  697. </xsl:template>
  698. </xsl:stylesheet>