prompt.xts 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561
  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, 2019
  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/portal.xml, messages/portalRL.xml">
  9. <xts:block id="formatPrompt" mode="output" processor="XSLT" type="exec" mimeType="text/html"
  10. mandatory="false">
  11. <xts:logicsheet path="logicsheets/portal.xsl"/>
  12. <xts:logicsheet path="logicsheets/presentation/dialog/templates.xsl"/>
  13. <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
  14. <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
  15. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  16. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  17. <xts:logicsheet path="logicsheets/validation.xslt"/>
  18. <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
  19. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  20. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  21. xmlns:fault="http://developer.cognos.com/schemas/xts/portal/iFaultHandler/1/"
  22. xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  23. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  24. xmlns:faults="http://www.w3.org/2001/09/soap-faults"
  25. xmlns:cam="http://developer.cognos.com/schemas/CAM/AAA/1/"
  26. xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/"
  27. xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
  28. xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
  29. xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/"
  30. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  31. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  32. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  33. exclude-result-prefixes="xsl bus fault SOAP-ENV faults cam xtsext df dp cp lyt pf xsi xts">
  34. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  35. <!-- Global variable definitions -->
  36. <xsl:variable name="mname" select="'prompt.xts'"/>
  37. <pf:variables/>
  38. <pf:modalVariables/>
  39. <xsl:variable name="prompt-action" select="/root/header/*/Prompt//item[name='h_promptAction']/value"/>
  40. <xsl:variable name="verifyTextNoEcho" select="//*[local-name() = 'type' and . = 'verifytextnoecho']/../*[local-name()= 'name']"/>
  41. <xsl:variable name="title">
  42. <xsl:choose>
  43. <xsl:when test="string($prompt-action) = 'AmbigiousDataSourceConnection'"><xts:string id="IDS_AMBIGIOUS_DATASOURCECONNECTION"/></xsl:when>
  44. <xsl:when test="string($prompt-action) = 'AmbigiousSignon'"><xts:string id="IDS_AMBIGIOUS_SIGNONS"/></xsl:when>
  45. <xsl:otherwise><xts:string id="IDS_LOGON_TITLE"/></xsl:otherwise>
  46. </xsl:choose>
  47. </xsl:variable>
  48. <xsl:variable name="browserTitle">
  49. <xsl:choose>
  50. <xsl:when test="string($prompt-action) = 'AmbigiousDataSourceConnection'"><xts:string id="IDS_AMBIGIOUS_DATASOURCECONNECTION"/></xsl:when>
  51. <xsl:when test="string($prompt-action) = 'AmbigiousSignon'"><xts:string id="IDS_AMBIGIOUS_SIGNONS"/></xsl:when>
  52. <xsl:otherwise><xts:string id="IDS_LOGON_TITLE_BROWSER"/></xsl:otherwise>
  53. </xsl:choose>
  54. </xsl:variable>
  55. <xsl:variable name="externalBack">
  56. <xsl:if test="/root/env/param[@name='BACK'] or /root/env/param[@name='back']">
  57. <xsl:value-of select="concat(string(/root/env/param[@name='BACK']),string(/root/env/param[@name='back']))"/>
  58. </xsl:if>
  59. </xsl:variable>
  60. <!-- Prefix field names with o_ based on defined condition variables -->
  61. <xsl:variable name="formFieldPrefix">
  62. <xsl:variable name="faultFieldVars" select="/root/command//*[local-name()='fault']//*[local-name()='Header']//*[local-name() = 'formFieldVars']"/>
  63. <xsl:variable name="faultOriginalRequest" select="/root/command//*[local-name()='originalRequest']"/>
  64. <!-- Variables required to set the formFieldPrefix -->
  65. <!-- These condition variables are based on condition checks done during the apply templates to determine if re-routing to main.xts, -->
  66. <!-- in which case all active form fields require a prefix - otherwise main.xts removes them before redirecting. -->
  67. <xsl:variable name="mItem" select="$faultFieldVars/*[local-name()='item']/*[local-name()='name' and .='m']"/>
  68. <xsl:variable name="doingRedirect" select="string($mItem)!='' and not(contains(string($mItem/../*[local-name()='value']),concat($app,'/main.xts'))) and string(/root/command//item[name='REQUEST_METHOD']/value)!=''"/>
  69. <xsl:variable name="hasNoBody" select="not($faultOriginalRequest//*[local-name()='Envelope']/*[local-name()='Body']/*)"/>
  70. <xsl:variable name="isNoWaiting" select="not($faultOriginalRequest//*[local-name()='item']/*[local-name()='name' and .='ui.action']/../*[local-name()='value' and .='wait'])"/>
  71. <xsl:variable name="hasFields" select="$faultFieldVars/*"/>
  72. <xsl:if test="($isNoWaiting and $hasFields) and $hasNoBody and $doingRedirect">
  73. <xsl:text>o_</xsl:text>
  74. </xsl:if>
  75. </xsl:variable>
  76. <!-- Main template -->
  77. <xsl:template match="/root">
  78. <!-- transform the fault to html -->
  79. <xsl:apply-templates select="command/fault:prompt"/>
  80. </xsl:template>
  81. <!-- html output -->
  82. <xsl:template match="command/fault:prompt">
  83. <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html></xsl:text><dp:page longTitle="$browserTitle" cache="false">
  84. <dp:meta>
  85. <pf:meta/>
  86. </dp:meta>
  87. <dp:script>
  88. <xsl:comment>
  89. <xsl:text>&lt;ERROR_CODE>CAM_PASSPORT_ERROR&lt;/ERROR_CODE></xsl:text>
  90. </xsl:comment>
  91. <script language="javascript">
  92. var sParamDelimiter = "<xsl:value-of select="xtsext:javascriptencode(string(key('system-param', 'delimiters')/@d1))"/>";
  93. var sNameValueDelimiter = "<xsl:value-of select="xtsext:javascriptencode(string(key('system-param', 'delimiters')/@d2))"/>";
  94. var sCookiePath = "<xsl:value-of select="xtsext:javascriptencode(string($cookie_path))"/>";
  95. var sCookieDomain = "<xsl:value-of select="xtsext:javascriptencode(string($cookie_domain))"/>";
  96. var sCookieSecure = "<xsl:value-of select="xtsext:javascriptencode(string($cookie_secure))"/>";
  97. </script>
  98. <script language="javascript" src="{$webcontent}/{$app}/js/cookie_jar.js"/>
  99. <script language="javascript">
  100. function init()
  101. {
  102. <!-- Give focus to the first visible control -->
  103. var nFormFields = document.pform.elements.length;
  104. for (var i=0; i&lt;nFormFields; i++)
  105. {
  106. if( document.pform.elements[i].type != 'hidden' )
  107. {
  108. //Handle a timing error in IE which can prevent setting the focus
  109. setTimeout('document.pform.elements[' + i + '].focus()',1);
  110. break;
  111. }
  112. }
  113. return true;
  114. }
  115. function doClose()
  116. {
  117. doCloseCancel('close');
  118. }
  119. function doCancel()
  120. {
  121. doCloseCancel('cancel');
  122. }
  123. function doCloseCancel(event)
  124. {
  125. var emptyHistoryThreshold = <xsl:choose><xsl:when test="$browser = 'ie'">0</xsl:when><xsl:otherwise>1</xsl:otherwise></xsl:choose>;
  126. <xsl:choose>
  127. <xsl:when test="$externalBack!=''">
  128. setTimeout("document.location.href = '<xsl:value-of select="xtsext:javascriptencode(xtsext:javascriptencode(string($externalBack)))"/>'",100); <!-- SEC_INFO: Double javascript encode $externalBack to prevent javascript injection. -->
  129. </xsl:when>
  130. <xsl:when test="$isModal">
  131. <!-- Set the right call back target -->
  132. var callBackTarget = <xsl:value-of select="$callBackTargetJSVar"/>;
  133. if( callBackTarget )
  134. {
  135. callBackTarget.<xsl:value-of select="$callBackFunctionName"/>(event, null);
  136. }
  137. </xsl:when>
  138. <xsl:when test="$prompt-action!=''">
  139. if( parent &amp;&amp; parent.closeErrorPage )
  140. parent.closeErrorPage();
  141. else if (window.external &amp;&amp; window.external.HasOnClose)
  142. window.external.OnClose(1);
  143. else if ( history.length > emptyHistoryThreshold )
  144. {
  145. document.cform.submit();
  146. }
  147. else
  148. window.close();
  149. </xsl:when>
  150. <xsl:otherwise>
  151. if( parent &amp;&amp; parent.closeErrorPage )
  152. parent.closeErrorPage();
  153. else if (window.external &amp;&amp; window.external.HasOnClose)
  154. window.external.OnClose(1);
  155. else if ( history.length > emptyHistoryThreshold )
  156. history.back();
  157. else
  158. window.close();
  159. </xsl:otherwise>
  160. </xsl:choose>
  161. }
  162. function validate()
  163. {
  164. <!-- Only care to validate a password change. If that is the case then do it, otherwise, return true. -->
  165. var sVerifyTextNoEcho = "<xsl:value-of select="$verifyTextNoEcho"/>";
  166. if (document.pform.elements[sVerifyTextNoEcho])
  167. {
  168. if (document.pform.elements[sVerifyTextNoEcho][0].value != document.pform.elements[sVerifyTextNoEcho][1].value)
  169. {
  170. var s = "<xts:string id="IDS_ERR_0003_PASSWORD_VERIF_FAILED" encode="javascript"/>";
  171. alert(s);
  172. return false;
  173. }
  174. }
  175. return true;
  176. }
  177. function doSubmit()
  178. {
  179. if (validate())
  180. {
  181. document.pform.submit();
  182. cmdOK_disable();
  183. return true;
  184. }
  185. else
  186. {
  187. return false;
  188. }
  189. }
  190. </script>
  191. <pf:help context=""/>
  192. </dp:script>
  193. <!-- Preserve any PATH_INFO from the original request. -->
  194. <xsl:variable name="formAction" select="concat($gateway,string(.//*[local-name()='originalRequest']//*[local-name()='environmentVars']/*[local-name()='item']/*[local-name()='name' and .='PATH_INFO']/../*[local-name()='value']))"/>
  195. <form method="post" action="{$formAction}" name="pform">
  196. <!-- Insert modal dialog paramaters if they exist -->
  197. <xsl:for-each select=".//*[local-name() = 'formFieldVars']/*[starts-with(local-name(), 'md.')]">
  198. <input type="hidden" name="{*[local-name() = 'name']}" value="{*[local-name() = 'value']}"/>
  199. </xsl:for-each>
  200. <xsl:if test="not(/root/env/param[@name='errURL']) and /root/env/param[@name='ui.backURL']!=''">
  201. <input type="hidden" name="errURL" value="{/root/env/param[@name='ui.backURL']}"/>
  202. </xsl:if>
  203. <!-- Render the body (log in details) -->
  204. <xsl:apply-templates/>
  205. <dp:footer copyright="true">
  206. <td>
  207. <cp:cmdButton defaultState="active" id="cmdOK" type="submit">
  208. <cp:cmdButtonText><xts:string id="IDS_OK"/></cp:cmdButtonText>
  209. <cp:cmdButtonEvents>
  210. <cp:cmdButtonEvent name="onclick">return doSubmit()</cp:cmdButtonEvent>
  211. </cp:cmdButtonEvents>
  212. </cp:cmdButton>
  213. </td>
  214. <td>
  215. <cp:cmdButton defaultState="active" id="cmdCancel">
  216. <cp:cmdButtonText><xts:string id="IDS_CANCEL"/></cp:cmdButtonText>
  217. <cp:cmdButtonEvents>
  218. <cp:cmdButtonEvent name="onclick">doCancel()</cp:cmdButtonEvent>
  219. </cp:cmdButtonEvents>
  220. </cp:cmdButton>
  221. </td>
  222. </dp:footer>
  223. </form>
  224. <xsl:variable name="backProtocol">
  225. <xsl:if test="contains(/root/env/param[@name='ui.backURL'],'?')">
  226. <xsl:value-of select="substring-before(/root/env/param[@name='ui.backURL'],'?')"/>
  227. </xsl:if>
  228. </xsl:variable>
  229. <xsl:variable name="backFormAction">
  230. <xsl:choose>
  231. <xsl:when test="$backProtocol = '' or $backProtocol = $formAction">
  232. <xsl:value-of select="$formAction"/>
  233. </xsl:when>
  234. <xsl:when test="not(contains($backProtocol,$gateway))">
  235. <xsl:value-of select="$gateway"/>
  236. <xsl:if test="not(starts-with($backProtocol,'/'))"><xsl:text>/</xsl:text></xsl:if>
  237. <xsl:value-of select="$backProtocol"/>
  238. </xsl:when>
  239. <xsl:otherwise>
  240. <xsl:value-of select="$backProtocol"/>
  241. </xsl:otherwise>
  242. </xsl:choose>
  243. </xsl:variable>
  244. <form method="post" action="{$backFormAction}" name="cform">
  245. <xsl:variable name="returnURL" select="substring-after(/root/env/param[@name='ui.backURL'],'?')"/>
  246. <xsl:call-template name="inputs">
  247. <xsl:with-param name="urlInputs" select="$returnURL"/>
  248. </xsl:call-template>
  249. </form>
  250. </dp:page>
  251. </xsl:template>
  252. <xsl:template name="inputs">
  253. <xsl:param name="urlInputs" select="''"/>
  254. <xsl:variable name="parm">
  255. <xsl:if test="$urlInputs!=''">
  256. <xsl:choose>
  257. <xsl:when test="contains($urlInputs,'&amp;')">
  258. <xsl:value-of select="substring-before($urlInputs,'&amp;')"/>
  259. </xsl:when>
  260. <xsl:otherwise>
  261. <xsl:value-of select="$urlInputs"/>
  262. </xsl:otherwise>
  263. </xsl:choose>
  264. </xsl:if>
  265. </xsl:variable>
  266. <xsl:if test="$parm!=''">
  267. <xsl:variable name="vn" select="substring-before($parm,'=')"/>
  268. <xsl:variable name="vv" select="substring-after($parm,'=')"/>
  269. <input type="hidden" name="{$vn}" value="{$vv}"/>
  270. <xsl:call-template name="inputs">
  271. <xsl:with-param name="urlInputs" select="substring-after($urlInputs,'&amp;')"/>
  272. </xsl:call-template>
  273. </xsl:if>
  274. </xsl:template>
  275. <xsl:template match="SOAP-ENV:Envelope">
  276. <!-- Only handle the "deepest" fault -->
  277. <xsl:choose>
  278. <xsl:when test="descendant::*[local-name()!='Envelope']">
  279. <!-- dialog header -->
  280. <dp:header>
  281. <!-- header titles-->
  282. <dp:title><xsl:value-of select="$title"/></dp:title>
  283. <!-- close link for the header -->
  284. <dp:close>
  285. <a href="javascript:doClose()">
  286. <dp:closeMarker/>
  287. </a>
  288. </dp:close>
  289. <!-- header description -->
  290. <dp:description>
  291. <xsl:for-each select="SOAP-ENV:Header/descendant::*[local-name() = 'promptInfo']/*[local-name() = 'captions']/*">
  292. <xsl:value-of select="concat(., ' ')"/>
  293. </xsl:for-each>
  294. </dp:description>
  295. </dp:header>
  296. <!-- pass through the detail to be caught by the templates below -->
  297. <lyt:layout style="1">
  298. <lyt:section>
  299. <xsl:apply-templates select="SOAP-ENV:Header"/>
  300. </lyt:section>
  301. </lyt:layout>
  302. </xsl:when>
  303. <xsl:otherwise>
  304. <!-- go deeper -->
  305. <xsl:apply-templates select="descendant::*[local-name()='Envelope'][1]"/>
  306. </xsl:otherwise>
  307. </xsl:choose>
  308. </xsl:template>
  309. <!-- Render CAM fields -->
  310. <xsl:template match="*[@xsi:type = 'bus:displayObject']">
  311. <xsl:choose>
  312. <!-- Hidded fields -->
  313. <xsl:when test="*[local-name() = 'type'] = 'hidden'">
  314. <input type="hidden" name="{$formFieldPrefix}{*[local-name() = 'name']}" value="{*[local-name() = 'value']}"/>
  315. </xsl:when>
  316. <xsl:otherwise>
  317. <dp:input>
  318. <dp:section1>
  319. <xsl:value-of select="*[local-name() = 'caption']"/>
  320. </dp:section1>
  321. <dp:section2 width="100%">
  322. <!-- Account for single selection fields - e.g. namespace selection -->
  323. <xsl:choose>
  324. <xsl:when test="*[local-name() = 'type']='singleselect'">
  325. <select name="{$formFieldPrefix}{*[local-name() = 'name']}" onkeypress="submitThis(event)">
  326. <xsl:for-each select="*[local-name() = 'promptOptions']/*">
  327. <option value="{*[local-name() = 'id']}">
  328. <xsl:if test="*[local-name() = 'default'] = 'true'">
  329. <xsl:attribute name="selected">selected</xsl:attribute>
  330. </xsl:if>
  331. <xsl:value-of select="*[local-name() = 'value']"/>
  332. </option>
  333. </xsl:for-each>
  334. </select>
  335. <script language="JavaScript">
  336. function submitThis(e)
  337. {
  338. var sKey = null;
  339. if (window.event) //IE, Safari
  340. sKey = window.event.keyCode;
  341. else
  342. sKey = e.which; //Moz
  343. if ((sKey == '13') || (sKey=='32'))
  344. window.document.pform.submit();
  345. }
  346. </script>
  347. </xsl:when>
  348. <!-- Static display fields -->
  349. <xsl:when test="*[local-name() = 'type']='display'">
  350. <input name="{$formFieldPrefix}{*[local-name() = 'name']}" value="{*[local-name() = 'value']}" type="hidden"/>
  351. <dp:text><xsl:value-of select="*[local-name() = 'value']"/></dp:text>
  352. </xsl:when>
  353. <xsl:otherwise>
  354. <!-- Password / Text fields-->
  355. <input name="{$formFieldPrefix}{*[local-name() = 'name']}" value="{*[local-name() = 'value']}">
  356. <xsl:if test="contains(*[local-name() = 'type'], 'textnoecho')">
  357. <xsl:attribute name="type">password</xsl:attribute>
  358. <xsl:attribute name="autocomplete">off</xsl:attribute>
  359. </xsl:if>
  360. <xsl:if test="*[local-name() = 'type']='text'">
  361. <xsl:attribute name="type">text</xsl:attribute>
  362. </xsl:if>
  363. </input>
  364. </xsl:otherwise>
  365. </xsl:choose>
  366. </dp:section2>
  367. </dp:input>
  368. </xsl:otherwise>
  369. </xsl:choose>
  370. </xsl:template>
  371. <xsl:template match="fault:originalRequest">
  372. <xsl:choose>
  373. <!--
  374. If the current request is an asynch (wait) request then we need to resubmit the original "run" request
  375. provided we do have the form field vars that represent the "run" request.
  376. -->
  377. <xsl:when test=" (.//*[local-name() = 'formFieldVars']/*[local-name()='item']/*[local-name()='name' and .='ui.action']/../*[local-name()='value' and .='wait']) and (../fault:fault//bus:formFieldVars/*)">
  378. <xsl:call-template name="genFormFieldsForOriginalHTTPRequest">
  379. <xsl:with-param name="formFieldVarsArray">
  380. <xsl:copy-of select="../fault:fault//bus:formFieldVars"/>
  381. </xsl:with-param>
  382. </xsl:call-template>
  383. </xsl:when>
  384. <xsl:when test="SOAP-ENV:Envelope/SOAP-ENV:Body/*">
  385. <xsl:call-template name="genFormFieldsForOriginalHTTPRequest">
  386. <xsl:with-param name="formFieldVarsArray">
  387. <xsl:copy-of select=".//*[local-name() = 'formFieldVars']"/>
  388. </xsl:with-param>
  389. </xsl:call-template>
  390. </xsl:when>
  391. <xsl:otherwise>
  392. <xsl:variable name="mparam" select=".//*[local-name() = 'formFieldVars']/*[local-name()='item']/*[local-name()='name' and .='m']"/>
  393. <xsl:variable name="mvalue" select=".//*[local-name() = 'formFieldVars']/*[local-name()='item']/*[local-name()='name' and .='m']/../*[local-name()='value']"/>
  394. <xsl:choose>
  395. <xsl:when test="string($mparam)!='' and $mvalue != concat($app,'/main.xts') ">
  396. <xsl:call-template name="genFormFieldsForOriginalHTTPRequest">
  397. <xsl:with-param name="formFieldVarsArray">
  398. <xsl:copy-of select=".//*[local-name() = 'formFieldVars']"/>
  399. </xsl:with-param>
  400. <xsl:with-param name="redirectMethod" select=".//item[name='REQUEST_METHOD']/value"/>
  401. </xsl:call-template>
  402. </xsl:when>
  403. <xsl:otherwise>
  404. <xsl:call-template name="genFormFieldsForOriginalHTTPRequest">
  405. <xsl:with-param name="formFieldVarsArray">
  406. <xsl:copy-of select=".//*[local-name() = 'formFieldVars']"/>
  407. </xsl:with-param>
  408. </xsl:call-template>
  409. </xsl:otherwise>
  410. </xsl:choose>
  411. </xsl:otherwise>
  412. </xsl:choose>
  413. </xsl:template>
  414. <xsl:template name="genFormFieldsForOriginalHTTPRequest">
  415. <xsl:param name="formFieldVarsArray"/>
  416. <xsl:param name="redirectMethod" select="''"/>
  417. <xsl:choose>
  418. <!-- If we have a redirect method then we must redirect -->
  419. <xsl:when test="$redirectMethod != ''">
  420. <xsl:variable name="m_override" select="$formFieldVarsArray/*[local-name()='item']/*[local-name()='name' and .='m_override']"/>
  421. <xsl:variable name="m_override_value" select="$formFieldVarsArray/*[local-name()='item']/*[local-name()='name' and .='m_override']/../*[local-name()='value']"/>
  422. <xsl:for-each select="$formFieldVarsArray/bus:formFieldVars/*">
  423. <xsl:if test="not(starts-with(name, 'CAM'))">
  424. <xsl:choose>
  425. <xsl:when test="$m_override">
  426. <xsl:if test="name!='m' and name!='m_override'">
  427. <input type="hidden" name="{concat('o_', *[local-name() = 'name'])}" value="{*[local-name() = 'value']}"/>
  428. </xsl:if>
  429. </xsl:when>
  430. <xsl:otherwise>
  431. <input type="hidden" name="{concat('o_', *[local-name() = 'name'])}" value="{*[local-name() = 'value']}"/>
  432. <xsl:if test="starts-with(name, 'md.')">
  433. <!-- if it is a modal variable, it must also be in the form with its original name -->
  434. <!-- otherwise, if it is possible that these variables won't get passed on to another request -->
  435. <input type="hidden" name="{*[local-name() = 'name']}" value="{*[local-name() = 'value']}"/>
  436. </xsl:if>
  437. </xsl:otherwise>
  438. </xsl:choose>
  439. </xsl:if>
  440. </xsl:for-each>
  441. <xsl:if test="$m_override">
  442. <input type="hidden" name="o_m" value="{$m_override_value}"/>
  443. </xsl:if>
  444. <input type="hidden" name="m" value="{$app}/main.xts"/>
  445. <input type="hidden" name="b_action" value="xts.run"/>
  446. <input type="hidden" name="m_method" value="{$redirectMethod}"/>
  447. </xsl:when>
  448. <xsl:otherwise>
  449. <xsl:for-each select="$formFieldVarsArray/bus:formFieldVars/*">
  450. <xsl:if test="not(starts-with(name, 'CAM'))">
  451. <input type="hidden" name="{*[local-name() = 'name']}" value="{*[local-name() = 'value']}"/>
  452. </xsl:if>
  453. </xsl:for-each>
  454. </xsl:otherwise>
  455. </xsl:choose>
  456. </xsl:template>
  457. <xsl:template match="text()"/>
  458. </xsl:stylesheet>
  459. </xts:block>
  460. <!--
  461. ===============================================================================================
  462. debug - display debug information
  463. ===============================================================================================
  464. -->
  465. <xts:block id="debug" dependency="formatPrompt" condition=".[ /root/session/param[@name='debug'] = '1' or /root/env/param[@name = 'd'] = '1' ]" type="exec" mode="output" processor="XSLT" mandatory="false" mimeType="text/html" >
  466. <!-- <xts:block id="debug" dependency="formatLogin formatError" type="exec" mode="output" processor="XSLT" mandatory="false" mimeType="text/html" > -->
  467. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  468. <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">
  469. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  470. <xsl:template match="/">
  471. <dbg:dumpxml select="/root"/>
  472. </xsl:template>
  473. </xsl:stylesheet>
  474. </xts:block>
  475. </xts:morphlet>