new_connection2.xts 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439
  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, 2014
  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. delete_encrypted_passwords
  22. It is possible that this requests includes encrypted passwords if the user is
  23. returning (clicked on Back) from the Specify the connection string step of the
  24. New Data Source/New Connection Wizard. Since going back results in the
  25. passwords being "forgotten", we must delete them from the DOM.
  26. ================================================================================
  27. -->
  28. <xts:block id="delete_encrypted_passwords" type="exec" mode="interpret" processor="XML" mandatory="false" condition=".[/root/env/param[@name='m_connection_password' or @name='m_connection_confirm_password' or @name='m_cube_password' or @name='m_cube_confirm_password']]">
  29. <xts:sequence>
  30. <xts:delete select="/root/env/param[@name='m_connection_password' or @name='m_connection_confirm_password' or @name='m_cube_password' or @name='m_cube_confirm_password']"/>
  31. </xts:sequence>
  32. </xts:block>
  33. <!--
  34. ================================================================================
  35. get_content
  36. ================================================================================
  37. -->
  38. <xts:block id="get_content" type="exec" mode="interpret" processor="XML" nodelist="">
  39. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  40. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  41. <xsl:template match="/">
  42. <xts:sequence>
  43. <xts:append>
  44. <connection>
  45. <dataSourceConnection xmlns="http://developer.cognos.com/schemas/xts-cm/1/">
  46. <permissions>read write execute setPolicy traverse</permissions>
  47. </dataSourceConnection>
  48. </connection>
  49. </xts:append>
  50. <xts:append>
  51. <config>
  52. <xts:function name="getConfiguration">
  53. <xts:param name="dataAccess"/>
  54. <xts:param name="edition"/>
  55. </xts:function>
  56. </config>
  57. </xts:append>
  58. <!-- get a list of installed components -->
  59. <xts:append>
  60. <installedComponents>
  61. <xts:function name="getConfiguration">
  62. <xts:param name="installedComponents"/>
  63. </xts:function>
  64. </installedComponents>
  65. </xts:append>
  66. <xts:append>
  67. <xts:transform src="/transforms/portal/dataSource/filterHiddenDatasources.xslt" processor="XSLT">
  68. <root>
  69. <xts:queryNode select="/root/env"/>
  70. <xts:queryNode select="/root/system"/>
  71. <config>
  72. <param name="dataAccess"><xts:queryValue select="/root/config/configuration/property[@name='dataAccess']"/></param>
  73. <param name="edition"><xts:queryValue select="/root/config/configuration/property[@name='edition']"/></param>
  74. </config>
  75. <xts:queryNode select="/root/installedComponents"/>
  76. <xts:transform src="/transforms/portal/dataSource/generateDatasourceMetadata.xslt" processor="XSLT">
  77. <xts:param name="messageBase">/messages/portal.xml</xts:param>
  78. <root/>
  79. </xts:transform>
  80. </root>
  81. </xts:transform>
  82. </xts:append>
  83. </xts:sequence>
  84. </xsl:template>
  85. </xsl:stylesheet>
  86. </xts:block>
  87. <!--
  88. ===============================================================================================
  89. renderPage - render the page
  90. ===============================================================================================
  91. -->
  92. <xts:block id="render_page" mode="output" processor="XSLT" type="exec" mimeType="text/html" dependency="formlogic_init get_content delete_encrypted_passwords">
  93. <!-- get the presentation theme -->
  94. <xts:logicsheet path="logicsheets/portal.xsl"/>
  95. <xts:logicsheet path="logicsheets/presentation/dialog/templates.xsl"/>
  96. <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
  97. <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
  98. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  99. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  100. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  101. <!-- apply the form logic -->
  102. <xts:logicsheet path="logicsheets/formlogic.xslt"/>
  103. <xts:logicsheet path="logicsheets/validation.xslt"/>
  104. <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
  105. <xsl:stylesheet version="1.0"
  106. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  107. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  108. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  109. xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/"
  110. xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
  111. xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/"
  112. xmlns:dt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/templates/"
  113. xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
  114. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  115. xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
  116. xmlns:x="x"
  117. xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/"
  118. exclude-result-prefixes="xsl cm cf cp pf df dp lyt utml x">
  119. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  120. <!-- current file name -->
  121. <xsl:variable name="mname" select="'new_connection2.xts'"/>
  122. <!-- add any theme variables -->
  123. <pf:variables/>
  124. <xsl:variable name="fromCMM" select="key('env-param', 'fromCMM')"/>
  125. <!-- start the output -->
  126. <xsl:template match="/root">
  127. <xsl:variable name="backURL" select="key('env-param','backURL')"/>
  128. <xsl:variable name="connect-type">
  129. <xsl:choose>
  130. <xsl:when test="key('env-param','m_connection_type')!=''">
  131. <xsl:value-of select="key('env-param','m_connection_type')"/>
  132. </xsl:when>
  133. <xsl:otherwise>consolidation</xsl:otherwise>
  134. </xsl:choose>
  135. </xsl:variable>
  136. <xsl:variable name="supportsIso">
  137. <xsl:value-of select="datasources/datasource[value=$connect-type]/supportsIsolationLevels"/>
  138. </xsl:variable>
  139. <xsl:variable name="supportsJdbc">
  140. <xsl:value-of select="count(datasources/datasource[value=$connect-type]/queryServiceEquivalent)!=0"/>
  141. </xsl:variable>
  142. <xsl:variable name="wizardTitle">
  143. <xsl:choose>
  144. <xsl:when test="key('env-param','m_new_class')='dataSource'"><xts:string id="IDS_NEW_DATA_SOURCE_TITLE"/></xsl:when>
  145. <xsl:otherwise><xts:string id="IDS_NEW_CONNECTION_TITLE"/></xsl:otherwise>
  146. </xsl:choose>
  147. </xsl:variable>
  148. <xsl:variable name="browserTitle">
  149. <xsl:text/><xts:string id="IDS_NEW_TITLE_CONNECTION">
  150. <xts:param name="wizardTitle"><xsl:value-of select="$wizardTitle"/></xts:param>
  151. </xts:string><xsl:text/>
  152. </xsl:variable>
  153. <xsl:variable name="pageDescription">
  154. <xsl:choose>
  155. <xsl:when test="key('env-param','m_new_class')='dataSource'">
  156. <xsl:text/><xts:string id="IDS_NEW_INTRO_DATASOURCE"/><xsl:text/>
  157. </xsl:when>
  158. <xsl:otherwise>
  159. <xsl:text/><xts:string id="IDS_NEW_INTRO_CONNECTION"/><xsl:text/>
  160. </xsl:otherwise>
  161. </xsl:choose>
  162. </xsl:variable>
  163. <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html></xsl:text><dp:page longTitle="$browserTitle">
  164. <dp:meta>
  165. <!-- Standard meta tags -->
  166. <pf:meta/>
  167. </dp:meta>
  168. <dp:script>
  169. <script language="javascript">
  170. function disableIso(disable) {
  171. var frm = document.pform;
  172. if (frm) {
  173. var lstIsoLevel = frm.m_p_isolationLevel;
  174. if (lstIsoLevel) {
  175. lstIsoLevel.disabled = disable;
  176. }
  177. }
  178. }
  179. function disableJdbc(disable) {
  180. var frm = document.pform;
  181. if (frm.m_create_jdbc){
  182. frm.m_create_jdbc.disabled = disable;
  183. // For Generic JDBC, we will need to set the check box as checked, but disabled.
  184. if (frm.m_connection_type.value == 'jdbc-generic' || frm.m_connection_type.value == 'lob-jdbc') {
  185. frm.m_create_jdbc.checked = true;
  186. } else {
  187. frm.m_create_jdbc.checked = !disable;
  188. }
  189. }
  190. }
  191. <xsl:if test="$fromCMM">
  192. function doCMMCancel() {
  193. document.cmmform.submit();
  194. }
  195. </xsl:if>
  196. <xsl:if test="key('env-param','from_bmt')!=''">
  197. <!-- Called only when canceling back to BMT environment. -->
  198. function doCancel() {
  199. window.external.OnClose(1);
  200. }
  201. </xsl:if>
  202. function mustDisable(type,attr) {
  203. var frm = document.pform;
  204. if (frm) {
  205. var dataSrcList = frm.m_connection_type.options;
  206. for (var i=0;i&lt;dataSrcList.length;i++) {
  207. if (dataSrcList[i].value == type) {
  208. return dataSrcList[i].getAttribute('supports'+attr) == 'false';
  209. }
  210. }
  211. }
  212. return false;
  213. }
  214. function changeType() {
  215. var frm = document.pform;
  216. if (frm) {
  217. var dataSrcList = frm.m_connection_type;
  218. var disableIsolation = mustDisable(dataSrcList[dataSrcList.selectedIndex].value,'Isolation');
  219. frm.m_p_iso_pref[0].disabled = disableIsolation;
  220. frm.m_p_iso_pref[1].disabled = disableIsolation;
  221. disableIso(disableIsolation || frm.m_p_iso_pref[0].checked);
  222. <xsl:if test="count(/root/installedComponents/configuration/property/component[string(.)='queryService'])!=0">
  223. disableJdbc(mustDisable(dataSrcList[dataSrcList.selectedIndex].value,'Jdbc'));
  224. </xsl:if>
  225. if (frm.m_p_connectionString) {
  226. frm.m_p_connectionString.value = '';
  227. }
  228. //update the data source capability if needed
  229. var eltSelect = frm.m_connection_type;
  230. var dsCapability = eltSelect.options[eltSelect.selectedIndex].getAttribute("dataSourceCapability");
  231. frm.m_dscap.value = (dsCapability != "") ? dsCapability: "reporting";
  232. }
  233. }
  234. function init() {
  235. var frm = document.pform;
  236. if (frm) {
  237. frm.m_p_isolationLevel.disabled = !frm.m_p_iso_pref[1].checked;
  238. }
  239. changeType();
  240. }
  241. </script>
  242. <!-- Help system -->
  243. <pf:help context="HID_ADD_MODIFY_DATA_SOURCE"/>
  244. </dp:script>
  245. <utml:form name="pform" method="post" action="{$gateway}">
  246. <dp:header>
  247. <!-- header titles-->
  248. <dp:title><xsl:value-of select="$browserTitle"/></dp:title>
  249. <dp:description><xsl:value-of select="$pageDescription"/></dp:description>
  250. <dp:close>
  251. <xsl:choose>
  252. <xsl:when test="key('env-param','from_bmt')">
  253. <a href="javascript:doCancel()">
  254. <dp:closeMarker/>
  255. </a>
  256. </xsl:when>
  257. <xsl:when test="$fromCMM">
  258. <a href="javascript:doCMMCancel()">
  259. <dp:closeMarker/>
  260. </a>
  261. </xsl:when>
  262. <xsl:otherwise>
  263. <a href="{$backURL}">
  264. <dp:closeMarker/>
  265. </a>
  266. </xsl:otherwise>
  267. </xsl:choose>
  268. </dp:close>
  269. </dp:header>
  270. <lyt:layout style="1">
  271. <lyt:section>
  272. <dp:list role="presentation">
  273. <xsl:variable name="repositoryOnly" select="contains(key('env-param','m_classSubtype'),'externalRepository')"/>
  274. <xsl:variable name="dataSourceOnly" select="contains(key('env-param','m_classSubtype'),'dataSource')"/>
  275. <dp:section>
  276. <dp:label for="connectionType_ID"><xts:string id="IDS_PROP_CONN_TYPE"/></dp:label>
  277. </dp:section>
  278. <dp:section>
  279. <utml:select size="1" name="m_connection_type" id="connectionType_ID" onchange="changeType()">
  280. <xsl:for-each select="datasources/datasource">
  281. <xsl:sort select="name"/>
  282. <xsl:if test="($repositoryOnly and value='filenet') or ($dataSourceOnly and value != 'filenet') or (($repositoryOnly = false) and ($dataSourceOnly = false)) ">
  283. <utml:option>
  284. <utml:value>
  285. <xsl:value-of select="value"/>
  286. </utml:value>
  287. <xsl:attribute name="supportsIsolation">
  288. <xsl:value-of select="supportsIsolationLevels"/>
  289. </xsl:attribute>
  290. <xsl:attribute name="supportsJdbc">
  291. <xsl:value-of select="count(queryServiceEquivalent)!=0"/>
  292. </xsl:attribute>
  293. <xsl:attribute name="dataSourceCapability">
  294. <xsl:value-of select="defaultCapability"/>
  295. </xsl:attribute>
  296. <xsl:value-of select="name"/>
  297. </utml:option>
  298. </xsl:if>
  299. </xsl:for-each>
  300. </utml:select>
  301. <utml:input type="hidden" name="m_connection_type_history"/>
  302. <!-- the default data source capability to reporting, this value got updated while you change the connection type-->
  303. <utml:input type="hidden" name="m_dscap" value="reporting" update="true"/>
  304. </dp:section>
  305. </dp:list>
  306. <img height="5" width="1" src="{$webcontent}/images/space.gif"/>
  307. <dp:list>
  308. <dp:section>
  309. <dp:label for="isolationLevel_ID" id="isolationLevel_ID">
  310. <xts:string id="IDS_PROP_CONN_ISOLATION"/>
  311. </dp:label>
  312. </dp:section>
  313. </dp:list>
  314. <utml:radio-group name="m_p_iso_pref" default-value="default">
  315. <dp:choice aria-labelledby="isolationLevel_ID">
  316. <dp:section1>
  317. <utml:input type="radio" value="default" id="useDefaultGateway_ID" onclick="disableIso(true);">
  318. <xsl:attribute name="disabled">disabled</xsl:attribute>
  319. </utml:input>
  320. </dp:section1>
  321. <dp:section2 for="useDefaultGateway_ID">
  322. <xts:string id="IDS_PROP_CONN_GATEWAYDEFAULT"/>
  323. </dp:section2>
  324. <dp:section1>
  325. <utml:input type="radio" value="specify" id="specifyValue_ID" onclick="disableIso(false);">
  326. <xsl:if test="$supportsIso='false'">
  327. <xsl:attribute name="disabled">disabled</xsl:attribute>
  328. </xsl:if>
  329. </utml:input>
  330. </dp:section1>
  331. <dp:section2 for="specifyValue_ID">
  332. <xts:string id="IDS_PROP_CONN_SPECIFYVALUE"/>
  333. </dp:section2>
  334. <dp:section3>
  335. <utml:select size="1" name="m_p_isolationLevel" id="isolationLevel_ID" disabled="true">
  336. <utml:option value="cursorStability">
  337. <xts:string id="IDS_PROP_CONN_CURSOR"/>
  338. </utml:option>
  339. <utml:option value="phantomProtection">
  340. <xts:string id="IDS_PROP_CONN_PHANTOM"/>
  341. </utml:option>
  342. <utml:option value="readCommitted">
  343. <xts:string id="IDS_PROP_CONN_COMMITTED"/>
  344. </utml:option>
  345. <utml:option value="readUncommitted">
  346. <xts:string id="IDS_PROP_CONN_UNCOMMITTED"/>
  347. </utml:option>
  348. <utml:option value="reproducibleRead">
  349. <xts:string id="IDS_PROP_CONN_REPRODUCIBLE"/>
  350. </utml:option>
  351. <utml:option value="serializable">
  352. <xts:string id="IDS_PROP_CONN_SERIALIZABLE"/>
  353. </utml:option>
  354. </utml:select>
  355. </dp:section3>
  356. </dp:choice>
  357. <xsl:if test="count(datasources/datasource/queryServiceEquivalent) != 0 and count(/root/installedComponents/configuration/property/component[string(.)='queryService'])!=0">
  358. <dp:choice>
  359. <dp:section1>
  360. <utml:input type="checkbox" name="m_create_jdbc" id="configureJDBC_ID">
  361. <xsl:if test="$supportsJdbc='false'">
  362. <xsl:attribute name="disabled">disabled</xsl:attribute>
  363. </xsl:if>
  364. </utml:input>
  365. </dp:section1>
  366. <dp:section2 for="configureJDBC_ID">
  367. <xts:string id="IDS_PROP_CONN_CREATE_JDBC"/>
  368. </dp:section2>
  369. </dp:choice>
  370. </xsl:if>
  371. </utml:radio-group>
  372. </lyt:section>
  373. </lyt:layout>
  374. <dp:footer>
  375. <!-- Cancel button -->
  376. <xsl:choose>
  377. <xsl:when test="key('env-param','from_bmt')!=''">
  378. <df:button df:id="IDS_CANCEL" df:style="href" df:href="javascript:doCancel()"/>
  379. </xsl:when>
  380. <xsl:when test="$fromCMM">
  381. <df:button df:id="IDS_CANCEL" df:style="href" df:href="javascript:doCMMCancel()"/>
  382. </xsl:when>
  383. <xsl:otherwise>
  384. <df:button df:id="IDS_CANCEL" df:style="back-url"/>
  385. </xsl:otherwise>
  386. </xsl:choose>
  387. <!-- Back button -->
  388. <df:button df:id="IDS_BACK" df:style="maintain">
  389. <df:target>
  390. <xsl:value-of select="concat($app, '/new_general.xts')"/>
  391. </df:target>
  392. </df:button>
  393. <!-- Next button -->
  394. <df:button df:id="IDS_NEXT" df:style="maintain">
  395. <df:target>
  396. <xsl:value-of select="concat($app, '/new_connection3.xts')"/>
  397. </df:target>
  398. </df:button>
  399. <!-- Finish button -->
  400. <df:button df:id="IDS_FINISH"/>
  401. </dp:footer>
  402. </utml:form>
  403. <xsl:if test="$fromCMM">
  404. <dt:cmmPostBackForm/>
  405. </xsl:if>
  406. </dp:page>
  407. </xsl:template>
  408. </xsl:stylesheet>
  409. </xts:block>
  410. <!--
  411. ===============================================================================================
  412. debug - display debug information
  413. ===============================================================================================
  414. -->
  415. <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">
  416. <!-- get the debug logic sheet -->
  417. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  418. <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">
  419. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  420. <xsl:template match="/">
  421. <dbg:dumpxml select="/root"/>
  422. </xsl:template>
  423. </xsl:stylesheet>
  424. </xts:block>
  425. </xts:morphlet>