123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: ps
- (C) Copyright IBM Corp. 2005, 2013
- 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" includeConfig="true" 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"/>
-
- <!--
- ===============================================================================================
- Send a request to FM.
- ===============================================================================================
- -->
- <xts:block id="checkDataSource" processor="XSLT" type="exec" dependency="formlogic_init" condition=".[/root/env/param[@name='frmcmd']='' or /root/env/param[@name='frmcmd']!='failure']" mandatory="false">
- <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:variable name="datasourceName" select="/root/env/param[@name = 'm_p_defaultName']"/>
- <xsl:variable name="newDataSourceID" select="/root/env/param[@name='newDataSourceID']"/>
- <xsl:variable name="newDataSourcePath" select="/root/env/param[@name='newDataSourcePath']"/>
- <xsl:variable name="class-filter">
- <xsl:text>[@objectClass='dataSourceConnection']</xsl:text>
- </xsl:variable>
- <xsl:template match="/">
- <!-- Check if the datasource can be used to create a package for CMM. -->
- <xsl:if test="$datasourceName != ''">
- <xts:sequence>
- <!-- FM: get the datasource -->
- <xts:append>
- <xts:transform src="transforms/fm/fm-params.xslt" processor="XSLT">
- <send:request provider="metadataService" faultBlock="handleMetadataLWMRequestError">
- <md1:updateMetadata xmlns:md1="http://developer.cognos.com/schemas/metadataService/1">
- <request>
- <xts:transform name="XMLEncode">
- <mdprovider type="transientAction" action="execute" seq="1">
- <transaction saved="false" seq="1">
- <action seq="1" type="IsLWM">
- <inputparams>
- <param seq="1" type="i18nstring">
- <value><xsl:value-of select="$datasourceName"/></value>
- </param>
- </inputparams>
- <domchanges/>
- <result success="t">
- <outputparams/>
- </result>
- </action>
- </transaction>
- </mdprovider>
- </xts:transform>
- </request>
- </md1:updateMetadata>
- </send:request>
- </xts:transform>
- </xts:append>
- <!-- CMM: get the DataSourceConnection -->
- <xts:append>
- <theDataSourceConnection>
- <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
- <send:request provider="cm">
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <cm:query>
- <cm:requests>
- <cm:query>
- <cm:search>
- <xsl:value-of select="$newDataSourcePath"/>/*<xsl:value-of select="concat($class-filter, /root/system/param[@name='visible'])"/>
- </cm:search>
- <cm:properties>
- <cml:prop-base/>
- <cm:property name="connectionString"/>
- </cm:properties>
- </cm:query>
- </cm:requests>
- </cm:query>
- </xts:transform>
- </send:request>
- </xts:transform>
- </theDataSourceConnection>
- </xts:append>
- </xts:sequence>
- </xsl:if>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
-
- <!--
- ===============================================================================================
- handleMetadataLWMRequestError - handle the error occurring when requesting LWM to metadata service
- Do nothing for now
- ===============================================================================================
- -->
- <xts:block id="handleMetadataLWMRequestError" type="fault">
- <ignoreError/>
- </xts:block>
-
- <!--
- ===============================================================================================
- renderPackage - render the confirmation dialog or redirect the browser to the directory tool.
- ===============================================================================================
- -->
- <xts:block id="renderPackage" mode="output" processor="XSLT" type="exec" mimeType="text/html" mandatory="false" dependency="checkDataSource">
- <!-- get the presentation theme -->
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/dialog/connections.xslt"/>
- <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:dcx="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/connections/1/"
- xmlns:dt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/templates/"
- xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/"
- xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
- 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:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
- xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/"
- xmlns:out="dummy-uri"
- exclude-result-prefixes="xsl dcx cf cp pf df dp dt lyt utml">
-
- <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_connection_finish.xts'"/>
- <!-- add any theme variables -->
- <pf:variables/>
- <xsl:variable name="datasourceName" select="/root/env/param[@name = 'm_p_defaultName']"/>
- <xsl:variable name="fromCMM" select="key('env-param', 'fromCMM')"/>
- <xsl:variable name="fromBMT" select="key('env-param', 'from_bmt')"/>
- <xsl:variable name="fromTransformer" select="key('env-param', 'from_transf')"/>
- <xsl:variable name="notFrmCmdFailure" select="key('env-param', 'frmcmd')!='failure'"/>
- <xsl:variable name="backURL" select="key('env-param', 'backURL')"/>
- <xsl:variable name="storeId"><xsl:value-of select="/root/env/param[@name='newDataSourceID']"/></xsl:variable>
- <xsl:variable name="searchPath"><xsl:value-of select="/root/env/param[@name='newDataSourcePath']"/></xsl:variable>
- <xsl:variable name="dataConnectionString">
- <xsl:value-of select="/root/*[local-name()='theDataSourceConnection']/*[local-name()='queryResponse']/*[local-name()='queryReply']/*[local-name()='dataSourceConnection']/*[local-name()='connectionString']"/>
- </xsl:variable>
- <xsl:variable name="connectionString" select="contains($dataConnectionString, ';LOCAL;OL;DBInfo_Type=MS;') or contains($dataConnectionString, ';LOCAL;D2;') or contains($dataConnectionString, ';LOCAL;OR;')"/>
- <xsl:variable name="isLWM" select="/root/theFMDataSource/*[local-name()='response']/*[local-name() = 'outputparams']/*[local-name() = 'param']/."/>
- <xsl:variable name="canCreateMetricPackage" select="not($fromCMM) and not($fromBMT) and not($fromTransformer) and $userCanUseMetricsManagerAdministration and $connectionString"/>
- <xsl:variable name="canCreateLWMPackage" select="((not($fromCMM) and not($fromBMT)) or $fromTransformer) and ($isLWM and $isLWM='1') and $datasourceName != '' and $userCanUseSelfServicePackageWizard"/>
-
- <xsl:template match="/root">
- <xsl:choose>
- <xsl:when test="$notFrmCmdFailure and ($canCreateMetricPackage or $canCreateLWMPackage)">
- <xsl:text disable-output-escaping='yes'><!DOCTYPE html></xsl:text><dp:page longTitle="$product_name">
- <dp:meta>
- <pf:meta/> <!-- Standard meta tags -->
- </dp:meta>
- <dp:script>
- <!-- Help system -->
- <pf:help context="HID_DATA_SOURCES"/>
- </dp:script>
- </dp:page>
- <utml:form name="pform" method="post" action="{$gateway}">
- <dp:header>
- <dp:title><xts:string id="IDS_NEW_DATASOURCE_WIZARD_FINAL_TITLE"/></dp:title>
- <dp:close>
- <a href="javascript:doCancel();">
- <dp:closeMarker/>
- </a>
- </dp:close>
- </dp:header>
- <xsl:variable name="back-url" select="string(key('env-param', 'backURL'))"/>
- <xsl:variable name="encoded-back-url">
- <xsl:value-of select="xtsext:javascriptencode(xtsext:protect(xtsext:urlencode(string($back-url)),'url','url','getdata'))"/>
- </xsl:variable>
- <xsl:variable name="spacer">
- <img height="10" width="10">
- <xsl:attribute name="src"><xsl:value-of select="$webcontent"/>/images/space.gif</xsl:attribute>
- </img>
- </xsl:variable>
- <utml:input name="m_dataSourceName" type="hidden" value="(key('env-param', 'm_p_defaultName'))"/>
- <xsl:text disable-output-escaping='yes'><!DOCTYPE html></xsl:text><dp:page longTitle="title">
- <lyt:layout title="" style="1" border="no">
- <lyt:section>
- <dp:box valign="top">
- <dp:boxSection valign="bottom">
- <img width="32" height="32" align="top" hspace="10" id="maincontent">
- <xsl:attribute name="src">
- <xsl:value-of select="concat($webcontent, '/', $app, '/images/msg_information.gif')"/>
- </xsl:attribute>
- <xsl:attribute name="alt"><xts:string id="IDS_ICON_INFORMATION"/></xsl:attribute>
- </img>
- </dp:boxSection>
- <dp:boxSection valign="bottom">
- <dp:section1>
- <dp:text wrap="true" nospace="true">
- <xts:string id="IDS_FINISH_DATASOURCE_PARA1"><xts:param name="prodName"><xsl:value-of select="$product_name"/></xts:param></xts:string>
- </dp:text>
- </dp:section1>
- </dp:boxSection>
- </dp:box>
- <dp:box valign="bottom">
- <dp:boxSection valign="bottom">
- <img width="32" height="32" align="top" hspace="10">
- <xsl:attribute name="src"><xsl:value-of select="$webcontent"/>/images/space.gif</xsl:attribute>
- </img>
- </dp:boxSection>
- <dp:boxSection hgap="30">
- <dp:choice>
- <dp:section1>
- <utml:input type="checkbox" name="createNewPackage" value="n" utml:track="true" id="ctrl_createNewPackage">
- <xsl:if test="$fromTransformer!=''">
- <xsl:attribute name="disabled">true</xsl:attribute>
- <xsl:attribute name="checked">true</xsl:attribute>
- </xsl:if>
- </utml:input>
- </dp:section1>
- <dp:section2 for="ctrl_createNewPackage">
- <dp:text wrap="true">
- <xsl:choose>
- <xsl:when test="$canCreateLWMPackage">
- <xts:string id="IDS_NEW_DATASOURCE_WIZARD_CREATE_PACKAGE"/>
- </xsl:when>
- <xsl:when test="$canCreateMetricPackage">
- <xts:string id="IDS_NEW_DATASOURCE_WIZARD_CREATE_METRICPACKAGE"/>
- </xsl:when>
- </xsl:choose>
- </dp:text>
- </dp:section2>
- </dp:choice>
- </dp:boxSection>
- </dp:box>
- </lyt:section>
- </lyt:layout>
- </dp:page>
- <dp:footer>
- <df:button df:id="IDS_OK" df:style="href">
- <df:href>
- <xsl:text>javascript:createPackage();</xsl:text>
- </df:href>
- </df:button>
- <!-- Finish button -->
- <script language="javascript">
- function createPackage() {
- var fromTransformer = '<xsl:value-of select="$fromTransformer"/>';
- if (document.pform.createNewPackage.checked == true) {
- var canCreateLWMPackage = '<xsl:value-of select="$canCreateLWMPackage"/>';
- var canCreateMetricPackage = '<xsl:value-of select="$canCreateMetricPackage"/>';
- if (canCreateLWMPackage == 'true') {
- document.pform.m.value = "<xsl:value-of select="$app"/>/new_package.xts";
- document.pform.m_dataSourceName.value = '<xsl:value-of select="xtsext:javascriptencode($datasourceName)"/>';
- if (fromTransformer != '')
- {
- //Set back the datasource id before to call the new package
- var storeid = '<xsl:value-of select="$storeId"/>';
- if(window.external && window.external.HasSetDataSourceStoreID )
- window.external.SetDataSourceStoreID( storeid );
- var searchPath = '<xsl:value-of select="xtsext:javascriptencode($searchPath)"/>';
- if(window.external && window.external.HasSetDataSourceSearchPath )
- window.external.SetDataSourceSearchPath( searchPath );
-
- }
- document.pform.submit();
- } else if ( canCreateMetricPackage == 'true')
- {
- var store = '<xsl:value-of select="$storeId"/>';
- location.href= "<xsl:value-of select="$gateway"/>?b_action=mms.run&pid=new_mpwizard_start&datasourceId="+store+"&ui.backURL=<xsl:value-of select="$encoded-back-url"/>";
- } else {
- if (fromTransformer != '')
- {
- //Return the datasource id if the user cannot create the package
- var storeid = '<xsl:value-of select="$storeId"/>';
- if(window.external && window.external.HasSetDataSourceStoreID )
- window.external.SetDataSourceStoreID( storeid );
- var searchPath = '<xsl:value-of select="xtsext:javascriptencode($searchPath)"/>';
- if(window.external && window.external.HasSetDataSourceSearchPath )
- window.external.SetDataSourceSearchPath( searchPath );
- window.external.OnClose(1);
- }
- else
- {
- location.href = "<xsl:value-of select="xtsext:javascriptencode($backURL)"/>";
- }
- }
- } else {
- // createNewPackage not checked
- if (fromTransformer != '')
- {
- //Return the datasource id if the user did not choose to create a package
- var storeid = '<xsl:value-of select="$storeId"/>';
- if (window.external && window.external.HasSetDataSourceStoreID )
- window.external.SetDataSourceStoreID( storeid );
- var searchPath = '<xsl:value-of select="xtsext:javascriptencode($searchPath)"/>';
- if(window.external && window.external.HasSetDataSourceSearchPath )
- window.external.SetDataSourceSearchPath( searchPath );
- window.external.OnClose(1);
- }
- else {
- location.href = "<xsl:value-of select="xtsext:javascriptencode($backURL)"/>";
- }
- }
- }
- function doCancel()
- {
- var fromTransformer = '<xsl:value-of select="$fromTransformer"/>';
- //new_connection_finish.xts is called only when we're not in CMM abd BMT.
- // Only in the case of Transformer and the portal.
- if (fromTransformer != '')
- {
- //Close the window when we're in Transformer.
- window.external.OnClose(1);
- } else
- {
- location.href = "<xsl:value-of select="xtsext:javascriptencode($backURL)"/>";
- }
- }
- </script>
- </dp:footer>
- </utml:form>
- </xsl:when>
- <xsl:when test="$fromTransformer!=''">
- <xsl:text disable-output-escaping='yes'><!DOCTYPE html></xsl:text><dp:page longTitle="$product_name">
- <dp:meta>
- <pf:meta/> <!-- Standard meta tags -->
- </dp:meta>
- <dp:script>
- <script language="javascript">
- function doCancel()
- {
- window.external.OnClose(1);
- }
-
- function doOK()
- {
- if(window.external && window.external.HasSetPassport )
- window.external.SetPassport('<xsl:value-of select="xtsext:javascriptencode(string(/root/cookies/cookie[@name='cam_passport']))"/>');
- //Set back the datasource id
- var storeid = '<xsl:value-of select="$storeId"/>';
- if( window.external && window.external.HasSetDataSourceStoreID )
- window.external.SetDataSourceStoreID( storeid );
- var searchPath = '<xsl:value-of select="xtsext:javascriptencode($searchPath)"/>';
- if(window.external && window.external.HasSetDataSourceSearchPath )
- window.external.SetDataSourceSearchPath( searchPath );
- window.external.OnClose(0);
- }
- </script>
- <!-- Help system -->
- <pf:help context="HID_DATA_SOURCES"/>
- </dp:script>
- <utml:form name="pform" method="post" action="{$gateway}">
- <!-- this is the handler of the form command, which happens to be this morphlet... -->
- <dp:header>
- <!-- header titles-->
- <dp:title><xts:string id="IDS_WELCOME_DATASOURCE_TITLE_SUCCESS"/></dp:title>
- <dp:close><a href="javascript:doCancel()"><dp:closeMarker/></a></dp:close>
- </dp:header>
- <!-- display success message -->
- <lyt:layout style="1">
- <lyt:section>
- <dp:list>
- <dp:section>
- <dp:text wrap="true">
- <xsl:choose>
- <xsl:when test="key('env-param','frmcmd') = 'failure'">
- <xts:string id="IDS_CANCEL_DATASOURCE_PARA"/>
- </xsl:when>
- <xsl:otherwise>
- <xts:string id="IDS_FINISH_DATASOURCE_PARA1"><xts:param name="prodName"><xsl:value-of select="$product_name"/></xts:param></xts:string>
- </xsl:otherwise>
- </xsl:choose>
- </dp:text>
- </dp:section>
- </dp:list>
- <br/>
- </lyt:section>
- </lyt:layout>
- <dp:footer>
- <xsl:choose>
- <xsl:when test="key('env-param','frmcmd') = 'failure'">
- <df:button df:id="IDS_CLOSE" df:style="href" df:href="javascript:doCancel();"/>
- </xsl:when>
- <xsl:otherwise>
- <df:button df:id="IDS_CLOSE" df:style="href" df:href="javascript:doOK();"/>
- </xsl:otherwise>
- </xsl:choose>
- </dp:footer>
- </utml:form>
- </dp:page>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="redirect">
- <xsl:with-param name="url" select="$backURL"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template name="redirect">
- <xsl:param name="url"/>
- <html>
- <head>
- <meta http-equiv="refresh">
- <xsl:attribute name="content">0; URL=<xsl:value-of select="$url"/></xsl:attribute>
- </meta>
- <title>
- <xts:string id="IDS_COGNOS_REPORTS"/>
- </title>
- </head>
- </html>
- </xsl:template>
-
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===============================================================================================
- debug - display debug information
- ===============================================================================================
- -->
- <xts:block id="debug" dependency="renderPackage" 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>
|