示例#1
0
        /// <summary>
        /// Executes this plug-in's workflow using the specified <see cref="PluginExecutionData"/>.
        /// </summary>
        /// <remarks>
        ///
        /// <seealso cref="PluginExecutionData"/>
        /// <seealso cref="PluginExecutionResult"/>
        /// <seealso cref="PluginResult"/>
        /// </remarks>
        /// <param name="executionData">The execution data.</param>
        /// <returns>A <see cref="PluginExecutionResult"/> indicating the outcome of the
        /// execution.</returns>
        public PluginExecutionResult Execute(PluginExecutionData executionData)
        {
            _data       = executionData.GetMetadata <HpecInstallerActivityData>();
            _credential = executionData.Credential;
            _serverInfo = executionData.Servers.FirstOrDefault();
            _sessionId  = executionData.SessionId;
            var printer = executionData.Assets.OfType <PrintDeviceInfo>().FirstOrDefault();

            UpdateStatus("Creating Device List File.");
            _deviceListFile = CreateDeviceList(printer);
            UpdateStatus($"Created Device List File on remote server at: {_deviceListFile}");

            switch (_data.InstallerAction)
            {
            case HpecInstallerAction.InstallHpec:
                InstallHpec();
                break;

            case HpecInstallerAction.UninstallHpec:
                UninstallHpec();
                break;

            case HpecInstallerAction.UploadWorkflow:
                UploadWorkFlow();
                break;

            case HpecInstallerAction.RemoveWorkflow:
                RemoveWorkFlow();
                break;
            }

            return(new PluginExecutionResult(PluginResult.Passed));
        }
示例#2
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 HpecInstallerActivityData();
     hpec_serverComboBox.Initialize("HPEC");
     hpec_assetSelectionControl.Initialize(AssetAttributes.Scanner);
     version_textBox.Text = _data.ServerVersion;
 }
示例#3
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 <HpecInstallerActivityData>();

            workflowFile_textBox.Text = _data.WorkflowFile;
            hpec_serverComboBox.Initialize(configuration.Servers.SelectedServers.FirstOrDefault());
            hpec_assetSelectionControl.Initialize(configuration.Assets, AssetAttributes.Scanner);
            installerAction_comboBox.SelectedItem = _data.InstallerAction.ToString();
            version_textBox.Text = _data.ServerVersion;
        }