visualizations.xts 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: cogadmin
  5. (C) Copyright IBM Corp. 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. <xts:morphlet xmlns:xts="http://developer.cognos.com/schemas/xts/" resolverBase="cogadmin" messageBase="messages/cogadminuimsgs.xml" requiredCapability="canUsePortalAdministrationTool">
  13. <xts:block id="frag_init" nodelist="env, credential" type="exec" mode="interpret" processor="XSLT" path="cogadmin/logicsheets/fragment_init.xslt" condition=".[not(/root/env/param[@name='frag-directive']='meta-only')]" mandatory="true"/>
  14. <xts:block id="getContent" dependency="frag_init" nodelist="env, state, header, session, system, http, configProps" type="exec" mode="interpret" processor="XSLT">
  15. <xts:logicsheet path="logicsheets/tenantlogic.xsl"/>
  16. <xts:logicsheet path="cogadmin/logicsheets/admin.xslt"/>
  17. <xts:logicsheet path="cogadmin/logicsheets/presentation/filters.xslt"/>
  18. <xts:logicsheet path="/cogadmin/logicsheets/buslogic.xslt"/>
  19. <xsl:stylesheet version="1.0"
  20. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  21. xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  22. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  23. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  24. xmlns:flt="http://developer.cognos.com/schemas/uic/presentation/filters/"
  25. xmlns:admui="http://developer.cognos.com/schemas/xts/admui"
  26. exclude-result-prefixes="xsl xts SOAP-ENV bus admui xtsext flt">
  27. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  28. <!-- common pager variables -->
  29. <admui:pagerVariables pagerName="visualizations"/>
  30. <!-- common variables -->
  31. <admui:variables/>
  32. <xsl:variable name="path">
  33. <xsl:choose>
  34. <xsl:when test="key('env-param', 'visualization_path') != ''">
  35. <xsl:value-of select="key('env-param', 'visualization_path')"/>
  36. </xsl:when>
  37. <xsl:otherwise>
  38. <xsl:text>path:/catalog/catalogFolder[@name='Visualizations']</xsl:text>
  39. </xsl:otherwise>
  40. </xsl:choose>
  41. </xsl:variable>
  42. <xsl:template match="/">
  43. <xts:sequence>
  44. <xts:append select="/root">
  45. <response>
  46. <xts:request href="bus://dispatcher" protocol="NAV" responseEnvelope="false" outputHeader="false">
  47. <SOAP-ENV:Envelope xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:nav="http://developer.cognos.com/schemas/cps/navigation/1/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  48. <SOAP-ENV:Header>
  49. <xsl:copy-of select="/root/header/bus:biBusHeader"/>
  50. </SOAP-ENV:Header>
  51. <SOAP-ENV:Body>
  52. <nav:getContainer>
  53. <nav:id>
  54. <xsl:value-of select="$path"/>
  55. </nav:id>
  56. <nav:childObjectFilter>
  57. <xsl:if test="false()"> <!-- not supported at this point! -->
  58. <nav:itemType>catalogFolder</nav:itemType>
  59. </xsl:if>
  60. <nav:itemType>visualization</nav:itemType>
  61. <nav:itemType>catalog</nav:itemType>
  62. </nav:childObjectFilter>
  63. <nav:validateTag fault="true"/>
  64. <nav:scope><xsl:value-of select="$path"/>/*</nav:scope>
  65. <nav:property name="defaultName"/>
  66. <nav:property name="ancestors"/>
  67. <nav:property name="hasChildren"/>
  68. <nav:property name="permissions"/>
  69. <nav:property name="searchPath"/>
  70. <nav:property name="lastModifiedDate"/>
  71. <nav:property name="displaySequence"/>
  72. <nav:property name="position"/>
  73. <nav:property name="screenTip"/>
  74. <nav:property name="iconURI"/>
  75. <nav:property name="userCapability"/>
  76. <nav:property name="fullPath"/>
  77. <nav:property name="ancestors"/>
  78. <nav:property name="parentId"/>
  79. <nav:property name="type"/>
  80. <nav:property name="internalId"/>
  81. <nav:property name="name"/>
  82. <nav:property name="icons"/>
  83. <nav:property name="hidden"/>
  84. <nav:property name="tenantID"/>
  85. <nav:property name="dataPathInfo"/>
  86. <!-- nav properties -->
  87. <nav:maxObjects><xsl:value-of select="$maxObjects"/></nav:maxObjects>
  88. <nav:skipObjects><xsl:value-of select="$skipObjects"/></nav:skipObjects>
  89. <nav:sort>
  90. <xsl:variable name="_sortColumn">
  91. <xsl:choose>
  92. <xsl:when test="key('env-param', 'sort_column') != ''">
  93. <xsl:value-of select="key('env-param', 'sort_column')"/>
  94. </xsl:when>
  95. <xsl:otherwise>
  96. <xsl:value-of select="key('env-param', 'init_sort_column')"/>
  97. </xsl:otherwise>
  98. </xsl:choose>
  99. </xsl:variable>
  100. <xsl:variable name="_sortOrder">
  101. <xsl:choose>
  102. <xsl:when test="key('env-param', 'sort_column') != ''">
  103. <xsl:value-of select="key('env-param', 'sort_order')"/>
  104. </xsl:when>
  105. <xsl:otherwise>
  106. <xsl:value-of select="key('env-param', 'init_sort_order') "/>
  107. </xsl:otherwise>
  108. </xsl:choose>
  109. </xsl:variable>
  110. <xsl:attribute name="order">
  111. <xsl:choose>
  112. <xsl:when test="$_sortOrder='ascending'">ascending</xsl:when>
  113. <xsl:when test="$_sortOrder='descending'">descending</xsl:when>
  114. <xsl:otherwise>descending</xsl:otherwise>
  115. </xsl:choose>
  116. </xsl:attribute>
  117. <xsl:choose>
  118. <xsl:when test="$_sortOrder != ''">
  119. <xsl:value-of select="$_sortColumn"/>
  120. </xsl:when>
  121. <xsl:otherwise>
  122. <xsl:text>displaySequence</xsl:text>
  123. </xsl:otherwise>
  124. </xsl:choose>
  125. </nav:sort>
  126. <!-- common nav params -->
  127. <admui:commonNavParams/>
  128. </nav:getContainer>
  129. </SOAP-ENV:Body>
  130. </SOAP-ENV:Envelope>
  131. </xts:request>
  132. </response>
  133. </xts:append>
  134. </xts:sequence>
  135. </xsl:template>
  136. </xsl:stylesheet>
  137. </xts:block>
  138. <!-- Merge the tenantNames into the response -->
  139. <xts:block processor="XSLT" type="exec" mandatory="false"
  140. path="/portal/tenancy/mergeTenantNames.xslt"
  141. id="mergeTenantNames"
  142. dependency="getContent"
  143. condition=".[/root/session/param[@name='e_showTenantInfo']='true']">
  144. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  145. </xts:block>
  146. <xts:block id="getMeta" type="exec" mode="interpret" nodelist="env, updatedPath" processor="XSLT">
  147. <xsl:stylesheet version="1.0"
  148. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  149. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  150. xmlns:val="http://developer.cognos.com/schemas/validator/1/"
  151. xmlns:xos="http://developer.cognos.com/schemas/xts/output/"
  152. xmlns:nav="http://developer.cognos.com/schemas/cps/navigation/1/"
  153. exclude-result-prefixes="xsl xts xos val xtsext nav">
  154. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  155. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  156. <xsl:variable name="path" select="/root/response/nav:getContainerResponse/nav:container/nav:content/*/nav:id"/>
  157. <xsl:template match="/">
  158. <xts:sequence>
  159. <xts:append select="/root/output">
  160. <xos:part>
  161. <xos:entityHeader>
  162. <xos:param name="Content-Type">text/xml; charset=utf-8</xos:param>
  163. </xos:entityHeader>
  164. <xos:entityBody>
  165. <fragment>
  166. <info>
  167. <title>
  168. <xts:string id="IDS_ADM_VISUALIZATIONS"/>
  169. </title>
  170. </info>
  171. <preferredTitle>
  172. <xts:string id="IDS_ADM_VISUALIZATIONS"/>
  173. </preferredTitle>
  174. <meta>
  175. <transientProperties name="visualization_name">
  176. <validate>
  177. <val:name>visualization_name</val:name>
  178. <val:rule>
  179. <val:type>
  180. <val:string maxLength="255"/>
  181. </val:type>
  182. </val:rule>
  183. </validate>
  184. </transientProperties>
  185. <transientProperties name="visualization_path">
  186. <validate>
  187. <val:name>visualization_path</val:name>
  188. <val:rule>
  189. <val:type>
  190. <val:string maxLength="255"/>
  191. </val:type>
  192. </val:rule>
  193. </validate>
  194. </transientProperties>
  195. </meta>
  196. <state>
  197. <xsl:variable name="state">
  198. <xsl:text>&lt;param name="searchMode"&gt;</xsl:text>
  199. <xsl:value-of select="xtsext:xmlencode(string(key('env-param', 'searchMode')))"/>
  200. <xsl:text>&lt;/param&gt;</xsl:text>
  201. </xsl:variable>
  202. <xsl:value-of select="xtsext:base64encode($state,true())"/>
  203. </state>
  204. </fragment>
  205. </xos:entityBody>
  206. </xos:part>
  207. </xts:append>
  208. </xts:sequence>
  209. </xsl:template>
  210. </xsl:stylesheet>
  211. </xts:block>
  212. <xts:block id="renderMarkup" dependency="frag_init getMeta getContent" nodelist="env, state, user, system" type="exec" mode="interpret" processor="XSLT">
  213. <xts:logicsheet path="cogadmin/logicsheets/admin.xslt"/>
  214. <xsl:stylesheet version="1.0"
  215. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  216. xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  217. xmlns:xos="http://developer.cognos.com/schemas/xts/output/"
  218. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  219. xmlns:nemo="http://developer.cognos.com/nemo"
  220. xmlns:nav="http://developer.cognos.com/schemas/cps/navigation/1/"
  221. xmlns:admui="http://developer.cognos.com/schemas/xts/admui"
  222. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  223. exclude-result-prefixes="xsl nemo admui xts SOAP-ENV xos bus nav">
  224. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  225. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  226. <xsl:template match="/">
  227. <xts:sequence>
  228. <xts:append select="/root/output/*[local-name()='part']/*[local-name()='entityBody']/fragment">
  229. <markup>
  230. <mimeType>text/html</mimeType>
  231. <markupXml>
  232. <xts:transform src="/cogadmin/transforms/presentation/renderFragment.xslt" processor="XSLT">
  233. <xts:param name="messageBase">/messages/cogadminuimsgs.xml</xts:param>
  234. <xts:param name="logicsheet">/cogadmin/logicsheets/admin.xslt</xts:param>
  235. <root>
  236. <xts:transform src="/cogadmin/transforms/gen-ui-markup/visualizations.xslt" processor="XSLT">
  237. <xts:param name="messageBase">/messages/cogadminuimsgs.xml</xts:param>
  238. <xts:param name="logicsheet">/cogadmin/logicsheets/presentation/common.xslt</xts:param>
  239. <xts:param name="logicsheet">/cogadmin/logicsheets/presentation/pager.xslt</xts:param>
  240. <xts:param name="logicsheet">/cogadmin/logicsheets/admin.xslt</xts:param>
  241. <root>
  242. <xts:queryNode select="/root/*[local-name()='queryResponse'] | /root/response/* | /root/scheduledBy | /root/user | /root/metadata | /root/system | /root/session | /root/env | /root/http | /root/updatedPath"/>
  243. </root>
  244. </xts:transform>
  245. <xts:queryNode select="/root/system | /root/session | /root/user"/>
  246. </root>
  247. </xts:transform>
  248. </markupXml>
  249. </markup>
  250. <xsl:if test="key('env-param','searchMode') != ''">
  251. <subfragment id="VISUALIZATIONS_SEARCH_FRAGMENT" href="bus://xts.run?m=/cogadmin/search.xts&amp;type=visualizations"/>
  252. </xsl:if>
  253. </xts:append>
  254. </xts:sequence>
  255. </xsl:template>
  256. </xsl:stylesheet>
  257. </xts:block>
  258. </xts:morphlet>