set_signons.xts 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348
  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. 2005, 2011
  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 xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="messages/portal.xml, messages/portalRL.xml" requiredCapability="canUseAdministrationPortal">
  13. <!--
  14. ================================================================================
  15. formlogic_init
  16. Initializes the UTML navigation stuff.
  17. ================================================================================
  18. -->
  19. <xts:block id="formlogic_init" type="exec" mode="interpret" processor="XSLT" path="/logicsheets/formlogic_init.xslt" nodelist="env,credential,system,http"/>
  20. <!--
  21. ================================================================================
  22. render_page
  23. Renders the HTML output.
  24. ================================================================================
  25. -->
  26. <xts:block id="render_page" type="exec" mode="output" mimeType="text/html" processor="XSLT" dependency="formlogic_init">
  27. <!-- portal specific information -->
  28. <xts:logicsheet path="logicsheets/portal.xsl"/>
  29. <!-- get the presentation theme -->
  30. <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
  31. <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
  32. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  33. <xts:logicsheet path="logicsheets/presentation/dialog/connections.xslt"/>
  34. <!-- apply the form logic -->
  35. <xts:logicsheet path="logicsheets/formlogic.xslt"/>
  36. <!-- Keeps the status line clean. -->
  37. <xts:logicsheet path="logicsheets/validation.xslt"/> <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
  38. <xsl:stylesheet version="1.0"
  39. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  40. xmlns:dcx="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/connections/1/"
  41. xmlns:dt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/templates/"
  42. xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/"
  43. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  44. xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/"
  45. xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
  46. xmlns:dc="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/confirm/1/"
  47. xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
  48. xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
  49. xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/"
  50. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  51. xmlns:x="x"
  52. exclude-result-prefixes="xsl pf df dc dp lyt cp cf x utml">
  53. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  54. <!-- Get the portal common variables. -->
  55. <pf:variables/>
  56. <xsl:variable name="mname" select="'set_signons.xts'"/>
  57. <xsl:variable name="back-url"/>
  58. <xsl:template match="/">
  59. <xsl:variable name="object-name" select="key('env-param','m_name')"/>
  60. <xsl:variable name="isPowerCube" select="contains(key('env-param','connectionString'),';LOCAL;PC;')"/>
  61. <xsl:variable name="title" select="key('env-param','credential_title')"/>
  62. <xsl:variable name="browser-title">
  63. <xsl:choose>
  64. <xsl:when test="$title != ''">
  65. <xsl:value-of select="$title"/>
  66. </xsl:when>
  67. <xsl:when test="$object-name != ''">
  68. <xts:string id="IDS_PROP_SIGNON_CREDENTIALS_TITLE">
  69. <xts:param name="objectName">
  70. <xsl:value-of select="$object-name"/>
  71. </xts:param>
  72. </xts:string>
  73. </xsl:when>
  74. <xsl:otherwise>
  75. <xts:string id="IDS_PROP_SIGNON_CREDENTIALS_TITLE_NO_OBJECT"/>
  76. </xsl:otherwise>
  77. </xsl:choose>
  78. </xsl:variable>
  79. <!-- Start the HTML -->
  80. <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html></xsl:text><dp:page longTitle="$browser-title">
  81. <dp:meta>
  82. <!-- Standard meta tags -->
  83. <pf:meta/>
  84. </dp:meta>
  85. <dp:script>
  86. <!-- Help system -->
  87. <pf:help context="HID_DATA_SOURCES_SIGNON"/>
  88. <script language="JavaScript" src="{$webcontent}/{$app}/js/utilities.js"/>
  89. <script language="JavaScript">
  90. <dcx:checkReservedChar/>
  91. function checkMandatory(obj, label)
  92. {
  93. obj.value = trim(obj.value);
  94. if (obj.value == '')
  95. {
  96. <xsl:variable name="errmsg">
  97. <xts:string id="IDS_ERR_MANDATORY" encode="javascript">
  98. <xts:param name="field">" + label + "</xts:param>
  99. </xts:string>
  100. </xsl:variable>
  101. window.alert("<xsl:value-of select="normalize-space($errmsg)"/>");
  102. obj.focus();
  103. return false;
  104. }
  105. return true;
  106. }
  107. var isFocusOnBox='false';
  108. function init()
  109. {
  110. <xsl:choose>
  111. <xsl:when test="$isPowerCube">document.pform.m_cube_password.focus();</xsl:when>
  112. <xsl:otherwise>document.pform.m_signon_password.focus();</xsl:otherwise>
  113. </xsl:choose>
  114. setFocus('true');
  115. }
  116. function validate()
  117. {
  118. var f = document.pform;
  119. <xsl:choose>
  120. <xsl:when test="$isPowerCube">
  121. if (f.m_cube_password.value != f.m_cube_confirm_password.value)
  122. {
  123. alert("<xts:string id="IDS_ERR_0003_PASSWORD_VERIF_FAILED" encode="javascript"/>");
  124. document.pform.m_cube_password.focus();
  125. return false;
  126. }
  127. if (!checkReservedChar(f.m_cube_password, '<xts:string id="IDS_PASSWORD" encode="javascript"/>'))
  128. {
  129. return false;
  130. }
  131. </xsl:when>
  132. <xsl:otherwise>
  133. if (!checkMandatory(f.m_signon_userid, "<xts:string id="IDS_USERID" encode="javascript"/>"))
  134. {
  135. return false;
  136. }
  137. if (f.m_signon_password.value != f.m_signon_confirm_password.value)
  138. {
  139. alert("<xts:string id="IDS_ERR_0003_PASSWORD_VERIF_FAILED" encode="javascript"/>");
  140. document.pform.m_signon_password.focus();
  141. return false;
  142. }
  143. if (!checkReservedChar(f.m_signon_userid, '<xts:string id="IDS_USERID" encode="javascript"/>'))
  144. {
  145. return false;
  146. }
  147. if (!checkReservedChar(f.m_signon_password, '<xts:string id="IDS_PASSWORD" encode="javascript"/>'))
  148. {
  149. return false;
  150. }
  151. </xsl:otherwise>
  152. </xsl:choose>
  153. return true;
  154. }
  155. function setFocus(bFocus)
  156. {
  157. isFocusOnBox=bFocus;
  158. }
  159. function handleKeyDown()
  160. {
  161. <xsl:if test="$browser='ie' ">
  162. keyPressed = event.keyCode;
  163. if (keyPressed == 13)
  164. {
  165. if (window.event.returnValue != false)
  166. {
  167. window.event.returnValue = false;
  168. return false;
  169. }
  170. if (window.event.returnValue == false)
  171. {
  172. window.event.cancelBubble = true;
  173. return false;
  174. }
  175. window.event.returnValue = false;
  176. return false;
  177. }
  178. </xsl:if>
  179. }
  180. </script>
  181. </dp:script>
  182. <utml:form name="pform" method="post" action="{$gateway}">
  183. <dp:header>
  184. <dp:title>
  185. <xsl:value-of select="$browser-title"/>
  186. </dp:title>
  187. <dp:description>
  188. <xsl:choose>
  189. <xsl:when test="$isPowerCube">
  190. <xts:string id="IDS_PROP_SIGNON_CREDENTIALS_POWERCUBE_INTRO"/>
  191. </xsl:when>
  192. <xsl:otherwise>
  193. <xts:string id="IDS_PROP_SIGNON_CREDENTIALS_INTRO"/>
  194. </xsl:otherwise>
  195. </xsl:choose>
  196. </dp:description>
  197. </dp:header>
  198. <utml:input type="hidden" name="m_signon_pwd_changed" utml:update="false" value="0"/>
  199. <utml:input type="hidden" name="m_signon_cube_pwd_changed" utml:update="false" value="0"/>
  200. <lyt:layout style="1" border="no">
  201. <lyt:section>
  202. <xsl:choose>
  203. <xsl:when test="$isPowerCube">
  204. <dp:input>
  205. <dp:section1>
  206. <label for="ctrl_m_cube_password"><xts:string id="IDS_PASSWORD"/></label>
  207. </dp:section1>
  208. <dp:section2>
  209. <utml:input type="password" size="53" name="m_cube_password" utml:update="false" onchange="document.pform.m_signon_cube_pwd_changed.value='1'" onfocus="this.select();setFocus('true')" onblur="setFocus('false')" onKeyDown="handleKeyDown()" id="ctrl_m_cube_password">
  210. <utml:value>
  211. <!-- There is no need to localize this, it's simply a dummy value used to
  212. make *** appear in the password field. -->
  213. <xsl:text>###PASSWORD###</xsl:text>
  214. </utml:value>
  215. </utml:input>
  216. <xsl:if test="$browser = 'moz' ">
  217. <script language="JavaScript">
  218. window.captureEvents(Event.KEYPRESS);
  219. function keyhandler(e)
  220. {
  221. var Key;
  222. Key = e.which;
  223. if (Key==13)
  224. {
  225. if (isFocusOnBox == 'true')
  226. return false;
  227. }
  228. }
  229. window.onkeypress = keyhandler;
  230. </script>
  231. </xsl:if>
  232. </dp:section2>
  233. </dp:input>
  234. <dp:input>
  235. <dp:section1>
  236. <label for="ctrl_m_cube_confirm_password"><xts:string id="IDS_CONFIRM_PASSWORD"/></label>
  237. </dp:section1>
  238. <dp:section2>
  239. <utml:input type="password" size="53" name="m_cube_confirm_password" utml:update="false" onfocus="this.select();" id="ctrl_m_cube_confirm_password">
  240. <utml:value>
  241. <!-- There is no need to localize this, it's simply a dummy value used to
  242. make *** appear in the password field. -->
  243. <xsl:text>###PASSWORD###</xsl:text>
  244. </utml:value>
  245. </utml:input>
  246. </dp:section2>
  247. </dp:input>
  248. </xsl:when>
  249. <xsl:otherwise>
  250. <dp:input>
  251. <dp:section1>
  252. <label for="ctrl_m_signon_userid"><xts:string id="IDS_USERID"/></label>
  253. </dp:section1>
  254. <dp:section2>
  255. <utml:input type="text" size="53" name="m_signon_userid" value="" utml:track="true" id="ctrl_m_signon_userid"/>
  256. </dp:section2>
  257. </dp:input>
  258. <dp:input>
  259. <dp:section1>
  260. <label for="ctrl_m_signon_password"><xts:string id="IDS_PASSWORD"/></label>
  261. </dp:section1>
  262. <dp:section2>
  263. <utml:input type="password" size="53" name="m_signon_password" utml:update="false" onchange="document.pform.m_signon_pwd_changed.value='1'" onfocus="this.select();setFocus('true')" onblur="setFocus('false')" onKeyDown="handleKeyDown()" id="ctrl_m_signon_password">
  264. <utml:value>
  265. <!-- There is no need to localize this, it's simply a dummy value used to
  266. make *** appear in the password field. -->
  267. <xsl:text>###PASSWORD###</xsl:text>
  268. </utml:value>
  269. </utml:input>
  270. <xsl:if test="$browser = 'moz' ">
  271. <script language="JavaScript">
  272. window.captureEvents(Event.KEYPRESS);
  273. function keyhandler(e)
  274. {
  275. var Key;
  276. Key = e.which;
  277. if (Key==13)
  278. {
  279. if (isFocusOnBox == 'true')
  280. return false;
  281. }
  282. }
  283. window.onkeypress = keyhandler;
  284. </script>
  285. </xsl:if>
  286. </dp:section2>
  287. </dp:input>
  288. <dp:input>
  289. <dp:section1>
  290. <label for="ctrl_m_signon_confirm_password"><xts:string id="IDS_CONFIRM_PASSWORD"/></label>
  291. </dp:section1>
  292. <dp:section2>
  293. <utml:input type="password" size="53" name="m_signon_confirm_password" utml:update="false" onfocus="this.select();" id="ctrl_m_signon_confirm_password">
  294. <utml:value>
  295. <!-- There is no need to localize this, it's simply a dummy value used to
  296. make *** appear in the password field. -->
  297. <xsl:text>###PASSWORD###</xsl:text>
  298. </utml:value>
  299. </utml:input>
  300. </dp:section2>
  301. </dp:input>
  302. </xsl:otherwise>
  303. </xsl:choose>
  304. </lyt:section>
  305. </lyt:layout>
  306. <dp:footer>
  307. <df:button df:id="IDS_OK" utml:validate="true" df:style="stack-down-save"/>
  308. <df:button df:id="IDS_CANCEL" df:style="stack-down"/>
  309. </dp:footer>
  310. </utml:form>
  311. </dp:page>
  312. </xsl:template>
  313. </xsl:stylesheet>
  314. </xts:block>
  315. <!--
  316. ===============================================================================================
  317. debug - display debug information
  318. ===============================================================================================
  319. -->
  320. <xts:block id="debug" dependency="render_page" condition=".[/root/session/param[@name='debug']='1']" type="exec" mode="output" processor="XSLT" mandatory="false" mimeType="text/html">
  321. <!-- get the debug logic sheet -->
  322. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  323. <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">
  324. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  325. <xsl:template match="/">
  326. <dbg:dumpxml select="/root"/>
  327. </xsl:template>
  328. </xsl:stylesheet>
  329. </xts:block>
  330. </xts:morphlet>