Exemple #1
0
 /// <summary>
 /// Initializes this configuration control to default values.
 ///
 /// <seealso cref="PluginEnvironment"/>
 /// </summary>
 /// <param name="environment">Information about the plug-in environment.</param>
 public void Initialize(PluginEnvironment environment)
 {
     // Initialize the activity data.
     _data = new EquitracInstallerActivityData();
     equitrac_assetSelectionControl.Initialize(AssetAttributes.ControlPanel);
     equitrac_serverComboBox.Initialize("Equitrac");
 }
Exemple #2
0
        /// <summary>
        /// Provides plug-in configuration data for an existing activity, including plug-in
        /// specific metadata, a metadata version, and selections of assets and documents.
        /// </summary>
        /// <param name="configuration">The configuration data.</param>
        /// <param name="environment">Information about the plug-in environment.</param>
        public void Initialize(PluginConfigurationData configuration, PluginEnvironment environment)
        {
            // Initialize the activity data by deserializing it from an existing copy of the
            // configuration information.
            _data = configuration.GetMetadata <EquitracInstallerActivityData>();
            equitrac_assetSelectionControl.Initialize(configuration.Assets, AssetAttributes.ControlPanel);
            equitrac_serverComboBox.Initialize(configuration.Servers.SelectedServers.FirstOrDefault(), "Equitrac");

            bundleFile_textBox.Text     = _data.BundleFileName;
            tasks_comboBox.SelectedItem = _data.InstallerAction;
        }
        /// <summary>
        /// Executes this plug-in's workflow using the specified <see cref="PluginExecutionData"/>.
        /// </summary>
        public PluginExecutionResult Execute(PluginExecutionData executionData)
        {
            var result = new PluginExecutionResult(PluginResult.Skipped);

            _activityData = executionData.GetMetadata <EquitracInstallerActivityData>();
            _serverInfo   = executionData.Servers.FirstOrDefault();
            _deviceInfo   = executionData.Assets.OfType <DeviceInfo>().FirstOrDefault();

            var jediDevice      = new JediOmniDevice(_deviceInfo.Address, _deviceInfo.AdminPassword);
            var bundleInstaller = new EquitracBundleInstaller(jediDevice);

            _signedSessionId = bundleInstaller.SignIn(string.Empty);
            switch (_activityData.InstallerAction)
            {
            case EquitracInstallerAction.DeployBundleFile:
                result = bundleInstaller.InstallSolution(_signedSessionId, _activityData.BundleFileName);
                break;

            case EquitracInstallerAction.RegisterDevice:
            {
                NameValueCollection nvc = new NameValueCollection
                {
                    { "IPAddress", _serverInfo.Address },
                    { "debug", "on" },
                    { "trace", "on" },
                    { "submit", "Ok" }
                };
                result = bundleInstaller.RegisterDevice(_signedSessionId, nvc);
            }
            break;

            case EquitracInstallerAction.ConnectDomain:
                result = bundleInstaller.EquitracConntecDomain(_serverInfo.ServerId.ToString());
                break;
            }

            return(result);
        }