settings_rolapcube_configurations_edit.xts 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327
  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. 2011, 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/" messageBase="messages/config.xml, messages/portal.xml, messages/portalRL.xml" resolverBase="prompting" requiredCapability="canUseAdministrationPortal">
  9. <!--
  10. ===============================================================================================
  11. formlogic_init
  12. ===============================================================================================
  13. -->
  14. <xts:block id="formlogic_init" type="exec" mode="interpret" processor="XSLT" path="/logicsheets/formlogic_init.xslt" nodelist="env,credential,system,http"/>
  15. <!--
  16. ===============================================================================================
  17. getConfig - retrieve the configuration UI settings
  18. ===============================================================================================
  19. -->
  20. <xts:block id="getConfig" type="exec" mode="interpret" processor="XSLT" path="transforms/portal/rolapCubeConfigurations/getParameters.xslt" dependency="formlogic_init"/>
  21. <!--
  22. ===============================================================================================
  23. restoreEntires - restore the whole entries from env
  24. ===============================================================================================
  25. -->
  26. <xts:block id="restoreEntires" processor="XSLT" type="exec" mode="interpret"
  27. path="transforms/portal/rolapCubeConfigurations/restoreEntries.xslt"
  28. dependency="getConfig" mandatory="false"/>
  29. <!--
  30. ===============================================================================================
  31. format - render the page
  32. ===============================================================================================
  33. -->
  34. <xts:block id="format" mode="output" processor="XSLT" type="exec" dependency="restoreEntires" mimeType="text/html" mandatory="false">
  35. <xts:logicsheet path="logicsheets/portal.xsl"/>
  36. <xts:logicsheet path="logicsheets/presentation/dialog/templates.xsl"/>
  37. <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
  38. <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
  39. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  40. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  41. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  42. <xts:logicsheet path="logicsheets/formlogic.xslt"/>
  43. <xts:logicsheet path="logicsheets/validation.xslt"/>
  44. <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
  45. <xts:logicsheet path="logicsheets/presentation/dialog/confirm.xslt"/>
  46. <xsl:stylesheet version="1.0"
  47. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  48. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  49. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  50. xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/"
  51. xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
  52. xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/"
  53. xmlns:dc="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/confirm/1/"
  54. xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
  55. xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
  56. xmlns:dt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/templates/"
  57. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  58. xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/"
  59. exclude-result-prefixes="xsl cm pf lyt dp df dc cf cp utml xts xtsext pf">
  60. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  61. <!-- Global variables ======================== -->
  62. <pf:variables/>
  63. <xsl:variable name="browserTitle">
  64. <xts:string id="IDS_RLP_CUBE_PROPERTIES_TITLE">
  65. <xts:param name="objectName">
  66. <span lang="{$contentLocale}"><xsl:value-of select="key('env-param', 'selected_localizedCube')"/></span>
  67. </xts:param>
  68. </xts:string>
  69. </xsl:variable>
  70. <xsl:variable name="selectedCubeConfiguration" select="/root/wholeEntries/*[*[local-name()='dataSourceName']=key('env-param', 'selected_cube')]"/>
  71. <xsl:variable name="prefix" select="'rlp_'"/>
  72. <xsl:variable name="encodedEditParams">
  73. <xsl:call-template name="serialize-xml">
  74. <xsl:with-param name="node-set" select="/root/paramsMetadata"/>
  75. </xsl:call-template>
  76. </xsl:variable>
  77. <!-- start the output -->
  78. <xsl:template match="/root">
  79. <pf:dojo>
  80. <require>com.ibm.cognos.ps.xts.validator.validate</require>
  81. </pf:dojo>
  82. <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html></xsl:text><dp:page longTitle="$browserTitle">
  83. <dp:meta>
  84. <pf:meta/>
  85. <!-- Standard meta tags -->
  86. </dp:meta>
  87. <dp:script>
  88. <dc:confirm-cancel/>
  89. <pf:help context="HID_PROPERTIES"/>
  90. <!-- Help system -->
  91. <!-- Define selectall and deselectall functions.-->
  92. <dt:selectDeselectAll/>
  93. <script language="javascript">
  94. dojo.addOnLoad(function(){
  95. (new com.ibm.cognos.ps.xts.validator.validate(document.pform, {
  96. prefix: '<xsl:value-of select="$prefix"/>',
  97. toggleCheckboxName: 'rolap_properties_edit_checkbox',
  98. metadata: '<xsl:value-of select="xtsext:javascriptencode(string($encodedEditParams))"/>',
  99. defaultLimits: {
  100. minInclusive: 0,
  101. maxInclusive: <xsl:value-of select="xtsext:javascriptencode(key('system-param', 'integerMaximumValue'))"/>
  102. },
  103. message: {
  104. IDS_RLP_INDICATION_AND: '<xts:string id="IDS_RLP_INDICATION_AND" encode="javascript"/>',
  105. IDS_RLP_VALIDATE_NOT_A_NUMBER: '<xts:string id="IDS_RLP_VALIDATE_NOT_A_NUMBER" encode="javascript"/>',
  106. IDS_RLP_VALIDATE_OUT_OF_BOUNDARY: '<xts:string id="IDS_RLP_VALIDATE_OUT_OF_BOUNDARY" encode="javascript"/>',
  107. IDS_RLP_VALIDATE_EMPTY_VALUE: '<xts:string id="IDS_RLP_VALIDATE_EMPTY_VALUE" encode="javascript"/>'
  108. }
  109. })).init();
  110. });
  111. </script>
  112. </dp:script>
  113. <utml:form name="pform" method="post" action="{$gateway}">
  114. <utml:read-only>
  115. <xsl:choose>
  116. <xsl:when test="key('env-param', 'has_write_permission') = 'false'">true</xsl:when>
  117. <xsl:otherwise>false</xsl:otherwise>
  118. </xsl:choose>
  119. </utml:read-only>
  120. <utml:input type="hidden" name="ps_nav_op" value=""/>
  121. <utml:input type="hidden" name="controller_state" value="editEntry" utml:update="false"/>
  122. <input type="hidden" name="actionResourceID" value="{key('env-param', 'actionResourceID')}"/>
  123. <!-- deal with the readonly parameters -->
  124. <xsl:for-each select="/root/paramsMetadata/parameter[@readonly='true' and (@objectDependency='baseROLAPCubeConfiguration' or @objectDependency=name($selectedCubeConfiguration))]">
  125. <xsl:variable name="paramName" select="@name"/>
  126. <xsl:variable name="displayValue">
  127. <xsl:choose>
  128. <xsl:when test="$selectedCubeConfiguration/*[local-name()=$paramName] != ''">
  129. <xsl:value-of select="$selectedCubeConfiguration/*[local-name()=$paramName]"/>
  130. </xsl:when>
  131. <xsl:otherwise>
  132. <xsl:value-of select="@default"/>
  133. </xsl:otherwise>
  134. </xsl:choose>
  135. </xsl:variable>
  136. <input type="hidden" name="{concat($prefix, @name)}" id="{concat($prefix, @name)}" value="{$displayValue}"/>
  137. </xsl:for-each>
  138. <!-- header -->
  139. <!-- dialog header -->
  140. <xsl:variable name="useBackUrl" select="key('env-param', 'ps_nav_stack') = 'cogadmin/controls/datastores/editCubeConfiguration.xts'"/>
  141. <dp:header useBackURL="$useBackUrl">
  142. <!-- header titles-->
  143. <dp:title showName="false">
  144. <xsl:copy-of select="$browserTitle"/>
  145. </dp:title>
  146. <dp:description>
  147. <xts:string id="IDS_RLP_CUBE_PROPERTIES_INTRO"/>
  148. </dp:description>
  149. </dp:header>
  150. <lyt:layout style="1">
  151. <lyt:section>
  152. <cp:table name="ROLAPCubeConfigurationsEdit" showEmptyMsg="true" iterate="/root/paramsMetadata/parameter[@readonly!='true' and (@objectDependency='baseROLAPCubeConfiguration' or @objectDependency=name($selectedCubeConfiguration))]" width="100%" cellpadding="3">
  153. <cp:action>
  154. <xsl:if test="key('env-param', 'has_write_permission') = 'true'">
  155. <a href="#" id="resetToDefault">
  156. <xsl:text/><xts:string id="IDS_RLP_RESET_TO_DEFAULT"/><xsl:text/>
  157. </a>
  158. </xsl:if>
  159. </cp:action>
  160. <!-- table headers -->
  161. <cp:tableHeader>
  162. <cp:columnHeader width="16" toggleName="rolap_properties_edit_checkbox" utml="utml"/>
  163. <cp:columnHeader width="16"/>
  164. <cp:columnHeader width="60%">
  165. <xts:string id="IDS_RLP_NAME"/>
  166. </cp:columnHeader>
  167. <cp:columnHeader>
  168. <xts:string id="IDS_RLP_VALUE"/>
  169. </cp:columnHeader>
  170. </cp:tableHeader>
  171. <!-- table cantents -->
  172. <cp:tableContent>
  173. <!-- checkbox -->
  174. <cp:columnContent valign="top">
  175. <xsl:if test="key('env-param', 'has_write_permission') = 'true'">
  176. <input type="checkbox" name="{concat('rolap_properties_edit_checkbox_', @name)}" id="{concat('rolap_properties_edit_checkbox_', @name)}" value="{@name}">
  177. <xsl:attribute name="aria-label"><xts:string id="IDS_SELECTION_FOR_PAGER_ITEM" encode="html"><xts:param name="pagerItemName"><xsl:value-of select="@label"/></xts:param></xts:string></xsl:attribute>
  178. </input>
  179. </xsl:if>
  180. </cp:columnContent>
  181. <cp:columnContent>
  182. <img width="16" height="16">
  183. <xsl:attribute name="src"><xsl:value-of select="concat($image_root, 'icon_parameter.gif')"/></xsl:attribute>
  184. </img>
  185. </cp:columnContent>
  186. <cp:columnContent id="lbl_{@name}">
  187. <xsl:if test="@condition"><xsl:text>&#160;&#160;&#160;&#160;</xsl:text></xsl:if>
  188. <xsl:value-of select="@label"/>
  189. </cp:columnContent>
  190. <cp:columnContent>
  191. <xsl:variable name="paramName" select="@name"/>
  192. <xsl:variable name="displayValue">
  193. <xsl:choose>
  194. <xsl:when test="$selectedCubeConfiguration/*[local-name()=$paramName] != ''">
  195. <xsl:value-of select="$selectedCubeConfiguration/*[local-name()=$paramName]"/>
  196. </xsl:when>
  197. <xsl:otherwise>
  198. <xsl:value-of select="@default"/>
  199. </xsl:otherwise>
  200. </xsl:choose>
  201. </xsl:variable>
  202. <xsl:choose>
  203. <xsl:when test="key('env-param', 'has_write_permission') = 'true'">
  204. <xsl:choose>
  205. <xsl:when test="@type='xsd:int'">
  206. <utml:input type="text" size="10" utml:update="true" utml:track="true" aria-labelledby="lbl_{@name}">
  207. <xsl:attribute name="id"><xsl:value-of select="concat($prefix, @name)"/></xsl:attribute>
  208. <utml:prefix><xsl:value-of select="$prefix"/></utml:prefix>
  209. <utml:name><xsl:value-of select="@name"/></utml:name>
  210. <utml:value><xsl:value-of select="$displayValue"/></utml:value>
  211. </utml:input>
  212. </xsl:when>
  213. <xsl:when test="@type='xsd:string'">
  214. <utml:input type="text" size="30" utml:update="true" utml:track="true" aria-labelledby="lbl_{@name}">
  215. <xsl:attribute name="id"><xsl:value-of select="concat($prefix, @name)"/></xsl:attribute>
  216. <utml:prefix><xsl:value-of select="$prefix"/></utml:prefix>
  217. <utml:name><xsl:value-of select="@name"/></utml:name>
  218. <utml:value><xsl:value-of select="$displayValue"/></utml:value>
  219. </utml:input>
  220. </xsl:when>
  221. <xsl:when test="@type='xsd:boolean' or @type='cm:automaticAggregateOptimizationEnum'">
  222. <xsl:variable name="trueValue">
  223. <xsl:choose>
  224. <xsl:when test="@trueValue"><xsl:value-of select="@trueValue"/></xsl:when>
  225. <xsl:otherwise>true</xsl:otherwise>
  226. </xsl:choose>
  227. </xsl:variable>
  228. <utml:input type="checkbox" utml:track="true" utml:update="true" utml:default-condition="$displayValue=$trueValue" style="text-indent: -4px; margin-left: 0pt;" aria-labelledby="lbl_{@name}">
  229. <xsl:attribute name="id"><xsl:value-of select="concat($prefix, @name)"/></xsl:attribute>
  230. <utml:prefix><xsl:value-of select="$prefix"/></utml:prefix>
  231. <utml:name><xsl:value-of select="@name"/></utml:name>
  232. <utml:value><xsl:value-of select="$trueValue"/></utml:value>
  233. </utml:input>
  234. </xsl:when>
  235. </xsl:choose>
  236. </xsl:when>
  237. <xsl:otherwise>
  238. <xsl:choose>
  239. <xsl:when test="@type='xsd:boolean' or @type='cm:automaticAggregateOptimizationEnum'">
  240. <xsl:variable name="trueValue">
  241. <xsl:choose>
  242. <xsl:when test="@trueValue"><xsl:value-of select="@trueValue"/></xsl:when>
  243. <xsl:otherwise>true</xsl:otherwise>
  244. </xsl:choose>
  245. </xsl:variable>
  246. <xsl:value-of select="$displayValue=$trueValue"/>
  247. </xsl:when>
  248. <xsl:otherwise>
  249. <xsl:value-of select="$displayValue"/>
  250. </xsl:otherwise>
  251. </xsl:choose>
  252. </xsl:otherwise>
  253. </xsl:choose>
  254. </cp:columnContent>
  255. </cp:tableContent>
  256. </cp:table>
  257. </lyt:section>
  258. </lyt:layout>
  259. <dp:footer>
  260. <xsl:choose>
  261. <xsl:when test="key('env-param', 'has_write_permission') = 'true'">
  262. <xsl:choose>
  263. <xsl:when test="key('env-param', 'ps_nav_stack') = 'cogadmin/controls/datastores/editCubeConfiguration.xts'">
  264. <df:button df:id="IDS_OK" utml:validate="false" df:style="stack-down" onclick="return validateAndSave();"/>
  265. <df:button df:id="IDS_CANCEL" df:style="stack-down" onclick="document.pform.controller_state.value='close';parent.ui_modal_dialog.close();"/>
  266. </xsl:when>
  267. <xsl:otherwise>
  268. <df:button df:id="IDS_OK" utml:validate="true" df:style="stack-down-save"/>
  269. <df:button df:id="IDS_CANCEL" df:style="stack-down" onclick="{$dc-confirm-cancel}"/>
  270. </xsl:otherwise>
  271. </xsl:choose>
  272. </xsl:when>
  273. <xsl:otherwise>
  274. <xsl:choose>
  275. <xsl:when test="key('env-param', 'm_class') = 'configurationFolder'">
  276. </xsl:when>
  277. <xsl:otherwise>
  278. <df:button df:id="IDS_CLOSE" df:style="stack-down"/>
  279. </xsl:otherwise>
  280. </xsl:choose>
  281. </xsl:otherwise>
  282. </xsl:choose>
  283. </dp:footer>
  284. <script>
  285. function validateAndSave() {
  286. if(validate()) {
  287. var eAutoOptimizeInMemAggr = document.getElementById('rlp_automaticAggregateOptimizationEnabled');
  288. if (eAutoOptimizeInMemAggr) {
  289. var eAggregateCacheSize = document.getElementById('rlp_aggregateCacheSize');
  290. if (eAggregateCacheSize &amp;&amp; (eAggregateCacheSize.value == '0') &amp;&amp; (eAutoOptimizeInMemAggr.checked)) {
  291. alert('<xts:string id="IDS_RLP_AGGREGATE_OPTIMIZE_NEEDS_MEMORY" encode="javascript"><xts:param name="aggregateCacheSizePropName"><xsl:value-of select="xtsext:javascriptencode(normalize-space(string(/root/paramsMetadata/parameter[@name='aggregateCacheSize']/@label)))"/></xts:param></xts:string>');
  292. eAggregateCacheSize.select();
  293. return false;
  294. }
  295. }
  296. setTimeout('parent.ui_modal_dialog.close();',1);
  297. return true;
  298. } else {
  299. return false;
  300. }
  301. }
  302. </script>
  303. </utml:form>
  304. </dp:page>
  305. </xsl:template>
  306. <pf:serialize-xml/>
  307. </xsl:stylesheet>
  308. </xts:block>
  309. <!-- Debug -->
  310. <xts:block id="debug" type="exec" dependency="format" mode="output" condition=".[ /root/session/param[@name='debug'] = '1' ]" processor="XSLT" mandatory="false" mimeType="text/html">
  311. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  312. <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">
  313. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  314. <dbg:templates/>
  315. <xsl:template match="/">
  316. <dbg:dumpxml select="/root"/>
  317. </xsl:template>
  318. </xsl:stylesheet>
  319. </xts:block>
  320. </xts:morphlet>