userPreferences.xts 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  1. <xts:morphlet resolverBase="prompting" xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="messages/QSRVUITextPL.xml,messages/portal.xml,messages/portalRL.xml" requiredCapability="canUseQueryStudio">
  2. <!--
  3. Licensed Materials - Property of IBM
  4. BI and PM: qs
  5. (C) Copyright IBM Corp. 2001, 2017
  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:block id="browserDetection" path="qs/browserDetection.xslt" mode="interpret" type="exec" processor="XSLT" contentId="browserDetection" partId="1"/>
  13. <xts:block id="format" type="exec" mode="output" processor="XSLT" mimeType="text/html" dependency="browserDetection">
  14. <!-- get the debug logic sheet -->
  15. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  16. <!-- get the new theme stuff -->
  17. <xts:logicsheet path="logicsheets/portal.xsl"/>
  18. <xts:logicsheet path="qs/logicsheets/dialogIncludes.xsl"/>
  19. <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
  20. <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
  21. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  22. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  23. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  24. <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
  25. <!-- apply the form logic -->
  26. <xts:logicsheet path="logicsheets/formlogic.xslt"/>
  27. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/" xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/" xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/" xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/" xmlns:dbg="http://developer.cognos.com/schemas/xts/logicsheets/xslt/debug/" xmlns:qsdialog="http://developer.cognos.com/schemas/xts/logicsheets/xslt/qs/dialog/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="xsl xts lyt pf dp df cp cf dbg qsdialog xtsext">
  28. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
  29. <!-- Default variables (like skin) and prompt variables -->
  30. <qsdialog:variables/>
  31. <qsdialog:promptVariables/>
  32. <!-- add any theme variables -->
  33. <df:variables/>
  34. <pf:variables/>
  35. <!-- start the output -->
  36. <xsl:template match="/root">
  37. <!--Get HTML output for the HEAD section -->
  38. <dp:page>
  39. <dp:script>
  40. <head>
  41. <script type="text/javascript">
  42. <xsl:attribute name="src"><xsl:value-of select="$webRoot"/>/qs/layout.js</xsl:attribute>
  43. <xsl:text/>//<xsl:text/>
  44. </script>
  45. <script type="text/javascript">
  46. <xsl:attribute name="src"><xsl:value-of select="$webRoot"/>/qs/classes/CTemplateDialog.js</xsl:attribute>
  47. <xsl:text/>//<xsl:text/>
  48. </script>
  49. <qsdialog:headerIncludes dlgSize="290" featureName="UserPreferenceDialog" setupParameters="env"/>
  50. </head>
  51. </dp:script>
  52. <body>
  53. <form style="margin:0px" name="f" method="POST" onsubmit="return false;">
  54. <table border="0" cellspacing="0" cellpadding="0" height="100%" width="100%">
  55. <tr>
  56. <td colspan="2" width="100%" height="0%">
  57. <!-- dialog header -->
  58. <dp:header help="false">
  59. <!-- header titles -->
  60. <dp:title>
  61. <xts:string id="MENU_MANAGE_FILE_MY_PREFERENCES"/>
  62. </dp:title>
  63. <!-- close link for the header -->
  64. <dp:close>
  65. <a href="javascript:goDialogManager.getWindowManager().hideDialogFrame()">
  66. <dp:closeMarker/>
  67. </a>
  68. </dp:close>
  69. <!-- description (hint text) -->
  70. <dp:description>
  71. <xts:string id="CHANGE_USAGE_PREFERENCES"/>
  72. </dp:description>
  73. </dp:header>
  74. </td>
  75. </tr>
  76. <tr>
  77. <td id="limitedDataModeContainer" valign="top" style="display: none;">
  78. <lyt:layout style="1" border="no" joinSection="true">
  79. <lyt:section>
  80. <span nocOnly="disabled">
  81. <dp:choice title="DEFAULT_DATA_DISPLAY">
  82. <dp:section1>
  83. <input onChange="oLimitedDataPreference.setDialogValue(this.value);" type="radio" name="limitedDataMode" value="full">
  84. <xsl:if test="not(/root/env/param[@name='limitedDataMode']) or /root/env/param[@name='limitedDataMode']='' or /root/env/param[@name='limitedDataMode']='full'">
  85. <xsl:attribute name="checked">true</xsl:attribute>
  86. </xsl:if>
  87. </input>
  88. </dp:section1>
  89. <dp:section2>
  90. <xts:string id="MENU_RUN_REPORT_COMPLETE"/>
  91. </dp:section2>
  92. <dp:section1>
  93. <input onChange="oLimitedDataPreference.setDialogValue(this.value);" type="radio" name="limitedDataMode" value="partial">
  94. <xsl:if test="/root/env/param[@name='limitedDataMode']='partial'">
  95. <xsl:attribute name="checked">true</xsl:attribute>
  96. </xsl:if>
  97. </input>
  98. </dp:section1>
  99. <dp:section2>
  100. <xts:string id="MENU_RUN_REPORT_PARTIAL"/>
  101. </dp:section2>
  102. <dp:section1>
  103. <input onChange="oLimitedDataPreference.setDialogValue(this.value);" type="radio" name="limitedDataMode" value="nodata">
  104. <xsl:if test="/root/env/param[@name='limitedDataMode']='nodata'">
  105. <xsl:attribute name="checked">true</xsl:attribute>
  106. </xsl:if>
  107. </input>
  108. </dp:section1>
  109. <dp:section2>
  110. <xts:string id="MENU_RUN_REPORT_NONE"/>
  111. </dp:section2>
  112. </dp:choice>
  113. </span>
  114. </lyt:section>
  115. </lyt:layout>
  116. </td>
  117. <td valign="top">
  118. <lyt:layout style="1" border="no" joinSection="true">
  119. <lyt:section>
  120. <span nocOnly="disabled">
  121. <dp:choice title="DEFAULT_FILTER_DIALOG_FOR_VALUE_SELECTION">
  122. <dp:section1>
  123. <input onChange="oFilterDialogTypePreference.setDialogValue(this.value);" type="radio" name="defaultFilterDialogType" value="default">
  124. <xsl:if test="not(/root/env/param[@name='defaultFilterDialogType']) or /root/env/param[@name='defaultFilterDialogType']='' or /root/env/param[@name='defaultFilterDialogType']='default'">
  125. <xsl:attribute name="checked">true</xsl:attribute>
  126. </xsl:if>
  127. </input>
  128. </dp:section1>
  129. <dp:section2>
  130. <xts:string id="DIALOG_DEFAULT_OPTION"/>
  131. </dp:section2>
  132. <dp:section1>
  133. <input onChange="oFilterDialogTypePreference.setDialogValue(this.value);" type="radio" name="defaultFilterDialogType" value="picklist">
  134. <xsl:if test="/root/env/param[@name='defaultFilterDialogType']='picklist'">
  135. <xsl:attribute name="checked">true</xsl:attribute>
  136. </xsl:if>
  137. </input>
  138. </dp:section1>
  139. <dp:section2>
  140. <xts:string id="FILTER_PICK_VALUES"/>
  141. </dp:section2>
  142. <dp:section1>
  143. <input onChange="oFilterDialogTypePreference.setDialogValue(this.value);" type="radio" name="defaultFilterDialogType" value="search">
  144. <xsl:if test="/root/env/param[@name='defaultFilterDialogType']='search'">
  145. <xsl:attribute name="checked">true</xsl:attribute>
  146. </xsl:if>
  147. </input>
  148. </dp:section1>
  149. <dp:section2>
  150. <xts:string id="FILTER_SEARCH_FOR_VALUES"/>
  151. </dp:section2>
  152. <tr id="filterTypeIn" style="visibility: hidden;">
  153. <td nowrap="true" class="formText">
  154. <input onChange="oFilterDialogTypePreference.setDialogValue(this.value);" type="radio" name="defaultFilterDialogType" value="typein">
  155. <xsl:if test="/root/env/param[@name='defaultFilterDialogType']='typein'">
  156. <xsl:attribute name="checked">true</xsl:attribute>
  157. </xsl:if>
  158. </input>
  159. </td>
  160. <td nowrap="true" class="formText">
  161. <xts:string id="FILTER_TYPE_IN_VALUES"/>
  162. </td>
  163. </tr>
  164. </dp:choice>
  165. </span>
  166. </lyt:section>
  167. </lyt:layout>
  168. </td>
  169. </tr>
  170. <tr>
  171. <td height="0%">
  172. <lyt:layout style="1" border="no" joinSection="true">
  173. <lyt:section>
  174. <span nocOnly="disabled">
  175. <dp:choice title="DEFAULT_TEMPLATE">
  176. <dp:section1>
  177. <input type="checkbox" name="templateMode" value="false">
  178. <xsl:if test="/root/env/param[@name='templateMode']='true'">
  179. <xsl:attribute name="checked">true</xsl:attribute>
  180. </xsl:if>
  181. </input>
  182. </dp:section1>
  183. <dp:section2>
  184. <xts:string id="REPORT_TEMPLATE_APPLY_TEMPLATE"/>
  185. </dp:section2>
  186. <dp:section1/>
  187. <dp:section2>
  188. <div id="loadingContainer" style="vertical-align:top;">
  189. <img id="loadingIcon">
  190. <xsl:attribute name="src"><xsl:value-of select="$webRoot"/>/common/images/spacer.gif</xsl:attribute>
  191. </img>&#160;
  192. </div>
  193. <div id="pathContainer" style="display:none">
  194. <!-- Path to the container where we want to place this new entry. Leave this empty if the user does not have write access. -->
  195. <input type="hidden" name="templateSearchPath" value="" style="width: 400px;" onfocus="document.f.templateMode[1].checked=true;"/>
  196. <span id="path"/>
  197. <span id="pathContents"> </span>
  198. &#160;
  199. <a href="javascript:void oTemplateDialog.selectTmpl();" onmouseover="window.status='';return true;" onmouseout="window.status='';return true;">
  200. <xts:string id="REPORT_TEMPLATE_SELECT"/>
  201. </a>
  202. </div>
  203. </dp:section2>
  204. </dp:choice>
  205. </span>
  206. </lyt:section>
  207. </lyt:layout>
  208. </td>
  209. <!-- Run time Query Options -->
  210. <td height="0%">
  211. <lyt:layout style="1" border="no" joinSection="true">
  212. <lyt:section>
  213. <span nocOnly="disabled">
  214. <dp:choice>
  215. <dp:section1/>
  216. <dp:section2>
  217. <div id="runTimeQueryOptions" style="vertical-align:top;">
  218. <a href="javascript:goDialogManager.getApplicationManager().getFeatureManager().launchFeature('AdvancedRunTimeOptions')">
  219. <xts:string id="ADVANCED_RUN_TIME_OPTIONS_TITLE"/>
  220. </a>
  221. </div>
  222. </dp:section2>
  223. </dp:choice>
  224. </span>
  225. </lyt:section>
  226. </lyt:layout>
  227. </td>
  228. </tr>
  229. <tr>
  230. <td colspan="2">
  231. <!-- Use default buttons [ OK = execute() and CANCEL = hideDialogFrame() ] -->
  232. <qsdialog:defaultButtons/>
  233. </td>
  234. </tr>
  235. <!--dbg:dumpxml select="/"/-->
  236. </table>
  237. </form>
  238. <script type="text/javascript">&lt;!--
  239. // Setup preference types and defaults for user preferences
  240. var oUserPreferenceManager = goDialogManager.getApplicationManager().getUserPreferenceManager();
  241. var oLimitedDataPreference = oUserPreferenceManager.add("limitedDataMode");
  242. var oFilterDialogTypePreference = oUserPreferenceManager.add("defaultFilterDialogType");
  243. var oTemplateSearchPathPreference = oUserPreferenceManager.add("defaultSystemTemplate");
  244. // The form input name usually defaults to the preference name
  245. // In this case, we need to conform to the CTemplateDialog.js format of 'templateSearchPath'
  246. oTemplateSearchPathPreference.setFormInputName("templateSearchPath");
  247. // If we're coming back from the portal OK page, set the TemplateDialog search path to the returned value
  248. // Otherwise, use the stored value
  249. var sSearchPath = oTemplateSearchPathPreference.getValue();
  250. <xsl:if test="not(/root/env/param[@name='templateMode']) and /root/env/param[@name='so.searchPath']">
  251. sSearchPath="<xsl:text/>
  252. <xsl:value-of select="xtsext:javascriptencode(string(/root/env/param[@name='so.searchPath']))"/>
  253. <xsl:text/>";
  254. </xsl:if>
  255. var oTemplateModePreference = oUserPreferenceManager.add("templateMode");
  256. // The search path must be passed into the report template class
  257. var oTemplateDialog = new CTemplateDialog("userPreferences.xts", sSearchPath);
  258. // Set all values in the form
  259. // We have to do this each time because we can be called back from portal
  260. // Or called directly by the feature manager
  261. var oUserPreferenceDialog = goDialogManager.getFeatureRegistry().getRegisteredFeature("UserPreferenceDialog");
  262. oUserPreferenceDialog.setFormFieldValues(document.forms['f']);
  263. // Set 'type in' values radio button to disabled unless cf.checkCalcFunctionAgainstDB("FLEXIBLE_FILTERS") is set
  264. if (typeof getConfigFrame === "function" &amp;&amp; getConfigFrame().checkCalcFunctionAgainstDB("FLEXIBLE_FILTERS"))
  265. {
  266. var oDiv = document.getElementById("filterTypeIn");
  267. oDiv.style.visibility = "visible";
  268. }
  269. <!--
  270. Set the templateMode checkbox automatically if a template has been selected coming back from the portal selector.
  271. -->
  272. <xsl:if test="/root/env/param[@name='so.searchPath']">
  273. oTemplateDialog.setTemplateSelected(true);
  274. </xsl:if>
  275. <!-- Only display the data display type select if we allow user override -->
  276. if (oLimitedDataPreference.isUserOverrideAllowed())
  277. {
  278. document.getElementById("limitedDataModeContainer").style.display = "inline";
  279. }
  280. // Called from CDialogManager
  281. function cancelDialog(aParams)
  282. {
  283. oUserPreferenceManager.clearAllDialogValues();
  284. goDialogManager.getWindowManager().hideDialogFrame(aParams);
  285. }
  286. //--&gt;</script>
  287. </body>
  288. </dp:page>
  289. </xsl:template>
  290. </xsl:stylesheet>
  291. </xts:block>
  292. </xts:morphlet>