properties_datasource.xts 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392
  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, 2015
  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. <!--
  21. ================================================================================
  22. Load object-specific property tabs map
  23. ================================================================================
  24. -->
  25. <xts:block id="getTabs" type="exec" mode="interpret" processor="XML" path="/portal/uiobjects_tabs.xml"/>
  26. <!--
  27. ================================================================================
  28. get_content
  29. ================================================================================
  30. -->
  31. <xts:block id="get_content" processor="XSLT" type="exec" mode="interpret" dependency="formlogic_init">
  32. <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
  33. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  34. <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">
  35. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  36. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  37. <xsl:template match="/">
  38. <xts:sequence>
  39. <xts:append>
  40. <dataSource>
  41. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  42. <send:request provider="cm">
  43. <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
  44. <query xmlns="http://developer.cognos.com/schemas/xts-cm/1/">
  45. <search>
  46. <xsl:value-of select="key('env-param','m_obj')"/>
  47. <xsl:text>[permission(&quot;read&quot;)]</xsl:text>
  48. </search>
  49. <properties>
  50. <property name="openConnectionCommands"/>
  51. <property name="openSessionCommands"/>
  52. <property name="closeConnectionCommands"/>
  53. <property name="closeSessionCommands"/>
  54. <property name="permissions"/>
  55. <property name="capabilities"/>
  56. </properties>
  57. <options schemaInfo="true"/>
  58. </query>
  59. </xts:transform>
  60. </send:request>
  61. </xts:transform>
  62. </dataSource>
  63. </xts:append>
  64. <!-- check the LWM packages -->
  65. <xts:append>
  66. <xts:transform src="transforms/fm/fm-params.xslt" processor="XSLT">
  67. <send:request provider="metadataService" faultBlock="handleMetadataLWMRequestError">
  68. <md1:updateMetadata xmlns:md1="http://developer.cognos.com/schemas/metadataService/1">
  69. <request>
  70. <xts:transform name="XMLEncode">
  71. <mdprovider type="transientAction" action="execute" seq="1">
  72. <transaction saved="false" seq="1">
  73. <action seq="1" type="IsLWM">
  74. <inputparams>
  75. <param seq="1" type="i18nstring">
  76. <value><xsl:value-of select="key('env-param','m_name')"/></value>
  77. </param>
  78. </inputparams>
  79. <domchanges/>
  80. <result success="t">
  81. <outputparams/>
  82. </result>
  83. </action>
  84. </transaction>
  85. </mdprovider>
  86. </xts:transform>
  87. </request>
  88. </md1:updateMetadata>
  89. </send:request>
  90. </xts:transform>
  91. </xts:append>
  92. <!-- get a connection so that we can determine the connection type -->
  93. <xts:append>
  94. <connection>
  95. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  96. <send:request provider="cm">
  97. <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
  98. <query xmlns="http://developer.cognos.com/schemas/xts-cm/1/">
  99. <search>
  100. <xsl:value-of select="key('env-param','m_obj')"/>
  101. <xsl:text>/dataSourceConnection</xsl:text>
  102. </search>
  103. <properties>
  104. <property name="connectionString"/>
  105. </properties>
  106. <options schemaInfo="true"/>
  107. </query>
  108. </xts:transform>
  109. </send:request>
  110. </xts:transform>
  111. </connection>
  112. </xts:append>
  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. handleMetadataLWMRequestError - handle the error occurring when requesting LWM to metadata service
  124. Do nothing for now
  125. ===============================================================================================
  126. -->
  127. <xts:block id="handleMetadataLWMRequestError" type="fault">
  128. <ignoreError/>
  129. </xts:block>
  130. <!--
  131. ===============================================================================================
  132. getConfig - retrieve the configuration UI settings
  133. ===============================================================================================
  134. -->
  135. <xts:block id="process_command_blocks" dependency="get_content" type="exec" mode="interpret" processor="XSLT" path="portal/command_blocks.xml"/>
  136. <!--
  137. ================================================================================
  138. render_page
  139. Render the HTML page.
  140. ================================================================================
  141. -->
  142. <xts:block id="render_page" mode="output" processor="XSLT" type="exec" mimeType="text/html" dependency="process_command_blocks getTabs">
  143. <!-- portal specific information -->
  144. <xts:logicsheet path="logicsheets/portal.xsl"/>
  145. <!-- get the presentation theme -->
  146. <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
  147. <xts:logicsheet path="logicsheets/presentation/dialog/connections.xslt"/>
  148. <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
  149. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  150. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  151. <xts:logicsheet path="logicsheets/presentation/dialog/templates.xsl"/>
  152. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  153. <xts:logicsheet path="logicsheets/presentation/dialog/confirm.xslt"/>
  154. <!-- apply the form logic -->
  155. <xts:logicsheet path="logicsheets/formlogic.xslt"/>
  156. <xts:logicsheet path="logicsheets/validation.xslt"/> <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
  157. <xsl:stylesheet version="1.0"
  158. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  159. xmlns:dcx="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/connections/1/"
  160. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  161. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  162. xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/"
  163. xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
  164. xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/"
  165. xmlns:dc="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/confirm/1/"
  166. xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
  167. xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
  168. xmlns:dt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/templates/"
  169. xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/"
  170. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  171. exclude-result-prefixes="xsl cm cf cp pf df dp dc lyt dt utml xtsext">
  172. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  173. <!-- current file name -->
  174. <xsl:variable name="mname" select="'properties_datasource.xts'"/>
  175. <!-- add any theme variables -->
  176. <pf:variables/>
  177. <xsl:variable name="back-url" select="key('env-param','backURL')"/>
  178. <xsl:variable name="object" select="/root/dataSource/cm:queryResponse/cm:dataSource"/>
  179. <dcx:commandTemplate/>
  180. <!-- start the output -->
  181. <xsl:template match="/root">
  182. <!-- get passed in parameters -->
  183. <xsl:variable name="canWrite" select="contains($object/cm:permissions,'write')"/>
  184. <xsl:variable name="canSetPolicy" select="contains($object/cm:permissions,'setPolicy')"/>
  185. <xsl:variable name="showOKCancel" select="$canWrite or $canSetPolicy"/>
  186. <xsl:variable name="dataSourceCapabilities" select="$object/cm:dataSourceCapabilities"/>
  187. <xsl:variable name="allowsReporting" select="$dataSourceCapabilities/cm:capability[contains(., '#reporting')] != ''"/>
  188. <xsl:variable name="allowsPersonalPackages" select="$dataSourceCapabilities/cm:capability[contains(., '#personalPackages')] != ''"/>
  189. <xsl:variable name="allowsWebBasedModeling" select="$dataSourceCapabilities/cm:capability[contains(., '#webBasedModeling')] != ''"/>
  190. <xsl:variable name="allowsPersonalData" select="$dataSourceCapabilities/cm:capability[contains(., '#lobData')] != ''"/>
  191. <xsl:variable name="allowsRepository" select="$dataSourceCapabilities/cm:capability[contains(., '#repository')] != ''"/>
  192. <xsl:variable name="allowsAtomContent" select="$dataSourceCapabilities/cm:capability[contains(., '#atomContentProvider')] != ''"/>
  193. <xsl:variable name="isLWM" select="/root/theFMDataSource/*[local-name()='response']/*[local-name() = 'outputparams']/*[local-name() = 'param']/."/>
  194. <xsl:variable name="connectionString" select="/root/*[local-name()='connection']/*[local-name()='queryResponse']/*[local-name() = 'dataSourceConnection']/*[local-name() = 'connectionString']/."/>
  195. <xsl:variable name="browserTitle">
  196. <xts:string id="IDS_PROPERTIES_TITLE">
  197. <xts:param name="objectName"><span lang="{$contentLocale}"><xsl:value-of select="/root/env/param[@name='m_name']"/></span></xts:param>
  198. </xts:string>
  199. </xsl:variable>
  200. <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html></xsl:text><dp:page longTitle="$browserTitle">
  201. <dp:meta>
  202. <!-- Standard meta tags -->
  203. <pf:meta/>
  204. </dp:meta>
  205. <dp:script>
  206. <!-- Help system -->
  207. <pf:help context="HID_DATA_SOURCES"/>
  208. <dt:selectDeselectAll/>
  209. <xsl:if test="$canWrite">
  210. <dc:confirm-cancel/>
  211. <script language="javascript" src="{$webcontent}/{$app}/js/utilities.js"/>
  212. </xsl:if>
  213. </dp:script>
  214. <utml:form name="pform" method="post" action="{$gateway}">
  215. <utml:read-only>
  216. <xsl:choose>
  217. <xsl:when test="$canWrite">false</xsl:when>
  218. <xsl:otherwise>true</xsl:otherwise>
  219. </xsl:choose>
  220. </utml:read-only>
  221. <!--
  222. this defines the form command operation to be performed when all the collected properties are submitted.
  223. -->
  224. <utml:input type="hidden" name="ifrmcmd" value="save" utml:update="false"/>
  225. <xsl:if test="$allowsReporting">
  226. <utml:input type="hidden" name="m_dscap" value="reporting"/>
  227. </xsl:if>
  228. <!-- dialog header -->
  229. <dp:header useBackURL="not($showOKCancel)">
  230. <!-- header titles-->
  231. <dp:title><xsl:copy-of select="$browserTitle"/></dp:title>
  232. </dp:header>
  233. <!-- property tabs -->
  234. <df:propertiesTabs select="connection">
  235. <df:hasSetPolicy><xsl:value-of select="$canSetPolicy"/></df:hasSetPolicy>
  236. </df:propertiesTabs>
  237. <!-- description tabs -->
  238. <dp:description>
  239. <xts:string id="IDS_PROP_DATASOURCE_DESCRIPTION"/>
  240. </dp:description>
  241. <!-- command blocks section -->
  242. <xsl:call-template name="dcx-commandTemplate">
  243. <xsl:with-param name="form-read-only" select="$form-read-only"/>
  244. <xsl:with-param name="utml-form-name" select="$utml-form-name"/>
  245. <xsl:with-param name="canWrite" select="$canWrite"/>
  246. <xsl:with-param name="dataSourceConnection" select="false()"/>
  247. <xsl:with-param name="inWizard" select="false()"/>
  248. </xsl:call-template>
  249. <lyt:layout style="1" title="IDS_PROP_DATASOURCE_CAPABILITIES">
  250. <lyt:section>
  251. <dp:list>
  252. <xsl:if test="$allowsRepository">
  253. <dp:section dp:kbA11y="true">
  254. <dp:text wrap="wrap" valign="top">
  255. <xts:string id="IDS_PROP_REPOSITORY_CAPABILITY"/>
  256. </dp:text>
  257. </dp:section>
  258. </xsl:if>
  259. <xsl:if test="$allowsAtomContent">
  260. <dp:section>
  261. <dp:text wrap="wrap" valign="top">
  262. <xts:string id="IDS_PROP_ATOM_CONTENT_CAPABILITY"/>
  263. </dp:text>
  264. </dp:section>
  265. </xsl:if>
  266. <xsl:if test="$allowsReporting or (not($allowsReporting) and not($allowsPersonalPackages) and not($allowsRepository) and not($allowsAtomContent))">
  267. <dp:section dp:kbA11y="true">
  268. <dp:text wrap="wrap" valign="top">
  269. <xts:string id="IDS_PROP_REPORTING_CAPABILITY"/>
  270. </dp:text>
  271. </dp:section>
  272. </xsl:if>
  273. <xsl:if test="$allowsPersonalData">
  274. <dp:section dp:kbA11y="true">
  275. <dp:text wrap="wrap" valign="top">
  276. <xts:string id="IDS_PROP_PERSONAL_DATA_CAPABILITY"/>
  277. </dp:text>
  278. </dp:section>
  279. </xsl:if>
  280. </dp:list>
  281. <!-- personal packages capability -->
  282. <xsl:choose>
  283. <xsl:when test="$isLWM = '1'">
  284. <dp:choice width="100%">
  285. <dp:section1>
  286. <utml:input type="checkbox" name="m_dscap" value="personalPackages" utml:track="true" utml:default-condition="$allowsPersonalPackages"/>
  287. </dp:section1>
  288. <dp:section2>
  289. <xts:string id="IDS_PROP_PERSONAL_PACKAGES_CAPABILITY"/>
  290. </dp:section2>
  291. </dp:choice>
  292. </xsl:when>
  293. <xsl:when test="$allowsPersonalPackages">
  294. <dp:list width="100%">
  295. <dp:section dp:kbA11y="true">
  296. <dp:text wrap="wrap" valign="top">
  297. <xts:string id="IDS_PROP_PERSONAL_PACKAGES_CAPABILITY"/>
  298. </dp:text>
  299. </dp:section>
  300. </dp:list>
  301. </xsl:when>
  302. </xsl:choose>
  303. <!-- check if connection string is for jdbc connections only -->
  304. <xsl:variable name="supportsWebBasedModeling" select="/root/*[local-name()='connection']/*[local-name()='queryResponse']/*[local-name() = 'dataSourceConnection']/*[local-name() = 'connectionString'][contains(.,'jdbc:') or contains(.,';LOCAL;TMR;') or contains(.,';LOCAL;X8;')
  305. or contains(.,';LOCAL;M12;') or contains(.,';LOCAL;M14;') or contains(.,';LOCAL;M16;') or contains(.,';LOCAL;M17;')]"/>
  306. <!-- web modeling capability-->
  307. <xsl:choose>
  308. <xsl:when test="count($supportsWebBasedModeling) > 0">
  309. <dp:section1>
  310. <utml:input type="checkbox" name="m_dscap" value="webBasedModeling" utml:track="true" utml:default-condition="$allowsWebBasedModeling"/>
  311. </dp:section1>
  312. <dp:section2>
  313. <xts:string id="IDS_PROP_PERSONAL_WEB_BASED_MODELING_CAPABILITY"/>
  314. </dp:section2>
  315. </xsl:when>
  316. <xsl:otherwise>
  317. <dp:section1>
  318. <xts:string id="IDS_PROP_PERSONAL_WEB_BASED_MODELING_INCAPABILE"/>
  319. </dp:section1>
  320. </xsl:otherwise>
  321. </xsl:choose>
  322. </lyt:section>
  323. </lyt:layout>
  324. <dp:footer>
  325. <xsl:choose>
  326. <xsl:when test="$showOKCancel">
  327. <df:button df:id="IDS_OK" utml:validate="true" df:style="submit"/>
  328. <xsl:choose>
  329. <xsl:when test="key('env-param', 'ps_nav_stack') and not(key('env-param', 'ps_nav_stack') = '') ">
  330. <df:button df:id="IDS_CANCEL" df:style="stack-down" onclick="{$dc-confirm-cancel}"/>
  331. </xsl:when>
  332. <xsl:otherwise>
  333. <df:button df:id="IDS_CANCEL" df:style="back-url" onclick="{$dc-confirm-cancel}"/>
  334. </xsl:otherwise>
  335. </xsl:choose>
  336. </xsl:when>
  337. <xsl:otherwise>
  338. <df:button df:id="IDS_CLOSE" df:style="back-url"/>
  339. </xsl:otherwise>
  340. </xsl:choose>
  341. </dp:footer>
  342. </utml:form>
  343. </dp:page>
  344. </xsl:template>
  345. <xsl:template match="*[local-name()='messageString']">
  346. <xsl:value-of select="xtsext:javascriptencode(string(.))"/><xsl:if test="string-length(normalize-space(.)) > 0">\n</xsl:if>
  347. </xsl:template>
  348. </xsl:stylesheet>
  349. </xts:block>
  350. <!--
  351. ===============================================================================================
  352. debug - display debug information
  353. ===============================================================================================
  354. -->
  355. <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">
  356. <!-- get the debug logic sheet -->
  357. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  358. <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">
  359. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  360. <xsl:template match="/">
  361. <dbg:dumpxml select="/root"/>
  362. </xsl:template>
  363. </xsl:stylesheet>
  364. </xts:block>
  365. </xts:morphlet>