datasets.xts 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327
  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. 2014
  6. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. -->
  8. <xts:morphlet xmlns:xts="http://developer.cognos.com/schemas/xts/" resolverBase="cogadmin" messageBase="messages/cogadminuimsgs.xml" requiredCapability="canUseMyDataSetsAdministration">
  9. <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"/>
  10. <!--
  11. Get the datasets
  12. -->
  13. <xts:block id="getContent" dependency="frag_init" nodelist="env, header, session, system, http, configProps" type="exec" mode="interpret" processor="XSLT">
  14. <xts:logicsheet path="logicsheets/tenantlogic.xsl"/>
  15. <xts:logicsheet path="cogadmin/logicsheets/admin.xslt"/>
  16. <xts:logicsheet path="cogadmin/logicsheets/presentation/filters.xslt"/>
  17. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  18. <xsl:stylesheet version="1.0"
  19. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  20. xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  21. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  22. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  23. xmlns:flt="http://developer.cognos.com/schemas/uic/presentation/filters/"
  24. xmlns:admui="http://developer.cognos.com/schemas/xts/admui"
  25. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
  26. exclude-result-prefixes="xsl xts SOAP-ENV bus admui xtsext flt send">
  27. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  28. <!-- common variables -->
  29. <admui:variables/>
  30. <!-- common pager variables -->
  31. <admui:pagerVariables pagerName="datasets"/>
  32. <!--
  33. build a searchPath to find the datasets
  34. -->
  35. <xsl:variable name="datasetsPath">
  36. <!-- add the scope filter -->
  37. <xsl:if test="key('env-param', 'dataset_filter_scope') != ''">
  38. <xsl:value-of select="key('env-param', 'dataset_filter_scope')"/>
  39. </xsl:if>
  40. <xsl:text>//dataSet[permission('read')]</xsl:text>
  41. <!-- add the refreshed filter -->
  42. <xsl:if test="key('env-param', 'dataset_filter_age') != ''">
  43. <xsl:text>[@dataModificationTime &lt; '</xsl:text>
  44. <xsl:value-of select="xtsext:getDateTimeOffset( xtsext:getCurrentDateTime(string('GMT')), -1 * number(key('env-param', 'dataset_filter_age')), string('hour'))"/>
  45. <xsl:text>']</xsl:text>
  46. </xsl:if>
  47. <!-- add the owned by filter -->
  48. <xsl:if test="key('env-param', 'dataset_filter_owned_by') != ''">
  49. <xsl:text>[containsReferences(@owner, </xsl:text>
  50. <xsl:value-of select="key('env-param', 'dataset_filter_owned_by')"/>
  51. <xsl:text>)]</xsl:text>
  52. </xsl:if>
  53. <!-- add the tenantid filter -->
  54. <xsl:if test="key('env-param', 'dataset_filter_tenantid') != ''">
  55. <xsl:text>[@tenantID='</xsl:text>
  56. <xsl:value-of select="key('env-param', 'dataset_filter_tenantid')"/>
  57. <xsl:text>']</xsl:text>
  58. </xsl:if>
  59. </xsl:variable>
  60. <xsl:template match="/">
  61. <xts:sequence>
  62. <xts:append select="/root">
  63. <xts:transform src="/cogadmin/transforms/datasets/decodeSpecification.xslt" processor="XSLT">
  64. <response>
  65. <xts:request href="bus://dispatcher" protocol="NAV" responseEnvelope="false" outputHeader="false">
  66. <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">
  67. <SOAP-ENV:Header>
  68. <xsl:copy-of select="/root/header/bus:biBusHeader"/>
  69. </SOAP-ENV:Header>
  70. <SOAP-ENV:Body>
  71. <nav:search>
  72. <!-- nav options -->
  73. <nav:validateTag fault="true"/>
  74. <nav:scope><xsl:value-of select="$datasetsPath"/></nav:scope>
  75. <nav:property name="fullPath"/>
  76. <nav:property name="owner"/>
  77. <nav:property name="icons"/>
  78. <nav:property name="searchPath"/>
  79. <nav:property name="internalId"/>
  80. <nav:property name="times"/>
  81. <nav:property name="position"/>
  82. <nav:property name="defaultName"/>
  83. <nav:property name="dataModificationTime"/>
  84. <nav:property name="dataSetSize"/>
  85. <nav:property name="lastModifiedDate"/>
  86. <nav:property name="internalId"/>
  87. <nav:property name="searchPathForURL"/>
  88. <nav:property name="priority"/>
  89. <nav:property name="permissions"/>
  90. <nav:property name="screenTip"/>
  91. <nav:property name="tenantID"/>
  92. <nav:property name="hidden"/>
  93. <nav:property name="shown"/>
  94. <nav:property name="specification"/>
  95. <!-- nav properties -->
  96. <nav:recursive>false</nav:recursive>
  97. <nav:param name="backUrl">false</nav:param>
  98. <nav:param name="urlFlags">h1cu</nav:param>
  99. <nav:param name="mode">admin</nav:param>
  100. <nav:maxObjects><xsl:value-of select="$maxObjects"/></nav:maxObjects>
  101. <nav:skipObjects><xsl:value-of select="$skipObjects"/></nav:skipObjects>
  102. <nav:sort>
  103. <xsl:attribute name="order">
  104. <xsl:choose>
  105. <xsl:when test="key('env-param', 'sort_order')='ascending'">ascending</xsl:when>
  106. <xsl:otherwise>descending</xsl:otherwise>
  107. </xsl:choose>
  108. </xsl:attribute>
  109. <xsl:choose>
  110. <xsl:when test="key('env-param', 'sort_column') != ''">
  111. <xsl:value-of select="key('env-param', 'sort_column')"/>
  112. </xsl:when>
  113. <xsl:otherwise>dataModificationTime</xsl:otherwise>
  114. </xsl:choose>
  115. </nav:sort>
  116. <!-- common nav params -->
  117. <admui:commonNavParams/>
  118. </nav:search>
  119. </SOAP-ENV:Body>
  120. </SOAP-ENV:Envelope>
  121. </xts:request>
  122. </response>
  123. </xts:transform>
  124. </xts:append>
  125. </xts:sequence>
  126. </xsl:template>
  127. </xsl:stylesheet>
  128. </xts:block>
  129. <!-- Merge the tenantNames into the response -->
  130. <xts:block processor="XSLT" type="exec" mandatory="false"
  131. path="/portal/tenancy/mergeTenantNames.xslt"
  132. id="mergeTenantNames"
  133. dependency="getContent"
  134. condition=".[/root/session/param[@name='e_showTenantInfo']='true']">
  135. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  136. </xts:block>
  137. <!--
  138. Get the owned by information
  139. -->
  140. <xts:block id="getOwnedBy" dependency="frag_init mergeTenantNames" nodelist="header, response" type="exec" mode="interpret" processor="XSLT" condition=".[/root/response/*[local-name()='searchResponse']/*[local-name()='content']/*[local-name()='item']/*[local-name()='owner']/*[local-name()='internalId' and . != '']]" mandatory="false">
  141. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  142. <xsl:stylesheet version="1.0"
  143. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  144. xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  145. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
  146. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  147. xmlns:nav="http://developer.cognos.com/schemas/cps/navigation/1/"
  148. exclude-result-prefixes="xsl xts SOAP-ENV bus nav">
  149. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  150. <xsl:template match="/">
  151. <xts:sequence>
  152. <xts:append select="/root">
  153. <ownedBy>
  154. <send:request provider="cm">
  155. <cm:query xmlns:cm="http://developer.cognos.com/schemas/bibus/3/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  156. <requests xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="cm:queryRequest[]">
  157. <xsl:for-each select="/root/response/nav:searchResponse/nav:content/nav:item">
  158. <!-- most users won't have access to the credential, so we need parse the user's searchPath from the credential searchPath -->
  159. <item xsi:type="cm:queryRequest">
  160. <search xsi:type="xsd:string"><xsl:value-of select="nav:owner/nav:searchPath"/></search>
  161. <properties xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="cm:propEnum[]">
  162. <item xsi:type="cm:propEnum">storeID</item>
  163. <item xsi:type="cm:propEnum">defaultName</item>
  164. <item xsi:type="cm:propEnum">userName</item>
  165. <item xsi:type="cm:propEnum">searchPath</item>
  166. <item xsi:type="cm:propEnum">shown</item>
  167. </properties>
  168. </item>
  169. </xsl:for-each>
  170. </requests>
  171. </cm:query>
  172. </send:request>
  173. </ownedBy>
  174. </xts:append>
  175. </xts:sequence>
  176. </xsl:template>
  177. </xsl:stylesheet>
  178. </xts:block>
  179. <xts:block id="getMeta" type="exec" mode="interpret" nodelist="env" processor="XSLT">
  180. <xsl:stylesheet version="1.0"
  181. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  182. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  183. xmlns:xos="http://developer.cognos.com/schemas/xts/output/"
  184. exclude-result-prefixes="xsl xts xos xtsext">
  185. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  186. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  187. <xsl:template match="/">
  188. <xts:sequence>
  189. <xts:append select="/root/output">
  190. <xos:part>
  191. <xos:entityHeader>
  192. <xos:param name="Content-Type">text/xml; charset=utf-8</xos:param>
  193. </xos:entityHeader>
  194. <xos:entityBody>
  195. <fragment>
  196. <info>
  197. <title>
  198. <xts:string id="IDS_DST_TITLE"/>
  199. </title>
  200. </info>
  201. <preferredTitle>
  202. <xts:string id="IDS_DST_TITLE"/>
  203. </preferredTitle>
  204. <meta>
  205. <transientProperties name="timestamp">
  206. <validate>
  207. <name>timestamp</name>
  208. <ruleRef id="fragment-cogadmin:timestamp"/>
  209. </validate>
  210. </transientProperties>
  211. <transientProperties name="dataset_filter_age">
  212. <validate>
  213. <name>dataset_filter_age</name>
  214. <ruleRef id="fragment-cogadmin:filter_age"/>
  215. </validate>
  216. </transientProperties>
  217. <transientProperties name="dataset_filter_scope">
  218. <validate>
  219. <name>dataset_filter_scope</name>
  220. <ruleRef id="fragment-cogadmin:filter_scope"/>
  221. </validate>
  222. </transientProperties>
  223. <transientProperties name="dataset_filter_tenantid">
  224. <validate>
  225. <name>dataset_filter_tenantid</name>
  226. <ruleRef id="fragment-cogadmin:filter_tenantid"/>
  227. </validate>
  228. </transientProperties>
  229. <transientProperties name="dataset_filter_owned_by">
  230. <validate>
  231. <name>dataset_filter_owned_by</name>
  232. <ruleRef id="fragment-cogadmin:user"/>
  233. </validate>
  234. </transientProperties>
  235. <globalValidator>
  236. <parameter>
  237. <name>sort_order</name>
  238. <ruleRef id="fragment-cogadmin:sort_order"/>
  239. </parameter>
  240. </globalValidator>
  241. <requiredCapabilities>canUseMyDataSetsAdministration</requiredCapabilities>
  242. </meta>
  243. <state>
  244. <xsl:variable name="state">
  245. </xsl:variable>
  246. <xsl:value-of select="xtsext:base64encode($state,true())"/>
  247. </state>
  248. </fragment>
  249. </xos:entityBody>
  250. </xos:part>
  251. </xts:append>
  252. </xts:sequence>
  253. </xsl:template>
  254. </xsl:stylesheet>
  255. </xts:block>
  256. <!--
  257. render the HTML
  258. -->
  259. <xts:block id="renderMarkup" dependency="frag_init getMeta mergeTenantNames getOwnedBy" nodelist="cogadminChartUrl, env, user, system" type="exec" mode="interpret" processor="XSLT">
  260. <xts:logicsheet path="cogadmin/logicsheets/admin.xslt"/>
  261. <xsl:stylesheet version="1.0"
  262. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  263. xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  264. xmlns:xos="http://developer.cognos.com/schemas/xts/output/"
  265. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  266. xmlns:nemo="http://developer.cognos.com/nemo"
  267. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  268. xmlns:val="http://developer.cognos.com/schemas/validator/1/"
  269. xmlns:fragment="urn:cognos:fragments:validator"
  270. xmlns:fragment-cogadmin="urn:cognos:fragments:validator:cogadmin"
  271. xmlns:admui="http://developer.cognos.com/schemas/xts/admui"
  272. exclude-result-prefixes="xsl nemo xts SOAP-ENV xos bus admui">
  273. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  274. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  275. <xsl:template match="/">
  276. <xts:sequence>
  277. <xts:append select="/root/output/*[local-name()='part']/*[local-name()='entityBody']/fragment">
  278. <markup>
  279. <mimeType>text/html</mimeType>
  280. <markupXml>
  281. <xts:transform src="/cogadmin/transforms/presentation/renderFragment.xslt" processor="XSLT">
  282. <xts:param name="messageBase">/messages/cogadminuimsgs.xml</xts:param>
  283. <xts:param name="logicsheet">/cogadmin/logicsheets/admin.xslt</xts:param>
  284. <root>
  285. <!-- Generate UI markup using the response and metadata -->
  286. <xts:transform src="/cogadmin/transforms/gen-ui-markup/datasets.xslt" processor="XSLT">
  287. <xts:param name="messageBase">/messages/cogadminuimsgs.xml</xts:param>
  288. <xts:param name="logicsheet">/cogadmin/logicsheets/presentation/common.xslt</xts:param>
  289. <xts:param name="logicsheet">/cogadmin/logicsheets/presentation/pager.xslt</xts:param>
  290. <xts:param name="logicsheet">/cogadmin/logicsheets/admin.xslt</xts:param>
  291. <root>
  292. <xts:queryNode select="/root/*[local-name()='queryResponse'] | /root/response/* | /root/ownedBy | /root/mostRecentEvent | /root/user | /root/metadata | /root/system | /root/session | /root/env"/>
  293. </root>
  294. </xts:transform>
  295. <xts:queryNode select="/root/system | /root/session | /root/env | /root/user"/>
  296. </root>
  297. </xts:transform>
  298. </markupXml>
  299. </markup>
  300. </xts:append>
  301. </xts:sequence>
  302. </xsl:template>
  303. </xsl:stylesheet>
  304. </xts:block>
  305. </xts:morphlet>