doLoginProxy.xts 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: AGS
  5. (C) Copyright IBM Corp. 2005, 2015
  6. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. -->
  8. <xts:morphlet version="1.0" xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="messages/AGS.xml,messages/portal.xml,messages/portalRL.xml" requiredCapability="canUseEventStudio">
  9. <!--
  10. This morphlet (dfsdfsdf.xts) consists of the following blocks:
  11. formlogic_init - update various /root/env level parameters based on new or changed /root/env parameters.
  12. format - render the product about page.
  13. -->
  14. <!--
  15. ===============================================================================================
  16. Get the information for the agent
  17. ===============================================================================================
  18. -->
  19. <xts:block id="queryCM" type="exec" mode="interpret" condition=".[not(/root/env/param[@name='htmlFragment']) or /root/env/param[@name='htmlFragment'] = '']" processor="XSLT">
  20. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  21. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" exclude-result-prefixes="send cm">
  22. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  23. <xsl:template match="/">
  24. <xts:sequence>
  25. <xts:append select="root">
  26. <agentDefinition>
  27. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  28. <send:request provider="cm" requester="AGS:doLoginProxy">
  29. <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
  30. <cm:query>
  31. <cm:search>~</cm:search>
  32. <cm:properties>
  33. <cm:property name="searchPath"/>
  34. </cm:properties>
  35. </cm:query>
  36. </xts:transform>
  37. </send:request>
  38. </xts:transform>
  39. </agentDefinition>
  40. </xts:append>
  41. </xts:sequence>
  42. </xsl:template>
  43. </xsl:stylesheet>
  44. </xts:block>
  45. <!--
  46. ================================================================================
  47. TWEAK M
  48. and delete html fragment
  49. ================================================================================
  50. -->
  51. <xts:block id="tweakm" processor="XSLT" type="exec" condition=".[/root/env/param[@name='htmlFragment'] != '']" mandatory="false">
  52. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="xtsext">
  53. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  54. <xsl:template match="/">
  55. <xts:sequence>
  56. <xts:append select="/root">
  57. <htmlFragment>
  58. <xsl:value-of select="/root/env/param[@name='htmlFragment']" disable-output-escaping="no"/>
  59. </htmlFragment>
  60. </xts:append>
  61. <xts:delete select="/root/env/param[@name='htmlFragment']"/>
  62. <xts:delete select="/root/header//*[local-name()='formFieldVars']/item[./name='htmlFragment']"/>
  63. <xts:delete select="/root/env/param[@name='m']"/>
  64. <xts:append select="/root/env">
  65. <param name="m">
  66. <xsl:text>/portal/iFaultHandler/handleFault.xts</xsl:text>
  67. </param>
  68. </xts:append>
  69. </xts:sequence>
  70. </xsl:template>
  71. </xsl:stylesheet>
  72. </xts:block>
  73. <!--
  74. ================================================================================
  75. render_page
  76. Render the HTML really, just the dialog adapter page
  77. ===============================================================================================
  78. -->
  79. <xts:block id="logonFromHeaderFault" dependency="tweakm" processor="XSLT" type="exec" mode="interpret" condition=".[/root/htmlFragment != '']" mandatory="false">
  80. <xts:logicsheet path="ags/logicsheets/agentDefinition.xsl"/>
  81. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  82. xmlns:fault="http://developer.cognos.com/schemas/xts/portal/iFaultHandler/1/"
  83. xmlns:xos="http://developer.cognos.com/schemas/xts/output/" >
  84. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
  85. <xsl:template match="/">
  86. <xts:sequence>
  87. <xts:append select="/root/output">
  88. <xos:part>
  89. <xos:entityHeader>
  90. <xos:param name="Content-Type">text/html; charset=utf-8</xos:param>
  91. </xos:entityHeader>
  92. <xos:entityBody>
  93. <xts:request name="BUS" target="bus://xts2/portal/iFaultHandler/handleFault.xts" option="content" outputHeader="true">
  94. <!-- env -->
  95. <xsl:copy-of select="/root/env"/>
  96. <!-- system -->
  97. <xsl:copy-of select="/root/system"/>
  98. <!-- http -->
  99. <xsl:copy-of select="/root/http"/>
  100. <!-- session -->
  101. <xsl:copy-of select="/root/session"/>
  102. <!-- header vars -->
  103. <xsl:copy-of select="/root/header"/>
  104. <!-- credential -->
  105. <xsl:copy-of select="/root/credential"/>
  106. <!-- cookies-->
  107. <xsl:copy-of select="/root/cookies"/>
  108. <!-- user vars -->
  109. <xsl:copy-of select="/root/user"/>
  110. <command>
  111. <fault:handleFault>
  112. <xsl:value-of select="/root/htmlFragment" disable-output-escaping="yes"/>
  113. <fault:originalRequest>
  114. <xsl:copy-of select="/root/header//*[local-name()='formFieldVars']"/>
  115. </fault:originalRequest>
  116. </fault:handleFault>
  117. </command>
  118. </xts:request>
  119. </xos:entityBody>
  120. </xos:part>
  121. </xts:append>
  122. </xts:sequence>
  123. </xsl:template>
  124. </xsl:stylesheet>
  125. </xts:block>
  126. <xts:block id="hidePopupFrame" mode="output" processor="XSLT" type="exec" mimeType="text/html" dependency="queryCM logonFromHeaderFault" condition=".[not(/root/env/param[@name='origin']) or /root/env/param[@name='origin' != 'popUpFrame'] and not(/root/env/param[@name='htmlFragment'])]" mandatory="false">
  127. <!-- portal specific information -->
  128. <xts:logicsheet path="logicsheets/portal.xsl"/>
  129. <!-- Get the new theme logicsheets. -->
  130. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  131. <!-- apply the form logic -->
  132. <xts:logicsheet path="logicsheets/formlogic.xslt"/>
  133. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  134. xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/"
  135. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  136. xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
  137. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  138. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  139. exclude-result-prefixes="utml dp pf xtsext">
  140. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
  141. <!-- add any theme variables -->
  142. <pf:variables/>
  143. <xsl:template match="/">
  144. <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html></xsl:text>
  145. <html>
  146. <head>
  147. <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
  148. <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  149. <script type="text/javascript" src="../ags/layout.js">//</script>
  150. <script type="text/javascript" src="../ags/cmd.js">//</script>
  151. <script type="text/javascript" src="../ags/util.js">//</script>
  152. <script type="text/javascript">
  153. function init() {
  154. var cf = parent.getConfigFrame();
  155. if(cf.doClosePopUp){
  156. //Now close the popup wait.
  157. cf.doClosePopUp();
  158. cf.getCommandStackManager().processCommandStack();
  159. }
  160. }
  161. </script>
  162. </head>
  163. <body onload="init();">
  164. </body>
  165. </html>
  166. </xsl:template>
  167. </xsl:stylesheet>
  168. </xts:block>
  169. <!--
  170. ===============================================================================================
  171. Deal with the original form submit. This will restore the initial call that may have faulted
  172. with a logon page earlier.
  173. ===============================================================================================
  174. -->
  175. <xts:block id="hidePopupFrame2" mode="output" processor="XSLT" type="exec" mimeType="text/html" dependency="hidePopupFrame" condition=".[/root/env/param[@name='origin'] and /root/env/param[@name='origin' = 'popUpFrame'] and not(/root/env/param[@name='htmlFragment'])]" mandatory="false">
  176. <!-- portal specific information -->
  177. <xts:logicsheet path="logicsheets/portal.xsl"/>
  178. <!-- Get the new theme logicsheets. -->
  179. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  180. <!-- apply the form logic -->
  181. <xts:logicsheet path="logicsheets/formlogic.xslt"/>
  182. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="utml dp pf xtsext">
  183. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
  184. <!-- add any theme variables -->
  185. <pf:variables/>
  186. <xsl:template match="/">
  187. <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html></xsl:text><dp:page>
  188. <!-- specify the style sheet(used to render the active/inactive hint text)
  189. todo move this into its own xslt file. Do not put it into the dp stuff because that is relevant to the whole portal
  190. -->
  191. <utml:form name="pform" method="post" action="{$gateway}">
  192. <utml:exclusion-list><xsl:value-of select="' origin original_m '"/></utml:exclusion-list>
  193. </utml:form>
  194. <dp:script>
  195. <script type="text/javascript">
  196. function init()
  197. {
  198. var cf = parent.getConfigFrame();
  199. //Mark it for closure now
  200. if(cf.doSetPopUpClosureFlag){
  201. cf.doSetPopUpClosureFlag();
  202. }
  203. var m = '<xsl:value-of select="xtsext:javascriptencode(string(/root/env/param[@name='original_m']))"/>';
  204. // forward to the correct location
  205. document.pform.m.value = m;
  206. if (document.pform.ps_nav_op) {
  207. var psNavOp = '<xsl:value-of select="xtsext:javascriptencode(string(/root/env/param[@name='ps_nav_op']))"/>';
  208. document.pform.ps_nav_op.value = psNavOp;
  209. }
  210. document.pform.target = "messageIFrame";
  211. document.pform.submit();
  212. }
  213. </script>
  214. </dp:script>
  215. </dp:page>
  216. </xsl:template>
  217. </xsl:stylesheet>
  218. </xts:block>
  219. </xts:morphlet>