private void ConfigureControls(CloudConnectorActivityData data)
        {
            comboBox_SIO.Text    = data.SIO.GetDescription();
            cb_AppName.Text      = data.CloudAppType.GetDescription();
            tb_ID.Text           = data.ID;
            tb_PWD.Text          = data.PWD;
            comboBox_Logout.Text = data.LogOut.GetDescription();
            nud_PageCount.Value  = data.PageCount;

            tb_FolderPath.Text    = data.FolderPath;
            tb_FilePath.Text      = data.FilePath;
            tb_MP_FolderPath.Text = data.FilePath;

            if (data.FileList != null)
            {
                foreach (string str in data.FileList)
                {
                    lbx_FileNames.Items.Add(str);
                }
            }

            if (!String.IsNullOrEmpty(data.SharePointSite))
            {
                tb_SharePointSites.Text = data.SharePointSite;
            }

            lockTimeoutControl.Initialize(data.LockTimeouts);
        }
        /// <summary>
        /// Returns all of the HPInc_STB_Plugin_Template1 configuration data along with a version string.
        /// </summary>
        /// <returns>Configuration data and version string.</returns>
        public PluginConfigurationData GetConfiguration()
        {
            List <string> filelist = new List <string>();

            for (int i = 0; i < lbx_FileNames.Items.Count; i++)
            {
                filelist.Add(lbx_FileNames.Items[i].ToString());
            }

            _activityData = new CloudConnectorActivityData()
            {
                SIO          = EnumUtil.GetByDescription <SIOMethod>(comboBox_SIO.SelectedItem.ToString()),
                CloudAppType = EnumUtil.GetByDescription <ConnectorName>(cb_AppName.SelectedItem.ToString()),
                ID           = tb_ID.Text,
                PWD          = tb_PWD.Text,
                LogOut       = EnumUtil.GetByDescription <LogOutMethod>(comboBox_Logout.SelectedItem.ToString()),
                PageCount    = (int)nud_PageCount.Value,

                CloudScanOptions  = _soptions,
                CloudPrintOptions = _poptions,
                LockTimeouts      = lockTimeoutControl.Value
            };

            _activityData.CloudScanOptions.PageCount = _activityData.PageCount;

            if (!String.IsNullOrEmpty(tb_SharePointSites.Text))
            {
                _activityData.SharePointSite = tb_SharePointSites.Text;
            }

            if (rb_Scan.Checked)
            {
                _activityData.FolderPath               = tb_FolderPath.Text;
                _activityData.CloudJobType             = ConnectorJobType.Scan.GetDescription();
                _activityData.CloudScanOptions.AppName = _activityData.CloudAppType.ToString();
            }
            else if (rb_Print.Checked)
            {
                _activityData.FilePath     = tb_FilePath.Text;
                _activityData.CloudJobType = ConnectorJobType.Print.GetDescription();
                _activityData.CloudPrintOptions.AppName = _activityData.CloudAppType.ToString();
            }
            else if (rb_MultipleFile.Checked)
            {
                _activityData.FilePath     = tb_MP_FolderPath.Text;
                _activityData.FileList     = filelist;
                _activityData.CloudJobType = ConnectorJobType.MultiplePrint.GetDescription();
                _activityData.CloudPrintOptions.AppName = _activityData.CloudAppType.ToString();
            }

            return(new PluginConfigurationData(_activityData, "1.0")
            {
                Assets = assetSelectionControl.AssetSelectionData,
            });
        }
Пример #3
0
        /// <summary>
        /// Defines and executes the CloudConnector workflow.
        /// </summary>
        /// <param name="executionData">Information used in the execution of this workflow.</param>
        /// <returns>The result of executing the workflow.</returns>
        public PluginExecutionResult Execute(PluginExecutionData executionData)
        {
            _data = executionData.GetMetadata <CloudConnectorActivityData>();

            if (_data.CloudJobType.Equals(ConnectorJobType.Print.GetDescription()) || _data.CloudJobType.Equals(ConnectorJobType.MultiplePrint.GetDescription()))
            {
                return(ExecutePrint(executionData));
            }

            else if (_data.CloudJobType.Equals(ConnectorJobType.Scan.GetDescription()))
            {
                return(ExecuteScan(executionData));
            }

            return(new PluginExecutionResult(PluginResult.Failed, $"Unrecognized Connector Job Type: {_data.CloudJobType}", ConnectorExceptionCategory.FalseAlarm.GetDescription()));
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="CloudConnectorScanManager" /> class.
 /// </summary>
 /// <param name="executionData">The execution data.</param>
 /// <param name="scanOptions">The scan options.</param>
 /// <param name="serverName">Name of the server.</param>
 public CloudConnectorScanManager(PluginExecutionData executionData, LinkScanOptions scanOptions, LockTimeoutData lockTimeoutData, string serverName)
     : base(executionData, scanOptions, lockTimeoutData, serverName)
 {
     ExecutionData = executionData;
     _data         = executionData.GetMetadata <CloudConnectorActivityData>();
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="CloudConnectorPrintManager" /> class.
 /// </summary>
 /// <param name="executionData">The execution data.</param>
 /// <param name="printOptions">The scan options.</param>
 public CloudConnectorPrintManager(PluginExecutionData executionData, LinkPrintOptions printOptions, LockTimeoutData lockTimeoutData)
     : base(executionData, printOptions, lockTimeoutData)
 {
     ExecutionData = executionData;
     _data         = executionData.GetMetadata <CloudConnectorActivityData>();
 }