Exemplo n.º 1
0
        private void AddChildren(ExtractionConfigurationsNode extractionConfigurationsNode, DescendancyList descendancy)
        {
            HashSet <object> children = new HashSet <object>();

            //Create a frozen extraction configurations folder as a subfolder of each ExtractionConfigurationsNode
            var frozenConfigurationsNode = new FrozenExtractionConfigurationsNode(extractionConfigurationsNode.Project);

            //Make the frozen folder appear under the extractionConfigurationsNode
            children.Add(frozenConfigurationsNode);

            //Add children to the frozen folder
            AddChildren(frozenConfigurationsNode, descendancy.Add(frozenConfigurationsNode));

            //Add ExtractionConfigurations which are not released (frozen)
            if (ExtractionConfigurationsByProject.TryGetValue(extractionConfigurationsNode.Project.ID, out List <ExtractionConfiguration> result))
            {
                foreach (ExtractionConfiguration config in result.Where(c => !c.IsReleased))
                {
                    AddChildren(config, descendancy.Add(config));
                    children.Add(config);
                }
            }

            AddToDictionaries(children, descendancy);
        }
Exemplo n.º 2
0
        private void AddChildren(Project project, DescendancyList descendancy)
        {
            HashSet <object> children = new HashSet <object>();

            var projectCohortNode = new ProjectCohortsNode(project);

            children.Add(projectCohortNode);
            AddChildren(projectCohortNode, descendancy.Add(projectCohortNode));

            var projectCataloguesNode = new ProjectCataloguesNode(project);

            children.Add(projectCataloguesNode);
            AddChildren(projectCataloguesNode, descendancy.Add(projectCataloguesNode).SetNewBestRoute());

            var extractionConfigurationsNode = new ExtractionConfigurationsNode(project);

            children.Add(extractionConfigurationsNode);

            AddChildren(extractionConfigurationsNode, descendancy.Add(extractionConfigurationsNode));

            var folder = new ExtractionDirectoryNode(project);

            children.Add(folder);
            AddToDictionaries(children, descendancy);
        }
Exemplo n.º 3
0
        private void AddChildren(ProjectCohortsNode projectCohortsNode, DescendancyList descendancy)
        {
            HashSet <object> children = new HashSet <object>();
            var projectCiCsNode       = new ProjectCohortIdentificationConfigurationAssociationsNode(projectCohortsNode.Project);

            children.Add(projectCiCsNode);
            AddChildren(projectCiCsNode, descendancy.Add(projectCiCsNode));

            var savedCohortsNode = new ProjectSavedCohortsNode(projectCohortsNode.Project);

            children.Add(savedCohortsNode);
            AddChildren(savedCohortsNode, descendancy.Add(savedCohortsNode));

            AddToDictionaries(children, descendancy);
        }
Exemplo n.º 4
0
        private void AddChildren(ExtractionConfiguration extractionConfiguration, DescendancyList descendancy)
        {
            HashSet <object> children = new HashSet <object>();

            var parameters = AllGlobalExtractionFilterParameters.Where(p => p.ExtractionConfiguration_ID == extractionConfiguration.ID)
                             .ToArray();

            if (parameters.Any())
            {
                var parameterNode = new ParametersNode(extractionConfiguration, parameters);
                children.Add(parameterNode);
            }

            //if it has a cohort
            if (extractionConfiguration.Cohort_ID != null)
            {
                var cohort = Cohorts.Single(c => c.ID == extractionConfiguration.Cohort_ID);
                children.Add(new LinkedCohortNode(extractionConfiguration, cohort));
            }

            //if it has extractable datasets add those
            foreach (SelectedDataSets ds in GetDatasets(extractionConfiguration))
            {
                children.Add(ds);
                AddChildren(ds, descendancy.Add(ds));
            }

            AddToDictionaries(children, descendancy);
        }
Exemplo n.º 5
0
 private void AddChildren(SelectedDataSets selectedDataSets, DescendancyList descendancy)
 {
     if (selectedDataSets.RootFilterContainer_ID != null)
     {
         var rootContainer = AllContainers[selectedDataSets.RootFilterContainer_ID.Value];
         AddChildren(rootContainer, descendancy.Add(rootContainer));
         AddToDictionaries(new HashSet <object>(new object[] { rootContainer }), descendancy);
     }
 }
Exemplo n.º 6
0
        private void AddChildren(AllCohortsNode cohortsNode, DescendancyList descendancy)
        {
            var validSources = CohortSources.ToArray();

            AddToDictionaries(new HashSet <object>(validSources), descendancy);
            foreach (var s in validSources)
            {
                AddChildren(s, descendancy.Add(s));
            }
        }
Exemplo n.º 7
0
        private void AddChildren(FilterContainer filterContainer, DescendancyList descendancy)
        {
            HashSet <object> children = new HashSet <object>();

            foreach (FilterContainer subcontainer in _dataExportFilterManager.GetSubContainers(filterContainer))
            {
                AddChildren(subcontainer, descendancy.Add(subcontainer));
                children.Add(subcontainer);
            }

            foreach (DeployedExtractionFilter filter in _dataExportFilterManager.GetFilters(filterContainer))
            {
                AddChildren(filter, descendancy.Add(filter));
                children.Add(filter);
            }


            AddToDictionaries(children, descendancy);
        }
Exemplo n.º 8
0
        private void AddChildren(ProjectCataloguesNode projectCataloguesNode, DescendancyList descendancy)
        {
            HashSet <object> children = new HashSet <object>();

            foreach (ExtractableDataSet projectSpecificEds in ExtractableDataSets.Where(eds => eds.Project_ID == projectCataloguesNode.Project.ID))
            {
                children.Add(projectSpecificEds.Catalogue);
                AddChildren((Catalogue)projectSpecificEds.Catalogue, descendancy.Add(projectSpecificEds.Catalogue));
            }

            AddToDictionaries(children, descendancy);
        }
Exemplo n.º 9
0
        private void AddChildren(ProjectSavedCohortsNode savedCohortsNode, DescendancyList descendancy)
        {
            HashSet <object> children = new HashSet <object>();

            var cohortGroups = GetAllCohortProjectUsageNodesFor(savedCohortsNode.Project);

            foreach (CohortSourceUsedByProjectNode cohortSourceUsedByProjectNode in cohortGroups)
            {
                AddChildren(cohortSourceUsedByProjectNode, descendancy.Add(cohortSourceUsedByProjectNode));
                children.Add(cohortSourceUsedByProjectNode);
            }

            AddToDictionaries(children, descendancy);
        }
Exemplo n.º 10
0
        private void AddChildren(FrozenExtractionConfigurationsNode frozenExtractionConfigurationsNode, DescendancyList descendancy)
        {
            HashSet <object> children = new HashSet <object>();

            //Add ExtractionConfigurations which are not released (frozen)
            var configs = ExtractionConfigurations.Where(c => c.Project_ID == frozenExtractionConfigurationsNode.Project.ID).ToArray();

            foreach (ExtractionConfiguration config in configs.Where(c => c.IsReleased))
            {
                AddChildren(config, descendancy.Add(config));
                children.Add(config);
            }

            AddToDictionaries(children, descendancy);
        }
Exemplo n.º 11
0
        private void AddChildren(ExtractionConfigurationsNode extractionConfigurationsNode, DescendancyList descendancy)
        {
            HashSet <object> children = new HashSet <object>();

            //Create a frozen extraction configurations folder as a subfolder of each ExtractionConfigurationsNode
            var frozenConfigurationsNode = new FrozenExtractionConfigurationsNode(extractionConfigurationsNode.Project);

            //Make the frozen folder appear under the extractionConfigurationsNode
            children.Add(frozenConfigurationsNode);

            //Add children to the frozen folder
            AddChildren(frozenConfigurationsNode, descendancy.Add(frozenConfigurationsNode));

            //Add ExtractionConfigurations which are not released (frozen)
            var configs = ExtractionConfigurations.Where(c => c.Project_ID == extractionConfigurationsNode.Project.ID).ToArray();

            foreach (ExtractionConfiguration config in configs.Where(c => !c.IsReleased))
            {
                AddChildren(config, descendancy.Add(config));
                children.Add(config);
            }

            AddToDictionaries(children, descendancy);
        }
Exemplo n.º 12
0
        private void AddChildren(FrozenExtractionConfigurationsNode frozenExtractionConfigurationsNode, DescendancyList descendancy)
        {
            HashSet <object> children = new HashSet <object>();

            //Add ExtractionConfigurations which are not released (frozen)
            if (ExtractionConfigurationsByProject.TryGetValue(frozenExtractionConfigurationsNode.Project.ID, out List <ExtractionConfiguration> result))
            {
                foreach (ExtractionConfiguration config in result.Where(c => c.IsReleased))
                {
                    AddChildren(config, descendancy.Add(config));
                    children.Add(config);
                }
            }

            AddToDictionaries(children, descendancy);
        }
Exemplo n.º 13
0
        private void AddChildren(ProjectCataloguesNode projectCataloguesNode, DescendancyList descendancy)
        {
            HashSet <object> children = new HashSet <object>();

            foreach (ExtractableDataSet projectSpecificEds in ExtractableDataSets.Where(eds => eds.Project_ID == projectCataloguesNode.Project.ID))
            {
                var cata = (Catalogue)projectSpecificEds.Catalogue;

                // cata will be null if it has been deleted from the database
                if (cata != null)
                {
                    children.Add(cata);
                    AddChildren(cata, descendancy.Add(projectSpecificEds.Catalogue));
                }
            }

            AddToDictionaries(children, descendancy);
        }
Exemplo n.º 14
0
        private void AddChildren(SelectedDataSets selectedDataSets, DescendancyList descendancy)
        {
            HashSet <object> children = new HashSet <object>();

            if (_extractionProgressesBySelectedDataSetID.ContainsKey(selectedDataSets.ID))
            {
                children.Add(_extractionProgressesBySelectedDataSetID[selectedDataSets.ID]);
            }

            if (selectedDataSets.RootFilterContainer_ID != null)
            {
                var rootContainer = AllContainers[selectedDataSets.RootFilterContainer_ID.Value];
                children.Add(rootContainer);

                AddChildren(rootContainer, descendancy.Add(rootContainer));
            }

            if (children.Any())
            {
                AddToDictionaries(children, descendancy);
            }
        }