v.3.0 is coming.
refactoring and many changes. It is not backward compatible with Schedule file. It is required to configure all jobs from scratch. Ability to import packages into multiple legal entities using single RIS import job. It is now possible to download execution errors for import job in json format. All jobs have controls of delays between processed files as well as between execution/processing status checks.
This commit is contained in:
Родитель
11fc8a6058
Коммит
418b97e39c
|
@ -84,7 +84,7 @@
|
|||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Identity.Client">
|
||||
<Version>4.7.1</Version>
|
||||
<Version>4.8.1</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Newtonsoft.Json">
|
||||
<Version>12.0.3</Version>
|
||||
|
|
|
@ -19,6 +19,6 @@ namespace RecurringIntegrationsScheduler.Common.Contracts
|
|||
public const string GetMessageStatusActionPath = "data/DataManagementDefinitionGroups/Microsoft.Dynamics.DataEntities.GetMessageStatus";
|
||||
public const string GetImportTargetErrorKeysFileUrlPath = "data/DataManagementDefinitionGroups/Microsoft.Dynamics.DataEntities.GetImportTargetErrorKeysFileUrl";
|
||||
public const string GenerateImportTargetErrorKeysFilePath = "data/DataManagementDefinitionGroups/Microsoft.Dynamics.DataEntities.GenerateImportTargetErrorKeysFile";
|
||||
|
||||
public const string GetExecutionErrorsPath = "data/DataManagementDefinitionGroups/Microsoft.Dynamics.DataEntities.GetExecutionErrors";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -56,12 +56,12 @@ namespace RecurringIntegrationsScheduler.Common.Contracts
|
|||
/// <summary>
|
||||
/// The delay between files processing
|
||||
/// </summary>
|
||||
public const string Interval = "Interval";
|
||||
public const string DelayBetweenFiles = "DelayBetweenFiles";
|
||||
|
||||
/// <summary>
|
||||
/// The delay between status check of export job
|
||||
/// </summary>
|
||||
public const string StatusCheckInterval = "StatusCheckInterval";
|
||||
public const string DelayBetweenStatusCheck = "DelayBetweenStatusCheck";
|
||||
|
||||
/// <summary>
|
||||
/// The retry count
|
||||
|
@ -138,6 +138,11 @@ namespace RecurringIntegrationsScheduler.Common.Contracts
|
|||
/// </summary>
|
||||
public const string GetImportTargetErrorKeysFileUrlPath = "GetImportTargetErrorKeysFileUrlPath";
|
||||
|
||||
/// <summary>
|
||||
/// The relative path to the GetExecutionErrors Odata action
|
||||
/// </summary>
|
||||
public const string GetExecutionErrorsPath = "GetExecutionErrorsPath";
|
||||
|
||||
/// <summary>
|
||||
/// The download job
|
||||
/// </summary>
|
||||
|
@ -292,5 +297,40 @@ namespace RecurringIntegrationsScheduler.Common.Contracts
|
|||
/// Get import target error keys file
|
||||
/// </summary>
|
||||
public const string GetImportTargetErrorKeysFile = "GetImportTargetErrorKeysFile";
|
||||
|
||||
/// <summary>
|
||||
/// Multicompany import
|
||||
/// </summary>
|
||||
public const string MultiCompanyImport = "MultiCompanyImport";
|
||||
|
||||
/// <summary>
|
||||
/// Get legal entity from filename
|
||||
/// </summary>
|
||||
public const string GetLegalEntityFromFilename = "GetLegalEntityFromFilename";
|
||||
|
||||
/// <summary>
|
||||
/// Get legal entity from subfolder
|
||||
/// </summary>
|
||||
public const string GetLegalEntityFromSubfolder = "GetLegalEntityFromSubfolder";
|
||||
|
||||
/// <summary>
|
||||
/// Filename separator
|
||||
/// </summary>
|
||||
public const string FilenameSeparator = "FilenameSeparator";
|
||||
|
||||
/// <summary>
|
||||
/// Legal entity token position
|
||||
/// </summary>
|
||||
public const string LegalEntityTokenPosition = "LegalEntityTokenPosition";
|
||||
|
||||
/// <summary>
|
||||
/// Input files are packages
|
||||
/// </summary>
|
||||
public const string InputFilesArePackages = "InputFilesArePackages";
|
||||
|
||||
/// <summary>
|
||||
/// Get execution errors
|
||||
/// </summary>
|
||||
public const string GetExecutionErrors = "GetExecutionErrors";
|
||||
}
|
||||
}
|
|
@ -19,6 +19,7 @@ namespace RecurringIntegrationsScheduler.Common.Helpers
|
|||
private readonly Settings _settings;
|
||||
private string _authorizationHeader;
|
||||
private readonly AsyncRetryPolicy _retryPolicy;
|
||||
private const string AuthEndpoint = "https://login.microsoftonline.com/";
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="AuthenticationHelper"/> class.
|
||||
|
@ -45,13 +46,14 @@ namespace RecurringIntegrationsScheduler.Common.Helpers
|
|||
/// <returns>Authorization header</returns>
|
||||
private async Task<string> AuthorizationHeader()
|
||||
{
|
||||
if (!string.IsNullOrEmpty(_authorizationHeader) &&
|
||||
(DateTime.UtcNow.AddSeconds(60) < AuthenticationResult.ExpiresOn)) return _authorizationHeader;
|
||||
|
||||
if (!string.IsNullOrEmpty(_authorizationHeader) && (DateTime.UtcNow.AddSeconds(60) < AuthenticationResult.ExpiresOn))
|
||||
{
|
||||
return _authorizationHeader;
|
||||
}
|
||||
IConfidentialClientApplication appConfidential;
|
||||
IPublicClientApplication appPublic;
|
||||
var aosUriAuthUri = new Uri(_settings.AosUri);
|
||||
string authority = "https://login.microsoftonline.com/"+ _settings.AadTenant;
|
||||
string authority = AuthEndpoint + _settings.AadTenant;
|
||||
string[] scopes = new string[] { aosUriAuthUri.AbsoluteUri + ".default" };
|
||||
|
||||
if (_settings.UseServiceAuthentication)
|
||||
|
@ -69,7 +71,6 @@ namespace RecurringIntegrationsScheduler.Common.Helpers
|
|||
.Build();
|
||||
var accounts = await _retryPolicy.ExecuteAsync(() => appPublic.GetAccountsAsync());
|
||||
|
||||
|
||||
if (accounts.Any())
|
||||
{
|
||||
AuthenticationResult = await _retryPolicy.ExecuteAsync(() => appPublic.AcquireTokenSilent(scopes, accounts.FirstOrDefault()).ExecuteAsync());
|
||||
|
@ -78,8 +79,9 @@ namespace RecurringIntegrationsScheduler.Common.Helpers
|
|||
{
|
||||
using var securePassword = new SecureString();
|
||||
foreach (char c in _settings.UserPassword)
|
||||
{
|
||||
securePassword.AppendChar(c);
|
||||
|
||||
}
|
||||
AuthenticationResult = await _retryPolicy.ExecuteAsync(() => appPublic.AcquireTokenByUsernamePassword(scopes, _settings.UserName, securePassword).ExecuteAsync());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -247,6 +247,7 @@ namespace RecurringIntegrationsScheduler.Common.Helpers
|
|||
/// <returns>Boolean with operation result</returns>
|
||||
public static void Move(string sourceFilePath, string targetFilePath)
|
||||
{
|
||||
new FileInfo(targetFilePath).Directory.Create();//Create subfolders if necessary
|
||||
if (File.Exists(targetFilePath))
|
||||
{
|
||||
File.Delete(targetFilePath);
|
||||
|
|
|
@ -502,6 +502,31 @@ namespace RecurringIntegrationsScheduler.Common.Helpers
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get execution errors
|
||||
/// </summary>
|
||||
/// <param name="executionId">Execution Id</param>
|
||||
/// <returns></returns>
|
||||
public async Task<HttpResponseMessage> GetExecutionErrors(string executionId)
|
||||
{
|
||||
var requestUri = GetAosRequestUri(_settings.GetExecutionErrorsPath);
|
||||
|
||||
var parameters = new
|
||||
{
|
||||
executionId
|
||||
};
|
||||
string parametersJson = JsonConvert.SerializeObject(parameters, new JsonSerializerSettings { TypeNameHandling = TypeNameHandling.Auto });
|
||||
var response = await PostStringRequestAsync(requestUri, parametersJson);
|
||||
if (response.IsSuccessStatusCode)
|
||||
{
|
||||
return response;
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private Uri GetAosRequestUri(string requestRelativePath)
|
||||
{
|
||||
var aosUri = new Uri(_settings.AosUri);
|
||||
|
|
|
@ -89,7 +89,7 @@ namespace RecurringIntegrationsScheduler.Common.JobSettings
|
|||
|
||||
PackageTemplate = dataMap.GetString(SettingsConstants.PackageTemplate);
|
||||
|
||||
StatusCheckInterval = dataMap.GetInt(SettingsConstants.StatusCheckInterval);
|
||||
DelayBetweenStatusCheck = dataMap.GetInt(SettingsConstants.DelayBetweenStatusCheck);
|
||||
}
|
||||
|
||||
#region Members
|
||||
|
@ -148,7 +148,7 @@ namespace RecurringIntegrationsScheduler.Common.JobSettings
|
|||
/// <value>
|
||||
/// Delay between status checks.
|
||||
/// </value>
|
||||
public int StatusCheckInterval { get; private set; }
|
||||
public int DelayBetweenStatusCheck { get; private set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
|
|
@ -82,11 +82,7 @@ namespace RecurringIntegrationsScheduler.Common.JobSettings
|
|||
throw new JobExecutionException(string.Format(CultureInfo.InvariantCulture, Resources.Company_is_missing_in_job_configuration));
|
||||
}
|
||||
|
||||
StatusCheckInterval = dataMap.GetInt(SettingsConstants.StatusCheckInterval);
|
||||
if (StatusCheckInterval < 1) //Default status check interval is 1 second.
|
||||
{
|
||||
StatusCheckInterval = 1;
|
||||
}
|
||||
DelayBetweenStatusCheck = dataMap.GetInt(SettingsConstants.DelayBetweenStatusCheck);
|
||||
}
|
||||
|
||||
#region Members
|
||||
|
@ -153,7 +149,7 @@ namespace RecurringIntegrationsScheduler.Common.JobSettings
|
|||
/// <value>
|
||||
/// Delay between status checks.
|
||||
/// </value>
|
||||
public int StatusCheckInterval { get; private set; }
|
||||
public int DelayBetweenStatusCheck { get; private set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
|
|
@ -81,8 +81,14 @@ namespace RecurringIntegrationsScheduler.Common.JobSettings
|
|||
|
||||
ExecutionJobPresent = Convert.ToBoolean(dataMap.GetString(SettingsConstants.ExecutionJobPresent));
|
||||
|
||||
MultiCompanyImport = Convert.ToBoolean(dataMap.GetString(SettingsConstants.MultiCompanyImport));
|
||||
|
||||
GetLegalEntityFromSubfolder = Convert.ToBoolean(dataMap.GetString(SettingsConstants.GetLegalEntityFromSubfolder));
|
||||
|
||||
GetLegalEntityFromFilename = Convert.ToBoolean(dataMap.GetString(SettingsConstants.GetLegalEntityFromFilename));
|
||||
|
||||
Company = dataMap.GetString(SettingsConstants.Company);
|
||||
if (string.IsNullOrEmpty(Company))
|
||||
if (!MultiCompanyImport && string.IsNullOrEmpty(Company))
|
||||
{
|
||||
throw new JobExecutionException(string.Format(CultureInfo.InvariantCulture, Resources.Company_is_missing_in_job_configuration));
|
||||
}
|
||||
|
@ -135,6 +141,16 @@ namespace RecurringIntegrationsScheduler.Common.JobSettings
|
|||
throw new JobExecutionException(string.Format(CultureInfo.InvariantCulture, Resources.Verification_of_package_template_location_failed_0, PackageTemplate), ex);
|
||||
}
|
||||
}
|
||||
|
||||
FilenameSeparator = dataMap.GetString(SettingsConstants.FilenameSeparator);
|
||||
if (GetLegalEntityFromFilename && string.IsNullOrEmpty(FilenameSeparator))
|
||||
{
|
||||
throw new JobExecutionException(string.Format(CultureInfo.InvariantCulture, Resources.no_separator));
|
||||
}
|
||||
|
||||
LegalEntityTokenPosition = dataMap.GetInt(SettingsConstants.LegalEntityTokenPosition);
|
||||
|
||||
InputFilesArePackages = Convert.ToBoolean(dataMap.GetString(SettingsConstants.InputFilesArePackages));
|
||||
}
|
||||
|
||||
#region Members
|
||||
|
@ -242,7 +258,55 @@ namespace RecurringIntegrationsScheduler.Common.JobSettings
|
|||
/// Package template location.
|
||||
/// </value>
|
||||
public string PackageTemplate { get; private set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Multicompany import.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// Multicompany import.
|
||||
/// </value>
|
||||
public bool MultiCompanyImport { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Get target legal entity from subfolder name.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// Get target legal entity from subfolder name.
|
||||
/// </value>
|
||||
public bool GetLegalEntityFromSubfolder { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Get target legal entity from file name.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// Get target legal entity from file name.
|
||||
/// </value>
|
||||
public bool GetLegalEntityFromFilename { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Separator in file name to get legal entity.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// Separator in file name to get legal entity.
|
||||
/// </value>
|
||||
public string FilenameSeparator { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Position of legal entity token in splitted file name.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// Position of legal entity token in splitted file name.
|
||||
/// </value>
|
||||
public int LegalEntityTokenPosition { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Input files are packages.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// Input files are packages.
|
||||
/// </value>
|
||||
public bool InputFilesArePackages { get; private set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -93,7 +93,7 @@ namespace RecurringIntegrationsScheduler.Common.JobSettings
|
|||
throw new JobExecutionException(string.Format(CultureInfo.InvariantCulture, Resources.Extension_of_status_files_is_missing_in_job_configuration));
|
||||
}
|
||||
|
||||
StatusCheckInterval = dataMap.GetInt(SettingsConstants.StatusCheckInterval);
|
||||
StatusCheckInterval = dataMap.GetInt(SettingsConstants.DelayBetweenStatusCheck);
|
||||
}
|
||||
|
||||
#region Members
|
||||
|
|
|
@ -79,11 +79,7 @@ namespace RecurringIntegrationsScheduler.Common.JobSettings
|
|||
UserPassword = EncryptDecrypt.Decrypt(UserPassword);
|
||||
}
|
||||
|
||||
Interval = dataMap.GetInt(SettingsConstants.Interval);
|
||||
if (Interval < 1) //Default execution interval is 1 second.
|
||||
{
|
||||
Interval = 1;
|
||||
}
|
||||
DelayBetweenFiles = dataMap.GetInt(SettingsConstants.DelayBetweenFiles);
|
||||
|
||||
RetryCount = dataMap.GetInt(SettingsConstants.RetryCount);
|
||||
if (RetryCount == 0)
|
||||
|
@ -94,7 +90,7 @@ namespace RecurringIntegrationsScheduler.Common.JobSettings
|
|||
RetryDelay = dataMap.GetInt(SettingsConstants.RetryDelay);
|
||||
if (RetryDelay == 0)
|
||||
{
|
||||
RetryDelay = 60; //seconds
|
||||
RetryDelay = 10; //seconds
|
||||
}
|
||||
|
||||
PauseJobOnException = Convert.ToBoolean(dataMap.GetString(SettingsConstants.PauseJobOnException));
|
||||
|
@ -166,6 +162,14 @@ namespace RecurringIntegrationsScheduler.Common.JobSettings
|
|||
{
|
||||
GenerateImportTargetErrorKeysFilePath = OdataActionsConstants.GenerateImportTargetErrorKeysFilePath;
|
||||
}
|
||||
|
||||
GetExecutionErrorsPath = dataMap.GetString(SettingsConstants.GetExecutionErrorsPath);
|
||||
if (string.IsNullOrEmpty(GetExecutionErrorsPath))
|
||||
{
|
||||
GetExecutionErrorsPath = OdataActionsConstants.GetExecutionErrorsPath;
|
||||
}
|
||||
|
||||
GetExecutionErrors = Convert.ToBoolean(dataMap.GetString(SettingsConstants.GetExecutionErrors));
|
||||
}
|
||||
|
||||
#region Members
|
||||
|
@ -240,7 +244,7 @@ namespace RecurringIntegrationsScheduler.Common.JobSettings
|
|||
/// <value>
|
||||
/// The execution interval.
|
||||
/// </value>
|
||||
public int Interval { get; private set; }
|
||||
public int DelayBetweenFiles { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets retry count.
|
||||
|
@ -264,7 +268,7 @@ namespace RecurringIntegrationsScheduler.Common.JobSettings
|
|||
/// <value>
|
||||
/// <c>true</c> if [pause job when exception occurs]; otherwise, <c>false</c>.
|
||||
/// </value>
|
||||
public bool PauseJobOnException { get; set; }
|
||||
public bool PauseJobOnException { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the job is paused indefinitely or not.
|
||||
|
@ -272,7 +276,7 @@ namespace RecurringIntegrationsScheduler.Common.JobSettings
|
|||
/// <value>
|
||||
/// <c>true</c> if [pause job indefinitely]; otherwise, <c>false</c>.
|
||||
/// </value>
|
||||
public bool IndefinitePause { get; set; }
|
||||
public bool IndefinitePause { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Get the ImportFromPackage Odata action relative path
|
||||
|
@ -362,6 +366,21 @@ namespace RecurringIntegrationsScheduler.Common.JobSettings
|
|||
/// </value>
|
||||
public string GenerateImportTargetErrorKeysFilePath { get; private set; } = OdataActionsConstants.GenerateImportTargetErrorKeysFilePath;
|
||||
|
||||
/// <summary>
|
||||
/// Get the GetExecutionErrors Odata action relative path
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// The relative path to the GetExecutionErrors Odata action
|
||||
/// </value>
|
||||
public string GetExecutionErrorsPath { get; private set; } = OdataActionsConstants.GetExecutionErrorsPath;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether to retrieve execution errors.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// <c>true</c> if [gt executon errors]; otherwise, <c>false</c>.
|
||||
/// </value>
|
||||
public bool GetExecutionErrors { get; private set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
|
|
@ -105,8 +105,6 @@ namespace RecurringIntegrationsScheduler.Common.JobSettings
|
|||
throw new JobExecutionException(string.Format(CultureInfo.InvariantCulture, Resources.Extension_of_status_files_is_missing_in_job_configuration));
|
||||
}
|
||||
|
||||
ProcessingJobPresent = Convert.ToBoolean(dataMap.GetString(SettingsConstants.ProcessingJobPresent));
|
||||
|
||||
SearchPattern = dataMap.GetString(SettingsConstants.SearchPattern);
|
||||
if (string.IsNullOrEmpty(SearchPattern))
|
||||
{
|
||||
|
|
|
@ -19,7 +19,7 @@ namespace RecurringIntegrationsScheduler.Common.Properties {
|
|||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
@ -285,6 +285,15 @@ namespace RecurringIntegrationsScheduler.Common.Properties {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Job is configured to get target legal entity from file name, but no separator was configured..
|
||||
/// </summary>
|
||||
internal static string no_separator {
|
||||
get {
|
||||
return ResourceManager.GetString("no_separator", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Package template: {0} was not found!.
|
||||
/// </summary>
|
||||
|
|
|
@ -234,4 +234,7 @@
|
|||
<data name="GetAzureWriteUrl_returned_empty_string_Check_previous_errors" xml:space="preserve">
|
||||
<value>Method GetAzureWriteUrl returned empty string. Check previous errors.</value>
|
||||
</data>
|
||||
<data name="no_separator" xml:space="preserve">
|
||||
<value>Job is configured to get target legal entity from file name, but no separator was configured.</value>
|
||||
</data>
|
||||
</root>
|
|
@ -235,9 +235,9 @@ namespace RecurringIntegrationsScheduler.Job
|
|||
|
||||
using (var downloadedStream = await response.Content.ReadAsStreamAsync())
|
||||
{
|
||||
if(fileCount > 0 && _settings.Interval > 0) //Only delay after first file and never after last.
|
||||
if(fileCount > 0 && _settings.DelayBetweenFiles > 0) //Only delay after first file and never after last.
|
||||
{
|
||||
System.Threading.Thread.Sleep(_settings.Interval * 1000);
|
||||
System.Threading.Thread.Sleep(TimeSpan.FromSeconds(_settings.DelayBetweenFiles));
|
||||
}
|
||||
fileCount++;
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
using log4net;
|
||||
using Polly;
|
||||
using Quartz;
|
||||
using Quartz.Util;
|
||||
using RecurringIntegrationsScheduler.Common.Contracts;
|
||||
using RecurringIntegrationsScheduler.Common.Helpers;
|
||||
using RecurringIntegrationsScheduler.Common.JobSettings;
|
||||
|
@ -186,9 +185,9 @@ namespace RecurringIntegrationsScheduler.Job
|
|||
|
||||
while (EnqueuedJobs.TryDequeue(out DataMessage dataMessage))
|
||||
{
|
||||
if (fileCount > 0 && _settings.StatusCheckInterval > 0) //Only delay after first file and never after last.
|
||||
if (fileCount > 0 && _settings.DelayBetweenStatusCheck > 0) //Only delay after first file and never after last.
|
||||
{
|
||||
System.Threading.Thread.Sleep(_settings.StatusCheckInterval * 1000);
|
||||
System.Threading.Thread.Sleep(TimeSpan.FromSeconds(_settings.DelayBetweenStatusCheck));
|
||||
}
|
||||
fileCount++;
|
||||
|
||||
|
@ -217,7 +216,7 @@ namespace RecurringIntegrationsScheduler.Job
|
|||
case "Succeeded":
|
||||
{
|
||||
// Move message file and delete processing status file
|
||||
var processingSuccessDestination = Path.Combine(_settings.ProcessingSuccessDir, dataMessage.Name);
|
||||
var processingSuccessDestination = dataMessage.FullPath.Replace(_settings.UploadSuccessDir, _settings.ProcessingSuccessDir);
|
||||
_retryPolicyForIo.Execute(() => FileOperationsHelper.MoveDataToTarget(dataMessage.FullPath, processingSuccessDestination, true, _settings.StatusFileExtension));
|
||||
await CreateLinkToExecutionSummaryPage(dataMessage.MessageId, processingSuccessDestination);
|
||||
}
|
||||
|
@ -227,7 +226,7 @@ namespace RecurringIntegrationsScheduler.Job
|
|||
case "Failed":
|
||||
case "Canceled":
|
||||
{
|
||||
var processingErrorDestination = Path.Combine(_settings.ProcessingErrorsDir, dataMessage.Name);
|
||||
var processingErrorDestination = dataMessage.FullPath.Replace(_settings.UploadSuccessDir, _settings.ProcessingErrorsDir);
|
||||
_retryPolicyForIo.Execute(() => FileOperationsHelper.MoveDataToTarget(dataMessage.FullPath, processingErrorDestination, true, _settings.StatusFileExtension));
|
||||
await CreateLinkToExecutionSummaryPage(dataMessage.MessageId, processingErrorDestination);
|
||||
if (_settings.GetImportTargetErrorKeysFile)
|
||||
|
@ -257,7 +256,7 @@ namespace RecurringIntegrationsScheduler.Job
|
|||
errorFileUrl = await _httpClientHelper.GetImportTargetErrorKeysFileUrl(dataMessage.MessageId, entity);
|
||||
if (errorFileUrl.Length == 0)
|
||||
{
|
||||
System.Threading.Thread.Sleep(_settings.Interval);
|
||||
System.Threading.Thread.Sleep(TimeSpan.FromSeconds(_settings.DelayBetweenStatusCheck));//TODO
|
||||
}
|
||||
}
|
||||
while (string.IsNullOrEmpty(errorFileUrl));
|
||||
|
@ -268,7 +267,7 @@ namespace RecurringIntegrationsScheduler.Job
|
|||
|
||||
using Stream downloadedStream = await response.Content.ReadAsStreamAsync();
|
||||
var errorsFileName = $"{Path.GetFileNameWithoutExtension(dataMessage.Name)}-{entity}-ErrorKeys-{DateTime.Now:yyyy-MM-dd_HH-mm-ss-ffff}.txt";
|
||||
var errorsFilePath = Path.Combine(_settings.ProcessingErrorsDir, errorsFileName);
|
||||
var errorsFilePath = Path.Combine(Path.GetDirectoryName(dataMessage.FullPath.Replace(_settings.UploadSuccessDir, _settings.ProcessingErrorsDir)), errorsFileName);
|
||||
var dataMessageForErrorsFile = new DataMessage()
|
||||
{
|
||||
FullPath = errorsFilePath,
|
||||
|
@ -279,6 +278,28 @@ namespace RecurringIntegrationsScheduler.Job
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (_settings.GetExecutionErrors)
|
||||
{
|
||||
if (Log.IsDebugEnabled)
|
||||
{
|
||||
Log.DebugFormat(CultureInfo.InvariantCulture, string.Format(Resources.Job_0_Trying_to_download_execution_errors, _context.JobDetail.Key));
|
||||
}
|
||||
var response = await _httpClientHelper.GetExecutionErrors(dataMessage.MessageId);
|
||||
if (!response.IsSuccessStatusCode)
|
||||
throw new JobExecutionException(string.Format(Resources.Job_0_download_of_execution_errors_failed_1, _context.JobDetail.Key, string.Format($"Status: {response.StatusCode}. Message: {response.Content}")));
|
||||
|
||||
using Stream downloadedStream = await response.Content.ReadAsStreamAsync();
|
||||
var errorsFileName = $"{Path.GetFileNameWithoutExtension(dataMessage.Name)}-ExecutionErrors-{DateTime.Now:yyyy-MM-dd_HH-mm-ss-ffff}.txt";
|
||||
var errorsFilePath = Path.Combine(Path.GetDirectoryName(dataMessage.FullPath.Replace(_settings.UploadSuccessDir, _settings.ProcessingErrorsDir)), errorsFileName);
|
||||
var dataMessageForErrorsFile = new DataMessage()
|
||||
{
|
||||
FullPath = errorsFilePath,
|
||||
Name = errorsFileName,
|
||||
MessageStatus = MessageStatus.Failed
|
||||
};
|
||||
_retryPolicyForIo.Execute(() => FileOperationsHelper.Create(downloadedStream, dataMessageForErrorsFile.FullPath));
|
||||
}
|
||||
}
|
||||
break;
|
||||
default: //"NotRun", "Executing"
|
||||
|
|
|
@ -96,6 +96,15 @@ namespace RecurringIntegrationsScheduler.Job.Properties {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Job: {0} Download of execution errors failed. {1}.
|
||||
/// </summary>
|
||||
internal static string Job_0_download_of_execution_errors_failed_1 {
|
||||
get {
|
||||
return ResourceManager.GetString("Job_0_download_of_execution_errors_failed_1", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Job: {0} ended..
|
||||
/// </summary>
|
||||
|
@ -222,6 +231,15 @@ namespace RecurringIntegrationsScheduler.Job.Properties {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Job: {0} Trying to download execution errors..
|
||||
/// </summary>
|
||||
internal static string Job_0_Trying_to_download_execution_errors {
|
||||
get {
|
||||
return ResourceManager.GetString("Job_0_Trying_to_download_execution_errors", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Job: {0} was paused because of an error..
|
||||
/// </summary>
|
||||
|
|
|
@ -177,4 +177,10 @@
|
|||
<data name="Job_0_Looking_for_data_entities_in_manifest_file_1" xml:space="preserve">
|
||||
<value>Job: {0}. Looking for data entities in manifest file {1}.</value>
|
||||
</data>
|
||||
<data name="Job_0_Trying_to_download_execution_errors" xml:space="preserve">
|
||||
<value>Job: {0} Trying to download execution errors.</value>
|
||||
</data>
|
||||
<data name="Job_0_download_of_execution_errors_failed_1" xml:space="preserve">
|
||||
<value>Job: {0} Download of execution errors failed. {1}</value>
|
||||
</data>
|
||||
</root>
|
|
@ -159,9 +159,9 @@ namespace RecurringIntegrationsScheduler.Job
|
|||
var attempt = 0;
|
||||
do
|
||||
{
|
||||
if (attempt > 0 && _settings.StatusCheckInterval > 0) //Only delay after first file and never after last.
|
||||
if (attempt > 0 && _settings.DelayBetweenStatusCheck > 0) //Only delay after first file and never after last.
|
||||
{
|
||||
System.Threading.Thread.Sleep(_settings.StatusCheckInterval * 1000);
|
||||
System.Threading.Thread.Sleep(TimeSpan.FromSeconds(_settings.DelayBetweenStatusCheck));
|
||||
}
|
||||
attempt++;
|
||||
|
||||
|
@ -181,9 +181,9 @@ namespace RecurringIntegrationsScheduler.Job
|
|||
Uri packageUrl = null;
|
||||
do
|
||||
{
|
||||
if (attempt > 0 && _settings.Interval > 0) //Only delay after first file and never after last.
|
||||
if (attempt > 0 && _settings.DelayBetweenFiles > 0) //Only delay after first file and never after last.
|
||||
{
|
||||
System.Threading.Thread.Sleep(_settings.Interval * 1000);
|
||||
System.Threading.Thread.Sleep(TimeSpan.FromSeconds(_settings.DelayBetweenFiles));
|
||||
}
|
||||
attempt++;
|
||||
|
||||
|
|
|
@ -188,14 +188,14 @@ namespace RecurringIntegrationsScheduler.Job
|
|||
using (_httpClientHelper = new HttpClientHelper(_settings, _retryPolicyForHttp))
|
||||
{
|
||||
var fileCount = 0;
|
||||
string fileNameInPackage = "";
|
||||
string fileNameInPackageTemplate = "";
|
||||
FileStream zipToOpen = null;
|
||||
ZipArchive archive = null;
|
||||
|
||||
if (!string.IsNullOrEmpty(_settings.PackageTemplate))
|
||||
if (_settings.InputFilesArePackages == false)
|
||||
{
|
||||
fileNameInPackage = GetFileNameInPackage();
|
||||
if (string.IsNullOrEmpty(fileNameInPackage))
|
||||
fileNameInPackageTemplate = GetFileNameInPackageTemplate();
|
||||
if (string.IsNullOrEmpty(fileNameInPackageTemplate))
|
||||
{
|
||||
throw new Exception(string.Format(Resources.Job_0_Please_check_your_package_template_Input_file_name_in_Manifest_cannot_be_identified, _context.JobDetail.Key));
|
||||
}
|
||||
|
@ -205,9 +205,9 @@ namespace RecurringIntegrationsScheduler.Job
|
|||
{
|
||||
try
|
||||
{
|
||||
if (fileCount > 0 && _settings.Interval > 0) //Only delay after first file and never after last.
|
||||
if (fileCount > 0 && _settings.DelayBetweenFiles > 0) //Only delay after first file and never after last.
|
||||
{
|
||||
System.Threading.Thread.Sleep(_settings.Interval * 1000);
|
||||
System.Threading.Thread.Sleep(TimeSpan.FromSeconds(_settings.DelayBetweenFiles));
|
||||
}
|
||||
fileCount++;
|
||||
|
||||
|
@ -217,7 +217,7 @@ namespace RecurringIntegrationsScheduler.Job
|
|||
string tempFileName = "";
|
||||
|
||||
//If we need to "wrap" file in package envelope
|
||||
if (!string.IsNullOrEmpty(_settings.PackageTemplate))
|
||||
if (_settings.InputFilesArePackages == false)
|
||||
{
|
||||
using (zipToOpen = new FileStream(_settings.PackageTemplate, FileMode.Open))
|
||||
{
|
||||
|
@ -227,17 +227,17 @@ namespace RecurringIntegrationsScheduler.Job
|
|||
using (archive = new ZipArchive(tempZipStream, ZipArchiveMode.Update))
|
||||
{
|
||||
//Check if package template contains input file and remove it first. It should not be there in the first place.
|
||||
ZipArchiveEntry entry = archive.GetEntry(fileNameInPackage);
|
||||
ZipArchiveEntry entry = archive.GetEntry(fileNameInPackageTemplate);
|
||||
if (entry != null)
|
||||
{
|
||||
entry.Delete();
|
||||
Log.WarnFormat(CultureInfo.InvariantCulture, string.Format(Resources.Job_0_Package_template_contains_input_file_1_Please_remove_it_from_the_template, _context.JobDetail.Key, fileNameInPackage));
|
||||
Log.WarnFormat(CultureInfo.InvariantCulture, string.Format(Resources.Job_0_Package_template_contains_input_file_1_Please_remove_it_from_the_template, _context.JobDetail.Key, fileNameInPackageTemplate));
|
||||
}
|
||||
|
||||
// Update Manifest file with the original file name for end-to-end traceability. Use the new file name in the rest of the method.
|
||||
fileNameInPackage = UpdateManifestFile(archive, dataMessage, fileNameInPackage);
|
||||
fileNameInPackageTemplate = UpdateManifestFile(archive, dataMessage, fileNameInPackageTemplate);
|
||||
|
||||
var importedFile = archive.CreateEntry(fileNameInPackage, CompressionLevel.Fastest);
|
||||
var importedFile = archive.CreateEntry(fileNameInPackageTemplate, CompressionLevel.Fastest);
|
||||
using var entryStream = importedFile.Open();
|
||||
sourceStream.CopyTo(entryStream);
|
||||
sourceStream.Close();
|
||||
|
@ -253,7 +253,7 @@ namespace RecurringIntegrationsScheduler.Job
|
|||
var response = await _httpClientHelper.GetAzureWriteUrl();
|
||||
if(string.IsNullOrEmpty(response))
|
||||
{
|
||||
Log.ErrorFormat(CultureInfo.InvariantCulture, "Method GetAzureWriteUrl returned empty string");
|
||||
Log.ErrorFormat(CultureInfo.InvariantCulture, string.Format(Resources.Job_0_Method_GetAzureWriteUrl_returned_empty_string, _context.JobDetail.Key));
|
||||
continue;
|
||||
}
|
||||
var blobInfo = (JObject)JsonConvert.DeserializeObject(response);
|
||||
|
@ -263,11 +263,12 @@ namespace RecurringIntegrationsScheduler.Job
|
|||
|
||||
//Upload package to blob storage
|
||||
var uploadResponse = await _httpClientHelper.UploadContentsToBlob(blobUri, sourceStream);
|
||||
|
||||
if (sourceStream != null)
|
||||
{
|
||||
sourceStream.Close();
|
||||
sourceStream.Dispose();
|
||||
if (!string.IsNullOrEmpty(_settings.PackageTemplate))
|
||||
if (!_settings.InputFilesArePackages)//if we wraped file in package envelop we need to delete temp file
|
||||
{
|
||||
_retryPolicyForIo.Execute(() => FileOperationsHelper.Delete(tempFileName));
|
||||
}
|
||||
|
@ -275,7 +276,30 @@ namespace RecurringIntegrationsScheduler.Job
|
|||
if (uploadResponse.IsSuccessStatusCode)
|
||||
{
|
||||
//Now send import request
|
||||
var importResponse = await _httpClientHelper.ImportFromPackage(blobUri.AbsoluteUri, _settings.DataProject, CreateExecutionId(_settings.DataProject), _settings.ExecuteImport, _settings.OverwriteDataProject, _settings.Company);
|
||||
var targetLegalEntity = _settings.Company;
|
||||
if (_settings.GetLegalEntityFromSubfolder)
|
||||
{
|
||||
targetLegalEntity = new FileInfo(dataMessage.FullPath).Directory.Name;
|
||||
}
|
||||
if (_settings.GetLegalEntityFromFilename)
|
||||
{
|
||||
String[] separator = { _settings.FilenameSeparator };
|
||||
var tokenList = dataMessage.Name.Split(separator, 10, StringSplitOptions.RemoveEmptyEntries);
|
||||
|
||||
targetLegalEntity = tokenList[_settings.LegalEntityTokenPosition - 1];
|
||||
}
|
||||
if(targetLegalEntity.Length > 4)
|
||||
{
|
||||
Log.ErrorFormat(CultureInfo.InvariantCulture, string.Format(Resources.Job_0_Target_legal_entity_is_not_valid_1, _context.JobDetail.Key, targetLegalEntity));
|
||||
}
|
||||
|
||||
|
||||
if(string.IsNullOrEmpty(targetLegalEntity))
|
||||
{
|
||||
throw new Exception(string.Format(Resources.Job_0_Unable_to_get_target_legal_entity_name, _context.JobDetail.Key));
|
||||
}
|
||||
var executionIdGenerated = CreateExecutionId(_settings.DataProject);
|
||||
var importResponse = await _httpClientHelper.ImportFromPackage(blobUri.AbsoluteUri, _settings.DataProject, executionIdGenerated, _settings.ExecuteImport, _settings.OverwriteDataProject, targetLegalEntity);
|
||||
|
||||
if (importResponse.IsSuccessStatusCode)
|
||||
{
|
||||
|
@ -301,7 +325,7 @@ namespace RecurringIntegrationsScheduler.Job
|
|||
else
|
||||
{
|
||||
// import request failed. Move message to error location.
|
||||
Log.ErrorFormat(CultureInfo.InvariantCulture, string.Format(Resources.Job_0_Upload_failed_for_file_1_Failure_response_Status_2_Reason_3, _context.JobDetail.Key, dataMessage.FullPath.Replace(@"{", @"{{").Replace(@"}", @"}}"), importResponse.StatusCode, importResponse.ReasonPhrase));
|
||||
Log.ErrorFormat(CultureInfo.InvariantCulture, string.Format(Resources.Job_0_Upload_failed_for_file_1_Failure_response_Status_2_Reason_3, _context.JobDetail.Key, dataMessage.FullPath.Replace(@"{", @"{{").Replace(@"}", @"}}"), importResponse.StatusCode, importResponse.ReasonPhrase, $"{Environment.NewLine}packageUrl: {blobUri.AbsoluteUri}{Environment.NewLine}definitionGroupId: {_settings.DataProject}{Environment.NewLine}executionId: {executionIdGenerated}{Environment.NewLine}execute: {_settings.ExecuteImport.ToString()}{Environment.NewLine}overwrite: {_settings.OverwriteDataProject.ToString()}{Environment.NewLine}legalEntityId: {targetLegalEntity}"));
|
||||
|
||||
var targetDataMessage = new DataMessage(dataMessage)
|
||||
{
|
||||
|
@ -352,7 +376,7 @@ namespace RecurringIntegrationsScheduler.Job
|
|||
}
|
||||
}
|
||||
|
||||
private string GetFileNameInPackage()
|
||||
private string GetFileNameInPackageTemplate()
|
||||
{
|
||||
using var package = ZipFile.OpenRead(_settings.PackageTemplate);
|
||||
foreach (var entry in package.Entries)
|
||||
|
@ -404,9 +428,11 @@ namespace RecurringIntegrationsScheduler.Job
|
|||
tempXmlDocManifest.SelectSingleNode("//InputFilePath[1]").InnerText = Path.GetFileName(dataMessage.FullPath);
|
||||
|
||||
// Save the document to a file and auto-indent the output.
|
||||
using XmlTextWriter writer = new XmlTextWriter(tempManifestFileNameNew, null);
|
||||
writer.Namespaces = false;
|
||||
writer.Formatting = System.Xml.Formatting.Indented;
|
||||
using XmlTextWriter writer = new XmlTextWriter(tempManifestFileNameNew, null)
|
||||
{
|
||||
Namespaces = false,
|
||||
Formatting = System.Xml.Formatting.Indented
|
||||
};
|
||||
tempXmlDocManifest.Save(writer);
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ namespace RecurringIntegrationsScheduler.Job.Properties {
|
|||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
@ -141,6 +141,15 @@ namespace RecurringIntegrationsScheduler.Job.Properties {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Job: {0}. Method GetAzureWriteUrl returned empty string.
|
||||
/// </summary>
|
||||
internal static string Job_0_Method_GetAzureWriteUrl_returned_empty_string {
|
||||
get {
|
||||
return ResourceManager.GetString("Job_0_Method_GetAzureWriteUrl_returned_empty_string", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Job: {0} Package template contains input file: {1}. Please remove it from the template..
|
||||
/// </summary>
|
||||
|
@ -196,6 +205,15 @@ namespace RecurringIntegrationsScheduler.Job.Properties {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Job: {0}. Target legal entity is not valid: {1}.
|
||||
/// </summary>
|
||||
internal static string Job_0_Target_legal_entity_is_not_valid_1 {
|
||||
get {
|
||||
return ResourceManager.GetString("Job_0_Target_legal_entity_is_not_valid_1", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Job: {0} thrown an error. Exception : {1}.
|
||||
/// </summary>
|
||||
|
@ -206,7 +224,16 @@ namespace RecurringIntegrationsScheduler.Job.Properties {
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Job: {0}. Upload failed for file: {1}. Failure response: Status: {2}, Reason: {3}.
|
||||
/// Looks up a localized string similar to Job: {0}. Unable to get target legal entity name. Check job configuration..
|
||||
/// </summary>
|
||||
internal static string Job_0_Unable_to_get_target_legal_entity_name {
|
||||
get {
|
||||
return ResourceManager.GetString("Job_0_Unable_to_get_target_legal_entity_name", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Job: {0}. Upload failed for file: {1}. Failure response: Status: {2}, Reason: {3}. ImportFromPackage failed request's parameters: {4}.
|
||||
/// </summary>
|
||||
internal static string Job_0_Upload_failed_for_file_1_Failure_response_Status_2_Reason_3 {
|
||||
get {
|
||||
|
|
|
@ -139,7 +139,7 @@
|
|||
<value>Job: {0}. File: {1} - uploaded successfully.</value>
|
||||
</data>
|
||||
<data name="Job_0_Upload_failed_for_file_1_Failure_response_Status_2_Reason_3" xml:space="preserve">
|
||||
<value>Job: {0}. Upload failed for file: {1}. Failure response: Status: {2}, Reason: {3}</value>
|
||||
<value>Job: {0}. Upload failed for file: {1}. Failure response: Status: {2}, Reason: {3}. ImportFromPackage failed request's parameters: {4}</value>
|
||||
</data>
|
||||
<data name="Job_0_Failure_processing_file_1_Exception_2" xml:space="preserve">
|
||||
<value>Job: {0}. Failure processing file: {1} Exception : {2}</value>
|
||||
|
@ -177,4 +177,13 @@
|
|||
<data name="Job_0_Please_check_your_package_template_Input_file_name_in_Manifest_cannot_be_identified" xml:space="preserve">
|
||||
<value>Job: {0} Please check your package template. Input file name in Manifest cannot be identified.</value>
|
||||
</data>
|
||||
<data name="Job_0_Unable_to_get_target_legal_entity_name" xml:space="preserve">
|
||||
<value>Job: {0}. Unable to get target legal entity name. Check job configuration.</value>
|
||||
</data>
|
||||
<data name="Job_0_Method_GetAzureWriteUrl_returned_empty_string" xml:space="preserve">
|
||||
<value>Job: {0}. Method GetAzureWriteUrl returned empty string</value>
|
||||
</data>
|
||||
<data name="Job_0_Target_legal_entity_is_not_valid_1" xml:space="preserve">
|
||||
<value>Job: {0}. Target legal entity is not valid: {1}</value>
|
||||
</data>
|
||||
</root>
|
|
@ -183,7 +183,7 @@ namespace RecurringIntegrationsScheduler.Job
|
|||
{
|
||||
if (fileCount > 0 && _settings.StatusCheckInterval > 0) //Only delay after first file and never after last.
|
||||
{
|
||||
System.Threading.Thread.Sleep(_settings.StatusCheckInterval * 1000);
|
||||
System.Threading.Thread.Sleep(TimeSpan.FromSeconds(_settings.StatusCheckInterval));
|
||||
}
|
||||
fileCount++;
|
||||
|
||||
|
@ -192,7 +192,7 @@ namespace RecurringIntegrationsScheduler.Job
|
|||
|
||||
// If status was found and is not null,
|
||||
if (jobStatusDetail != null)
|
||||
PostProcessMessage(jobStatusDetail, dataMessage);
|
||||
await PostProcessMessage(jobStatusDetail, dataMessage);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -202,7 +202,7 @@ namespace RecurringIntegrationsScheduler.Job
|
|||
/// </summary>
|
||||
/// <param name="jobStatusDetail">DataJobStatusDetail object</param>
|
||||
/// <param name="dataMessage">Name of the file whose status is being processed</param>
|
||||
private void PostProcessMessage(DataJobStatusDetail jobStatusDetail, DataMessage dataMessage)
|
||||
private async Task PostProcessMessage(DataJobStatusDetail jobStatusDetail, DataMessage dataMessage)
|
||||
{
|
||||
if (jobStatusDetail?.DataJobStatus == null)
|
||||
return;
|
||||
|
@ -231,6 +231,28 @@ namespace RecurringIntegrationsScheduler.Job
|
|||
};
|
||||
_retryPolicyForIo.Execute(() => FileOperationsHelper.MoveDataToTarget(dataMessage.FullPath, targetDataMessage.FullPath));
|
||||
_retryPolicyForIo.Execute(() => FileOperationsHelper.WriteStatusLogFile(jobStatusDetail, targetDataMessage, null, _settings.StatusFileExtension));
|
||||
|
||||
if (_settings.GetExecutionErrors)
|
||||
{
|
||||
if (Log.IsDebugEnabled)
|
||||
{
|
||||
Log.DebugFormat(CultureInfo.InvariantCulture, string.Format(Resources.Job_0_Trying_to_download_execution_errors, _context.JobDetail.Key));
|
||||
}
|
||||
var response = await _httpClientHelper.GetExecutionErrors(dataMessage.MessageId);
|
||||
if (!response.IsSuccessStatusCode)
|
||||
throw new JobExecutionException(string.Format(Resources.Job_0_download_of_execution_errors_failed_1, _context.JobDetail.Key, string.Format($"Status: {response.StatusCode}. Message: {response.Content}")));
|
||||
|
||||
using Stream downloadedStream = await response.Content.ReadAsStreamAsync();
|
||||
var errorsFileName = $"{Path.GetFileNameWithoutExtension(dataMessage.Name)}-ExecutionErrors-{DateTime.Now:yyyy-MM-dd_HH-mm-ss-ffff}.txt";
|
||||
var errorsFilePath = Path.Combine(Path.GetDirectoryName(dataMessage.FullPath.Replace(_settings.UploadSuccessDir, _settings.ProcessingErrorsDir)), errorsFileName);
|
||||
var dataMessageForErrorsFile = new DataMessage()
|
||||
{
|
||||
FullPath = errorsFilePath,
|
||||
Name = errorsFileName,
|
||||
MessageStatus = MessageStatus.Failed
|
||||
};
|
||||
_retryPolicyForIo.Execute(() => FileOperationsHelper.Create(downloadedStream, dataMessageForErrorsFile.FullPath));
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ namespace RecurringIntegrationsScheduler.Job.Properties {
|
|||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
@ -69,6 +69,15 @@ namespace RecurringIntegrationsScheduler.Job.Properties {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Job: {0} Download of execution errors failed. {1}.
|
||||
/// </summary>
|
||||
internal static string Job_0_download_of_execution_errors_failed_1 {
|
||||
get {
|
||||
return ResourceManager.GetString("Job_0_download_of_execution_errors_failed_1", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Job: {0} ended..
|
||||
/// </summary>
|
||||
|
@ -168,6 +177,15 @@ namespace RecurringIntegrationsScheduler.Job.Properties {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Job: {0} Trying to download execution errors..
|
||||
/// </summary>
|
||||
internal static string Job_0_Trying_to_download_execution_errors {
|
||||
get {
|
||||
return ResourceManager.GetString("Job_0_Trying_to_download_execution_errors", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Job: {0} was paused because of an error..
|
||||
/// </summary>
|
||||
|
|
|
@ -162,4 +162,10 @@
|
|||
<data name="Job_0_was_paused_indefinitely" xml:space="preserve">
|
||||
<value>Job: {0} was paused indefinitely.</value>
|
||||
</data>
|
||||
<data name="Job_0_download_of_execution_errors_failed_1" xml:space="preserve">
|
||||
<value>Job: {0} Download of execution errors failed. {1}</value>
|
||||
</data>
|
||||
<data name="Job_0_Trying_to_download_execution_errors" xml:space="preserve">
|
||||
<value>Job: {0} Trying to download execution errors.</value>
|
||||
</data>
|
||||
</root>
|
|
@ -188,9 +188,9 @@ namespace RecurringIntegrationsScheduler.Job
|
|||
{
|
||||
try
|
||||
{
|
||||
if (fileCount > 0 && _settings.Interval > 0) //Only delay after first file and never after last.
|
||||
if (fileCount > 0 && _settings.DelayBetweenFiles > 0) //Only delay after first file and never after last.
|
||||
{
|
||||
System.Threading.Thread.Sleep(_settings.Interval * 1000);
|
||||
System.Threading.Thread.Sleep(TimeSpan.FromSeconds(_settings.DelayBetweenFiles));
|
||||
}
|
||||
fileCount++;
|
||||
|
||||
|
@ -217,7 +217,7 @@ namespace RecurringIntegrationsScheduler.Job
|
|||
MessageStatus = MessageStatus.Enqueued
|
||||
};
|
||||
|
||||
// Move to inprocess/success location
|
||||
// Move to success location
|
||||
_retryPolicyForIo.Execute(() => FileOperationsHelper.Move(dataMessage.FullPath, targetDataMessage.FullPath));
|
||||
|
||||
if (_settings.ProcessingJobPresent)
|
||||
|
|
|
@ -100,7 +100,8 @@
|
|||
</setting>
|
||||
<setting name="DataJobs" serializeAs="Xml">
|
||||
<value>
|
||||
<ArrayOfDataJob xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
<ArrayOfDataJob xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
<DataJob>
|
||||
<Name>Customers import</Name>
|
||||
<ActivityId>00000000-0000-0000-0000-000000000000</ActivityId>
|
||||
|
@ -112,7 +113,8 @@
|
|||
</setting>
|
||||
<setting name="Instances" serializeAs="Xml">
|
||||
<value>
|
||||
<ArrayOfInstance xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
<ArrayOfInstance xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
<Instance>
|
||||
<Name>Contoso PROD</Name>
|
||||
<AosUri>https://contoso.production.operations.dynamics.com</AosUri>
|
||||
|
@ -124,7 +126,8 @@
|
|||
</setting>
|
||||
<setting name="Users" serializeAs="Xml">
|
||||
<value>
|
||||
<ArrayOfUser xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
<ArrayOfUser xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
<User>
|
||||
<Login>admin@contoso.com</Login>
|
||||
<Password>pass@word1</Password>
|
||||
|
@ -134,7 +137,8 @@
|
|||
</setting>
|
||||
<setting name="JobGroups" serializeAs="Xml">
|
||||
<value>
|
||||
<ArrayOfJobGroup xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
<ArrayOfJobGroup xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
<JobGroup>
|
||||
<Name>Import jobs</Name>
|
||||
</JobGroup>
|
||||
|
@ -152,7 +156,8 @@
|
|||
</setting>
|
||||
<setting name="AadApplications" serializeAs="Xml">
|
||||
<value>
|
||||
<ArrayOfAadApplication xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
<ArrayOfAadApplication xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
<AadApplication>
|
||||
<Name>User impersonation</Name>
|
||||
<ClientId>00000000-0000-0000-0000-000000000000</ClientId>
|
||||
|
@ -168,6 +173,9 @@
|
|||
</ArrayOfAadApplication>
|
||||
</value>
|
||||
</setting>
|
||||
<setting name="V3Forms" serializeAs="String">
|
||||
<value>True</value>
|
||||
</setting>
|
||||
</RecurringIntegrationsScheduler.Properties.Settings>
|
||||
</userSettings>
|
||||
<runtime>
|
||||
|
|
До Ширина: | Высота: | Размер: 52 KiB После Ширина: | Высота: | Размер: 52 KiB |
|
@ -38,95 +38,102 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
this.schedulerTextBox = new System.Windows.Forms.TextBox();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.serverTextBox = new System.Windows.Forms.TextBox();
|
||||
this.textBox1 = new System.Windows.Forms.TextBox();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// btnConnect
|
||||
//
|
||||
this.btnConnect.Location = new System.Drawing.Point(79, 119);
|
||||
this.btnConnect.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.btnConnect.Location = new System.Drawing.Point(59, 97);
|
||||
this.btnConnect.Name = "btnConnect";
|
||||
this.btnConnect.Size = new System.Drawing.Size(100, 28);
|
||||
this.btnConnect.Size = new System.Drawing.Size(75, 23);
|
||||
this.btnConnect.TabIndex = 4;
|
||||
this.btnConnect.Text = Resources.Connect;
|
||||
this.btnConnect.Text = global::RecurringIntegrationsScheduler.Properties.Resources.Connect;
|
||||
this.btnConnect.UseVisualStyleBackColor = true;
|
||||
this.btnConnect.Click += new System.EventHandler(this.ConnectButton_Click);
|
||||
//
|
||||
// btnCancel
|
||||
//
|
||||
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.btnCancel.Location = new System.Drawing.Point(189, 119);
|
||||
this.btnCancel.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.btnCancel.Location = new System.Drawing.Point(142, 97);
|
||||
this.btnCancel.Name = "btnCancel";
|
||||
this.btnCancel.Size = new System.Drawing.Size(100, 28);
|
||||
this.btnCancel.Size = new System.Drawing.Size(75, 23);
|
||||
this.btnCancel.TabIndex = 5;
|
||||
this.btnCancel.Text = Resources.Cancel;
|
||||
this.btnCancel.Text = global::RecurringIntegrationsScheduler.Properties.Resources.Cancel;
|
||||
this.btnCancel.UseVisualStyleBackColor = true;
|
||||
this.btnCancel.Click += new System.EventHandler(this.CancelButton_Click);
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(39, 15);
|
||||
this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.label1.Location = new System.Drawing.Point(29, 12);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(76, 17);
|
||||
this.label1.Size = new System.Drawing.Size(58, 13);
|
||||
this.label1.TabIndex = 2;
|
||||
this.label1.Text = Resources.Hostname;
|
||||
this.label1.Text = "Hostname:";
|
||||
//
|
||||
// portTextBox
|
||||
//
|
||||
this.portTextBox.Location = new System.Drawing.Point(120, 43);
|
||||
this.portTextBox.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.portTextBox.Location = new System.Drawing.Point(90, 35);
|
||||
this.portTextBox.Name = "portTextBox";
|
||||
this.portTextBox.Size = new System.Drawing.Size(57, 22);
|
||||
this.portTextBox.Size = new System.Drawing.Size(44, 20);
|
||||
this.portTextBox.TabIndex = 2;
|
||||
this.portTextBox.Text = "555";
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(39, 47);
|
||||
this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.label2.Location = new System.Drawing.Point(29, 38);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(38, 17);
|
||||
this.label2.Size = new System.Drawing.Size(29, 13);
|
||||
this.label2.TabIndex = 8;
|
||||
this.label2.Text = Resources.Port;
|
||||
this.label2.Text = "Port:";
|
||||
//
|
||||
// schedulerTextBox
|
||||
//
|
||||
this.schedulerTextBox.Location = new System.Drawing.Point(120, 75);
|
||||
this.schedulerTextBox.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.schedulerTextBox.Location = new System.Drawing.Point(90, 61);
|
||||
this.schedulerTextBox.Name = "schedulerTextBox";
|
||||
this.schedulerTextBox.Size = new System.Drawing.Size(220, 22);
|
||||
this.schedulerTextBox.Size = new System.Drawing.Size(166, 20);
|
||||
this.schedulerTextBox.TabIndex = 3;
|
||||
this.schedulerTextBox.Text = "RecurringIntegrationsScheduler";
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(39, 79);
|
||||
this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.label3.Location = new System.Drawing.Point(29, 64);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(72, 17);
|
||||
this.label3.Size = new System.Drawing.Size(55, 13);
|
||||
this.label3.TabIndex = 10;
|
||||
this.label3.Text = Resources.Scheduler;
|
||||
this.label3.Text = "Scheduler";
|
||||
//
|
||||
// serverTextBox
|
||||
//
|
||||
this.serverTextBox.Location = new System.Drawing.Point(120, 11);
|
||||
this.serverTextBox.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.serverTextBox.Location = new System.Drawing.Point(90, 9);
|
||||
this.serverTextBox.Name = "serverTextBox";
|
||||
this.serverTextBox.Size = new System.Drawing.Size(220, 22);
|
||||
this.serverTextBox.Size = new System.Drawing.Size(166, 20);
|
||||
this.serverTextBox.TabIndex = 1;
|
||||
this.serverTextBox.Text = "localhost";
|
||||
//
|
||||
// textBox1
|
||||
//
|
||||
this.textBox1.BackColor = System.Drawing.SystemColors.Control;
|
||||
this.textBox1.BorderStyle = System.Windows.Forms.BorderStyle.None;
|
||||
this.textBox1.Location = new System.Drawing.Point(12, 126);
|
||||
this.textBox1.Multiline = true;
|
||||
this.textBox1.Name = "textBox1";
|
||||
this.textBox1.Size = new System.Drawing.Size(241, 47);
|
||||
this.textBox1.TabIndex = 11;
|
||||
this.textBox1.Text = "If you are connecting to remote machine do not edit job settings or parameters. I" +
|
||||
"t will cause errors in jobs configuration due to secrets encryption.";
|
||||
this.textBox1.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
//
|
||||
// Connect
|
||||
//
|
||||
this.AcceptButton = this.btnConnect;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.CancelButton = this.btnCancel;
|
||||
this.ClientSize = new System.Drawing.Size(353, 162);
|
||||
this.ClientSize = new System.Drawing.Size(265, 185);
|
||||
this.Controls.Add(this.textBox1);
|
||||
this.Controls.Add(this.serverTextBox);
|
||||
this.Controls.Add(this.schedulerTextBox);
|
||||
this.Controls.Add(this.label3);
|
||||
|
@ -136,7 +143,6 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
this.Controls.Add(this.btnCancel);
|
||||
this.Controls.Add(this.btnConnect);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||
this.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "Connect";
|
||||
|
@ -144,7 +150,7 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
this.ShowInTaskbar = false;
|
||||
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = Resources.Connect_to_scheduler_service;
|
||||
this.Text = "Connect to scheduler service";
|
||||
this.Load += new System.EventHandler(this.ServerConnectForm_Load);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
@ -163,5 +169,6 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
private System.Windows.Forms.TextBox schedulerTextBox;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.TextBox serverTextBox;
|
||||
private System.Windows.Forms.TextBox textBox1;
|
||||
}
|
||||
}
|
|
@ -37,30 +37,33 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
// textBox1
|
||||
//
|
||||
this.textBox1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.textBox1.Font = new System.Drawing.Font("Courier New", 8.142858F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.textBox1.Location = new System.Drawing.Point(0, 0);
|
||||
this.textBox1.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
|
||||
this.textBox1.Multiline = true;
|
||||
this.textBox1.Name = "textBox1";
|
||||
this.textBox1.ReadOnly = true;
|
||||
this.textBox1.Size = new System.Drawing.Size(781, 310);
|
||||
this.textBox1.Size = new System.Drawing.Size(1417, 526);
|
||||
this.textBox1.TabIndex = 0;
|
||||
this.textBox1.Text = resources.GetString("textBox1.Text");
|
||||
//
|
||||
// CronExamples
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(11F, 24F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(781, 310);
|
||||
this.ClientSize = new System.Drawing.Size(1417, 526);
|
||||
this.Controls.Add(this.textBox1);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||
this.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
|
||||
this.MaximizeBox = false;
|
||||
this.MaximumSize = new System.Drawing.Size(797, 349);
|
||||
this.MaximumSize = new System.Drawing.Size(1441, 590);
|
||||
this.MinimizeBox = false;
|
||||
this.MinimumSize = new System.Drawing.Size(797, 349);
|
||||
this.MinimumSize = new System.Drawing.Size(1441, 590);
|
||||
this.Name = "CronExamples";
|
||||
this.ShowIcon = false;
|
||||
this.ShowInTaskbar = false;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = Resources.Cron_examples;
|
||||
this.Text = "Cron examples";
|
||||
this.Load += new System.EventHandler(this.CronExamples_Load);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
|
|
@ -118,27 +118,28 @@
|
|||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="textBox1.Text" xml:space="preserve">
|
||||
<value>Expression Meaning
|
||||
0 0 12 * * ? Fire at 12pm (noon) every day
|
||||
0 15 10 ? * * Fire at 10:15am every day
|
||||
0 15 10 * * ? Fire at 10:15am every day
|
||||
0 15 10 * * ? * Fire at 10:15am every day
|
||||
0 15 10 * * ? 2005 Fire at 10:15am every day during the year 2005
|
||||
0 * 14 * * ? Fire every minute starting at 2pm and ending at 2:59pm, every day
|
||||
0 0/5 14 * * ? Fire every 5 minutes starting at 2pm and ending at 2:55pm, every day
|
||||
0 0/5 14,18 * * ? Fire every 5 minutes starting at 2pm and ending at 2:55pm, AND fire every 5 minutes starting at 6pm and ending at 6:55pm, every day
|
||||
0 0-5 14 * * ? Fire every minute starting at 2pm and ending at 2:05pm, every day
|
||||
0 10,44 14 ? 3 WED Fire at 2:10pm and at 2:44pm every Wednesday in the month of March.
|
||||
0 15 10 ? * MON-FRI Fire at 10:15am every Monday, Tuesday, Wednesday, Thursday and Friday
|
||||
0 15 10 15 * ? Fire at 10:15am on the 15th day of every month
|
||||
0 15 10 L * ? Fire at 10:15am on the last day of every month
|
||||
0 15 10 L-2 * ? Fire at 10:15am on the 2nd-to-last last day of every month
|
||||
0 15 10 ? * 6L Fire at 10:15am on the last Friday of every month
|
||||
0 15 10 ? * 6L Fire at 10:15am on the last Friday of every month
|
||||
0 15 10 ? * 6L 2002-2005 Fire at 10:15am on every last friday of every month during the years 2002, 2003, 2004 and 2005
|
||||
0 15 10 ? * 6#3 Fire at 10:15am on the third Friday of every month
|
||||
0 0 12 1/5 * ? Fire at 12pm (noon) every 5 days every month, starting on the first day of the month.
|
||||
0 11 11 11 11 ? Fire every November 11th at 11:11am.
|
||||
<value>Expression Meaning
|
||||
0 0 12 * * ? Fire at 12pm (noon) every day
|
||||
0 15 10 ? * * Fire at 10:15am every day
|
||||
0 15 10 * * ? Fire at 10:15am every day
|
||||
0 15 10 * * ? * Fire at 10:15am every day
|
||||
0 15 10 * * ? 2005 Fire at 10:15am every day during the year 2005
|
||||
0 * 14 * * ? Fire every minute starting at 2pm and ending at 2:59pm, every day
|
||||
0 0/5 14 * * ? Fire every 5 minutes starting at 2pm and ending at 2:55pm, every day
|
||||
0 0/5 14,18 * * ? Fire every 5 minutes starting at 2pm and ending at 2:55pm, AND fire every 5 minutes
|
||||
starting at 6pm and ending at 6:55pm, every day
|
||||
0 0-5 14 * * ? Fire every minute starting at 2pm and ending at 2:05pm, every day
|
||||
0 10,44 14 ? 3 WED Fire at 2:10pm and at 2:44pm every Wednesday in the month of March.
|
||||
0 15 10 ? * MON-FRI Fire at 10:15am every Monday, Tuesday, Wednesday, Thursday and Friday
|
||||
0 15 10 15 * ? Fire at 10:15am on the 15th day of every month
|
||||
0 15 10 L * ? Fire at 10:15am on the last day of every month
|
||||
0 15 10 L-2 * ? Fire at 10:15am on the 2nd-to-last last day of every month
|
||||
0 15 10 ? * 6L Fire at 10:15am on the last Friday of every month
|
||||
0 15 10 ? * 6L Fire at 10:15am on the last Friday of every month
|
||||
0 15 10 ? * 6L 2002-2005 Fire at 10:15am on every last friday of every month during the years 2002, 2003, 2004 and 2005
|
||||
0 15 10 ? * 6#3 Fire at 10:15am on the third Friday of every month
|
||||
0 0 12 1/5 * ? Fire at 12pm (noon) every 5 days every month, starting on the first day of the month.
|
||||
0 11 11 11 11 ? Fire every November 11th at 11:11am.
|
||||
|
||||
Pay attention to the effects of '?' and '*' in the day-of-week and day-of-month fields!</value>
|
||||
</data>
|
||||
|
|
|
@ -112,7 +112,7 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
Convert.ToBoolean(
|
||||
JobDetail.JobDataMap[SettingsConstants.UseServiceAuthentication]
|
||||
.ToString());
|
||||
numericUpDownInterval.Value = Math.Round(Convert.ToDecimal(JobDetail.JobDataMap[SettingsConstants.Interval]));
|
||||
numericUpDownInterval.Value = Math.Round(Convert.ToDecimal(JobDetail.JobDataMap[SettingsConstants.DelayBetweenFiles]));
|
||||
|
||||
if (!serviceAuthRadioButton.Checked)
|
||||
{
|
||||
|
@ -411,7 +411,7 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
{SettingsConstants.RetryDelay, retriesDelayUpDown.Value.ToString(CultureInfo.InvariantCulture)},
|
||||
{SettingsConstants.PauseJobOnException, pauseOnExceptionsCheckBox.Checked.ToString()},
|
||||
{SettingsConstants.IndefinitePause, pauseIndefinitelyCheckBox.Checked.ToString()},
|
||||
{SettingsConstants.Interval, numericUpDownInterval.Value.ToString(CultureInfo.InvariantCulture)},
|
||||
{SettingsConstants.DelayBetweenFiles, numericUpDownInterval.Value.ToString(CultureInfo.InvariantCulture)},
|
||||
};
|
||||
if (serviceAuthRadioButton.Checked)
|
||||
{
|
||||
|
@ -429,7 +429,7 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
{
|
||||
cronmakerLinkLabel.LinkVisited = true;
|
||||
Process.Start(
|
||||
"http://www.quartz-scheduler.net/documentation/quartz-2.x/tutorial/crontrigger.html");
|
||||
"https://www.quartz-scheduler.net/documentation/quartz-3.x/tutorial/crontrigger.html");
|
||||
}
|
||||
|
||||
private void CalculateNextRunsButton_Click(object sender, EventArgs e)
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,507 @@
|
|||
/* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
Licensed under the MIT License. */
|
||||
|
||||
using Quartz;
|
||||
using Quartz.Impl.Triggers;
|
||||
using RecurringIntegrationsScheduler.Common.Contracts;
|
||||
using RecurringIntegrationsScheduler.Properties;
|
||||
using RecurringIntegrationsScheduler.Settings;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace RecurringIntegrationsScheduler.Forms
|
||||
{
|
||||
public partial class DownloadJobV3 : Form
|
||||
{
|
||||
private const int CpNocloseButton = 0x200;
|
||||
|
||||
public DownloadJobV3()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
protected override CreateParams CreateParams
|
||||
{
|
||||
get
|
||||
{
|
||||
var myCp = base.CreateParams;
|
||||
myCp.ClassStyle = myCp.ClassStyle | CpNocloseButton;
|
||||
return myCp;
|
||||
}
|
||||
}
|
||||
|
||||
public bool Cancelled { get; private set; }
|
||||
public IJobDetail JobDetail { get; set; }
|
||||
public ITrigger Trigger { get; set; }
|
||||
|
||||
private void DownloadJobForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
Cancelled = false;
|
||||
//Few changes based on form mode (create or edit)
|
||||
Text = JobDetail == null
|
||||
? Resources.Add_download_job
|
||||
: string.Format(Resources.Edit_job_0, JobDetail.Key.Name);
|
||||
addToolStripButton.Text = JobDetail == null ? Resources.Add_to_schedule : Resources.Edit_job;
|
||||
jobName.Enabled = JobDetail == null;
|
||||
|
||||
jobGroupComboBox.DataSource = Properties.Settings.Default.JobGroups;
|
||||
jobGroupComboBox.ValueMember = null;
|
||||
jobGroupComboBox.DisplayMember = "Name";
|
||||
|
||||
jobGroupComboBox.Enabled = JobDetail == null;
|
||||
|
||||
instanceComboBox.DataSource = Properties.Settings.Default.Instances;
|
||||
instanceComboBox.ValueMember = null;
|
||||
instanceComboBox.DisplayMember = "Name";
|
||||
|
||||
var dataJobs = Properties.Settings.Default.DataJobs.Where(x => x.Type == DataJobType.Download);
|
||||
var dataJobsBindingList = new BindingList<DataJob>(dataJobs.ToList());
|
||||
dataJobComboBox.DataSource = dataJobsBindingList;
|
||||
dataJobComboBox.ValueMember = null;
|
||||
dataJobComboBox.DisplayMember = "Name";
|
||||
|
||||
var applications = Properties.Settings.Default.AadApplications.Where(x => x.AuthenticationType == AuthenticationType.User);
|
||||
var applicationsBindingList = new BindingList<AadApplication>(applications.ToList());
|
||||
aadApplicationComboBox.DataSource = applicationsBindingList;
|
||||
aadApplicationComboBox.ValueMember = null;
|
||||
aadApplicationComboBox.DisplayMember = "Name";
|
||||
|
||||
userComboBox.DataSource = Properties.Settings.Default.Users;
|
||||
userComboBox.ValueMember = null;
|
||||
userComboBox.DisplayMember = "Login";
|
||||
|
||||
startAtDateTimePicker.Value = DateTime.Now;
|
||||
|
||||
errorsFolder.Text = Properties.Settings.Default.DownloadErrorsFolder;
|
||||
|
||||
if ((JobDetail != null) && (Trigger != null))
|
||||
{
|
||||
jobName.Text = JobDetail.Key.Name;
|
||||
|
||||
var jobGroup =
|
||||
((IEnumerable<JobGroup>) jobGroupComboBox.DataSource).FirstOrDefault(
|
||||
x => x.Name == JobDetail.Key.Group);
|
||||
jobGroupComboBox.SelectedItem = jobGroup;
|
||||
|
||||
jobDescription.Text = JobDetail.Description;
|
||||
|
||||
downloadFolder.Text = JobDetail.JobDataMap[SettingsConstants.DownloadSuccessDir]?.ToString() ??
|
||||
string.Empty;
|
||||
errorsFolder.Text = JobDetail.JobDataMap[SettingsConstants.DownloadErrorsDir]?.ToString() ??
|
||||
string.Empty;
|
||||
useStandardSubfolder.Checked = false;
|
||||
|
||||
unzipCheckBox.Checked = (JobDetail.JobDataMap[SettingsConstants.UnzipPackage] != null) &&
|
||||
Convert.ToBoolean(
|
||||
JobDetail.JobDataMap[SettingsConstants.UnzipPackage].ToString());
|
||||
addTimestampCheckBox.Checked = (JobDetail.JobDataMap[SettingsConstants.AddTimestamp] != null) &&
|
||||
Convert.ToBoolean(
|
||||
JobDetail.JobDataMap[SettingsConstants.AddTimestamp].ToString());
|
||||
deletePackageCheckBox.Checked = (JobDetail.JobDataMap[SettingsConstants.DeletePackage] != null) &&
|
||||
Convert.ToBoolean(
|
||||
JobDetail.JobDataMap[SettingsConstants.DeletePackage].ToString());
|
||||
serviceAuthRadioButton.Checked = (JobDetail.JobDataMap[SettingsConstants.UseServiceAuthentication] !=
|
||||
null) &&
|
||||
Convert.ToBoolean(
|
||||
JobDetail.JobDataMap[SettingsConstants.UseServiceAuthentication]
|
||||
.ToString());
|
||||
delayBetweenFilesNumericUpDown.Value = Math.Round(Convert.ToDecimal(JobDetail.JobDataMap[SettingsConstants.DelayBetweenFiles]));
|
||||
|
||||
if (!serviceAuthRadioButton.Checked)
|
||||
{
|
||||
User axUser = null;
|
||||
if (JobDetail.JobDataMap[SettingsConstants.UserName] != null)
|
||||
axUser =
|
||||
((IEnumerable<User>) userComboBox.DataSource).FirstOrDefault(
|
||||
x => x.Login == JobDetail.JobDataMap[SettingsConstants.UserName].ToString());
|
||||
if (axUser == null)
|
||||
{
|
||||
var userName = JobDetail.JobDataMap[SettingsConstants.UserName];
|
||||
if (userName != null)
|
||||
axUser = new User
|
||||
{
|
||||
Login = userName.ToString(),
|
||||
Password = JobDetail.JobDataMap[SettingsConstants.UserPassword].ToString()
|
||||
};
|
||||
var disabledUser = new Users {axUser};
|
||||
userComboBox.DataSource = disabledUser;
|
||||
userComboBox.Enabled = false;
|
||||
}
|
||||
userComboBox.SelectedItem = axUser;
|
||||
}
|
||||
var application =
|
||||
((IEnumerable<AadApplication>) aadApplicationComboBox.DataSource).FirstOrDefault(app =>
|
||||
app.ClientId == JobDetail.JobDataMap[SettingsConstants.AadClientId].ToString());
|
||||
if (application == null)
|
||||
if (JobDetail.JobDataMap[SettingsConstants.AadClientSecret] == null)
|
||||
{
|
||||
application = new AadApplication
|
||||
{
|
||||
ClientId = JobDetail.JobDataMap[SettingsConstants.AadClientId].ToString(),
|
||||
Name = Resources.IMPORTED_CHANGE_THIS,
|
||||
AuthenticationType = AuthenticationType.User
|
||||
};
|
||||
Properties.Settings.Default.AadApplications.Add(application);
|
||||
applications =
|
||||
Properties.Settings.Default.AadApplications.Where(x => x.AuthenticationType == AuthenticationType.User);
|
||||
applicationsBindingList = new BindingList<AadApplication>(applications.ToList());
|
||||
aadApplicationComboBox.DataSource = applicationsBindingList;
|
||||
aadApplicationComboBox.ValueMember = null;
|
||||
aadApplicationComboBox.DisplayMember = "Name";
|
||||
}
|
||||
else
|
||||
{
|
||||
application = new AadApplication
|
||||
{
|
||||
ClientId = JobDetail.JobDataMap[SettingsConstants.AadClientId].ToString(),
|
||||
Secret = JobDetail.JobDataMap[SettingsConstants.AadClientSecret].ToString(),
|
||||
Name = Resources.IMPORTED,
|
||||
AuthenticationType = AuthenticationType.Service
|
||||
};
|
||||
var disabledApplication = new AadApplications {application};
|
||||
aadApplicationComboBox.DataSource = disabledApplication;
|
||||
aadApplicationComboBox.Enabled = false;
|
||||
authMethodPanel.Enabled = false;
|
||||
}
|
||||
aadApplicationComboBox.SelectedItem = application;
|
||||
|
||||
var dataJob =
|
||||
((IEnumerable<DataJob>) dataJobComboBox.DataSource).FirstOrDefault(
|
||||
dj => dj.ActivityId == JobDetail.JobDataMap[SettingsConstants.ActivityId].ToString());
|
||||
if (dataJob == null)
|
||||
{
|
||||
dataJob = new DataJob
|
||||
{
|
||||
ActivityId = JobDetail.JobDataMap[SettingsConstants.ActivityId].ToString(),
|
||||
Type = DataJobType.Download,
|
||||
Name = Resources.IMPORTED_CHANGE_THIS
|
||||
};
|
||||
Properties.Settings.Default.DataJobs.Add(dataJob);
|
||||
dataJobs = Properties.Settings.Default.DataJobs.Where(x => x.Type == DataJobType.Download);
|
||||
dataJobsBindingList = new BindingList<DataJob>(dataJobs.ToList());
|
||||
dataJobComboBox.DataSource = dataJobsBindingList;
|
||||
dataJobComboBox.ValueMember = null;
|
||||
dataJobComboBox.DisplayMember = "Name";
|
||||
}
|
||||
dataJobComboBox.SelectedItem = dataJob;
|
||||
|
||||
var axInstance = ((IEnumerable<Instance>) instanceComboBox.DataSource).FirstOrDefault(x =>
|
||||
(x.AosUri == JobDetail.JobDataMap[SettingsConstants.AosUri].ToString()) &&
|
||||
(x.AadTenant == JobDetail.JobDataMap[SettingsConstants.AadTenant].ToString()) &&
|
||||
(x.AzureAuthEndpoint == JobDetail.JobDataMap[SettingsConstants.AzureAuthEndpoint].ToString()));
|
||||
if (axInstance == null)
|
||||
{
|
||||
axInstance = new Instance
|
||||
{
|
||||
AosUri = JobDetail.JobDataMap[SettingsConstants.AosUri].ToString(),
|
||||
AadTenant = JobDetail.JobDataMap[SettingsConstants.AadTenant].ToString(),
|
||||
AzureAuthEndpoint = JobDetail.JobDataMap[SettingsConstants.AzureAuthEndpoint].ToString(),
|
||||
Name = Resources.IMPORTED_CHANGE_THIS
|
||||
};
|
||||
Properties.Settings.Default.Instances.Add(axInstance);
|
||||
}
|
||||
instanceComboBox.SelectedItem = axInstance;
|
||||
|
||||
pauseIndefinitelyCheckBox.Checked =
|
||||
(JobDetail.JobDataMap[SettingsConstants.IndefinitePause] != null) &&
|
||||
Convert.ToBoolean(JobDetail.JobDataMap[SettingsConstants.IndefinitePause].ToString());
|
||||
|
||||
if (Trigger.GetType() == typeof(SimpleTriggerImpl))
|
||||
{
|
||||
var localTrigger = (SimpleTriggerImpl) Trigger;
|
||||
simpleTriggerRadioButton.Checked = true;
|
||||
hoursDateTimePicker.Value = DateTime.Now.Date + localTrigger.RepeatInterval;
|
||||
minutesDateTimePicker.Value = DateTime.Now.Date + localTrigger.RepeatInterval;
|
||||
}
|
||||
else if (Trigger.GetType() == typeof(CronTriggerImpl))
|
||||
{
|
||||
var localTrigger = (CronTriggerImpl) Trigger;
|
||||
cronTriggerRadioButton.Checked = true;
|
||||
cronExpressionTextBox.Text = localTrigger.CronExpressionString;
|
||||
}
|
||||
if(JobDetail.JobDataMap[SettingsConstants.RetryCount] != null)
|
||||
{
|
||||
retriesCountUpDown.Value = Convert.ToDecimal(JobDetail.JobDataMap[SettingsConstants.RetryCount]);
|
||||
}
|
||||
if(JobDetail.JobDataMap[SettingsConstants.RetryDelay] != null)
|
||||
{
|
||||
retriesDelayUpDown.Value = Convert.ToDecimal(JobDetail.JobDataMap[SettingsConstants.RetryDelay]);
|
||||
}
|
||||
pauseOnExceptionsCheckBox.Checked =
|
||||
(JobDetail.JobDataMap[SettingsConstants.PauseJobOnException] != null) &&
|
||||
Convert.ToBoolean(JobDetail.JobDataMap[SettingsConstants.PauseJobOnException].ToString());
|
||||
|
||||
Properties.Settings.Default.Save();
|
||||
}
|
||||
}
|
||||
|
||||
private void DownloadFolderBrowserButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (folderBrowserDialog.ShowDialog() == DialogResult.OK)
|
||||
downloadFolder.Text = folderBrowserDialog.SelectedPath;
|
||||
}
|
||||
|
||||
private void ErrorsFolderBrowserButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (folderBrowserDialog.ShowDialog() == DialogResult.OK)
|
||||
errorsFolder.Text = folderBrowserDialog.SelectedPath;
|
||||
}
|
||||
|
||||
private void UseStandardSubfolder_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
errorsFolder.Enabled = !useStandardSubfolder.Checked;
|
||||
errorsFolderBrowserButton.Enabled = !useStandardSubfolder.Checked;
|
||||
if (useStandardSubfolder.Checked)
|
||||
{
|
||||
errorsFolder.Text = Path.Combine(downloadFolder.Text, Properties.Settings.Default.DownloadErrorsFolder);
|
||||
}
|
||||
}
|
||||
|
||||
private void CronmakerLinkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
||||
{
|
||||
cronmakerLinkLabel.LinkVisited = true;
|
||||
Process.Start("http://www.cronmaker.com");
|
||||
}
|
||||
|
||||
private void CronTriggerRadioButton_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
simpleTriggerJobGroupBox.Enabled = !cronTriggerRadioButton.Checked;
|
||||
cronTriggerJobGroupBox.Enabled = cronTriggerRadioButton.Checked;
|
||||
}
|
||||
|
||||
private bool ValidateJobSettings()
|
||||
{
|
||||
if (cronTriggerRadioButton.Checked)
|
||||
{
|
||||
var date = GetScheduleForCron(cronExpressionTextBox.Text, DateTimeOffset.Now);
|
||||
if (date == DateTimeOffset.MinValue)
|
||||
return false;
|
||||
}
|
||||
var message = new StringBuilder();
|
||||
|
||||
if (string.IsNullOrEmpty(jobName.Text))
|
||||
message.AppendLine(Resources.Job_name_is_missing);
|
||||
|
||||
if (string.IsNullOrEmpty(jobGroupComboBox.Text))
|
||||
message.AppendLine(Resources.Job_group_is_not_selected);
|
||||
|
||||
if (string.IsNullOrEmpty(downloadFolder.Text))
|
||||
message.AppendLine(Resources.Download_folder_is_not_selected);
|
||||
|
||||
if (string.IsNullOrEmpty(errorsFolder.Text))
|
||||
message.AppendLine(Resources.Download_errors_folder_is_not_selected);
|
||||
|
||||
if ((instanceComboBox.SelectedItem == null) || string.IsNullOrEmpty(instanceComboBox.Text))
|
||||
message.AppendLine(Resources.Dynamics_instance_is_not_selected);
|
||||
|
||||
if (userAuthRadioButton.Checked &&
|
||||
((userComboBox.SelectedItem == null) || string.IsNullOrEmpty(userComboBox.Text)))
|
||||
message.AppendLine(Resources.User_is_not_selected);
|
||||
|
||||
if ((aadApplicationComboBox.SelectedItem == null) || string.IsNullOrEmpty(aadApplicationComboBox.Text))
|
||||
message.AppendLine(Resources.AAD_client_application_is_not_selected);
|
||||
|
||||
if ((dataJobComboBox.SelectedItem == null) || string.IsNullOrEmpty(dataJobComboBox.Text))
|
||||
message.AppendLine(Resources.Data_job_is_not_selected);
|
||||
|
||||
if (message.Length > 0)
|
||||
MessageBox.Show(message.ToString(), Resources.Job_configuration_is_not_valid);
|
||||
|
||||
return message.Length == 0;
|
||||
}
|
||||
|
||||
private IJobDetail GetJobDetail()
|
||||
{
|
||||
var detail = JobBuilder
|
||||
.Create()
|
||||
.OfType(Type.GetType("RecurringIntegrationsScheduler.Job.Download,RecurringIntegrationsScheduler.Job.Download", true))
|
||||
.WithDescription(jobDescription.Text)
|
||||
.WithIdentity(new JobKey(jobName.Text, jobGroupComboBox.Text))
|
||||
.UsingJobData(GetJobDataMap())
|
||||
.Build();
|
||||
|
||||
return detail;
|
||||
}
|
||||
|
||||
private ITrigger GetTrigger(IJobDetail jobDetail)
|
||||
{
|
||||
var builder =
|
||||
TriggerBuilder
|
||||
.Create()
|
||||
.ForJob(jobDetail)
|
||||
.WithDescription(string.Format(Resources.Trigger_for_job_0_1, jobDetail.Key.Name,
|
||||
jobDetail.Key.Group))
|
||||
.WithIdentity(
|
||||
new TriggerKey(
|
||||
string.Format(Resources.Trigger_for_job_0_1, jobDetail.Key.Name, jobDetail.Key.Group),
|
||||
jobDetail.Key.Group));
|
||||
|
||||
if (simpleTriggerRadioButton.Checked)
|
||||
{
|
||||
var minutes = hoursDateTimePicker.Value.Hour*60;
|
||||
minutes = minutes + minutesDateTimePicker.Value.Minute;
|
||||
|
||||
return builder.WithSimpleSchedule(x => x
|
||||
.WithIntervalInMinutes(minutes)
|
||||
.RepeatForever())
|
||||
.StartNow()
|
||||
.Build();
|
||||
}
|
||||
return
|
||||
builder.WithSchedule(CronScheduleBuilder.CronSchedule(cronExpressionTextBox.Text))
|
||||
.StartAt(startAtDateTimePicker.Value.ToUniversalTime())
|
||||
.Build();
|
||||
}
|
||||
|
||||
private JobDataMap GetJobDataMap()
|
||||
{
|
||||
var dataJob = (DataJob) dataJobComboBox.SelectedItem;
|
||||
var instance = (Instance) instanceComboBox.SelectedItem;
|
||||
var user = (User) userComboBox.SelectedItem;
|
||||
var application = (AadApplication) aadApplicationComboBox.SelectedItem;
|
||||
|
||||
var map = new JobDataMap
|
||||
{
|
||||
{SettingsConstants.DownloadSuccessDir, downloadFolder.Text},
|
||||
{SettingsConstants.DownloadErrorsDir, errorsFolder.Text},
|
||||
{SettingsConstants.AadTenant, instance.AadTenant},
|
||||
{SettingsConstants.AzureAuthEndpoint, instance.AzureAuthEndpoint},
|
||||
{SettingsConstants.AosUri, instance.AosUri},
|
||||
{SettingsConstants.ActivityId, dataJob.ActivityId},
|
||||
{SettingsConstants.UseServiceAuthentication, serviceAuthRadioButton.Checked.ToString()},
|
||||
{SettingsConstants.AadClientId, application.ClientId},
|
||||
{SettingsConstants.UnzipPackage, unzipCheckBox.Checked.ToString()},
|
||||
{SettingsConstants.AddTimestamp, addTimestampCheckBox.Checked.ToString()},
|
||||
{SettingsConstants.DeletePackage, deletePackageCheckBox.Checked.ToString()},
|
||||
{SettingsConstants.RetryCount, retriesCountUpDown.Value.ToString(CultureInfo.InvariantCulture)},
|
||||
{SettingsConstants.RetryDelay, retriesDelayUpDown.Value.ToString(CultureInfo.InvariantCulture)},
|
||||
{SettingsConstants.PauseJobOnException, pauseOnExceptionsCheckBox.Checked.ToString()},
|
||||
{SettingsConstants.IndefinitePause, pauseIndefinitelyCheckBox.Checked.ToString()},
|
||||
{SettingsConstants.DelayBetweenFiles, delayBetweenFilesNumericUpDown.Value.ToString(CultureInfo.InvariantCulture)},
|
||||
};
|
||||
if (serviceAuthRadioButton.Checked)
|
||||
{
|
||||
map.Add(SettingsConstants.AadClientSecret, application.Secret);
|
||||
}
|
||||
else
|
||||
{
|
||||
map.Add(SettingsConstants.UserName, user.Login);
|
||||
map.Add(SettingsConstants.UserPassword, user.Password);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
private void CronDocsLinkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
||||
{
|
||||
cronmakerLinkLabel.LinkVisited = true;
|
||||
Process.Start(
|
||||
"https://www.quartz-scheduler.net/documentation/quartz-3.x/tutorial/crontrigger.html");
|
||||
}
|
||||
|
||||
private void CalculateNextRunsButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
var scheduleTimes = new List<DateTimeOffset>();
|
||||
|
||||
var time = DateTimeOffset.Now;
|
||||
|
||||
if (!string.IsNullOrEmpty(cronExpressionTextBox.Text))
|
||||
for (var i = 0; i <= 99; i++)
|
||||
{
|
||||
var date = GetScheduleForCron(cronExpressionTextBox.Text, time);
|
||||
if (date == DateTimeOffset.MinValue)
|
||||
return;
|
||||
if (date == null) continue;
|
||||
scheduleTimes.Add(date.Value);
|
||||
time = date.Value;
|
||||
}
|
||||
calculatedRunsTextBox.Text = string.Empty;
|
||||
foreach (var date in scheduleTimes)
|
||||
calculatedRunsTextBox.Text = calculatedRunsTextBox.Text + $@"{date.ToLocalTime():yyyy-MM-dd HH:mm:ss}" +
|
||||
Environment.NewLine;
|
||||
}
|
||||
|
||||
private static DateTimeOffset? GetScheduleForCron(string cronexpression, DateTimeOffset date)
|
||||
{
|
||||
try
|
||||
{
|
||||
var cron = new CronExpression(cronexpression);
|
||||
return cron.GetNextValidTimeAfter(date);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, Resources.Cron_expression_is_invalid);
|
||||
return DateTimeOffset.MinValue;
|
||||
}
|
||||
}
|
||||
|
||||
private void DownloadFolder_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (useStandardSubfolder.Checked)
|
||||
errorsFolder.Text = Path.Combine(downloadFolder.Text, Properties.Settings.Default.DownloadErrorsFolder);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(Resources.Check_if_path + Environment.NewLine + ex.Message, Resources.Warning);
|
||||
}
|
||||
}
|
||||
|
||||
private void MoreExamplesButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
var form = new CronExamples();
|
||||
form.ShowDialog();
|
||||
}
|
||||
|
||||
private void UnzipCheckBox_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
addTimestampCheckBox.Enabled = unzipCheckBox.Checked;
|
||||
deletePackageCheckBox.Enabled = unzipCheckBox.Checked;
|
||||
}
|
||||
|
||||
private void ServiceAuthRadioButton_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
var applications = serviceAuthRadioButton.Checked
|
||||
? Properties.Settings.Default.AadApplications.Where(x => x.AuthenticationType == AuthenticationType.Service)
|
||||
: Properties.Settings.Default.AadApplications.Where(x => x.AuthenticationType == AuthenticationType.User);
|
||||
var applicationsBindingList = new BindingList<AadApplication>(applications.ToList());
|
||||
aadApplicationComboBox.DataSource = applicationsBindingList;
|
||||
aadApplicationComboBox.ValueMember = null;
|
||||
aadApplicationComboBox.DisplayMember = "Name";
|
||||
|
||||
userComboBox.Enabled = !serviceAuthRadioButton.Checked;
|
||||
}
|
||||
|
||||
private void CancelToolStripButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
Cancelled = true;
|
||||
Close();
|
||||
}
|
||||
|
||||
private void AddToolStripButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (JobDetail == null)
|
||||
{
|
||||
var jobKey = new JobKey(jobName.Text, jobGroupComboBox.Text);
|
||||
if (Scheduler.Instance.GetScheduler().CheckExists(jobKey).Result)
|
||||
if (
|
||||
MessageBox.Show(
|
||||
string.Format(Resources.Job_0_in_group_1_already_exists, jobKey.Name, jobKey.Group),
|
||||
Resources.Job_already_exists, MessageBoxButtons.YesNo) == DialogResult.No)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!ValidateJobSettings()) return;
|
||||
JobDetail = GetJobDetail();
|
||||
Trigger = GetTrigger(JobDetail);
|
||||
Close();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,162 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="folderBrowserDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<data name="cronTriggerInfoTextBox.Text" xml:space="preserve">
|
||||
<value>With cron expression you can specify schedules such as “every Friday at noon”, or “every weekday and 9:30 am”, or even “every 5 minutes between 9:00 am and 10:00 am on every Monday, Wednesday and Friday during January”.
|
||||
|
||||
Default example above means: Each working day of the week (MON-FRI) run every 15 minutes (0/15) between 8:00 and 18:45 (8-18 - last run will be at 18:45)</value>
|
||||
</data>
|
||||
<metadata name="mainToolStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>180, 17</value>
|
||||
</metadata>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="cancelToolStripButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
|
||||
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
|
||||
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
|
||||
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
|
||||
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
|
||||
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
|
||||
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
|
||||
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
|
||||
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
|
||||
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<data name="addToolStripButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
|
||||
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
|
||||
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
|
||||
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
|
||||
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
|
||||
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
|
||||
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
|
||||
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
|
||||
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
|
||||
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
</root>
|
|
@ -117,9 +117,9 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
|
||||
legalEntity.Text = JobDetail.JobDataMap[SettingsConstants.Company]?.ToString() ?? string.Empty;
|
||||
|
||||
statusCheckInterval.Value = Math.Round(Convert.ToDecimal(JobDetail.JobDataMap[SettingsConstants.StatusCheckInterval]));
|
||||
statusCheckInterval.Value = Math.Round(Convert.ToDecimal(JobDetail.JobDataMap[SettingsConstants.DelayBetweenStatusCheck]));
|
||||
|
||||
numericUpDownInterval.Value = Math.Round(Convert.ToDecimal(JobDetail.JobDataMap[SettingsConstants.Interval]));
|
||||
numericUpDownInterval.Value = Math.Round(Convert.ToDecimal(JobDetail.JobDataMap[SettingsConstants.DelayBetweenFiles]));
|
||||
|
||||
if (!serviceAuthRadioButton.Checked)
|
||||
{
|
||||
|
@ -401,8 +401,8 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
{SettingsConstants.DeletePackage, deletePackageCheckBox.Checked.ToString()},
|
||||
{SettingsConstants.DataProject, dataProject.Text},
|
||||
{SettingsConstants.Company, legalEntity.Text},
|
||||
{SettingsConstants.Interval, numericUpDownInterval.Value.ToString(CultureInfo.InvariantCulture)},
|
||||
{SettingsConstants.StatusCheckInterval, statusCheckInterval.Value.ToString(CultureInfo.InvariantCulture)},
|
||||
{SettingsConstants.DelayBetweenFiles, numericUpDownInterval.Value.ToString(CultureInfo.InvariantCulture)},
|
||||
{SettingsConstants.DelayBetweenStatusCheck, statusCheckInterval.Value.ToString(CultureInfo.InvariantCulture)},
|
||||
{SettingsConstants.RetryCount, retriesCountUpDown.Value.ToString(CultureInfo.InvariantCulture)},
|
||||
{SettingsConstants.RetryDelay, retriesDelayUpDown.Value.ToString(CultureInfo.InvariantCulture)},
|
||||
{SettingsConstants.PauseJobOnException, pauseOnExceptionsCheckBox.Checked.ToString()},
|
||||
|
@ -426,7 +426,7 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
private void CronDocsLinkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
||||
{
|
||||
cronmakerLinkLabel.LinkVisited = true;
|
||||
Process.Start("http://www.quartz-scheduler.net/documentation/quartz-2.x/tutorial/crontrigger.html");
|
||||
Process.Start("https://www.quartz-scheduler.net/documentation/quartz-3.x/tutorial/crontrigger.html");
|
||||
}
|
||||
|
||||
private void CalculateNextRunsButton_Click(object sender, EventArgs e)
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,517 @@
|
|||
/* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
Licensed under the MIT License. */
|
||||
|
||||
using Quartz;
|
||||
using Quartz.Impl.Triggers;
|
||||
using RecurringIntegrationsScheduler.Common.Contracts;
|
||||
using RecurringIntegrationsScheduler.Properties;
|
||||
using RecurringIntegrationsScheduler.Settings;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace RecurringIntegrationsScheduler.Forms
|
||||
{
|
||||
public partial class ExportJobV3 : Form
|
||||
{
|
||||
private const int CpNocloseButton = 0x200;
|
||||
|
||||
public ExportJobV3()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
protected override CreateParams CreateParams
|
||||
{
|
||||
get
|
||||
{
|
||||
var myCp = base.CreateParams;
|
||||
myCp.ClassStyle = myCp.ClassStyle | CpNocloseButton;
|
||||
return myCp;
|
||||
}
|
||||
}
|
||||
|
||||
public bool Cancelled { get; private set; }
|
||||
public IJobDetail JobDetail { get; set; }
|
||||
public ITrigger Trigger { get; set; }
|
||||
|
||||
private void ExportJobForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
Cancelled = false;
|
||||
//Few changes based on form mode (create or edit)
|
||||
Text = JobDetail == null
|
||||
? Resources.Add_export_job
|
||||
: string.Format(Resources.Edit_job_0, JobDetail.Key.Name);
|
||||
addToolStripButton.Text = JobDetail == null ? Resources.Add_to_schedule : Resources.Edit_job;
|
||||
jobName.Enabled = JobDetail == null;
|
||||
|
||||
jobGroupComboBox.DataSource = Properties.Settings.Default.JobGroups;
|
||||
jobGroupComboBox.ValueMember = null;
|
||||
jobGroupComboBox.DisplayMember = "Name";
|
||||
|
||||
jobGroupComboBox.Enabled = JobDetail == null;
|
||||
|
||||
instanceComboBox.DataSource = Properties.Settings.Default.Instances;
|
||||
instanceComboBox.ValueMember = null;
|
||||
instanceComboBox.DisplayMember = "Name";
|
||||
|
||||
var applications = Properties.Settings.Default.AadApplications.Where(x => x.AuthenticationType == AuthenticationType.User);
|
||||
var applicationsBindingList = new BindingList<AadApplication>(applications.ToList());
|
||||
aadApplicationComboBox.DataSource = applicationsBindingList;
|
||||
aadApplicationComboBox.ValueMember = null;
|
||||
aadApplicationComboBox.DisplayMember = "Name";
|
||||
|
||||
userComboBox.DataSource = Properties.Settings.Default.Users;
|
||||
userComboBox.ValueMember = null;
|
||||
userComboBox.DisplayMember = "Login";
|
||||
|
||||
startAtDateTimePicker.Value = DateTime.Now;
|
||||
|
||||
errorsFolder.Text = Properties.Settings.Default.DownloadErrorsFolder;
|
||||
|
||||
exportToPackageTextBox.Text = OdataActionsConstants.ExportToPackageActionPath;
|
||||
getExecutionSummaryStatusTextBox.Text = OdataActionsConstants.GetExecutionSummaryStatusActionPath;
|
||||
getExportedPackageUrlTextBox.Text = OdataActionsConstants.GetExportedPackageUrlActionPath;
|
||||
|
||||
if ((JobDetail != null) && (Trigger != null))
|
||||
{
|
||||
jobName.Text = JobDetail.Key.Name;
|
||||
|
||||
var jobGroup =
|
||||
((IEnumerable<JobGroup>) jobGroupComboBox.DataSource).FirstOrDefault(
|
||||
x => x.Name == JobDetail.Key.Group);
|
||||
jobGroupComboBox.SelectedItem = jobGroup;
|
||||
|
||||
jobDescription.Text = JobDetail.Description;
|
||||
|
||||
downloadFolder.Text = JobDetail.JobDataMap[SettingsConstants.DownloadSuccessDir]?.ToString() ?? string.Empty;
|
||||
errorsFolder.Text = JobDetail.JobDataMap[SettingsConstants.DownloadErrorsDir]?.ToString() ?? string.Empty;
|
||||
useStandardSubfolder.Checked = false;
|
||||
|
||||
unzipCheckBox.Checked = (JobDetail.JobDataMap[SettingsConstants.UnzipPackage] != null) &&
|
||||
Convert.ToBoolean(
|
||||
JobDetail.JobDataMap[SettingsConstants.UnzipPackage].ToString());
|
||||
addTimestampCheckBox.Checked = (JobDetail.JobDataMap[SettingsConstants.AddTimestamp] != null) &&
|
||||
Convert.ToBoolean(
|
||||
JobDetail.JobDataMap[SettingsConstants.AddTimestamp].ToString());
|
||||
deletePackageCheckBox.Checked = (JobDetail.JobDataMap[SettingsConstants.DeletePackage] != null) &&
|
||||
Convert.ToBoolean(
|
||||
JobDetail.JobDataMap[SettingsConstants.DeletePackage].ToString());
|
||||
serviceAuthRadioButton.Checked = (JobDetail.JobDataMap[SettingsConstants.UseServiceAuthentication] !=
|
||||
null) &&
|
||||
Convert.ToBoolean(
|
||||
JobDetail.JobDataMap[SettingsConstants.UseServiceAuthentication]
|
||||
.ToString());
|
||||
|
||||
dataProject.Text = JobDetail.JobDataMap[SettingsConstants.DataProject]?.ToString() ?? string.Empty;
|
||||
|
||||
legalEntity.Text = JobDetail.JobDataMap[SettingsConstants.Company]?.ToString() ?? string.Empty;
|
||||
|
||||
delayBetweenStatusCheckNumericUpDown.Value = Math.Round(Convert.ToDecimal(JobDetail.JobDataMap[SettingsConstants.DelayBetweenStatusCheck]));
|
||||
|
||||
delayBetweenAttemptsNumericUpDown.Value = Math.Round(Convert.ToDecimal(JobDetail.JobDataMap[SettingsConstants.DelayBetweenFiles]));
|
||||
|
||||
if (!serviceAuthRadioButton.Checked)
|
||||
{
|
||||
User axUser = null;
|
||||
if (JobDetail.JobDataMap[SettingsConstants.UserName] != null)
|
||||
axUser =
|
||||
((IEnumerable<User>) userComboBox.DataSource).FirstOrDefault(
|
||||
x => x.Login == JobDetail.JobDataMap[SettingsConstants.UserName].ToString());
|
||||
if (axUser == null)
|
||||
{
|
||||
var userName = JobDetail.JobDataMap[SettingsConstants.UserName];
|
||||
if (userName != null)
|
||||
axUser = new User
|
||||
{
|
||||
Login = userName.ToString(),
|
||||
Password = JobDetail.JobDataMap[SettingsConstants.UserPassword].ToString()
|
||||
};
|
||||
var disabledUser = new Users {axUser};
|
||||
userComboBox.DataSource = disabledUser;
|
||||
userComboBox.Enabled = false;
|
||||
}
|
||||
userComboBox.SelectedItem = axUser;
|
||||
}
|
||||
var application =
|
||||
((IEnumerable<AadApplication>) aadApplicationComboBox.DataSource).FirstOrDefault(app =>
|
||||
app.ClientId == JobDetail.JobDataMap[SettingsConstants.AadClientId].ToString());
|
||||
if (application == null)
|
||||
if (JobDetail.JobDataMap[SettingsConstants.AadClientSecret] == null)
|
||||
{
|
||||
application = new AadApplication
|
||||
{
|
||||
ClientId = JobDetail.JobDataMap[SettingsConstants.AadClientId].ToString(),
|
||||
Name = Resources.IMPORTED_CHANGE_THIS,
|
||||
AuthenticationType = AuthenticationType.User
|
||||
};
|
||||
Properties.Settings.Default.AadApplications.Add(application);
|
||||
applications = Properties.Settings.Default.AadApplications.Where(x => x.AuthenticationType == AuthenticationType.User);
|
||||
applicationsBindingList = new BindingList<AadApplication>(applications.ToList());
|
||||
aadApplicationComboBox.DataSource = applicationsBindingList;
|
||||
aadApplicationComboBox.ValueMember = null;
|
||||
aadApplicationComboBox.DisplayMember = "Name";
|
||||
}
|
||||
else
|
||||
{
|
||||
application = new AadApplication
|
||||
{
|
||||
ClientId = JobDetail.JobDataMap[SettingsConstants.AadClientId].ToString(),
|
||||
Secret = JobDetail.JobDataMap[SettingsConstants.AadClientSecret].ToString(),
|
||||
Name = Resources.IMPORTED,
|
||||
AuthenticationType = AuthenticationType.Service
|
||||
};
|
||||
var disabledApplication = new AadApplications {application};
|
||||
aadApplicationComboBox.DataSource = disabledApplication;
|
||||
aadApplicationComboBox.Enabled = false;
|
||||
authMethodPanel.Enabled = false;
|
||||
}
|
||||
aadApplicationComboBox.SelectedItem = application;
|
||||
|
||||
var axInstance = ((IEnumerable<Instance>) instanceComboBox.DataSource).FirstOrDefault(x =>
|
||||
(x.AosUri == JobDetail.JobDataMap[SettingsConstants.AosUri].ToString()) &&
|
||||
(x.AadTenant == JobDetail.JobDataMap[SettingsConstants.AadTenant].ToString()) &&
|
||||
(x.AzureAuthEndpoint == JobDetail.JobDataMap[SettingsConstants.AzureAuthEndpoint].ToString()));
|
||||
if (axInstance == null)
|
||||
{
|
||||
axInstance = new Instance
|
||||
{
|
||||
AosUri = JobDetail.JobDataMap[SettingsConstants.AosUri].ToString(),
|
||||
AadTenant = JobDetail.JobDataMap[SettingsConstants.AadTenant].ToString(),
|
||||
AzureAuthEndpoint = JobDetail.JobDataMap[SettingsConstants.AzureAuthEndpoint].ToString(),
|
||||
Name = Resources.IMPORTED_CHANGE_THIS
|
||||
};
|
||||
Properties.Settings.Default.Instances.Add(axInstance);
|
||||
}
|
||||
instanceComboBox.SelectedItem = axInstance;
|
||||
|
||||
pauseIndefinitelyCheckBox.Checked =
|
||||
(JobDetail.JobDataMap[SettingsConstants.IndefinitePause] != null) &&
|
||||
Convert.ToBoolean(JobDetail.JobDataMap[SettingsConstants.IndefinitePause].ToString());
|
||||
|
||||
if (Trigger.GetType() == typeof(SimpleTriggerImpl))
|
||||
{
|
||||
var localTrigger = (SimpleTriggerImpl) Trigger;
|
||||
simpleTriggerRadioButton.Checked = true;
|
||||
hoursDateTimePicker.Value = DateTime.Now.Date + localTrigger.RepeatInterval;
|
||||
minutesDateTimePicker.Value = DateTime.Now.Date + localTrigger.RepeatInterval;
|
||||
}
|
||||
else if (Trigger.GetType() == typeof(CronTriggerImpl))
|
||||
{
|
||||
var localTrigger = (CronTriggerImpl) Trigger;
|
||||
cronTriggerRadioButton.Checked = true;
|
||||
cronExpressionTextBox.Text = localTrigger.CronExpressionString;
|
||||
}
|
||||
if(JobDetail.JobDataMap[SettingsConstants.RetryCount] != null)
|
||||
{
|
||||
retriesCountUpDown.Value = Convert.ToDecimal(JobDetail.JobDataMap[SettingsConstants.RetryCount]);
|
||||
}
|
||||
if(JobDetail.JobDataMap[SettingsConstants.RetryDelay] != null)
|
||||
{
|
||||
retriesDelayUpDown.Value = Convert.ToDecimal(JobDetail.JobDataMap[SettingsConstants.RetryDelay]);
|
||||
}
|
||||
pauseOnExceptionsCheckBox.Checked =
|
||||
(JobDetail.JobDataMap[SettingsConstants.PauseJobOnException] != null) &&
|
||||
Convert.ToBoolean(JobDetail.JobDataMap[SettingsConstants.PauseJobOnException].ToString());
|
||||
|
||||
exportToPackageTextBox.Text = JobDetail.JobDataMap[SettingsConstants.ExportToPackageActionPath]?.ToString() ?? OdataActionsConstants.ExportToPackageActionPath;
|
||||
getExecutionSummaryStatusTextBox.Text = JobDetail.JobDataMap[SettingsConstants.GetExecutionSummaryStatusActionPath]?.ToString() ?? OdataActionsConstants.GetExecutionSummaryStatusActionPath;
|
||||
getExportedPackageUrlTextBox.Text = JobDetail.JobDataMap[SettingsConstants.GetExportedPackageUrlActionPath]?.ToString() ?? OdataActionsConstants.GetExportedPackageUrlActionPath;
|
||||
|
||||
Properties.Settings.Default.Save();
|
||||
}
|
||||
}
|
||||
|
||||
private void DownloadFolderBrowserButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (folderBrowserDialog.ShowDialog() == DialogResult.OK)
|
||||
downloadFolder.Text = folderBrowserDialog.SelectedPath;
|
||||
}
|
||||
|
||||
private void ErrorsFolderBrowserButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (folderBrowserDialog.ShowDialog() == DialogResult.OK)
|
||||
errorsFolder.Text = folderBrowserDialog.SelectedPath;
|
||||
}
|
||||
|
||||
private void UseStandardSubfolder_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (useStandardSubfolder.Checked)
|
||||
{
|
||||
errorsFolder.Enabled = false;
|
||||
errorsFolder.Text = Path.Combine(downloadFolder.Text, Properties.Settings.Default.DownloadErrorsFolder);
|
||||
errorsFolderBrowserButton.Enabled = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
errorsFolder.Enabled = true;
|
||||
errorsFolderBrowserButton.Enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void CronmakerLinkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
||||
{
|
||||
cronmakerLinkLabel.LinkVisited = true;
|
||||
Process.Start("http://www.cronmaker.com");
|
||||
}
|
||||
|
||||
private void CronTriggerRadioButton_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
simpleTriggerJobGroupBox.Enabled = !cronTriggerRadioButton.Checked;
|
||||
cronTriggerGroupBox.Enabled = cronTriggerRadioButton.Checked;
|
||||
}
|
||||
|
||||
private bool ValidateJobSettings()
|
||||
{
|
||||
if (cronTriggerRadioButton.Checked)
|
||||
{
|
||||
var date = GetScheduleForCron(cronExpressionTextBox.Text, DateTimeOffset.Now);
|
||||
if (date == DateTimeOffset.MinValue)
|
||||
return false;
|
||||
}
|
||||
var message = new StringBuilder();
|
||||
|
||||
if (string.IsNullOrEmpty(jobName.Text))
|
||||
message.AppendLine(Resources.Job_name_is_missing);
|
||||
|
||||
if (string.IsNullOrEmpty(jobGroupComboBox.Text))
|
||||
message.AppendLine(Resources.Job_group_is_not_selected);
|
||||
|
||||
if (string.IsNullOrEmpty(downloadFolder.Text))
|
||||
message.AppendLine(Resources.Download_folder_is_not_selected);
|
||||
|
||||
if (string.IsNullOrEmpty(errorsFolder.Text))
|
||||
message.AppendLine(Resources.Download_errors_folder_is_not_selected);
|
||||
|
||||
if ((instanceComboBox.SelectedItem == null) || string.IsNullOrEmpty(instanceComboBox.Text))
|
||||
message.AppendLine(Resources.Dynamics_instance_is_not_selected);
|
||||
|
||||
if (userAuthRadioButton.Checked &&
|
||||
((userComboBox.SelectedItem == null) || string.IsNullOrEmpty(userComboBox.Text)))
|
||||
message.AppendLine(Resources.User_is_not_selected);
|
||||
|
||||
if ((aadApplicationComboBox.SelectedItem == null) || string.IsNullOrEmpty(aadApplicationComboBox.Text))
|
||||
message.AppendLine(Resources.AAD_client_application_is_not_selected);
|
||||
|
||||
if (string.IsNullOrEmpty(dataProject.Text))
|
||||
message.AppendLine(Resources.Data_project_is_missing);
|
||||
|
||||
if (string.IsNullOrEmpty(legalEntity.Text))
|
||||
message.AppendLine(Resources.Legal_entity_is_missing);
|
||||
|
||||
if (string.IsNullOrEmpty(exportToPackageTextBox.Text))
|
||||
message.AppendLine(Resources.URL_for_ExportToPackage_action_is_missing);
|
||||
|
||||
if (string.IsNullOrEmpty(getExecutionSummaryStatusTextBox.Text))
|
||||
message.AppendLine(Resources.URL_for_GetExecutionSummaryStatus_action_is_missing);
|
||||
|
||||
if (string.IsNullOrEmpty(getExportedPackageUrlTextBox.Text))
|
||||
message.AppendLine(Resources.URL_for_GetExportedPackageUrl_action_is_missing);
|
||||
|
||||
if (message.Length > 0)
|
||||
MessageBox.Show(message.ToString(), Resources.Job_configuration_is_not_valid);
|
||||
|
||||
return message.Length == 0;
|
||||
}
|
||||
|
||||
private IJobDetail GetJobDetail()
|
||||
{
|
||||
var detail = JobBuilder
|
||||
.Create()
|
||||
.OfType(Type.GetType("RecurringIntegrationsScheduler.Job.Export,RecurringIntegrationsScheduler.Job.Export", true))
|
||||
.WithDescription(jobDescription.Text)
|
||||
.WithIdentity(new JobKey(jobName.Text, jobGroupComboBox.Text))
|
||||
.UsingJobData(GetJobDataMap())
|
||||
.Build();
|
||||
|
||||
return detail;
|
||||
}
|
||||
|
||||
private ITrigger GetTrigger(IJobDetail jobDetail)
|
||||
{
|
||||
var builder =
|
||||
TriggerBuilder
|
||||
.Create()
|
||||
.ForJob(jobDetail)
|
||||
.WithDescription(string.Format(Resources.Trigger_for_job_0_1, jobDetail.Key.Name,
|
||||
jobDetail.Key.Group))
|
||||
.WithIdentity(
|
||||
new TriggerKey(
|
||||
string.Format(Resources.Trigger_for_job_0_1, jobDetail.Key.Name, jobDetail.Key.Group),
|
||||
jobDetail.Key.Group));
|
||||
|
||||
if (simpleTriggerRadioButton.Checked)
|
||||
{
|
||||
var minutes = hoursDateTimePicker.Value.Hour*60;
|
||||
minutes = minutes + minutesDateTimePicker.Value.Minute;
|
||||
|
||||
return builder.WithSimpleSchedule(x => x
|
||||
.WithIntervalInMinutes(minutes)
|
||||
.RepeatForever())
|
||||
.StartNow()
|
||||
.Build();
|
||||
}
|
||||
return
|
||||
builder.WithSchedule(CronScheduleBuilder.CronSchedule(cronExpressionTextBox.Text))
|
||||
.StartAt(startAtDateTimePicker.Value.ToUniversalTime())
|
||||
.Build();
|
||||
}
|
||||
|
||||
private JobDataMap GetJobDataMap()
|
||||
{
|
||||
var instance = (Instance) instanceComboBox.SelectedItem;
|
||||
var user = (User) userComboBox.SelectedItem;
|
||||
var application = (AadApplication) aadApplicationComboBox.SelectedItem;
|
||||
|
||||
var map = new JobDataMap
|
||||
{
|
||||
{SettingsConstants.DownloadSuccessDir, downloadFolder.Text},
|
||||
{SettingsConstants.DownloadErrorsDir, errorsFolder.Text},
|
||||
{SettingsConstants.AadTenant, instance.AadTenant},
|
||||
{SettingsConstants.AzureAuthEndpoint, instance.AzureAuthEndpoint},
|
||||
{SettingsConstants.AosUri, instance.AosUri},
|
||||
{SettingsConstants.UseServiceAuthentication, serviceAuthRadioButton.Checked.ToString()},
|
||||
{SettingsConstants.AadClientId, application.ClientId},
|
||||
{SettingsConstants.UnzipPackage, unzipCheckBox.Checked.ToString()},
|
||||
{SettingsConstants.AddTimestamp, addTimestampCheckBox.Checked.ToString()},
|
||||
{SettingsConstants.DeletePackage, deletePackageCheckBox.Checked.ToString()},
|
||||
{SettingsConstants.DataProject, dataProject.Text},
|
||||
{SettingsConstants.Company, legalEntity.Text},
|
||||
{SettingsConstants.DelayBetweenFiles, delayBetweenAttemptsNumericUpDown.Value.ToString(CultureInfo.InvariantCulture)},
|
||||
{SettingsConstants.DelayBetweenStatusCheck, delayBetweenStatusCheckNumericUpDown.Value.ToString(CultureInfo.InvariantCulture)},
|
||||
{SettingsConstants.RetryCount, retriesCountUpDown.Value.ToString(CultureInfo.InvariantCulture)},
|
||||
{SettingsConstants.RetryDelay, retriesDelayUpDown.Value.ToString(CultureInfo.InvariantCulture)},
|
||||
{SettingsConstants.PauseJobOnException, pauseOnExceptionsCheckBox.Checked.ToString()},
|
||||
{SettingsConstants.ExportToPackageActionPath, exportToPackageTextBox.Text},
|
||||
{SettingsConstants.GetExecutionSummaryStatusActionPath, getExecutionSummaryStatusTextBox.Text},
|
||||
{SettingsConstants.GetExportedPackageUrlActionPath, getExportedPackageUrlTextBox.Text},
|
||||
{SettingsConstants.IndefinitePause, pauseIndefinitelyCheckBox.Checked.ToString()}
|
||||
};
|
||||
if (serviceAuthRadioButton.Checked)
|
||||
{
|
||||
map.Add(SettingsConstants.AadClientSecret, application.Secret);
|
||||
}
|
||||
else
|
||||
{
|
||||
map.Add(SettingsConstants.UserName, user.Login);
|
||||
map.Add(SettingsConstants.UserPassword, user.Password);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
private void CronDocsLinkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
||||
{
|
||||
cronmakerLinkLabel.LinkVisited = true;
|
||||
Process.Start("https://www.quartz-scheduler.net/documentation/quartz-3.x/tutorial/crontrigger.html");
|
||||
}
|
||||
|
||||
private void CalculateNextRunsButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
var scheduleTimes = new List<DateTimeOffset>();
|
||||
var time = DateTimeOffset.Now;
|
||||
|
||||
if (!string.IsNullOrEmpty(cronExpressionTextBox.Text))
|
||||
for (var i = 0; i <= 99; i++)
|
||||
{
|
||||
var date = GetScheduleForCron(cronExpressionTextBox.Text, time);
|
||||
if (date == DateTimeOffset.MinValue)
|
||||
return;
|
||||
if (date == null) continue;
|
||||
scheduleTimes.Add(date.Value);
|
||||
time = date.Value;
|
||||
}
|
||||
calculatedRunsTextBox.Text = string.Empty;
|
||||
foreach (var date in scheduleTimes)
|
||||
calculatedRunsTextBox.Text = calculatedRunsTextBox.Text + $@"{date.ToLocalTime():yyyy-MM-dd HH:mm:ss}" +
|
||||
Environment.NewLine;
|
||||
}
|
||||
|
||||
private static DateTimeOffset? GetScheduleForCron(string cronexpression, DateTimeOffset date)
|
||||
{
|
||||
try
|
||||
{
|
||||
var cron = new CronExpression(cronexpression);
|
||||
return cron.GetNextValidTimeAfter(date);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, Resources.Cron_expression_is_invalid);
|
||||
return DateTimeOffset.MinValue;
|
||||
}
|
||||
}
|
||||
|
||||
private void DownloadFolder_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (useStandardSubfolder.Checked)
|
||||
errorsFolder.Text = Path.Combine(downloadFolder.Text, Properties.Settings.Default.DownloadErrorsFolder);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(Resources.Check_if_path + Environment.NewLine + ex.Message, Resources.Warning);
|
||||
}
|
||||
}
|
||||
|
||||
private void MoreExamplesButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
var form = new CronExamples();
|
||||
form.ShowDialog();
|
||||
}
|
||||
|
||||
private void UnzipCheckBox_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
addTimestampCheckBox.Enabled = unzipCheckBox.Checked;
|
||||
deletePackageCheckBox.Enabled = unzipCheckBox.Checked;
|
||||
if (!unzipCheckBox.Checked)
|
||||
{
|
||||
addTimestampCheckBox.Checked = unzipCheckBox.Checked;
|
||||
deletePackageCheckBox.Checked = unzipCheckBox.Checked;
|
||||
}
|
||||
}
|
||||
|
||||
private void ServiceAuthRadioButton_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
var applications = serviceAuthRadioButton.Checked
|
||||
? Properties.Settings.Default.AadApplications.Where(x => x.AuthenticationType == AuthenticationType.Service)
|
||||
: Properties.Settings.Default.AadApplications.Where(x => x.AuthenticationType == AuthenticationType.User);
|
||||
var applicationsBindingList = new BindingList<AadApplication>(applications.ToList());
|
||||
aadApplicationComboBox.DataSource = applicationsBindingList;
|
||||
aadApplicationComboBox.ValueMember = null;
|
||||
aadApplicationComboBox.DisplayMember = "Name";
|
||||
|
||||
userComboBox.Enabled = !serviceAuthRadioButton.Checked;
|
||||
}
|
||||
|
||||
private void AddToolStripButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (JobDetail == null)
|
||||
{
|
||||
var jobKey = new JobKey(jobName.Text, jobGroupComboBox.Text);
|
||||
if (Scheduler.Instance.GetScheduler().CheckExists(jobKey).Result)
|
||||
if (
|
||||
MessageBox.Show(
|
||||
string.Format(Resources.Job_0_in_group_1_already_exists, jobKey.Name, jobKey.Group),
|
||||
Resources.Job_already_exists, MessageBoxButtons.YesNo) == DialogResult.No)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!ValidateJobSettings()) return;
|
||||
JobDetail = GetJobDetail();
|
||||
Trigger = GetTrigger(JobDetail);
|
||||
Close();
|
||||
}
|
||||
|
||||
private void CancelToolStripButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
Cancelled = true;
|
||||
Close();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,162 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="folderBrowserDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<data name="cronTriggerInfoTextBox.Text" xml:space="preserve">
|
||||
<value>With cron expression you can specify schedules such as “every Friday at noon”, or “every weekday and 9:30 am”, or even “every 5 minutes between 9:00 am and 10:00 am on every Monday, Wednesday and Friday during January”.
|
||||
|
||||
Default example above means: Each working day of the week (MON-FRI) run every 15 minutes (0/15) between 8:00 and 18:45 (8-18 - last run will be at 18:45)</value>
|
||||
</data>
|
||||
<metadata name="mainToolStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>180, 17</value>
|
||||
</metadata>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="cancelToolStripButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
|
||||
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
|
||||
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
|
||||
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
|
||||
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
|
||||
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
|
||||
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
|
||||
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
|
||||
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
|
||||
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<data name="addToolStripButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
|
||||
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
|
||||
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
|
||||
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
|
||||
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
|
||||
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
|
||||
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
|
||||
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
|
||||
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
|
||||
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
</root>
|
|
@ -137,7 +137,7 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
(ImportJobDetail.JobDataMap[SettingsConstants.ExecuteImport] != null) &&
|
||||
Convert.ToBoolean(ImportJobDetail.JobDataMap[SettingsConstants.ExecuteImport].ToString());
|
||||
|
||||
numericUpDownInterval.Value = Math.Round(Convert.ToDecimal(ImportJobDetail.JobDataMap[SettingsConstants.Interval]));
|
||||
numericUpDownInterval.Value = Math.Round(Convert.ToDecimal(ImportJobDetail.JobDataMap[SettingsConstants.DelayBetweenFiles]));
|
||||
|
||||
serviceAuthRadioButton.Checked =
|
||||
(ImportJobDetail.JobDataMap[SettingsConstants.UseServiceAuthentication] != null) &&
|
||||
|
@ -298,7 +298,7 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
(ExecutionJobDetail.JobDataMap[SettingsConstants.GetImportTargetErrorKeysFile] != null) &&
|
||||
Convert.ToBoolean(ExecutionJobDetail.JobDataMap[SettingsConstants.GetImportTargetErrorKeysFile].ToString());
|
||||
|
||||
numericUpDownStatusCheckInterval.Value = Math.Round(Convert.ToDecimal(ExecutionJobDetail.JobDataMap[SettingsConstants.StatusCheckInterval]));
|
||||
numericUpDownStatusCheckInterval.Value = Math.Round(Convert.ToDecimal(ExecutionJobDetail.JobDataMap[SettingsConstants.DelayBetweenStatusCheck]));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -581,7 +581,7 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
{SettingsConstants.GetAzureWriteUrlActionPath, getAzureWriteUrlPath},
|
||||
{SettingsConstants.ImportFromPackageActionPath, importFromPackagePath},
|
||||
{SettingsConstants.IndefinitePause, pauseIndefinitelyCheckBox.Checked.ToString()},
|
||||
{SettingsConstants.Interval, numericUpDownInterval.Value.ToString(CultureInfo.InvariantCulture)}
|
||||
{SettingsConstants.DelayBetweenFiles, numericUpDownInterval.Value.ToString(CultureInfo.InvariantCulture)}
|
||||
};
|
||||
if (serviceAuthRadioButton.Checked)
|
||||
{
|
||||
|
@ -622,7 +622,7 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
{SettingsConstants.GetImportTargetErrorKeysFileUrlPath, getImportTargetErrorKeysFileUrlPath},
|
||||
{SettingsConstants.GenerateImportTargetErrorKeysFilePath, generateImportTargetErrorKeysFilePath},
|
||||
{SettingsConstants.PackageTemplate, packageTemplateTextBox.Text},
|
||||
{SettingsConstants.StatusCheckInterval, numericUpDownStatusCheckInterval.Value.ToString(CultureInfo.InvariantCulture)}
|
||||
{SettingsConstants.DelayBetweenStatusCheck, numericUpDownStatusCheckInterval.Value.ToString(CultureInfo.InvariantCulture)}
|
||||
};
|
||||
if (serviceAuthRadioButton.Checked)
|
||||
{
|
||||
|
@ -640,7 +640,7 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
{
|
||||
cronmakerLinkLabel.LinkVisited = true;
|
||||
Process.Start(
|
||||
"http://www.quartz-scheduler.net/documentation/quartz-2.x/tutorial/crontrigger.html");
|
||||
"https://www.quartz-scheduler.net/documentation/quartz-3.x/tutorial/crontrigger.html");
|
||||
}
|
||||
|
||||
private void GetCronScheduleForUploadButton_Click(object sender, EventArgs e)
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,989 @@
|
|||
/* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
Licensed under the MIT License. */
|
||||
|
||||
using Quartz;
|
||||
using Quartz.Impl.Triggers;
|
||||
using RecurringIntegrationsScheduler.Common.Contracts;
|
||||
using RecurringIntegrationsScheduler.Properties;
|
||||
using RecurringIntegrationsScheduler.Settings;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace RecurringIntegrationsScheduler.Forms
|
||||
{
|
||||
public partial class ImportJobV3 : Form
|
||||
{
|
||||
private const int CpNocloseButton = 0x200;
|
||||
|
||||
public ImportJobV3()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
protected override CreateParams CreateParams
|
||||
{
|
||||
get
|
||||
{
|
||||
var myCp = base.CreateParams;
|
||||
myCp.ClassStyle = myCp.ClassStyle | CpNocloseButton;
|
||||
return myCp;
|
||||
}
|
||||
}
|
||||
|
||||
public bool Cancelled { get; private set; }
|
||||
public IJobDetail ImportJobDetail { get; set; }
|
||||
public ITrigger ImportTrigger { get; set; }
|
||||
public IJobDetail ExecutionJobDetail { get; set; }
|
||||
public ITrigger ExecutionTrigger { get; set; }
|
||||
|
||||
private void ImportJobForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
Cancelled = false;
|
||||
//Few changes based on form mode (create or edit)
|
||||
Text = ImportJobDetail == null
|
||||
? Resources.Add_import_job
|
||||
: string.Format(Resources.Edit_job_0, ImportJobDetail.Key.Name);
|
||||
addToolStripButton.Text = ImportJobDetail == null ? Resources.Add_to_schedule : Resources.Edit_job;
|
||||
jobName.Enabled = ImportJobDetail == null;
|
||||
|
||||
jobGroupComboBox.DataSource = Properties.Settings.Default.JobGroups;
|
||||
jobGroupComboBox.ValueMember = null;
|
||||
jobGroupComboBox.DisplayMember = "Name";
|
||||
|
||||
jobGroupComboBox.Enabled = ImportJobDetail == null;
|
||||
|
||||
instanceComboBox.DataSource = Properties.Settings.Default.Instances;
|
||||
instanceComboBox.ValueMember = null;
|
||||
instanceComboBox.DisplayMember = "Name";
|
||||
|
||||
var applications = Properties.Settings.Default.AadApplications.Where(x => x.AuthenticationType == AuthenticationType.User);
|
||||
var applicationsBindingList = new BindingList<AadApplication>(applications.ToList());
|
||||
appRegistrationComboBox.DataSource = applicationsBindingList;
|
||||
appRegistrationComboBox.ValueMember = null;
|
||||
appRegistrationComboBox.DisplayMember = "Name";
|
||||
|
||||
userComboBox.DataSource = Properties.Settings.Default.Users;
|
||||
userComboBox.ValueMember = null;
|
||||
userComboBox.DisplayMember = "Login";
|
||||
|
||||
orderByComboBox.DataSource = Enum.GetValues(typeof(OrderByOptions));
|
||||
|
||||
importJobStartAtDateTimePicker.Value = DateTime.Now;
|
||||
monitoringJobStartAtDateTimePicker.Value = DateTime.Now;
|
||||
|
||||
inputFolderTextBox.Text = Properties.Settings.Default.UploadInputFolder;
|
||||
uploadSuccessFolderTextBox.Text = Properties.Settings.Default.UploadSuccessFolder;
|
||||
uploadErrorsFolderTextBox.Text = Properties.Settings.Default.UploadErrorsFolder;
|
||||
processingSuccessFolderTextBox.Text = Properties.Settings.Default.ProcessingSuccessFolder;
|
||||
processingErrorsFolderTextBox.Text = Properties.Settings.Default.ProcessingErrorsFolder;
|
||||
|
||||
importFromPackageTextBox.Text = OdataActionsConstants.ImportFromPackageActionPath;
|
||||
getAzureWriteUrlTextBox.Text = OdataActionsConstants.GetAzureWriteUrlActionPath;
|
||||
getExecutionSummaryStatusTextBox.Text = OdataActionsConstants.GetExecutionSummaryStatusActionPath;
|
||||
getExecutionSummaryPageUrlTextBox.Text = OdataActionsConstants.GetExecutionSummaryPageUrlActionPath;
|
||||
getImportTargetErrorKeysFileUrlTextBox.Text = OdataActionsConstants.GetImportTargetErrorKeysFileUrlPath;
|
||||
generateImportTargetErrorKeysFileTextBox.Text = OdataActionsConstants.GenerateImportTargetErrorKeysFilePath;
|
||||
getExecutionErrorsTextBox.Text = OdataActionsConstants.GetExecutionErrorsPath;
|
||||
|
||||
if (ImportJobDetail != null)
|
||||
{
|
||||
jobName.Text = ImportJobDetail.Key.Name;
|
||||
|
||||
var jobGroup =
|
||||
((IEnumerable<JobGroup>) jobGroupComboBox.DataSource).FirstOrDefault(
|
||||
x => x.Name == ImportJobDetail.Key.Group);
|
||||
jobGroupComboBox.SelectedItem = jobGroup;
|
||||
|
||||
jobDescription.Text = ImportJobDetail.Description;
|
||||
|
||||
useStandardSubfolder.Checked = false;
|
||||
inputFolderTextBox.Text = ImportJobDetail.JobDataMap[SettingsConstants.InputDir]?.ToString() ??
|
||||
string.Empty;
|
||||
uploadSuccessFolderTextBox.Text =
|
||||
ImportJobDetail.JobDataMap[SettingsConstants.UploadSuccessDir]?.ToString() ?? string.Empty;
|
||||
|
||||
uploadErrorsFolderTextBox.Text =
|
||||
ImportJobDetail.JobDataMap[SettingsConstants.UploadErrorsDir]?.ToString() ?? string.Empty;
|
||||
|
||||
packageTemplateTextBox.Text =
|
||||
ImportJobDetail.JobDataMap[SettingsConstants.PackageTemplate]?.ToString() ?? string.Empty;
|
||||
|
||||
legalEntityTextBox.Text = ImportJobDetail.JobDataMap[SettingsConstants.Company]?.ToString() ??
|
||||
string.Empty;
|
||||
statusFileExtensionTextBox.Text =
|
||||
ImportJobDetail.JobDataMap[SettingsConstants.StatusFileExtension]?.ToString() ?? ".Status";
|
||||
|
||||
dataProject.Text = ImportJobDetail.JobDataMap[SettingsConstants.DataProject]?.ToString() ??
|
||||
string.Empty;
|
||||
|
||||
overwriteDataProjectCheckBox.Checked =
|
||||
(ImportJobDetail.JobDataMap[SettingsConstants.OverwriteDataProject] != null) &&
|
||||
Convert.ToBoolean(ImportJobDetail.JobDataMap[SettingsConstants.OverwriteDataProject].ToString());
|
||||
|
||||
executeImportCheckBox.Checked =
|
||||
(ImportJobDetail.JobDataMap[SettingsConstants.ExecuteImport] != null) &&
|
||||
Convert.ToBoolean(ImportJobDetail.JobDataMap[SettingsConstants.ExecuteImport].ToString());
|
||||
|
||||
delayBetweenFilesNumericUpDown.Value = Math.Round(Convert.ToDecimal(ImportJobDetail.JobDataMap[SettingsConstants.DelayBetweenFiles]));
|
||||
|
||||
serviceAuthRadioButton.Checked =
|
||||
(ImportJobDetail.JobDataMap[SettingsConstants.UseServiceAuthentication] != null) &&
|
||||
Convert.ToBoolean(ImportJobDetail.JobDataMap[SettingsConstants.UseServiceAuthentication].ToString());
|
||||
if (!serviceAuthRadioButton.Checked)
|
||||
{
|
||||
User axUser = null;
|
||||
if (ImportJobDetail.JobDataMap[SettingsConstants.UserName] != null)
|
||||
axUser =
|
||||
((IEnumerable<User>) userComboBox.DataSource).FirstOrDefault(
|
||||
x => x.Login == ImportJobDetail.JobDataMap[SettingsConstants.UserName].ToString());
|
||||
if (axUser == null)
|
||||
{
|
||||
var userName = ImportJobDetail.JobDataMap[SettingsConstants.UserName];
|
||||
if (userName != null)
|
||||
axUser = new User
|
||||
{
|
||||
Login = userName.ToString(),
|
||||
Password = ImportJobDetail.JobDataMap[SettingsConstants.UserPassword].ToString()
|
||||
};
|
||||
var disabledUser = new Users {axUser};
|
||||
userComboBox.DataSource = disabledUser;
|
||||
userComboBox.Enabled = false;
|
||||
}
|
||||
userComboBox.SelectedItem = axUser;
|
||||
}
|
||||
var application =
|
||||
((IEnumerable<AadApplication>) appRegistrationComboBox.DataSource).FirstOrDefault(app =>
|
||||
app.ClientId == ImportJobDetail.JobDataMap[SettingsConstants.AadClientId].ToString());
|
||||
if (application == null)
|
||||
if (ImportJobDetail.JobDataMap[SettingsConstants.AadClientSecret] == null)
|
||||
{
|
||||
application = new AadApplication
|
||||
{
|
||||
ClientId = ImportJobDetail.JobDataMap[SettingsConstants.AadClientId].ToString(),
|
||||
Name = Resources.IMPORTED_CHANGE_THIS,
|
||||
AuthenticationType = AuthenticationType.User
|
||||
};
|
||||
Properties.Settings.Default.AadApplications.Add(application);
|
||||
applications =
|
||||
Properties.Settings.Default.AadApplications.Where(x => x.AuthenticationType == AuthenticationType.User);
|
||||
applicationsBindingList = new BindingList<AadApplication>(applications.ToList());
|
||||
appRegistrationComboBox.DataSource = applicationsBindingList;
|
||||
appRegistrationComboBox.ValueMember = null;
|
||||
appRegistrationComboBox.DisplayMember = "Name";
|
||||
}
|
||||
else
|
||||
{
|
||||
application = new AadApplication
|
||||
{
|
||||
ClientId = ImportJobDetail.JobDataMap[SettingsConstants.AadClientId].ToString(),
|
||||
Secret = ImportJobDetail.JobDataMap[SettingsConstants.AadClientSecret].ToString(),
|
||||
Name = Resources.IMPORTED,
|
||||
AuthenticationType = AuthenticationType.Service
|
||||
};
|
||||
var disabledApplication = new AadApplications {application};
|
||||
appRegistrationComboBox.DataSource = disabledApplication;
|
||||
appRegistrationComboBox.Enabled = false;
|
||||
authMethodPanel.Enabled = false;
|
||||
}
|
||||
appRegistrationComboBox.SelectedItem = application;
|
||||
|
||||
var axInstance = ((IEnumerable<Instance>) instanceComboBox.DataSource).FirstOrDefault(x =>
|
||||
(x.AosUri == ImportJobDetail.JobDataMap[SettingsConstants.AosUri].ToString()) &&
|
||||
(x.AadTenant == ImportJobDetail.JobDataMap[SettingsConstants.AadTenant].ToString()) &&
|
||||
(x.AzureAuthEndpoint == ImportJobDetail.JobDataMap[SettingsConstants.AzureAuthEndpoint].ToString()));
|
||||
if (axInstance == null)
|
||||
{
|
||||
axInstance = new Instance
|
||||
{
|
||||
AosUri = ImportJobDetail.JobDataMap[SettingsConstants.AosUri].ToString(),
|
||||
AadTenant = ImportJobDetail.JobDataMap[SettingsConstants.AadTenant].ToString(),
|
||||
AzureAuthEndpoint = ImportJobDetail.JobDataMap[SettingsConstants.AzureAuthEndpoint].ToString(),
|
||||
Name = Resources.IMPORTED_CHANGE_THIS
|
||||
};
|
||||
Properties.Settings.Default.Instances.Add(axInstance);
|
||||
}
|
||||
instanceComboBox.SelectedItem = axInstance;
|
||||
|
||||
searchPatternTextBox.Text = ImportJobDetail.JobDataMap[SettingsConstants.SearchPattern]?.ToString() ??
|
||||
"*.*";
|
||||
orderByComboBox.DataSource = Enum.GetValues(typeof(OrderByOptions));
|
||||
var selectedOrderBy = OrderByOptions.FileName;
|
||||
if (ImportJobDetail.JobDataMap[SettingsConstants.OrderBy] != null)
|
||||
selectedOrderBy =
|
||||
(OrderByOptions)
|
||||
Enum.Parse(typeof(OrderByOptions),
|
||||
ImportJobDetail.JobDataMap[SettingsConstants.OrderBy].ToString());
|
||||
orderByComboBox.SelectedItem = selectedOrderBy;
|
||||
|
||||
orderDescendingRadioButton.Checked = (ImportJobDetail.JobDataMap[SettingsConstants.ReverseOrder] != null) &&
|
||||
Convert.ToBoolean(
|
||||
ImportJobDetail.JobDataMap[SettingsConstants.ReverseOrder]
|
||||
.ToString());
|
||||
inputFilesArePackagesCheckBox.Checked =
|
||||
(ImportJobDetail.JobDataMap[SettingsConstants.InputFilesArePackages] != null) &&
|
||||
Convert.ToBoolean(ImportJobDetail.JobDataMap[SettingsConstants.InputFilesArePackages].ToString());
|
||||
|
||||
pauseIndefinitelyCheckBox.Checked =
|
||||
(ImportJobDetail.JobDataMap[SettingsConstants.IndefinitePause] != null) &&
|
||||
Convert.ToBoolean(ImportJobDetail.JobDataMap[SettingsConstants.IndefinitePause].ToString());
|
||||
|
||||
if (ImportTrigger.GetType() == typeof(SimpleTriggerImpl))
|
||||
{
|
||||
var localTrigger = (SimpleTriggerImpl) ImportTrigger;
|
||||
importJobSimpleTriggerRadioButton.Checked = true;
|
||||
importJobHoursDateTimePicker.Value = DateTime.Now.Date + localTrigger.RepeatInterval;
|
||||
importJobMinutesDateTimePicker.Value = DateTime.Now.Date + localTrigger.RepeatInterval;
|
||||
}
|
||||
else if (ImportTrigger.GetType() == typeof(CronTriggerImpl))
|
||||
{
|
||||
var localTrigger = (CronTriggerImpl) ImportTrigger;
|
||||
importJobCronTriggerRadioButton.Checked = true;
|
||||
importJobCronExpressionTextBox.Text = localTrigger.CronExpressionString;
|
||||
}
|
||||
if(ImportJobDetail.JobDataMap[SettingsConstants.RetryCount] != null)
|
||||
{
|
||||
retriesCountUpDown.Value = Convert.ToDecimal(ImportJobDetail.JobDataMap[SettingsConstants.RetryCount]);
|
||||
}
|
||||
if(ImportJobDetail.JobDataMap[SettingsConstants.RetryDelay] != null)
|
||||
{
|
||||
retriesDelayUpDown.Value = Convert.ToDecimal(ImportJobDetail.JobDataMap[SettingsConstants.RetryDelay]);
|
||||
}
|
||||
pauseOnExceptionsCheckBox.Checked =
|
||||
(ImportJobDetail.JobDataMap[SettingsConstants.PauseJobOnException] != null) &&
|
||||
Convert.ToBoolean(ImportJobDetail.JobDataMap[SettingsConstants.PauseJobOnException].ToString());
|
||||
|
||||
importFromPackageTextBox.Text = ImportJobDetail.JobDataMap[SettingsConstants.ImportFromPackageActionPath]?.ToString() ?? OdataActionsConstants.ImportFromPackageActionPath;
|
||||
getAzureWriteUrlTextBox.Text = ImportJobDetail.JobDataMap[SettingsConstants.GetAzureWriteUrlActionPath]?.ToString() ?? OdataActionsConstants.GetAzureWriteUrlActionPath;
|
||||
|
||||
multicompanyCheckBox.Checked =
|
||||
(ImportJobDetail.JobDataMap[SettingsConstants.MultiCompanyImport] != null) &&
|
||||
Convert.ToBoolean(ImportJobDetail.JobDataMap[SettingsConstants.MultiCompanyImport].ToString());
|
||||
|
||||
getLegalEntityFromFilenameRadioButton.Checked = (ImportJobDetail.JobDataMap[SettingsConstants.GetLegalEntityFromFilename] != null) &&
|
||||
Convert.ToBoolean(
|
||||
ImportJobDetail.JobDataMap[SettingsConstants.GetLegalEntityFromFilename]
|
||||
.ToString());
|
||||
filenameSeparatorTextBox.Text = ImportJobDetail.JobDataMap[SettingsConstants.FilenameSeparator]?.ToString() ?? string.Empty;
|
||||
|
||||
if (ImportJobDetail.JobDataMap[SettingsConstants.LegalEntityTokenPosition] != null)
|
||||
{
|
||||
legalEntityTokenPositionNumericUpDown.Value = Convert.ToDecimal(ImportJobDetail.JobDataMap[SettingsConstants.LegalEntityTokenPosition]);
|
||||
}
|
||||
|
||||
Properties.Settings.Default.Save();
|
||||
}
|
||||
if ((ExecutionJobDetail != null) && (ExecutionTrigger != null))
|
||||
{
|
||||
useMonitoringJobCheckBox.Checked = true;
|
||||
processingSuccessFolderTextBox.Text =
|
||||
ExecutionJobDetail.JobDataMap[SettingsConstants.ProcessingSuccessDir]?.ToString() ?? string.Empty;
|
||||
processingErrorsFolderTextBox.Text =
|
||||
ExecutionJobDetail.JobDataMap[SettingsConstants.ProcessingErrorsDir]?.ToString() ?? string.Empty;
|
||||
|
||||
if (ExecutionTrigger.GetType() == typeof(SimpleTriggerImpl))
|
||||
{
|
||||
var localTrigger = (SimpleTriggerImpl)ExecutionTrigger;
|
||||
monitoringJobSimpleTriggerRadioButton.Checked = true;
|
||||
monitoringJobHoursDateTimePicker.Value = DateTime.Now.Date + localTrigger.RepeatInterval;
|
||||
monitoringJobMinutesDateTimePicker.Value = DateTime.Now.Date + localTrigger.RepeatInterval;
|
||||
}
|
||||
else if (ExecutionTrigger.GetType() == typeof(CronTriggerImpl))
|
||||
{
|
||||
var localTrigger = (CronTriggerImpl)ExecutionTrigger;
|
||||
monitoringJobCronTriggerRadioButton.Checked = true;
|
||||
monitoringJobCronExpressionTextBox.Text = localTrigger.CronExpressionString;
|
||||
}
|
||||
|
||||
getExecutionSummaryStatusTextBox.Text = ExecutionJobDetail.JobDataMap[SettingsConstants.GetExecutionSummaryStatusActionPath]?.ToString() ?? OdataActionsConstants.GetExecutionSummaryStatusActionPath;
|
||||
getExecutionSummaryPageUrlTextBox.Text = ExecutionJobDetail.JobDataMap[SettingsConstants.GetExecutionSummaryPageUrlActionPath]?.ToString() ?? OdataActionsConstants.GetExecutionSummaryPageUrlActionPath;
|
||||
getImportTargetErrorKeysFileUrlTextBox.Text = ExecutionJobDetail.JobDataMap[SettingsConstants.GetImportTargetErrorKeysFileUrlPath]?.ToString() ?? OdataActionsConstants.GetImportTargetErrorKeysFileUrlPath;
|
||||
generateImportTargetErrorKeysFileTextBox.Text = ExecutionJobDetail.JobDataMap[SettingsConstants.GenerateImportTargetErrorKeysFilePath]?.ToString() ?? OdataActionsConstants.GenerateImportTargetErrorKeysFilePath;
|
||||
getExecutionErrorsTextBox.Text = ExecutionJobDetail.JobDataMap[SettingsConstants.GetExecutionErrorsPath]?.ToString() ?? OdataActionsConstants.GetExecutionErrorsPath;
|
||||
|
||||
downloadErrorKeysFileCheckBox.Checked =
|
||||
(ExecutionJobDetail.JobDataMap[SettingsConstants.GetImportTargetErrorKeysFile] != null) &&
|
||||
Convert.ToBoolean(ExecutionJobDetail.JobDataMap[SettingsConstants.GetImportTargetErrorKeysFile].ToString());
|
||||
|
||||
getExecutionErrorsCheckBox.Checked =
|
||||
(ExecutionJobDetail.JobDataMap[SettingsConstants.GetExecutionErrors] != null) &&
|
||||
Convert.ToBoolean(ExecutionJobDetail.JobDataMap[SettingsConstants.GetExecutionErrors].ToString());
|
||||
|
||||
statusCheckDelayNumericUpDown.Value = Math.Round(Convert.ToDecimal(ExecutionJobDetail.JobDataMap[SettingsConstants.DelayBetweenStatusCheck]));
|
||||
}
|
||||
}
|
||||
|
||||
private bool ValidateJobSettings()
|
||||
{
|
||||
if (importJobCronTriggerRadioButton.Checked)
|
||||
{
|
||||
var date = GetScheduleForCron(importJobCronExpressionTextBox.Text, DateTimeOffset.Now);
|
||||
if (date == DateTimeOffset.MinValue)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (useMonitoringJobCheckBox.Checked && monitoringJobCronTriggerRadioButton.Checked)
|
||||
{
|
||||
var date = GetScheduleForCron(monitoringJobCronExpressionTextBox.Text, DateTimeOffset.Now);
|
||||
if (date == DateTimeOffset.MinValue)
|
||||
return false;
|
||||
}
|
||||
|
||||
var message = new StringBuilder();
|
||||
|
||||
if (string.IsNullOrEmpty(jobName.Text))
|
||||
message.AppendLine(Resources.Job_name_is_missing);
|
||||
|
||||
if ((jobGroupComboBox.SelectedItem == null) || string.IsNullOrEmpty(jobGroupComboBox.Text))
|
||||
message.AppendLine(Resources.Job_group_is_not_selected);
|
||||
|
||||
if (string.IsNullOrEmpty(topFolderTextBox.Text) && useStandardSubfolder.Checked)
|
||||
message.AppendLine(Resources.Top_uploads_folder_is_not_selected);
|
||||
|
||||
if (string.IsNullOrEmpty(inputFolderTextBox.Text))
|
||||
message.AppendLine(Resources.Input_folder_is_not_selected);
|
||||
|
||||
if (string.IsNullOrEmpty(uploadSuccessFolderTextBox.Text))
|
||||
message.AppendLine(Resources.Upload_success_folder_is_not_selected);
|
||||
|
||||
if (string.IsNullOrEmpty(uploadErrorsFolderTextBox.Text))
|
||||
message.AppendLine(Resources.Upload_errors_folder_is_not_selected);
|
||||
|
||||
if (string.IsNullOrEmpty(processingSuccessFolderTextBox.Text) && useMonitoringJobCheckBox.Checked)
|
||||
message.AppendLine(Resources.Processing_success_folder_is_not_selected);
|
||||
|
||||
if (string.IsNullOrEmpty(processingErrorsFolderTextBox.Text) && useMonitoringJobCheckBox.Checked)
|
||||
message.AppendLine(Resources.Processing_errors_folder_is_not_selected);
|
||||
|
||||
if (!multicompanyCheckBox.Checked && string.IsNullOrEmpty(legalEntityTextBox.Text))
|
||||
message.AppendLine(Resources.Legal_entity_is_missing);
|
||||
|
||||
if (string.IsNullOrEmpty(dataProject.Text))
|
||||
message.AppendLine(Resources.Data_project_is_missing);
|
||||
|
||||
if ((instanceComboBox.SelectedItem == null) || string.IsNullOrEmpty(instanceComboBox.Text))
|
||||
message.AppendLine(Resources.Dynamics_instance_is_not_selected);
|
||||
|
||||
if (userAuthRadioButton.Checked &&
|
||||
((userComboBox.SelectedItem == null) || string.IsNullOrEmpty(userComboBox.Text)))
|
||||
message.AppendLine(Resources.User_is_not_selected);
|
||||
|
||||
if ((appRegistrationComboBox.SelectedItem == null) || string.IsNullOrEmpty(appRegistrationComboBox.Text))
|
||||
message.AppendLine(Resources.AAD_client_application_is_not_selected);
|
||||
|
||||
if (string.IsNullOrEmpty(statusFileExtensionTextBox.Text) && useMonitoringJobCheckBox.Checked)
|
||||
message.AppendLine(Resources.Status_file_extension_is_not_specified);
|
||||
|
||||
if (!inputFilesArePackagesCheckBox.Checked && string.IsNullOrEmpty(packageTemplateTextBox.Text))
|
||||
message.AppendLine(Resources.Package_template_is_missing);
|
||||
|
||||
if (multicompanyCheckBox.Checked && getLegalEntityFromFilenameRadioButton.Checked)
|
||||
{
|
||||
if (string.IsNullOrEmpty(filenameSeparatorTextBox.Text))
|
||||
{
|
||||
message.AppendLine(Resources.Filename_separator_is_missing);
|
||||
}
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(getAzureWriteUrlTextBox.Text))
|
||||
message.AppendLine(Resources.URL_for_GetAzureWriteUrl_action_is_missing);
|
||||
|
||||
if (string.IsNullOrEmpty(importFromPackageTextBox.Text))
|
||||
message.AppendLine(Resources.URL_for_ImportFromPackage_action_is_missing);
|
||||
|
||||
if (string.IsNullOrEmpty(getExecutionSummaryStatusTextBox.Text))
|
||||
message.AppendLine(Resources.URL_for_GetExecutionSummaryStatus_action_is_missing);
|
||||
|
||||
if (string.IsNullOrEmpty(getExecutionSummaryPageUrlTextBox.Text))
|
||||
message.AppendLine(Resources.URL_for_GetExecutionSummaryPageUrl_action_is_missing);
|
||||
|
||||
if (string.IsNullOrEmpty(getImportTargetErrorKeysFileUrlTextBox.Text))
|
||||
message.AppendLine(Resources.URL_for_GetImportTargetErrorKeysFileUrl_action_is_missing);
|
||||
|
||||
if (string.IsNullOrEmpty(generateImportTargetErrorKeysFileTextBox.Text))
|
||||
message.AppendLine(Resources.URL_for_GenerateImportTargetErrorKeysFile_action_is_missing);
|
||||
|
||||
if (string.IsNullOrEmpty(getExecutionErrorsTextBox.Text))
|
||||
message.AppendLine(Resources.URL_for_GetExecutionErrors_action_is_missing);
|
||||
|
||||
if (message.Length > 0)
|
||||
MessageBox.Show(message.ToString(), Resources.Job_configuration_is_not_valid);
|
||||
|
||||
return message.Length == 0;
|
||||
}
|
||||
|
||||
private IJobDetail GetImportJobDetail()
|
||||
{
|
||||
var detail = JobBuilder
|
||||
.Create()
|
||||
.OfType(Type.GetType("RecurringIntegrationsScheduler.Job.Import,RecurringIntegrationsScheduler.Job.Import", true))
|
||||
.WithDescription(jobDescription.Text)
|
||||
.WithIdentity(new JobKey(jobName.Text, jobGroupComboBox.Text))
|
||||
.UsingJobData(GetImportJobDataMap())
|
||||
.Build();
|
||||
|
||||
return detail;
|
||||
}
|
||||
|
||||
private IJobDetail GetMonitorJobDetail()
|
||||
{
|
||||
var detail = JobBuilder
|
||||
.Create()
|
||||
.OfType(
|
||||
Type.GetType(
|
||||
"RecurringIntegrationsScheduler.Job.ExecutionMonitor,RecurringIntegrationsScheduler.Job.ExecutionMonitor",
|
||||
true))
|
||||
.WithDescription(string.Format(Resources.Execution_monitor_job_for_import_job_0_1, jobName.Text,
|
||||
jobGroupComboBox.Text))
|
||||
.WithIdentity(new JobKey($"{jobName.Text}-Execution monitor", jobGroupComboBox.Text))
|
||||
.UsingJobData(GetExecutionJobDataMap())
|
||||
.Build();
|
||||
|
||||
return detail;
|
||||
}
|
||||
|
||||
private ITrigger GetExecutionTrigger(IJobDetail jobDetail)
|
||||
{
|
||||
var builder =
|
||||
TriggerBuilder
|
||||
.Create()
|
||||
.ForJob(jobDetail)
|
||||
.WithDescription(string.Format(Resources.Trigger_for_job_0_1, jobDetail.Key.Name,
|
||||
jobDetail.Key.Group))
|
||||
.WithIdentity(
|
||||
new TriggerKey(
|
||||
string.Format(Resources.Trigger_for_job_0_1, jobDetail.Key.Name, jobDetail.Key.Group),
|
||||
jobDetail.Key.Group));
|
||||
|
||||
if (monitoringJobSimpleTriggerRadioButton.Checked)
|
||||
{
|
||||
var minutes = monitoringJobHoursDateTimePicker.Value.Hour * 60;
|
||||
minutes += monitoringJobMinutesDateTimePicker.Value.Minute;
|
||||
|
||||
return builder.WithSimpleSchedule(x => x
|
||||
.WithIntervalInMinutes(minutes)
|
||||
.RepeatForever())
|
||||
.StartNow()
|
||||
.Build();
|
||||
}
|
||||
return
|
||||
builder.WithSchedule(CronScheduleBuilder.CronSchedule(monitoringJobCronExpressionTextBox.Text))
|
||||
.StartAt(monitoringJobStartAtDateTimePicker.Value.ToUniversalTime())
|
||||
.Build();
|
||||
}
|
||||
|
||||
private ITrigger GetImportTrigger(IJobDetail jobDetail)
|
||||
{
|
||||
var builder =
|
||||
TriggerBuilder
|
||||
.Create()
|
||||
.ForJob(jobDetail)
|
||||
.WithDescription(string.Format(Resources.Trigger_for_job_0_1, jobDetail.Key.Name,
|
||||
jobDetail.Key.Group))
|
||||
.WithIdentity(
|
||||
new TriggerKey(
|
||||
string.Format(Resources.Trigger_for_job_0_1, jobDetail.Key.Name, jobDetail.Key.Group),
|
||||
jobDetail.Key.Group));
|
||||
|
||||
if (importJobSimpleTriggerRadioButton.Checked)
|
||||
{
|
||||
var minutes = importJobHoursDateTimePicker.Value.Hour * 60;
|
||||
minutes += importJobMinutesDateTimePicker.Value.Minute;
|
||||
|
||||
return builder.WithSimpleSchedule(x => x
|
||||
.WithIntervalInMinutes(minutes)
|
||||
.RepeatForever())
|
||||
.StartNow()
|
||||
.Build();
|
||||
}
|
||||
return
|
||||
builder.WithSchedule(CronScheduleBuilder.CronSchedule(importJobCronExpressionTextBox.Text))
|
||||
.StartAt(importJobStartAtDateTimePicker.Value.ToUniversalTime())
|
||||
.Build();
|
||||
}
|
||||
|
||||
private JobDataMap GetImportJobDataMap()
|
||||
{
|
||||
var instance = (Instance)instanceComboBox.SelectedItem;
|
||||
var user = (User)userComboBox.SelectedItem;
|
||||
var application = (AadApplication)appRegistrationComboBox.SelectedItem;
|
||||
|
||||
var map = new JobDataMap
|
||||
{
|
||||
{SettingsConstants.InputDir, inputFolderTextBox.Text},
|
||||
{SettingsConstants.UploadSuccessDir, uploadSuccessFolderTextBox.Text},
|
||||
{SettingsConstants.UploadErrorsDir, uploadErrorsFolderTextBox.Text},
|
||||
{SettingsConstants.Company, legalEntityTextBox.Text},
|
||||
{SettingsConstants.StatusFileExtension, statusFileExtensionTextBox.Text},
|
||||
{SettingsConstants.AadTenant, instance.AadTenant},
|
||||
{SettingsConstants.AzureAuthEndpoint, instance.AzureAuthEndpoint},
|
||||
{SettingsConstants.AosUri, instance.AosUri},
|
||||
{SettingsConstants.AadClientId, application.ClientId},
|
||||
{SettingsConstants.UseServiceAuthentication, serviceAuthRadioButton.Checked.ToString()},
|
||||
{SettingsConstants.ExecutionJobPresent, useMonitoringJobCheckBox.Checked.ToString()},
|
||||
{SettingsConstants.SearchPattern, searchPatternTextBox.Text},
|
||||
{SettingsConstants.OrderBy, orderByComboBox.SelectedItem.ToString()},
|
||||
{SettingsConstants.ReverseOrder, orderDescendingRadioButton.Checked.ToString()},
|
||||
{SettingsConstants.ExecuteImport, executeImportCheckBox.Checked.ToString()},
|
||||
{SettingsConstants.OverwriteDataProject, overwriteDataProjectCheckBox.Checked.ToString()},
|
||||
{SettingsConstants.DataProject, dataProject.Text},
|
||||
{SettingsConstants.PackageTemplate, packageTemplateTextBox.Text},
|
||||
{SettingsConstants.RetryCount, retriesCountUpDown.Value.ToString(CultureInfo.InvariantCulture)},
|
||||
{SettingsConstants.RetryDelay, retriesDelayUpDown.Value.ToString(CultureInfo.InvariantCulture)},
|
||||
{SettingsConstants.PauseJobOnException, pauseOnExceptionsCheckBox.Checked.ToString()},
|
||||
{SettingsConstants.GetAzureWriteUrlActionPath, getAzureWriteUrlTextBox.Text},
|
||||
{SettingsConstants.ImportFromPackageActionPath, importFromPackageTextBox.Text},
|
||||
{SettingsConstants.IndefinitePause, pauseIndefinitelyCheckBox.Checked.ToString()},
|
||||
{SettingsConstants.DelayBetweenFiles, delayBetweenFilesNumericUpDown.Value.ToString(CultureInfo.InvariantCulture)},
|
||||
{SettingsConstants.MultiCompanyImport, multicompanyCheckBox.Checked.ToString()},
|
||||
{SettingsConstants.GetLegalEntityFromSubfolder, getLegalEntityFromSubfoldersRadioButton.Checked.ToString()},
|
||||
{SettingsConstants.GetLegalEntityFromFilename, getLegalEntityFromFilenameRadioButton.Checked.ToString()},
|
||||
{SettingsConstants.FilenameSeparator, filenameSeparatorTextBox.Text},
|
||||
{SettingsConstants.LegalEntityTokenPosition, legalEntityTokenPositionNumericUpDown.Value.ToString(CultureInfo.InvariantCulture)},
|
||||
{SettingsConstants.InputFilesArePackages, inputFilesArePackagesCheckBox.Checked.ToString()}
|
||||
};
|
||||
if (serviceAuthRadioButton.Checked)
|
||||
{
|
||||
map.Add(SettingsConstants.AadClientSecret, application.Secret);
|
||||
}
|
||||
else
|
||||
{
|
||||
map.Add(SettingsConstants.UserName, user.Login);
|
||||
map.Add(SettingsConstants.UserPassword, user.Password);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
private JobDataMap GetExecutionJobDataMap()
|
||||
{
|
||||
var instance = (Instance)instanceComboBox.SelectedItem;
|
||||
var user = (User)userComboBox.SelectedItem;
|
||||
var application = (AadApplication)appRegistrationComboBox.SelectedItem;
|
||||
|
||||
var map = new JobDataMap
|
||||
{
|
||||
{SettingsConstants.UploadSuccessDir, uploadSuccessFolderTextBox.Text},
|
||||
{SettingsConstants.ProcessingSuccessDir, processingSuccessFolderTextBox.Text},
|
||||
{SettingsConstants.ProcessingErrorsDir, processingErrorsFolderTextBox.Text},
|
||||
{SettingsConstants.StatusFileExtension, statusFileExtensionTextBox.Text},
|
||||
{SettingsConstants.AadTenant, instance.AadTenant},
|
||||
{SettingsConstants.AzureAuthEndpoint, instance.AzureAuthEndpoint},
|
||||
{SettingsConstants.AosUri, instance.AosUri},
|
||||
{SettingsConstants.AadClientId, application.ClientId},
|
||||
{SettingsConstants.UseServiceAuthentication, serviceAuthRadioButton.Checked.ToString()},
|
||||
{SettingsConstants.RetryCount, retriesCountUpDown.Value.ToString(CultureInfo.InvariantCulture)},
|
||||
{SettingsConstants.RetryDelay, retriesDelayUpDown.Value.ToString(CultureInfo.InvariantCulture)},
|
||||
{SettingsConstants.PauseJobOnException, pauseOnExceptionsCheckBox.Checked.ToString()},
|
||||
{SettingsConstants.GetExecutionSummaryStatusActionPath, getExecutionSummaryStatusTextBox.Text},
|
||||
{SettingsConstants.GetExecutionSummaryPageUrlActionPath, getExecutionSummaryPageUrlTextBox.Text},
|
||||
{SettingsConstants.IndefinitePause, pauseIndefinitelyCheckBox.Checked.ToString()},
|
||||
{SettingsConstants.GetImportTargetErrorKeysFile, downloadErrorKeysFileCheckBox.Checked.ToString()},
|
||||
{SettingsConstants.GetImportTargetErrorKeysFileUrlPath, getImportTargetErrorKeysFileUrlTextBox.Text},
|
||||
{SettingsConstants.GenerateImportTargetErrorKeysFilePath, generateImportTargetErrorKeysFileTextBox.Text},
|
||||
{SettingsConstants.PackageTemplate, packageTemplateTextBox.Text},
|
||||
{SettingsConstants.DelayBetweenStatusCheck, statusCheckDelayNumericUpDown.Value.ToString(CultureInfo.InvariantCulture)},
|
||||
{SettingsConstants.GetExecutionErrors, getExecutionErrorsCheckBox.Checked.ToString()},
|
||||
{SettingsConstants.GetExecutionErrorsPath, getExecutionErrorsTextBox.Text}
|
||||
};
|
||||
if (serviceAuthRadioButton.Checked)
|
||||
{
|
||||
map.Add(SettingsConstants.AadClientSecret, application.Secret);
|
||||
}
|
||||
else
|
||||
{
|
||||
map.Add(SettingsConstants.UserName, user.Login);
|
||||
map.Add(SettingsConstants.UserPassword, user.Password);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
private static DateTimeOffset? GetScheduleForCron(string cronexpression, DateTimeOffset date)
|
||||
{
|
||||
try
|
||||
{
|
||||
var cron = new CronExpression(cronexpression);
|
||||
return cron.GetNextValidTimeAfter(date);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, Resources.Cron_expression_is_invalid);
|
||||
return DateTimeOffset.MinValue;
|
||||
}
|
||||
}
|
||||
|
||||
private void TopUploadFolderBrowserButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (folderBrowserDialog.ShowDialog() == DialogResult.OK)
|
||||
topFolderTextBox.Text = folderBrowserDialog.SelectedPath;
|
||||
}
|
||||
|
||||
private void UploadErrorsFolderBrowserButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (folderBrowserDialog.ShowDialog() == DialogResult.OK)
|
||||
uploadErrorsFolderTextBox.Text = folderBrowserDialog.SelectedPath;
|
||||
}
|
||||
|
||||
private void UseStandardSubfolder_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (useStandardSubfolder.Checked)
|
||||
{
|
||||
topFolderTextBox.Enabled = true;
|
||||
topFolderBrowserButton.Enabled = true;
|
||||
|
||||
inputFolderTextBox.Enabled = false;
|
||||
inputFolderTextBox.Text = Path.Combine(topFolderTextBox.Text,
|
||||
Properties.Settings.Default.UploadInputFolder);
|
||||
inputFolderBrowserButton.Enabled = false;
|
||||
|
||||
uploadSuccessFolderTextBox.Enabled = false;
|
||||
uploadSuccessFolderTextBox.Text = Path.Combine(topFolderTextBox.Text,
|
||||
Properties.Settings.Default.UploadSuccessFolder);
|
||||
uploadSuccessFolderBrowserButton.Enabled = false;
|
||||
|
||||
uploadErrorsFolderTextBox.Enabled = false;
|
||||
uploadErrorsFolderTextBox.Text = Path.Combine(topFolderTextBox.Text,
|
||||
Properties.Settings.Default.UploadErrorsFolder);
|
||||
uploadErrorsFolderBrowserButton.Enabled = false;
|
||||
|
||||
processingSuccessFolderTextBox.Enabled = false;
|
||||
processingSuccessFolderTextBox.Text = Path.Combine(topFolderTextBox.Text,
|
||||
Properties.Settings.Default.ProcessingSuccessFolder);
|
||||
processingSuccessFolderBrowserButton.Enabled = false;
|
||||
|
||||
processingErrorsFolderTextBox.Enabled = false;
|
||||
processingErrorsFolderTextBox.Text = Path.Combine(topFolderTextBox.Text,
|
||||
Properties.Settings.Default.ProcessingErrorsFolder);
|
||||
processingErrorsFolderBrowserButton.Enabled = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
topFolderTextBox.Enabled = false;
|
||||
topFolderBrowserButton.Enabled = false;
|
||||
|
||||
inputFolderTextBox.Enabled = true;
|
||||
inputFolderBrowserButton.Enabled = true;
|
||||
|
||||
uploadSuccessFolderTextBox.Enabled = true;
|
||||
uploadSuccessFolderBrowserButton.Enabled = true;
|
||||
|
||||
uploadErrorsFolderTextBox.Enabled = true;
|
||||
uploadErrorsFolderBrowserButton.Enabled = true;
|
||||
|
||||
processingSuccessFolderTextBox.Enabled = useMonitoringJobCheckBox.Checked;
|
||||
processingSuccessFolderBrowserButton.Enabled = useMonitoringJobCheckBox.Checked;
|
||||
|
||||
processingErrorsFolderTextBox.Enabled = useMonitoringJobCheckBox.Checked;
|
||||
processingErrorsFolderBrowserButton.Enabled = useMonitoringJobCheckBox.Checked;
|
||||
|
||||
if (string.IsNullOrEmpty(topFolderTextBox.Text))
|
||||
{
|
||||
inputFolderTextBox.Text = "";
|
||||
uploadSuccessFolderTextBox.Text = "";
|
||||
uploadErrorsFolderTextBox.Text = "";
|
||||
processingSuccessFolderTextBox.Text = "";
|
||||
processingErrorsFolderTextBox.Text = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void CronmakerLinkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
||||
{
|
||||
cronmakerLinkLabel.LinkVisited = true;
|
||||
Process.Start("http://www.cronmaker.com");
|
||||
}
|
||||
|
||||
private void ImportJobCronTriggerRadioButton_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
simpleTriggerImportJobGroupBox.Enabled = !importJobCronTriggerRadioButton.Checked;
|
||||
cronTriggerImportJobGroupBox.Enabled = importJobCronTriggerRadioButton.Checked;
|
||||
}
|
||||
|
||||
private void CronDocsLinkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
||||
{
|
||||
cronmakerLinkLabel.LinkVisited = true;
|
||||
Process.Start(
|
||||
"https://www.quartz-scheduler.net/documentation/quartz-3.x/tutorial/crontrigger.html");
|
||||
}
|
||||
|
||||
private void GetCronScheduleForUploadButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
var scheduleTimes = new List<DateTimeOffset>();
|
||||
|
||||
var time = DateTimeOffset.Now;
|
||||
|
||||
if (!string.IsNullOrEmpty(importJobCronExpressionTextBox.Text))
|
||||
for (var i = 0; i <= 99; i++)
|
||||
{
|
||||
var date = GetScheduleForCron(importJobCronExpressionTextBox.Text, time);
|
||||
if (date == DateTimeOffset.MinValue)
|
||||
return;
|
||||
if (date == null) continue;
|
||||
scheduleTimes.Add(date.Value);
|
||||
time = date.Value;
|
||||
}
|
||||
calculatedRunsImportTextBox.Text = string.Empty;
|
||||
foreach (var date in scheduleTimes)
|
||||
calculatedRunsImportTextBox.Text = calculatedRunsImportTextBox.Text + $@"{date.ToLocalTime():yyyy-MM-dd HH:mm:ss}" + Environment.NewLine;
|
||||
}
|
||||
|
||||
private void TopUploadFolder_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (useStandardSubfolder.Checked)
|
||||
{
|
||||
inputFolderTextBox.Text = Path.Combine(topFolderTextBox.Text,
|
||||
Properties.Settings.Default.UploadInputFolder);
|
||||
uploadSuccessFolderTextBox.Text = Path.Combine(topFolderTextBox.Text,
|
||||
Properties.Settings.Default.UploadSuccessFolder);
|
||||
uploadErrorsFolderTextBox.Text = Path.Combine(topFolderTextBox.Text,
|
||||
Properties.Settings.Default.UploadErrorsFolder);
|
||||
processingSuccessFolderTextBox.Text = Path.Combine(topFolderTextBox.Text,
|
||||
Properties.Settings.Default.ProcessingSuccessFolder);
|
||||
processingErrorsFolderTextBox.Text = Path.Combine(topFolderTextBox.Text,
|
||||
Properties.Settings.Default.ProcessingErrorsFolder);
|
||||
openFileDialog.InitialDirectory = topFolderTextBox.Text;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(Resources.Check_if_path + Environment.NewLine + ex.Message, Resources.Warning);
|
||||
}
|
||||
}
|
||||
|
||||
private void MoreExamplesButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
var form = new CronExamples();
|
||||
form.ShowDialog();
|
||||
}
|
||||
|
||||
private void UseMonitoringJobCheckBox_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
monitoringJobGroupBox.Enabled = useMonitoringJobCheckBox.Checked;
|
||||
|
||||
processingSuccessFolderTextBox.Enabled = useMonitoringJobCheckBox.Checked && !useStandardSubfolder.Checked;
|
||||
processingSuccessFolderBrowserButton.Enabled = useMonitoringJobCheckBox.Checked && !useStandardSubfolder.Checked;
|
||||
processingErrorsFolderTextBox.Enabled = useMonitoringJobCheckBox.Checked && !useStandardSubfolder.Checked;
|
||||
processingErrorsFolderBrowserButton.Enabled = useMonitoringJobCheckBox.Checked && !useStandardSubfolder.Checked;
|
||||
}
|
||||
|
||||
private void InputFolderButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (folderBrowserDialog.ShowDialog() == DialogResult.OK)
|
||||
inputFolderTextBox.Text = folderBrowserDialog.SelectedPath;
|
||||
}
|
||||
|
||||
private void UploadSuccessFolderButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (folderBrowserDialog.ShowDialog() == DialogResult.OK)
|
||||
uploadSuccessFolderTextBox.Text = folderBrowserDialog.SelectedPath;
|
||||
}
|
||||
|
||||
private void ProcessingSuccessFolderButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (folderBrowserDialog.ShowDialog() == DialogResult.OK)
|
||||
processingSuccessFolderTextBox.Text = folderBrowserDialog.SelectedPath;
|
||||
}
|
||||
|
||||
private void MonitoringJobCronTriggerRadioButton_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
simpleTriggerMonitoringJobGroupBox.Enabled = !monitoringJobCronTriggerRadioButton.Checked;
|
||||
cronTriggerMonitoringJobGroupBox.Enabled = monitoringJobCronTriggerRadioButton.Checked;
|
||||
}
|
||||
|
||||
private void GetCronScheduleForProcButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
var scheduleTimes = new List<DateTimeOffset>();
|
||||
|
||||
var time = DateTimeOffset.Now;
|
||||
|
||||
if (!string.IsNullOrEmpty(monitoringJobCronExpressionTextBox.Text))
|
||||
for (var i = 0; i <= 99; i++)
|
||||
{
|
||||
var date = GetScheduleForCron(monitoringJobCronExpressionTextBox.Text, time);
|
||||
if (date == DateTimeOffset.MinValue)
|
||||
return;
|
||||
if (date == null) continue;
|
||||
scheduleTimes.Add(date.Value);
|
||||
time = date.Value;
|
||||
}
|
||||
calculatedRunsImportTextBox.Text = string.Empty;
|
||||
foreach (var date in scheduleTimes)
|
||||
calculatedRunsImportTextBox.Text = calculatedRunsImportTextBox.Text + $@"{date.ToLocalTime():yyyy-MM-dd HH:mm:ss}" +
|
||||
Environment.NewLine;
|
||||
}
|
||||
|
||||
private void StatusFileExtensionTextBox_Leave(object sender, EventArgs e)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(statusFileExtensionTextBox.Text))
|
||||
{
|
||||
if (statusFileExtensionTextBox.Text.Substring(0, 1) != ".")
|
||||
statusFileExtensionTextBox.Text = $@".{statusFileExtensionTextBox.Text}";
|
||||
}
|
||||
else
|
||||
{
|
||||
statusFileExtensionTextBox.Text = @".Status";
|
||||
}
|
||||
}
|
||||
|
||||
private void ProcessingErrorsFolderBrowserButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (folderBrowserDialog.ShowDialog() == DialogResult.OK)
|
||||
processingErrorsFolderTextBox.Text = folderBrowserDialog.SelectedPath;
|
||||
}
|
||||
|
||||
private void ServiceAuthRadioButton_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
var applications = serviceAuthRadioButton.Checked
|
||||
? Properties.Settings.Default.AadApplications.Where(x => x.AuthenticationType == AuthenticationType.Service)
|
||||
: Properties.Settings.Default.AadApplications.Where(x => x.AuthenticationType == AuthenticationType.User);
|
||||
var applicationsBindingList = new BindingList<AadApplication>(applications.ToList());
|
||||
appRegistrationComboBox.DataSource = applicationsBindingList;
|
||||
appRegistrationComboBox.ValueMember = null;
|
||||
appRegistrationComboBox.DisplayMember = "Name";
|
||||
|
||||
userComboBox.Enabled = !serviceAuthRadioButton.Checked;
|
||||
}
|
||||
|
||||
private void PackageTemplateFileBrowserButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (openFileDialog.ShowDialog() == DialogResult.OK)
|
||||
packageTemplateTextBox.Text = openFileDialog.FileName;
|
||||
}
|
||||
|
||||
private void AddToolStripButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (ImportJobDetail == null)
|
||||
{
|
||||
var jobKey = new JobKey(jobName.Text, jobGroupComboBox.Text);
|
||||
if (Scheduler.Instance.GetScheduler().CheckExists(jobKey).Result)
|
||||
if (
|
||||
MessageBox.Show(
|
||||
string.Format(Resources.Job_0_in_group_1_already_exists, jobKey.Name, jobKey.Group),
|
||||
Resources.Job_already_exists, MessageBoxButtons.YesNo) == DialogResult.No)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!ValidateJobSettings()) return;
|
||||
ImportJobDetail = GetImportJobDetail();
|
||||
ImportTrigger = GetImportTrigger(ImportJobDetail);
|
||||
if (useMonitoringJobCheckBox.Checked)
|
||||
{
|
||||
ExecutionJobDetail = GetMonitorJobDetail();
|
||||
ExecutionTrigger = GetExecutionTrigger(ExecutionJobDetail);
|
||||
}
|
||||
Close();
|
||||
}
|
||||
|
||||
private void CancelToolStripButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
Cancelled = true;
|
||||
Close();
|
||||
}
|
||||
|
||||
private void GetCronScheduleForMonitoringButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
var scheduleTimes = new List<DateTimeOffset>();
|
||||
|
||||
var time = DateTimeOffset.Now;
|
||||
|
||||
if (!string.IsNullOrEmpty(monitoringJobCronExpressionTextBox.Text))
|
||||
for (var i = 0; i <= 99; i++)
|
||||
{
|
||||
var date = GetScheduleForCron(monitoringJobCronExpressionTextBox.Text, time);
|
||||
if (date == DateTimeOffset.MinValue)
|
||||
return;
|
||||
if (date == null) continue;
|
||||
scheduleTimes.Add(date.Value);
|
||||
time = date.Value;
|
||||
}
|
||||
calculatedRunsMonitoringTextBox.Text = string.Empty;
|
||||
foreach (var date in scheduleTimes)
|
||||
calculatedRunsMonitoringTextBox.Text = calculatedRunsMonitoringTextBox.Text + $@"{date.ToLocalTime():yyyy-MM-dd HH:mm:ss}" + Environment.NewLine;
|
||||
}
|
||||
|
||||
private void MoreExamplesMonitoringButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
var form = new CronExamples();
|
||||
form.ShowDialog();
|
||||
}
|
||||
|
||||
private void GetLegalEntityFromFilenameRadioButton_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
getLegalEntityFromFilenameDetailsGroupBox.Enabled = getLegalEntityFromFilenameRadioButton.Checked;
|
||||
}
|
||||
|
||||
private void LegalEntityTextBox_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
multicompanyCheckBox.Checked = legalEntityTextBox.Text.Length == 0;
|
||||
}
|
||||
|
||||
private void MulticompanyCheckBox_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
multiCompanyGetMethodPanel.Enabled = multicompanyCheckBox.Checked;
|
||||
legalEntityTextBox.Enabled = !multicompanyCheckBox.Checked;
|
||||
if(multicompanyCheckBox.Checked)
|
||||
{
|
||||
legalEntityTextBox.Text = string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
private void InputFilesArePackagesCheckBox_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
packageTemplateFileBrowserButton.Enabled = !inputFilesArePackagesCheckBox.Checked;
|
||||
packageTemplateTextBox.Enabled = !inputFilesArePackagesCheckBox.Checked;
|
||||
searchPatternTextBox.Enabled = !inputFilesArePackagesCheckBox.Checked;
|
||||
if(inputFilesArePackagesCheckBox.Checked)
|
||||
{
|
||||
searchPatternTextBox.Text = "*.zip";
|
||||
}
|
||||
}
|
||||
|
||||
private void FilenameSeparatorTextBox_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
separatorExampleButton.Enabled = !string.IsNullOrEmpty(filenameSeparatorTextBox.Text);
|
||||
|
||||
if(!string.IsNullOrEmpty(filenameSeparatorTextBox.Text))
|
||||
{
|
||||
var invalidCharacter = new Regex("[" + Regex.Escape(new string(System.IO.Path.GetInvalidFileNameChars())) + "]");
|
||||
if (invalidCharacter.IsMatch(filenameSeparatorTextBox.Text))
|
||||
{
|
||||
MessageBox.Show($"{filenameSeparatorTextBox.Text} is invalid character in filename", "Invalid separator");
|
||||
filenameSeparatorTextBox.Text = string.Empty;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
private void SeparatorExampleTextBox_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
separatorExampleLegalEntityTextBox.Text = string.Empty;
|
||||
}
|
||||
|
||||
private void SeparatorExampleButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
String[] separator = { filenameSeparatorTextBox.Text };
|
||||
var tokenList = separatorExampleTextBox.Text.Split(separator, 10, StringSplitOptions.RemoveEmptyEntries);
|
||||
separatorExampleLegalEntityTextBox.Text = tokenList[(int)legalEntityTokenPositionNumericUpDown.Value - 1];
|
||||
}
|
||||
|
||||
private void StatusFileExtensionTextBox_Leave_1(object sender, EventArgs e)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(statusFileExtensionTextBox.Text))
|
||||
{
|
||||
if (statusFileExtensionTextBox.Text.Substring(0, 1) != ".")
|
||||
statusFileExtensionTextBox.Text = $@".{statusFileExtensionTextBox.Text}";
|
||||
}
|
||||
else
|
||||
{
|
||||
statusFileExtensionTextBox.Text = @".Status";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,170 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="folderBrowserDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>12, 12</value>
|
||||
</metadata>
|
||||
<data name="cronTriggerInfoTextBox.Text" xml:space="preserve">
|
||||
<value>With cron expression you can specify schedules such as “every Friday at noon”, or “every weekday and 9:30 am”, or even “every 5 minutes between 9:00 am and 10:00 am on every Monday, Wednesday and Friday during January”.
|
||||
|
||||
Default example above means: Each working day of the week (MON-FRI) run every 15 minutes (0/15) between 8:00 and 18:45 (8-18 - last run will be at 18:45)</value>
|
||||
</data>
|
||||
<data name="monitoringCronTextBox.Text" xml:space="preserve">
|
||||
<value>With cron expression you can specify schedules such as “every Friday at noon”, or “every weekday and 9:30 am”, or even “every 5 minutes between 9:00 am and 10:00 am on every Monday, Wednesday and Friday during January”.
|
||||
|
||||
Default example above means: Each working day of the week (MON-FRI) run every 15 minutes (0/15) between 8:00 and 18:45 (8-18 - last run will be at 18:45)</value>
|
||||
</data>
|
||||
<metadata name="openFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>325, 12</value>
|
||||
</metadata>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="cancelToolStripButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
|
||||
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
|
||||
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
|
||||
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
|
||||
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
|
||||
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
|
||||
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
|
||||
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
|
||||
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
|
||||
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<data name="addToolStripButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
|
||||
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
|
||||
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
|
||||
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
|
||||
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
|
||||
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
|
||||
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
|
||||
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
|
||||
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
|
||||
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<metadata name="mainToolStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>507, 12</value>
|
||||
</metadata>
|
||||
</root>
|
|
@ -44,59 +44,65 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
this.panel1.Controls.Add(this.ButtonOK);
|
||||
this.panel1.Controls.Add(this.label1);
|
||||
this.panel1.Controls.Add(this.textBox1);
|
||||
this.panel1.Location = new System.Drawing.Point(13, 12);
|
||||
this.panel1.Location = new System.Drawing.Point(18, 18);
|
||||
this.panel1.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.panel1.Name = "panel1";
|
||||
this.panel1.Size = new System.Drawing.Size(391, 100);
|
||||
this.panel1.Size = new System.Drawing.Size(538, 150);
|
||||
this.panel1.TabIndex = 0;
|
||||
//
|
||||
// ButtonCancel
|
||||
//
|
||||
this.ButtonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.ButtonCancel.Location = new System.Drawing.Point(194, 57);
|
||||
this.ButtonCancel.Location = new System.Drawing.Point(267, 86);
|
||||
this.ButtonCancel.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.ButtonCancel.Name = "ButtonCancel";
|
||||
this.ButtonCancel.Size = new System.Drawing.Size(91, 35);
|
||||
this.ButtonCancel.Size = new System.Drawing.Size(125, 52);
|
||||
this.ButtonCancel.TabIndex = 9;
|
||||
this.ButtonCancel.Text = Resources.Cancel;
|
||||
this.ButtonCancel.Text = global::RecurringIntegrationsScheduler.Properties.Resources.Cancel;
|
||||
this.ButtonCancel.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// ButtonOK
|
||||
//
|
||||
this.ButtonOK.DialogResult = System.Windows.Forms.DialogResult.OK;
|
||||
this.ButtonOK.Location = new System.Drawing.Point(97, 57);
|
||||
this.ButtonOK.Location = new System.Drawing.Point(133, 86);
|
||||
this.ButtonOK.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.ButtonOK.Name = "ButtonOK";
|
||||
this.ButtonOK.Size = new System.Drawing.Size(91, 35);
|
||||
this.ButtonOK.Size = new System.Drawing.Size(125, 52);
|
||||
this.ButtonOK.TabIndex = 8;
|
||||
this.ButtonOK.Text = Resources.OK;
|
||||
this.ButtonOK.Text = global::RecurringIntegrationsScheduler.Properties.Resources.OK;
|
||||
this.ButtonOK.UseVisualStyleBackColor = true;
|
||||
this.ButtonOK.Click += new System.EventHandler(this.ButtonOK_Click);
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(16, 21);
|
||||
this.label1.Location = new System.Drawing.Point(22, 32);
|
||||
this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(111, 17);
|
||||
this.label1.Size = new System.Drawing.Size(184, 25);
|
||||
this.label1.TabIndex = 1;
|
||||
this.label1.Text = Resources.Job_group_name;
|
||||
this.label1.Text = "RIS job group name";
|
||||
//
|
||||
// textBox1
|
||||
//
|
||||
this.textBox1.Location = new System.Drawing.Point(133, 18);
|
||||
this.textBox1.Location = new System.Drawing.Point(214, 27);
|
||||
this.textBox1.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.textBox1.Name = "textBox1";
|
||||
this.textBox1.Size = new System.Drawing.Size(239, 22);
|
||||
this.textBox1.Size = new System.Drawing.Size(296, 29);
|
||||
this.textBox1.TabIndex = 0;
|
||||
//
|
||||
// JobGroupForm
|
||||
//
|
||||
this.AcceptButton = this.ButtonOK;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(11F, 24F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.CancelButton = this.ButtonCancel;
|
||||
this.ClientSize = new System.Drawing.Size(419, 127);
|
||||
this.ClientSize = new System.Drawing.Size(568, 165);
|
||||
this.Controls.Add(this.panel1);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||
this.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.MaximizeBox = false;
|
||||
this.MaximumSize = new System.Drawing.Size(437, 174);
|
||||
this.MaximumSize = new System.Drawing.Size(592, 229);
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "JobGroupForm";
|
||||
this.ShowIcon = false;
|
||||
|
|
|
@ -78,18 +78,14 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
|
||||
private void SettingsButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
using (Parameters form = new Parameters())
|
||||
{
|
||||
form.ShowDialog();
|
||||
}
|
||||
using Parameters form = new Parameters();
|
||||
form.ShowDialog();
|
||||
}
|
||||
|
||||
private void AboutButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
using (AboutBox form = new AboutBox())
|
||||
{
|
||||
form.ShowDialog();
|
||||
}
|
||||
using AboutBox form = new AboutBox();
|
||||
form.ShowDialog();
|
||||
}
|
||||
|
||||
private void JobsDataGridView_RowStateChanged(object sender, DataGridViewRowStateChangedEventArgs e)
|
||||
|
@ -171,43 +167,41 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
|
||||
private void ConnectToServerButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
using (var form = new Connect())
|
||||
using var form = new Connect();
|
||||
form.ShowDialog();
|
||||
if (!form.Cancelled)
|
||||
{
|
||||
form.ShowDialog();
|
||||
if (!form.Cancelled)
|
||||
try
|
||||
{
|
||||
try
|
||||
{
|
||||
Scheduler.Instance.Connect(form.Server, form.Port, form.Scheduler);
|
||||
Scheduler.Instance.Connect(form.Server, form.Port, form.Scheduler);
|
||||
|
||||
if (Scheduler.Instance.GetScheduler() != null)
|
||||
{
|
||||
toolStripConnectionStatus.Text =
|
||||
string.Format(Resources.Connected_to,
|
||||
Scheduler.Instance.Address);
|
||||
connectToServerButton.Enabled = false;
|
||||
privateSchedulerButton.Enabled = false;
|
||||
addDownloadJobMenuItem.Enabled = true;
|
||||
addUploadJobMenuItem.Enabled = true;
|
||||
addImportJobMenuItem.Enabled = true;
|
||||
addExportJobMenuItem.Enabled = true;
|
||||
refreshButton.Enabled = true;
|
||||
|
||||
RefreshGrid();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
if (Scheduler.Instance.GetScheduler() != null)
|
||||
{
|
||||
MessageBox.Show(
|
||||
ex.Message,
|
||||
string.Format(
|
||||
Resources.Unable_to_connect_to_scheduler,
|
||||
form.Scheduler,
|
||||
form.Server,
|
||||
form.Port)
|
||||
);
|
||||
toolStripConnectionStatus.Text =
|
||||
string.Format(Resources.Connected_to,
|
||||
Scheduler.Instance.Address);
|
||||
connectToServerButton.Enabled = false;
|
||||
privateSchedulerButton.Enabled = false;
|
||||
addDownloadJobMenuItem.Enabled = true;
|
||||
addUploadJobMenuItem.Enabled = true;
|
||||
addImportJobMenuItem.Enabled = true;
|
||||
addExportJobMenuItem.Enabled = true;
|
||||
refreshButton.Enabled = true;
|
||||
|
||||
RefreshGrid();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(
|
||||
ex.Message,
|
||||
string.Format(
|
||||
Resources.Unable_to_connect_to_scheduler,
|
||||
form.Scheduler,
|
||||
form.Server,
|
||||
form.Port)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -231,35 +225,33 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
{
|
||||
try
|
||||
{
|
||||
using (FileDialog dialog = new SaveFileDialog())
|
||||
using FileDialog dialog = new SaveFileDialog();
|
||||
dialog.Filter = Resources.Recurring_Integrations_Schedule_xml;
|
||||
dialog.FileName = "Schedule";
|
||||
dialog.DefaultExt = "xml";
|
||||
dialog.AddExtension = true;
|
||||
|
||||
var defaultPath = Path.Combine(
|
||||
Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86),
|
||||
"RecurringIntegrationsScheduler");
|
||||
if (Directory.Exists(defaultPath))
|
||||
{
|
||||
dialog.Filter = Resources.Recurring_Integrations_Schedule_xml;
|
||||
dialog.FileName = "Schedule";
|
||||
dialog.DefaultExt = "xml";
|
||||
dialog.AddExtension = true;
|
||||
|
||||
var defaultPath = Path.Combine(
|
||||
Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86),
|
||||
"RecurringIntegrationsScheduler");
|
||||
if (Directory.Exists(defaultPath))
|
||||
{
|
||||
dialog.InitialDirectory = defaultPath;
|
||||
dialog.RestoreDirectory = true;
|
||||
}
|
||||
|
||||
dialog.ShowDialog();
|
||||
if (string.IsNullOrEmpty(dialog.FileName)) return;
|
||||
|
||||
var file = new FileInfo(dialog.FileName);
|
||||
if (file.Exists)
|
||||
{
|
||||
File.Move(file.FullName,
|
||||
file.FullName.Replace(".xml", "-Backup-" + DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss") + ".xml"));
|
||||
}
|
||||
|
||||
Scheduler.Instance.BackupToFile(file);
|
||||
_scheduleChanged = false;
|
||||
dialog.InitialDirectory = defaultPath;
|
||||
dialog.RestoreDirectory = true;
|
||||
}
|
||||
|
||||
dialog.ShowDialog();
|
||||
if (string.IsNullOrEmpty(dialog.FileName)) return;
|
||||
|
||||
var file = new FileInfo(dialog.FileName);
|
||||
if (file.Exists)
|
||||
{
|
||||
File.Move(file.FullName,
|
||||
file.FullName.Replace(".xml", "-Backup-" + DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss") + ".xml"));
|
||||
}
|
||||
|
||||
Scheduler.Instance.BackupToFile(file);
|
||||
_scheduleChanged = false;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
@ -352,42 +344,72 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
switch (jobDetail.JobType.FullName)
|
||||
{
|
||||
case SettingsConstants.DownloadJob:
|
||||
using (DownloadJob downloadForm = new DownloadJob
|
||||
{
|
||||
JobDetail = jobDetail,
|
||||
Trigger = jobTrigger
|
||||
})
|
||||
if (Properties.Settings.Default.V3Forms)
|
||||
{
|
||||
using DownloadJobV3 downloadForm = new DownloadJobV3
|
||||
{
|
||||
JobDetail = jobDetail,
|
||||
Trigger = jobTrigger
|
||||
};
|
||||
|
||||
downloadForm.ShowDialog();
|
||||
|
||||
if (!downloadForm.Cancelled && (downloadForm.JobDetail != null) &&
|
||||
(downloadForm.Trigger != null))
|
||||
{
|
||||
scheduler.ScheduleJob(
|
||||
downloadForm.JobDetail, new HashSet<ITrigger> { downloadForm.Trigger }, true);
|
||||
if (downloadForm.Cancelled && downloadForm.JobDetail == null && downloadForm.Trigger == null) return;
|
||||
|
||||
RefreshGrid();
|
||||
}
|
||||
scheduler.ScheduleJob(downloadForm.JobDetail, new HashSet<ITrigger> { downloadForm.Trigger }, true);
|
||||
|
||||
RefreshGrid();
|
||||
}
|
||||
else
|
||||
{
|
||||
using DownloadJob downloadForm = new DownloadJob
|
||||
{
|
||||
JobDetail = jobDetail,
|
||||
Trigger = jobTrigger
|
||||
};
|
||||
|
||||
downloadForm.ShowDialog();
|
||||
|
||||
if (downloadForm.Cancelled && downloadForm.JobDetail == null && downloadForm.Trigger == null) return;
|
||||
|
||||
scheduler.ScheduleJob(downloadForm.JobDetail, new HashSet<ITrigger> { downloadForm.Trigger }, true);
|
||||
|
||||
RefreshGrid();
|
||||
}
|
||||
break;
|
||||
|
||||
case SettingsConstants.ExportJob:
|
||||
using (ExportJob exportForm = new ExportJob
|
||||
{
|
||||
JobDetail = jobDetail,
|
||||
Trigger = jobTrigger
|
||||
})
|
||||
if (Properties.Settings.Default.V3Forms)
|
||||
{
|
||||
using ExportJob exportForm = new ExportJob
|
||||
{
|
||||
JobDetail = jobDetail,
|
||||
Trigger = jobTrigger
|
||||
};
|
||||
|
||||
exportForm.ShowDialog();
|
||||
|
||||
if (!exportForm.Cancelled && (exportForm.JobDetail != null) &&
|
||||
(exportForm.Trigger != null))
|
||||
{
|
||||
scheduler.ScheduleJob(
|
||||
exportForm.JobDetail, new HashSet<ITrigger> { exportForm.Trigger }, true);
|
||||
if (exportForm.Cancelled && exportForm.JobDetail == null && exportForm.Trigger == null) return;
|
||||
|
||||
RefreshGrid();
|
||||
}
|
||||
scheduler.ScheduleJob(exportForm.JobDetail, new HashSet<ITrigger> { exportForm.Trigger }, true);
|
||||
|
||||
RefreshGrid();
|
||||
}
|
||||
else
|
||||
{
|
||||
using ExportJobV3 exportForm = new ExportJobV3
|
||||
{
|
||||
JobDetail = jobDetail,
|
||||
Trigger = jobTrigger
|
||||
};
|
||||
|
||||
exportForm.ShowDialog();
|
||||
|
||||
if (exportForm.Cancelled && exportForm.JobDetail == null && exportForm.Trigger == null) return;
|
||||
|
||||
scheduler.ScheduleJob(exportForm.JobDetail, new HashSet<ITrigger> { exportForm.Trigger }, true);
|
||||
|
||||
RefreshGrid();
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -402,13 +424,13 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
{
|
||||
processingJobTrigger = scheduler.GetTriggersOfJob(processingJobKey).Result.First();
|
||||
}
|
||||
|
||||
using (UploadJob uploadForm = new UploadJob
|
||||
{
|
||||
UploadJobDetail = jobDetail,
|
||||
UploadTrigger = jobTrigger
|
||||
})
|
||||
if (Properties.Settings.Default.V3Forms)
|
||||
{
|
||||
using UploadJobV3 uploadForm = new UploadJobV3
|
||||
{
|
||||
UploadJobDetail = jobDetail,
|
||||
UploadTrigger = jobTrigger
|
||||
};
|
||||
if ((processingJobDetail != null) && (processingJobTrigger != null))
|
||||
{
|
||||
uploadForm.ProcessingJobDetail = processingJobDetail;
|
||||
|
@ -416,20 +438,43 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
}
|
||||
|
||||
uploadForm.ShowDialog();
|
||||
if (!uploadForm.Cancelled && (uploadForm.UploadJobDetail != null) &&
|
||||
(uploadForm.UploadTrigger != null))
|
||||
|
||||
if (uploadForm.Cancelled && uploadForm.UploadJobDetail == null && uploadForm.UploadTrigger == null) return;
|
||||
|
||||
scheduler.ScheduleJob(uploadForm.UploadJobDetail, new HashSet<ITrigger> { uploadForm.UploadTrigger }, true);
|
||||
|
||||
if ((uploadForm.ProcessingJobDetail != null) && (uploadForm.ProcessingTrigger != null))
|
||||
{
|
||||
scheduler.ScheduleJob(
|
||||
uploadForm.UploadJobDetail, new HashSet<ITrigger> { uploadForm.UploadTrigger }, true);
|
||||
|
||||
if ((uploadForm.ProcessingJobDetail != null) && (uploadForm.ProcessingTrigger != null))
|
||||
{
|
||||
scheduler.ScheduleJob(
|
||||
uploadForm.ProcessingJobDetail, new HashSet<ITrigger> { uploadForm.ProcessingTrigger }, true);
|
||||
}
|
||||
|
||||
RefreshGrid();
|
||||
scheduler.ScheduleJob(uploadForm.ProcessingJobDetail, new HashSet<ITrigger> { uploadForm.ProcessingTrigger }, true);
|
||||
}
|
||||
|
||||
RefreshGrid();
|
||||
}
|
||||
else
|
||||
{
|
||||
using UploadJob uploadForm = new UploadJob
|
||||
{
|
||||
UploadJobDetail = jobDetail,
|
||||
UploadTrigger = jobTrigger
|
||||
};
|
||||
if ((processingJobDetail != null) && (processingJobTrigger != null))
|
||||
{
|
||||
uploadForm.ProcessingJobDetail = processingJobDetail;
|
||||
uploadForm.ProcessingTrigger = processingJobTrigger;
|
||||
}
|
||||
|
||||
uploadForm.ShowDialog();
|
||||
|
||||
if (uploadForm.Cancelled && uploadForm.UploadJobDetail == null && uploadForm.UploadTrigger == null) return;
|
||||
|
||||
scheduler.ScheduleJob(uploadForm.UploadJobDetail, new HashSet<ITrigger> { uploadForm.UploadTrigger }, true);
|
||||
|
||||
if ((uploadForm.ProcessingJobDetail != null) && (uploadForm.ProcessingTrigger != null))
|
||||
{
|
||||
scheduler.ScheduleJob(uploadForm.ProcessingJobDetail, new HashSet<ITrigger> { uploadForm.ProcessingTrigger }, true);
|
||||
}
|
||||
|
||||
RefreshGrid();
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -444,40 +489,57 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
{
|
||||
executionJobTrigger = scheduler.GetTriggersOfJob(executionJobKey).Result.First();
|
||||
}
|
||||
if (Properties.Settings.Default.V3Forms)
|
||||
{
|
||||
using ImportJobV3 importForm = new ImportJobV3
|
||||
{
|
||||
ImportJobDetail = jobDetail,
|
||||
ImportTrigger = jobTrigger
|
||||
};
|
||||
|
||||
using (ImportJob importForm = new ImportJob
|
||||
{
|
||||
ImportJobDetail = jobDetail,
|
||||
ImportTrigger = jobTrigger
|
||||
})
|
||||
{
|
||||
if ((executionJobDetail != null) && (executionJobTrigger != null))
|
||||
{
|
||||
importForm.ExecutionJobDetail = executionJobDetail;
|
||||
importForm.ExecutionTrigger = executionJobTrigger;
|
||||
}
|
||||
|
||||
importForm.ShowDialog();
|
||||
if (!importForm.Cancelled && (importForm.ImportJobDetail != null) &&
|
||||
(importForm.ImportTrigger != null))
|
||||
|
||||
if (importForm.Cancelled && importForm.ImportJobDetail == null && importForm.ImportTrigger == null) return;
|
||||
|
||||
scheduler.ScheduleJob(importForm.ImportJobDetail, new HashSet<ITrigger> { importForm.ImportTrigger }, true);
|
||||
|
||||
if (importForm.ExecutionJobDetail != null && importForm.ExecutionTrigger != null)
|
||||
{
|
||||
scheduler.ScheduleJob(
|
||||
importForm.ImportJobDetail, new HashSet<ITrigger> { importForm.ImportTrigger }, true);
|
||||
|
||||
if ((importForm.ExecutionJobDetail != null) && (importForm.ExecutionTrigger != null))
|
||||
{
|
||||
scheduler.ScheduleJob(
|
||||
importForm.ExecutionJobDetail, new HashSet<ITrigger> { importForm.ExecutionTrigger }, true);
|
||||
}
|
||||
|
||||
RefreshGrid();
|
||||
scheduler.ScheduleJob(importForm.ExecutionJobDetail, new HashSet<ITrigger> { importForm.ExecutionTrigger }, true);
|
||||
}
|
||||
RefreshGrid();
|
||||
}
|
||||
else
|
||||
{
|
||||
using ImportJob importForm = new ImportJob
|
||||
{
|
||||
ImportJobDetail = jobDetail,
|
||||
ImportTrigger = jobTrigger
|
||||
};
|
||||
if ((executionJobDetail != null) && (executionJobTrigger != null))
|
||||
{
|
||||
importForm.ExecutionJobDetail = executionJobDetail;
|
||||
importForm.ExecutionTrigger = executionJobTrigger;
|
||||
}
|
||||
importForm.ShowDialog();
|
||||
|
||||
if (importForm.Cancelled && (importForm.ImportJobDetail == null) && (importForm.ImportTrigger == null))
|
||||
|
||||
scheduler.ScheduleJob(importForm.ImportJobDetail, new HashSet<ITrigger> { importForm.ImportTrigger }, true);
|
||||
|
||||
if (importForm.ExecutionJobDetail != null && importForm.ExecutionTrigger != null)
|
||||
{
|
||||
scheduler.ScheduleJob(importForm.ExecutionJobDetail, new HashSet<ITrigger> { importForm.ExecutionTrigger }, true);
|
||||
}
|
||||
RefreshGrid();
|
||||
}
|
||||
break;
|
||||
|
||||
case SettingsConstants.ProcessingJob:
|
||||
MessageBox.Show(Resources.Processing_monitoring_job_is_not_supported);
|
||||
break;
|
||||
default:
|
||||
MessageBox.Show(Resources.This_type_of_job_is_not_supported_for_direct_editing);
|
||||
return;
|
||||
|
@ -717,15 +779,15 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
var bd = (BindingSource)jobsDataGridView.DataSource;
|
||||
var dt = (DataTable)bd.DataSource;
|
||||
dt.DefaultView.RowFilter = string.Empty;
|
||||
if (instanceFilter.Text != string.Empty && jobNameFilter.Text == string.Empty)
|
||||
if (!string.IsNullOrEmpty(instanceFilter.Text) && string.IsNullOrEmpty(jobNameFilter.Text))
|
||||
{
|
||||
dt.DefaultView.RowFilter = $"Instance like '%{instanceFilter.Text}%'";
|
||||
}
|
||||
else if (instanceFilter.Text == string.Empty && jobNameFilter.Text != string.Empty)
|
||||
else if (string.IsNullOrEmpty(instanceFilter.Text) && !string.IsNullOrEmpty(jobNameFilter.Text))
|
||||
{
|
||||
dt.DefaultView.RowFilter = $"JobName like '%{jobNameFilter.Text}%'";
|
||||
}
|
||||
else if (instanceFilter.Text != string.Empty && jobNameFilter.Text != string.Empty)
|
||||
else if (!string.IsNullOrEmpty(instanceFilter.Text) && !string.IsNullOrEmpty(jobNameFilter.Text))
|
||||
{
|
||||
dt.DefaultView.RowFilter = $"Instance like '%{instanceFilter.Text}%' and JobName like '%{jobNameFilter.Text}%'";
|
||||
}
|
||||
|
@ -743,7 +805,7 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
var scheduler = Scheduler.Instance.GetScheduler();
|
||||
var jobDetail = scheduler.GetJobDetail(_selectedJobKey).Result;
|
||||
var path = jobDetail.JobDataMap[SettingsConstants.DownloadSuccessDir]?.ToString();
|
||||
if (!String.IsNullOrEmpty(path) && Directory.Exists(path))
|
||||
if (!string.IsNullOrEmpty(path) && Directory.Exists(path))
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -765,7 +827,7 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
var scheduler = Scheduler.Instance.GetScheduler();
|
||||
var jobDetail = scheduler.GetJobDetail(_selectedJobKey).Result;
|
||||
var path = jobDetail.JobDataMap[SettingsConstants.ProcessingErrorsDir]?.ToString();
|
||||
if (!String.IsNullOrEmpty(path) && Directory.Exists(path))
|
||||
if (!string.IsNullOrEmpty(path) && Directory.Exists(path))
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -787,7 +849,7 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
var scheduler = Scheduler.Instance.GetScheduler();
|
||||
var jobDetail = scheduler.GetJobDetail(_selectedJobKey).Result;
|
||||
var path = jobDetail.JobDataMap[SettingsConstants.ProcessingSuccessDir]?.ToString();
|
||||
if (!String.IsNullOrEmpty(path) && Directory.Exists(path))
|
||||
if (!string.IsNullOrEmpty(path) && Directory.Exists(path))
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -809,7 +871,7 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
var scheduler = Scheduler.Instance.GetScheduler();
|
||||
var jobDetail = scheduler.GetJobDetail(_selectedJobKey).Result;
|
||||
var path = jobDetail.JobDataMap[SettingsConstants.UploadErrorsDir]?.ToString();
|
||||
if (!String.IsNullOrEmpty(path) && Directory.Exists(path))
|
||||
if (!string.IsNullOrEmpty(path) && Directory.Exists(path))
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -831,7 +893,7 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
var scheduler = Scheduler.Instance.GetScheduler();
|
||||
var jobDetail = scheduler.GetJobDetail(_selectedJobKey).Result;
|
||||
var path = jobDetail.JobDataMap[SettingsConstants.UploadSuccessDir]?.ToString();
|
||||
if (!String.IsNullOrEmpty(path) && Directory.Exists(path))
|
||||
if (!string.IsNullOrEmpty(path) && Directory.Exists(path))
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -853,7 +915,7 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
var scheduler = Scheduler.Instance.GetScheduler();
|
||||
var jobDetail = scheduler.GetJobDetail(_selectedJobKey).Result;
|
||||
var path = jobDetail.JobDataMap[SettingsConstants.InputDir]?.ToString();
|
||||
if (!String.IsNullOrEmpty(path) && Directory.Exists(path))
|
||||
if (!string.IsNullOrEmpty(path) && Directory.Exists(path))
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -874,29 +936,47 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
{
|
||||
try
|
||||
{
|
||||
using (UploadJob form = new UploadJob())
|
||||
IJobDetail uploadJob;
|
||||
ITrigger uploadTrigger;
|
||||
IJobDetail monitorJob;
|
||||
ITrigger monitorTrigger;
|
||||
|
||||
if (Properties.Settings.Default.V3Forms)
|
||||
{
|
||||
using UploadJobV3 form = new UploadJobV3();
|
||||
form.ShowDialog();
|
||||
if (form.Cancelled || (form.UploadJobDetail == null) || (form.UploadTrigger == null)) return;
|
||||
|
||||
var scheduler = Scheduler.Instance.GetScheduler();
|
||||
if (scheduler == null)
|
||||
{
|
||||
MessageBox.Show(Resources.No_active_scheduler, Resources.Missing_scheduler);
|
||||
return;
|
||||
}
|
||||
|
||||
scheduler.ScheduleJob(
|
||||
form.UploadJobDetail, new HashSet<ITrigger> { form.UploadTrigger }, true);
|
||||
|
||||
if ((form.ProcessingJobDetail != null) && (form.ProcessingTrigger != null))
|
||||
{
|
||||
scheduler.ScheduleJob(
|
||||
form.ProcessingJobDetail, new HashSet<ITrigger> { form.ProcessingTrigger }, true);
|
||||
}
|
||||
_scheduleChanged = true;
|
||||
RefreshGrid();
|
||||
uploadJob = form.UploadJobDetail;
|
||||
uploadTrigger = form.UploadTrigger;
|
||||
monitorJob = form.ProcessingJobDetail;
|
||||
monitorTrigger = form.ProcessingTrigger;
|
||||
}
|
||||
else
|
||||
{
|
||||
using UploadJob form = new UploadJob();
|
||||
form.ShowDialog();
|
||||
if (form.Cancelled || (form.UploadJobDetail == null) || (form.UploadTrigger == null)) return;
|
||||
uploadJob = form.UploadJobDetail;
|
||||
uploadTrigger = form.UploadTrigger;
|
||||
monitorJob = form.ProcessingJobDetail;
|
||||
monitorTrigger = form.ProcessingTrigger;
|
||||
}
|
||||
var scheduler = Scheduler.Instance.GetScheduler();
|
||||
if (scheduler == null)
|
||||
{
|
||||
MessageBox.Show(Resources.No_active_scheduler, Resources.Missing_scheduler);
|
||||
return;
|
||||
}
|
||||
|
||||
scheduler.ScheduleJob(uploadJob, new HashSet<ITrigger> { uploadTrigger }, true);
|
||||
|
||||
if ((monitorJob != null) && (monitorTrigger != null))
|
||||
{
|
||||
scheduler.ScheduleJob(monitorJob, new HashSet<ITrigger> { monitorTrigger }, true);
|
||||
}
|
||||
_scheduleChanged = true;
|
||||
|
||||
RefreshGrid();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
@ -908,19 +988,36 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
{
|
||||
try
|
||||
{
|
||||
using (ExportJob form = new ExportJob())
|
||||
IJobDetail exportJob;
|
||||
ITrigger exportTrigger;
|
||||
|
||||
if (Properties.Settings.Default.V3Forms)
|
||||
{
|
||||
using ExportJobV3 form = new ExportJobV3();
|
||||
form.ShowDialog();
|
||||
|
||||
if (!form.Cancelled && (form.JobDetail != null) && (form.Trigger != null))
|
||||
{
|
||||
Scheduler.Instance.GetScheduler()
|
||||
.ScheduleJob(form.JobDetail, new HashSet<ITrigger> { form.Trigger }, true);
|
||||
|
||||
_scheduleChanged = true;
|
||||
RefreshGrid();
|
||||
}
|
||||
if (form.Cancelled && (form.JobDetail == null) && (form.Trigger == null)) return;
|
||||
exportJob = form.JobDetail;
|
||||
exportTrigger = form.Trigger;
|
||||
}
|
||||
else
|
||||
{
|
||||
using ExportJob form = new ExportJob();
|
||||
form.ShowDialog();
|
||||
if (form.Cancelled && (form.JobDetail == null) && (form.Trigger == null)) return;
|
||||
exportJob = form.JobDetail;
|
||||
exportTrigger = form.Trigger;
|
||||
}
|
||||
var scheduler = Scheduler.Instance.GetScheduler();
|
||||
if (scheduler == null)
|
||||
{
|
||||
MessageBox.Show(Resources.No_active_scheduler, Resources.Missing_scheduler);
|
||||
return;
|
||||
}
|
||||
scheduler.ScheduleJob(exportJob, new HashSet<ITrigger> { exportTrigger }, true);
|
||||
|
||||
_scheduleChanged = true;
|
||||
|
||||
RefreshGrid();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
@ -932,29 +1029,48 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
{
|
||||
try
|
||||
{
|
||||
using (ImportJob form = new ImportJob())
|
||||
IJobDetail importJob;
|
||||
ITrigger importTrigger;
|
||||
IJobDetail monitorJob;
|
||||
ITrigger monitorTrigger;
|
||||
|
||||
if(Properties.Settings.Default.V3Forms)
|
||||
{
|
||||
using ImportJobV3 form = new ImportJobV3();
|
||||
form.ShowDialog();
|
||||
if (form.Cancelled || (form.ImportJobDetail == null) || (form.ImportTrigger == null)) return;
|
||||
|
||||
var scheduler = Scheduler.Instance.GetScheduler();
|
||||
if (scheduler == null)
|
||||
{
|
||||
MessageBox.Show(Resources.No_active_scheduler, Resources.Missing_scheduler);
|
||||
return;
|
||||
}
|
||||
|
||||
scheduler.ScheduleJob(
|
||||
form.ImportJobDetail, new HashSet<ITrigger> { form.ImportTrigger }, true);
|
||||
|
||||
if ((form.ExecutionJobDetail != null) && (form.ExecutionTrigger != null))
|
||||
{
|
||||
scheduler.ScheduleJob(
|
||||
form.ExecutionJobDetail, new HashSet<ITrigger> { form.ExecutionTrigger }, true);
|
||||
}
|
||||
_scheduleChanged = true;
|
||||
RefreshGrid();
|
||||
importJob = form.ImportJobDetail;
|
||||
importTrigger = form.ImportTrigger;
|
||||
monitorJob = form.ExecutionJobDetail;
|
||||
monitorTrigger = form.ExecutionTrigger;
|
||||
}
|
||||
else
|
||||
{
|
||||
using ImportJob form = new ImportJob();
|
||||
form.ShowDialog();
|
||||
if (form.Cancelled || (form.ImportJobDetail == null) || (form.ImportTrigger == null)) return;
|
||||
importJob = form.ImportJobDetail;
|
||||
importTrigger = form.ImportTrigger;
|
||||
monitorJob = form.ExecutionJobDetail;
|
||||
monitorTrigger = form.ExecutionTrigger;
|
||||
}
|
||||
|
||||
var scheduler = Scheduler.Instance.GetScheduler();
|
||||
if (scheduler == null)
|
||||
{
|
||||
MessageBox.Show(Resources.No_active_scheduler, Resources.Missing_scheduler);
|
||||
return;
|
||||
}
|
||||
|
||||
scheduler.ScheduleJob(importJob, new HashSet<ITrigger> { importTrigger }, true);
|
||||
|
||||
if ((monitorJob != null) && (monitorTrigger != null))
|
||||
{
|
||||
scheduler.ScheduleJob(monitorJob, new HashSet<ITrigger> { monitorTrigger }, true);
|
||||
}
|
||||
_scheduleChanged = true;
|
||||
|
||||
RefreshGrid();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
@ -966,19 +1082,37 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
{
|
||||
try
|
||||
{
|
||||
using (DownloadJob form = new DownloadJob())
|
||||
IJobDetail downloadJob;
|
||||
ITrigger downloadTrigger;
|
||||
|
||||
if (Properties.Settings.Default.V3Forms)
|
||||
{
|
||||
using DownloadJobV3 form = new DownloadJobV3();
|
||||
form.ShowDialog();
|
||||
|
||||
if (!form.Cancelled && (form.JobDetail != null) && (form.Trigger != null))
|
||||
{
|
||||
Scheduler.Instance.GetScheduler()
|
||||
.ScheduleJob(form.JobDetail, new HashSet<ITrigger> { form.Trigger }, true);
|
||||
|
||||
_scheduleChanged = true;
|
||||
RefreshGrid();
|
||||
}
|
||||
if (form.Cancelled && (form.JobDetail == null) && (form.Trigger == null)) return;
|
||||
downloadJob = form.JobDetail;
|
||||
downloadTrigger = form.Trigger;
|
||||
}
|
||||
else
|
||||
{
|
||||
using DownloadJob form = new DownloadJob();
|
||||
form.ShowDialog();
|
||||
if (form.Cancelled && (form.JobDetail == null) && (form.Trigger == null)) return;
|
||||
downloadJob = form.JobDetail;
|
||||
downloadTrigger = form.Trigger;
|
||||
}
|
||||
var scheduler = Scheduler.Instance.GetScheduler();
|
||||
if (scheduler == null)
|
||||
{
|
||||
MessageBox.Show(Resources.No_active_scheduler, Resources.Missing_scheduler);
|
||||
return;
|
||||
}
|
||||
|
||||
scheduler.ScheduleJob(downloadJob, new HashSet<ITrigger> { downloadTrigger }, true);
|
||||
|
||||
_scheduleChanged = true;
|
||||
|
||||
RefreshGrid();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
|
@ -93,6 +93,8 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
this.applicationsDeleteButton = new System.Windows.Forms.ToolStripButton();
|
||||
this.applicationsEditButton = new System.Windows.Forms.ToolStripButton();
|
||||
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.miscSettingsGroupBox = new System.Windows.Forms.GroupBox();
|
||||
this.v3formsCheckbox = new System.Windows.Forms.CheckBox();
|
||||
this.instancesToolStrip.SuspendLayout();
|
||||
this.usersToolStrip.SuspendLayout();
|
||||
this.dataJobsToolStrip.SuspendLayout();
|
||||
|
@ -113,6 +115,7 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
((System.ComponentModel.ISupportInitialize)(this.applicationsGrid)).BeginInit();
|
||||
this.applicationsToolStrip.SuspendLayout();
|
||||
this.tableLayoutPanel1.SuspendLayout();
|
||||
this.miscSettingsGroupBox.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// instancesToolStrip
|
||||
|
@ -128,7 +131,7 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
this.instancesToolStrip.Location = new System.Drawing.Point(7, 436);
|
||||
this.instancesToolStrip.Name = "instancesToolStrip";
|
||||
this.instancesToolStrip.Padding = new System.Windows.Forms.Padding(0);
|
||||
this.instancesToolStrip.Size = new System.Drawing.Size(780, 40);
|
||||
this.instancesToolStrip.Size = new System.Drawing.Size(785, 40);
|
||||
this.instancesToolStrip.TabIndex = 2;
|
||||
//
|
||||
// instancesAddButton
|
||||
|
@ -182,7 +185,7 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
this.usersToolStrip.Location = new System.Drawing.Point(7, 437);
|
||||
this.usersToolStrip.Name = "usersToolStrip";
|
||||
this.usersToolStrip.Padding = new System.Windows.Forms.Padding(0);
|
||||
this.usersToolStrip.Size = new System.Drawing.Size(379, 40);
|
||||
this.usersToolStrip.Size = new System.Drawing.Size(381, 40);
|
||||
this.usersToolStrip.TabIndex = 3;
|
||||
//
|
||||
// usersAddButton
|
||||
|
@ -226,7 +229,7 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
this.dataJobsToolStrip.Location = new System.Drawing.Point(7, 436);
|
||||
this.dataJobsToolStrip.Name = "dataJobsToolStrip";
|
||||
this.dataJobsToolStrip.Padding = new System.Windows.Forms.Padding(0);
|
||||
this.dataJobsToolStrip.Size = new System.Drawing.Size(376, 40);
|
||||
this.dataJobsToolStrip.Size = new System.Drawing.Size(378, 40);
|
||||
this.dataJobsToolStrip.TabIndex = 3;
|
||||
//
|
||||
// dataJobsAddButton
|
||||
|
@ -270,7 +273,7 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
this.jobGroupsToolStrip.Location = new System.Drawing.Point(7, 437);
|
||||
this.jobGroupsToolStrip.Name = "jobGroupsToolStrip";
|
||||
this.jobGroupsToolStrip.Padding = new System.Windows.Forms.Padding(0);
|
||||
this.jobGroupsToolStrip.Size = new System.Drawing.Size(376, 40);
|
||||
this.jobGroupsToolStrip.Size = new System.Drawing.Size(378, 40);
|
||||
this.jobGroupsToolStrip.TabIndex = 4;
|
||||
//
|
||||
// jobGroupsAddButton
|
||||
|
@ -312,10 +315,10 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
this.instancesGroupBox.Margin = new System.Windows.Forms.Padding(5, 6, 5, 6);
|
||||
this.instancesGroupBox.Name = "instancesGroupBox";
|
||||
this.instancesGroupBox.Padding = new System.Windows.Forms.Padding(7, 14, 7, 7);
|
||||
this.instancesGroupBox.Size = new System.Drawing.Size(794, 483);
|
||||
this.instancesGroupBox.Size = new System.Drawing.Size(799, 483);
|
||||
this.instancesGroupBox.TabIndex = 1;
|
||||
this.instancesGroupBox.TabStop = false;
|
||||
this.instancesGroupBox.Text = "Dynamics 365 for Finance and Operations instances";
|
||||
this.instancesGroupBox.Text = "Dynamics 365 instances";
|
||||
//
|
||||
// instancesGrid
|
||||
//
|
||||
|
@ -341,7 +344,7 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
this.instancesGrid.RowHeadersVisible = false;
|
||||
this.instancesGrid.RowHeadersWidth = 4;
|
||||
this.instancesGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
|
||||
this.instancesGrid.Size = new System.Drawing.Size(780, 400);
|
||||
this.instancesGrid.Size = new System.Drawing.Size(785, 400);
|
||||
this.instancesGrid.TabIndex = 0;
|
||||
this.instancesGrid.CellContentDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.InstancesGrid_CellContentDoubleClick);
|
||||
this.instancesGrid.RowsRemoved += new System.Windows.Forms.DataGridViewRowsRemovedEventHandler(this.InstancesDataGridView_RowsRemoved);
|
||||
|
@ -391,11 +394,11 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
this.usersGroupBox.Controls.Add(this.usersDataGrid);
|
||||
this.usersGroupBox.Controls.Add(this.usersToolStrip);
|
||||
this.usersGroupBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.usersGroupBox.Location = new System.Drawing.Point(406, 501);
|
||||
this.usersGroupBox.Location = new System.Drawing.Point(409, 501);
|
||||
this.usersGroupBox.Margin = new System.Windows.Forms.Padding(5, 6, 5, 6);
|
||||
this.usersGroupBox.Name = "usersGroupBox";
|
||||
this.usersGroupBox.Padding = new System.Windows.Forms.Padding(7, 14, 7, 7);
|
||||
this.usersGroupBox.Size = new System.Drawing.Size(393, 484);
|
||||
this.usersGroupBox.Size = new System.Drawing.Size(395, 484);
|
||||
this.usersGroupBox.TabIndex = 0;
|
||||
this.usersGroupBox.TabStop = false;
|
||||
this.usersGroupBox.Text = "User credentials";
|
||||
|
@ -422,7 +425,7 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
this.usersDataGrid.RowHeadersVisible = false;
|
||||
this.usersDataGrid.RowHeadersWidth = 4;
|
||||
this.usersDataGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
|
||||
this.usersDataGrid.Size = new System.Drawing.Size(379, 401);
|
||||
this.usersDataGrid.Size = new System.Drawing.Size(381, 401);
|
||||
this.usersDataGrid.TabIndex = 1;
|
||||
this.usersDataGrid.CellContentDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.UsersDataGrid_CellContentDoubleClick);
|
||||
this.usersDataGrid.RowsRemoved += new System.Windows.Forms.DataGridViewRowsRemovedEventHandler(this.UsersDataGridView_RowsRemoved);
|
||||
|
@ -452,14 +455,14 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
this.dataJobsGroupBox.Controls.Add(this.dataJobsGrid);
|
||||
this.dataJobsGroupBox.Controls.Add(this.dataJobsToolStrip);
|
||||
this.dataJobsGroupBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.dataJobsGroupBox.Location = new System.Drawing.Point(809, 6);
|
||||
this.dataJobsGroupBox.Location = new System.Drawing.Point(814, 6);
|
||||
this.dataJobsGroupBox.Margin = new System.Windows.Forms.Padding(5, 6, 5, 6);
|
||||
this.dataJobsGroupBox.Name = "dataJobsGroupBox";
|
||||
this.dataJobsGroupBox.Padding = new System.Windows.Forms.Padding(7, 14, 7, 7);
|
||||
this.dataJobsGroupBox.Size = new System.Drawing.Size(390, 483);
|
||||
this.dataJobsGroupBox.Size = new System.Drawing.Size(392, 483);
|
||||
this.dataJobsGroupBox.TabIndex = 0;
|
||||
this.dataJobsGroupBox.TabStop = false;
|
||||
this.dataJobsGroupBox.Text = "Data jobs";
|
||||
this.dataJobsGroupBox.Text = "Dynamics data jobs";
|
||||
//
|
||||
// dataJobsGrid
|
||||
//
|
||||
|
@ -485,7 +488,7 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
this.dataJobsGrid.RowHeadersVisible = false;
|
||||
this.dataJobsGrid.RowHeadersWidth = 4;
|
||||
this.dataJobsGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
|
||||
this.dataJobsGrid.Size = new System.Drawing.Size(376, 400);
|
||||
this.dataJobsGrid.Size = new System.Drawing.Size(378, 400);
|
||||
this.dataJobsGrid.TabIndex = 0;
|
||||
this.dataJobsGrid.CellContentDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.DataJobsGrid_CellContentDoubleClick);
|
||||
this.dataJobsGrid.RowsRemoved += new System.Windows.Forms.DataGridViewRowsRemovedEventHandler(this.DataJobsDataGridView_RowsRemoved);
|
||||
|
@ -698,14 +701,14 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
this.jobGroupsGroupBox.Controls.Add(this.jobGroupsGrid);
|
||||
this.jobGroupsGroupBox.Controls.Add(this.jobGroupsToolStrip);
|
||||
this.jobGroupsGroupBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.jobGroupsGroupBox.Location = new System.Drawing.Point(809, 501);
|
||||
this.jobGroupsGroupBox.Location = new System.Drawing.Point(814, 501);
|
||||
this.jobGroupsGroupBox.Margin = new System.Windows.Forms.Padding(5, 6, 5, 6);
|
||||
this.jobGroupsGroupBox.Name = "jobGroupsGroupBox";
|
||||
this.jobGroupsGroupBox.Padding = new System.Windows.Forms.Padding(7, 14, 7, 7);
|
||||
this.jobGroupsGroupBox.Size = new System.Drawing.Size(390, 484);
|
||||
this.jobGroupsGroupBox.Size = new System.Drawing.Size(392, 484);
|
||||
this.jobGroupsGroupBox.TabIndex = 1;
|
||||
this.jobGroupsGroupBox.TabStop = false;
|
||||
this.jobGroupsGroupBox.Text = "Job groups";
|
||||
this.jobGroupsGroupBox.Text = "RIS job groups";
|
||||
//
|
||||
// jobGroupsGrid
|
||||
//
|
||||
|
@ -728,7 +731,7 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
this.jobGroupsGrid.RowHeadersVisible = false;
|
||||
this.jobGroupsGrid.RowHeadersWidth = 4;
|
||||
this.jobGroupsGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
|
||||
this.jobGroupsGrid.Size = new System.Drawing.Size(376, 401);
|
||||
this.jobGroupsGrid.Size = new System.Drawing.Size(378, 401);
|
||||
this.jobGroupsGrid.TabIndex = 1;
|
||||
this.jobGroupsGrid.CellContentDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.JobGroupsGrid_CellContentDoubleClick);
|
||||
this.jobGroupsGrid.RowsRemoved += new System.Windows.Forms.DataGridViewRowsRemovedEventHandler(this.JobGroupsDataGridView_RowsRemoved);
|
||||
|
@ -747,12 +750,11 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
this.foldersGroupBox.Controls.Add(this.uploadJobsFoldersGroupBox);
|
||||
this.foldersGroupBox.Controls.Add(this.processingJobsFoldersGroupBox);
|
||||
this.foldersGroupBox.Controls.Add(this.downloadJobsFolderGroupBox);
|
||||
this.foldersGroupBox.Location = new System.Drawing.Point(1208, 5);
|
||||
this.foldersGroupBox.Location = new System.Drawing.Point(1215, 5);
|
||||
this.foldersGroupBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||
this.foldersGroupBox.Name = "foldersGroupBox";
|
||||
this.foldersGroupBox.Padding = new System.Windows.Forms.Padding(7, 14, 7, 7);
|
||||
this.tableLayoutPanel1.SetRowSpan(this.foldersGroupBox, 2);
|
||||
this.foldersGroupBox.Size = new System.Drawing.Size(345, 492);
|
||||
this.foldersGroupBox.Size = new System.Drawing.Size(337, 477);
|
||||
this.foldersGroupBox.TabIndex = 2;
|
||||
this.foldersGroupBox.TabStop = false;
|
||||
this.foldersGroupBox.Text = "Default folder names";
|
||||
|
@ -766,10 +768,10 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
this.applicationsGroupBox.Margin = new System.Windows.Forms.Padding(5, 6, 5, 6);
|
||||
this.applicationsGroupBox.Name = "applicationsGroupBox";
|
||||
this.applicationsGroupBox.Padding = new System.Windows.Forms.Padding(7, 14, 7, 7);
|
||||
this.applicationsGroupBox.Size = new System.Drawing.Size(391, 484);
|
||||
this.applicationsGroupBox.Size = new System.Drawing.Size(394, 484);
|
||||
this.applicationsGroupBox.TabIndex = 8;
|
||||
this.applicationsGroupBox.TabStop = false;
|
||||
this.applicationsGroupBox.Text = "Azure AD applications";
|
||||
this.applicationsGroupBox.Text = "Azure App registrations";
|
||||
//
|
||||
// applicationsGrid
|
||||
//
|
||||
|
@ -795,7 +797,7 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
this.applicationsGrid.RowHeadersVisible = false;
|
||||
this.applicationsGrid.RowHeadersWidth = 4;
|
||||
this.applicationsGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
|
||||
this.applicationsGrid.Size = new System.Drawing.Size(377, 401);
|
||||
this.applicationsGrid.Size = new System.Drawing.Size(380, 401);
|
||||
this.applicationsGrid.TabIndex = 1;
|
||||
this.applicationsGrid.CellContentDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.ApplicationsGrid_CellContentDoubleClick);
|
||||
this.applicationsGrid.RowsRemoved += new System.Windows.Forms.DataGridViewRowsRemovedEventHandler(this.ApplicationsGrid_RowsRemoved);
|
||||
|
@ -849,7 +851,7 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
this.applicationsToolStrip.Location = new System.Drawing.Point(7, 437);
|
||||
this.applicationsToolStrip.Name = "applicationsToolStrip";
|
||||
this.applicationsToolStrip.Padding = new System.Windows.Forms.Padding(0);
|
||||
this.applicationsToolStrip.Size = new System.Drawing.Size(377, 40);
|
||||
this.applicationsToolStrip.Size = new System.Drawing.Size(380, 40);
|
||||
this.applicationsToolStrip.TabIndex = 4;
|
||||
//
|
||||
// applicationsAddButton
|
||||
|
@ -897,6 +899,7 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
this.tableLayoutPanel1.Controls.Add(this.instancesGroupBox, 0, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.usersGroupBox, 1, 1);
|
||||
this.tableLayoutPanel1.Controls.Add(this.applicationsGroupBox, 0, 1);
|
||||
this.tableLayoutPanel1.Controls.Add(this.miscSettingsGroupBox, 3, 1);
|
||||
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||
|
@ -907,6 +910,26 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
this.tableLayoutPanel1.Size = new System.Drawing.Size(1558, 991);
|
||||
this.tableLayoutPanel1.TabIndex = 9;
|
||||
//
|
||||
// miscSettingsGroupBox
|
||||
//
|
||||
this.miscSettingsGroupBox.Controls.Add(this.v3formsCheckbox);
|
||||
this.miscSettingsGroupBox.Location = new System.Drawing.Point(1214, 498);
|
||||
this.miscSettingsGroupBox.Name = "miscSettingsGroupBox";
|
||||
this.miscSettingsGroupBox.Size = new System.Drawing.Size(338, 487);
|
||||
this.miscSettingsGroupBox.TabIndex = 9;
|
||||
this.miscSettingsGroupBox.TabStop = false;
|
||||
this.miscSettingsGroupBox.Text = "Miscellaneous";
|
||||
//
|
||||
// v3formsCheckbox
|
||||
//
|
||||
this.v3formsCheckbox.AutoSize = true;
|
||||
this.v3formsCheckbox.Location = new System.Drawing.Point(14, 39);
|
||||
this.v3formsCheckbox.Name = "v3formsCheckbox";
|
||||
this.v3formsCheckbox.Size = new System.Drawing.Size(439, 51);
|
||||
this.v3formsCheckbox.TabIndex = 0;
|
||||
this.v3formsCheckbox.Text = "Use alternative job forms";
|
||||
this.v3formsCheckbox.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// Parameters
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(11F, 24F);
|
||||
|
@ -957,6 +980,8 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
this.applicationsToolStrip.ResumeLayout(false);
|
||||
this.applicationsToolStrip.PerformLayout();
|
||||
this.tableLayoutPanel1.ResumeLayout(false);
|
||||
this.miscSettingsGroupBox.ResumeLayout(false);
|
||||
this.miscSettingsGroupBox.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
@ -1025,5 +1050,7 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
private System.Windows.Forms.DataGridViewTextBoxColumn applicationType;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn applicationClientId;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn applicationSecret;
|
||||
private System.Windows.Forms.GroupBox miscSettingsGroupBox;
|
||||
private System.Windows.Forms.CheckBox v3formsCheckbox;
|
||||
}
|
||||
}
|
|
@ -29,6 +29,7 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
Properties.Settings.Default.UploadErrorsFolder = uploadErrorsFolder.Text;
|
||||
Properties.Settings.Default.UploadInputFolder = uploadInputFolder.Text;
|
||||
Properties.Settings.Default.UploadSuccessFolder = uploadSuccessFolder.Text;
|
||||
Properties.Settings.Default.V3Forms = v3formsCheckbox.Checked;
|
||||
Properties.Settings.Default.Save();
|
||||
}
|
||||
|
||||
|
@ -45,6 +46,13 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
instancesGrid.DataSource = Properties.Settings.Default.Instances;
|
||||
applicationsGrid.DataSource = Properties.Settings.Default.AadApplications;
|
||||
usersDataGrid.DataSource = Properties.Settings.Default.Users;
|
||||
processingErrorsFolder.Text = Properties.Settings.Default.ProcessingErrorsFolder;
|
||||
processingSuccessFolder.Text = Properties.Settings.Default.ProcessingSuccessFolder;
|
||||
downloadErrorsFolder.Text = Properties.Settings.Default.DownloadErrorsFolder;
|
||||
uploadErrorsFolder.Text = Properties.Settings.Default.UploadErrorsFolder;
|
||||
uploadInputFolder.Text = Properties.Settings.Default.UploadInputFolder;
|
||||
uploadSuccessFolder.Text = Properties.Settings.Default.UploadSuccessFolder;
|
||||
v3formsCheckbox.Checked = Properties.Settings.Default.V3Forms;
|
||||
}
|
||||
|
||||
private void InstancesDataGridView_RowsRemoved(object sender, DataGridViewRowsRemovedEventArgs e)
|
||||
|
@ -94,14 +102,12 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
|
||||
private void UsersAddButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
using (UserForm form = new UserForm())
|
||||
{
|
||||
if (form.ShowDialog() != DialogResult.OK) return;
|
||||
var axUser = form.User;
|
||||
if (axUser != null)
|
||||
axUser.Password = EncryptDecrypt.Encrypt(axUser.Password);
|
||||
Properties.Settings.Default.Users.Add(axUser);
|
||||
}
|
||||
using UserForm form = new UserForm();
|
||||
if (form.ShowDialog() != DialogResult.OK) return;
|
||||
var axUser = form.User;
|
||||
if (axUser != null)
|
||||
axUser.Password = EncryptDecrypt.Encrypt(axUser.Password);
|
||||
Properties.Settings.Default.Users.Add(axUser);
|
||||
}
|
||||
|
||||
private void UsersDeleteButton_Click(object sender, EventArgs e)
|
||||
|
@ -127,11 +133,9 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
|
||||
private void DataJobsAddButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
using (DataJobForm form = new DataJobForm())
|
||||
{
|
||||
if (form.ShowDialog() == DialogResult.OK)
|
||||
Properties.Settings.Default.DataJobs.Add(form.DataJob);
|
||||
}
|
||||
using DataJobForm form = new DataJobForm();
|
||||
if (form.ShowDialog() == DialogResult.OK)
|
||||
Properties.Settings.Default.DataJobs.Add(form.DataJob);
|
||||
}
|
||||
|
||||
private void DataJobsDeleteButton_Click(object sender, EventArgs e)
|
||||
|
@ -157,11 +161,9 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
|
||||
private void JobGroupsAddButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
using (JobGroupForm form = new JobGroupForm())
|
||||
{
|
||||
if (form.ShowDialog() == DialogResult.OK)
|
||||
Properties.Settings.Default.JobGroups.Add(form.JobGroup);
|
||||
}
|
||||
using JobGroupForm form = new JobGroupForm();
|
||||
if (form.ShowDialog() == DialogResult.OK)
|
||||
Properties.Settings.Default.JobGroups.Add(form.JobGroup);
|
||||
}
|
||||
|
||||
private void JobGroupsDeleteButton_Click(object sender, EventArgs e)
|
||||
|
@ -172,10 +174,8 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
|
||||
private void InstancesValidateButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
using (ValidateConnection form = new ValidateConnection { Instance = (Instance)instancesGrid.SelectedRows[0].DataBoundItem })
|
||||
{
|
||||
form.ShowDialog();
|
||||
}
|
||||
using ValidateConnection form = new ValidateConnection { Instance = (Instance)instancesGrid.SelectedRows[0].DataBoundItem };
|
||||
form.ShowDialog();
|
||||
}
|
||||
|
||||
private void InstancesDataGridView_SelectionChanged(object sender, EventArgs e)
|
||||
|
@ -188,16 +188,14 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
|
||||
private void ApplicationsAddButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
using (AadApplicationForm form = new AadApplicationForm())
|
||||
{
|
||||
if (form.ShowDialog() != DialogResult.OK) return;
|
||||
using AadApplicationForm form = new AadApplicationForm();
|
||||
if (form.ShowDialog() != DialogResult.OK) return;
|
||||
|
||||
var application = form.AadApplication;
|
||||
if ((application != null) && (application.Secret != string.Empty))
|
||||
application.Secret = EncryptDecrypt.Encrypt(application.Secret);
|
||||
var application = form.AadApplication;
|
||||
if ((application != null) && (application.Secret != string.Empty))
|
||||
application.Secret = EncryptDecrypt.Encrypt(application.Secret);
|
||||
|
||||
Properties.Settings.Default.AadApplications.Add(application);
|
||||
}
|
||||
Properties.Settings.Default.AadApplications.Add(application);
|
||||
}
|
||||
|
||||
private void ApplicationsDeleteButton_Click(object sender, EventArgs e)
|
||||
|
@ -223,33 +221,27 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
|
||||
private void InstancesEdit()
|
||||
{
|
||||
using (InstanceForm form = new InstanceForm { Instance = (Instance)instancesGrid.SelectedRows[0].DataBoundItem })
|
||||
{
|
||||
var index =
|
||||
Properties.Settings.Default.Instances.IndexOf((Instance)instancesGrid.SelectedRows[0].DataBoundItem);
|
||||
using InstanceForm form = new InstanceForm { Instance = (Instance)instancesGrid.SelectedRows[0].DataBoundItem };
|
||||
var index = Properties.Settings.Default.Instances.IndexOf((Instance)instancesGrid.SelectedRows[0].DataBoundItem);
|
||||
|
||||
if (form.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
Properties.Settings.Default.Instances.RemoveAt(index);
|
||||
Properties.Settings.Default.Instances.Insert(index, form.Instance);
|
||||
}
|
||||
instancesGrid.Rows[index].Selected = true;
|
||||
if (form.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
Properties.Settings.Default.Instances.RemoveAt(index);
|
||||
Properties.Settings.Default.Instances.Insert(index, form.Instance);
|
||||
}
|
||||
instancesGrid.Rows[index].Selected = true;
|
||||
}
|
||||
|
||||
private void DataJobsEdit()
|
||||
{
|
||||
using (DataJobForm form = new DataJobForm { DataJob = (DataJob)dataJobsGrid.SelectedRows[0].DataBoundItem })
|
||||
using DataJobForm form = new DataJobForm { DataJob = (DataJob)dataJobsGrid.SelectedRows[0].DataBoundItem };
|
||||
var index = Properties.Settings.Default.DataJobs.IndexOf((DataJob)dataJobsGrid.SelectedRows[0].DataBoundItem);
|
||||
if (form.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
var index =
|
||||
Properties.Settings.Default.DataJobs.IndexOf((DataJob)dataJobsGrid.SelectedRows[0].DataBoundItem);
|
||||
if (form.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
Properties.Settings.Default.DataJobs.RemoveAt(index);
|
||||
Properties.Settings.Default.DataJobs.Insert(index, form.DataJob);
|
||||
}
|
||||
dataJobsGrid.Rows[index].Selected = true;
|
||||
Properties.Settings.Default.DataJobs.RemoveAt(index);
|
||||
Properties.Settings.Default.DataJobs.Insert(index, form.DataJob);
|
||||
}
|
||||
dataJobsGrid.Rows[index].Selected = true;
|
||||
}
|
||||
|
||||
private void ApplicationsEdit()
|
||||
|
@ -266,36 +258,32 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
MessageBox.Show(Resources.Existing_application_secret_could_not_be_decrypted);
|
||||
}
|
||||
|
||||
using (AadApplicationForm form = new AadApplicationForm { AadApplication = application })
|
||||
using AadApplicationForm form = new AadApplicationForm { AadApplication = application };
|
||||
var index = Properties.Settings.Default.AadApplications.IndexOf((AadApplication)applicationsGrid.SelectedRows[0].DataBoundItem);
|
||||
|
||||
if (form.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
var index =
|
||||
Properties.Settings.Default.AadApplications.IndexOf(
|
||||
(AadApplication)applicationsGrid.SelectedRows[0].DataBoundItem);
|
||||
Properties.Settings.Default.AadApplications.RemoveAt(index);
|
||||
application = form.AadApplication;
|
||||
|
||||
if (form.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
Properties.Settings.Default.AadApplications.RemoveAt(index);
|
||||
application = form.AadApplication;
|
||||
if ((application != null) && (application.Secret != string.Empty))
|
||||
application.Secret = EncryptDecrypt.Encrypt(application.Secret);
|
||||
|
||||
if ((application != null) && (application.Secret != string.Empty))
|
||||
application.Secret = EncryptDecrypt.Encrypt(application.Secret);
|
||||
|
||||
Properties.Settings.Default.AadApplications.Insert(index, application);
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
application.Secret = EncryptDecrypt.Encrypt(application.Secret);
|
||||
}
|
||||
catch
|
||||
{
|
||||
application.Secret = string.Empty;
|
||||
MessageBox.Show(Resources.Existing_application_secret_could_not_be_encrypted);
|
||||
}
|
||||
}
|
||||
applicationsGrid.Rows[index].Selected = true;
|
||||
Properties.Settings.Default.AadApplications.Insert(index, application);
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
application.Secret = EncryptDecrypt.Encrypt(application.Secret);
|
||||
}
|
||||
catch
|
||||
{
|
||||
application.Secret = string.Empty;
|
||||
MessageBox.Show(Resources.Existing_application_secret_could_not_be_encrypted);
|
||||
}
|
||||
}
|
||||
applicationsGrid.Rows[index].Selected = true;
|
||||
}
|
||||
|
||||
private void UsersEdit()
|
||||
|
@ -311,46 +299,41 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
MessageBox.Show(Resources.Existing_password_could_not_be_decrypted);
|
||||
}
|
||||
|
||||
using (UserForm form = new UserForm { User = user })
|
||||
using UserForm form = new UserForm { User = user };
|
||||
var index = Properties.Settings.Default.Users.IndexOf((User)usersDataGrid.SelectedRows[0].DataBoundItem);
|
||||
if (form.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
var index = Properties.Settings.Default.Users.IndexOf((User)usersDataGrid.SelectedRows[0].DataBoundItem);
|
||||
if (form.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
Properties.Settings.Default.Users.RemoveAt(index);
|
||||
user = form.User;
|
||||
if (user != null)
|
||||
user.Password = EncryptDecrypt.Encrypt(user.Password);
|
||||
Properties.Settings.Default.Users.Insert(index, user);
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
user.Password = EncryptDecrypt.Encrypt(user.Password);
|
||||
}
|
||||
catch
|
||||
{
|
||||
user.Password = string.Empty;
|
||||
MessageBox.Show(Resources.Existing_password_could_not_be_encrypted);
|
||||
}
|
||||
}
|
||||
usersDataGrid.Rows[index].Selected = true;
|
||||
Properties.Settings.Default.Users.RemoveAt(index);
|
||||
user = form.User;
|
||||
if (user != null)
|
||||
user.Password = EncryptDecrypt.Encrypt(user.Password);
|
||||
Properties.Settings.Default.Users.Insert(index, user);
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
user.Password = EncryptDecrypt.Encrypt(user.Password);
|
||||
}
|
||||
catch
|
||||
{
|
||||
user.Password = string.Empty;
|
||||
MessageBox.Show(Resources.Existing_password_could_not_be_encrypted);
|
||||
}
|
||||
}
|
||||
usersDataGrid.Rows[index].Selected = true;
|
||||
}
|
||||
|
||||
private void JobGroupsEdit()
|
||||
{
|
||||
using (JobGroupForm form = new JobGroupForm { JobGroup = (JobGroup)jobGroupsGrid.SelectedRows[0].DataBoundItem })
|
||||
using JobGroupForm form = new JobGroupForm { JobGroup = (JobGroup)jobGroupsGrid.SelectedRows[0].DataBoundItem };
|
||||
var index = Properties.Settings.Default.JobGroups.IndexOf((JobGroup)jobGroupsGrid.SelectedRows[0].DataBoundItem);
|
||||
if (form.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
var index =
|
||||
Properties.Settings.Default.JobGroups.IndexOf((JobGroup)jobGroupsGrid.SelectedRows[0].DataBoundItem);
|
||||
if (form.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
Properties.Settings.Default.JobGroups.RemoveAt(index);
|
||||
Properties.Settings.Default.JobGroups.Insert(index, form.JobGroup);
|
||||
}
|
||||
jobGroupsGrid.Rows[index].Selected = true;
|
||||
Properties.Settings.Default.JobGroups.RemoveAt(index);
|
||||
Properties.Settings.Default.JobGroups.Insert(index, form.JobGroup);
|
||||
}
|
||||
jobGroupsGrid.Rows[index].Selected = true;
|
||||
}
|
||||
|
||||
private void InstancesEditButton_Click(object sender, EventArgs e)
|
||||
|
|
|
@ -117,7 +117,7 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
statusFileExtensionTextBox.Text =
|
||||
UploadJobDetail.JobDataMap[SettingsConstants.StatusFileExtension]?.ToString() ?? ".Status";
|
||||
|
||||
numericUpDownIntervalUploads.Value = Math.Round(Convert.ToDecimal(UploadJobDetail.JobDataMap[SettingsConstants.Interval]));
|
||||
numericUpDownIntervalUploads.Value = Math.Round(Convert.ToDecimal(UploadJobDetail.JobDataMap[SettingsConstants.DelayBetweenFiles]));
|
||||
|
||||
serviceAuthRadioButton.Checked =
|
||||
(UploadJobDetail.JobDataMap[SettingsConstants.UseServiceAuthentication] != null) &&
|
||||
|
@ -272,7 +272,7 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
ProcessingJobDetail.JobDataMap[SettingsConstants.ProcessingSuccessDir]?.ToString() ?? string.Empty;
|
||||
processingErrorsFolderTextBox.Text =
|
||||
ProcessingJobDetail.JobDataMap[SettingsConstants.ProcessingErrorsDir]?.ToString() ?? string.Empty;
|
||||
numericUpDownStatusCheckInterval.Value = Math.Round(Convert.ToDecimal(ProcessingJobDetail.JobDataMap[SettingsConstants.StatusCheckInterval]));
|
||||
numericUpDownStatusCheckInterval.Value = Math.Round(Convert.ToDecimal(ProcessingJobDetail.JobDataMap[SettingsConstants.DelayBetweenStatusCheck]));
|
||||
|
||||
if (ProcessingTrigger.GetType() == typeof(SimpleTriggerImpl))
|
||||
{
|
||||
|
@ -588,7 +588,7 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
{SettingsConstants.RetryDelay, retriesDelayUpDown.Value.ToString(CultureInfo.InvariantCulture)},
|
||||
{SettingsConstants.PauseJobOnException, pauseOnExceptionsCheckBox.Checked.ToString()},
|
||||
{SettingsConstants.IndefinitePause, pauseIndefinitelyCheckBox.Checked.ToString()},
|
||||
{SettingsConstants.Interval, numericUpDownIntervalUploads.Value.ToString(CultureInfo.InvariantCulture)}
|
||||
{SettingsConstants.DelayBetweenFiles, numericUpDownIntervalUploads.Value.ToString(CultureInfo.InvariantCulture)}
|
||||
};
|
||||
if (serviceAuthRadioButton.Checked)
|
||||
{
|
||||
|
@ -625,7 +625,7 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
{SettingsConstants.RetryDelay, retriesDelayUpDown.Value.ToString(CultureInfo.InvariantCulture)},
|
||||
{SettingsConstants.PauseJobOnException, pauseOnExceptionsCheckBox.Checked.ToString()},
|
||||
{SettingsConstants.IndefinitePause, pauseIndefinitelyCheckBox.Checked.ToString()},
|
||||
{SettingsConstants.StatusCheckInterval, numericUpDownStatusCheckInterval.Value.ToString(CultureInfo.InvariantCulture)}
|
||||
{SettingsConstants.DelayBetweenStatusCheck, numericUpDownStatusCheckInterval.Value.ToString(CultureInfo.InvariantCulture)}
|
||||
};
|
||||
if (serviceAuthRadioButton.Checked)
|
||||
{
|
||||
|
@ -643,7 +643,7 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
{
|
||||
cronmakerLinkLabel.LinkVisited = true;
|
||||
Process.Start(
|
||||
"http://www.quartz-scheduler.net/documentation/quartz-2.x/tutorial/crontrigger.html");
|
||||
"https://www.quartz-scheduler.net/documentation/quartz-3.x/tutorial/crontrigger.html");
|
||||
}
|
||||
|
||||
private void GetCronScheduleForUploadButton_Click(object sender, EventArgs e)
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,824 @@
|
|||
/* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
Licensed under the MIT License. */
|
||||
|
||||
using Quartz;
|
||||
using Quartz.Impl.Triggers;
|
||||
using RecurringIntegrationsScheduler.Common.Contracts;
|
||||
using RecurringIntegrationsScheduler.Properties;
|
||||
using RecurringIntegrationsScheduler.Settings;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace RecurringIntegrationsScheduler.Forms
|
||||
{
|
||||
public partial class UploadJobV3 : Form
|
||||
{
|
||||
private const int CpNocloseButton = 0x200;
|
||||
|
||||
public UploadJobV3()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
protected override CreateParams CreateParams
|
||||
{
|
||||
get
|
||||
{
|
||||
var myCp = base.CreateParams;
|
||||
myCp.ClassStyle = myCp.ClassStyle | CpNocloseButton;
|
||||
return myCp;
|
||||
}
|
||||
}
|
||||
|
||||
public bool Cancelled { get; private set; }
|
||||
public IJobDetail UploadJobDetail { get; set; }
|
||||
public ITrigger UploadTrigger { get; set; }
|
||||
public IJobDetail ProcessingJobDetail { get; set; }
|
||||
public ITrigger ProcessingTrigger { get; set; }
|
||||
|
||||
private void UploadJobForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
Cancelled = false;
|
||||
//Few changes based on form mode (create or edit)
|
||||
Text = UploadJobDetail == null
|
||||
? Resources.Add_upload_job
|
||||
: string.Format(Resources.Edit_job_0, UploadJobDetail.Key.Name);
|
||||
addToolStripButton.Text = UploadJobDetail == null ? Resources.Add_to_schedule : Resources.Edit_job;
|
||||
jobName.Enabled = UploadJobDetail == null;
|
||||
|
||||
jobGroupComboBox.DataSource = Properties.Settings.Default.JobGroups;
|
||||
jobGroupComboBox.ValueMember = null;
|
||||
jobGroupComboBox.DisplayMember = "Name";
|
||||
|
||||
jobGroupComboBox.Enabled = UploadJobDetail == null;
|
||||
|
||||
instanceComboBox.DataSource = Properties.Settings.Default.Instances;
|
||||
instanceComboBox.ValueMember = null;
|
||||
instanceComboBox.DisplayMember = "Name";
|
||||
|
||||
var dataJobs = Properties.Settings.Default.DataJobs.Where(x => x.Type == DataJobType.Upload);
|
||||
var dataJobsBindingList = new BindingList<DataJob>(dataJobs.ToList());
|
||||
dataJobComboBox.DataSource = dataJobsBindingList;
|
||||
dataJobComboBox.ValueMember = null;
|
||||
dataJobComboBox.DisplayMember = "Name";
|
||||
|
||||
var applications = Properties.Settings.Default.AadApplications.Where(x => x.AuthenticationType == AuthenticationType.User);
|
||||
var applicationsBindingList = new BindingList<AadApplication>(applications.ToList());
|
||||
aadApplicationComboBox.DataSource = applicationsBindingList;
|
||||
aadApplicationComboBox.ValueMember = null;
|
||||
aadApplicationComboBox.DisplayMember = "Name";
|
||||
|
||||
userComboBox.DataSource = Properties.Settings.Default.Users;
|
||||
userComboBox.ValueMember = null;
|
||||
userComboBox.DisplayMember = "Login";
|
||||
|
||||
orderByComboBox.DataSource = Enum.GetValues(typeof(OrderByOptions));
|
||||
|
||||
upJobStartAtDateTimePicker.Value = DateTime.Now;
|
||||
procJobStartAtDateTimePicker.Value = DateTime.Now;
|
||||
|
||||
inputFolderTextBox.Text = Properties.Settings.Default.UploadInputFolder;
|
||||
uploadSuccessFolderTextBox.Text = Properties.Settings.Default.UploadSuccessFolder;
|
||||
uploadErrorsFolderTextBox.Text = Properties.Settings.Default.UploadErrorsFolder;
|
||||
processingSuccessFolderTextBox.Text = Properties.Settings.Default.ProcessingSuccessFolder;
|
||||
processingErrorsFolderTextBox.Text = Properties.Settings.Default.ProcessingErrorsFolder;
|
||||
|
||||
if ((UploadJobDetail != null) && (UploadTrigger != null))
|
||||
{
|
||||
jobName.Text = UploadJobDetail.Key.Name;
|
||||
|
||||
var jobGroup =
|
||||
((IEnumerable<JobGroup>) jobGroupComboBox.DataSource).FirstOrDefault(
|
||||
x => x.Name == UploadJobDetail.Key.Group);
|
||||
jobGroupComboBox.SelectedItem = jobGroup;
|
||||
|
||||
jobDescription.Text = UploadJobDetail.Description;
|
||||
|
||||
useStandardSubfolder.Checked = false;
|
||||
inputFolderTextBox.Text = UploadJobDetail.JobDataMap[SettingsConstants.InputDir]?.ToString() ??
|
||||
string.Empty;
|
||||
uploadSuccessFolderTextBox.Text =
|
||||
UploadJobDetail.JobDataMap[SettingsConstants.UploadSuccessDir]?.ToString() ?? string.Empty;
|
||||
uploadErrorsFolderTextBox.Text =
|
||||
UploadJobDetail.JobDataMap[SettingsConstants.UploadErrorsDir]?.ToString() ?? string.Empty;
|
||||
|
||||
legalEntityTextBox.Text = UploadJobDetail.JobDataMap[SettingsConstants.Company]?.ToString() ??
|
||||
string.Empty;
|
||||
isDataPackageCheckBox.Checked = (UploadJobDetail.JobDataMap[SettingsConstants.IsDataPackage] != null) &&
|
||||
Convert.ToBoolean(
|
||||
UploadJobDetail.JobDataMap[SettingsConstants.IsDataPackage].ToString());
|
||||
statusFileExtensionTextBox.Text =
|
||||
UploadJobDetail.JobDataMap[SettingsConstants.StatusFileExtension]?.ToString() ?? ".Status";
|
||||
|
||||
numericUpDownIntervalUploads.Value = Math.Round(Convert.ToDecimal(UploadJobDetail.JobDataMap[SettingsConstants.DelayBetweenFiles]));
|
||||
|
||||
serviceAuthRadioButton.Checked =
|
||||
(UploadJobDetail.JobDataMap[SettingsConstants.UseServiceAuthentication] != null) &&
|
||||
Convert.ToBoolean(UploadJobDetail.JobDataMap[SettingsConstants.UseServiceAuthentication].ToString());
|
||||
if (!serviceAuthRadioButton.Checked)
|
||||
{
|
||||
User axUser = null;
|
||||
if (UploadJobDetail.JobDataMap[SettingsConstants.UserName] != null)
|
||||
axUser =
|
||||
((IEnumerable<User>) userComboBox.DataSource).FirstOrDefault(
|
||||
x => x.Login == UploadJobDetail.JobDataMap[SettingsConstants.UserName].ToString());
|
||||
if (axUser == null)
|
||||
{
|
||||
var userName = UploadJobDetail.JobDataMap[SettingsConstants.UserName];
|
||||
if (userName != null)
|
||||
axUser = new User
|
||||
{
|
||||
Login = userName.ToString(),
|
||||
Password = UploadJobDetail.JobDataMap[SettingsConstants.UserPassword].ToString()
|
||||
};
|
||||
var disabledUser = new Users {axUser};
|
||||
userComboBox.DataSource = disabledUser;
|
||||
userComboBox.Enabled = false;
|
||||
}
|
||||
userComboBox.SelectedItem = axUser;
|
||||
}
|
||||
var application =
|
||||
((IEnumerable<AadApplication>) aadApplicationComboBox.DataSource).FirstOrDefault(app =>
|
||||
app.ClientId == UploadJobDetail.JobDataMap[SettingsConstants.AadClientId].ToString());
|
||||
if (application == null)
|
||||
if (UploadJobDetail.JobDataMap[SettingsConstants.AadClientSecret] == null)
|
||||
{
|
||||
application = new AadApplication
|
||||
{
|
||||
ClientId = UploadJobDetail.JobDataMap[SettingsConstants.AadClientId].ToString(),
|
||||
Name = Resources.IMPORTED_CHANGE_THIS,
|
||||
AuthenticationType = AuthenticationType.User
|
||||
};
|
||||
Properties.Settings.Default.AadApplications.Add(application);
|
||||
applications =
|
||||
Properties.Settings.Default.AadApplications.Where(x => x.AuthenticationType == AuthenticationType.User);
|
||||
applicationsBindingList = new BindingList<AadApplication>(applications.ToList());
|
||||
aadApplicationComboBox.DataSource = applicationsBindingList;
|
||||
aadApplicationComboBox.ValueMember = null;
|
||||
aadApplicationComboBox.DisplayMember = "Name";
|
||||
}
|
||||
else
|
||||
{
|
||||
application = new AadApplication
|
||||
{
|
||||
ClientId = UploadJobDetail.JobDataMap[SettingsConstants.AadClientId].ToString(),
|
||||
Secret = UploadJobDetail.JobDataMap[SettingsConstants.AadClientSecret].ToString(),
|
||||
Name = Resources.IMPORTED,
|
||||
AuthenticationType = AuthenticationType.Service
|
||||
};
|
||||
var disabledApplication = new AadApplications {application};
|
||||
aadApplicationComboBox.DataSource = disabledApplication;
|
||||
aadApplicationComboBox.Enabled = false;
|
||||
authMethodPanel.Enabled = false;
|
||||
}
|
||||
aadApplicationComboBox.SelectedItem = application;
|
||||
|
||||
var dataJob =
|
||||
((IEnumerable<DataJob>) dataJobComboBox.DataSource).FirstOrDefault(
|
||||
dj => dj.ActivityId == UploadJobDetail.JobDataMap[SettingsConstants.ActivityId].ToString());
|
||||
if (dataJob == null)
|
||||
{
|
||||
dataJob = new DataJob
|
||||
{
|
||||
ActivityId = UploadJobDetail.JobDataMap[SettingsConstants.ActivityId].ToString(),
|
||||
EntityName = UploadJobDetail.JobDataMap[SettingsConstants.EntityName].ToString(),
|
||||
Type = DataJobType.Upload,
|
||||
Name = Resources.IMPORTED_CHANGE_THIS
|
||||
};
|
||||
Properties.Settings.Default.DataJobs.Add(dataJob);
|
||||
dataJobs = Properties.Settings.Default.DataJobs.Where(x => x.Type == DataJobType.Upload);
|
||||
dataJobsBindingList = new BindingList<DataJob>(dataJobs.ToList());
|
||||
dataJobComboBox.DataSource = dataJobsBindingList;
|
||||
dataJobComboBox.ValueMember = null;
|
||||
dataJobComboBox.DisplayMember = "Name";
|
||||
}
|
||||
dataJobComboBox.SelectedItem = dataJob;
|
||||
|
||||
var axInstance = ((IEnumerable<Instance>) instanceComboBox.DataSource).FirstOrDefault(x =>
|
||||
(x.AosUri == UploadJobDetail.JobDataMap[SettingsConstants.AosUri].ToString()) &&
|
||||
(x.AadTenant == UploadJobDetail.JobDataMap[SettingsConstants.AadTenant].ToString()) &&
|
||||
(x.AzureAuthEndpoint == UploadJobDetail.JobDataMap[SettingsConstants.AzureAuthEndpoint].ToString()));
|
||||
if (axInstance == null)
|
||||
{
|
||||
axInstance = new Instance
|
||||
{
|
||||
AosUri = UploadJobDetail.JobDataMap[SettingsConstants.AosUri].ToString(),
|
||||
AadTenant = UploadJobDetail.JobDataMap[SettingsConstants.AadTenant].ToString(),
|
||||
AzureAuthEndpoint = UploadJobDetail.JobDataMap[SettingsConstants.AzureAuthEndpoint].ToString(),
|
||||
Name = Resources.IMPORTED_CHANGE_THIS
|
||||
};
|
||||
Properties.Settings.Default.Instances.Add(axInstance);
|
||||
}
|
||||
instanceComboBox.SelectedItem = axInstance;
|
||||
|
||||
searchPatternTextBox.Text = UploadJobDetail.JobDataMap[SettingsConstants.SearchPattern]?.ToString() ??
|
||||
"*.*";
|
||||
orderByComboBox.DataSource = Enum.GetValues(typeof(OrderByOptions));
|
||||
var selectedOrderBy = OrderByOptions.FileName;
|
||||
if (UploadJobDetail.JobDataMap[SettingsConstants.OrderBy] != null)
|
||||
selectedOrderBy =
|
||||
(OrderByOptions)
|
||||
Enum.Parse(typeof(OrderByOptions),
|
||||
UploadJobDetail.JobDataMap[SettingsConstants.OrderBy].ToString());
|
||||
orderByComboBox.SelectedItem = selectedOrderBy;
|
||||
|
||||
orderDescendingRadioButton.Checked = (UploadJobDetail.JobDataMap[SettingsConstants.ReverseOrder] != null) &&
|
||||
Convert.ToBoolean(
|
||||
UploadJobDetail.JobDataMap[SettingsConstants.ReverseOrder]
|
||||
.ToString());
|
||||
|
||||
pauseIndefinitelyCheckBox.Checked =
|
||||
(UploadJobDetail.JobDataMap[SettingsConstants.IndefinitePause] != null) &&
|
||||
Convert.ToBoolean(UploadJobDetail.JobDataMap[SettingsConstants.IndefinitePause].ToString());
|
||||
|
||||
if (UploadTrigger.GetType() == typeof(SimpleTriggerImpl))
|
||||
{
|
||||
var localTrigger = (SimpleTriggerImpl) UploadTrigger;
|
||||
upJobSimpleTriggerRadioButton.Checked = true;
|
||||
upJobHoursDateTimePicker.Value = DateTime.Now.Date + localTrigger.RepeatInterval;
|
||||
upJobMinutesDateTimePicker.Value = DateTime.Now.Date + localTrigger.RepeatInterval;
|
||||
}
|
||||
else if (UploadTrigger.GetType() == typeof(CronTriggerImpl))
|
||||
{
|
||||
var localTrigger = (CronTriggerImpl) UploadTrigger;
|
||||
upJobCronTriggerRadioButton.Checked = true;
|
||||
upJobCronExpressionTextBox.Text = localTrigger.CronExpressionString;
|
||||
}
|
||||
if(UploadJobDetail.JobDataMap[SettingsConstants.RetryCount] != null)
|
||||
{
|
||||
retriesCountUpDown.Value = Convert.ToDecimal(UploadJobDetail.JobDataMap[SettingsConstants.RetryCount]);
|
||||
}
|
||||
if(UploadJobDetail.JobDataMap[SettingsConstants.RetryDelay] != null)
|
||||
{
|
||||
retriesDelayUpDown.Value = Convert.ToDecimal(UploadJobDetail.JobDataMap[SettingsConstants.RetryDelay]);
|
||||
}
|
||||
pauseOnExceptionsCheckBox.Checked =
|
||||
(UploadJobDetail.JobDataMap[SettingsConstants.PauseJobOnException] != null) &&
|
||||
Convert.ToBoolean(UploadJobDetail.JobDataMap[SettingsConstants.PauseJobOnException].ToString());
|
||||
|
||||
Properties.Settings.Default.Save();
|
||||
}
|
||||
if ((ProcessingJobDetail != null) && (ProcessingTrigger != null))
|
||||
{
|
||||
useMonitoringJobCheckBox.Checked = true;
|
||||
processingSuccessFolderTextBox.Text =
|
||||
ProcessingJobDetail.JobDataMap[SettingsConstants.ProcessingSuccessDir]?.ToString() ?? string.Empty;
|
||||
processingErrorsFolderTextBox.Text =
|
||||
ProcessingJobDetail.JobDataMap[SettingsConstants.ProcessingErrorsDir]?.ToString() ?? string.Empty;
|
||||
delayBetweenStatusCheckNumericUpDown.Value = Math.Round(Convert.ToDecimal(ProcessingJobDetail.JobDataMap[SettingsConstants.DelayBetweenStatusCheck]));
|
||||
|
||||
getExecutionErrorsCheckBox.Checked =
|
||||
(ProcessingJobDetail.JobDataMap[SettingsConstants.GetExecutionErrors] != null) &&
|
||||
Convert.ToBoolean(ProcessingJobDetail.JobDataMap[SettingsConstants.GetExecutionErrors].ToString());
|
||||
|
||||
if (ProcessingTrigger.GetType() == typeof(SimpleTriggerImpl))
|
||||
{
|
||||
var localTrigger = (SimpleTriggerImpl) ProcessingTrigger;
|
||||
procJobSimpleTriggerRadioButton.Checked = true;
|
||||
procJobHoursDateTimePicker.Value = DateTime.Now.Date + localTrigger.RepeatInterval;
|
||||
procJobMinutesDateTimePicker.Value = DateTime.Now.Date + localTrigger.RepeatInterval;
|
||||
}
|
||||
else if (ProcessingTrigger.GetType() == typeof(CronTriggerImpl))
|
||||
{
|
||||
var localTrigger = (CronTriggerImpl) ProcessingTrigger;
|
||||
procJobCronTriggerRadioButton.Checked = true;
|
||||
procJobCronExpressionTextBox.Text = localTrigger.CronExpressionString;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void TopUploadFolderBrowserButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (folderBrowserDialog.ShowDialog() == DialogResult.OK)
|
||||
topUploadFolderTextBox.Text = folderBrowserDialog.SelectedPath;
|
||||
}
|
||||
|
||||
private void UploadErrorsFolderBrowserButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (folderBrowserDialog.ShowDialog() == DialogResult.OK)
|
||||
uploadErrorsFolderTextBox.Text = folderBrowserDialog.SelectedPath;
|
||||
}
|
||||
|
||||
private void UseStandardSubfolder_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (useStandardSubfolder.Checked)
|
||||
{
|
||||
topUploadFolderTextBox.Enabled = true;
|
||||
topUploadFolderBrowserButton.Enabled = true;
|
||||
|
||||
inputFolderTextBox.Enabled = false;
|
||||
inputFolderTextBox.Text = Path.Combine(topUploadFolderTextBox.Text,
|
||||
Properties.Settings.Default.UploadInputFolder);
|
||||
inputFolderBrowserButton.Enabled = false;
|
||||
|
||||
uploadSuccessFolderTextBox.Enabled = false;
|
||||
uploadSuccessFolderTextBox.Text = Path.Combine(topUploadFolderTextBox.Text,
|
||||
Properties.Settings.Default.UploadSuccessFolder);
|
||||
uploadSuccessFolderBrowserButton.Enabled = false;
|
||||
|
||||
uploadErrorsFolderTextBox.Enabled = false;
|
||||
uploadErrorsFolderTextBox.Text = Path.Combine(topUploadFolderTextBox.Text,
|
||||
Properties.Settings.Default.UploadErrorsFolder);
|
||||
uploadErrorsFolderBrowserButton.Enabled = false;
|
||||
|
||||
processingSuccessFolderTextBox.Enabled = false;
|
||||
processingSuccessFolderTextBox.Text = Path.Combine(topUploadFolderTextBox.Text,
|
||||
Properties.Settings.Default.ProcessingSuccessFolder);
|
||||
processingSuccessFolderBrowserButton.Enabled = false;
|
||||
|
||||
processingErrorsFolderTextBox.Enabled = false;
|
||||
processingErrorsFolderTextBox.Text = Path.Combine(topUploadFolderTextBox.Text,
|
||||
Properties.Settings.Default.ProcessingErrorsFolder);
|
||||
processingErrorsFolderBrowserButton.Enabled = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
topUploadFolderTextBox.Enabled = false;
|
||||
topUploadFolderBrowserButton.Enabled = false;
|
||||
|
||||
inputFolderTextBox.Enabled = true;
|
||||
inputFolderBrowserButton.Enabled = true;
|
||||
|
||||
uploadSuccessFolderTextBox.Enabled = true;
|
||||
uploadSuccessFolderBrowserButton.Enabled = true;
|
||||
|
||||
uploadErrorsFolderTextBox.Enabled = true;
|
||||
uploadErrorsFolderBrowserButton.Enabled = true;
|
||||
|
||||
processingSuccessFolderTextBox.Enabled = useMonitoringJobCheckBox.Checked;
|
||||
processingSuccessFolderBrowserButton.Enabled = useMonitoringJobCheckBox.Checked;
|
||||
|
||||
processingErrorsFolderTextBox.Enabled = useMonitoringJobCheckBox.Checked;
|
||||
processingErrorsFolderBrowserButton.Enabled = useMonitoringJobCheckBox.Checked;
|
||||
|
||||
if (string.IsNullOrEmpty(topUploadFolderTextBox.Text))
|
||||
{
|
||||
inputFolderTextBox.Text = "";
|
||||
uploadSuccessFolderTextBox.Text = "";
|
||||
uploadErrorsFolderTextBox.Text = "";
|
||||
processingSuccessFolderTextBox.Text = "";
|
||||
processingErrorsFolderTextBox.Text = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void CronmakerLinkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
||||
{
|
||||
cronmakerLinkLabel.LinkVisited = true;
|
||||
Process.Start("http://www.cronmaker.com");
|
||||
}
|
||||
|
||||
private void UpJobCronTriggerRadioButton_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
simpleTriggerUploadJobGroupBox.Enabled = !upJobCronTriggerRadioButton.Checked;
|
||||
cronTriggerUploadJobGroupBox.Enabled = upJobCronTriggerRadioButton.Checked;
|
||||
}
|
||||
|
||||
private bool ValidateJobSettings()
|
||||
{
|
||||
if (upJobCronTriggerRadioButton.Checked)
|
||||
{
|
||||
var date = GetScheduleForCron(upJobCronExpressionTextBox.Text, DateTimeOffset.Now);
|
||||
if (date == DateTimeOffset.MinValue)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (useMonitoringJobCheckBox.Checked && procJobCronTriggerRadioButton.Checked)
|
||||
{
|
||||
var date = GetScheduleForCron(procJobCronExpressionTextBox.Text, DateTimeOffset.Now);
|
||||
if (date == DateTimeOffset.MinValue)
|
||||
return false;
|
||||
}
|
||||
|
||||
var message = new StringBuilder();
|
||||
|
||||
if (string.IsNullOrEmpty(jobName.Text))
|
||||
message.AppendLine(Resources.Job_name_is_missing);
|
||||
|
||||
if ((jobGroupComboBox.SelectedItem == null) || string.IsNullOrEmpty(jobGroupComboBox.Text))
|
||||
message.AppendLine(Resources.Job_group_is_not_selected);
|
||||
|
||||
if (string.IsNullOrEmpty(topUploadFolderTextBox.Text) && useStandardSubfolder.Checked)
|
||||
message.AppendLine(Resources.Top_uploads_folder_is_not_selected);
|
||||
|
||||
if (string.IsNullOrEmpty(inputFolderTextBox.Text))
|
||||
message.AppendLine(Resources.Input_folder_is_not_selected);
|
||||
|
||||
if (string.IsNullOrEmpty(uploadSuccessFolderTextBox.Text))
|
||||
message.AppendLine(Resources.Upload_success_folder_is_not_selected);
|
||||
|
||||
if (string.IsNullOrEmpty(uploadErrorsFolderTextBox.Text))
|
||||
message.AppendLine(Resources.Upload_errors_folder_is_not_selected);
|
||||
|
||||
if (string.IsNullOrEmpty(processingSuccessFolderTextBox.Text) && useMonitoringJobCheckBox.Checked)
|
||||
message.AppendLine(Resources.Processing_success_folder_is_not_selected);
|
||||
|
||||
if (string.IsNullOrEmpty(processingErrorsFolderTextBox.Text) && useMonitoringJobCheckBox.Checked)
|
||||
message.AppendLine(Resources.Processing_errors_folder_is_not_selected);
|
||||
|
||||
if ((instanceComboBox.SelectedItem == null) || string.IsNullOrEmpty(instanceComboBox.Text))
|
||||
message.AppendLine(Resources.Dynamics_instance_is_not_selected);
|
||||
|
||||
if (userAuthRadioButton.Checked &&
|
||||
((userComboBox.SelectedItem == null) || string.IsNullOrEmpty(userComboBox.Text)))
|
||||
message.AppendLine(Resources.User_is_not_selected);
|
||||
|
||||
if ((aadApplicationComboBox.SelectedItem == null) || string.IsNullOrEmpty(aadApplicationComboBox.Text))
|
||||
message.AppendLine(Resources.AAD_client_application_is_not_selected);
|
||||
|
||||
if ((dataJobComboBox.SelectedItem == null) || string.IsNullOrEmpty(dataJobComboBox.Text))
|
||||
message.AppendLine(Resources.Data_job_is_not_selected);
|
||||
|
||||
if (string.IsNullOrEmpty(statusFileExtensionTextBox.Text) && useMonitoringJobCheckBox.Checked)
|
||||
message.AppendLine(Resources.Status_file_extension_is_not_specified);
|
||||
|
||||
if (message.Length > 0)
|
||||
MessageBox.Show(message.ToString(), Resources.Job_configuration_is_not_valid);
|
||||
|
||||
return message.Length == 0;
|
||||
}
|
||||
|
||||
private IJobDetail GetUploadJobDetail()
|
||||
{
|
||||
var detail = JobBuilder
|
||||
.Create()
|
||||
.OfType(Type.GetType("RecurringIntegrationsScheduler.Job.Upload,RecurringIntegrationsScheduler.Job.Upload", true))
|
||||
.WithDescription(jobDescription.Text)
|
||||
.WithIdentity(new JobKey(jobName.Text, jobGroupComboBox.Text))
|
||||
.UsingJobData(GetUploadJobDataMap())
|
||||
.Build();
|
||||
|
||||
return detail;
|
||||
}
|
||||
|
||||
private IJobDetail GetMonitorJobDetail()
|
||||
{
|
||||
var detail = JobBuilder
|
||||
.Create()
|
||||
.OfType(
|
||||
Type.GetType(
|
||||
"RecurringIntegrationsScheduler.Job.ProcessingMonitor,RecurringIntegrationsScheduler.Job.ProcessingMonitor",
|
||||
true))
|
||||
.WithDescription(string.Format(Resources.Processing_monitor_job_for_upload_job_0_1, jobName.Text,
|
||||
jobGroupComboBox.Text))
|
||||
.WithIdentity(new JobKey($"{jobName.Text}-Processing monitor", jobGroupComboBox.Text))
|
||||
.UsingJobData(GetProcessingJobDataMap())
|
||||
.Build();
|
||||
|
||||
return detail;
|
||||
}
|
||||
|
||||
private ITrigger GetProcessingTrigger(IJobDetail jobDetail)
|
||||
{
|
||||
var builder =
|
||||
TriggerBuilder
|
||||
.Create()
|
||||
.ForJob(jobDetail)
|
||||
.WithDescription(string.Format(Resources.Trigger_for_job_0_1, jobDetail.Key.Name,
|
||||
jobDetail.Key.Group))
|
||||
.WithIdentity(
|
||||
new TriggerKey(
|
||||
string.Format(Resources.Trigger_for_job_0_1, jobDetail.Key.Name, jobDetail.Key.Group),
|
||||
jobDetail.Key.Group));
|
||||
|
||||
if (procJobSimpleTriggerRadioButton.Checked)
|
||||
{
|
||||
var minutes = procJobHoursDateTimePicker.Value.Hour*60;
|
||||
minutes = minutes + procJobMinutesDateTimePicker.Value.Minute;
|
||||
|
||||
return builder.WithSimpleSchedule(x => x
|
||||
.WithIntervalInMinutes(minutes)
|
||||
.RepeatForever())
|
||||
.StartNow()
|
||||
.Build();
|
||||
}
|
||||
return
|
||||
builder.WithSchedule(CronScheduleBuilder.CronSchedule(procJobCronExpressionTextBox.Text))
|
||||
.StartAt(procJobStartAtDateTimePicker.Value.ToUniversalTime())
|
||||
.Build();
|
||||
}
|
||||
|
||||
private ITrigger GetUploadTrigger(IJobDetail jobDetail)
|
||||
{
|
||||
var builder =
|
||||
TriggerBuilder
|
||||
.Create()
|
||||
.ForJob(jobDetail)
|
||||
.WithDescription(string.Format(Resources.Trigger_for_job_0_1, jobDetail.Key.Name,
|
||||
jobDetail.Key.Group))
|
||||
.WithIdentity(
|
||||
new TriggerKey(
|
||||
string.Format(Resources.Trigger_for_job_0_1, jobDetail.Key.Name, jobDetail.Key.Group),
|
||||
jobDetail.Key.Group));
|
||||
|
||||
if (upJobSimpleTriggerRadioButton.Checked)
|
||||
{
|
||||
var minutes = upJobHoursDateTimePicker.Value.Hour*60;
|
||||
minutes += upJobMinutesDateTimePicker.Value.Minute;
|
||||
|
||||
return builder.WithSimpleSchedule(x => x
|
||||
.WithIntervalInMinutes(minutes)
|
||||
.RepeatForever())
|
||||
.StartNow()
|
||||
.Build();
|
||||
}
|
||||
return
|
||||
builder.WithSchedule(CronScheduleBuilder.CronSchedule(upJobCronExpressionTextBox.Text))
|
||||
.StartAt(upJobStartAtDateTimePicker.Value.ToUniversalTime())
|
||||
.Build();
|
||||
}
|
||||
|
||||
private JobDataMap GetUploadJobDataMap()
|
||||
{
|
||||
var dataJob = (DataJob) dataJobComboBox.SelectedItem;
|
||||
var instance = (Instance) instanceComboBox.SelectedItem;
|
||||
var user = (User) userComboBox.SelectedItem;
|
||||
var application = (AadApplication) aadApplicationComboBox.SelectedItem;
|
||||
|
||||
var map = new JobDataMap
|
||||
{
|
||||
{SettingsConstants.InputDir, inputFolderTextBox.Text},
|
||||
{SettingsConstants.UploadSuccessDir, uploadSuccessFolderTextBox.Text},
|
||||
{SettingsConstants.UploadErrorsDir, uploadErrorsFolderTextBox.Text},
|
||||
{SettingsConstants.Company, legalEntityTextBox.Text},
|
||||
{SettingsConstants.EntityName, dataJob.EntityName},
|
||||
{SettingsConstants.IsDataPackage, isDataPackageCheckBox.Checked.ToString()},
|
||||
{SettingsConstants.StatusFileExtension, statusFileExtensionTextBox.Text},
|
||||
{SettingsConstants.AadTenant, instance.AadTenant},
|
||||
{SettingsConstants.AzureAuthEndpoint, instance.AzureAuthEndpoint},
|
||||
{SettingsConstants.AosUri, instance.AosUri},
|
||||
{SettingsConstants.AadClientId, application.ClientId},
|
||||
{SettingsConstants.ActivityId, dataJob.ActivityId},
|
||||
{SettingsConstants.UseServiceAuthentication, serviceAuthRadioButton.Checked.ToString()},
|
||||
{SettingsConstants.ProcessingJobPresent, useMonitoringJobCheckBox.Checked.ToString()},
|
||||
{SettingsConstants.SearchPattern, searchPatternTextBox.Text},
|
||||
{SettingsConstants.OrderBy, orderByComboBox.SelectedItem.ToString()},
|
||||
{SettingsConstants.ReverseOrder, orderDescendingRadioButton.Checked.ToString()},
|
||||
{SettingsConstants.RetryCount, retriesCountUpDown.Value.ToString(CultureInfo.InvariantCulture)},
|
||||
{SettingsConstants.RetryDelay, retriesDelayUpDown.Value.ToString(CultureInfo.InvariantCulture)},
|
||||
{SettingsConstants.PauseJobOnException, pauseOnExceptionsCheckBox.Checked.ToString()},
|
||||
{SettingsConstants.IndefinitePause, pauseIndefinitelyCheckBox.Checked.ToString()},
|
||||
{SettingsConstants.DelayBetweenFiles, numericUpDownIntervalUploads.Value.ToString(CultureInfo.InvariantCulture)}
|
||||
};
|
||||
if (serviceAuthRadioButton.Checked)
|
||||
{
|
||||
map.Add(SettingsConstants.AadClientSecret, application.Secret);
|
||||
}
|
||||
else
|
||||
{
|
||||
map.Add(SettingsConstants.UserName, user.Login);
|
||||
map.Add(SettingsConstants.UserPassword, user.Password);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
private JobDataMap GetProcessingJobDataMap()
|
||||
{
|
||||
var instance = (Instance) instanceComboBox.SelectedItem;
|
||||
var user = (User) userComboBox.SelectedItem;
|
||||
var dataJob = (DataJob) dataJobComboBox.SelectedItem;
|
||||
var application = (AadApplication) aadApplicationComboBox.SelectedItem;
|
||||
|
||||
var map = new JobDataMap
|
||||
{
|
||||
{SettingsConstants.UploadSuccessDir, uploadSuccessFolderTextBox.Text},
|
||||
{SettingsConstants.ProcessingSuccessDir, processingSuccessFolderTextBox.Text},
|
||||
{SettingsConstants.ProcessingErrorsDir, processingErrorsFolderTextBox.Text},
|
||||
{SettingsConstants.StatusFileExtension, statusFileExtensionTextBox.Text},
|
||||
{SettingsConstants.AadTenant, instance.AadTenant},
|
||||
{SettingsConstants.AzureAuthEndpoint, instance.AzureAuthEndpoint},
|
||||
{SettingsConstants.AosUri, instance.AosUri},
|
||||
{SettingsConstants.AadClientId, application.ClientId},
|
||||
{SettingsConstants.ActivityId, dataJob.ActivityId},
|
||||
{SettingsConstants.UseServiceAuthentication, serviceAuthRadioButton.Checked.ToString()},
|
||||
{SettingsConstants.RetryCount, retriesCountUpDown.Value.ToString(CultureInfo.InvariantCulture)},
|
||||
{SettingsConstants.RetryDelay, retriesDelayUpDown.Value.ToString(CultureInfo.InvariantCulture)},
|
||||
{SettingsConstants.PauseJobOnException, pauseOnExceptionsCheckBox.Checked.ToString()},
|
||||
{SettingsConstants.IndefinitePause, pauseIndefinitelyCheckBox.Checked.ToString()},
|
||||
{SettingsConstants.DelayBetweenStatusCheck, delayBetweenStatusCheckNumericUpDown.Value.ToString(CultureInfo.InvariantCulture)},
|
||||
{SettingsConstants.GetExecutionErrors, getExecutionErrorsCheckBox.Checked.ToString()},
|
||||
};
|
||||
if (serviceAuthRadioButton.Checked)
|
||||
{
|
||||
map.Add(SettingsConstants.AadClientSecret, application.Secret);
|
||||
}
|
||||
else
|
||||
{
|
||||
map.Add(SettingsConstants.UserName, user.Login);
|
||||
map.Add(SettingsConstants.UserPassword, user.Password);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
private void CronDocsLinkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
||||
{
|
||||
cronmakerLinkLabel.LinkVisited = true;
|
||||
Process.Start(
|
||||
"https://www.quartz-scheduler.net/documentation/quartz-3.x/tutorial/crontrigger.html");
|
||||
}
|
||||
|
||||
private void GetCronScheduleForUploadButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
var scheduleTimes = new List<DateTimeOffset>();
|
||||
|
||||
var time = DateTimeOffset.Now;
|
||||
|
||||
if (!string.IsNullOrEmpty(upJobCronExpressionTextBox.Text))
|
||||
for (var i = 0; i <= 99; i++)
|
||||
{
|
||||
var date = GetScheduleForCron(upJobCronExpressionTextBox.Text, time);
|
||||
if (date == DateTimeOffset.MinValue)
|
||||
return;
|
||||
if (date == null) continue;
|
||||
scheduleTimes.Add(date.Value);
|
||||
time = date.Value;
|
||||
}
|
||||
calculatedRunsTextBox.Text = string.Empty;
|
||||
foreach (var date in scheduleTimes)
|
||||
calculatedRunsTextBox.Text = calculatedRunsTextBox.Text + $@"{date.ToLocalTime():yyyy-MM-dd HH:mm:ss}" +
|
||||
Environment.NewLine;
|
||||
}
|
||||
|
||||
private static DateTimeOffset? GetScheduleForCron(string cronexpression, DateTimeOffset date)
|
||||
{
|
||||
try
|
||||
{
|
||||
var cron = new CronExpression(cronexpression);
|
||||
return cron.GetNextValidTimeAfter(date);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, Resources.Cron_expression_is_invalid);
|
||||
return DateTimeOffset.MinValue;
|
||||
}
|
||||
}
|
||||
|
||||
private void TopUploadFolder_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (useStandardSubfolder.Checked)
|
||||
{
|
||||
inputFolderTextBox.Text = Path.Combine(topUploadFolderTextBox.Text,
|
||||
Properties.Settings.Default.UploadInputFolder);
|
||||
uploadSuccessFolderTextBox.Text = Path.Combine(topUploadFolderTextBox.Text,
|
||||
Properties.Settings.Default.UploadSuccessFolder);
|
||||
uploadErrorsFolderTextBox.Text = Path.Combine(topUploadFolderTextBox.Text,
|
||||
Properties.Settings.Default.UploadErrorsFolder);
|
||||
processingSuccessFolderTextBox.Text = Path.Combine(topUploadFolderTextBox.Text,
|
||||
Properties.Settings.Default.ProcessingSuccessFolder);
|
||||
processingErrorsFolderTextBox.Text = Path.Combine(topUploadFolderTextBox.Text,
|
||||
Properties.Settings.Default.ProcessingErrorsFolder);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(Resources.Check_if_path + Environment.NewLine + ex.Message, Resources.Warning);
|
||||
}
|
||||
}
|
||||
|
||||
private void MoreExamplesButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
var form = new CronExamples();
|
||||
form.ShowDialog();
|
||||
}
|
||||
|
||||
private void UseMonitoringJobCheckBox_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
processingJobGroupBox.Enabled = useMonitoringJobCheckBox.Checked;
|
||||
|
||||
processingSuccessFolderTextBox.Enabled = useMonitoringJobCheckBox.Checked && !useStandardSubfolder.Checked;
|
||||
processingSuccessFolderBrowserButton.Enabled = useMonitoringJobCheckBox.Checked && !useStandardSubfolder.Checked;
|
||||
processingErrorsFolderTextBox.Enabled = useMonitoringJobCheckBox.Checked && !useStandardSubfolder.Checked;
|
||||
processingErrorsFolderBrowserButton.Enabled = useMonitoringJobCheckBox.Checked && !useStandardSubfolder.Checked;
|
||||
}
|
||||
|
||||
private void InputFolderButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (folderBrowserDialog.ShowDialog() == DialogResult.OK)
|
||||
inputFolderTextBox.Text = folderBrowserDialog.SelectedPath;
|
||||
}
|
||||
|
||||
private void UploadSuccessFolderButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (folderBrowserDialog.ShowDialog() == DialogResult.OK)
|
||||
uploadSuccessFolderTextBox.Text = folderBrowserDialog.SelectedPath;
|
||||
}
|
||||
|
||||
private void ProcessingSuccessFolderButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (folderBrowserDialog.ShowDialog() == DialogResult.OK)
|
||||
processingSuccessFolderTextBox.Text = folderBrowserDialog.SelectedPath;
|
||||
}
|
||||
|
||||
private void ProcJobCronTriggerRadioButton_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
simpleTriggerMonitoringJobGroupBox.Enabled = !procJobCronTriggerRadioButton.Checked;
|
||||
cronTriggerMonitoringJobGroupBox.Enabled = procJobCronTriggerRadioButton.Checked;
|
||||
}
|
||||
|
||||
private void GetCronScheduleForProcButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
var scheduleTimes = new List<DateTimeOffset>();
|
||||
|
||||
var time = DateTimeOffset.Now;
|
||||
|
||||
if (!string.IsNullOrEmpty(procJobCronExpressionTextBox.Text))
|
||||
for (var i = 0; i <= 99; i++)
|
||||
{
|
||||
var date = GetScheduleForCron(procJobCronExpressionTextBox.Text, time);
|
||||
if (date == DateTimeOffset.MinValue)
|
||||
return;
|
||||
if (date == null) continue;
|
||||
scheduleTimes.Add(date.Value);
|
||||
time = date.Value;
|
||||
}
|
||||
calculatedRunsMonitoringTextBox.Text = string.Empty;
|
||||
foreach (var date in scheduleTimes)
|
||||
calculatedRunsMonitoringTextBox.Text = calculatedRunsMonitoringTextBox.Text + $@"{date.ToLocalTime():yyyy-MM-dd HH:mm:ss}" + Environment.NewLine;
|
||||
}
|
||||
|
||||
private void StatusFileExtensionTextBox_Leave(object sender, EventArgs e)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(statusFileExtensionTextBox.Text))
|
||||
{
|
||||
if (statusFileExtensionTextBox.Text.Substring(0, 1) != ".")
|
||||
statusFileExtensionTextBox.Text = $@".{statusFileExtensionTextBox.Text}";
|
||||
}
|
||||
else
|
||||
{
|
||||
statusFileExtensionTextBox.Text = @".Status";
|
||||
}
|
||||
}
|
||||
|
||||
private void ProcessingErrorsFolderBrowserButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (folderBrowserDialog.ShowDialog() == DialogResult.OK)
|
||||
processingErrorsFolderTextBox.Text = folderBrowserDialog.SelectedPath;
|
||||
}
|
||||
|
||||
private void ServiceAuthRadioButton_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
var applications = serviceAuthRadioButton.Checked
|
||||
? Properties.Settings.Default.AadApplications.Where(x => x.AuthenticationType == AuthenticationType.Service)
|
||||
: Properties.Settings.Default.AadApplications.Where(x => x.AuthenticationType == AuthenticationType.User);
|
||||
var applicationsBindingList = new BindingList<AadApplication>(applications.ToList());
|
||||
aadApplicationComboBox.DataSource = applicationsBindingList;
|
||||
aadApplicationComboBox.ValueMember = null;
|
||||
aadApplicationComboBox.DisplayMember = "Name";
|
||||
|
||||
userComboBox.Enabled = !serviceAuthRadioButton.Checked;
|
||||
}
|
||||
|
||||
private void CancelToolStripButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
Cancelled = true;
|
||||
Close();
|
||||
}
|
||||
|
||||
private void AddToolStripButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (UploadJobDetail == null)
|
||||
{
|
||||
var jobKey = new JobKey(jobName.Text, jobGroupComboBox.Text);
|
||||
if (Scheduler.Instance.GetScheduler().CheckExists(jobKey).Result)
|
||||
if (
|
||||
MessageBox.Show(
|
||||
string.Format(Resources.Job_0_in_group_1_already_exists, jobKey.Name, jobKey.Group),
|
||||
Resources.Job_already_exists, MessageBoxButtons.YesNo) == DialogResult.No)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!ValidateJobSettings()) return;
|
||||
UploadJobDetail = GetUploadJobDetail();
|
||||
UploadTrigger = GetUploadTrigger(UploadJobDetail);
|
||||
if (useMonitoringJobCheckBox.Checked)
|
||||
{
|
||||
ProcessingJobDetail = GetMonitorJobDetail();
|
||||
ProcessingTrigger = GetProcessingTrigger(ProcessingJobDetail);
|
||||
}
|
||||
Close();
|
||||
}
|
||||
|
||||
private void IsDataPackageCheckBox_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (isDataPackageCheckBox.Checked)
|
||||
{
|
||||
searchPatternTextBox.Text = "*.zip";
|
||||
searchPatternTextBox.Enabled = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
searchPatternTextBox.Text = "*.*";
|
||||
searchPatternTextBox.Enabled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,167 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="folderBrowserDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<data name="cronTriggerInfoTextBox.Text" xml:space="preserve">
|
||||
<value>With cron expression you can specify schedules such as “every Friday at noon”, or “every weekday and 9:30 am”, or even “every 5 minutes between 9:00 am and 10:00 am on every Monday, Wednesday and Friday during January”.
|
||||
|
||||
Default example above means: Each working day of the week (MON-FRI) run every 15 minutes (0/15) between 8:00 and 18:45 (8-18 - last run will be at 18:45)</value>
|
||||
</data>
|
||||
<data name="monitoringCronTextBox.Text" xml:space="preserve">
|
||||
<value>With cron expression you can specify schedules such as “every Friday at noon”, or “every weekday and 9:30 am”, or even “every 5 minutes between 9:00 am and 10:00 am on every Monday, Wednesday and Friday during January”.
|
||||
|
||||
Default example above means: Each working day of the week (MON-FRI) run every 15 minutes (0/15) between 8:00 and 18:45 (8-18 - last run will be at 18:45)</value>
|
||||
</data>
|
||||
<metadata name="mainToolStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>180, 17</value>
|
||||
</metadata>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="cancelToolStripButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
|
||||
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
|
||||
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
|
||||
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
|
||||
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
|
||||
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
|
||||
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
|
||||
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
|
||||
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
|
||||
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<data name="addToolStripButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
|
||||
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
|
||||
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
|
||||
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
|
||||
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
|
||||
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
|
||||
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
|
||||
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
|
||||
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
|
||||
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
</root>
|
|
@ -55,19 +55,21 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
// userComboBox
|
||||
//
|
||||
this.userComboBox.FormattingEnabled = true;
|
||||
this.userComboBox.Location = new System.Drawing.Point(358, 173);
|
||||
this.userComboBox.Location = new System.Drawing.Point(558, 260);
|
||||
this.userComboBox.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.userComboBox.Name = "userComboBox";
|
||||
this.userComboBox.Size = new System.Drawing.Size(185, 24);
|
||||
this.userComboBox.Size = new System.Drawing.Size(187, 32);
|
||||
this.userComboBox.TabIndex = 0;
|
||||
//
|
||||
// userLabel
|
||||
//
|
||||
this.userLabel.AutoSize = true;
|
||||
this.userLabel.Location = new System.Drawing.Point(264, 176);
|
||||
this.userLabel.Location = new System.Drawing.Point(426, 263);
|
||||
this.userLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.userLabel.Name = "userLabel";
|
||||
this.userLabel.Size = new System.Drawing.Size(88, 17);
|
||||
this.userLabel.Size = new System.Drawing.Size(124, 25);
|
||||
this.userLabel.TabIndex = 1;
|
||||
this.userLabel.Text = Resources.Choose_user;
|
||||
this.userLabel.Text = "Choose user";
|
||||
//
|
||||
// validateGroupBox
|
||||
//
|
||||
|
@ -86,48 +88,55 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
this.validateGroupBox.Controls.Add(this.axInstanceNameLabel);
|
||||
this.validateGroupBox.Controls.Add(this.userLabel);
|
||||
this.validateGroupBox.Controls.Add(this.userComboBox);
|
||||
this.validateGroupBox.Location = new System.Drawing.Point(13, 13);
|
||||
this.validateGroupBox.Location = new System.Drawing.Point(18, 20);
|
||||
this.validateGroupBox.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.validateGroupBox.Name = "validateGroupBox";
|
||||
this.validateGroupBox.Size = new System.Drawing.Size(685, 367);
|
||||
this.validateGroupBox.Padding = new System.Windows.Forms.Padding(4);
|
||||
this.validateGroupBox.Size = new System.Drawing.Size(942, 550);
|
||||
this.validateGroupBox.TabIndex = 2;
|
||||
this.validateGroupBox.TabStop = false;
|
||||
//
|
||||
// aadClientLabel
|
||||
//
|
||||
this.aadClientLabel.AutoSize = true;
|
||||
this.aadClientLabel.Location = new System.Drawing.Point(197, 203);
|
||||
this.aadClientLabel.Location = new System.Drawing.Point(271, 303);
|
||||
this.aadClientLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.aadClientLabel.Name = "aadClientLabel";
|
||||
this.aadClientLabel.Size = new System.Drawing.Size(155, 17);
|
||||
this.aadClientLabel.Size = new System.Drawing.Size(279, 25);
|
||||
this.aadClientLabel.TabIndex = 16;
|
||||
this.aadClientLabel.Text = Resources.Choose_AAD_Client_app;
|
||||
this.aadClientLabel.Text = "Choose Azure App registration";
|
||||
//
|
||||
// aadApplicationComboBox
|
||||
//
|
||||
this.aadApplicationComboBox.FormattingEnabled = true;
|
||||
this.aadApplicationComboBox.Location = new System.Drawing.Point(358, 200);
|
||||
this.aadApplicationComboBox.Location = new System.Drawing.Point(558, 300);
|
||||
this.aadApplicationComboBox.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.aadApplicationComboBox.Name = "aadApplicationComboBox";
|
||||
this.aadApplicationComboBox.Size = new System.Drawing.Size(185, 24);
|
||||
this.aadApplicationComboBox.Size = new System.Drawing.Size(187, 32);
|
||||
this.aadApplicationComboBox.TabIndex = 15;
|
||||
//
|
||||
// authMethodGroupBox
|
||||
//
|
||||
this.authMethodGroupBox.Controls.Add(this.serviceAuthRadioButton);
|
||||
this.authMethodGroupBox.Controls.Add(this.userAuthRadioButton);
|
||||
this.authMethodGroupBox.Location = new System.Drawing.Point(7, 147);
|
||||
this.authMethodGroupBox.Location = new System.Drawing.Point(10, 220);
|
||||
this.authMethodGroupBox.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.authMethodGroupBox.Name = "authMethodGroupBox";
|
||||
this.authMethodGroupBox.Size = new System.Drawing.Size(179, 84);
|
||||
this.authMethodGroupBox.Padding = new System.Windows.Forms.Padding(4);
|
||||
this.authMethodGroupBox.Size = new System.Drawing.Size(246, 126);
|
||||
this.authMethodGroupBox.TabIndex = 14;
|
||||
this.authMethodGroupBox.TabStop = false;
|
||||
this.authMethodGroupBox.Text = Resources.Authentication_method;
|
||||
this.authMethodGroupBox.Text = "Authentication method";
|
||||
//
|
||||
// serviceAuthRadioButton
|
||||
//
|
||||
this.serviceAuthRadioButton.AutoSize = true;
|
||||
this.serviceAuthRadioButton.Location = new System.Drawing.Point(7, 54);
|
||||
this.serviceAuthRadioButton.Location = new System.Drawing.Point(10, 81);
|
||||
this.serviceAuthRadioButton.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.serviceAuthRadioButton.Name = "serviceAuthRadioButton";
|
||||
this.serviceAuthRadioButton.Size = new System.Drawing.Size(169, 21);
|
||||
this.serviceAuthRadioButton.Size = new System.Drawing.Size(229, 29);
|
||||
this.serviceAuthRadioButton.TabIndex = 1;
|
||||
this.serviceAuthRadioButton.Text = Resources.Service_authentication;
|
||||
this.serviceAuthRadioButton.Text = global::RecurringIntegrationsScheduler.Properties.Resources.Service_authentication;
|
||||
this.serviceAuthRadioButton.UseVisualStyleBackColor = true;
|
||||
this.serviceAuthRadioButton.CheckedChanged += new System.EventHandler(this.ServiceAuthRadioButton_CheckedChanged);
|
||||
//
|
||||
|
@ -135,30 +144,33 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
//
|
||||
this.userAuthRadioButton.AutoSize = true;
|
||||
this.userAuthRadioButton.Checked = true;
|
||||
this.userAuthRadioButton.Location = new System.Drawing.Point(7, 27);
|
||||
this.userAuthRadioButton.Location = new System.Drawing.Point(10, 40);
|
||||
this.userAuthRadioButton.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.userAuthRadioButton.Name = "userAuthRadioButton";
|
||||
this.userAuthRadioButton.Size = new System.Drawing.Size(152, 21);
|
||||
this.userAuthRadioButton.Size = new System.Drawing.Size(204, 29);
|
||||
this.userAuthRadioButton.TabIndex = 0;
|
||||
this.userAuthRadioButton.TabStop = true;
|
||||
this.userAuthRadioButton.Text = Resources.User_authentication;
|
||||
this.userAuthRadioButton.Text = global::RecurringIntegrationsScheduler.Properties.Resources.User_authentication;
|
||||
this.userAuthRadioButton.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// messagesTextBox
|
||||
//
|
||||
this.messagesTextBox.Location = new System.Drawing.Point(7, 237);
|
||||
this.messagesTextBox.Location = new System.Drawing.Point(10, 356);
|
||||
this.messagesTextBox.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.messagesTextBox.Multiline = true;
|
||||
this.messagesTextBox.Name = "messagesTextBox";
|
||||
this.messagesTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
|
||||
this.messagesTextBox.Size = new System.Drawing.Size(672, 124);
|
||||
this.messagesTextBox.Size = new System.Drawing.Size(922, 184);
|
||||
this.messagesTextBox.TabIndex = 13;
|
||||
//
|
||||
// validateButton
|
||||
//
|
||||
this.validateButton.Location = new System.Drawing.Point(549, 199);
|
||||
this.validateButton.Location = new System.Drawing.Point(755, 298);
|
||||
this.validateButton.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.validateButton.Name = "validateButton";
|
||||
this.validateButton.Size = new System.Drawing.Size(130, 25);
|
||||
this.validateButton.Size = new System.Drawing.Size(179, 38);
|
||||
this.validateButton.TabIndex = 12;
|
||||
this.validateButton.Text = Resources.Validate;
|
||||
this.validateButton.Text = global::RecurringIntegrationsScheduler.Properties.Resources.Validate;
|
||||
this.validateButton.UseVisualStyleBackColor = true;
|
||||
this.validateButton.Click += new System.EventHandler(this.ValidateButton_Click);
|
||||
//
|
||||
|
@ -166,88 +178,97 @@ namespace RecurringIntegrationsScheduler.Forms
|
|||
//
|
||||
this.tenantTextBox.BackColor = System.Drawing.SystemColors.Control;
|
||||
this.tenantTextBox.BorderStyle = System.Windows.Forms.BorderStyle.None;
|
||||
this.tenantTextBox.Location = new System.Drawing.Point(180, 113);
|
||||
this.tenantTextBox.Location = new System.Drawing.Point(248, 170);
|
||||
this.tenantTextBox.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.tenantTextBox.Name = "tenantTextBox";
|
||||
this.tenantTextBox.Size = new System.Drawing.Size(499, 15);
|
||||
this.tenantTextBox.Size = new System.Drawing.Size(686, 22);
|
||||
this.tenantTextBox.TabIndex = 11;
|
||||
//
|
||||
// authEndPointTextBox
|
||||
//
|
||||
this.authEndPointTextBox.BackColor = System.Drawing.SystemColors.Control;
|
||||
this.authEndPointTextBox.BorderStyle = System.Windows.Forms.BorderStyle.None;
|
||||
this.authEndPointTextBox.Location = new System.Drawing.Point(180, 84);
|
||||
this.authEndPointTextBox.Location = new System.Drawing.Point(248, 126);
|
||||
this.authEndPointTextBox.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.authEndPointTextBox.Name = "authEndPointTextBox";
|
||||
this.authEndPointTextBox.Size = new System.Drawing.Size(499, 15);
|
||||
this.authEndPointTextBox.Size = new System.Drawing.Size(686, 22);
|
||||
this.authEndPointTextBox.TabIndex = 9;
|
||||
//
|
||||
// aosURLTextBox
|
||||
//
|
||||
this.aosURLTextBox.BackColor = System.Drawing.SystemColors.Control;
|
||||
this.aosURLTextBox.BorderStyle = System.Windows.Forms.BorderStyle.None;
|
||||
this.aosURLTextBox.Location = new System.Drawing.Point(180, 53);
|
||||
this.aosURLTextBox.Location = new System.Drawing.Point(248, 80);
|
||||
this.aosURLTextBox.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.aosURLTextBox.Name = "aosURLTextBox";
|
||||
this.aosURLTextBox.Size = new System.Drawing.Size(499, 15);
|
||||
this.aosURLTextBox.Size = new System.Drawing.Size(686, 22);
|
||||
this.aosURLTextBox.TabIndex = 8;
|
||||
//
|
||||
// axInstanceNameTextBox
|
||||
//
|
||||
this.axInstanceNameTextBox.BackColor = System.Drawing.SystemColors.Control;
|
||||
this.axInstanceNameTextBox.BorderStyle = System.Windows.Forms.BorderStyle.None;
|
||||
this.axInstanceNameTextBox.Location = new System.Drawing.Point(180, 22);
|
||||
this.axInstanceNameTextBox.Location = new System.Drawing.Point(248, 33);
|
||||
this.axInstanceNameTextBox.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.axInstanceNameTextBox.Name = "axInstanceNameTextBox";
|
||||
this.axInstanceNameTextBox.Size = new System.Drawing.Size(499, 15);
|
||||
this.axInstanceNameTextBox.Size = new System.Drawing.Size(686, 22);
|
||||
this.axInstanceNameTextBox.TabIndex = 7;
|
||||
//
|
||||
// tenantLabel
|
||||
//
|
||||
this.tenantLabel.AutoSize = true;
|
||||
this.tenantLabel.Location = new System.Drawing.Point(98, 113);
|
||||
this.tenantLabel.Location = new System.Drawing.Point(135, 170);
|
||||
this.tenantLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.tenantLabel.Name = "tenantLabel";
|
||||
this.tenantLabel.Size = new System.Drawing.Size(76, 17);
|
||||
this.tenantLabel.Size = new System.Drawing.Size(106, 25);
|
||||
this.tenantLabel.TabIndex = 6;
|
||||
this.tenantLabel.Text = Resources.Tenant_Id;
|
||||
this.tenantLabel.Text = "Tenant Id :";
|
||||
//
|
||||
// authEndpointLabel
|
||||
//
|
||||
this.authEndpointLabel.AutoSize = true;
|
||||
this.authEndpointLabel.Location = new System.Drawing.Point(9, 84);
|
||||
this.authEndpointLabel.Location = new System.Drawing.Point(12, 126);
|
||||
this.authEndpointLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.authEndpointLabel.Name = "authEndpointLabel";
|
||||
this.authEndpointLabel.Size = new System.Drawing.Size(165, 17);
|
||||
this.authEndpointLabel.Size = new System.Drawing.Size(227, 25);
|
||||
this.authEndpointLabel.TabIndex = 4;
|
||||
this.authEndpointLabel.Text = Resources.Authentication_endpoint;
|
||||
this.authEndpointLabel.Text = "Authentication endpoint :";
|
||||
//
|
||||
// aosURLLabel
|
||||
//
|
||||
this.aosURLLabel.AutoSize = true;
|
||||
this.aosURLLabel.Location = new System.Drawing.Point(97, 53);
|
||||
this.aosURLLabel.Location = new System.Drawing.Point(133, 80);
|
||||
this.aosURLLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.aosURLLabel.Name = "aosURLLabel";
|
||||
this.aosURLLabel.Size = new System.Drawing.Size(77, 17);
|
||||
this.aosURLLabel.Size = new System.Drawing.Size(110, 25);
|
||||
this.aosURLLabel.TabIndex = 3;
|
||||
this.aosURLLabel.Text = Resources.AOS_URL_;
|
||||
this.aosURLLabel.Text = "AOS URL :";
|
||||
//
|
||||
// axInstanceNameLabel
|
||||
//
|
||||
this.axInstanceNameLabel.AutoSize = true;
|
||||
this.axInstanceNameLabel.Location = new System.Drawing.Point(66, 22);
|
||||
this.axInstanceNameLabel.Location = new System.Drawing.Point(91, 33);
|
||||
this.axInstanceNameLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.axInstanceNameLabel.Name = "axInstanceNameLabel";
|
||||
this.axInstanceNameLabel.Size = new System.Drawing.Size(108, 17);
|
||||
this.axInstanceNameLabel.Size = new System.Drawing.Size(151, 25);
|
||||
this.axInstanceNameLabel.TabIndex = 2;
|
||||
this.axInstanceNameLabel.Text = Resources.Instance_name_;
|
||||
this.axInstanceNameLabel.Text = "Instance name :";
|
||||
//
|
||||
// ValidateConnection
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(11F, 24F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(710, 392);
|
||||
this.ClientSize = new System.Drawing.Size(976, 588);
|
||||
this.Controls.Add(this.validateGroupBox);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||
this.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.MinimumSize = new System.Drawing.Size(728, 439);
|
||||
this.MinimumSize = new System.Drawing.Size(992, 626);
|
||||
this.Name = "ValidateConnection";
|
||||
this.ShowIcon = false;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = Resources.Validate_instance_settings;
|
||||
this.Text = "Validate instance settings";
|
||||
this.Load += new System.EventHandler(this.ValidateConnection_Load);
|
||||
this.validateGroupBox.ResumeLayout(false);
|
||||
this.validateGroupBox.PerformLayout();
|
||||
|
|
|
@ -19,7 +19,7 @@ namespace RecurringIntegrationsScheduler.Properties {
|
|||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
@ -1036,6 +1036,15 @@ namespace RecurringIntegrationsScheduler.Properties {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to File name separator is missing.
|
||||
/// </summary>
|
||||
internal static string Filename_separator_is_missing {
|
||||
get {
|
||||
return ResourceManager.GetString("Filename_separator_is_missing", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Files filter and order.
|
||||
/// </summary>
|
||||
|
@ -1577,6 +1586,15 @@ namespace RecurringIntegrationsScheduler.Properties {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Package template file is missing.
|
||||
/// </summary>
|
||||
internal static string Package_template_is_missing {
|
||||
get {
|
||||
return ResourceManager.GetString("Package_template_is_missing", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Parameters.
|
||||
/// </summary>
|
||||
|
@ -2109,6 +2127,87 @@ namespace RecurringIntegrationsScheduler.Properties {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to URL for ExportToPackage action is missing.
|
||||
/// </summary>
|
||||
internal static string URL_for_ExportToPackage_action_is_missing {
|
||||
get {
|
||||
return ResourceManager.GetString("URL_for_ExportToPackage_action_is_missing", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to URL for GenerateImportTargetErrorKeysFile action is missing.
|
||||
/// </summary>
|
||||
internal static string URL_for_GenerateImportTargetErrorKeysFile_action_is_missing {
|
||||
get {
|
||||
return ResourceManager.GetString("URL_for_GenerateImportTargetErrorKeysFile_action_is_missing", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to URL for GetAzureWriteUrl action is missing.
|
||||
/// </summary>
|
||||
internal static string URL_for_GetAzureWriteUrl_action_is_missing {
|
||||
get {
|
||||
return ResourceManager.GetString("URL_for_GetAzureWriteUrl_action_is_missing", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to URL for GetExecutionErrors action is missing.
|
||||
/// </summary>
|
||||
internal static string URL_for_GetExecutionErrors_action_is_missing {
|
||||
get {
|
||||
return ResourceManager.GetString("URL_for_GetExecutionErrors_action_is_missing", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to URL for GetExecutionSummaryPageUrl action is missing.
|
||||
/// </summary>
|
||||
internal static string URL_for_GetExecutionSummaryPageUrl_action_is_missing {
|
||||
get {
|
||||
return ResourceManager.GetString("URL_for_GetExecutionSummaryPageUrl_action_is_missing", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to URL for GetExecutionSummaryStatus action is missing.
|
||||
/// </summary>
|
||||
internal static string URL_for_GetExecutionSummaryStatus_action_is_missing {
|
||||
get {
|
||||
return ResourceManager.GetString("URL_for_GetExecutionSummaryStatus_action_is_missing", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to URL for GetExportedPackageUrl action is missing.
|
||||
/// </summary>
|
||||
internal static string URL_for_GetExportedPackageUrl_action_is_missing {
|
||||
get {
|
||||
return ResourceManager.GetString("URL_for_GetExportedPackageUrl_action_is_missing", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to URL for GetImportTargetErrorKeysFileUrl action is missing.
|
||||
/// </summary>
|
||||
internal static string URL_for_GetImportTargetErrorKeysFileUrl_action_is_missing {
|
||||
get {
|
||||
return ResourceManager.GetString("URL_for_GetImportTargetErrorKeysFileUrl_action_is_missing", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to URL for ImportFromPackage action is missing.
|
||||
/// </summary>
|
||||
internal static string URL_for_ImportFromPackage_action_is_missing {
|
||||
get {
|
||||
return ResourceManager.GetString("URL_for_ImportFromPackage_action_is_missing", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Use default folder names.
|
||||
/// </summary>
|
||||
|
|
|
@ -864,4 +864,37 @@
|
|||
|
||||
Default example above means: Each working day of the week (MON-FRI) run every 15 minutes (0/15) between 8:00 and 18:45 (8-18 - last run will be at 18:45)</value>
|
||||
</data>
|
||||
<data name="Filename_separator_is_missing" xml:space="preserve">
|
||||
<value>File name separator is missing</value>
|
||||
</data>
|
||||
<data name="Package_template_is_missing" xml:space="preserve">
|
||||
<value>Package template file is missing</value>
|
||||
</data>
|
||||
<data name="URL_for_GenerateImportTargetErrorKeysFile_action_is_missing" xml:space="preserve">
|
||||
<value>URL for GenerateImportTargetErrorKeysFile action is missing</value>
|
||||
</data>
|
||||
<data name="URL_for_GetAzureWriteUrl_action_is_missing" xml:space="preserve">
|
||||
<value>URL for GetAzureWriteUrl action is missing</value>
|
||||
</data>
|
||||
<data name="URL_for_GetExecutionErrors_action_is_missing" xml:space="preserve">
|
||||
<value>URL for GetExecutionErrors action is missing</value>
|
||||
</data>
|
||||
<data name="URL_for_GetExecutionSummaryPageUrl_action_is_missing" xml:space="preserve">
|
||||
<value>URL for GetExecutionSummaryPageUrl action is missing</value>
|
||||
</data>
|
||||
<data name="URL_for_GetExecutionSummaryStatus_action_is_missing" xml:space="preserve">
|
||||
<value>URL for GetExecutionSummaryStatus action is missing</value>
|
||||
</data>
|
||||
<data name="URL_for_GetImportTargetErrorKeysFileUrl_action_is_missing" xml:space="preserve">
|
||||
<value>URL for GetImportTargetErrorKeysFileUrl action is missing</value>
|
||||
</data>
|
||||
<data name="URL_for_ImportFromPackage_action_is_missing" xml:space="preserve">
|
||||
<value>URL for ImportFromPackage action is missing</value>
|
||||
</data>
|
||||
<data name="URL_for_ExportToPackage_action_is_missing" xml:space="preserve">
|
||||
<value>URL for ExportToPackage action is missing</value>
|
||||
</data>
|
||||
<data name="URL_for_GetExportedPackageUrl_action_is_missing" xml:space="preserve">
|
||||
<value>URL for GetExportedPackageUrl action is missing</value>
|
||||
</data>
|
||||
</root>
|
|
@ -12,7 +12,7 @@ namespace RecurringIntegrationsScheduler.Properties {
|
|||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.0.0")]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.5.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
@ -228,5 +228,17 @@ namespace RecurringIntegrationsScheduler.Properties {
|
|||
this["AadApplications"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("True")]
|
||||
public bool V3Forms {
|
||||
get {
|
||||
return ((bool)(this["V3Forms"]));
|
||||
}
|
||||
set {
|
||||
this["V3Forms"] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -88,5 +88,8 @@
|
|||
</AadApplication>
|
||||
</ArrayOfAadApplication></Value>
|
||||
</Setting>
|
||||
<Setting Name="V3Forms" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">True</Value>
|
||||
</Setting>
|
||||
</Settings>
|
||||
</SettingsFile>
|
|
@ -124,12 +124,30 @@
|
|||
<Compile Include="Forms\AadApplicationForm.Designer.cs">
|
||||
<DependentUpon>AadApplicationForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Forms\DownloadJobV3.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Forms\DownloadJobV3.Designer.cs">
|
||||
<DependentUpon>DownloadJobV3.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Forms\ExportJobV3.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Forms\ExportJobV3.Designer.cs">
|
||||
<DependentUpon>ExportJobV3.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Forms\ExportJobOptions.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Forms\ExportJobOptions.Designer.cs">
|
||||
<DependentUpon>ExportJobOptions.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Forms\ImportJobV3.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Forms\ImportJobV3.Designer.cs">
|
||||
<DependentUpon>ImportJobV3.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Forms\ImportJobOptions.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
|
@ -160,6 +178,12 @@
|
|||
<Compile Include="Forms\ImportJob.Designer.cs">
|
||||
<DependentUpon>ImportJob.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Forms\UploadJobV3.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Forms\UploadJobV3.Designer.cs">
|
||||
<DependentUpon>UploadJobV3.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Forms\UserForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
|
@ -228,10 +252,19 @@
|
|||
<DependentUpon>AadApplicationForm.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Forms\DownloadJobV3.resx">
|
||||
<DependentUpon>DownloadJobV3.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Forms\ExportJobV3.resx">
|
||||
<DependentUpon>ExportJobV3.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Forms\ExportJobOptions.resx">
|
||||
<DependentUpon>ExportJobOptions.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Forms\ImportJobV3.resx">
|
||||
<DependentUpon>ImportJobV3.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Forms\ImportJobOptions.resx">
|
||||
<DependentUpon>ImportJobOptions.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
|
@ -249,6 +282,9 @@
|
|||
<EmbeddedResource Include="Forms\ImportJob.resx">
|
||||
<DependentUpon>ImportJob.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Forms\UploadJobV3.resx">
|
||||
<DependentUpon>UploadJobV3.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Forms\UserForm.resx">
|
||||
<DependentUpon>UserForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
|
|
|
@ -2,4 +2,4 @@
|
|||
Licensed under the MIT License. */
|
||||
|
||||
using System.Reflection;
|
||||
[assembly: AssemblyVersion("2.9.0.0")]
|
||||
[assembly: AssemblyVersion("3.0.0.0")]
|
Загрузка…
Ссылка в новой задаче