Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initialize default Odata actions path when there is no Context to use #38

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
51 changes: 51 additions & 0 deletions Common/JobSettings/Settings.cs
Expand Up @@ -154,6 +154,57 @@ public virtual void Initialize(IJobExecutionContext context)
}
}

/// <summary>
/// This method can be used to initialize default Odata action path values when there is no context to use.
/// </summary>
public void InitializeDefaultOdataActionPath()
{
if (string.IsNullOrEmpty(ImportFromPackageActionPath))
{
ImportFromPackageActionPath = OdataActionsConstants.ImportFromPackageActionPath;
}

if (string.IsNullOrEmpty(GetAzureWriteUrlActionPath))
{
GetAzureWriteUrlActionPath = OdataActionsConstants.GetAzureWriteUrlActionPath;
}

if (string.IsNullOrEmpty(GetExecutionSummaryStatusActionPath))
{
GetExecutionSummaryStatusActionPath = OdataActionsConstants.GetExecutionSummaryStatusActionPath;
}

if (string.IsNullOrEmpty(GetExportedPackageUrlActionPath))
{
GetExportedPackageUrlActionPath = OdataActionsConstants.GetExportedPackageUrlActionPath;
}

if (string.IsNullOrEmpty(GetExecutionSummaryPageUrlActionPath))
{
GetExecutionSummaryPageUrlActionPath = OdataActionsConstants.GetExecutionSummaryPageUrlActionPath;
}

if (string.IsNullOrEmpty(DeleteExecutionHistoryJobActionPath))
{
DeleteExecutionHistoryJobActionPath = OdataActionsConstants.DeleteExecutionHistoryJobActionPath;
}

if (string.IsNullOrEmpty(ExportToPackageActionPath))
{
ExportToPackageActionPath = OdataActionsConstants.ExportToPackageActionPath;
}

if (string.IsNullOrEmpty(ExportFromPackageActionPath))
{
ExportFromPackageActionPath = OdataActionsConstants.ExportFromPackageActionPath;
}

if (string.IsNullOrEmpty(GetMessageStatusActionPath))
{
GetMessageStatusActionPath = OdataActionsConstants.GetMessageStatusActionPath;
}
}

#region Members

/// <summary>
Expand Down
3 changes: 3 additions & 0 deletions Scheduler/Forms/ValidateConnection.cs
Expand Up @@ -68,6 +68,9 @@ private void ValidateButton_Click(object sender, EventArgs e)

var settings = new Common.JobSettings.DownloadJobSettings();

// Initialize default Odata action path as we do not have any context to use
settings.InitializeDefaultOdataActionPath();

Guid.TryParse(application.ClientId, out Guid aadClientGuid);
settings.AadClientId = aadClientGuid;
settings.AadClientSecret = EncryptDecrypt.Decrypt(application.Secret);
Expand Down