new_connection4.xts 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395
  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/" xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" messageBase="messages/portal.xml, messages/portalRL.xml" requiredCapability="canUseDataSourcesTool">
  13. <!--
  14. ===============================================================================================
  15. formlogic_init - standard form logic initialization
  16. ===============================================================================================
  17. -->
  18. <xts:block id="formlogic_init" type="exec" mode="interpret" processor="XSLT" path="/logicsheets/formlogic_init.xslt" nodelist="env,credential,system,http"/>
  19. <!--
  20. ======================================================================================
  21. encrypt the password - never store passwords in the page if they're not encrypted.
  22. ======================================================================================
  23. -->
  24. <xts:block id="encrypt_password" dependency="formlogic_init" type="exec" mode="interpret" processor="XSLT" mandatory="false" condition=".[/root/env/param[@name='m_connection_password'] != '']">
  25. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  26. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  27. <xsl:variable name="xtscm" select="'http://developer.cognos.com/schemas/xts-cm/1/'"/>
  28. <xsl:template match="/">
  29. <xts:sequence>
  30. <xsl:if test="not(/root/env/param[@name='passwordEncrypted']) or /root/env/param[@name='passwordEncrypted'] = ''">
  31. <xts:delete select="/root/env/param[@name='passwordEncrypted']"/>
  32. <xts:append select="/root/env">
  33. <param name="passwordEncrypted">
  34. <xts:encrypt>
  35. <xts:param name="provider">cognos.cam</xts:param>
  36. <xts:param name="source">
  37. <xsl:choose>
  38. <xsl:when test="/root/env/param[@name='m_connection_password' !='' and @format='encrypted']">
  39. <xts:decrypt>
  40. <xts:param name="provider">cognos.cam</xts:param>
  41. <xts:param name="source"><xsl:value-of select="/root/env/param[@name='m_connection_password']"/></xts:param>
  42. </xts:decrypt>
  43. </xsl:when>
  44. <xsl:otherwise>
  45. <xsl:value-of select="/root/env/param[@name='m_connection_password']"/>
  46. </xsl:otherwise>
  47. </xsl:choose>
  48. </xts:param>
  49. </xts:encrypt>
  50. </param>
  51. </xts:append>
  52. <xts:delete select="/root/env/param[@name='m_connection_password']"/>
  53. <xts:delete select="/root/env/param[@name='m_connection_confirm_password']"/>
  54. </xsl:if>
  55. </xts:sequence>
  56. </xsl:template>
  57. </xsl:stylesheet>
  58. </xts:block>
  59. <!--
  60. ===============================================================================================================
  61. get_content
  62. - if we're creating a new oracle connection then query for the commands stored on the dataSource
  63. - add the information in the DOM for the pager control
  64. ===============================================================================================================
  65. -->
  66. <xts:block id="get_content" processor="XSLT" type="exec" mode="interpret" condition=".[/root/env/param[@name='m_new_type']='dataSourceConnection' or /root/env/param[@name='m_class']='dataSourceConnection']" mandatory="false">
  67. <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
  68. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  69. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt">
  70. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  71. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  72. <xsl:template match="/">
  73. <xts:sequence>
  74. <xts:append>
  75. <parentDataSource>
  76. <xts:transform src="transforms/portal/dataSource/stripnamespace.xslt" processor="XSLT">
  77. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  78. <send:request provider="cm">
  79. <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
  80. <query xmlns="http://developer.cognos.com/schemas/xts-cm/1/">
  81. <search><xsl:value-of select="key('env-param','m_path')"/></search>
  82. <properties>
  83. <cm:property name="searchPath"/>
  84. <cm:property name="openConnectionCommands"/>
  85. <cm:property name="openSessionCommands"/>
  86. <cm:property name="closeConnectionCommands"/>
  87. <cm:property name="closeSessionCommands"/>
  88. </properties>
  89. <cm:options schemaInfo="true"/>
  90. </query>
  91. </xts:transform>
  92. </send:request>
  93. </xts:transform>
  94. </xts:transform>
  95. </parentDataSource>
  96. </xts:append>
  97. </xts:sequence>
  98. </xsl:template>
  99. </xsl:stylesheet>
  100. </xts:block>
  101. <!--
  102. ===============================================================================================================
  103. remove pager params
  104. ===============================================================================================================
  105. -->
  106. <xts:block id="remove_pager_params" processor="XSLT" type="exec" mode="interpret" mandatory="false">
  107. <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
  108. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  109. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt">
  110. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  111. <xsl:template match="/">
  112. <xts:sequence>
  113. <xts:delete select="/root/env/param[@name='pagerfromlistpager']"/>
  114. <xts:delete select="/root/env/param[@name='pagertolistpager']"/>
  115. <xts:delete select="/root/env/param[@name='pagerfrom_dlistpager']"/>
  116. <xts:delete select="/root/env/param[@name='pagerto_dlistpager']"/>
  117. </xts:sequence>
  118. </xsl:template>
  119. </xsl:stylesheet>
  120. </xts:block>
  121. <!--
  122. ===============================================================================================
  123. load_metadata
  124. ===============================================================================================
  125. -->
  126. <xts:block id="load_metadata" processor="XSLT" type="exec" mode="interpret" nodelist="">
  127. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  128. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  129. <xsl:template match="/">
  130. <xts:sequence>
  131. <xts:append>
  132. <xts:transform src="transforms/portal/dataSource/extractDatasourceMetadata.xslt" processor="XSLT">
  133. <root>
  134. <xts:queryNode select="/root/env"/>
  135. <xts:transform src="/transforms/portal/dataSource/generateDatasourceMetadata.xslt" processor="XSLT">
  136. <xts:param name="messageBase">/messages/portal.xml</xts:param>
  137. <root/>
  138. </xts:transform>
  139. </root>
  140. </xts:transform>
  141. </xts:append>
  142. </xts:sequence>
  143. </xsl:template>
  144. </xsl:stylesheet>
  145. </xts:block>
  146. <!--
  147. ===============================================================================================
  148. getConfig - retrieve the configuration UI settings
  149. ===============================================================================================
  150. -->
  151. <xts:block id="process_command_blocks" dependency="get_content load_metadata" type="exec" mode="interpret" processor="XSLT" path="portal/command_blocks.xml"/>
  152. <!--
  153. ===============================================================================================
  154. renderPage - render the page
  155. ===============================================================================================
  156. -->
  157. <xts:block id="render_page" mode="output" processor="XSLT" type="exec" mimeType="text/html" dependency="process_command_blocks encrypt_password get_content formlogic_init">
  158. <!-- get the presentation theme -->
  159. <xts:logicsheet path="logicsheets/portal.xsl"/>
  160. <xts:logicsheet path="logicsheets/presentation/dialog/connections.xslt"/>
  161. <xts:logicsheet path="logicsheets/presentation/dialog/templates.xsl"/>
  162. <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
  163. <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
  164. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  165. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  166. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  167. <!-- apply the form logic -->
  168. <xts:logicsheet path="logicsheets/formlogic.xslt"/>
  169. <xts:logicsheet path="logicsheets/validation.xslt"/> <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
  170. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  171. xmlns:dcx="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/connections/1/"
  172. xmlns:dt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/templates/"
  173. xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/"
  174. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  175. xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
  176. xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/"
  177. xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
  178. xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
  179. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  180. xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/"
  181. exclude-result-prefixes="xsl dcx cf cp pf df dp dt lyt utml">
  182. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  183. <!-- current file name -->
  184. <xsl:variable name="mname" select="'new_connection4.xts'"/>
  185. <!-- add any theme variables -->
  186. <pf:variables/>
  187. <dcx:commandTemplate/>
  188. <!-- start the output -->
  189. <xsl:template match="/root">
  190. <xsl:variable name="backURL" select="key('env-param','backURL')"/>
  191. <xsl:variable name="browserTitle">
  192. <xsl:choose>
  193. <xsl:when test="key('env-param','m_new_class')='dataSource'">
  194. <xts:string id="IDS_NEW_DATA_SOURCE_COMMANDS_TITLE"/>
  195. </xsl:when>
  196. <xsl:otherwise>
  197. <xts:string id="IDS_NEW_CONNECTION_COMMANDS_TITLE"/>
  198. </xsl:otherwise>
  199. </xsl:choose>
  200. </xsl:variable>
  201. <xsl:variable name="fromCMM" select="key('env-param', 'fromCMM')"/>
  202. <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html></xsl:text><dp:page longTitle="$browserTitle">
  203. <dp:meta>
  204. <!-- Standard meta tags -->
  205. <pf:meta/>
  206. </dp:meta>
  207. <dp:script>
  208. <!-- Help system -->
  209. <pf:help context="HID_DATABASE_COMMANDS"/>
  210. <dt:selectDeselectAll/>
  211. <script language="javascript">
  212. <xsl:if test="$fromCMM">
  213. function doCMMCancel()
  214. {
  215. document.cmmform.submit();
  216. }
  217. </xsl:if>
  218. <xsl:if test="key('env-param','from_bmt')!=''">
  219. <!-- Called only when canceling back to BMT environment.
  220. from_bmt is not exclusive to BMT. It is added to the environment by the new_connection.xts
  221. Therefore any external application that calls this morphlet will be defining this from_bmt
  222. (Transformer, BMT ...).
  223. -->
  224. function doCancel()
  225. {
  226. window.external.OnClose(1);
  227. }
  228. </xsl:if>
  229. </script>
  230. </dp:script>
  231. <utml:form name="pform" method="post" action="{$gateway}">
  232. <utml:exclusion-list>
  233. <xsl:value-of select="' m_connection_password m_connection_confirm_password '"/>
  234. </utml:exclusion-list>
  235. <dp:header>
  236. <!-- header titles-->
  237. <dp:title><xsl:value-of select="normalize-space($browserTitle)"/></dp:title>
  238. <dp:description>
  239. <xsl:choose>
  240. <xsl:when test="key('env-param','m_new_class')='dataSource'">
  241. <xts:string id="IDS_NEW_INTRO_DATASOURCE_COMMANDS"/>
  242. </xsl:when>
  243. <xsl:otherwise>
  244. <xts:string id="IDS_NEW_INTRO_CONNECTION_COMMANDS"/>
  245. </xsl:otherwise>
  246. </xsl:choose>
  247. </dp:description>
  248. <dp:close>
  249. <xsl:choose>
  250. <xsl:when test="key('env-param','from_bmt')">
  251. <a href="javascript:doCancel()">
  252. <dp:closeMarker/>
  253. </a>
  254. </xsl:when>
  255. <xsl:when test="$fromCMM">
  256. <a href="javascript:doCMMCancel()">
  257. <dp:closeMarker/>
  258. </a>
  259. </xsl:when>
  260. <xsl:otherwise>
  261. <a href="{$backURL}">
  262. <dp:closeMarker/>
  263. </a>
  264. </xsl:otherwise>
  265. </xsl:choose>
  266. </dp:close>
  267. </dp:header>
  268. <xsl:call-template name="dcx-commandTemplate">
  269. <xsl:with-param name="form-read-only" select="$form-read-only"/>
  270. <xsl:with-param name="utml-form-name" select="$utml-form-name"/>
  271. <xsl:with-param name="canWrite" select="true()"/>
  272. <xsl:with-param name="dataSourceConnection" select="key('env-param','m_new_class')='dataSourceConnection'"/>
  273. <xsl:with-param name="inWizard" select="true()"/>
  274. </xsl:call-template>
  275. <!-- Drop the "Wait" dialog here so it gets rendered in the correct spot on the page -->
  276. <xsl:if test="key('env-param','from_bmt')">
  277. <cp:genericDialog id="wait" width="200" height="100">
  278. <cp:param name="title"></cp:param>
  279. <cp:param name="message">
  280. <img src="{$brand_images}progress.gif" align="absmiddle"/><xsl:value-of select="'&#160;&#160;&#160;&#160;&#160;&#160;'"/><xts:string id="IDS_WAIT"/>
  281. </cp:param>
  282. </cp:genericDialog>
  283. </xsl:if>
  284. <dp:footer>
  285. <!-- Cancel button -->
  286. <xsl:choose>
  287. <xsl:when test="key('env-param','from_bmt')!=''">
  288. <df:button df:id="IDS_CANCEL" df:style="href" df:href="javascript:doCancel()"/>
  289. </xsl:when>
  290. <xsl:when test="$fromCMM">
  291. <df:button df:id="IDS_CANCEL" df:style="href" df:href="javascript:doCMMCancel()"/>
  292. </xsl:when>
  293. <xsl:otherwise>
  294. <df:button df:id="IDS_CANCEL" df:style="back-url"/>
  295. </xsl:otherwise>
  296. </xsl:choose>
  297. <!-- Back button -->
  298. <df:button df:id="IDS_BACK" df:style="maintain">
  299. <df:target>
  300. <xsl:value-of select="concat($app, '/new_connection3.xts')"/>
  301. </df:target>
  302. </df:button>
  303. <!-- Next button -->
  304. <df:button df:id="IDS_NEXT"/>
  305. <utml:input type="hidden" name="m_return" value=""/>
  306. <!-- Finish button -->
  307. <script language="javascript">
  308. var bCommandSent = false;
  309. function finish()
  310. {
  311. document.pform.ps_nav_op.value = "maintain";
  312. document.pform.m.value = "<xsl:value-of select="$app"/>/submit.xts";
  313. <xsl:if test="key('env-param', 'm_new_class')='dataSource' and (key('env-param', 'from_transf')!='' or (not($fromCMM) and not(key('env-param', 'from_bmt')!='')))">
  314. <!-- we don't have to set the m_return when the wizard is called by CMM, FM and PW1.
  315. This is already taken care by new_connection.xts.
  316. The new_connection_finish.xts will present the option to create a package
  317. when permitted.
  318. Exception is for the Transformer which provides from_bmt and from_transf (BUG# 539911).
  319. -->
  320. document.pform.m_return.value = "<xsl:value-of select="$app"/>/new_connection_finish.xts";
  321. </xsl:if>
  322. <xsl:choose>
  323. <xsl:when test="key('env-param','from_bmt')">
  324. if (!bCommandSent)
  325. {
  326. document.pform.submit();
  327. bCommandSent = true;
  328. <xsl:if test="$browser='ie'">
  329. wait.show();
  330. document.body.style.cursor = "wait";
  331. </xsl:if>
  332. }
  333. else
  334. {
  335. bCommandSent = false;
  336. <xsl:if test="$browser='ie'">
  337. document.body.style.cursor = "default";
  338. wait.hide();
  339. </xsl:if>
  340. }
  341. </xsl:when>
  342. <xsl:otherwise>
  343. document.pform.submit();
  344. </xsl:otherwise>
  345. </xsl:choose>
  346. }
  347. </script>
  348. <df:button df:id="IDS_FINISH" df:style="href" df:href="javascript:finish()"/>
  349. </dp:footer>
  350. </utml:form>
  351. <xsl:if test="$fromCMM">
  352. <dt:cmmPostBackForm/>
  353. </xsl:if>
  354. </dp:page>
  355. </xsl:template>
  356. </xsl:stylesheet>
  357. </xts:block>
  358. <!--
  359. ===============================================================================================
  360. debug - display debug information
  361. ===============================================================================================
  362. -->
  363. <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">
  364. <!-- get the debug logic sheet -->
  365. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  366. <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">
  367. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  368. <xsl:template match="/">
  369. <dbg:dumpxml select="/root"/>
  370. </xsl:template>
  371. </xsl:stylesheet>
  372. </xts:block>
  373. </xts:morphlet>