protected override ScheduledDataLoadJob CreateImpl(IRDMPPlatformRepositoryServiceLocator repositoryLocator, IDataLoadEventListener listener, HICDatabaseConfiguration configuration)
        {
            ScheduledDataLoadJob job;
            var loadProgress    = _scheduleList[_lastScheduleId];
            var datesToRetrieve = _availableSchedules[loadProgress].GetDates(OverrideNumberOfDaysToLoad ?? _scheduleList[_lastScheduleId].DefaultNumberOfDaysToLoadEachTime, false);

            if (!datesToRetrieve.Any())
            {
                return(null);
            }

            var LoadDirectory = new LoadDirectory(LoadMetadata.LocationOfFlatFiles);

            job = new ScheduledDataLoadJob(repositoryLocator, JobDescription, LogManager, LoadMetadata, LoadDirectory, listener, configuration);

            job.LoadProgress    = loadProgress;
            job.DatesToRetrieve = datesToRetrieve;

            // move our circular pointer for the round-robin assignment
            _lastScheduleId = (_lastScheduleId + 1) % _scheduleList.Count;

            return(job);
        }
Exemplo n.º 2
0
        private ExtractDatasetCommand CreateDatasetCommand(IRDMPPlatformRepositoryServiceLocator repositoryLocator, IExtractableDataSet dataset, IExtractionConfiguration configuration)
        {
            var catalogue = dataset.Catalogue;

            //get all extractable locals AND extractable globals first time then just extractable locals
            var docs = catalogue.GetAllSupportingDocuments(FetchOptions.ExtractableLocals);
            var sqls = catalogue.GetAllSupportingSQLTablesForCatalogue(FetchOptions.ExtractableLocals);

            //Now find all the lookups and include them into the bundle
            List <ITableInfo> lookupsFound;
            List <ITableInfo> normalTablesFound;

            catalogue.GetTableInfos(out normalTablesFound, out lookupsFound);

            //bundle consists of:
            var bundle = new ExtractableDatasetBundle(
                dataset,                                            //the dataset
                docs,                                               //all non global extractable docs (SupportingDocuments)
                sqls.Where(sql => sql.IsGlobal == false).ToArray(), //all non global extractable sql (SupportingSQL)
                lookupsFound.ToArray());                            //all lookups associated with the Catalogue (the one behind the ExtractableDataset)

            return(new ExtractDatasetCommand(configuration, bundle));
        }
Exemplo n.º 3
0
        public RDMPContextMenuStrip(RDMPContextMenuStripArgs args, object o)
        {
            _o    = o;
            _args = args;

            _activator = _args.ItemActivator;

            _activator.Theme.ApplyTo(this);

            AtomicCommandUIFactory = new AtomicCommandUIFactory(_activator);

            RepositoryLocator = _activator.RepositoryLocator;

            if (o != null && !(o is RDMPCollection))
            {
                ActivateCommandMenuItem = Add(new ExecuteCommandActivate(_activator, args.Masquerader ?? o));
            }

            if (o is DatabaseEntity e)
            {
                var gotoMenuBuilder = new GoToMenuBuilder(_activator);
                Items.Add(gotoMenuBuilder.GetMenu(e));
            }
        }
Exemplo n.º 4
0
        public int Run(IRDMPPlatformRepositoryServiceLocator repositoryLocator, IDataLoadEventListener listener, ICheckNotifier checkNotifier, GracefulCancellationToken token)
        {
            var dbType = repositoryLocator.CatalogueRepository.MEF.GetType(_options.Type);

            if (!typeof(IMapsDirectlyToDatabaseTable).IsAssignableFrom(dbType))
            {
                throw new NotSupportedException("Only Types derrived from IMapsDirectlyToDatabaseTable can be listed");
            }

            if (repositoryLocator.CatalogueRepository.SupportsObjectType(dbType))
            {
                ListObjects(repositoryLocator.CatalogueRepository, dbType);
            }
            else if (repositoryLocator.DataExportRepository.SupportsObjectType(dbType))
            {
                ListObjects(repositoryLocator.DataExportRepository, dbType);
            }
            else
            {
                throw new NotSupportedException("No IRepository owned up to supporting Type '" + dbType.FullName + "'");
            }

            return(0);
        }
        public CreateNewCatalogueByImportingFileUI_Advanced(IActivateItems activator, DiscoveredDatabase database, FileInfo file, bool alsoForwardEngineerCatalogue, Project projectSpecific)
        {
            _repositoryLocator            = activator.RepositoryLocator;
            _activator                    = activator;
            _database                     = database;
            _alsoForwardEngineerCatalogue = alsoForwardEngineerCatalogue;
            _projectSpecific              = projectSpecific;

            InitializeComponent();

            configureAndExecutePipeline1 = new ConfigureAndExecutePipelineUI(new UploadFileUseCase(file, database), activator);
            _file = file;
            //
            // configureAndExecutePipeline1
            //
            configureAndExecutePipeline1.Dock     = System.Windows.Forms.DockStyle.Fill;
            configureAndExecutePipeline1.Location = new System.Drawing.Point(0, 0);
            configureAndExecutePipeline1.Name     = "configureAndExecutePipeline1";
            configureAndExecutePipeline1.Size     = new System.Drawing.Size(979, 894);
            configureAndExecutePipeline1.TabIndex = 14;
            Controls.Add(this.configureAndExecutePipeline1);

            configureAndExecutePipeline1.PipelineExecutionFinishedsuccessfully += ConfigureAndExecutePipeline1OnPipelineExecutionFinishedsuccessfully;
        }
Exemplo n.º 6
0
        public ActivateItems(ITheme theme, RefreshBus refreshBus, DockPanel mainDockPanel, IRDMPPlatformRepositoryServiceLocator repositoryLocator, WindowFactory windowFactory, WindowManager windowManager, ICheckNotifier globalErrorCheckNotifier) : base(repositoryLocator, globalErrorCheckNotifier)
        {
            Theme          = theme;
            WindowFactory  = windowFactory;
            _mainDockPanel = mainDockPanel;
            _windowManager = windowManager;
            RefreshBus     = refreshBus;

            ConstructPluginChildProviders();
            CoreChildProvider = GetChildProvider();

            //Shouldn't ever change externally to your session so doesn't need constantly refreshed
            FavouritesProvider = new FavouritesProvider(this, repositoryLocator.CatalogueRepository);
            HistoryProvider    = new HistoryProvider(repositoryLocator);

            //handle custom icons from plugin user interfaces in which
            CoreIconProvider = new DataExportIconProvider(repositoryLocator, PluginUserInterfaces.ToArray());

            SelectIMapsDirectlyToDatabaseTableDialog.ImageGetter = (model) => CoreIconProvider.GetImage(model);

            WindowArranger = new WindowArranger(this, _windowManager, _mainDockPanel);

            CommandFactory          = new RDMPCombineableFactory();
            CommandExecutionFactory = new RDMPCommandExecutionFactory(this);

            ProblemProviders = new List <IProblemProvider>();
            ProblemProviders.Add(new DataExportProblemProvider());
            ProblemProviders.Add(new CatalogueProblemProvider());
            RefreshProblemProviders();

            RefreshBus.Subscribe(this);
        }
Exemplo n.º 7
0
        public WindowManager(ITheme theme, RDMPMainForm mainForm, RefreshBus refreshBus, DockPanel mainDockPanel, IRDMPPlatformRepositoryServiceLocator repositoryLocator, ICheckNotifier globalErrorCheckNotifier)
        {
            _windowFactory = new WindowFactory(repositoryLocator, this);
            ActivateItems  = new ActivateItems(theme, refreshBus, mainDockPanel, repositoryLocator, _windowFactory, this, globalErrorCheckNotifier);

            _mainDockPanel = mainDockPanel;

            MainForm          = mainForm;
            RepositoryLocator = repositoryLocator;

            Navigation = new NavigationTrack <DockContent>((c) => c.ParentForm != null, (c) => c.Activate());
            mainDockPanel.ActiveDocumentChanged += mainDockPanel_ActiveDocumentChanged;
        }
Exemplo n.º 8
0
        public int Run(IRDMPPlatformRepositoryServiceLocator repositoryLocator, IDataLoadEventListener listener, ICheckNotifier checkNotifier, GracefulCancellationToken token)
        {
            var toCommit = new FileInfo(_packOpts.File);

            if (!toCommit.Exists)
            {
                throw new FileNotFoundException("Could not find file '" + toCommit + "'");
            }

            if (toCommit.Extension.ToLowerInvariant() != PluginPackageSuffix)
            {
                throw new NotSupportedException("Plugins must be packaged as " + PluginPackageSuffix);
            }

            //the version of the plugin e.g. MyPlugin.nupkg version 1.0.0.0
            Version pluginVersion;

            //the version of rdmp on which the package depends on (e.g. 3.0)
            Version rdmpDependencyVersion;

            if (_packOpts.Prune)
            {
                var cmd = new ExecuteCommandPrunePlugin(_packOpts.File);
                cmd.Execute();
            }

            //find the manifest that lists name, version etc
            using (var zf = ZipFile.OpenRead(toCommit.FullName))
            {
                var manifests = zf.Entries.Where(e => e.FullName.EndsWith(PluginPackageManifest)).ToArray();

                if (manifests.Length != 1)
                {
                    throw new Exception("Found " + manifests.Length + " files in plguin with the extension " + PluginPackageManifest);
                }

                using (var s = manifests[0].Open())
                {
                    var doc = XDocument.Load(s);

                    var ns          = doc.Root.GetDefaultNamespace();// XNamespace.Get("http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd");
                    var versionNode = doc.Root.Element(ns + "metadata").Element(ns + "version");

                    if (versionNode == null)
                    {
                        throw new Exception("Could not find version tag");
                    }

                    pluginVersion = new Version(versionSuffix.Replace(versionNode.Value, ""));

                    var rdmpDependencyNode = doc.Descendants(ns + "dependency").FirstOrDefault(e => e.Attribute("id").Value == "HIC.RDMP.Plugin");

                    if (rdmpDependencyNode == null)
                    {
                        throw new Exception("Expected a single <dependency> tag with id = HIC.RDMP.Plugin (in order to determine plugin compatibility).  Ensure your nuspec file includes a dependency on this package.");
                    }

                    rdmpDependencyVersion = new Version(versionSuffix.Replace(rdmpDependencyNode.Attribute("version").Value, ""));
                }
            }

            var runningSoftwareVersion = new Version(FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location).FileVersion);

            if (!rdmpDependencyVersion.IsCompatibleWith(runningSoftwareVersion, 2))
            {
                throw new NotSupportedException(string.Format("Plugin version {0} is incompatible with current running version of RDMP ({1}).", pluginVersion, runningSoftwareVersion));
            }

            UploadFile(repositoryLocator, checkNotifier, toCommit, pluginVersion, rdmpDependencyVersion);

            return(0);
        }
Exemplo n.º 9
0
 /// <summary>
 /// Sets up checking of extracted global artifacts of the <paramref name="extractionConfigurations"/> to ensure that none have been missed and all are in
 /// a fit state to be shipped off in a release package.  You require one <see cref="GlobalsReleaseChecker"/> per global (which should be passeed as
 /// <paramref name="globalToCheck"/>).
 /// </summary>
 /// <param name="repositoryLocator"></param>
 /// <param name="extractionConfigurations"></param>
 /// <param name="globalToCheck">Determines the return of <see cref="GetEvaluator"/>.  Pass a global </param>
 public GlobalsReleaseChecker(IRDMPPlatformRepositoryServiceLocator repositoryLocator, IExtractionConfiguration[] extractionConfigurations, IMapsDirectlyToDatabaseTable globalToCheck = null)
 {
     _repositoryLocator = repositoryLocator;
     _configurations    = extractionConfigurations;
     _globalToCheck     = globalToCheck;
 }
Exemplo n.º 10
0
 // todo: refactor to cut down on ctor params
 public IterativeScheduledDataLoadProcess(IRDMPPlatformRepositoryServiceLocator repositoryLocator, ILoadMetadata loadMetadata, ICheckable preExecutionChecker, IDataLoadExecution loadExecution, JobDateGenerationStrategyFactory jobDateGenerationStrategyFactory, ILoadProgressSelectionStrategy loadProgressSelectionStrategy, int?overrideNumberOfDaysToLoad, ILogManager logManager, IDataLoadEventListener dataLoadEventsreceiver, HICDatabaseConfiguration configuration)
     : base(repositoryLocator, loadMetadata, preExecutionChecker, loadExecution, jobDateGenerationStrategyFactory, loadProgressSelectionStrategy, overrideNumberOfDaysToLoad, logManager, dataLoadEventsreceiver, configuration)
 {
 }
Exemplo n.º 11
0
 public UnitTests()
 {
     RepositoryLocator = new RepositoryProvider(Repository);
 }
Exemplo n.º 12
0
        public DatabaseTests()
        {
            var opts = new PlatformDatabaseCreationOptions()
            {
                ServerName          = TestDatabaseSettings.ServerName,
                Prefix              = TestDatabaseNames.Prefix,
                Username            = TestDatabaseSettings.Username,
                Password            = TestDatabaseSettings.Password,
                ValidateCertificate = false
            };


            RepositoryLocator = new PlatformDatabaseCreationRepositoryFinder(opts);


            Console.WriteLine("Expecting Unit Test Catalogue To Be At Server=" + CatalogueRepository.DiscoveredServer.Name + " Database=" + CatalogueRepository.DiscoveredServer.GetCurrentDatabase());

            if (!CatalogueRepository.DiscoveredServer.Exists())
            {
                Assert.Inconclusive("Catalogue database does not exist, run 'rdmp.exe install ...' to create it (Ensure that servername and prefix in TestDatabases.txt match those you provide to CreateDatabases.exe e.g. 'rdmp.exe install localhost\\sqlexpress TEST_')");
            }


            Console.WriteLine("Found Catalogue");

            Console.WriteLine("Expecting Unit Test Data Export To Be At Server=" + DataExportRepository.DiscoveredServer.Name + " Database= " + DataExportRepository.DiscoveredServer.GetCurrentDatabase());
            Assert.IsTrue(DataExportRepository.DiscoveredServer.Exists(), "Data Export database does not exist, run 'rdmp.exe install ...' to create it (Ensure that servername and prefix in TestDatabases.txt match those you provide to CreateDatabases.exe e.g. 'rdmp.exe install localhost\\sqlexpress TEST_')");
            Console.WriteLine("Found DataExport");

            Console.Write(Environment.NewLine + Environment.NewLine + Environment.NewLine);

            RunBlitzDatabases(RepositoryLocator);

            var defaults = CatalogueRepository.GetServerDefaults();

            DataQualityEngineConnectionString = CreateServerPointerInCatalogue(defaults, TestDatabaseNames.Prefix, PlatformDatabaseCreation.DefaultDQEDatabaseName, PermissableDefaults.DQE, new DataQualityEnginePatcher());
            UnitTestLoggingConnectionString   = CreateServerPointerInCatalogue(defaults, TestDatabaseNames.Prefix, PlatformDatabaseCreation.DefaultLoggingDatabaseName, PermissableDefaults.LiveLoggingServer_ID, new LoggingDatabasePatcher());
            DiscoveredServerICanCreateRandomDatabasesAndTablesOn = new DiscoveredServer(CreateServerPointerInCatalogue(defaults, TestDatabaseNames.Prefix, null, PermissableDefaults.RAWDataLoadServer, null));
            if (DiscoveredServerICanCreateRandomDatabasesAndTablesOn.Builder is SqlConnectionStringBuilder dsiccrdatocsb)
            {
                dsiccrdatocsb.TrustServerCertificate = true;
            }

            _discoveredSqlServer = new DiscoveredServer(TestDatabaseSettings.ServerName, null, DatabaseType.MicrosoftSQLServer, TestDatabaseSettings.Username, TestDatabaseSettings.Password);
            if (_discoveredSqlServer.Builder is SqlConnectionStringBuilder csb)
            {
                csb.TrustServerCertificate = true;
            }

            if (TestDatabaseSettings.MySql != null)
            {
                var builder = new MySqlConnectionStringBuilder(TestDatabaseSettings.MySql);

                foreach (string k in builder.Keys)
                {
                    if (k is "server" or "database" or "user id" or "password")
                    {
                        continue;
                    }

                    new ConnectionStringKeyword(CatalogueRepository, DatabaseType.MySql, k, builder[k].ToString());
                }
                _discoveredMySqlServer = new DiscoveredServer(builder);
            }

            if (TestDatabaseSettings.Oracle != null)
            {
                _discoveredOracleServer = new DiscoveredServer(TestDatabaseSettings.Oracle, DatabaseType.Oracle);
            }

            if (TestDatabaseSettings.PostgreSql != null)
            {
                _discoveredPostgresServer = new DiscoveredServer(TestDatabaseSettings.PostgreSql, DatabaseType.PostgreSql);
            }
        }
Exemplo n.º 13
0
 public PickObjectByName(IRDMPPlatformRepositoryServiceLocator repositoryLocator) :
     base(repositoryLocator,
          new Regex(@"^([A-Za-z]+):([^:]+)$", RegexOptions.IgnoreCase))
 {
 }
Exemplo n.º 14
0
 public PickType(IRDMPPlatformRepositoryServiceLocator repositoryLocator) : base(repositoryLocator, new Regex(".*"))
 {
 }
Exemplo n.º 15
0
 public void SetRepositoryLocator(IRDMPPlatformRepositoryServiceLocator repositoryLocator)
 {
     RepositoryLocator = repositoryLocator;
 }
Exemplo n.º 16
0
 protected GlobalReleasePotential(IRDMPPlatformRepositoryServiceLocator repositoryLocator, ISupplementalExtractionResults globalResult, IMapsDirectlyToDatabaseTable globalToCheck)
 {
     RepositoryLocator = repositoryLocator;
     GlobalResult      = globalResult;
     RelatedGlobal     = globalToCheck;
 }
Exemplo n.º 17
0
        public DeserializeInstruction ShouldCreateObjectCollection(string persistString, IRDMPPlatformRepositoryServiceLocator repositoryLocator)
        {
            if (!persistString.StartsWith(PersistableObjectCollectionDockContent.Prefix))
            {
                return(null);
            }

            if (!persistString.Contains(PersistStringHelper.ExtraText))
            {
                throw new PersistenceException("Persistence string did not contain '" + PersistStringHelper.ExtraText);
            }

            //Looks something like this  RDMPObjectCollection:MyCoolControlUI:MyControlUIsBundleOfObjects:[CatalogueRepository:AggregateConfiguration:105,CatalogueRepository:AggregateConfiguration:102,CatalogueRepository:AggregateConfiguration:101]###EXTRA_TEXT###I've got a lovely bunch of coconuts
            var tokens = persistString.Split(PersistStringHelper.Separator);

            var uiType         = GetTypeByName(tokens[1], typeof(Control), repositoryLocator);
            var collectionType = GetTypeByName(tokens[2], typeof(IPersistableObjectCollection), repositoryLocator);

            ObjectConstructor            objectConstructor  = new ObjectConstructor();
            IPersistableObjectCollection collectionInstance = (IPersistableObjectCollection)objectConstructor.Construct(collectionType);

            if (collectionInstance.DatabaseObjects == null)
            {
                throw new PersistenceException("Constructor of Type '" + collectionType + "' did not initialise property DatabaseObjects");
            }

            var allObjectsString = _persistStringHelper.MatchCollectionInString(persistString);

            collectionInstance.DatabaseObjects.AddRange(_persistStringHelper.GetObjectCollectionFromPersistString(allObjectsString, repositoryLocator));

            var extraText = _persistStringHelper.GetExtraText(persistString);

            collectionInstance.LoadExtraText(extraText);

            return(new DeserializeInstruction(uiType, collectionInstance));
        }
Exemplo n.º 18
0
        public DeserializeInstruction ShouldCreateSingleObjectControl(string persistString, IRDMPPlatformRepositoryServiceLocator repositoryLocator)
        {
            if (!persistString.StartsWith(PersistableSingleDatabaseObjectDockContent.Prefix))
            {
                return(null);
            }

            //return Prefix + s + _control.GetType().Name + s + _databaseObject.Repository.GetType() +  s + _databaseObject.GetType().Name + s + _databaseObject.ID;
            var tokens = persistString.Split(PersistStringHelper.Separator);

            if (tokens.Length != 5)
            {
                throw new PersistenceException("Unexpected number of tokens (" + tokens.Length + ") for Persistence of Type " + PersistableSingleDatabaseObjectDockContent.Prefix);
            }

            Type controlType = GetTypeByName(tokens[1], typeof(Control), repositoryLocator);
            IMapsDirectlyToDatabaseTable o = repositoryLocator.GetArbitraryDatabaseObject(tokens[2], tokens[3], int.Parse(tokens[4]));

            return(new DeserializeInstruction(controlType, o));
        }
 public override ReleasePotential GetReleasePotential(IRDMPPlatformRepositoryServiceLocator repositoryLocator, ISelectedDataSets selectedDataSet)
 {
     return(new MsSqlExtractionReleasePotential(repositoryLocator, selectedDataSet));
 }
Exemplo n.º 20
0
        public DataExportChildProvider(IRDMPPlatformRepositoryServiceLocator repositoryLocator, IChildProvider[] pluginChildProviders, ICheckNotifier errorsCheckNotifier, DataExportChildProvider previousStateIfKnown) : base(repositoryLocator.CatalogueRepository, pluginChildProviders, errorsCheckNotifier, previousStateIfKnown)
        {
            BlackListedSources   = previousStateIfKnown?.BlackListedSources ?? new List <ExternalCohortTable>();
            _errorsCheckNotifier = errorsCheckNotifier;
            dataExportRepository = repositoryLocator.DataExportRepository;

            AllProjectAssociatedCics = GetAllObjects <ProjectCohortIdentificationConfigurationAssociation>(dataExportRepository);

            _cicAssociations = new HashSet <int>(AllProjectAssociatedCics.Select(a => a.CohortIdentificationConfiguration_ID));

            CohortSources       = GetAllObjects <ExternalCohortTable>(dataExportRepository);
            ExtractableDataSets = GetAllObjects <ExtractableDataSet>(dataExportRepository);

            AddToDictionaries(new HashSet <object>(AllCohortIdentificationConfigurations.Where(cic => _cicAssociations.Contains(cic.ID))), new DescendancyList(AllProjectCohortIdentificationConfigurationsNode));
            AddToDictionaries(new HashSet <object>(AllCohortIdentificationConfigurations.Where(cic => !_cicAssociations.Contains(cic.ID))), new DescendancyList(AllFreeCohortIdentificationConfigurationsNode));

            _selectedDataSetsWithNoIsExtractionIdentifier = new HashSet <ISelectedDataSets>(dataExportRepository.GetSelectedDatasetsWithNoExtractionIdentifiers());

            SelectedDataSets = GetAllObjects <SelectedDataSets>(dataExportRepository);
            ReportProgress("Fetching data export objects");

            var dsDictionary = ExtractableDataSets.ToDictionary(ds => ds.ID, d => d);

            foreach (SelectedDataSets s in SelectedDataSets)
            {
                s.InjectKnown(dsDictionary[s.ExtractableDataSet_ID]);
            }

            ReportProgress("Injecting SelectedDataSets");

            //This means that the ToString method in ExtractableDataSet doesn't need to go lookup catalogue info
            var catalogueIdDict = AllCatalogues.ToDictionary(c => c.ID, c2 => c2);

            foreach (ExtractableDataSet ds in ExtractableDataSets)
            {
                if (catalogueIdDict.TryGetValue(ds.Catalogue_ID, out Catalogue cata))
                {
                    ds.InjectKnown(cata);
                }
            }

            ReportProgress("Injecting ExtractableDataSet");

            AllPackages = GetAllObjects <ExtractableDataSetPackage>(dataExportRepository);

            Projects = GetAllObjects <Project>(dataExportRepository);
            ExtractionConfigurations = GetAllObjects <ExtractionConfiguration>(dataExportRepository);

            ReportProgress("Get Projects and Configurations");

            ExtractionConfigurationsByProject = ExtractionConfigurations.GroupBy(k => k.Project_ID).ToDictionary(gdc => gdc.Key, gdc => gdc.ToList());

            ReportProgress("Grouping Extractions by Project");

            AllGlobalExtractionFilterParameters = GetAllObjects <GlobalExtractionFilterParameter>(dataExportRepository);

            AllContainers = GetAllObjects <FilterContainer>(dataExportRepository).ToDictionary(o => o.ID, o => o);
            AllDeployedExtractionFilters = GetAllObjects <DeployedExtractionFilter>(dataExportRepository);
            _allParameters = GetAllObjects <DeployedExtractionFilterParameter>(dataExportRepository);

            ReportProgress("Getting Filters");

            //if we are using a database repository then we can make use of the caching class DataExportFilterManagerFromChildProvider to speed up
            //filter contents
            var dbRepo = dataExportRepository as DataExportRepository;

            _dataExportFilterManager = dbRepo == null ? dataExportRepository.FilterManager : new DataExportFilterManagerFromChildProvider(dbRepo, this);

            ReportProgress("Building FilterManager");

            Cohorts            = GetAllObjects <ExtractableCohort>(dataExportRepository);
            _cohortsByOriginId = new Dictionary <int, HashSet <ExtractableCohort> >();

            foreach (ExtractableCohort c in Cohorts)
            {
                if (!_cohortsByOriginId.ContainsKey(c.OriginID))
                {
                    _cohortsByOriginId.Add(c.OriginID, new HashSet <ExtractableCohort>());
                }

                _cohortsByOriginId[c.OriginID].Add(c);
            }

            _configurationToDatasetMapping = new Dictionary <ExtractionConfiguration, List <SelectedDataSets> >();

            ReportProgress("Fetching Cohorts");

            GetCohortAvailability();

            ReportProgress("GetCohortAvailability");

            var configToSds = SelectedDataSets.GroupBy(k => k.ExtractionConfiguration_ID).ToDictionary(gdc => gdc.Key, gdc => gdc.ToList());

            foreach (ExtractionConfiguration configuration in ExtractionConfigurations)
            {
                if (configToSds.TryGetValue(configuration.ID, out List <SelectedDataSets> result))
                {
                    _configurationToDatasetMapping.Add(configuration, result);
                }
            }

            ReportProgress("Mapping configurations to datasets");

            RootCohortsNode = new AllCohortsNode();
            AddChildren(RootCohortsNode, new DescendancyList(RootCohortsNode));

            foreach (ExtractableDataSetPackage package in AllPackages)
            {
                AddChildren(package, new DescendancyList(package));
            }

            ReportProgress("Packages and Cohorts");

            foreach (Project p in Projects)
            {
                AddChildren(p, new DescendancyList(p));
            }

            ReportProgress("Projects");

            //work out all the Catalogues that are extractable (Catalogues are extractable if there is an ExtractableDataSet with the Catalogue_ID that matches them)
            var cataToEds = new Dictionary <int, ExtractableDataSet>(ExtractableDataSets.ToDictionary(k => k.Catalogue_ID));

            //inject extractability into Catalogues
            foreach (Catalogue catalogue in AllCatalogues)
            {
                if (cataToEds.TryGetValue(catalogue.ID, out ExtractableDataSet result))
                {
                    catalogue.InjectKnown(result.GetCatalogueExtractabilityStatus());
                }
                else
                {
                    catalogue.InjectKnown(new CatalogueExtractabilityStatus(false, false));
                }
            }

            ReportProgress("Catalogue extractability injection");

            try
            {
                AddPipelineUseCases(new Dictionary <string, PipelineUseCase>
                {
                    { "File Import", UploadFileUseCase.DesignTime() },
                    { "Extraction", ExtractionPipelineUseCase.DesignTime() },
                    { "Release", ReleaseUseCase.DesignTime() },
                    { "Cohort Creation", CohortCreationRequest.DesignTime() },
                    { "Caching", CachingPipelineUseCase.DesignTime() },
                    { "Aggregate Committing", CreateTableFromAggregateUseCase.DesignTime(repositoryLocator.CatalogueRepository) }
                });
            }
            catch (Exception ex)
            {
                _errorsCheckNotifier.OnCheckPerformed(new CheckEventArgs("Failed to build DesignTime PipelineUseCases", CheckResult.Fail, ex));
            }

            ReportProgress("Pipeline adding");
        }
 public override GlobalReleasePotential GetGlobalReleasabilityEvaluator(IRDMPPlatformRepositoryServiceLocator repositoryLocator, ISupplementalExtractionResults globalResult, IMapsDirectlyToDatabaseTable globalToCheck)
 {
     return(new MsSqlGlobalsReleasePotential(repositoryLocator, globalResult, globalToCheck));
 }
 public CataloguePipelinesAndReferencesCreation(IRDMPPlatformRepositoryServiceLocator repositoryLocator, SqlConnectionStringBuilder logging, SqlConnectionStringBuilder dqe)
 {
     _repositoryLocator = repositoryLocator;
     _logging           = logging;
     _dqe = dqe;
 }
Exemplo n.º 23
0
 public WindowFactory(IRDMPPlatformRepositoryServiceLocator repositoryLocator, WindowManager windowManager)
 {
     _windowManager = windowManager;
     RepositoryLocator = repositoryLocator;
 }
Exemplo n.º 24
0
 /// <summary>
 /// Creates a new manager for importing and exporting objects from the given platform databases
 /// </summary>
 /// <param name="repositoryLocator"></param>
 /// <param name="localReferenceGetter"></param>
 public ShareManager(IRDMPPlatformRepositoryServiceLocator repositoryLocator, LocalReferenceGetterDelegate localReferenceGetter = null)
 {
     RepositoryLocator    = repositoryLocator;
     _catalogueRepository = RepositoryLocator.CatalogueRepository;
     LocalReferenceGetter = localReferenceGetter ?? DefaultLocalReferenceGetter;
 }
Exemplo n.º 25
0
 public Startup(EnvironmentInfo environmentInfo, IRDMPPlatformRepositoryServiceLocator repositoryLocator) : this(environmentInfo)
 {
     RepositoryLocator = repositoryLocator;
 }
Exemplo n.º 26
0
 public abstract IDataLoadJob Create(IRDMPPlatformRepositoryServiceLocator repositoryLocator, IDataLoadEventListener listener, HICDatabaseConfiguration configuration);
Exemplo n.º 27
0
 /// <summary>
 /// Creates a new instance connected to the provided RDMP platform databases
 /// </summary>
 /// <param name="repositoryLocator">The databases to connect to</param>
 /// <param name="globalErrorCheckNotifier">The global error provider for non fatal issues</param>
 public ConsoleInputManager(IRDMPPlatformRepositoryServiceLocator repositoryLocator, ICheckNotifier globalErrorCheckNotifier) : base(repositoryLocator, globalErrorCheckNotifier)
 {
     RefreshChildProvider();
 }
Exemplo n.º 28
0
 public ExampleDatasetsCreation(IRDMPPlatformRepositoryServiceLocator repos)
 {
     this._repos = repos;
 }
Exemplo n.º 29
0
 public ConsoleGuiActivator(IRDMPPlatformRepositoryServiceLocator repositoryLocator, ICheckNotifier globalErrorCheckNotifier) : base(repositoryLocator, globalErrorCheckNotifier)
 {
     CoreChildProvider = new DataExportChildProvider(RepositoryLocator, null, GlobalErrorCheckNotifier);
 }
 public FlatFileGlobalsReleasePotential(IRDMPPlatformRepositoryServiceLocator repositoryLocator, ISupplementalExtractionResults globalResult, IMapsDirectlyToDatabaseTable globalToCheck)
     : base(repositoryLocator, globalResult, globalToCheck)
 {
 }