/// <summary> /// prepares to check the dataset as it is selected in an <see cref="ExtractionConfiguration"/>. Optionally checks an extraction <see cref="Pipeline"/> and globals /// </summary> /// <param name="activator"></param> /// <param name="selectedDataSet"></param> /// <param name="checkGlobals"></param> /// <param name="alsoCheckPipeline"></param> public SelectedDataSetsChecker(IBasicActivateItems activator, ISelectedDataSets selectedDataSet, bool checkGlobals = false, IPipeline alsoCheckPipeline = null) { _checkGlobals = checkGlobals; _alsoCheckPipeline = alsoCheckPipeline; _activator = activator; SelectedDataSet = selectedDataSet; }
public object GetState(ISelectedDataSets selectedDataSets) { var matches = GetCheckerResults <ReleasePotential>(rp => rp.SelectedDataSet.ID == selectedDataSets.ID); if (matches.Length == 0) { return(null); } var releasePotential = (ReleasePotential)matches.Single().Key; var results = matches.Single().Value; //not been released ever if (releasePotential is NoReleasePotential) { return(Releaseability.NeverBeenSuccessfullyExecuted); } //do we know the release state of the assesments if (releasePotential.Assessments != null && releasePotential.Assessments.Any()) { var releasability = releasePotential.Assessments.Values.Min(); if (releasability != Releaseability.Undefined) { return(releasability); } } //otherwise use the checks of it return(results.GetWorst()); }
public ExecuteCommandOpenExtractionDirectory(IActivateItems activator, ISelectedDataSets sds) : base(activator) { var result = sds.GetCumulativeExtractionResultsIfAny(); try { if (result == null) { SetImpossible("Dataset has not been extracted"); } else if (result.DestinationType == null || !result.DestinationType.EndsWith("FlatFileDestination")) { SetImpossible("Extraction destination was not to disk"); } else { _file = new FileInfo(result.DestinationDescription); if (!_file.Exists) { SetImpossible($"File '{_file.FullName}' did not exist on disk"); } } } catch (Exception) { SetImpossible("Could not determine file location"); } }
protected ReleasePotential(IRDMPPlatformRepositoryServiceLocator repositoryLocator, ISelectedDataSets selectedDataSet) { _repositoryLocator = repositoryLocator; _repository = selectedDataSet.Repository; SelectedDataSet = selectedDataSet; Configuration = selectedDataSet.ExtractionConfiguration; DataSet = selectedDataSet.ExtractableDataSet; Assessments = new Dictionary <IExtractionResults, Releaseability>(); //see what has been extracted before DatasetExtractionResult = Configuration.CumulativeExtractionResults.FirstOrDefault(r => r.ExtractableDataSet_ID == DataSet.ID); }
private void AddClearTarget(ISelectedDataSets sds) { var progress = sds.ExtractionProgressIfAny; if (progress == null) { return; } if (progress.ProgressDate != null) { _toClear.Add(progress); } }
/// <summary> /// Sets the thing being released, valid targets are <see cref="Project"/>, <see cref="ExtractionConfiguration"/> and <see cref="ISelectedDataSets"/>. /// </summary> /// <param name="target"></param> /// <returns></returns> public IAtomicCommandWithTarget SetTarget(DatabaseEntity target) { _project = target as Project; _configuration = target as ExtractionConfiguration; _selectedDataSet = target as ISelectedDataSets; if (_project != null && _project.ExtractionConfigurations.All(ec => ec.IsReleased)) { SetImpossible("There are no unreleased ExtractionConfigurations in Project"); } if (_configuration != null) { _project = (Project)_configuration.Project; if (_configuration.IsReleased) { SetImpossible("ExtractionConfiguration has already been Released"); } if (_configuration.Cohort_ID == null) { SetImpossible("No Cohort Defined"); } if (!_configuration.SelectedDataSets.Any()) { SetImpossible("No datasets configured"); } } if (_selectedDataSet != null) { _configuration = (ExtractionConfiguration)_selectedDataSet.ExtractionConfiguration; _project = (Project)_configuration.Project; if (_selectedDataSet.ExtractionConfiguration.IsReleased) { SetImpossible("This dataset is part of an ExtractionConfiguration that has already been Released"); } if (_selectedDataSet.ExtractionConfiguration.Cohort_ID == null) { SetImpossible("This dataset is part of an ExtractionConfiguration with no Cohort defined"); } } return(this); }
public override void Execute() { base.Execute(); if (_selectedDataSet == null && _extractionConfiguration != null) { _selectedDataSet = SelectOne(BasicActivator.RepositoryLocator.DataExportRepository.GetAllObjectsWithParent <SelectedDataSets>(_extractionConfiguration)); } if (_selectedDataSet == null) { return; } BasicActivator.ShowData(new ViewSelectedDatasetExtractionUICollection(_selectedDataSet)); }
public ExecuteCommandAddExtractionProgress(IBasicActivateItems activator, ISelectedDataSets sds) : base(activator) { _sds = sds; if (_sds.ExtractionProgressIfAny != null) { SetImpossible("Catalogue already has an ExtractionProgress"); return; } if (_sds.GetCatalogue()?.TimeCoverage_ExtractionInformation_ID == null) { SetImpossible("Catalogue does not have a time coverage field configured"); return; } }
public IAtomicCommandWithTarget SetTarget(DatabaseEntity target) { if (target is SelectedDataSets) { _selectedDataSet = target as SelectedDataSets; if (_selectedDataSet != null) { //must have datasets and have a cohort configured if (_selectedDataSet.ExtractionConfiguration.Cohort_ID == null) { SetImpossible("No cohort has been selected for ExtractionConfiguration"); } } } if (target is ExtractionConfiguration) { _extractionConfiguration = target as ExtractionConfiguration; } return(this); }
/// <inheritdoc/> public abstract ReleasePotential GetReleasePotential(IRDMPPlatformRepositoryServiceLocator repositoryLocator, ISelectedDataSets selectedDataSet);
/// <summary> /// prepares to check the dataset as it is selected in an <see cref="ExtractionConfiguration"/>. Optionally checks an extraction <see cref="Pipeline"/> and globals /// </summary> /// <param name="selectedDataSet"></param> /// <param name="checkGlobals"></param> /// <param name="alsoCheckPipeline"></param> public SelectedDataSetsChecker(ISelectedDataSets selectedDataSet, bool checkGlobals = false, IPipeline alsoCheckPipeline = null) { _checkGlobals = checkGlobals; _alsoCheckPipeline = alsoCheckPipeline; SelectedDataSet = selectedDataSet; }
public ExtractDatasetCommand Create(IRDMPPlatformRepositoryServiceLocator repositoryLocator, ISelectedDataSets selectedDataSets) { return(CreateDatasetCommand(repositoryLocator, selectedDataSets.ExtractableDataSet, selectedDataSets.ExtractionConfiguration)); }
private bool IsEligible(ISelectedDataSets arg) { return(arg.RootFilterContainer_ID != null); }
/// <inheritdoc/> public bool IsFor(ISelectedDataSets selectedDataSet) { return(selectedDataSet.ExtractableDataSet_ID == ExtractableDataSet_ID && selectedDataSet.ExtractionConfiguration_ID == ExtractionConfiguration_ID); }
public ReleasePotential GetReleasePotential(IRDMPPlatformRepositoryServiceLocator repositoryLocator, ISelectedDataSets selectedDataSet) { return(new FlatFileReleasePotential(repositoryLocator, selectedDataSet)); }
public ExecuteCommandViewExtractionSql(IBasicActivateItems activator, SelectedDataSets sds) : base(activator) { _extractionConfiguration = sds.ExtractionConfiguration; _selectedDataSet = sds; }
public FlatFileReleasePotential(IRDMPPlatformRepositoryServiceLocator repositoryLocator, ISelectedDataSets selectedDataSets) : base(repositoryLocator, selectedDataSets) { }
public void Tick(ISelectedDataSets selectedDataSet) { tlvReleasePotentials.UncheckAll(); tlvReleasePotentials.CheckObject(selectedDataSet); tlvReleasePotentials.CheckObject(_globalsNode); }
public override ReleasePotential GetReleasePotential(IRDMPPlatformRepositoryServiceLocator repositoryLocator, ISelectedDataSets selectedDataSet) { return(new MsSqlExtractionReleasePotential(repositoryLocator, selectedDataSet)); }
public MsSqlExtractionReleasePotential(IRDMPPlatformRepositoryServiceLocator repositoryLocator, ISelectedDataSets selectedDataSets) : base(repositoryLocator, selectedDataSets) { }