123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: ps
- (C) Copyright IBM Corp. 2005, 2014
- US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- -->
- <!--
- Copyright (C) 2008 Cognos ULC, an IBM Company. All rights reserved.
- Cognos (R) is a trademark of Cognos ULC, (formerly Cognos Incorporated).
- -->
- <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">
- <!--
- ===============================================================================================
- formlogic_init - standard form logic initialization
- ===============================================================================================
- -->
- <xts:block id="formlogic_init" type="exec" mode="interpret" processor="XSLT" path="/logicsheets/formlogic_init.xslt" nodelist="env,credential,system,http"/>
- <!--
- ================================================================================
- delete_encrypted_passwords
- It is possible that this requests includes encrypted passwords if the user is
- returning (clicked on Back) from the Specify the connection string step of the
- New Data Source/New Connection Wizard. Since going back results in the
- passwords being "forgotten", we must delete them from the DOM.
- ================================================================================
- -->
- <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']]">
- <xts:sequence>
- <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']"/>
- </xts:sequence>
- </xts:block>
- <!--
- ================================================================================
- get_content
- ================================================================================
- -->
- <xts:block id="get_content" type="exec" mode="interpret" processor="XML" nodelist="">
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="/">
- <xts:sequence>
- <xts:append>
- <connection>
- <dataSourceConnection xmlns="http://developer.cognos.com/schemas/xts-cm/1/">
- <permissions>read write execute setPolicy traverse</permissions>
- </dataSourceConnection>
- </connection>
- </xts:append>
- <xts:append>
- <config>
- <xts:function name="getConfiguration">
- <xts:param name="dataAccess"/>
- <xts:param name="edition"/>
- </xts:function>
- </config>
- </xts:append>
- <!-- get a list of installed components -->
- <xts:append>
- <installedComponents>
- <xts:function name="getConfiguration">
- <xts:param name="installedComponents"/>
- </xts:function>
- </installedComponents>
- </xts:append>
- <xts:append>
- <xts:transform src="/transforms/portal/dataSource/filterHiddenDatasources.xslt" processor="XSLT">
- <root>
- <xts:queryNode select="/root/env"/>
- <xts:queryNode select="/root/system"/>
- <config>
- <param name="dataAccess"><xts:queryValue select="/root/config/configuration/property[@name='dataAccess']"/></param>
- <param name="edition"><xts:queryValue select="/root/config/configuration/property[@name='edition']"/></param>
- </config>
- <xts:queryNode select="/root/installedComponents"/>
- <xts:transform src="/transforms/portal/dataSource/generateDatasourceMetadata.xslt" processor="XSLT">
- <xts:param name="messageBase">/messages/portal.xml</xts:param>
- <root/>
- </xts:transform>
- </root>
- </xts:transform>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===============================================================================================
- renderPage - render the page
- ===============================================================================================
- -->
- <xts:block id="render_page" mode="output" processor="XSLT" type="exec" mimeType="text/html" dependency="formlogic_init get_content delete_encrypted_passwords">
- <!-- get the presentation theme -->
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/dialog/templates.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
- <!-- apply the form logic -->
- <xts:logicsheet path="logicsheets/formlogic.xslt"/>
- <xts:logicsheet path="logicsheets/validation.xslt"/>
- <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
- xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/"
- xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
- xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/"
- xmlns:dt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/templates/"
- xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
- xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
- xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
- xmlns:x="x"
- xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/"
- exclude-result-prefixes="xsl cm cf cp pf df dp lyt utml x">
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
- <!-- current file name -->
- <xsl:variable name="mname" select="'new_connection2.xts'"/>
- <!-- add any theme variables -->
- <pf:variables/>
- <xsl:variable name="fromCMM" select="key('env-param', 'fromCMM')"/>
- <!-- start the output -->
- <xsl:template match="/root">
- <xsl:variable name="backURL" select="key('env-param','backURL')"/>
- <xsl:variable name="connect-type">
- <xsl:choose>
- <xsl:when test="key('env-param','m_connection_type')!=''">
- <xsl:value-of select="key('env-param','m_connection_type')"/>
- </xsl:when>
- <xsl:otherwise>consolidation</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="supportsIso">
- <xsl:value-of select="datasources/datasource[value=$connect-type]/supportsIsolationLevels"/>
- </xsl:variable>
- <xsl:variable name="supportsJdbc">
- <xsl:value-of select="count(datasources/datasource[value=$connect-type]/queryServiceEquivalent)!=0"/>
- </xsl:variable>
- <xsl:variable name="wizardTitle">
- <xsl:choose>
- <xsl:when test="key('env-param','m_new_class')='dataSource'"><xts:string id="IDS_NEW_DATA_SOURCE_TITLE"/></xsl:when>
- <xsl:otherwise><xts:string id="IDS_NEW_CONNECTION_TITLE"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="browserTitle">
- <xsl:text/><xts:string id="IDS_NEW_TITLE_CONNECTION">
- <xts:param name="wizardTitle"><xsl:value-of select="$wizardTitle"/></xts:param>
- </xts:string><xsl:text/>
- </xsl:variable>
- <xsl:variable name="pageDescription">
- <xsl:choose>
- <xsl:when test="key('env-param','m_new_class')='dataSource'">
- <xsl:text/><xts:string id="IDS_NEW_INTRO_DATASOURCE"/><xsl:text/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text/><xts:string id="IDS_NEW_INTRO_CONNECTION"/><xsl:text/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:text disable-output-escaping='yes'><!DOCTYPE html></xsl:text><dp:page longTitle="$browserTitle">
- <dp:meta>
- <!-- Standard meta tags -->
- <pf:meta/>
- </dp:meta>
- <dp:script>
- <script language="javascript">
- function disableIso(disable) {
- var frm = document.pform;
- if (frm) {
- var lstIsoLevel = frm.m_p_isolationLevel;
- if (lstIsoLevel) {
- lstIsoLevel.disabled = disable;
- }
- }
- }
- function disableJdbc(disable) {
- var frm = document.pform;
- if (frm.m_create_jdbc){
- frm.m_create_jdbc.disabled = disable;
- // For Generic JDBC, we will need to set the check box as checked, but disabled.
- if (frm.m_connection_type.value == 'jdbc-generic' || frm.m_connection_type.value == 'lob-jdbc') {
- frm.m_create_jdbc.checked = true;
- } else {
- frm.m_create_jdbc.checked = !disable;
- }
- }
- }
- <xsl:if test="$fromCMM">
- function doCMMCancel() {
- document.cmmform.submit();
- }
- </xsl:if>
- <xsl:if test="key('env-param','from_bmt')!=''">
- <!-- Called only when canceling back to BMT environment. -->
- function doCancel() {
- window.external.OnClose(1);
- }
- </xsl:if>
- function mustDisable(type,attr) {
- var frm = document.pform;
- if (frm) {
- var dataSrcList = frm.m_connection_type.options;
- for (var i=0;i<dataSrcList.length;i++) {
- if (dataSrcList[i].value == type) {
- return dataSrcList[i].getAttribute('supports'+attr) == 'false';
- }
- }
- }
- return false;
- }
- function changeType() {
- var frm = document.pform;
- if (frm) {
- var dataSrcList = frm.m_connection_type;
- var disableIsolation = mustDisable(dataSrcList[dataSrcList.selectedIndex].value,'Isolation');
- frm.m_p_iso_pref[0].disabled = disableIsolation;
- frm.m_p_iso_pref[1].disabled = disableIsolation;
- disableIso(disableIsolation || frm.m_p_iso_pref[0].checked);
- <xsl:if test="count(/root/installedComponents/configuration/property/component[string(.)='queryService'])!=0">
- disableJdbc(mustDisable(dataSrcList[dataSrcList.selectedIndex].value,'Jdbc'));
- </xsl:if>
- if (frm.m_p_connectionString) {
- frm.m_p_connectionString.value = '';
- }
-
- //update the data source capability if needed
- var eltSelect = frm.m_connection_type;
- var dsCapability = eltSelect.options[eltSelect.selectedIndex].getAttribute("dataSourceCapability");
- frm.m_dscap.value = (dsCapability != "") ? dsCapability: "reporting";
- }
- }
- function init() {
- var frm = document.pform;
- if (frm) {
- frm.m_p_isolationLevel.disabled = !frm.m_p_iso_pref[1].checked;
- }
- changeType();
- }
- </script>
- <!-- Help system -->
- <pf:help context="HID_ADD_MODIFY_DATA_SOURCE"/>
- </dp:script>
- <utml:form name="pform" method="post" action="{$gateway}">
- <dp:header>
- <!-- header titles-->
- <dp:title><xsl:value-of select="$browserTitle"/></dp:title>
- <dp:description><xsl:value-of select="$pageDescription"/></dp:description>
- <dp:close>
- <xsl:choose>
- <xsl:when test="key('env-param','from_bmt')">
- <a href="javascript:doCancel()">
- <dp:closeMarker/>
- </a>
- </xsl:when>
- <xsl:when test="$fromCMM">
- <a href="javascript:doCMMCancel()">
- <dp:closeMarker/>
- </a>
- </xsl:when>
- <xsl:otherwise>
- <a href="{$backURL}">
- <dp:closeMarker/>
- </a>
- </xsl:otherwise>
- </xsl:choose>
- </dp:close>
- </dp:header>
- <lyt:layout style="1">
- <lyt:section>
- <dp:list role="presentation">
- <xsl:variable name="repositoryOnly" select="contains(key('env-param','m_classSubtype'),'externalRepository')"/>
- <xsl:variable name="dataSourceOnly" select="contains(key('env-param','m_classSubtype'),'dataSource')"/>
- <dp:section>
- <dp:label for="connectionType_ID"><xts:string id="IDS_PROP_CONN_TYPE"/></dp:label>
- </dp:section>
- <dp:section>
- <utml:select size="1" name="m_connection_type" id="connectionType_ID" onchange="changeType()">
- <xsl:for-each select="datasources/datasource">
- <xsl:sort select="name"/>
- <xsl:if test="($repositoryOnly and value='filenet') or ($dataSourceOnly and value != 'filenet') or (($repositoryOnly = false) and ($dataSourceOnly = false)) ">
- <utml:option>
- <utml:value>
- <xsl:value-of select="value"/>
- </utml:value>
- <xsl:attribute name="supportsIsolation">
- <xsl:value-of select="supportsIsolationLevels"/>
- </xsl:attribute>
- <xsl:attribute name="supportsJdbc">
- <xsl:value-of select="count(queryServiceEquivalent)!=0"/>
- </xsl:attribute>
- <xsl:attribute name="dataSourceCapability">
- <xsl:value-of select="defaultCapability"/>
- </xsl:attribute>
- <xsl:value-of select="name"/>
- </utml:option>
- </xsl:if>
- </xsl:for-each>
- </utml:select>
- <utml:input type="hidden" name="m_connection_type_history"/>
- <!-- the default data source capability to reporting, this value got updated while you change the connection type-->
- <utml:input type="hidden" name="m_dscap" value="reporting" update="true"/>
- </dp:section>
- </dp:list>
- <img height="5" width="1" src="{$webcontent}/images/space.gif"/>
- <dp:list>
- <dp:section>
- <dp:label for="isolationLevel_ID" id="isolationLevel_ID">
- <xts:string id="IDS_PROP_CONN_ISOLATION"/>
- </dp:label>
- </dp:section>
- </dp:list>
- <utml:radio-group name="m_p_iso_pref" default-value="default">
- <dp:choice aria-labelledby="isolationLevel_ID">
- <dp:section1>
- <utml:input type="radio" value="default" id="useDefaultGateway_ID" onclick="disableIso(true);">
- <xsl:attribute name="disabled">disabled</xsl:attribute>
- </utml:input>
- </dp:section1>
- <dp:section2 for="useDefaultGateway_ID">
- <xts:string id="IDS_PROP_CONN_GATEWAYDEFAULT"/>
- </dp:section2>
- <dp:section1>
- <utml:input type="radio" value="specify" id="specifyValue_ID" onclick="disableIso(false);">
- <xsl:if test="$supportsIso='false'">
- <xsl:attribute name="disabled">disabled</xsl:attribute>
- </xsl:if>
- </utml:input>
- </dp:section1>
- <dp:section2 for="specifyValue_ID">
- <xts:string id="IDS_PROP_CONN_SPECIFYVALUE"/>
- </dp:section2>
- <dp:section3>
- <utml:select size="1" name="m_p_isolationLevel" id="isolationLevel_ID" disabled="true">
- <utml:option value="cursorStability">
- <xts:string id="IDS_PROP_CONN_CURSOR"/>
- </utml:option>
- <utml:option value="phantomProtection">
- <xts:string id="IDS_PROP_CONN_PHANTOM"/>
- </utml:option>
- <utml:option value="readCommitted">
- <xts:string id="IDS_PROP_CONN_COMMITTED"/>
- </utml:option>
- <utml:option value="readUncommitted">
- <xts:string id="IDS_PROP_CONN_UNCOMMITTED"/>
- </utml:option>
- <utml:option value="reproducibleRead">
- <xts:string id="IDS_PROP_CONN_REPRODUCIBLE"/>
- </utml:option>
- <utml:option value="serializable">
- <xts:string id="IDS_PROP_CONN_SERIALIZABLE"/>
- </utml:option>
- </utml:select>
- </dp:section3>
- </dp:choice>
- <xsl:if test="count(datasources/datasource/queryServiceEquivalent) != 0 and count(/root/installedComponents/configuration/property/component[string(.)='queryService'])!=0">
- <dp:choice>
- <dp:section1>
- <utml:input type="checkbox" name="m_create_jdbc" id="configureJDBC_ID">
- <xsl:if test="$supportsJdbc='false'">
- <xsl:attribute name="disabled">disabled</xsl:attribute>
- </xsl:if>
- </utml:input>
- </dp:section1>
- <dp:section2 for="configureJDBC_ID">
- <xts:string id="IDS_PROP_CONN_CREATE_JDBC"/>
- </dp:section2>
- </dp:choice>
- </xsl:if>
- </utml:radio-group>
- </lyt:section>
- </lyt:layout>
- <dp:footer>
- <!-- Cancel button -->
- <xsl:choose>
- <xsl:when test="key('env-param','from_bmt')!=''">
- <df:button df:id="IDS_CANCEL" df:style="href" df:href="javascript:doCancel()"/>
- </xsl:when>
- <xsl:when test="$fromCMM">
- <df:button df:id="IDS_CANCEL" df:style="href" df:href="javascript:doCMMCancel()"/>
- </xsl:when>
- <xsl:otherwise>
- <df:button df:id="IDS_CANCEL" df:style="back-url"/>
- </xsl:otherwise>
- </xsl:choose>
- <!-- Back button -->
- <df:button df:id="IDS_BACK" df:style="maintain">
- <df:target>
- <xsl:value-of select="concat($app, '/new_general.xts')"/>
- </df:target>
- </df:button>
- <!-- Next button -->
- <df:button df:id="IDS_NEXT" df:style="maintain">
- <df:target>
- <xsl:value-of select="concat($app, '/new_connection3.xts')"/>
- </df:target>
- </df:button>
- <!-- Finish button -->
- <df:button df:id="IDS_FINISH"/>
- </dp:footer>
- </utml:form>
- <xsl:if test="$fromCMM">
- <dt:cmmPostBackForm/>
- </xsl:if>
- </dp:page>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===============================================================================================
- debug - display debug information
- ===============================================================================================
- -->
- <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">
- <!-- get the debug logic sheet -->
- <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
- <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">
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
- <xsl:template match="/">
- <dbg:dumpxml select="/root"/>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- </xts:morphlet>
|