editCubeConfiguration.xts 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345
  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. 2012, 2013
  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">
  9. <xts:block mandatory="false" processor="XSLT" type="exec" id="getContent" condition=".[/root/env/param[@name='action']='SetCubeProperties']">
  10. <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
  11. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  12. <xts:logicsheet path="logicsheets/portal.xsl"/>
  13. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
  14. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  15. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  16. xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
  17. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  18. xmlns:resourceId="xalan://com.cognos.admin.xts.ResourceId">
  19. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  20. <pf:variables/>
  21. <xsl:template match="/">
  22. <xsl:variable name="qsResId" select="resourceId:getResourceId(/root/env/param[@name='actionResourceID'],'queryService')"/>
  23. <xsl:variable name="id" select="resourceId:getId($qsResId)"/>
  24. <xsl:variable name="searchPath">
  25. <xsl:text>storeID('</xsl:text><xsl:value-of select="$id"/><xsl:text>')</xsl:text>
  26. </xsl:variable>
  27. <xts:sequence>
  28. <xts:append select="/root">
  29. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  30. <send:request provider="cm">
  31. <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
  32. <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  33. <cm:search>
  34. <xsl:value-of select="$searchPath"/>
  35. </cm:search>
  36. <cm:properties>
  37. <cm:property name="storeID"/>
  38. <cm:property name="defaultName"/>
  39. <cm:property name="permissions"/>
  40. <cm:property name="qsROLAPCubeConfigurations"/>
  41. </cm:properties>
  42. </cm:query>
  43. </xts:transform>
  44. </send:request>
  45. </xts:transform>
  46. </xts:append>
  47. </xts:sequence>
  48. </xsl:template>
  49. </xsl:stylesheet>
  50. </xts:block>
  51. <!--
  52. ===============================================================================================
  53. getDetails - get details (e.g. localed rolap cube name and icon) information from DataSource object
  54. ===============================================================================================
  55. -->
  56. <xts:block id="getDetails" processor="XSLT" type="exec" mode="interpret" dependency="getContent" mandatory="false">
  57. <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
  58. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  59. <xsl:stylesheet version="1.0"
  60. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  61. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  62. xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/"
  63. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
  64. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  65. exclude-result-prefixes="xts xsl send cml cm pf">
  66. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  67. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  68. <xsl:template match="/">
  69. <xts:sequence>
  70. <xts:delete select="/root/env/param[@name='has_write_permission']"/>
  71. <xts:append select="/root/env">
  72. <param name="has_write_permission">
  73. <xsl:choose>
  74. <xsl:when test="contains(concat(' ', /root/cm:queryResponse/*/cm:permissions, ' '), ' write ')">
  75. <xsl:value-of select="'true'"/>
  76. </xsl:when>
  77. <xsl:otherwise>
  78. <xsl:value-of select="'false'"/>
  79. </xsl:otherwise>
  80. </xsl:choose>
  81. </param>
  82. </xts:append>
  83. </xts:sequence>
  84. <xts:sequence>
  85. <xsl:variable name="qsROLAPCubeConfigurations" select="/root/cm:queryResponse/*/cm:qsROLAPCubeConfigurations"/>
  86. <xsl:if test="$qsROLAPCubeConfigurations != ''">
  87. <xts:append>
  88. <wholeEntries>
  89. <xsl:for-each select="$qsROLAPCubeConfigurations/*">
  90. <xsl:variable name="cubeConfigType">
  91. <xsl:choose>
  92. <xsl:when test="local-name()='value'">
  93. <!--Cube was derived from FMD quick publish. qsROLAPCubeConfigurations array "item" is actually "value" and is not
  94. consumed traditionally via post-process.xslt. Handle this by deriving the configType from value/@type-->
  95. <xsl:value-of select="substring-after(@*[local-name()='type'],':')"/>
  96. </xsl:when>
  97. <xsl:otherwise>
  98. <xsl:value-of select="local-name()"/>
  99. </xsl:otherwise>
  100. </xsl:choose>
  101. </xsl:variable>
  102. <xsl:element name="{$cubeConfigType}" namespace="http://developer.cognos.com/schemas/xts-cm/1/">
  103. <xsl:copy-of select="*"/>
  104. <xts:transform src="transforms/portal/rolapCubeConfigurations/buildFormatedEntries.xslt" processor="XSLT">
  105. <rolapDataSourceDetails>
  106. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  107. <send:request provider="cm" testBlock="test">
  108. <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
  109. <cm:query>
  110. <cm:requests>
  111. <cm:query>
  112. <cm:search>CAMID(&quot;:&quot;)/rolapDataSource[@name='<xsl:value-of select="cm:dataSourceName"/>']|CAMID(&quot;:&quot;)/rolapVirtualDataSource[@name='<xsl:value-of select="cm:dataSourceName"/>']</cm:search>
  113. <cm:properties>
  114. <cm:property name="defaultName"/>
  115. <cm:property name="hidden"/>
  116. </cm:properties>
  117. </cm:query>
  118. </cm:requests>
  119. </cm:query>
  120. </xts:transform>
  121. </send:request>
  122. </xts:transform>
  123. </rolapDataSourceDetails>
  124. </xts:transform>
  125. </xsl:element>
  126. </xsl:for-each>
  127. </wholeEntries>
  128. </xts:append>
  129. </xsl:if>
  130. </xts:sequence>
  131. </xsl:template>
  132. </xsl:stylesheet>
  133. </xts:block>
  134. <!--
  135. ===============================================================================================
  136. getDetails - get details (e.g. localed rolap cube name and icon) information from DataSource object
  137. ===============================================================================================
  138. -->
  139. <xts:block id="tbd" processor="XSLT" type="exec" mode="interpret" dependency="getDetails" mandatory="false">
  140. <xts:logicsheet path="logicsheets/portal.xsl"/>
  141. <xsl:stylesheet version="1.0"
  142. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  143. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  144. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  145. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  146. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  147. exclude-result-prefixes="xts xsl pf xtsext cm">
  148. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  149. <pf:variables/>
  150. <xsl:template match="/">
  151. <xts:sequence>
  152. <xts:append select="/root/env">
  153. <xts:transform src="portal/controls/create_web64_param.xslt" processor="XSLT">
  154. <param name="whole_entries">
  155. <passport><xsl:value-of select="$passport"/></passport>
  156. <markup>
  157. <xts:transform name="XMLEncode">
  158. <xts:queryNode select="/root/wholeEntries"/>
  159. </xts:transform>
  160. </markup>
  161. </param>
  162. </xts:transform>
  163. </xts:append>
  164. </xts:sequence>
  165. </xsl:template>
  166. </xsl:stylesheet>
  167. </xts:block>
  168. <xts:block id="buildFragment" type="exec" dependency="tbd" nodelist="header, env,messages,user,response" processor="XSLT" condition=".[not(/root/env/param[@name='ps_nav_op']='pop')]">
  169. <xts:logicsheet path="/cogadmin/logicsheets/presentation/common.xslt"/>
  170. <xts:logicsheet path="/cogadmin/logicsheets/admin.xslt"/>
  171. <xsl:stylesheet version="1.0"
  172. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  173. xmlns:xos="http://developer.cognos.com/schemas/xts/output/"
  174. xmlns:ui="http://developer.cognos.com/schemas/ui/presentation/markup/"
  175. xmlns:uic="http://developer.cognos.com/schemas/uic/presentation/markup/"
  176. xmlns:adm-prop="http://developer.cognos.com/admin/properties"
  177. xmlns:wsrf-rp="http://docs.oasis-open.org/wsrf/rp-2"
  178. xmlns:admui="http://developer.cognos.com/schemas/xts/admui"
  179. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  180. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
  181. xmlns:cm="http://developer.cognos.com/schemas/bibus/3/"
  182. xmlns:resourceId="xalan://com.cognos.admin.xts.ResourceId"
  183. xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
  184. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  185. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  186. exclude-result-prefixes="xsl xts xos uic adm-prop wsrf-rp admui xtsext dp resourceId">
  187. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  188. <admui:variables/>
  189. <xsl:template match="/">
  190. <xts:sequence>
  191. <xts:append select="/root">
  192. <fragment>
  193. <uic:fragment>
  194. <script>
  195. <!-- display the popup -->
  196. function buildUrl(current, name, value) {
  197. return current + '&amp;'+name+'='+encodeURIComponent(value);
  198. }
  199. <xsl:variable name="storeID" select="/root//*[local-name()='queryResponse']//*[local-name()='storeID']"/>
  200. var url = '<xsl:value-of select="concat(/root/configProps/param[@name = 'cps']/property[@name ='gateway']/., '?b_action=xts.run')"/>';
  201. <xsl:variable name="dsResourceId" select="/root/env/param[@name='actionResourceID']"/>
  202. <xsl:variable name="cubeResourceId">
  203. <xsl:variable name="rolapCubeResId" select="resourceId:getResourceId($dsResourceId,'rolapCube')"/>
  204. <xsl:choose>
  205. <xsl:when test="$rolapCubeResId != ''">
  206. <xsl:value-of select="$rolapCubeResId"/>
  207. </xsl:when>
  208. <xsl:otherwise>
  209. <xsl:value-of select="resourceId:getResourceId($dsResourceId,'rolapVirtualCube')"/>
  210. </xsl:otherwise>
  211. </xsl:choose>
  212. </xsl:variable>
  213. <xsl:variable name="cubeName" select="resourceId:getId($cubeResourceId)"/>
  214. var cubeName = '<xsl:value-of select="$cubeName"/>';
  215. url = buildUrl(url, 'm', 'portal/settings_rolapcube_configurations_edit.xts');
  216. url = buildUrl(url, 'selected_cube',cubeName);
  217. url = buildUrl(url, 'selected_localizedCube',cubeName);
  218. url = buildUrl(url, 'm_obj','storeID(&quot;<xsl:value-of select="$storeID"/>&quot;)');
  219. url = buildUrl(url, 'm_class','configurationFolder');
  220. url = buildUrl(url, 'backURL','javascript:parent._THIS_callBack();');
  221. url = buildUrl(url, 'whole_entries','<xsl:value-of select="/root/env/param[@name='whole_entries']"/>');
  222. url = buildUrl(url, 'has_write_permission', 'true');
  223. url = buildUrl(url, 'ps_nav_stack', 'cogadmin/controls/datastores/editCubeConfiguration.xts');
  224. url = buildUrl(url, 'ps_nav_source', 'cogadmin/controls/datastores/editCubeConfiguration.xts');
  225. url = buildUrl(url, 'actionResourceID', '<xsl:value-of select="/root/env/param[@name='actionResourceID']"/>');
  226. ui_modal_dialog.open(url,false,true,true);
  227. </script>
  228. </uic:fragment>
  229. </fragment>
  230. </xts:append>
  231. </xts:sequence>
  232. </xsl:template>ves
  233. </xsl:stylesheet>
  234. </xts:block>
  235. <xts:block id="executeConfigureCube" type="exec" dependency="tbd" nodelist="header, env,messages,user,response" processor="XSLT" condition=".[/root/env/param[@name='controller_state']='editEntry']">
  236. <xts:logicsheet path="/cogadmin/logicsheets/presentation/common.xslt"/>
  237. <xts:logicsheet path="/cogadmin/logicsheets/admin.xslt"/>
  238. <xsl:stylesheet version="1.0"
  239. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  240. xmlns:xos="http://developer.cognos.com/schemas/xts/output/"
  241. xmlns:ui="http://developer.cognos.com/schemas/ui/presentation/markup/"
  242. xmlns:uic="http://developer.cognos.com/schemas/uic/presentation/markup/"
  243. xmlns:adm-prop="http://developer.cognos.com/admin/properties"
  244. xmlns:wsrf-rp="http://docs.oasis-open.org/wsrf/rp-2"
  245. xmlns:admui="http://developer.cognos.com/schemas/xts/admui"
  246. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  247. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
  248. xmlns:cm="http://developer.cognos.com/schemas/bibus/3/"
  249. xmlns:resourceId="xalan://com.cognos.admin.xts.ResourceId"
  250. xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
  251. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  252. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  253. exclude-result-prefixes="xsl xts xos uic adm-prop wsrf-rp admui xtsext dp resourceId">
  254. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  255. <admui:variables/>
  256. <xsl:template match="/">
  257. <xts:sequence>
  258. <xts:request protocol="ExecuteResourceAction" responseEnvelope="true">
  259. <!-- xsl:copy-of select="/root/envelope/*[1]"/-->
  260. <SOAP-ENV:Envelope
  261. xmlns:wsrf-rp="http://docs.oasis-open.org/wsrf/rp-2"
  262. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  263. xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  264. xmlns:nemo="http://developer.cognos.com/nemo"
  265. xmlns:muws-p2-xs="http://docs.oasis-open.org/wsdm/muws2-2.xsd"
  266. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  267. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  268. xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
  269. <SOAP-ENV:Header>
  270. <xsl:copy-of select="/root/header/bus:biBusHeader"/>
  271. <nemo:cogadminHeader>
  272. <nemo:ResourceIdentifier><xsl:value-of select="/root/env/param[@name='actionResourceID']"/></nemo:ResourceIdentifier>
  273. </nemo:cogadminHeader>
  274. </SOAP-ENV:Header>
  275. <SOAP-ENV:Body>
  276. <ns1:ExecuteResourceAction xmlns:ns1="http://developer.cognos.com/admin/properties">
  277. <ns1:Name>SetCubeProperties</ns1:Name>
  278. <xsl:for-each select="/root/env/param">
  279. <ns1:Argument name="{@name}"><xsl:value-of select="text()"/></ns1:Argument>
  280. </xsl:for-each>
  281. </ns1:ExecuteResourceAction>
  282. </SOAP-ENV:Body>
  283. </SOAP-ENV:Envelope>
  284. </xts:request>
  285. </xts:sequence>
  286. </xsl:template>ves
  287. </xsl:stylesheet>
  288. </xts:block>
  289. <xts:block id="renderMarkup" type="exec" processor="XML" nodelist="fragment" dependency="buildFragment"
  290. xmlns:xos="http://developer.cognos.com/schemas/xts/output/">
  291. <xts:sequence>
  292. <xts:append select="/root/output">
  293. <xos:part>
  294. <xos:entityHeader>
  295. <xos:param name="Content-Type">text/xml; charset=utf-8</xos:param>
  296. </xos:entityHeader>
  297. <xos:entityBody>
  298. <markup>
  299. <mimeType>text/html</mimeType>
  300. <markupXml>
  301. <xts:transform src="/cogadmin/transforms/presentation/renderFragment.xslt" processor="XSLT">
  302. <xts:param name="messageBase">/messages/cogadminuimsgs.xml</xts:param>
  303. <xts:param name="logicsheet">/cogadmin/logicsheets/admin.xslt</xts:param>
  304. <root>
  305. <xts:queryNode select="/root/envelope/* | /root/fragment/* | /root/system | /root/session | /root/user"/>
  306. </root>
  307. </xts:transform>
  308. </markupXml>
  309. </markup>
  310. </xos:entityBody>
  311. </xos:part>
  312. </xts:append>
  313. </xts:sequence>
  314. </xts:block>
  315. </xts:morphlet>