formatText.xts 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. <?xml version="1.0" encoding="UTF-8"?>
  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:morphlet resolverBase="prompting" version="1.0" xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="messages/QSRVUITextPL.xml,messages/portal.xml,messages/portalRL.xml" requiredCapability="canUseQueryStudio">
  13. <xts:block id="page" type="exec" mode="output" processor="XSLT" mimeType="text/html">
  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/dialogs.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:xts="http://developer.cognos.com/schemas/xts/" 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:qsdlg="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 qsdlg xtsext">
  28. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
  29. <!-- Default variables (like skin) and prompt variables -->
  30. <qsdlg:variables/>
  31. <qsdlg:promptVariables/>
  32. <!-- Prompt Control XSL include -->
  33. <xsl:include href="p_include.xsl"/>
  34. <!-- add any theme variables -->
  35. <df:variables/>
  36. <pf:variables/>
  37. <!-- start the output -->
  38. <xsl:template match="/root">
  39. <dp:page>
  40. <dp:script>
  41. <xsl:call-template name="getPromptCommonIncludes"/>
  42. <xsl:call-template name="gettextBoxIncludes">
  43. <xsl:with-param name="promptLocale" select="$promptLocale"/>
  44. <xsl:with-param name="promptContentLocale" select="$contentLocale"/>
  45. </xsl:call-template>
  46. <script type="text/javascript">
  47. <xsl:attribute name="src"><xsl:value-of select="$webRoot"/>/qs/layout.js</xsl:attribute>
  48. <xsl:text/>//<xsl:text/>
  49. </script>
  50. <script type="text/javascript">
  51. <xsl:attribute name="src"><xsl:value-of select="$webRoot"/>/qs/classes/CDialogManager.js</xsl:attribute>
  52. <xsl:text/>//<xsl:text/>
  53. </script>
  54. <script type="text/javascript">
  55. <xsl:attribute name="src"><xsl:value-of select="$webRoot"/>/qs/classes/CWindowManager.js</xsl:attribute>
  56. <xsl:text/>//<xsl:text/>
  57. </script>
  58. <script type="text/javascript">&lt;!--
  59. var goDialogManager = new CDialogManager();
  60. function execute()
  61. {
  62. var oMQMgr = goDialogManager.getMiniQueryManager();
  63. var cf = getConfigFrame();
  64. if (cf)
  65. {
  66. var i;
  67. var cmdArray = new Array();
  68. var len = textBoxnumberValue.sGetValue();
  69. if (document.f.formattype.selectedIndex == 0 || (textBoxnumberValue.isValid() &amp;&amp; len &lt; 1))
  70. cmdArray[0] = "default";
  71. else if (textBoxnumberValue.isValid())
  72. {
  73. cmdArray[0] = "text";
  74. cmdArray[1] = "textFormat";
  75. cmdArray[2] = "1";
  76. cmdArray[3] = "textLength";
  77. cmdArray[4] = cf.escapeParam(len);
  78. cmdArray[5] = "0";
  79. }
  80. else
  81. {
  82. cf.hideDialogFrame();
  83. return;
  84. }
  85. for (i = 0; i &lt; cf.cfgSize("SelColumns"); i++)
  86. cmdArray[cmdArray.length] = cf.escapeParam(oMQMgr.getColumnId(cf.cfgGetAt("SelColumns", i)));
  87. cf.addColumnsForReselection();
  88. cf.submitFormat(cmdArray);
  89. }
  90. }
  91. function changeDlgType()
  92. {
  93. document.getElementById("spanchars").style.display = (document.f.formattype.selectedIndex == 1)?"inline":"none";
  94. }
  95. function init()
  96. {
  97. attachMouseEvents();
  98. var cf=getConfigFrame?getConfigFrame():null;if (cf &amp;&amp; cf.showDialogFrame) cf.showDialogFrame(395);
  99. with (document)
  100. {
  101. var oldlen = cf.dlgGlobalGetParm('xxTextLength');
  102. document.f.formattype.selectedIndex = 1;
  103. if (oldlen == "")
  104. {
  105. document.f.formattype.selectedIndex = 0;
  106. oldlen = "20";
  107. textBoxnumberValue.m_oSubmit.value = oldlen;
  108. textBoxnumberValue.m_oForm.value = oldlen;
  109. }
  110. else if (oldlen != "mixed")
  111. {
  112. textBoxnumberValue.m_oSubmit.value = oldlen;
  113. textBoxnumberValue.m_oForm.value = oldlen;
  114. }
  115. changeDlgType();
  116. }
  117. }
  118. </script>
  119. <script type="text/javascript">
  120. <xsl:attribute name="src"><xsl:value-of select="$webRoot"/>/qs/dialogs/executeButton.js</xsl:attribute>
  121. <xsl:text/>//<xsl:text/>
  122. </script>
  123. </dp:script>
  124. <form style="margin:0px" name="f" method="POST" onsubmit="execute();return false;">
  125. <table border="0" cellspacing="0" cellpadding="0" height="100%" width="100%">
  126. <tr>
  127. <td width="100%" height="0%">
  128. <!-- dialog header -->
  129. <dp:header help="false">
  130. <!-- header titles -->
  131. <dp:title>
  132. <xts:string id="FORMAT_TITLE"/>
  133. </dp:title>
  134. <!-- close link for the header -->
  135. <dp:close>
  136. <a href="javascript:getConfigFrame().hideDialogFrame()">
  137. <dp:closeMarker/>
  138. </a>
  139. </dp:close>
  140. <dp:description>
  141. <xts:string id="FORMAT_TEXT_HINT"/>
  142. </dp:description>
  143. </dp:header>
  144. </td>
  145. </tr>
  146. <tr>
  147. <td width="100%" height="100%" valign="top">
  148. <!-- layout -->
  149. <lyt:layout style="2" border="no">
  150. <lyt:section height="266">
  151. <dp:input>
  152. <dp:section1>
  153. <xts:string id="FORMAT_CATEGORY_LABEL"/>
  154. </dp:section1>
  155. <dp:section2>
  156. <select name="formattype" onchange="changeDlgType()">
  157. <option>
  158. <xsl:attribute name="value">default</xsl:attribute>
  159. <xts:string id="DIALOG_DEFAULT_OPTION"/>
  160. </option>
  161. <option>
  162. <xsl:attribute name="value">text</xsl:attribute>
  163. <xts:string id="FORMAT_TEXT_OPTION"/>
  164. </option>
  165. </select>
  166. </dp:section2>
  167. </dp:input>
  168. <span id="spanchars" style="display:none">
  169. <dp:input>
  170. <dp:section1>
  171. <BR/>
  172. <BR/>
  173. <xts:string id="FORMAT_NUMBER_OF_VISIBLE_CHARS_LABEL"/>
  174. </dp:section1>
  175. <dp:section2>
  176. <xsl:call-template name="getTextBox">
  177. <xsl:with-param name="promptLocale" select="$promptLocale"/>
  178. <xsl:with-param name="promptFormName" select="$promptFormName"/>
  179. <xsl:with-param name="promptRequired" select="'false'"/>
  180. <xsl:with-param name="promptId" select="'numberValue'"/>
  181. <xsl:with-param name="promptHideText" select="'false'"/>
  182. <xsl:with-param name="promptMultiLine" select="'false'"/>
  183. <xsl:with-param name="promptParameter" select="'numberParam'"/>
  184. <xsl:with-param name="promptDataType" select="'whole'"/>
  185. <xsl:with-param name="promptMaxLength" select="'15'"/>
  186. </xsl:call-template>
  187. </dp:section2>
  188. </dp:input>
  189. </span>
  190. </lyt:section>
  191. <lyt:section/>
  192. </lyt:layout>
  193. </td>
  194. </tr>
  195. <tr>
  196. <td width="100%" height="0%">
  197. <!-- Use default buttons [ OK = execute() and CANCEL = hideDialogFrame() ] -->
  198. <qsdlg:defaultButtons/>
  199. </td>
  200. </tr>
  201. <!--dbg:dumpxml select="/"/-->
  202. </table>
  203. </form>
  204. </dp:page>
  205. </xsl:template>
  206. </xsl:stylesheet>
  207. </xts:block>
  208. </xts:morphlet>