Article ID: 128647, created on Apr 11, 2016, last review on Apr 11, 2016

This article contains the BM_ProvisioningParams.xml and script.js customization files which must be used during the deployment of the Office 365 6.3-6.4 and Azure CSP 1.0-1.1 Applications. These files must be applied on your Odin Automation billing Application Server to configure the subdomain form.

Important:

  • Before applying the customization files, make sure that the versions of the Applications used on your installation belong to the versions stated in the KB. To view the versions of the Applications, log in to your control panel and go to Services > Applications.
  • The list of customization files for all versions of the Office 365 and Azure CSP Applications is provided in the KB article https://kb.odin.com/en/127372.

To learm more about the subdomain form, see the following sections:

  • Odin Automation Office 365 Integration Provider's Guide >> Syndication Partner Scenario > Configuring Office 365 Subdomain Form for Odin Automation billing Control Panel
  • Odin Automation Office 365 Integration Provider's Guide >> Cloud Solution Provider Scenario > Configuring Office 365 Subdomain Form for Odin Automation billing Control Panel
  • Odin Automation Azure CSP Integration Provider's Guide >> Configuring Billing > Configuring Azure CSP Subdomain Form for Odin Automation billing Control Panel

BM_ProvisioningParams.xml

<!-- customization file for Office 365 6.3-6.4 and Azure CSP 1.0-1.1 -->
<window id="BM_ProvisioningParams">
    <layout>
        <grid id="ProvisioningParams">
            <row id="onmicrosoftcom">
                <cell labelfor="onmicrosoftcom">`Microsoft Online Subdomain`</cell>
                <cell class="dashboardStats">
                    <html>
                        <ui:cell-rows>
                            <ui:row>
                                <ui:cell id="theonmicrosoftCell">
                                    <style>#theonmicrosoftCell div.text-value {padding: 0px;}</style>
                                    <input name="theonmicrosoft" id="theonmicrosoft" type="text" size="25" maxlength="25" class="FlatInputFlow" style="text-align:right"/><span>.onmicrosoft.com</span>
                                    <div id="alert" style="padding-bottom:10px;"></div>
                                    <div id="subdomain_hint" style="color:gray;"></div>
                                    <div id="msg_subdomain_hint" style="display:none"></html>`To activate your account in Microsoft cloud, please choose an initial subdomain name. You will be able to add or buy other domains later. The subdomain is mandatory, only Latin letters and numbers are allowed and the length cannot exceed 25 characters.`<html></div>
                                    <div id="msg_subdomain_hint_alow_empty" style="display:none"></html>`To activate your account in Microsoft cloud, please choose an initial subdomain name. You will be able to add or buy other domains later. Only Latin letters and numbers are allowed and the length cannot exceed 25 characters. You can leave the subdomain field empty, in this case you will be asked to specify the subdomain later from Customer Control Panel.`<html></div>
                                    <div id="msg_click_to_check" style="display:none"></html>`Please click here to check the subdomain availability.`<html></div>
                                    <div id="msg_subdomain_empty" style="display:none"><span style="color:red"></html>`The subdomain field cannot be empty.`<html></span></div>
                                    <div id="msg_subdomain_too_long" style="display:none"><span style="color:red"></html>`The subdomain length cannot exceed 25 characters.`<html></span></div>
                                    <div id="msg_checking_subdomain" style="display:none"><img src="/bss-static/skins/default/v3/icons/16/plesk/indicator.gif"/> </html>`Checking the subdomain availability.`<html></div>
                                    <div id="msg_subdomain_available" style="display:none"><span style="color:green"></html>`The subdomain is available.`<html></span></div>
                                    <div id="msg_subdomain_not_available" style="display:none"><span style="color:red"></html>`This subdomain is not available. Please try another and click here.`<html></span></div>
                                    <div id="msg_subdomain_format" style="display:none"><span style="color:red"></html>`Only Latin letters and numbers are allowed.`<html></span></div>
                                    <script src="/bss-static/azure/script.js"></script>
                                </ui:cell>
                            </ui:row>
                        </ui:cell-rows>
                    </html>
                </cell>
            </row>
        </grid>
    </layout>
</window>

script.js

// customization file for Office 365 6.3-6.4 and Azure CSP 1.0-1.1
var keyPressTimer = null;
var lastCheckedDomain = null;
var checkSubdomain = function () {
    keyPressTimer && clearTimeout(keyPressTimer);
    keyPressTimer = null;
    var subdomain = $("#theonmicrosoft").val().trim();
    lastCheckedDomain = subdomain;
    var alertDiv = $("#alert");
    if (subdomain.length === 0) {
        var azureIncluded = $("#input___aps_defaults_azure").length > 0,
            o365Included = $("#input___aps_defaults_o365").length > 0;
        if (azureIncluded) { 
            alertDiv.html($("#msg_subdomain_empty").html());
        } else if (o365Included) { // Office 365 allow empty subdomain
            var nextBtn = $("#input___Next");
            nextBtn.removeAttr("disabled");
            nextBtn.fadeTo("slow", 1, function () { });
            alertDiv.empty();
        }
        return;
    } else if (subdomain.length > 25) {
        alertDiv.html($("#msg_subdomain_too_long").html());
        return;
    } else if (!subdomain.match(/^[a-zA-Z0-9]+$/)) {
        alertDiv.html($("#msg_subdomain_format").html());
        return;
    }
    alertDiv.html($("#msg_checking_subdomain").html());
    var url = "https://login.windows.net/" + subdomain + ".onmicrosoft.com/FederationMetadata/2007-06/FederationMetadata.xml";
    jQuery.getJSON("https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20html%20where%20url='" + encodeURIComponent(url) + "'&format=json&callback=?", (function (inValue) {
        return function (data) {
            var fieldValue = $("#theonmicrosoft").val().trim();
            if (inValue === fieldValue) { // ensure we've queried the same value, as the input has now
                if (data.query.count === 0) {
                    alertDiv.html($("#msg_subdomain_available").html());
                    var defaults = $("#input____aps_defaults_o365");
                    if (defaults.length === 1) {
                        defaults.attr("maxlength", "255");
                        defaults.val('{"aps":{"type":"http://www.parallels.com/Office365/Tenant/1.1"},"subdomain":"' + inValue + '"}');
                    } else {
                        defaults = $("#input____aps_defaults_azure");
                        if (defaults.length === 1) {
                            defaults.attr("maxlength", "255");
                            defaults.val('{"aps":{"type":"http://www.odin.com/app/azure-csp/tenant/1.0"},"domain_prefix":"' + inValue + '"}');
                        }
                    }
                    var nextBtn = $("#input___Next");
                    nextBtn.removeAttr("disabled");
                    nextBtn.fadeTo("slow", 1, function () { });
                } else {
                    alertDiv.html($("#msg_subdomain_not_available").html());
                    $("#theonmicrosoft").focus();
                }
            }
        }
    })(subdomain));
};
$("#theonmicrosoft").blur(checkSubdomain);
$("#theonmicrosoft").keyup(function () {
    var subdomain = $("#theonmicrosoft").val().trim();
    if (subdomain === lastCheckedDomain) {
        return
    }
    var nextBtn = $("#input___Next");
    nextBtn.attr("disabled", "disabled");
    nextBtn.fadeTo("slow", 0.1, function () { });
    keyPressTimer && clearTimeout(keyPressTimer);
    keyPressTimer = setTimeout(checkSubdomain, 2000);
    $("#alert").html($("#msg_click_to_check").html());
});
$(document).ready(function () {
    var azureIncluded = $("#input___aps_defaults_azure").length > 0,
        o365Included = $("#input___aps_defaults_o365").length > 0;
    if (!azureIncluded && !o365Included) {
        $("#theonmicrosoft,#alert,#tr___onmicrosoftcom,#tr___ccsctpnet").remove();
        return;
    }
    if ($("#input___DomainID").length > 0) {
        $("#input___DomainID, #tr___DomainID").remove();
    }
    $("#tr___aps_defaults_o365,#tr___aps_defaults_azure").css("display", "none");

    var hintDiv = $("#subdomain_hint");
    if (azureIncluded) {
        hintDiv.html($("#msg_subdomain_hint").html());

        var nextBtn = $("#input___Next");
        nextBtn.attr("disabled", "disabled");
        nextBtn.fadeTo("slow", 0.1, function () { });
    } else if (o365Included) { // Office 365 allow empty subdomain
        hintDiv.html($("#msg_subdomain_hint_alow_empty").html());
    }
});

Email subscription for changes to this article
Save as PDF