outputs_titan.xts 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  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, 2014
  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. <xts:morphlet xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="messages/portal.xml, messages/portalRL.xml" includeConfig="true">
  13. <!--
  14. ===============================================================================================
  15. formlogic_init - standard form logic initialization
  16. ===============================================================================================
  17. -->
  18. <xts:block
  19. id="formlogic_init"
  20. type="exec"
  21. mode="interpret"
  22. processor="XSLT"
  23. path="/logicsheets/formlogic_init.xslt"
  24. nodelist="env,credential,system,http"/>
  25. <xts:block id="getReportStoreId" processor="XSLT" type="exec" dependency="" mandatory="false">
  26. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  27. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  28. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  29. <xsl:template match="/">
  30. <!-- Outputs need to honour reportVersionPath from history pages (view/view_details). -->
  31. <xsl:variable name="reportVersionPath"><xsl:value-of select="string(/root/env/param[@name= 'reportVersionPath'])"/></xsl:variable>
  32. <xts:sequence>
  33. <xts:append>
  34. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  35. <send:request provider="cm">
  36. <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
  37. <cm:query>
  38. <cm:requests>
  39. <xsl:choose>
  40. <xsl:when test="$reportVersionPath != ''">
  41. <!-- Get parent if there is a reportVersionPath (this could be a storeID) so we know the name etc. Means it is from history/view.xts and is the actual output to show. -->
  42. <cm:query>
  43. <cm:search>
  44. <xsl:value-of select="$reportVersionPath"/>
  45. </cm:search>
  46. <cm:properties>
  47. <cm:property name="defaultName"/>
  48. <cm:property name="creationTime"/>
  49. <cm:property name="searchPath"/>
  50. <cm:property name="hidden"/>
  51. <cm:property name="storeID"/>
  52. </cm:properties>
  53. <cm:options>
  54. <cm:refProps>
  55. <cm:refProp refPropName="parent">
  56. <cm:properties>
  57. <cm:property name="defaultName"/>
  58. <cm:property name="storeID"/>
  59. <cm:property name="searchPath"/>
  60. <cm:property name="documentType"/>
  61. <cm:property name="hidden"/>
  62. <cm:property name="repositoryRules"/>
  63. </cm:properties>
  64. </cm:refProp>
  65. </cm:refProps>
  66. </cm:options>
  67. <cm:sortBy>
  68. <cm:sort name="creationTime" order="descending"/>
  69. </cm:sortBy>
  70. </cm:query>
  71. </xsl:when>
  72. <xsl:otherwise>
  73. <xsl:variable name="target-obj">
  74. <xsl:choose>
  75. <xsl:when test="string(/root/env/param[@name= 'sc_target_obj']) != ''"><xsl:value-of select="/root/env/param[@name= 'sc_target_obj']"/></xsl:when>
  76. <xsl:otherwise><xsl:value-of select="/root/env/param[@name= 'm_obj']"/></xsl:otherwise>
  77. </xsl:choose>
  78. </xsl:variable>
  79. <!-- Get the report -->
  80. <cm:query>
  81. <cm:search>
  82. <xsl:value-of select="$target-obj"/>
  83. </cm:search>
  84. <cm:properties>
  85. <cm:property name="storeID"/>
  86. <cm:property name="defaultName"/>
  87. </cm:properties>
  88. <cm:options>
  89. <cm:refProps>
  90. <cm:refProp refPropName="parent">
  91. <cm:properties>
  92. <cm:property name="repositoryRules"/>
  93. </cm:properties>
  94. </cm:refProp>
  95. </cm:refProps>
  96. </cm:options>
  97. </cm:query>
  98. </xsl:otherwise>
  99. </xsl:choose>
  100. </cm:requests>
  101. </cm:query>
  102. </xts:transform>
  103. </send:request>
  104. </xts:transform>
  105. </xts:append>
  106. <xts:append>
  107. <xts:function name="getConfiguration">
  108. <xts:param name="portal.render.outputpage.asoftime"/>
  109. </xts:function>
  110. </xts:append>
  111. </xts:sequence>
  112. </xsl:template>
  113. </xsl:stylesheet>
  114. </xts:block>
  115. <xts:block id="getRepositoryConnectionInfo" processor="XSLT" type="exec" dependency="getReportStoreId" mandatory="false" condition=".[/root/env/param[@name= 'reportVersionPath']='']">
  116. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  117. <xsl:stylesheet version="1.0"
  118. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  119. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
  120. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  121. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  122. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  123. <xsl:template match="/">
  124. <xsl:variable name="datasourceName" select="/root/*[local-name()='queryResponse']/*[local-name()='queryReply']//*[local-name()='parent']//*[local-name()='repositoryRules']//*[local-name()='dataSourceName'][1]"/>
  125. <xsl:variable name="sq">'</xsl:variable>
  126. <!-- must escape the ' to '' to make the search expression CM safe. -->
  127. <xsl:variable name="cmSafeDatasourceName" select=" xtsext:replace(string($datasourceName), string($sq), concat($sq,$sq))"/>
  128. <xts:sequence>
  129. <xts:append>
  130. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  131. <send:request provider="cm">
  132. <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
  133. <cm:query>
  134. <cm:requests>
  135. <cm:query>
  136. <cm:search>
  137. dataSourceSignon('<xsl:value-of select="$cmSafeDatasourceName"/>')
  138. </cm:search>
  139. <cm:properties>
  140. <cm:property name="storeID"/>
  141. <cm:property name="defaultName"/>
  142. <cm:property name="tenantID"/>
  143. </cm:properties>
  144. </cm:query>
  145. <cm:query>
  146. <cm:search>
  147. defaultRepositoryConnection('<xsl:value-of select="$cmSafeDatasourceName"/>')
  148. </cm:search>
  149. <cm:properties>
  150. <cm:property name="storeID"/>
  151. <cm:property name="defaultName"/>
  152. <cm:property name="tenantID"/>
  153. </cm:properties>
  154. </cm:query>
  155. </cm:requests>
  156. </cm:query>
  157. </xts:transform>
  158. </send:request>
  159. </xts:transform>
  160. </xts:append>
  161. </xts:sequence>
  162. </xsl:template>
  163. </xsl:stylesheet>
  164. </xts:block>
  165. <!-- Merge the tenantNames into the response -->
  166. <xts:block processor="XSLT" type="exec" mandatory="false"
  167. path="/portal/tenancy/mergeTenantNames.xslt"
  168. id="mergeTenantNames"
  169. dependency="getRepositoryConnectionInfo"
  170. condition=".[/root/session/param[@name='e_showTenantInfo']='true' and count(/root/*[local-name()='queryResponse'][2]/*[local-name()='queryReply'][1]/*[local-name()='dataSourceConnection']) &gt; 1]">
  171. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  172. </xts:block>
  173. <xts:block id="format" mode="interpret" processor="XSLT" type="exec" mimeType="text/html" dependency="getRepositoryConnectionInfo formlogic_init">
  174. <xsl:stylesheet version="1.0"
  175. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  176. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  177. xmlns:cps="http://developer.cognos.com/schemas/cps/asm/objects/1/"
  178. xmlns:xos="http://developer.cognos.com/schemas/xts/output/"
  179. xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  180. xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
  181. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  182. xmlns:nav="http://developer.cognos.com/schemas/cps/navigation/1/"
  183. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  184. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
  185. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  186. xmlns:asm="http://developer.cognos.com/schemas/cps/asm/assembler/1/"
  187. exclude-result-prefixes="cm cps xos SOAP-ENV SOAP-ENC xsi bus send xtsext">
  188. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  189. <xsl:template match="/">
  190. <xsl:variable name="renderSheet">
  191. <xsl:choose>
  192. <xsl:when test="/root/env/param[@name='output_tab'] = 'arch'">portal/outputs/render_old_versions_titan.xslt</xsl:when>
  193. <xsl:otherwise>portal/outputs/render_recent_versions_titan.xslt</xsl:otherwise>
  194. </xsl:choose>
  195. </xsl:variable>
  196. <xts:sequence>
  197. <xts:append select="/root/output">
  198. <xts:transform processor="XSLT" nodelist="cookies, http, credential, env, user, system, session, configProps, queryResponse, config, configuration" src="{$renderSheet}" option="part" mimeType="text/html">
  199. <xts:param name="logicsheet">logicsheets/portal.xsl</xts:param>
  200. <xts:param name="logicsheet">logicsheets/presentation/dialog/framework.xsl</xts:param>
  201. <xts:param name="logicsheet">logicsheets/presentation/layout.xsl</xts:param>
  202. <xts:param name="logicsheet">logicsheets/presentation/controls/framework.xsl</xts:param>
  203. <xts:param name="logicsheet">logicsheets/presentation/controls/presentation.xsl</xts:param>
  204. <xts:param name="logicsheet">logicsheets/presentation/dialog/presentation.xsl</xts:param>
  205. <xts:param name="logicsheet">logicsheets/formlogic.xslt</xts:param>
  206. <xts:param name="logicsheet">logicsheets/validation.xslt</xts:param>
  207. <xts:param name="logicsheet">portal/outputs/dateVariables.xslt</xts:param>
  208. <xts:param name="logicsheet">logicsheets/presentation/touch_up.xslt</xts:param>
  209. <xts:param name="messageBase">messages/portal.xml</xts:param>
  210. <xts:param name="messageBase">messages/portalRL.xml</xts:param>
  211. </xts:transform>
  212. </xts:append>
  213. </xts:sequence>
  214. </xsl:template>
  215. </xsl:stylesheet>
  216. </xts:block>
  217. <!-- Debug -->
  218. <!-- ============================================================================= -->
  219. <xts:block id="debug" dependency="format" condition=".[ /root/session/param[@name='debug'] = '1' ]" type="exec" mode="output" processor="XSLT" mandatory="false" mimeType="text/html">
  220. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  221. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dbg="http://developer.cognos.com/schemas/xts/logicsheets/xslt/debug/" exclude-result-prefixes="dbg">
  222. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  223. <dbg:templates/>
  224. <xsl:template match="/">
  225. <dbg:dumpxml select="/root"/>
  226. </xsl:template>
  227. </xsl:stylesheet>
  228. </xts:block>
  229. </xts:morphlet>