capabilities.xts 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396
  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. 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. <xts:morphlet xmlns:xts="http://developer.cognos.com/schemas/xts/" resolverBase="cogadmin" messageBase="messages/cogadminuimsgs.xml" requiredCapability="canUseCapabilitiesTool">
  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. <!--
  15. Get the capabilities
  16. -->
  17. <xts:block id="getContent" dependency="frag_init" nodelist="env, state, header, session, system, http, configProps" type="exec" mode="interpret" processor="XSLT">
  18. <xts:logicsheet path="cogadmin/logicsheets/admin.xslt"/>
  19. <xts:logicsheet path="cogadmin/logicsheets/presentation/filters.xslt"/>
  20. <xts:logicsheet path="/cogadmin/logicsheets/buslogic.xslt"/>
  21. <xsl:stylesheet version="1.0"
  22. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  23. xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  24. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  25. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  26. xmlns:flt="http://developer.cognos.com/schemas/uic/presentation/filters/"
  27. xmlns:admui="http://developer.cognos.com/schemas/xts/admui"
  28. exclude-result-prefixes="xsl xts SOAP-ENV bus admui xtsext flt">
  29. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  30. <!-- common pager variables -->
  31. <admui:pagerVariables pagerName="capabilities"/>
  32. <!-- common variables -->
  33. <admui:variables/>
  34. <xsl:variable name="path">
  35. <xsl:choose>
  36. <xsl:when test="key('env-param', 'capability_path') != ''">
  37. <xsl:value-of select="key('env-param', 'capability_path')"/>
  38. </xsl:when>
  39. <xsl:otherwise>
  40. <xsl:text>path:/capability</xsl:text>
  41. </xsl:otherwise>
  42. </xsl:choose>
  43. </xsl:variable>
  44. <xsl:template match="/">
  45. <xts:sequence>
  46. <xts:append select="/root">
  47. <response>
  48. <xts:request href="bus://dispatcher" protocol="NAV" responseEnvelope="false" outputHeader="false">
  49. <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">
  50. <SOAP-ENV:Header>
  51. <xsl:copy-of select="/root/header/bus:biBusHeader"/>
  52. </SOAP-ENV:Header>
  53. <SOAP-ENV:Body>
  54. <nav:getContainer>
  55. <nav:id>
  56. <xsl:value-of select="$path"/>
  57. </nav:id>
  58. <nav:childObjectFilter>
  59. <nav:itemType>securedFunction</nav:itemType>
  60. <nav:itemType>securedFeature</nav:itemType>
  61. <nav:itemType>capability</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 properties -->
  86. <nav:maxObjects><xsl:value-of select="$maxObjects"/></nav:maxObjects>
  87. <nav:skipObjects><xsl:value-of select="$skipObjects"/></nav:skipObjects>
  88. <nav:sort>
  89. <xsl:variable name="_sortColumn">
  90. <xsl:choose>
  91. <xsl:when test="key('env-param', 'sort_column') != ''">
  92. <xsl:value-of select="key('env-param', 'sort_column')"/>
  93. </xsl:when>
  94. <xsl:otherwise>
  95. <xsl:value-of select="key('env-param', 'init_sort_column')"/>
  96. </xsl:otherwise>
  97. </xsl:choose>
  98. </xsl:variable>
  99. <xsl:variable name="_sortOrder">
  100. <xsl:choose>
  101. <xsl:when test="key('env-param', 'sort_column') != ''">
  102. <xsl:value-of select="key('env-param', 'sort_order')"/>
  103. </xsl:when>
  104. <xsl:otherwise>
  105. <xsl:value-of select="key('env-param', 'init_sort_order') "/>
  106. </xsl:otherwise>
  107. </xsl:choose>
  108. </xsl:variable>
  109. <xsl:attribute name="order">
  110. <xsl:choose>
  111. <xsl:when test="$_sortOrder='ascending'">ascending</xsl:when>
  112. <xsl:when test="$_sortOrder='descending'">descending</xsl:when>
  113. <xsl:otherwise>descending</xsl:otherwise>
  114. </xsl:choose>
  115. </xsl:attribute>
  116. <xsl:choose>
  117. <xsl:when test="$_sortOrder != ''">
  118. <xsl:value-of select="$_sortColumn"/>
  119. </xsl:when>
  120. <xsl:otherwise>
  121. <xsl:text>displaySequence</xsl:text>
  122. </xsl:otherwise>
  123. </xsl:choose>
  124. </nav:sort>
  125. <!-- common nav params -->
  126. <admui:commonNavParams/>
  127. </nav:getContainer>
  128. </SOAP-ENV:Body>
  129. </SOAP-ENV:Envelope>
  130. </xts:request>
  131. </response>
  132. </xts:append>
  133. </xts:sequence>
  134. </xsl:template>
  135. </xsl:stylesheet>
  136. </xts:block>
  137. <!--
  138. When only one folder at root get the children of that folder
  139. -->
  140. <xts:block id="getContent2" dependency="getContent" nodelist="env, state, header, session, system, http, configProps, response" type="exec" mode="interpret" processor="XSLT" mandatory="false" condition=".[(not(/root/session/param[@name='e_showTenantInfo']) or /root/session/param[@name='e_showTenantInfo']!='true') and not(/root/response/*[local-name()='getContainerResponse']/*[local-name()='container']/*[local-name()='fullPath']/*[local-name()='pathStep']/*[local-name()='pathStep']) and /root/response/*[local-name()='getContainerResponse']/*[local-name()='container']/*[local-name()='content' and @total='1']]">
  141. <xts:logicsheet path="cogadmin/logicsheets/admin.xslt"/>
  142. <xts:logicsheet path="cogadmin/logicsheets/presentation/filters.xslt"/>
  143. <xts:logicsheet path="/cogadmin/logicsheets/buslogic.xslt"/>
  144. <xsl:stylesheet version="1.0"
  145. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  146. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  147. xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  148. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  149. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  150. xmlns:flt="http://developer.cognos.com/schemas/uic/presentation/filters/"
  151. xmlns:admui="http://developer.cognos.com/schemas/xts/admui"
  152. xmlns:nav="http://developer.cognos.com/schemas/cps/navigation/1/"
  153. exclude-result-prefixes="xsl xts SOAP-ENV bus admui xtsext flt nav">
  154. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  155. <!-- common pager variables -->
  156. <admui:pagerVariables pagerName="capabilities"/>
  157. <!-- common variables -->
  158. <admui:variables/>
  159. <xsl:variable name="path" select="/root/response/nav:getContainerResponse/nav:container/nav:content/*/nav:id"/>
  160. <xsl:template match="/">
  161. <xts:sequence>
  162. <xts:append select="/root">
  163. <updatedPath><xsl:value-of select="$path"/></updatedPath>
  164. </xts:append>
  165. <xts:replace select="/root/response">
  166. <response>
  167. <xts:request href="bus://dispatcher" protocol="NAV" responseEnvelope="false" outputHeader="false">
  168. <SOAP-ENV:Envelope 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">
  169. <SOAP-ENV:Header>
  170. <xsl:copy-of select="/root/header/bus:biBusHeader"/>
  171. </SOAP-ENV:Header>
  172. <SOAP-ENV:Body>
  173. <nav:getContainer>
  174. <nav:id>
  175. <xsl:value-of select="$path"/>
  176. </nav:id>
  177. <nav:childObjectFilter>
  178. <nav:itemType>securedFunction</nav:itemType>
  179. <nav:itemType>securedFeature</nav:itemType>
  180. <nav:itemType>capability</nav:itemType>
  181. </nav:childObjectFilter>
  182. <nav:validateTag fault="true"/>
  183. <nav:scope><xsl:value-of select="$path"/>/*</nav:scope>
  184. <nav:property name="defaultName"/>
  185. <nav:property name="ancestors"/>
  186. <nav:property name="hasChildren"/>
  187. <nav:property name="permissions"/>
  188. <nav:property name="searchPath"/>
  189. <nav:property name="lastModifiedDate"/>
  190. <nav:property name="displaySequence"/>
  191. <nav:property name="position"/>
  192. <nav:property name="screenTip"/>
  193. <nav:property name="iconURI"/>
  194. <nav:property name="userCapability"/>
  195. <nav:property name="fullPath"/>
  196. <nav:property name="ancestors"/>
  197. <nav:property name="parentId"/>
  198. <nav:property name="type"/>
  199. <nav:property name="internalId"/>
  200. <nav:property name="name"/>
  201. <nav:property name="icons"/>
  202. <nav:property name="hidden"/>
  203. <!-- nav properties -->
  204. <nav:maxObjects><xsl:value-of select="$maxObjects"/></nav:maxObjects>
  205. <nav:skipObjects><xsl:value-of select="$skipObjects"/></nav:skipObjects>
  206. <nav:sort>
  207. <xsl:variable name="_sortColumn">
  208. <xsl:choose>
  209. <xsl:when test="key('env-param', 'sort_column') != ''">
  210. <xsl:value-of select="key('env-param', 'sort_column')"/>
  211. </xsl:when>
  212. <xsl:otherwise>
  213. <xsl:value-of select="key('env-param', 'init_sort_column')"/>
  214. </xsl:otherwise>
  215. </xsl:choose>
  216. </xsl:variable>
  217. <xsl:variable name="_sortOrder">
  218. <xsl:choose>
  219. <xsl:when test="key('env-param', 'sort_column') != ''">
  220. <xsl:value-of select="key('env-param', 'sort_order')"/>
  221. </xsl:when>
  222. <xsl:otherwise>
  223. <xsl:value-of select="key('env-param', 'init_sort_order') "/>
  224. </xsl:otherwise>
  225. </xsl:choose>
  226. </xsl:variable>
  227. <xsl:attribute name="order">
  228. <xsl:choose>
  229. <xsl:when test="$_sortOrder='ascending'">ascending</xsl:when>
  230. <xsl:when test="$_sortOrder='descending'">descending</xsl:when>
  231. <xsl:otherwise>descending</xsl:otherwise>
  232. </xsl:choose>
  233. </xsl:attribute>
  234. <xsl:choose>
  235. <xsl:when test="$_sortOrder != ''">
  236. <xsl:value-of select="$_sortColumn"/>
  237. </xsl:when>
  238. <xsl:otherwise>
  239. <xsl:text>displaySequence</xsl:text>
  240. </xsl:otherwise>
  241. </xsl:choose>
  242. </nav:sort>
  243. <!-- common nav params -->
  244. <admui:commonNavParams/>
  245. </nav:getContainer>
  246. </SOAP-ENV:Body>
  247. </SOAP-ENV:Envelope>
  248. </xts:request>
  249. </response>
  250. </xts:replace>
  251. </xts:sequence>
  252. </xsl:template>
  253. </xsl:stylesheet>
  254. </xts:block>
  255. <!-- Merge the tenantNames into the response -->
  256. <xts:block processor="XSLT" type="exec" mandatory="false"
  257. path="/portal/tenancy/mergeTenantNames.xslt"
  258. id="mergeTenantNames"
  259. dependency="getContent2"
  260. condition=".[/root/session/param[@name='e_showTenantInfo']='true']">
  261. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  262. </xts:block>
  263. <xts:block id="getMeta" type="exec" mode="interpret" nodelist="env, updatedPath" processor="XSLT">
  264. <xsl:stylesheet version="1.0"
  265. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  266. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  267. xmlns:val="http://developer.cognos.com/schemas/validator/1/"
  268. xmlns:xos="http://developer.cognos.com/schemas/xts/output/"
  269. xmlns:nav="http://developer.cognos.com/schemas/cps/navigation/1/"
  270. exclude-result-prefixes="xsl xts xos val xtsext nav">
  271. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  272. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  273. <xsl:variable name="path" select="/root/response/nav:getContainerResponse/nav:container/nav:content/*/nav:id"/>
  274. <xsl:template match="/">
  275. <xts:sequence>
  276. <xts:append select="/root/output">
  277. <xos:part>
  278. <xos:entityHeader>
  279. <xos:param name="Content-Type">text/xml; charset=utf-8</xos:param>
  280. </xos:entityHeader>
  281. <xos:entityBody>
  282. <fragment>
  283. <info>
  284. <title>
  285. <xts:string id="IDS_ADM_CAPABILITIES"/>
  286. </title>
  287. </info>
  288. <preferredTitle>
  289. <xts:string id="IDS_ADM_CAPABILITIES"/>
  290. </preferredTitle>
  291. <meta>
  292. <transientProperties name="capability_name">
  293. <validate>
  294. <val:name>capability_name</val:name>
  295. <val:rule>
  296. <val:type>
  297. <val:string maxLength="255"/>
  298. </val:type>
  299. </val:rule>
  300. </validate>
  301. </transientProperties>
  302. <transientProperties name="capability_path">
  303. <validate>
  304. <val:name>capability_path</val:name>
  305. <val:rule>
  306. <val:type>
  307. <val:string maxLength="255"/>
  308. </val:type>
  309. </val:rule>
  310. </validate>
  311. </transientProperties>
  312. <requiredCapabilities>canUseCapabilitiesTool</requiredCapabilities>
  313. </meta>
  314. <state>
  315. <xsl:variable name="state">
  316. <xsl:text>&lt;param name="searchMode"&gt;</xsl:text>
  317. <xsl:value-of select="xtsext:xmlencode(string(key('env-param', 'searchMode')))"/>
  318. <xsl:text>&lt;/param&gt;</xsl:text>
  319. </xsl:variable>
  320. <xsl:value-of select="xtsext:base64encode($state,true())"/>
  321. </state>
  322. </fragment>
  323. </xos:entityBody>
  324. </xos:part>
  325. </xts:append>
  326. </xts:sequence>
  327. </xsl:template>
  328. </xsl:stylesheet>
  329. </xts:block>
  330. <xts:block id="renderMarkup" dependency="frag_init getMeta mergeTenantNames" nodelist="env, state, user, system" type="exec" mode="interpret" processor="XSLT">
  331. <xts:logicsheet path="cogadmin/logicsheets/admin.xslt"/>
  332. <xsl:stylesheet version="1.0"
  333. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  334. xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  335. xmlns:xos="http://developer.cognos.com/schemas/xts/output/"
  336. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  337. xmlns:nemo="http://developer.cognos.com/nemo"
  338. xmlns:nav="http://developer.cognos.com/schemas/cps/navigation/1/"
  339. xmlns:admui="http://developer.cognos.com/schemas/xts/admui"
  340. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  341. exclude-result-prefixes="xsl nemo admui xts SOAP-ENV xos bus nav">
  342. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  343. <xsl:template match="/">
  344. <xts:sequence>
  345. <xts:append select="/root/output/*[local-name()='part']/*[local-name()='entityBody']/fragment">
  346. <markup>
  347. <mimeType>text/html</mimeType>
  348. <markupXml>
  349. <xts:transform src="/cogadmin/transforms/presentation/renderFragment.xslt" processor="XSLT">
  350. <xts:param name="messageBase">/messages/cogadminuimsgs.xml</xts:param>
  351. <xts:param name="logicsheet">/cogadmin/logicsheets/admin.xslt</xts:param>
  352. <root>
  353. <xts:transform src="/cogadmin/transforms/gen-ui-markup/capabilities.xslt" processor="XSLT">
  354. <xts:param name="messageBase">/messages/cogadminuimsgs.xml</xts:param>
  355. <xts:param name="logicsheet">/cogadmin/logicsheets/presentation/common.xslt</xts:param>
  356. <xts:param name="logicsheet">/cogadmin/logicsheets/presentation/pager.xslt</xts:param>
  357. <xts:param name="logicsheet">/cogadmin/logicsheets/admin.xslt</xts:param>
  358. <root>
  359. <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"/>
  360. </root>
  361. </xts:transform>
  362. <xts:queryNode select="/root/system | /root/session | /root/user"/>
  363. </root>
  364. </xts:transform>
  365. </markupXml>
  366. </markup>
  367. </xts:append>
  368. </xts:sequence>
  369. </xsl:template>
  370. </xsl:stylesheet>
  371. </xts:block>
  372. </xts:morphlet>