How to Show Configuration Information within a Windows Azure Pack Management Portal Plan User Interface

 

Applies To: Windows Azure Pack

<<ExtensionName>>.ServiceOffer.js is needed when the resource page is loaded. This file defines the commands and behavior for the initialization, execution of commands, and handles the onOfferSaving event for the page.

The primary functions are initializeServiceOffer which receives the configuration from the host and updates the user interface and executeCommand which performs the commands defined by the resource provider in the bottom ribbon.

To Show Configuration Information

  1. Implement ServiceOffer.js with the following code:

    /*globals window,parent,jQuery,document,setTimeout*/
    /// <dictionary>jslint,iframe, Addon, </dictionary>
    /// <disable>JS2076.IdentifierIsMiscased</disable>  // for 'Editions'
    (function ($, global, undefined) {
        "use strict";
    
        // Executes the commands defined by the resource provider in the bottom command ribbon
        function executeCommand(commandId, commandParameter) {
            var i;
            switch (commandId) {
                case "X.addAddon":
                    showAddAddonWizard();
                    break;
    
                case "X.editAddon":
                    showEditAddonWizard();
                    break;
    
                case "X.deleteAddon":
                    showDeleteAddonConfirmation();
                    break;
    
                case "X.addEdition":
                    showAddEditionWizard();
                    break;
    
                case "X.editEdition":
                    showEditEditionWizard();
                    break;
    
                case "X.deleteEdition":
                    showDeleteEditionConfirmation();
                    break;            
    
                    updateAnytingNeededByExtension();
            }
        }
    
        // Called after "Save" command for plan is invoked, but before it is sent to a resource provider. Do final validation here and throw an exception if there is an error</summary>
        function onOfferSaving() {
            if (!cachedServiceOffer || !cachedServiceOffer.Editions || cachedServiceOffer.Editions.length === 0) {
                throw resources.InvalidQuotasNoGroup;
            }
        }
    
        // Receives config from host and updates the UI
        function initializeServiceOffer(serviceOffer, planEntityType) {
    
    
        }
    
        function initializePage() {
            global.ServiceOffer.registerExtension({
                initializeServiceOffer: initializeServiceOffer,
                onOfferSaving: onOfferSaving,
                executeCommand: executeCommand
            });
        }
    
        $(document).ready(initializePage);
    
    })(jQuery, this);      
    

See Also

Performing Common Tasks in a Windows Azure Pack Management Portal Extension