properties_connection.xts 51 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215
  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, 2020
  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="canUseAdministrationPortal">
  13. <!--
  14. ===============================================================================================
  15. formlogic_init
  16. Standard form logic initialization
  17. ===============================================================================================
  18. -->
  19. <xts:block id="formlogic_init" type="exec" mode="interpret" processor="XSLT" path="/logicsheets/formlogic_init.xslt" nodelist="env,credential,system,http"/>
  20. <!-- Load object-specific property tabs map ============================================================== -->
  21. <xts:block id="getTabs" type="exec" mode="interpret" processor="XML" path="/portal/uiobjects_tabs.xml"/>
  22. <!--
  23. ================================================================================
  24. get_content
  25. Retrieve the data source connection details from Content Manager.
  26. ================================================================================
  27. -->
  28. <xts:block id="get_content" processor="XSLT" type="exec" mode="interpret" dependency="formlogic_init">
  29. <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
  30. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  31. <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">
  32. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  33. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  34. <xsl:template match="/">
  35. <xsl:choose>
  36. <xsl:when test="key('env-param','m_connection_data')!=''">
  37. <xts:sequence>
  38. <xts:append>
  39. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap', string(key('env-param','m_connection_data'))), true())" disable-output-escaping="yes"/>
  40. </xts:append>
  41. </xts:sequence>
  42. </xsl:when>
  43. <xsl:otherwise>
  44. <xts:sequence>
  45. <xts:append>
  46. <connection>
  47. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  48. <send:request provider="cm">
  49. <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
  50. <query xmlns="http://developer.cognos.com/schemas/xts-cm/1/">
  51. <search>
  52. <xsl:value-of select="key('env-param','m_obj')"/>
  53. <xsl:text>[permission(&quot;read&quot;)]</xsl:text>
  54. </search>
  55. <properties>
  56. <cml:prop-connection/>
  57. </properties>
  58. <options schemaInfo="true">
  59. <refProps>
  60. <refProp refPropName="parent">
  61. <properties>
  62. <property name="openConnectionCommands"/>
  63. <property name="openSessionCommands"/>
  64. <property name="closeConnectionCommands"/>
  65. <property name="closeSessionCommands"/>
  66. <property name="capabilities"/>
  67. </properties>
  68. </refProp>
  69. </refProps>
  70. </options>
  71. </query>
  72. </xts:transform>
  73. </send:request>
  74. </xts:transform>
  75. </connection>
  76. </xts:append>
  77. </xts:sequence>
  78. </xsl:otherwise>
  79. </xsl:choose>
  80. <xts:sequence>
  81. <xts:append>
  82. <namespaces>
  83. <xts:transform src="transforms/portal/dataSource/stripnamespace.xslt" processor="XSLT">
  84. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  85. <send:request provider="cm">
  86. <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
  87. <query xmlns="http://developer.cognos.com/schemas/xts-cm/1/">
  88. <search>/directory/namespace</search>
  89. <properties>
  90. <cm:property name="defaultName"/>
  91. <cm:property name="searchPath"/>
  92. <cm:property name="active"/>
  93. </properties>
  94. </query>
  95. </xts:transform>
  96. </send:request>
  97. </xts:transform>
  98. </xts:transform>
  99. </namespaces>
  100. </xts:append>
  101. <xts:delete select="/root/env/param[@name='pagerfromlistpager']"/>
  102. <xts:delete select="/root/env/param[@name='pagertolistpager']"/>
  103. <xts:delete select="/root/env/param[@name='pagerfrom_dlistpager']"/>
  104. <xts:delete select="/root/env/param[@name='pagerto_dlistpager']"/>
  105. </xts:sequence>
  106. </xsl:template>
  107. </xsl:stylesheet>
  108. </xts:block>
  109. <!--
  110. ===============================================================================================
  111. process_command_blocks
  112. ===============================================================================================
  113. -->
  114. <xts:block id="process_command_blocks" dependency="get_content load_metadata" type="exec" mode="interpret" processor="XSLT" path="portal/command_blocks.xml"/>
  115. <!--
  116. ================================================================================
  117. parse_connect_string
  118. This block examines the database code contained in the connection string to
  119. determine what the connection type is.
  120. This block only runs if the connection_type parameter is not present.
  121. ================================================================================
  122. -->
  123. <xts:block id="parse_connect_string" type="exec" mode="interpret" dependency="get_content" processor="XSLT" mandatory="false" condition=".[not(/root/env/param[@name='m_connection_type'])]">
  124. <xts:logicsheet path="logicsheets/portal.xsl"/>
  125. <xsl:stylesheet version="1.0"
  126. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  127. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  128. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  129. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  130. exclude-result-prefixes="cm pf xtsext">
  131. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  132. <xsl:variable name="xtscm" select="'http://developer.cognos.com/schemas/xts-cm/1/'"/>
  133. <pf:variables/>
  134. <xsl:template match="/">
  135. <xsl:variable name="capability" select="/root/connection/cm:queryResponse/cm:dataSourceConnection/cm:parent/cm:dataSource/cm:dataSourceCapabilities/cm:capability"/>
  136. <xsl:variable name="connectionString">
  137. <xsl:choose>
  138. <xsl:when test="/root/env/param[@name='m_p_connectionString'] != ''">
  139. <xsl:value-of select="/root/env/param[@name='m_p_connectionString']"/>
  140. </xsl:when>
  141. <xsl:otherwise>
  142. <xsl:value-of select="/root/connection/cm:queryResponse/cm:dataSourceConnection/cm:connectionString"/>
  143. </xsl:otherwise>
  144. </xsl:choose>
  145. </xsl:variable>
  146. <xsl:variable name="type">
  147. <xsl:choose>
  148. <xsl:when test="contains($capability, 'Enum#lobData')">
  149. <xsl:text>lob-jdbc</xsl:text>
  150. </xsl:when>
  151. <xsl:when test="contains($connectionString, ';LOCAL;CR') and not(contains($connectionString, 'SERVER='))">
  152. <!-- Contributor -->
  153. <xsl:text>contributor</xsl:text>
  154. </xsl:when>
  155. <xsl:when test="contains($connectionString, ';LOCAL;CR;') and contains($connectionString, 'SERVER=')">
  156. <!-- Contributor Series 7-->
  157. <xsl:text>contributorSeries7</xsl:text>
  158. </xsl:when>
  159. <xsl:when test="contains($connectionString, ';LOCAL;CL;')">
  160. <!-- Consolidation -->
  161. <xsl:text>consolidation</xsl:text>
  162. </xsl:when>
  163. <xsl:when test="contains($connectionString, ';LOCAL;PC;')">
  164. <!-- Cognos powercube -->
  165. <xsl:text>powercube</xsl:text>
  166. </xsl:when>
  167. <xsl:when test="contains($connectionString, ';LOCAL;CS;')">
  168. <!-- composite -->
  169. <xsl:text>composite</xsl:text>
  170. </xsl:when>
  171. <xsl:when test="contains($connectionString, ';LOCAL;VM;')">
  172. <!-- IBM Cognos Virtual View Manager -->
  173. <xsl:text>virtualviewmanager</xsl:text>
  174. </xsl:when>
  175. <xsl:when test="contains($connectionString, ';LOCAL;DO;') or contains($connectionString, ';LOCAL;EB;')">
  176. <!-- IBM DB2 OLAP Server -->
  177. <xsl:text>dbtwoolap</xsl:text>
  178. </xsl:when>
  179. <xsl:when test="contains($connectionString, ';LOCAL;X8;')">
  180. <!-- Microsoft Analysis Services (via XMLA) -->
  181. <xsl:text>msas_xmla</xsl:text>
  182. </xsl:when>
  183. <xsl:when test="contains($connectionString, ';LOCAL;TM;')">
  184. <!-- TM1 -->
  185. <xsl:text>tm1</xsl:text>
  186. </xsl:when>
  187. <xsl:when test="contains($connectionString, ';LOCAL;TMR;')">
  188. <!-- TM1 -->
  189. <xsl:text>tm1R</xsl:text>
  190. </xsl:when>
  191. <xsl:when test="contains($connectionString, ';LOCAL;ODATA;')">
  192. <!-- ODATA -->
  193. <xsl:text>odata</xsl:text>
  194. </xsl:when>
  195. <xsl:when test="contains($connectionString, ';LOCAL;JSON;')">
  196. <!-- JSON -->
  197. <xsl:text>json</xsl:text>
  198. </xsl:when>
  199. <xsl:when test="contains($connectionString, ';LOCAL;LA;')">
  200. <!-- Cognos Now! Cube -->
  201. <xsl:text>cognosnow</xsl:text>
  202. </xsl:when>
  203. <xsl:when test="contains($connectionString, ';LOCAL;YK;')">
  204. <!-- MS Analysis Services 2005-->
  205. <xsl:text>msanalysis2005</xsl:text>
  206. </xsl:when>
  207. <xsl:when test="contains($connectionString, ';LOCAL;M8;')">
  208. <!-- MS Analysis Services 2008-->
  209. <xsl:text>msanalysis2008</xsl:text>
  210. </xsl:when>
  211. <xsl:when test="contains($connectionString, ';LOCAL;M12;')">
  212. <!-- MS Analysis Services 2012-->
  213. <xsl:text>msanalysis2012</xsl:text>
  214. </xsl:when>
  215. <xsl:when test="contains($connectionString, ';LOCAL;M14;')">
  216. <!-- MS Analysis Services 2014-->
  217. <xsl:text>msanalysis2014</xsl:text>
  218. </xsl:when>
  219. <xsl:when test="contains($connectionString, ';LOCAL;M16;')">
  220. <!-- MS Analysis Services 2016-->
  221. <xsl:text>msanalysis2016</xsl:text>
  222. </xsl:when>
  223. <xsl:when test="contains($connectionString, ';LOCAL;M17;')">
  224. <!-- MS Analysis Services 2017-->
  225. <xsl:text>msanalysis2017</xsl:text>
  226. </xsl:when>
  227. <xsl:when test="contains($connectionString, ';LOCAL;D2;')">
  228. <!-- DB2 -->
  229. <xsl:text>db2</xsl:text>
  230. </xsl:when>
  231. <xsl:when test="contains($connectionString, ';LOCAL;OR;')">
  232. <!-- Oracle -->
  233. <xsl:text>oracle</xsl:text>
  234. </xsl:when>
  235. <xsl:when test="contains($connectionString, ';LOCAL;OL;DBInfo_Type=MS;Provider=SQLOLEDB;')">
  236. <!-- MS SQLServer (OLE DB) -->
  237. <xsl:text>sql</xsl:text>
  238. </xsl:when>
  239. <xsl:when test="contains($connectionString, ';LOCAL;OL;DBInfo_Type=MS;Provider=SQLNCLI;')">
  240. <!-- MS SQLServer 2005 (SQLNCLI) -->
  241. <xsl:text>sql2005</xsl:text>
  242. </xsl:when>
  243. <xsl:when test="contains($connectionString, ';LOCAL;OL;DBInfo_Type=MS;Provider=SQLNCLI10;')">
  244. <!-- MS SQLServer 2008 (SQLNCLI10) -->
  245. <xsl:text>sql2008</xsl:text>
  246. </xsl:when>
  247. <xsl:when test="contains($connectionString, ';LOCAL;OL;DBInfo_Type=MS;Provider=SQLNCLI11;')">
  248. <!-- MS SQLServer 2012/2014 (SQLNCLI11) -->
  249. <xsl:text>sql2012-2014</xsl:text>
  250. </xsl:when>
  251. <xsl:when test="contains($connectionString, ';LOCAL;OD;')">
  252. <!-- ODBC -->
  253. <xsl:text>odbc</xsl:text>
  254. </xsl:when>
  255. <xsl:when test="contains($connectionString, ';LOCAL;PG;')">
  256. <!-- Progress OpenEdge -->
  257. <xsl:text>openEdge</xsl:text>
  258. </xsl:when>
  259. <xsl:when test="contains($connectionString, ';LOCAL;CT;')">
  260. <!-- Sybase -->
  261. <xsl:text>sybase</xsl:text>
  262. </xsl:when>
  263. <xsl:when test="contains($connectionString, ';LOCAL;CT15;')">
  264. <!-- Sybase CT15-->
  265. <xsl:text>sybase_ct15</xsl:text>
  266. </xsl:when>
  267. <xsl:when test="contains($connectionString, ';LOCAL;IQ;')">
  268. <!-- SybaseIQ -->
  269. <xsl:text>sybaseIQ</xsl:text>
  270. </xsl:when>
  271. <xsl:when test="contains($connectionString, ';LOCAL;IF;')">
  272. <!-- Informix -->
  273. <xsl:text>informix</xsl:text>
  274. </xsl:when>
  275. <xsl:when test="contains($connectionString, ';LOCAL;BW;')">
  276. <!-- SAP -->
  277. <xsl:text>sap</xsl:text>
  278. </xsl:when>
  279. <xsl:when test="contains($connectionString, ';LOCAL;R3;')">
  280. <!-- SAP R3 -->
  281. <xsl:text>sapR3</xsl:text>
  282. </xsl:when>
  283. <xsl:when test="contains($connectionString, ';LOCAL;EC;')">
  284. <!-- SAP BW ECC -->
  285. <xsl:text>sapECC</xsl:text>
  286. </xsl:when>
  287. <xsl:when test="contains($connectionString, ';LOCAL;XML;')">
  288. <!-- XML -->
  289. <xsl:text>xml</xsl:text>
  290. </xsl:when>
  291. <xsl:when test="contains($connectionString, ';LOCAL;RB;')">
  292. <!-- redbrick -->
  293. <xsl:text>redbrick</xsl:text>
  294. </xsl:when>
  295. <xsl:when test="contains($connectionString, ';LOCAL;TD;')">
  296. <!-- teradata -->
  297. <xsl:text>teradata</xsl:text>
  298. </xsl:when>
  299. <xsl:when test="contains($connectionString, ';LOCAL;NZ;')">
  300. <xsl:text>netezza</xsl:text>
  301. </xsl:when>
  302. <xsl:when test="contains($connectionString, ';LOCAL;SS;')">
  303. <!-- sql via odbc -->
  304. <xsl:text>sqlodbc</xsl:text>
  305. </xsl:when>
  306. <xsl:when test="contains($connectionString, ';LOCAL;JD-D2;')">
  307. <xsl:text>jdbc-db2</xsl:text>
  308. </xsl:when>
  309. <xsl:when test="contains($connectionString, ';LOCAL;JD-OR;')">
  310. <xsl:text>jdbc-oracle</xsl:text>
  311. </xsl:when>
  312. <xsl:when test="contains($connectionString, ';LOCAL;JD-SS;')">
  313. <xsl:text>jdbc-sql</xsl:text>
  314. </xsl:when>
  315. <xsl:when test="contains($connectionString, ';LOCAL;JDBC;')">
  316. <xsl:text>jdbc-generic</xsl:text>
  317. </xsl:when>
  318. <xsl:when test="contains($connectionString, ';LOCAL;JD-TD;')">
  319. <xsl:text>jdbc-teradata</xsl:text>
  320. </xsl:when>
  321. <xsl:when test="contains($connectionString, ';LOCAL;JD-NZ;')">
  322. <xsl:text>jdbc-netezza</xsl:text>
  323. </xsl:when>
  324. <xsl:when test="contains($connectionString, ';LOCAL;RP-CMIS-FILENET;')">
  325. <xsl:text>filenet</xsl:text>
  326. </xsl:when>
  327. <xsl:when test="contains($connectionString, 'ERP-SFDC')">
  328. <xsl:text>sfdc</xsl:text>
  329. </xsl:when>
  330. <xsl:when test="contains($connectionString, 'ERP-SAP')">
  331. <xsl:text>sr3</xsl:text>
  332. </xsl:when>
  333. <xsl:when test="contains($connectionString, 'ERP-SIEBEL')">
  334. <xsl:text>siebel</xsl:text>
  335. </xsl:when>
  336. <xsl:otherwise>
  337. <xsl:text>other</xsl:text>
  338. </xsl:otherwise>
  339. </xsl:choose>
  340. </xsl:variable>
  341. <xsl:variable name="variant">
  342. <xsl:text>new</xsl:text>
  343. </xsl:variable>
  344. <!-- Populate the DOM -->
  345. <xts:sequence>
  346. <xts:append select="/root/env">
  347. <xsl:if test="contains(' msanalysis2005 msanalysis2008 msanalysis2012 msanalysis2014 msanalysis2016 msanalysis2017 ', concat(' ',$type,' '))">
  348. <xsl:variable name="lcidFromConnString">
  349. <xsl:if test="contains($connectionString, ';LCID=')">
  350. <xsl:value-of select="substring-after($connectionString, ';LCID=')"/>
  351. </xsl:if>
  352. </xsl:variable>
  353. <param name="m_connection_locale">
  354. <xsl:choose>
  355. <xsl:when test="$lcidFromConnString">
  356. <xsl:choose>
  357. <xsl:when test="contains($lcidFromConnString, ';')">
  358. <xsl:value-of select="substring-before($lcidFromConnString, ';')"/>
  359. </xsl:when>
  360. <xsl:otherwise>
  361. <xsl:value-of select="$lcidFromConnString"/>
  362. </xsl:otherwise>
  363. </xsl:choose>
  364. </xsl:when>
  365. <xsl:otherwise>
  366. <xsl:value-of select="translate( $contentLocale, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz' )"/>
  367. </xsl:otherwise>
  368. </xsl:choose>
  369. </param>
  370. </xsl:if>
  371. <param name="m_connection_type"><xsl:value-of select="$type"/></param>
  372. <param name="m_connection_variant"><xsl:value-of select="$variant"/></param>
  373. <xsl:if test="$type = 'cognosnow'">
  374. <param name="m_connection_file"><xsl:value-of select="concat('/', substring-after($connectionString, '/'))"/></param>
  375. </xsl:if>
  376. <xsl:if test="/root/connection/cm:queryResponse/cm:dataSourceConnection/cm:credentialNamespaces/*/cm:searchPath">
  377. <param name="m_p_credentialNamespaces"><xsl:value-of select="/root/connection/cm:queryResponse/cm:dataSourceConnection/cm:credentialNamespaces/*/cm:searchPath"/></param>
  378. </xsl:if>
  379. </xts:append>
  380. </xts:sequence>
  381. </xsl:template>
  382. </xsl:stylesheet>
  383. </xts:block>
  384. <!--
  385. ================================================================================
  386. get_proxy_info
  387. Retrieve the proxy host information
  388. ================================================================================
  389. -->
  390. <xts:block id="get_proxy_info" mode="interpret" type="exec" processor="XSLT" dependency="parse_connect_string" nodelist="env,credential,system,http,header" mandatory="false" condition=".[(/root/env/param[@name='m_connection_type']='sfdc') and (not(/root/env/param[@name='m_proxy_credentials']))]">
  391. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  392. <xsl:stylesheet version="1.0"
  393. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  394. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/">
  395. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  396. <xsl:template match="/">
  397. <xts:sequence>
  398. <xts:append>
  399. <proxyHost>
  400. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  401. <send:request provider="cm">
  402. <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
  403. <query xmlns="http://developer.cognos.com/schemas/xts-cm/1/">
  404. <search><xsl:value-of select="/root/env/param[@name='m_obj']"/>/credential[@name='proxy']</search>
  405. <properties>
  406. <cm:property name="defaultName"/>
  407. <cm:property name="objectClass"/>
  408. <cm:property name="dataSourceConnectionName"/>
  409. <cm:property name="credentials"/>
  410. </properties>
  411. </query>
  412. </xts:transform>
  413. </send:request>
  414. </xts:transform>
  415. </proxyHost>
  416. </xts:append>
  417. </xts:sequence>
  418. </xsl:template>
  419. </xsl:stylesheet>
  420. </xts:block>
  421. <!--
  422. ================================================================================
  423. save_credentials_param
  424. Save the credentials value in an environment variable
  425. ================================================================================
  426. -->
  427. <xts:block id="save_credentials_param" processor="XSLT" mode="interpret" type="exec" dependency="get_proxy_info" nodelist="env,proxyHost" mandatory="false" condition=".[(/root/env/param[@name='m_connection_type']='sfdc') and (not(/root/env/param[@name='m_proxy_credentials']))]">
  428. <xts:logicsheet path="logicsheets/portal.xsl"/>
  429. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="xsl pf xtsext">
  430. <xsl:output method="xml" encoding="UTF-8" version="1.0" indent="no"/>
  431. <xsl:template match="/">
  432. <xts:sequence>
  433. <xts:append select="/root/env">
  434. <param name="m_proxy_credentials">
  435. <xsl:value-of select="/root/proxyHost/cm:queryResponse/cm:credential/cm:credentials"/>
  436. </param>
  437. </xts:append>
  438. </xts:sequence>
  439. </xsl:template>
  440. </xsl:stylesheet>
  441. </xts:block>
  442. <!--
  443. ================================================================================
  444. create_credentials
  445. Recreate the credentials if the user changed the password or username of
  446. the proxy host signon
  447. ================================================================================
  448. -->
  449. <xts:block id="create_credentials" type="exec" mode="interpret" processor="XSLT" dependency="get_content save_credentials_param" nodelist="env" mandatory="false" condition=".[/root/env/param[@name='m_username_changed']='1' or /root/env/param[@name='m_password_changed']='1']">
  450. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  451. <xts:logicsheet path="logicsheets/presentation/dialog/connections.xslt"/>
  452. <xsl:stylesheet version="1.0"
  453. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  454. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
  455. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  456. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  457. xmlns:dcx="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/connections/1/">
  458. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  459. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  460. <xsl:template match="/">
  461. <xts:sequence>
  462. <dcx:savePasswordVars/>
  463. <xsl:variable name="proxy_password">
  464. <xsl:value-of select="key('env-param', 'm_connection_proxy_password')"/>
  465. </xsl:variable>
  466. <xts:delete select="/root/env/param[@name='m_proxy_credentials']"/>
  467. <xts:append select="/root/env">
  468. <param name="m_proxy_credentials">
  469. <xsl:text>&lt;credential&gt;&lt;encryptedValue&gt;</xsl:text>
  470. <xsl:call-template name="dcx:genCredentials">
  471. <xsl:with-param name="username" select="key('env-param', 'm_connection_proxy_user')"/>
  472. <xsl:with-param name="password" select="$proxy_password"/>
  473. <xsl:with-param name="passwordEncrypted" select="true()"/>
  474. <xsl:with-param name="cubePassword" select="$cubePassword"/>
  475. <xsl:with-param name="cubePasswordEncrypted" select="$cubePasswordEncrypted"/>
  476. </xsl:call-template>
  477. <xsl:text>&lt;/encryptedValue&gt;&lt;/credential&gt;</xsl:text>
  478. </param>
  479. </xts:append>
  480. </xts:sequence>
  481. </xsl:template>
  482. <dcx:genCredentialTemplate/>
  483. </xsl:stylesheet>
  484. </xts:block>
  485. <!--
  486. ================================================================================
  487. encode_lists
  488. Encodes the signons list into a blob so that the set_signons.xts morphlet can
  489. use it.
  490. ================================================================================
  491. -->
  492. <xts:block id="encode_lists" processor="XSLT" mode="interpret" type="exec" dependency="get_content">
  493. <xts:logicsheet path="logicsheets/portal.xsl"/>
  494. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="xsl pf xtsext">
  495. <xsl:output method="xml" encoding="UTF-8" version="1.0" indent="no"/>
  496. <pf:serialize-xml/>
  497. <pf:variables/>
  498. <xsl:template match="/">
  499. <xts:sequence>
  500. <xts:delete select="/root/env/param[@name='m_connection_data']"/>
  501. <xts:append select="/root/env">
  502. <xsl:variable name="markup">
  503. <xsl:apply-templates select="/root/connection" mode="markup"/>
  504. </xsl:variable>
  505. <param name="m_connection_data">
  506. <xsl:value-of select="xtsext:cafaction( concat('sign_wrap_setpassportid_', $passport), xtsext:web64encode(string($markup), true()))"/>
  507. </param>
  508. </xts:append>
  509. </xts:sequence>
  510. </xsl:template>
  511. </xsl:stylesheet>
  512. </xts:block>
  513. <!--
  514. ================================================================================
  515. catch_changes
  516. Detects if the connection string has changed.
  517. ================================================================================
  518. -->
  519. <xts:block id="catch_changes" type="exec" mode="interpret" processor="XSLT" dependency="get_content create_credentials">
  520. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  521. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  522. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  523. <xsl:template match="/">
  524. <xts:sequence>
  525. <xts:delete select="/root/env/param[@name='changed_m_p_connectionString']"/>
  526. <xts:append select="/root/env">
  527. <param name="changed_m_p_connectionString">
  528. <xsl:variable name="orig-value">
  529. <xsl:value-of select="/root/connection/cm:queryResponse/cm:dataSourceConnection/cm:connectionString"/>
  530. </xsl:variable>
  531. <xsl:variable name="current-value">
  532. <xsl:value-of select="/root/env/param[@name='m_p_connectionString']"/>
  533. </xsl:variable>
  534. <xsl:choose>
  535. <xsl:when test="($orig-value != $current-value) and /root/env/param[@name='m_p_connectionString']">1</xsl:when>
  536. <xsl:otherwise>0</xsl:otherwise>
  537. </xsl:choose>
  538. </param>
  539. </xts:append>
  540. </xts:sequence>
  541. </xsl:template>
  542. </xsl:stylesheet>
  543. </xts:block>
  544. <!--
  545. ================================================================================
  546. delete_signons
  547. Deletes the existing signons if the user switched from "Signons" to any other
  548. type of authentication.
  549. ================================================================================
  550. -->
  551. <xts:block id="delete_signons" type="exec" mode="interpret" processor="XSLT" dependency="catch_changes" mandatory="false" condition=".[/root/env/param[@name='changed_m_p_connectionString']='1']">
  552. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  553. <xts:logicsheet path="logicsheets/presentation/dialog/connections.xslt"/>
  554. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  555. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
  556. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  557. xmlns:dcx="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/connections/1/"
  558. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/">
  559. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  560. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  561. <xsl:template match="/">
  562. <xts:sequence>
  563. <xsl:variable name="connectionString" select="key('env-param','m_p_connectionString')"/>
  564. <xsl:variable name="isDatasourceSignon">
  565. <xsl:call-template name="dcx-isDatasourceSignon">
  566. <xsl:with-param name="connectionString" select="$connectionString"/>
  567. </xsl:call-template>
  568. </xsl:variable>
  569. <!-- delete all the existing signons if the type is NOT datasourceSignon -->
  570. <xsl:if test="$isDatasourceSignon='false'">
  571. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  572. <send:request provider="cm">
  573. <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
  574. <cm:delete xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  575. <cm:objects>
  576. <cm:dataSourceSignon>
  577. <cm:searchPath><xsl:value-of select="key('env-param','m_obj')"/>/dataSourceSignon</cm:searchPath>
  578. </cm:dataSourceSignon>
  579. </cm:objects>
  580. <cm:options recursive="true" force="true"/>
  581. </cm:delete>
  582. </xts:transform>
  583. </send:request>
  584. </xts:transform>
  585. </xsl:if>
  586. </xts:sequence>
  587. </xsl:template>
  588. <dcx:isDatasourceSignon/>
  589. </xsl:stylesheet>
  590. </xts:block>
  591. ===============================================================================================
  592. load metadata
  593. ===============================================================================================
  594. -->
  595. <xts:block id="load_metadata" type="exec" mode="interpret" processor="XML" nodelist="">
  596. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  597. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  598. <xsl:template match="/">
  599. <xts:sequence>
  600. <xts:append>
  601. <config>
  602. <xts:function name="getConfiguration">
  603. <xts:param name="dataAccess"/>
  604. <xts:param name="edition"/>
  605. </xts:function>
  606. </config>
  607. </xts:append>
  608. <!-- get a list of installed components -->
  609. <xts:append>
  610. <installedComponents>
  611. <xts:function name="getConfiguration">
  612. <xts:param name="installedComponents"/>
  613. </xts:function>
  614. </installedComponents>
  615. </xts:append>
  616. <xts:append>
  617. <xts:transform src="/transforms/portal/dataSource/filterHiddenDatasources.xslt" processor="XSLT">
  618. <root>
  619. <xts:queryNode select="/root/env"/>
  620. <xts:queryNode select="/root/system"/>
  621. <config>
  622. <param name="dataAccess"><xts:queryValue select="/root/config/configuration/property[@name='dataAccess']"/></param>
  623. <param name="edition"><xts:queryValue select="/root/config/configuration/property[@name='edition']"/></param>
  624. </config>
  625. <xts:queryNode select="/root/installedComponents"/>
  626. <exempted>
  627. <value>
  628. <xts:queryNode select="/root/env/param[@name='m_connection_type']"/>
  629. </value>
  630. </exempted>
  631. <xts:transform src="/transforms/portal/dataSource/generateDatasourceMetadata.xslt" processor="XSLT">
  632. <xts:param name="messageBase">/messages/portal.xml</xts:param>
  633. <root/>
  634. </xts:transform>
  635. </root>
  636. </xts:transform>
  637. </xts:append>
  638. </xts:sequence>
  639. </xsl:template>
  640. </xsl:stylesheet>
  641. </xts:block>
  642. <!--
  643. ================================================================================
  644. render_page
  645. Render the HTML page.
  646. ================================================================================
  647. -->
  648. <xts:block id="render_page" mode="output" processor="XSLT" type="exec" mimeType="text/html" dependency="process_command_blocks parse_connect_string encode_lists catch_changes getTabs delete_signons">
  649. <!-- portal specific information -->
  650. <xts:logicsheet path="logicsheets/portal.xsl"/>
  651. <!-- get the presentation theme -->
  652. <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
  653. <xts:logicsheet path="logicsheets/presentation/dialog/connections.xslt"/>
  654. <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
  655. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  656. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  657. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  658. <xts:logicsheet path="logicsheets/presentation/dialog/templates.xsl"/>
  659. <xts:logicsheet path="logicsheets/presentation/dialog/confirm.xslt"/>
  660. <!-- apply the form logic -->
  661. <xts:logicsheet path="logicsheets/formlogic.xslt"/>
  662. <xts:logicsheet path="logicsheets/validation.xslt"/> <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
  663. <xsl:stylesheet version="1.0"
  664. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  665. xmlns:dcx="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/connections/1/"
  666. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  667. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  668. xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/"
  669. xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
  670. xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/"
  671. xmlns:dc="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/confirm/1/"
  672. xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
  673. xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
  674. xmlns:dt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/templates/"
  675. xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/"
  676. xmlns:x="x"
  677. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  678. exclude-result-prefixes="xsl cm cf cp pf df dp dc dt lyt utml x xtsext">
  679. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  680. <!-- current file name -->
  681. <xsl:variable name="mname" select="'properties_connection.xts'"/>
  682. <!-- add any theme variables -->
  683. <pf:variables/>
  684. <xsl:variable name="back-url" select="key('env-param','backURL')"/>
  685. <xsl:variable name="object" select="/root/connection/cm:queryResponse/cm:dataSourceConnection"/>
  686. <xsl:variable name="connectionType" select="/root/env/param[@name='m_connection_type']"/>
  687. <dcx:commandTemplate/>
  688. <!-- start the output -->
  689. <xsl:template match="/root">
  690. <xsl:variable name="supportsIso">
  691. <xsl:value-of select="datasources/datasource[value=$connectionType]/supportsIsolationLevels"/>
  692. </xsl:variable>
  693. <xsl:variable name="known-type" select="datasources/datasource[value=$connectionType] and $connectionType != 'other'"/>
  694. <!-- get passed in parameters -->
  695. <xsl:variable name="canWrite" select="contains($object/cm:permissions,'write')"/>
  696. <xsl:variable name="canSetPolicy" select="contains($object/cm:permissions,'setPolicy')"/>
  697. <xsl:variable name="showOKCancel" select="$canWrite or $canSetPolicy"/>
  698. <xsl:variable name="browserTitle">
  699. <xts:string id="IDS_PROPERTIES_TITLE">
  700. <xts:param name="objectName"><span lang="{$contentLocale}"><xsl:value-of select="/root/env/param[@name='m_name']"/></span></xts:param>
  701. </xts:string>
  702. </xsl:variable>
  703. <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html></xsl:text><dp:page longTitle="$browserTitle">
  704. <dp:meta>
  705. <!-- Standard meta tags -->
  706. <pf:meta/>
  707. </dp:meta>
  708. <dp:script>
  709. <!-- Help system -->
  710. <pf:help context="HID_DATA_SOURCES"/>
  711. <xsl:if test="$canWrite">
  712. <script language="javascript">
  713. function init()
  714. {
  715. var f = document.pform;
  716. f.m_p_isolationLevel.disabled = !f.m_p_iso_pref[1].checked;
  717. f.m_connection_tab.value='odbc';
  718. }
  719. var MSG_CONF_CHANGE = "<xts:string id="IDS_WARN_0005_CHANGE_CONNECTION_TYPE" encode="javascript"/>";
  720. var originalType = "<xsl:value-of select="xtsext:javascriptencode(string($connectionType))"/>";
  721. <![CDATA[
  722. function changeType()
  723. {
  724. var f = document.pform;
  725. // Perform the delete after confirmation
  726. if (confirm(MSG_CONF_CHANGE))
  727. {
  728. // delete the connection string
  729. f.m_p_connectionString.value='';
  730. f.submit();
  731. }
  732. else
  733. {
  734. resetType();
  735. }
  736. }
  737. function resetType()
  738. {
  739. var ctrl = document.pform.m_connection_type;
  740. for (i = 0; i < ctrl.options.length; i++)
  741. {
  742. if (ctrl.options[i].value == originalType)
  743. {
  744. ctrl.options[i].selected = true;
  745. break;
  746. }
  747. }
  748. }
  749. function disableIso(disable)
  750. {
  751. var frm = document.pform;
  752. if (frm) {
  753. var lstIsoLevel = frm.m_p_isolationLevel;
  754. if (lstIsoLevel) {
  755. lstIsoLevel.disabled = disable;
  756. }
  757. }
  758. }
  759. ]]>
  760. function checkMandatoryConnectString(obj, label)
  761. {
  762. obj.value = trim(obj.value);
  763. if (obj.value == '')
  764. {
  765. <xsl:variable name="errmsg">
  766. <xts:string id="IDS_ERR_MANDATORY_CONNECTION_STRING" encode="javascript"><xts:param name="field">" + label + "</xts:param></xts:string>
  767. </xsl:variable>
  768. window.alert("<xsl:value-of select="normalize-space($errmsg)"/>");
  769. obj.focus();
  770. return false;
  771. }
  772. return true;
  773. }
  774. function validate()
  775. {
  776. var f = document.pform;
  777. if (f.m_p_connectionString)
  778. {
  779. return checkMandatoryConnectString(f.m_p_connectionString, "<xts:string id="IDS_PROP_CONN_CONNECT" encode="javascript"/>");
  780. }
  781. return true;
  782. }
  783. </script>
  784. <dc:confirm-cancel/>
  785. </xsl:if>
  786. <script language="javascript" src="{$webcontent}/{$app}/js/utilities.js"/>
  787. <script language="javascript">
  788. function validateBeforeTest()
  789. {
  790. var f = document.pform;
  791. if (f.m_p_connectionString)
  792. {
  793. return checkMandatoryConnectString(f.m_p_connectionString, "<xts:string id="IDS_PROP_CONN_CONNECT" encode="javascript"/>");
  794. }
  795. return true;
  796. }
  797. function doTest()
  798. {
  799. if(!validateBeforeTest())
  800. {
  801. return;
  802. }
  803. else
  804. {
  805. f=document.pform;
  806. f.ps_nav_op.value = 'push';
  807. f.m.value = '<xsl:value-of select="concat($app,'/test_connection.xts')"/>';
  808. f.submit();
  809. }
  810. }
  811. function doAuthentication()
  812. {
  813. var f = document.pform;
  814. if (f.m_p_connectionString) {
  815. var authString = f.action;
  816. var cs = f.m_p_connectionString.value;
  817. var authType = getField(cs,';AUTHENTICATION_TYPE=');
  818. if(authType == 'OAuth1.0'){
  819. authString += '/oauth1?';
  820. authString += 'temporary_token_endpoint=' + getField(cs,';TEMPORARY_TOKEN_ENDPOINT=');
  821. authString += '&amp;authorization_endpoint=' + getField(cs,';AUTHORIZATION_ENDPOINT=');
  822. authString += '&amp;token_endpoint=' + getField(cs,';TOKEN_ENDPOINT=');
  823. authString += '&amp;reponse_type=code';
  824. authString += '&amp;state=' + f.m_name.value;
  825. } else {
  826. authString += '/oauth2?';
  827. authString += 'authorization_endpoint=' + getField(cs,';AUTHORIZATION_ENDPOINT=');
  828. authString += '&amp;token_endpoint=' + getField(cs,';TOKEN_ENDPOINT=');
  829. var scope = getField(cs,';SCOPE=');
  830. if (scope)
  831. {
  832. authString += '&amp;scope=' + scope;
  833. }
  834. authString += '&amp;state=' + f.m_name.value;
  835. }
  836. window.open(authString);
  837. }
  838. }
  839. function getField(string, param)
  840. {
  841. start = string.indexOf(param);
  842. if (start != -1)
  843. {
  844. end = string.indexOf(";", start + param.length);
  845. if (end == -1)
  846. {
  847. return(string.substring(start + param.length));
  848. }
  849. return(string.substring(start + param.length, end));
  850. }
  851. return '';
  852. }
  853. </script>
  854. </dp:script>
  855. <utml:form name="pform" method="post" action="{$gateway}">
  856. <utml:read-only>
  857. <xsl:choose>
  858. <xsl:when test="$canWrite">false</xsl:when>
  859. <xsl:otherwise>true</xsl:otherwise>
  860. </xsl:choose>
  861. </utml:read-only>
  862. <!--
  863. this defines the form command operation to be performed when all the collected properties are submitted.
  864. -->
  865. <utml:input type="hidden" name="ifrmcmd" value="save" utml:update="false"/>
  866. <utml:input type="hidden" name="changed_m_p_isolationLevel" value="0"/>
  867. <utml:input type="hidden" name="m_p_credentialNamespaces" utml:value="key('env-param','m_p_credentialNamespaces')"/>
  868. <utml:input type="hidden" name="m_connection_tab" utml:value="odbc"/>
  869. <utml:input type="hidden" name="m_dscap" value="" update="true"/>
  870. <!--
  871. Get the flag to tell if a connection string is a dual which is needed to render the initial status of "Trusted context" checkbox in ODBC tab.
  872. [Work Item 59728] Disable/hide 'Trusted context' feature when configuring a dual stack (classic and jdbc) for DB2 data source connections
  873. -->
  874. <utml:input type="hidden" name="m_connection_enable_JDBC">
  875. <utml:value>
  876. <xsl:choose>
  877. <xsl:when test="contains($object/cm:connectionString,'IBM_JD_CNX_STR:')">
  878. <xsl:value-of select="'true'"/>
  879. </xsl:when>
  880. <xsl:otherwise>
  881. <xsl:value-of select="'false'"/>
  882. </xsl:otherwise>
  883. </xsl:choose>
  884. </utml:value>
  885. </utml:input>
  886. <!-- dialog header -->
  887. <dp:header useBackURL="not($showOKCancel)">
  888. <!-- header titles-->
  889. <dp:title><xsl:copy-of select="$browserTitle"/></dp:title>
  890. </dp:header>
  891. <!-- property tabs -->
  892. <df:propertiesTabs select="connection">
  893. <df:hasSetPolicy><xsl:value-of select="$canSetPolicy"/></df:hasSetPolicy>
  894. </df:propertiesTabs>
  895. <!-- description tabs -->
  896. <dp:description>
  897. <xts:string id="IDS_PROP_CONN_INTRO"/>
  898. </dp:description>
  899. <lyt:layout style="1">
  900. <lyt:section>
  901. <dp:list>
  902. <dp:section>
  903. <dp:label for="ctrl_m_connection_type"><xts:string id="IDS_PROP_CONN_TYPE"/></dp:label>
  904. </dp:section>
  905. <dp:section>
  906. <dp:box>
  907. <dp:boxSection hgap="20">
  908. <utml:select size="1" name="m_connection_type" onchange="changeType();" id="ctrl_m_connection_type">
  909. <xsl:for-each select="datasources/datasource">
  910. <utml:option>
  911. <utml:value><xsl:value-of select="value"/></utml:value>
  912. <xsl:value-of select="name"/>
  913. </utml:option>
  914. </xsl:for-each>
  915. </utml:select>
  916. </dp:boxSection>
  917. <dp:boxSection>
  918. <a href="javascript:doTest();">
  919. <xsl:text><xts:string id="IDS_PROP_CONN_TEST_CONNECTION"/></xsl:text>
  920. </a>
  921. </dp:boxSection>
  922. </dp:box>
  923. </dp:section>
  924. </dp:list>
  925. <img height="5" width="1" src="{$webcontent}/images/space.gif"/>
  926. <dp:list>
  927. <dp:section>
  928. <dp:label for="isolationLevel_ID" id="isolationLevel_ID">
  929. <xts:string id="IDS_PROP_CONN_ISOLATION"/>
  930. </dp:label>
  931. </dp:section>
  932. </dp:list>
  933. <utml:radio-group name="m_p_iso_pref">
  934. <utml:default-value>
  935. <xsl:choose>
  936. <xsl:when test="string-length($object/cm:isolationLevel) = 0">default</xsl:when>
  937. <xsl:otherwise>specify</xsl:otherwise>
  938. </xsl:choose>
  939. </utml:default-value>
  940. <dp:choice aria-labelledby="isolationLevel_ID">
  941. <dp:section1>
  942. <utml:input type="radio" value="default" onclick="window.disableIso(true);" id="useDefaultGateway_ID">
  943. <xsl:if test="$supportsIso = 'false'">
  944. <xsl:attribute name="disabled">disabled</xsl:attribute>
  945. </xsl:if>
  946. </utml:input>
  947. </dp:section1>
  948. <dp:section2 for="useDefaultGateway_ID">
  949. <xts:string id="IDS_PROP_CONN_GATEWAYDEFAULT"/>
  950. </dp:section2>
  951. <dp:section1>
  952. <utml:input type="radio" value="specify" onclick="window.disableIso(false);" id="specifyValue_ID">
  953. <xsl:if test="$supportsIso = 'false'">
  954. <xsl:attribute name="disabled">disabled</xsl:attribute>
  955. </xsl:if>
  956. </utml:input>
  957. </dp:section1>
  958. <dp:section2 for="specifyValue_ID">
  959. <xts:string id="IDS_PROP_CONN_SPECIFYVALUE"/>
  960. </dp:section2>
  961. <dp:section3>
  962. <utml:select size="1" name="m_p_isolationLevel" onchange="document.pform.changed_m_p_isolationLevel.value='1';" id="isolationLevel_ID">
  963. <utml:default-value>
  964. <xsl:value-of select="$object/cm:isolationLevel"/>
  965. </utml:default-value>
  966. <xsl:if test="string-length($object/cm:isolationLevel) = 0">
  967. <xsl:attribute name="disabled"><xsl:value-of select="'true'"/></xsl:attribute>
  968. </xsl:if>
  969. <utml:option value="cursorStability"><xts:string id="IDS_PROP_CONN_CURSOR"/></utml:option>
  970. <utml:option value="phantomProtection"><xts:string id="IDS_PROP_CONN_PHANTOM"/></utml:option>
  971. <utml:option value="readCommitted"><xts:string id="IDS_PROP_CONN_COMMITTED"/></utml:option>
  972. <utml:option value="readUncommitted"><xts:string id="IDS_PROP_CONN_UNCOMMITTED"/></utml:option>
  973. <utml:option value="reproducibleRead"><xts:string id="IDS_PROP_CONN_REPRODUCIBLE"/></utml:option>
  974. <utml:option value="serializable"><xts:string id="IDS_PROP_CONN_SERIALIZABLE"/></utml:option>
  975. </utml:select>
  976. </dp:section3>
  977. </dp:choice>
  978. </utml:radio-group>
  979. </lyt:section>
  980. <lyt:section>
  981. <dp:list>
  982. <dp:section>
  983. <dp:textarea>
  984. <dp:section1>
  985. <span id="lbl_connectionString"><xts:string id="IDS_PROP_CONN_CONNECT"/></span>
  986. </dp:section1>
  987. <dp:section2>
  988. <utml:input type="text" name="m_p_connectionString" size="53" utml:track="true" aria-labelledby="lbl_connectionString">
  989. <xsl:if test="$known-type">
  990. <xsl:attribute name="readonly">readonly</xsl:attribute>
  991. </xsl:if>
  992. <utml:value>
  993. <xsl:value-of select="$object/cm:connectionString"/>
  994. </utml:value>
  995. </utml:input>
  996. <xsl:if test="$known-type and $canWrite">
  997. <xsl:text>&#160;&#160;</xsl:text>
  998. <utml:a utml:op="stack-up">
  999. <utml:target>
  1000. <xsl:value-of select="concat($app,'/specify_connection.xts')"/>
  1001. </utml:target>
  1002. <img border="0" height="16" width="10">
  1003. <xsl:attribute name="src"><xsl:value-of select="concat($image_root,'action_edit_10.gif')"/></xsl:attribute>
  1004. <xsl:attribute name="alt"><xts:string id="IDS_PROP_CONN_EDIT_ALT"/></xsl:attribute>
  1005. </img>
  1006. </utml:a>
  1007. </xsl:if>
  1008. </dp:section2>
  1009. </dp:textarea>
  1010. </dp:section>
  1011. <xsl:if test="$connectionType != 'other' and $connectionType != 'xml'">
  1012. <dp:section>
  1013. <dp:text>
  1014. <xts:string id="IDS_SELECT_CONNECT_AUTHENTICATION"/>
  1015. <xsl:variable name="connectionString">
  1016. <xsl:choose>
  1017. <xsl:when test="key('env-param','m_p_connectionString')!=''">
  1018. <xsl:value-of select="key('env-param','m_p_connectionString')"/>
  1019. </xsl:when>
  1020. <xsl:otherwise>
  1021. <xsl:value-of select="/root/connection/*[local-name()='queryResponse']/*[local-name()='dataSourceConnection']/*[local-name()='connectionString']"/>
  1022. </xsl:otherwise>
  1023. </xsl:choose>
  1024. </xsl:variable>
  1025. <xsl:choose>
  1026. <xsl:when test="key('env-param','m_p_credentialNamespaces') != ''">
  1027. <xts:string id="IDS_SELECT_CONNECT_EXTERNAL_NAMESPACE">
  1028. <xts:param name="namespaceName"><xsl:value-of select="/root/*[local-name()='namespaces']/*[local-name()='queryResponse']/*[local-name()='namespace' and ./*[local-name()='searchPath']=key('env-param','m_p_credentialNamespaces')]/*[local-name()='defaultName']"/></xts:param>
  1029. </xts:string>
  1030. </xsl:when>
  1031. <xsl:when test="contains($connectionString,'Trusted_Connection=yes') or contains($connectionString,'Integrated Security=SSPI')">
  1032. <xts:string id="IDS_SELECT_CONNECT_WINDOWS_AUTHENTICATION"/>
  1033. </xsl:when>
  1034. <xsl:when test="contains($connectionString, '^User ID:')">
  1035. <xts:string id="IDS_SELECT_CONNECT_SIGNON_PROPERTY_DIALOG"/>
  1036. </xsl:when>
  1037. <xsl:when test="contains($connectionString, 'AUTHENTICATION_TYPE=None')">
  1038. <xts:string id="IDS_SELECT_CONNECT_NONE"/>
  1039. </xsl:when>
  1040. <xsl:when test="contains($connectionString, 'AUTHENTICATION_TYPE=APIKey')">
  1041. <xts:string id="IDS_SELECT_CONNECT_API_KEY"/>
  1042. </xsl:when>
  1043. <xsl:when test="contains($connectionString, 'AUTHENTICATION_TYPE=Basic')">
  1044. <xts:string id="IDS_SELECT_CONNECT_BASIC"/>
  1045. </xsl:when>
  1046. <xsl:when test="contains($connectionString, 'AUTHENTICATION_TYPE=OAuth1.0')">
  1047. <xts:string id="IDS_SELECT_CONNECT_OAUTH1"/>
  1048. <xsl:text>&#160;</xsl:text>
  1049. <a href="javascript:doAuthentication();">
  1050. <xsl:text><xts:string id="IDS_PROP_CONN_AUTHENTICATE"/></xsl:text>
  1051. </a>
  1052. </xsl:when>
  1053. <xsl:when test="contains($connectionString, 'AUTHENTICATION_TYPE=OAuth2.0')">
  1054. <xts:string id="IDS_SELECT_CONNECT_OAUTH2"/>
  1055. <xsl:text>&#160;</xsl:text>
  1056. <a href="javascript:doAuthentication();">
  1057. <xsl:text><xts:string id="IDS_PROP_CONN_AUTHENTICATE"/></xsl:text>
  1058. </a>
  1059. </xsl:when>
  1060. <xsl:otherwise>
  1061. <xsl:choose>
  1062. <xsl:when test="$connectionType = 'powercube'">
  1063. <xts:string id="IDS_SELECT_CONNECT_POWERCUBE_NO_AUTHENTICATION"/>
  1064. </xsl:when>
  1065. <xsl:otherwise>
  1066. <xts:string id="IDS_SELECT_CONNECT_NO_AUTHENTICATION"/>
  1067. </xsl:otherwise>
  1068. </xsl:choose>
  1069. </xsl:otherwise>
  1070. </xsl:choose>
  1071. </dp:text>
  1072. </dp:section>
  1073. </xsl:if>
  1074. <xsl:if test="$connectionType = 'sfdc'">
  1075. <dp:section>
  1076. <dp:text>
  1077. <xts:string id="IDS_SELECT_CONNECT_PROXY_HOST"/>
  1078. <xsl:variable name="connectionString">
  1079. <xsl:choose>
  1080. <xsl:when test="key('env-param','m_p_connectionString')!=''">
  1081. <xsl:value-of select="key('env-param','m_p_connectionString')"/>
  1082. </xsl:when>
  1083. <xsl:otherwise>
  1084. <xsl:value-of select="/root/connection/*[local-name()='queryResponse']/*[local-name()='dataSourceConnection']/*[local-name()='connectionString']"/>
  1085. </xsl:otherwise>
  1086. </xsl:choose>
  1087. </xsl:variable>
  1088. <xsl:choose>
  1089. <xsl:when test="contains($connectionString,'PROXY_ENABLED=true')">
  1090. <xts:string id="IDS_SELECT_CONNECT_PROXY_HOST_SET"/>
  1091. </xsl:when>
  1092. <xsl:otherwise>
  1093. <xts:string id="IDS_SELECT_CONNECT_NO_PROXY_HOST_SET"/>
  1094. </xsl:otherwise>
  1095. </xsl:choose>
  1096. </dp:text>
  1097. </dp:section>
  1098. </xsl:if>
  1099. <xsl:if test="datasources/datasource[value=$connectionType]/supportsCommandBlocks = 'true'">
  1100. <dp:section>
  1101. <cf:dynamicExpandingSection name="b_commands" indent="false" initialize="true" visible="false" title="IDS_PROP_CONN_COMMAND_SECTION">
  1102. <xsl:call-template name="dcx-commandTemplate">
  1103. <xsl:with-param name="form-read-only" select="$form-read-only"/>
  1104. <xsl:with-param name="utml-form-name" select="$utml-form-name"/>
  1105. <xsl:with-param name="canWrite" select="$canWrite"/>
  1106. <xsl:with-param name="dataSourceConnection" select="true()"/>
  1107. <xsl:with-param name="inWizard" select="false()"/>
  1108. </xsl:call-template>
  1109. </cf:dynamicExpandingSection>
  1110. </dp:section>
  1111. </xsl:if>
  1112. </dp:list>
  1113. </lyt:section>
  1114. </lyt:layout>
  1115. <dp:footer>
  1116. <xsl:choose>
  1117. <xsl:when test="$showOKCancel">
  1118. <df:button df:id="IDS_OK" utml:validate="true" df:style="submit"/>
  1119. <xsl:choose>
  1120. <xsl:when test="key('env-param', 'ps_nav_stack') and not(key('env-param', 'ps_nav_stack') = '') ">
  1121. <df:button df:id="IDS_CANCEL" df:style="stack-down" onclick="{$dc-confirm-cancel}"/>
  1122. </xsl:when>
  1123. <xsl:otherwise>
  1124. <df:button df:id="IDS_CANCEL" df:style="back-url" onclick="{$dc-confirm-cancel}"/>
  1125. </xsl:otherwise>
  1126. </xsl:choose>
  1127. </xsl:when>
  1128. <xsl:otherwise>
  1129. <df:button df:id="IDS_CLOSE" df:style="back-url"/>
  1130. </xsl:otherwise>
  1131. </xsl:choose>
  1132. </dp:footer>
  1133. </utml:form>
  1134. </dp:page>
  1135. </xsl:template>
  1136. <xsl:template match="*[local-name()='messageString']">
  1137. <xsl:value-of select="xtsext:javascriptencode(string(.))"/><xsl:if test="string-length(normalize-space(.)) > 0">\n</xsl:if>
  1138. </xsl:template>
  1139. </xsl:stylesheet>
  1140. </xts:block>
  1141. <!--
  1142. ===============================================================================================
  1143. debug - display debug information
  1144. ===============================================================================================
  1145. -->
  1146. <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">
  1147. <!-- get the debug logic sheet -->
  1148. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  1149. <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">
  1150. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
  1151. <xsl:template match="/">
  1152. <dbg:dumpxml select="/root"/>
  1153. </xsl:template>
  1154. </xsl:stylesheet>
  1155. </xts:block>
  1156. </xts:morphlet>