123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: ps
- (C) Copyright IBM Corp. 2013
- US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- -->
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
- xmlns:reqhelpers="http://developer.cognos.com/schemas/xts-cm/1/reqhelpers"
- xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
- xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:out="dummy-uri"
- 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: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:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/"
- exclude-result-prefixes="xsl send reqhelpers xts bus lyt dp df cf cp utml">
- <xsl:output method="xml" version="1.0" encoding="UTF-8"
- indent="no" />
- <xsl:namespace-alias stylesheet-prefix="out"
- result-prefix="xsl" />
- <xsl:template match="tenantSelectionUIDojoInit">
- <link id="themeStyles" rel="stylesheet" href="{{$webcontent}}/../dojo16/dijit/themes/tundra/tundra.css" />
- <script src="{{$webRoot}}/dojo16/dojo/dojo.js" />
- </xsl:template>
- <xsl:template match="tenantSelectionUI">
- <lyt:section>
- <out:if test="key('env-param','m_new_class') != 'tenant'">
- <out:variable name="parent_is_public" select="$the-object/cm:tenantID=''" />
- <out:variable name="has_read_permission" select="true()" />
- <out:variable name="tenantID">
- <out:choose>
- <out:when test="key('env-param','m_p_tenantID') and key('env-param', 'm_p_tenantID') != ''">
- <out:value-of select="key('env-param', 'm_p_tenantID')" />
- </out:when>
- <out:when test="string($the-object/cm:tenantID)!='' and (not(key('env-param', 'changed_m_p_tenantID')) or key('env-param', 'changed_m_p_tenantID') != '1')">
- <out:value-of select="string($the-object/cm:tenantID)" />
- </out:when>
- <out:otherwise>
- <out:value-of select="key('session-param', 'e_tenantID')"/>
- </out:otherwise>
- </out:choose>
- </out:variable>
- <out:variable name="tenantName">
- <out:choose>
- <out:when test="key('env-param','objTenantName') != ''">
- <out:value-of select="key('env-param','objTenantName')" />
- </out:when>
- <out:when test="/root/tenantObjInfo//*/cm:defaultName != ''">
- <out:value-of select="/root/tenantObjInfo//*/cm:defaultName" />
- </out:when>
- <out:when test="boolean(key('session-param', 'e_writeTenantName'))">
- <out:choose>
- <out:when test="key('session-param', 'e_writeTenantName') != ''">
- <out:value-of select="key('session-param', 'e_writeTenantName')"/>
- </out:when>
- <out:otherwise>
- <xts:string id="IDS_NONE"/>
- </out:otherwise>
- </out:choose>
- <out:value-of select="key('session-param', 'e_writeTenantName')"/>
- </out:when>
- <out:when test="key('session-param', 'e_tenantDisplayName') != ''">
- <out:value-of select="key('session-param', 'e_tenantDisplayName')"/>
- </out:when>
- <out:otherwise>
- <xts:string id="IDS_NONE"/>
- </out:otherwise>
- </out:choose>
- </out:variable>
- <out:variable name="isAccountObject"
- select="$the-object/cm:objectClass='account'" />
- <out:variable name="isTenantObject"
- select="$the-object/cm:objectClass='tenant' or $the-object/cm:objectClass='tenants'" />
- <out:variable name="tenantInfo">
- <out:choose>
- <out:when test="$isTenantObject">
- <label>
- <xts:string id="IDS_PROP_TENANTID" />
- </label>
- <text>
- <out:value-of select="$the-object/cm:tenantID" />
- </text>
- </out:when>
- <out:otherwise>
- <label>
- <xts:string id="IDS_PROP_TENANT_NAME" />
- </label>
- <text>
- <out:value-of select="$tenantName" />
- </text>
- </out:otherwise>
- </out:choose>
- </out:variable>
- <out:if test="not($isTenantObject) and key('session-param', 'e_showTenantInfo')='true' and $has_read_permission">
- <dp:list width="50%">
- <dp:input>
- <dp:section1>
- <utml:input type="hidden" name="changed_genprop" value="0" />
- <utml:input type="hidden" id="tenantID" name="m_p_tenantID" class="pInput" maxlength="100" size="30">
- <utml:value>
- <out:value-of select="$tenantID" />
- </utml:value>
- </utml:input>
- <utml:input type="hidden" name="changed_m_p_tenantID" class="pInput" maxlength="100" size="30">
- <utml:value>
- <out:value-of select="'1'" />
- </utml:value>
- </utml:input>
- </dp:section1>
- </dp:input>
- <out:if test="key('session-param', 'e_showTenantInfo')='true' and $has_read_permission">
- <dp:section>
- <dp:label valign="top" width="1%" tabindex="0">
- <out:value-of select="$tenantInfo/label" />
- </dp:label>
- <dp:text width="1%">
- <out:value-of select="xtsext:enforceBTD($tenantInfo/text, $baseTextDirection, $productLocale, boolean($isBidiEnabled='true'))" />
- </dp:text>
- <out:if test="key('session-param', 'e_isSysAdmin')='true' or key('session-param', 'e_isTenantAdmin')='true'">
- <dp:link>
- <out:if test="/root/tenantChanged">
- <script language="javascript">
- dojo.addOnLoad(function()
- {
- alert('<xts:string id="IDS_TENANT_CHANGED_WARNING" encode="javascript"/>' );
- }
- );
- </script>
- </out:if>
- <out:if test="not($tenantID ='' and ($isAccountObject or $isTenantObject)) and $parent_is_public">
- <script language="javascript">
- function utmlSubmitForm(formName, targetPage, operation, dovalid) {
- if( dovalid != '' && window.validate ) {
- if( !validate() )
- return;
- }
- formName.ps_nav_op.value = operation;
- if (targetPage != '')
- formName.m.value = targetPage;
- else if (operation == 'pop' || operation == 'drop')
- formName.m.value = '';
-
- formName.submit();
- }
-
- dojo.require("dijit.form.FilteringSelect");
- dojo.require("dojo.data.ItemFileReadStore");
-
- var g_select;
- dojo.addOnLoad(function() {
- // create store instance referencing data from listTenants.xts
- var tenantStore = new dojo.data.ItemFileReadStore({
- url: "<out:value-of select="concat($gateway,'?b_action=xts.run&m=',$app,'/tenants/listTenants.xts')" />"
- });
- g_select = new dijit.form.FilteringSelect({
- name: "selectedTenantName",
- placeHolder: "<xts:string id="IDS_SELECT_THE_TENANTID" encode="javascript" />",
- value: "<out:value-of select="xtsext:javascriptencode($tenantName)"/>",
- store: tenantStore
- }, "selectedTenantName");
-
- g_select.startup();
- });
-
- function showTenantDlg() {
- selectTenantDialog.show();
- setTimeout('setTenantFocus()', 11);
- }
-
- function setTenantFocus(){
- if (selectTenantDialog.className = "visible")
- g_select.focus();
- }
-
- function updateTenantID(newTenantID, newTenantName) {
-
- setFormInputElement('newTenantID',newTenantID);
- setFormInputElement('newTenantName',newTenantName);
- setFormInputElement('tenantChanged','true');
-
- setPropertiesChanged();
- utmlSubmitForm(document.pform,'<out:value-of select="xtsext:javascriptencode(string($app))"/>/<out:value-of select="xtsext:javascriptencode(string($mname))"/>','maintain','');
- }
-
- function setNewTenantID() {
- if (g_select.isValid()) {
- updateTenantID(g_select.item.id, g_select.item.name);
- javascript:selectTenantDialog.hide();
- }
- }
-
- function makeTenantIDPublic() {
- updateTenantID('','<xts:string id="IDS_NONE" encode="javascript"/>');
- }
-
- function setPropertiesChanged() {
- document.pform['changed_genprop'].value='1';
- }
- </script>
- <out:if test="not($isTenantObject)">
- <out:choose>
- <out:when test="$tenantID !=''">
- <dp:text>
- <a href="javascript:showTenantDlg();">
- <out:text />
- <xts:string id="IDS_EDIT_THE_TENANTID" />
- <out:text />
- </a>
- </dp:text>
- <out:if test="not($isAccountObject)">
- <dp:text>
- <a href="javascript:makeTenantIDPublic();">
- <out:text />
- <xts:string id="IDS_MAKE_PUBLIC" />
- <out:text />
- </a>
- </dp:text>
- </out:if>
- </out:when>
- <out:otherwise>
- <dp:text>
- <a href="javascript:showTenantDlg();">
- <out:text />
- <xts:string id="IDS_SELECT_THE_TENANTID" />
- <out:text />
- </a>
- </dp:text>
- </out:otherwise>
- </out:choose>
- </out:if>
- <div>
- <cp:genericDialog id="selectTenantDialog"
- rootContainerId="pform" interactive="true" align="left"
- width="300" positionVertical="true" positionHorizontal="true"
- helpid="tenantHelp" focusidOnShiftTab="tenantCancel">
- <cp:param name="title">
- <xts:string id="IDS_SELECT_TENANTID_TITLE" />
- </cp:param>
- <cp:param name="body">
- <lyt:layout style="1" lyt:kbA11y="true">
- <lyt:section>
- <dp:list>
- <dp:section>
- <dp:text>
- <xts:string id="IDS_SELECT_TENANTID_INTRO" />
- </dp:text>
- </dp:section>
- <dp:section>
- <dp:text />
- </dp:section>
- <dp:section>
- <dp:input dp:kbA11y="true">
- <dp:section1>
- <Label for="selectedTenantName">
- <xts:string id="IDS_PROP_TENANT_NAME" />
- </Label>
- </dp:section1>
- <dp:section2>
- <table><tr><td><input id="selectedTenantName"/></td></tr></table>
- </dp:section2>
- </dp:input>
- </dp:section>
- <dp:section>
- <dp:text />
- </dp:section>
- </dp:list>
- </lyt:section>
- </lyt:layout>
- </cp:param>
- <cp:param name="footer">
- <!-- NOTE: onkeydown required to force navigation within the
- popup element -->
- <dp:simpleFooter>
- <td>
- <table cellpadding="0" cellspacing="0" role="presentation">
- <tr>
- <td>
- <cp:cmdButton defaultState="active" id="tenantOK">
- <cp:cmdButtonText>
- <xts:string id="IDS_OK" />
- </cp:cmdButtonText>
- <cp:cmdButtonEvents>
- <cp:cmdButtonEvent name="onclick">setNewTenantID();
- </cp:cmdButtonEvent>
- </cp:cmdButtonEvents>
- </cp:cmdButton>
- </td>
- <td>
- <cp:cmdButton defaultState="active" id="tenantCancel">
- <cp:cmdButtonText>
- <xts:string id="IDS_CANCEL" />
- </cp:cmdButtonText>
- <cp:cmdButtonEvents>
- <cp:cmdButtonEvent name="onclick">javascript:selectTenantDialog.hide();
- </cp:cmdButtonEvent>
- <cp:cmdButtonEvent name="onkeydown">
- javascript:if(event.keyCode==9)
- <out:text>{</out:text>
- if(event.shiftKey==true) return true; else
- <out:text>{</out:text>
- if(document.getElementById("tenantHelp"))
- <out:text>{</out:text>
- document.getElementById("tenantHelp").focus();
- return false;
- <out:text>}</out:text>
- <out:text>}</out:text>
- <out:text>}</out:text>
- return true;
- </cp:cmdButtonEvent>
- </cp:cmdButtonEvents>
- </cp:cmdButton>
- </td>
- </tr>
- </table>
- </td>
- </dp:simpleFooter>
- </cp:param>
- </cp:genericDialog>
- </div>
- </out:if>
- </dp:link>
- </out:if>
- </dp:section>
- </out:if>
- </dp:list>
- </out:if>
- </out:if>
- </lyt:section>
- </xsl:template>
- <xsl:template match="*">
- <xsl:copy>
- <xsl:copy-of select="@*" />
- <xsl:apply-templates />
- </xsl:copy>
- </xsl:template>
- </xsl:stylesheet>
|