Ejemplo n.º 1
0
        private void SetupPipelineSelectionCohortRefresh()
        {
            ragSmiley1Refresh.Reset();

            if (_cohortRefreshingPipelineSelectionUI != null)
            {
                return;
            }
            try
            {
                //the use case is extracting a dataset
                var useCase = new CohortCreationRequest(_extractionConfiguration);

                //the user is DefaultPipeline_ID field of ExtractionConfiguration
                var user = new PipelineUser(typeof(ExtractionConfiguration).GetProperty("CohortRefreshPipeline_ID"), _extractionConfiguration);

                //create the UI for this situation
                var factory = new PipelineSelectionUIFactory(Activator.RepositoryLocator.CatalogueRepository, user, useCase);
                _cohortRefreshingPipelineSelectionUI                  = factory.Create(Activator, "Cohort Refresh Pipeline", DockStyle.Fill, pChooseCohortRefreshPipeline);
                _cohortRefreshingPipelineSelectionUI.Pipeline         = _extractionConfiguration.CohortRefreshPipeline;
                _cohortRefreshingPipelineSelectionUI.PipelineChanged += _cohortRefreshingPipelineSelectionUI_PipelineChanged;
                _cohortRefreshingPipelineSelectionUI.CollapseToSingleLineMode();
            }
            catch (Exception e)
            {
                ragSmiley1Refresh.Fatal(e);
            }
        }
Ejemplo n.º 2
0
        public void SetUp(IActivateItems activator, ArgumentValueUIArgs args)
        {
            var instanceOfParentType = Activator.CreateInstance(_typeOfUnderlyingClass);

            var factory = new PipelineSelectionUIFactory(args.CatalogueRepository, args.Required, args, instanceOfParentType);

            _pipelineSelectionUIInstance = factory.Create(activator);
            _pipelineSelectionUIInstance.CollapseToSingleLineMode();

            var c = (Control)_pipelineSelectionUIInstance;

            Controls.Add(c);

            try
            {
                Pipeline p = null;
                try
                {
                    p = (Pipeline)args.InitialValue;
                }
                catch (Exception e)
                {
                    ExceptionViewer.Show(e);
                }
            }
            catch (Exception e)
            {
                args.Fatal(e);
            }
        }
Ejemplo n.º 3
0
        private void SetupPipelineSelectionExtraction()
        {
            //already set i tup
            if (_extractionPipelineSelectionUI != null)
            {
                return;
            }

            //the use case is extracting a dataset
            var useCase = ExtractionPipelineUseCase.DesignTime();

            //the user is DefaultPipeline_ID field of ExtractionConfiguration
            var user = new PipelineUser(typeof(ExtractionConfiguration).GetProperty("DefaultPipeline_ID"), _extractionConfiguration);

            //create the UI for this situation
            var factory = new PipelineSelectionUIFactory(Activator.RepositoryLocator.CatalogueRepository, user, useCase);

            _extractionPipelineSelectionUI = factory.Create(Activator, "Extraction Pipeline", DockStyle.Fill, pChooseExtractionPipeline);
            _extractionPipelineSelectionUI.CollapseToSingleLineMode();
        }
Ejemplo n.º 4
0
        public IPipelineSelectionUI Create(IActivateItems activator, string text = null, DockStyle dock = DockStyle.None, Control containerControl = null)
        {
            //setup getter as an event handler for the selection ui
            _pipelineSelectionUIInstance = new PipelineSelectionUI(activator, _useCase, _repository);

            if (_user != null)
            {
                _pipelineSelectionUIInstance.Pipeline = _user.Getter();

                _pipelineSelectionUIInstance.PipelineChanged +=
                    (sender, args) =>
                    _user.Setter(((IPipelineSelectionUI)sender).Pipeline as Pipeline);
            }

            var c = (Control)_pipelineSelectionUIInstance;

            if (dock == DockStyle.None)
            {
                c.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
            }
            else
            {
                c.Dock = dock;
            }

            if (text != null)
            {
                c.Text = text;
            }

            if (containerControl != null)
            {
                containerControl.Controls.Add(c);
            }

            return(_pipelineSelectionUIInstance);
        }
Ejemplo n.º 5
0
        public override void SetDatabaseObject(IActivateItems activator, ExtractionConfiguration databaseObject)
        {
            base.SetDatabaseObject(activator, databaseObject);

            _extractionConfiguration = databaseObject;

            if (!_commonFunctionality.IsSetup)
            {
                _commonFunctionality.SetUp(RDMPCollection.None, tlvDatasets, activator, olvName, null, new RDMPCollectionCommonFunctionalitySettings()
                {
                    AddFavouriteColumn    = false,
                    AllowPinning          = false,
                    SuppressChildrenAdder = true,
                    SuppressActivate      = true,
                    AddCheckColumn        = false
                });
            }

            var checkedBefore = tlvDatasets.CheckedObjects;

            tlvDatasets.ClearObjects();

            _globals  = _extractionConfiguration.GetGlobals();
            _datasets = databaseObject.SelectedDataSets.ToArray();

            GetBundledStuff();

            //add the folders
            tlvDatasets.AddObjects(new object[] { _globalsFolder, _coreDatasetsFolder, _projectSpecificDatasetsFolder });

            //enable all to start with
            tlvDatasets.EnableObjects(tlvDatasets.Objects);

            tlvDatasets.DisableObjects(_globals);
            tlvDatasets.DisableObjects(_bundledStuff);

            //if there are no globals disable this option
            if (!_globals.Any())
            {
                tlvDatasets.DisableObject(_globalsFolder);
            }

            //if there are no project specific datasets
            if (_datasets.All(sds => sds.ExtractableDataSet.Project_ID == null))
            {
                tlvDatasets.DisableObject(_projectSpecificDatasetsFolder); //disable this option
            }
            //if all the datasets are project specific
            if (_datasets.All(sds => sds.ExtractableDataSet.Project_ID != null))
            {
                tlvDatasets.DisableObject(_coreDatasetsFolder);
            }

            //don't accept refresh while executing
            if (checkAndExecuteUI1.IsExecuting)
            {
                return;
            }

            if (_pipelineSelectionUI1 == null)
            {
                //create a new selection UI (pick an extraction pipeliene UI)
                var useCase = ExtractionPipelineUseCase.DesignTime();
                var factory = new PipelineSelectionUIFactory(Activator.RepositoryLocator.CatalogueRepository, null, useCase);

                _pipelineSelectionUI1 = factory.Create("Extraction Pipeline", DockStyle.Fill);
                _pipelineSelectionUI1.CollapseToSingleLineMode();

                //if the configuration has a default then use that pipeline
                if (_extractionConfiguration.DefaultPipeline_ID != null)
                {
                    _pipelineSelectionUI1.Pipeline = _extractionConfiguration.DefaultPipeline;
                }

                _pipelineSelectionUI1.PipelineChanged += ResetChecksUI;

                _pipelinePanel = new ToolStripControlHost((Control)_pipelineSelectionUI1);

                helpIcon1.SetHelpText("Extraction", "It is a wise idea to click here if you don't know what this screen can do for you...", BuildHelpFlow());
            }

            CommonFunctionality.Add(new ToolStripLabel("Extraction Pipeline:"));
            CommonFunctionality.Add(_pipelinePanel);
            CommonFunctionality.AddHelpStringToToolStrip("Extraction Pipeline", "The sequence of components that will be executed in order to enable the datasets to be extracted. This will start with a source component that performs the linkage against the cohort followed by subsequent components (if any) and then a destination component that writes the final records (e.g. to database / csv file etc).");

            CommonFunctionality.AddToMenu(new ExecuteCommandRelease(activator).SetTarget(_extractionConfiguration));

            CommonFunctionality.Add(lblMaxConcurrent);
            CommonFunctionality.Add(tbMaxConcurrent);
            CommonFunctionality.AddHelpStringToToolStrip("Concurrent", "The maximum number of datasets to extract at once.  Once this number is reached the remainder will be queued and only started when one of the other extracting datasets completes.");

            checkAndExecuteUI1.SetItemActivator(activator);

            tlvDatasets.ExpandAll();

            if (_isFirstTime)
            {
                tlvDatasets.CheckAll();
                foreach (var disabledObject in tlvDatasets.DisabledObjects.OfType <ArbitraryFolderNode>())
                {
                    tlvDatasets.UncheckObject(disabledObject);
                }
            }
            else if (checkedBefore.Count > 0)
            {
                tlvDatasets.CheckObjects(checkedBefore);
            }

            _isFirstTime = false;
        }
Ejemplo n.º 6
0
        public override void SetDatabaseObject(IActivateItems activator, Project databaseObject)
        {
            base.SetDatabaseObject(activator, databaseObject);

            if (!_commonFunctionality.IsSetup)
            {
                _commonFunctionality.SetUp(RDMPCollection.None, tlvReleasePotentials, Activator, olvName, null, new RDMPCollectionCommonFunctionalitySettings
                {
                    AddFavouriteColumn    = false,
                    AllowPinning          = false,
                    SuppressChildrenAdder = true,
                    AddCheckColumn        = false
                });
            }

            _childProvider = (DataExportChildProvider)Activator.CoreChildProvider;
            _project       = databaseObject;

            //figure out the globals
            var ec = _project.ExtractionConfigurations.FirstOrDefault();

            _globals = ec != null?ec.GetGlobals() : new IMapsDirectlyToDatabaseTable[0];

            if (_pipelineSelectionUI1 == null)
            {
                var context = ReleaseUseCase.DesignTime();
                _pipelineSelectionUI1 = new PipelineSelectionUIFactory(Activator.RepositoryLocator.CatalogueRepository, null, context).Create(Activator, "Release", DockStyle.Fill);
                _pipelineSelectionUI1.CollapseToSingleLineMode();
                _pipelineSelectionUI1.Pipeline         = null;
                _pipelineSelectionUI1.PipelineChanged += ResetChecksUI;

                _pipelinePanel = new ToolStripControlHost((Control)_pipelineSelectionUI1);
            }

            CommonFunctionality.Add(new ToolStripLabel("Release Pipeline:"));
            CommonFunctionality.Add(_pipelinePanel);
            CommonFunctionality.AddHelpStringToToolStrip("Release Pipeline", "The sequence of components that will be executed in order to gather the extracted artifacts and assemble them into a single release folder/database. This will start with a source component that gathers the artifacts (from wherever they were extracted to) followed by subsequent components (if any) and then a destination component that generates the final releasable file/folder.");

            checkAndExecuteUI1.SetItemActivator(activator);

            var checkedBefore = tlvReleasePotentials.CheckedObjects;

            tlvReleasePotentials.ClearObjects();
            tlvReleasePotentials.AddObject(_globalsNode);
            tlvReleasePotentials.AddObject(_project);
            tlvReleasePotentials.ExpandAll();

            if (_isFirstTime)
            {
                tlvReleasePotentials.CheckAll();
            }
            else if (checkedBefore.Count > 0)
            {
                tlvReleasePotentials.CheckObjects(checkedBefore);
            }

            _isFirstTime = false;

            tlvReleasePotentials.DisableObjects(_globals);
            //tlvReleasePotentials.DisableObject(_globalsNode);
        }