Exemple #1
0
        private void ConfigureControls(ScanToWorkflowData data)
        {
            workflowName_TextBox.Text     = data.WorkflowName;
            logOcr_CheckBox.Checked       = data.UseOcr;
            pageCount_NumericUpDown.Value = data.PageCount;

            lockTimeoutControl.Initialize(data.LockTimeouts);

            assetSelectionControl.AutomationPause  = data.AutomationPause;
            assetSelectionControl.UseAdf           = data.UseAdf;
            excludeFileNamePrompt_checkBox.Checked = data.ExcludeFileNamePrompt;

            // Determine whether the DSS server should be filled in
            if (!string.IsNullOrEmpty(data.DigitalSendServer))
            {
                digitalSendServer_TextBox.Text = data.DigitalSendServer;
            }

            // Initialize other UI values
            sharepointDestination_RadioButton.Checked = (data.DestinationType == "SharePoint");
            if (data.ApplicationAuthentication)
            {
                radioButton_ScanToWorkflow.Checked = true;
            }
            else
            {
                radioButton_SignInButton.Checked = true;
            }

            comboBox_AuthProvider.SelectedValue = data.AuthProvider;
            SetPromptValues(data);
        }
Exemple #2
0
        public PluginExecutionResult Execute(PluginExecutionData executionData)
        {
            ScanToWorkflowData data        = executionData.GetMetadata <ScanToWorkflowData>(ConverterProvider.GetMetadataConverters());
            ScanOptions        scanOptions = new ScanOptions()
            {
                LockTimeouts = data.LockTimeouts,
                PageCount    = data.PageCount,
                UseAdf       = data.UseAdf,
            };

            WorkflowScanManager manager;

            if (string.IsNullOrWhiteSpace(data.DigitalSendServer))
            {
                manager = new WorkflowScanManager(executionData, scanOptions);
            }
            else
            {
                manager = new WorkflowScanManager(executionData, scanOptions, data.DigitalSendServer);
            }

            manager.ActivityStatusChanged += UpdateStatus;
            manager.DeviceSelected        += UpdateDevice;
            return(manager.RunScanActivity());
        }
Exemple #3
0
        public XElement Convert(XElement xml)
        {
            ScanToWorkflowData data = Serializer.Deserialize <ScanToWorkflowData>(xml);

            data.ApplicationAuthentication = true;
            data.AuthProvider = AuthenticationProvider.Auto;
            return(Serializer.Serialize(data));
        }
Exemple #4
0
        private void SetPromptValues(ScanToWorkflowData data)
        {
            workflowPrompts_DataGridView.Rows.Clear();

            // Add read-only row for the OCR file name prompt
            workflowPrompts_DataGridView.Rows.Add(new object[] { WorkflowScanManager.FileNamePrompt, "[Automatic]" });
            DataGridViewRow row = workflowPrompts_DataGridView.Rows[0];

            row.DefaultCellStyle           = new DataGridViewCellStyle(workflowPrompts_DataGridView.DefaultCellStyle);
            row.DefaultCellStyle.BackColor = SystemColors.Control;
            row.ReadOnly = true;

            // Add a row for each of the user-defined prompt values
            foreach (WorkflowPromptValue prompt in data.PromptValues)
            {
                workflowPrompts_DataGridView.Rows.Add(new object[] { prompt.PromptText, prompt.PromptValue });
            }
        }
Exemple #5
0
        /// <summary>
        /// Validates the given metadata against the ScanToWorkflow Activity data.
        /// </summary>
        /// <param name="configurationData">The configuration data.</param>
        /// <returns>true if valid</returns>
        public bool ValidateMetadata(ref PluginConfigurationData configurationData)
        {
            bool validData = true;
            ScanToWorkflowData activityData = null;

            try
            {
                activityData = configurationData.GetMetadata <ScanToWorkflowData>(ConverterProvider.GetMetadataConverters());
            }
            catch
            {
                activityData = new ScanToWorkflowData();
                validData    = false;
            }

            configurationData = new PluginConfigurationData(activityData, ScanToWorkflowConfigControl.Version);

            return(validData);
        }
Exemple #6
0
        /// <summary>
        /// Creates and returns a <see cref="PluginConfigurationData" /> instance containing the
        /// configuration data from this control.
        /// </summary>
        /// <returns>The configuration data.</returns>
        public PluginConfigurationData GetConfiguration()
        {
            ScanToWorkflowData data = new ScanToWorkflowData()
            {
                WorkflowName              = workflowName_TextBox.Text,
                UseOcr                    = logOcr_CheckBox.Checked,
                PageCount                 = (int)pageCount_NumericUpDown.Value,
                LockTimeouts              = lockTimeoutControl.Value,
                AutomationPause           = assetSelectionControl.AutomationPause,
                UseAdf                    = assetSelectionControl.UseAdf,
                ApplicationAuthentication = radioButton_ScanToWorkflow.Checked,
                ExcludeFileNamePrompt     = excludeFileNamePrompt_checkBox.Checked,
                AuthProvider              = (AuthenticationProvider)comboBox_AuthProvider.SelectedValue
            };

            data.DestinationType   = (folderDestination_RadioButton.Checked ? "Workflow" : "SharePoint");
            data.DigitalSendServer = digitalSendServer_TextBox.Text;

            data.PromptValues.Clear();
            foreach (DataGridViewRow row in workflowPrompts_DataGridView.Rows)
            {
                if (!row.ReadOnly)
                {
                    object promptText  = row.Cells[0].Value;
                    object promptValue = row.Cells[1].Value;
                    if (promptText != null && promptValue != null)
                    {
                        data.PromptValues.Add(new WorkflowPromptValue(promptText.ToString(), promptValue.ToString()));
                    }
                }
            }

            return(new PluginConfigurationData(data, Version)
            {
                Assets = assetSelectionControl.AssetSelectionData,
                Documents = assetSelectionControl.AdfDocuments
            });
        }
Exemple #7
0
 public WorkflowScanManager(PluginExecutionData executionData, ScanOptions scanOptions, string serverName)
     : base(executionData, serverName)
 {
     _data       = executionData.GetMetadata <ScanToWorkflowData>(ConverterProvider.GetMetadataConverters());
     ScanOptions = scanOptions;
 }