new_signon.xts 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297
  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, 2013
  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. <xts:block id="formlogic_init" type="exec" mode="interpret" processor="XSLT" path="/logicsheets/formlogic_init.xslt" nodelist="env,credential,system,http"/>
  14. <!--
  15. ================================================================================
  16. get_content - need to the get connectionString to know if we're dealing with
  17. a powerCube
  18. ================================================================================
  19. -->
  20. <xts:block id="get_content" processor="XSLT" type="exec" mode="interpret" dependency="formlogic_init" condition=".[/root/env/param[@name='m_path']!='']" mandatory="false">
  21. <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
  22. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  23. <xsl:stylesheet version="1.0"
  24. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  25. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/">
  26. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  27. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  28. <xsl:template match="/">
  29. <xts:sequence>
  30. <xts:append>
  31. <connection>
  32. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  33. <send:request provider="cm">
  34. <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
  35. <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  36. <cm:search><xsl:value-of select="/root/env/param[@name='m_path']"/></cm:search>
  37. <cm:properties>
  38. <cm:property name="connectionString"/>
  39. </cm:properties>
  40. </cm:query>
  41. </xts:transform>
  42. </send:request>
  43. </xts:transform>
  44. </connection>
  45. </xts:append>
  46. </xts:sequence>
  47. </xsl:template>
  48. </xsl:stylesheet>
  49. </xts:block>
  50. <!--
  51. ================================================================================
  52. render_page
  53. Render the HTML page
  54. ===============================================================================================
  55. -->
  56. <xts:block id="render_page" dependency="get_content formlogic_init" mode="output" processor="XSLT" type="exec" mimeType="text/html">
  57. <!-- portal specific information -->
  58. <xts:logicsheet path="logicsheets/portal.xsl"/>
  59. <!-- Get the new theme framework. -->
  60. <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
  61. <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
  62. <xts:logicsheet path="logicsheets/presentation/dialog/connections.xslt"/>
  63. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  64. <xts:logicsheet path="logicsheets/presentation/dialog/templates.xsl"/>
  65. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  66. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  67. <xts:logicsheet path="logicsheets/presentation/dialog/confirm.xslt"/>
  68. <!-- apply the form logic -->
  69. <xts:logicsheet path="logicsheets/formlogic.xslt"/>
  70. <!-- Prevent the href from appearing in the status bar. -->
  71. <xts:logicsheet path="logicsheets/validation.xslt"/>
  72. <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
  73. <xsl:stylesheet version="1.0"
  74. xmlns:dcx="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/connections/1/"
  75. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  76. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  77. xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/"
  78. xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
  79. xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/"
  80. xmlns:dt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/templates/"
  81. xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
  82. xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
  83. xmlns:dc="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/confirm/1/"
  84. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  85. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  86. xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/"
  87. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  88. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  89. xmlns:x="x"
  90. exclude-result-prefixes="xsl lyt dp dc pf df cp cf cm utml xtsext x">
  91. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  92. <!-- current file name -->
  93. <xsl:variable name="mname" select="'new_signon.xts'"/>
  94. <xsl:variable name="m_class" select="/root/env/param[@name = 'm_new_class']"/>
  95. <xsl:variable name="isPowerCube" select="contains(/root/connection/cm:queryResponse/cm:dataSourceConnection/cm:connectionString,';LOCAL;PC;')"/>
  96. <!-- add any theme variables -->
  97. <pf:variables/>
  98. <!-- start the output -->
  99. <xsl:template match="root">
  100. <xsl:variable name="wizardTitle">
  101. <xts:string id="IDS_NEW_DATA_SOURCE_SIGNON_TITLE"/>
  102. </xsl:variable>
  103. <xsl:variable name="browserTitle">
  104. <xts:string id="IDS_NEW_TITLE_SIGNON"><xts:param name="wizardTitle"><xsl:value-of select="$wizardTitle"/></xts:param></xts:string>
  105. </xsl:variable>
  106. <!-- Page and title -->
  107. <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html></xsl:text><dp:page longTitle="$browserTitle">
  108. <dp:meta>
  109. <!-- Standard meta tags -->
  110. <pf:meta/>
  111. </dp:meta>
  112. <dp:script>
  113. <!-- Help system -->
  114. <pf:help context="HID_DATA_SOURCES"/>
  115. <script language="JavaScript">
  116. <dcx:checkReservedChar/>
  117. var m1 = "<xts:string id="IDS_USERID" encode="javascript"/>";
  118. var m2 = "<xts:string id="IDS_ERR_0003_PASSWORD_VERIF_FAILED" encode="javascript"/>";
  119. function validate()
  120. {
  121. var f = document.pform;
  122. <xsl:choose>
  123. <xsl:when test="$isPowerCube">
  124. if (f.m_cube_password.value != f.m_cube_confirm_password.value)
  125. {
  126. alert(m2);
  127. return false;
  128. }
  129. if (!checkReservedChar(f.m_cube_password, '<xts:string id="IDS_PASSWORD" encode="javascript"/>'))
  130. {
  131. return false;
  132. }
  133. </xsl:when>
  134. <xsl:otherwise>
  135. if (!checkMandatory(f.m_signon_userid, m1))
  136. {
  137. return false;
  138. }
  139. if (f.m_signon_password.value != f.m_signon_confirm_password.value)
  140. {
  141. alert(m2);
  142. return false;
  143. }
  144. if (!checkReservedChar(f.m_signon_userid, '<xts:string id="IDS_USERID" encode="javascript"/>'))
  145. {
  146. return false;
  147. }
  148. if (!checkReservedChar(f.m_signon_password, '<xts:string id="IDS_PASSWORD" encode="javascript"/>'))
  149. {
  150. return false;
  151. }
  152. </xsl:otherwise>
  153. </xsl:choose>
  154. return true;
  155. }
  156. function checkMandatory(obj, label)
  157. {
  158. obj.value = trim(obj.value);
  159. if (obj.value == '')
  160. {
  161. <xsl:variable name="errmsg">
  162. <xts:string id="IDS_ERR_MANDATORY" encode="javascript">
  163. <xts:param name="field">" + label + "</xts:param>
  164. </xts:string>
  165. </xsl:variable>
  166. window.alert("<xsl:value-of select="normalize-space($errmsg)"/>");
  167. obj.focus();
  168. return false;
  169. }
  170. return true;
  171. }
  172. function init()
  173. {
  174. if (document.pform.m_signon_userid)
  175. document.pform.m_signon_userid.focus();
  176. }
  177. </script>
  178. <script language="JavaScript" src="{$webcontent}/{$app}/js/utilities.js"/>
  179. </dp:script>
  180. <utml:form name="pform" action="{$gateway}" method="post">
  181. <!-- Dialog header -->
  182. <dp:header>
  183. <dp:title><xsl:value-of select="$browserTitle"/></dp:title>
  184. <dp:description>
  185. <xsl:choose>
  186. <xsl:when test="$isPowerCube">
  187. <xsl:text/><xts:string id="IDS_NEW_INTRO_SIGNON_POWERCUBE"/><xsl:text/>
  188. </xsl:when>
  189. <xsl:otherwise>
  190. <xsl:text/><xts:string id="IDS_NEW_INTRO_SIGNON"/><xsl:text/>
  191. </xsl:otherwise>
  192. </xsl:choose>
  193. </dp:description>
  194. </dp:header>
  195. <lyt:layout style="1" border="no">
  196. <lyt:section>
  197. <xsl:choose>
  198. <xsl:when test="$isPowerCube">
  199. <dp:input>
  200. <dp:section1>
  201. <label for="ctrl_m_cube_password"><xts:string id="IDS_PASSWORD"/></label>
  202. </dp:section1>
  203. <dp:section2>
  204. <utml:input type="password" name="m_cube_password" size="53" utml:update="false" value="" id="ctrl_m_cube_password"/>
  205. </dp:section2>
  206. </dp:input>
  207. <dp:input>
  208. <dp:section1>
  209. <label for="ctrl_m_cube_confirm_password"><xts:string id="IDS_SELECT_CONNECT_CONFIRMPASSWORD"/></label>
  210. </dp:section1>
  211. <dp:section2>
  212. <utml:input type="password" name="m_cube_confirm_password" size="53" utml:update="false" value="" id="ctrl_m_cube_confirm_password"/>
  213. </dp:section2>
  214. </dp:input>
  215. </xsl:when>
  216. <xsl:otherwise>
  217. <dp:input>
  218. <dp:section1>
  219. <label for="ctrl_m_signon_userid"><xts:string id="IDS_USERID"/></label>
  220. </dp:section1>
  221. <dp:section2>
  222. <utml:input type="text" name="m_signon_userid" size="53" id="ctrl_m_signon_userid"/>
  223. </dp:section2>
  224. </dp:input>
  225. <dp:input>
  226. <dp:section1>
  227. <label for="ctrl_m_signon_password"><xts:string id="IDS_PASSWORD"/></label>
  228. </dp:section1>
  229. <dp:section2>
  230. <utml:input type="password" name="m_signon_password" size="53" utml:update="false" value="" id="ctrl_m_signon_password"/>
  231. </dp:section2>
  232. </dp:input>
  233. <dp:input>
  234. <dp:section1>
  235. <label for="ctrl_m_signon_confirm_password"><xts:string id="IDS_CONFIRM_PASSWORD"/></label>
  236. </dp:section1>
  237. <dp:section2>
  238. <utml:input type="password" name="m_signon_confirm_password" size="53" utml:update="false" value="" id="ctrl_m_signon_confirm_password"/>
  239. </dp:section2>
  240. </dp:input>
  241. </xsl:otherwise>
  242. </xsl:choose>
  243. </lyt:section>
  244. </lyt:layout>
  245. <dp:footer>
  246. <df:button df:id="IDS_CANCEL" df:style="back-url" onclick="{$dc-confirm-cancel}"/>
  247. <df:button df:id="IDS_BACK" df:style="maintain">
  248. <df:target><xsl:value-of select="concat($app,'/new_general.xts')"/></df:target>
  249. </df:button>
  250. <df:button df:id="IDS_NEXT" df:style="maintain" utml:validate="true">
  251. <df:target><xsl:value-of select="concat($app,'/new_signon2.xts')"/></df:target>
  252. </df:button>
  253. <df:button df:id="IDS_FINISH"/>
  254. </dp:footer>
  255. </utml:form>
  256. </dp:page>
  257. </xsl:template>
  258. </xsl:stylesheet>
  259. </xts:block>
  260. <!--
  261. ================================================================================
  262. debug
  263. ================================================================================
  264. -->
  265. <xts:block id="debug" type="exec" mode="output" processor="XSLT" condition=".[/root/session/param[@name = 'debug'] = '1']" mandatory="false" mimeType="text/html" dependency="render_page">
  266. <!-- Get the debug logic sheet -->
  267. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  268. <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">
  269. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  270. <xsl:template match="/">
  271. <dbg:dumpxml select="/root"/>
  272. </xsl:template>
  273. </xsl:stylesheet>
  274. </xts:block>
  275. </xts:morphlet>