Exemplo n.º 1
0
        public void SetCollection(IActivateItems activator, IPersistableObjectCollection collection)
        {
            _bLoading = true;
            SetItemActivator(activator);

            _collection = (GoodBadCataloguePieChartObjectCollection)collection;

            if (firstTime)
            {
                SetupFlags();
            }

            btnAllCatalogues.Checked   = !_collection.IsSingleCatalogueMode;
            btnSingleCatalogue.Checked = _collection.IsSingleCatalogueMode;
            btnShowLabels.Checked      = _collection.ShowLabels;

            CommonFunctionality.Add(btnAllCatalogues);
            CommonFunctionality.Add(toolStripLabel1);
            CommonFunctionality.Add(btnAllCatalogues);
            CommonFunctionality.Add(btnSingleCatalogue);
            CommonFunctionality.Add(btnShowLabels);
            CommonFunctionality.Add(btnRefresh);

            foreach (var mi in _flagOptions)
            {
                CommonFunctionality.AddToMenu(mi);
            }

            GenerateChart();
            _bLoading = false;
        }
Exemplo n.º 2
0
        protected void BuildMenu(IActivateItems activator)
        {
            if (!menuInitialized)
            {
                menuInitialized = true;

                if (DatabaseObject != null)
                {
                    CommonFunctionality.AddToMenu(new ExecuteCommandActivate(activator, DatabaseObject));
                }

                CommonFunctionality.AddToMenu(new ToolStripSeparator());

                CommonFunctionality.AddToMenu(miSaveImages);
                CommonFunctionality.AddToMenu(miCopyToClipboard);
                CommonFunctionality.AddToMenu(btnCache);

                CommonFunctionality.Add(btnResendQuery);

                foreach (var c in _timeoutControls.GetControls())
                {
                    CommonFunctionality.Add(c);
                }
            }
        }
Exemplo n.º 3
0
        public override void SetDatabaseObject(IActivateItems activator, CatalogueItem databaseObject)
        {
            _catalogueItem = databaseObject;

            if (_scintillaDescription == null)
            {
                var f = new ScintillaTextEditorFactory();
                _scintillaDescription      = f.Create(null, null, null, true, false, activator.CurrentDirectory);
                _scintillaDescription.Font = System.Drawing.SystemFonts.DefaultFont;
                panel1.Controls.Add(_scintillaDescription);
            }

            base.SetDatabaseObject(activator, databaseObject);


            if (_catalogueItem.ExtractionInformation != null)
            {
                CommonFunctionality.AddToMenu(new ExecuteCommandActivate(activator, _catalogueItem.ExtractionInformation), "Go To Extraction Information");
            }
            else
            {
                CommonFunctionality.AddToMenu(new ExecuteCommandMakeCatalogueItemExtractable(activator, _catalogueItem), "Make Extractable");
            }

            if (_catalogueItem.ColumnInfo_ID != null)
            {
                CommonFunctionality.AddToMenu(new ExecuteCommandShow(activator, _catalogueItem.ColumnInfo, 0, true));
            }
        }
Exemplo n.º 4
0
        private void SetupRibbon()
        {
            if (_ribbonInitialized)
            {
                return;
            }

            _ribbonInitialized = true;

            foreach (var o in GetRibbonObjects())
            {
                if (o is string)
                {
                    CommonFunctionality.Add((string)o);
                }
                else if (o is DatabaseEntity)
                {
                    CommonFunctionality.AddToMenu(new ExecuteCommandShow(Activator, (DatabaseEntity)o, 0, true));
                }
                else
                {
                    throw new NotSupportedException(
                              "GetRibbonObjects can only return strings or DatabaseEntity objects, object '" + o +
                              "' is not valid because it is a '" + o.GetType().Name + "'");
                }
            }
        }
Exemplo n.º 5
0
        public override void SetDatabaseObject(IActivateItems activator, CacheProgress databaseObject)
        {
            base.SetDatabaseObject(activator, databaseObject);

            CommonFunctionality.AddHelp(tbCacheProgress, "ICacheProgress.CacheFillProgress");
            CommonFunctionality.AddHelp(ddCacheLagDurationType, "ICacheProgress.CacheLagPeriod");
            CommonFunctionality.AddHelp(ddCacheLagDelayDurationType, "ICacheProgress.CacheLagPeriodLoadDelay");
            CommonFunctionality.AddHelp(tbChunkPeriod, "ICacheProgress.ChunkPeriod");
            CommonFunctionality.AddHelp(pPipeline, "ICacheProgress.Pipeline_ID");

            _cacheProgress = databaseObject;

            CommonFunctionality.AddToMenu(new ExecuteCommandExecuteCacheProgress(activator, databaseObject), "Go To Execute");

            ragSmiley1.Reset();

            try
            {
                PopulateCacheProgressPanel(_cacheProgress);
            }
            catch (Exception e)
            {
                ragSmiley1.Fatal(e);
            }
        }
 /// <summary>
 /// Adds the all <see cref="IAtomicCommand"/> specified by <see cref="IActivateItems.PluginUserInterfaces"/> for the current control.  Commands
 /// will appear in the menu drop down options at the top of the control
 /// </summary>
 protected void AddPluginCommandsToMenu()
 {
     foreach (IAtomicCommand cmd in GetPluginCommands())
     {
         CommonFunctionality.AddToMenu(cmd);
     }
 }
Exemplo n.º 7
0
        public override void SetDatabaseObject(IActivateItems activator, PreLoadDiscardedColumn databaseObject)
        {
            base.SetDatabaseObject(activator, databaseObject);

            CommonFunctionality.AddChecks(databaseObject);
            CommonFunctionality.StartChecking();
            CommonFunctionality.AddToMenu(new SetDumpServerMenuItem(Activator, databaseObject.TableInfo));
        }
        public override void SetDatabaseObject(IActivateItems activator, CohortIdentificationConfiguration databaseObject)
        {
            base.SetDatabaseObject(activator, databaseObject);
            _configuration = databaseObject;

            RebuildClearCacheCommand();

            gbCicInfo.Text     = $"Name: {_configuration.Name}";
            tbDescription.Text = $"Description: {_configuration.Description}";
            ticket.TicketText  = _configuration.Ticket;

            if (_commonFunctionality == null)
            {
                activator.RefreshBus.Subscribe(this);
                _commonFunctionality = new RDMPCollectionCommonFunctionality();

                _commonFunctionality.SetUp(RDMPCollection.Cohort, tlvCic, activator, olvNameCol, olvNameCol, new RDMPCollectionCommonFunctionalitySettings
                {
                    SuppressActivate   = true,
                    AddFavouriteColumn = false,
                    AddCheckColumn     = false,
                    AllowPinning       = false,
                    AllowSorting       = true, //important, we need sorting on so that we can override sort order with our OrderableComparer
                });
                _commonFunctionality.MenuBuilt += MenuBuilt;
                tlvCic.AddObject(_configuration);
                tlvCic.ExpandAll();
            }

            CommonFunctionality.AddToMenu(cbIncludeCumulative);
            CommonFunctionality.AddToMenu(new ToolStripSeparator());
            CommonFunctionality.AddToMenu(new ExecuteCommandSetQueryCachingDatabase(Activator, _configuration));
            CommonFunctionality.AddToMenu(new ExecuteCommandClearQueryCache(Activator, _configuration));
            CommonFunctionality.AddToMenu(new ExecuteCommandCreateNewQueryCacheDatabase(activator, _configuration));
            CommonFunctionality.AddToMenu(
                new ExecuteCommandSet(activator, _configuration, _configuration.GetType().GetProperty("Description"))
            {
                OverrideIcon =
                    Activator.CoreIconProvider.GetImage(RDMPConcept.CohortIdentificationConfiguration, OverlayKind.Edit)
            });
            CommonFunctionality.AddToMenu(new ToolStripSeparator());
            CommonFunctionality.AddToMenu(new ExecuteCommandShowXmlDoc(activator, "CohortIdentificationConfiguration.QueryCachingServer_ID", "Query Caching"), "Help (What is Query Caching)");
            CommonFunctionality.Add(new ExecuteCommandCreateNewCohortByExecutingACohortIdentificationConfiguration(activator, null).SetTarget(_configuration),
                                    "Commit Cohort",
                                    activator.CoreIconProvider.GetImage(RDMPConcept.ExtractableCohort, OverlayKind.Add));

            foreach (var c in _timeoutControls.GetControls())
            {
                CommonFunctionality.Add(c);
            }

            _queryCachingServer = _configuration.QueryCachingServer;
            Compiler.CohortIdentificationConfiguration = _configuration;
            Compiler.CoreChildProvider = activator.CoreChildProvider;
            RecreateAllTasks();
        }
Exemplo n.º 9
0
        public override void SetItemActivator(IActivateItems activator)
        {
            base.SetItemActivator(activator);

            _factory = new RunnerFactory();

            CommonFunctionality.AddToMenu(new ExecuteCommandGenerateRunCommand(activator, Detatch_CommandGetter));

            loadProgressUI1.ApplyTheme(activator.Theme);
        }
Exemplo n.º 10
0
        public void SetCollection(IActivateItems activator, IPersistableObjectCollection collection)
        {
            _collection = (IViewSQLAndResultsCollection)collection;

            CommonFunctionality.ClearToolStrip();

            btnExecuteSql.Image = activator.CoreIconProvider.GetImage(RDMPConcept.SQL, OverlayKind.Execute);

            var overlayer = new IconOverlayProvider();

            btnResetSql.Image = overlayer.GetOverlay(FamFamFamIcons.text_align_left, OverlayKind.Problem);

            if (_autoComplete == null)
            {
                _autoComplete = new AutoCompleteProviderFactory(activator).Create(_collection.GetQuerySyntaxHelper());

                _collection.AdjustAutocomplete(_autoComplete);

                _autoComplete.RegisterForEvents(_scintilla);
            }

            SetItemActivator(activator);

            CommonFunctionality.Add(btnExecuteSql);
            CommonFunctionality.Add(btnResetSql);

            foreach (var c in _timeoutControls.GetControls())
            {
                CommonFunctionality.Add(c);
            }

            foreach (DatabaseEntity d in _collection.GetToolStripObjects())
            {
                CommonFunctionality.AddToMenu(new ExecuteCommandShow(activator, d, 0, true));
            }

            CommonFunctionality.Add(new ToolStripSeparator());
            CommonFunctionality.Add(_serverHeader);

            try
            {
                var dap = _collection.GetDataAccessPoint();
                _serverHeader.Text  = $"Server: {dap.Server} Database: {dap.Database}";
                _serverHeader.Image = _databaseTypeIconProvider.GetImage(dap.DatabaseType);
            }
            catch (Exception)
            {
                _serverHeader.Text = "Server:Unknown";
            }


            RefreshUIFromDatabase();
        }
Exemplo n.º 11
0
        public override void SetDatabaseObject(IActivateItems activator, LoadProgress databaseObject)
        {
            base.SetDatabaseObject(activator, databaseObject);
            _loadProgress = databaseObject;

            loadProgressDiagram1.SetItemActivator(activator);

            ReloadUIFromDatabase();

            CommonFunctionality.AddHelp(nDefaultNumberOfDaysToLoadEachTime, "ILoadProgress.DefaultNumberOfDaysToLoadEachTime");

            CommonFunctionality.AddToMenu(new ExecuteCommandActivate(activator, databaseObject.LoadMetadata), "Execute Load");
        }
Exemplo n.º 12
0
        public override void SetDatabaseObject(IActivateItems activator, CacheProgress databaseObject)
        {
            base.SetDatabaseObject(activator, databaseObject);

            _cacheProgress = databaseObject;

            CommonFunctionality.AddToMenu(new ExecuteCommandEditCacheProgress(activator, databaseObject), "Edit");
            CommonFunctionality.AddToMenu(new ExecuteCommandShowCacheFetchFailures(activator, databaseObject), "View Cache Failures");

            bool failures = _cacheProgress.CacheFetchFailures.Any(f => f.ResolvedOn == null);

            cbFailures.Enabled = failures;

            checkAndExecuteUI1.SetItemActivator(activator);
        }
Exemplo n.º 13
0
        public override void SetDatabaseObject(IActivateItems activator, ExtractionInformation databaseObject)
        {
            base.SetDatabaseObject(activator, databaseObject);

            Setup(databaseObject);

            ObjectSaverButton1.BeforeSave += objectSaverButton1OnBeforeSave;

            CommonFunctionality.Add(ragSmiley1);
            CommonFunctionality.AddToMenu(new ExecuteCommandActivate(activator, databaseObject.CatalogueItem), "Go To Description (CatalogueItem)");
            CommonFunctionality.AddToMenu(new ExecuteCommandShow(activator, databaseObject.ColumnInfo, 0, true));

            CommonFunctionality.AddHelp(cbHashOnDataRelease, "IColumn.HashOnDataRelease", "Hash on Data Release");
            CommonFunctionality.AddHelp(cbIsExtractionIdentifier, "IColumn.IsExtractionIdentifier", "Is Extraction Identifier");
            CommonFunctionality.AddHelp(cbIsPrimaryKey, "IColumn.IsPrimaryKey", "Is Primary Key");
        }
Exemplo n.º 14
0
        public override void SetDatabaseObject(IActivateItems activator, ConcreteFilter databaseObject)
        {
            _loading = true;
            base.SetDatabaseObject(activator, databaseObject);
            Catalogue         = databaseObject.GetCatalogue();
            _extractionFilter = databaseObject;

            ParameterCollectionUIOptionsFactory factory = null;
            ParameterCollectionUIOptions        options = null;

            try
            {
                factory = new ParameterCollectionUIOptionsFactory();
                options = factory.Create(databaseObject, activator.CoreChildProvider);
            }
            catch (Exception e)
            {
                Activator.KillForm(ParentForm, e);
                return;
            }

            //collapse panel 1 unless there are parameters
            splitContainer1.Panel1Collapsed = !options.ParameterManager.ParametersFoundSoFarInQueryGeneration.Values.Any(v => v.Any());

            parameterCollectionUI1.SetUp(options, Activator);

            CommonFunctionality.AddToMenu(new ExecuteCommandViewFilterMatchData(Activator, databaseObject, ViewType.TOP_100));
            CommonFunctionality.AddToMenu(new ExecuteCommandViewFilterMatchData(Activator, databaseObject, ViewType.Aggregate));
            CommonFunctionality.AddToMenu(new ExecuteCommandViewFilterMatchGraph(Activator, databaseObject));
            CommonFunctionality.AddToMenu(new ExecuteCommandBrowseLookup(Activator, databaseObject));
            CommonFunctionality.AddToMenu(new ExecuteCommandPublishFilter(Activator, databaseObject, databaseObject.GetCatalogue()));

            FigureOutGlobalsAndAutoComplete();

            QueryEditor.Text = _extractionFilter.WhereSQL;

            CommonFunctionality.AddChecks(databaseObject);
            CommonFunctionality.StartChecking();

            QueryEditor.ReadOnly         = ReadOnly;
            tbFilterName.ReadOnly        = ReadOnly;
            tbFilterDescription.ReadOnly = ReadOnly;
            cbIsMandatory.Enabled        = !ReadOnly;

            _loading = false;
        }
Exemplo n.º 15
0
        public override void SetDatabaseObject(IActivateItems activator, Catalogue databaseObject)
        {
            base.SetDatabaseObject(activator, databaseObject);
            _catalogue = databaseObject;
            RefreshUIFromDatabase();

            rbCore.Image            = CatalogueIcons.ExtractionInformation;
            rbSupplemental.Image    = CatalogueIcons.ExtractionInformation_Supplemental;
            rbSpecialApproval.Image = CatalogueIcons.ExtractionInformation_SpecialApproval;
            rbInternal.Image        = activator.CoreIconProvider.GetImage(CatalogueIcons.ExtractionInformation_SpecialApproval, OverlayKind.Internal);

            CommonFunctionality.Add(rbCore);
            CommonFunctionality.Add(rbSupplemental);
            CommonFunctionality.Add(rbSpecialApproval);
            CommonFunctionality.Add(rbInternal);

            CommonFunctionality.AddToMenu(new ExecuteCommandReOrderColumns(Activator, _catalogue));
        }
Exemplo n.º 16
0
        public override void SetDatabaseObject(IActivateItems activator, CohortIdentificationConfiguration databaseObject)
        {
            base.SetDatabaseObject(activator, databaseObject);
            _configuration = databaseObject;

            lblFrozen.Visible = _configuration.Frozen;

            tbID.Text          = _configuration.ID.ToString();
            tbName.Text        = _configuration.Name;
            tbDescription.Text = _configuration.Description;
            ticket.TicketText  = _configuration.Ticket;
            tlvCic.Enabled     = !databaseObject.Frozen;

            if (_commonFunctionality == null)
            {
                _commonFunctionality = new RDMPCollectionCommonFunctionality();

                _commonFunctionality.SetUp(RDMPCollection.Cohort, tlvCic, activator, olvNameCol, olvNameCol, new RDMPCollectionCommonFunctionalitySettings
                {
                    AddFavouriteColumn = false,
                    AddCheckColumn     = false,
                    AllowPinning       = false,
                    AllowSorting       = true, //important, we need sorting on so that we can override sort order with our OrderableComparer
                });

                tlvCic.AddObject(_configuration);
                tlvCic.ExpandAll();
            }

            CommonFunctionality.AddToMenu(cbIncludeCumulative);
            CommonFunctionality.AddToMenu(new ToolStripSeparator());
            CommonFunctionality.AddToMenu(_miClearCache);
            CommonFunctionality.AddToMenu(new ExecuteCommandSetQueryCachingDatabase(Activator, _configuration));
            CommonFunctionality.AddToMenu(new ExecuteCommandCreateNewQueryCacheDatabase(activator, _configuration));

            CommonFunctionality.AddToMenu(new ToolStripSeparator());
            CommonFunctionality.AddToMenu(new ExecuteCommandShowXmlDoc(activator, "CohortIdentificationConfiguration.QueryCachingServer_ID", "Query Caching"), "Help (What is Query Caching)");

            CommonFunctionality.Add(new ExecuteCommandCreateNewCohortByExecutingACohortIdentificationConfiguration(activator, null).SetTarget(_configuration),
                                    "Commit Cohort",
                                    activator.CoreIconProvider.GetImage(RDMPConcept.ExtractableCohort, OverlayKind.Add));

            CohortCompilerUI1.SetDatabaseObject(activator, databaseObject);
        }
Exemplo n.º 17
0
        public override void SetDatabaseObject(IActivateItems activator, SelectedDataSets databaseObject)
        {
            base.SetDatabaseObject(activator, databaseObject);

            activator.RefreshBus.EstablishLifetimeSubscription(this);

            SelectedDataSet = databaseObject;
            _dataSet        = SelectedDataSet.ExtractableDataSet;
            _config         = (ExtractionConfiguration)SelectedDataSet.ExtractionConfiguration;

            SetupUserInterface();

            SortSelectedByOrder();

            CommonFunctionality.AddToMenu(new ExecuteCommandShow(activator, databaseObject.ExtractableDataSet.Catalogue, 0, true), "Show Catalogue");
            CommonFunctionality.Add(new ExecuteCommandExecuteExtractionConfiguration(activator, databaseObject));

            CommonFunctionality.AddChecks(new SelectedDataSetsChecker(SelectedDataSet));
        }
Exemplo n.º 18
0
        public override void SetDatabaseObject(IActivateItems activator, LoadMetadata databaseObject)
        {
            base.SetDatabaseObject(activator, databaseObject);
            _loadMetadata = databaseObject;

            checkAndExecuteUI1.SetItemActivator(activator);

            SetButtonStates(null, null);

            SetLoadProgressGroupBoxState();


            CommonFunctionality.Add(new ExecuteCommandViewLoadDiagram(activator, _loadMetadata));

            CommonFunctionality.AddToMenu(new ExecuteCommandEditLoadMetadataDescription(activator, _loadMetadata));

            CommonFunctionality.Add(new ExecuteCommandViewLogs(activator, (LoadMetadata)databaseObject));

            CommonFunctionality.Add(dd_DebugOptions);
        }
Exemplo n.º 19
0
        public override void SetDatabaseObject(IActivateItems activator, CatalogueItem databaseObject)
        {
            _catalogueItem = databaseObject;

            if (_scintillaDescription == null)
            {
                var f = new ScintillaTextEditorFactory();
                _scintillaDescription          = f.Create(null, SyntaxLanguage.None, null, true, false, activator.CurrentDirectory);
                _scintillaDescription.Font     = System.Drawing.SystemFonts.DefaultFont;
                _scintillaDescription.WrapMode = WrapMode.Word;
                panel1.Controls.Add(_scintillaDescription);
            }

            base.SetDatabaseObject(activator, databaseObject);


            if (_catalogueItem.ExtractionInformation == null)
            {
                CommonFunctionality.AddToMenu(new ExecuteCommandMakeCatalogueItemExtractable(activator, _catalogueItem), "Make Extractable");
            }
        }
Exemplo n.º 20
0
        public override void SetDatabaseObject(IActivateItems activator, Catalogue databaseObject)
        {
            base.SetDatabaseObject(activator, databaseObject);

            CommonFunctionality.AddToMenu(new ExecuteCommandRunDQEOnCatalogue(activator).SetTarget(databaseObject));
            CommonFunctionality.AddToMenu(new ExecuteCommandViewDQEResultsForCatalogue(activator)
            {
                OverrideCommandName = "View Results..."
            }.SetTarget(databaseObject));

            AddPluginCommandsToMenu();

            _catalogue = databaseObject;

            SetupComboBoxes(databaseObject);

            //get the validation XML
            if (string.IsNullOrWhiteSpace(databaseObject.ValidatorXML))
            {
                Validator = new Validator();
            }
            else
            {
                Validator = Validator.LoadFromXml(databaseObject.ValidatorXML);
            }

            var extractionInformations = databaseObject.GetAllExtractionInformation(ExtractionCategory.Any).ToArray();

            Array.Sort(extractionInformations);

            //Update the objects in case the publish is because the user added new columns etc
            var oldSelection = olvColumns.SelectedObject;

            olvColumns.ClearObjects();
            olvColumns.AddObjects(extractionInformations);
            olvColumns.SelectedObject = oldSelection;

            ValidateConfiguration();
        }
Exemplo n.º 21
0
        public override void SetDatabaseObject(IActivateItems activator, AggregateConfiguration databaseObject)
        {
            if (!menuInitialized)
            {
                base.SetDatabaseObject(activator, databaseObject);
                menuInitialized = true;

                CommonFunctionality.AddToMenu(new ExecuteCommandActivate(activator, databaseObject));
                CommonFunctionality.AddToMenu(new ToolStripSeparator());

                CommonFunctionality.AddToMenu(miSaveImages);
                CommonFunctionality.AddToMenu(miCopyToClipboard);
                CommonFunctionality.AddToMenu(btnCache);

                CommonFunctionality.Add(btnResendQuery);

                foreach (var c in _timeoutControls.GetControls())
                {
                    CommonFunctionality.Add(c);
                }
            }

            SetAggregate(activator, databaseObject);
        }
Exemplo n.º 22
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;
        }
Exemplo n.º 23
0
        public override void SetDatabaseObject(IActivateItems activator, AggregateConfiguration databaseObject)
        {
            _aggregate = databaseObject;

            base.SetDatabaseObject(activator, databaseObject);

            try
            {
                _querySyntaxHelper = databaseObject.GetQuerySyntaxHelper();
            }
            catch (AmbiguousDatabaseTypeException e)
            {
                activator.KillForm(ParentForm, e);
                return;
            }
            isRefreshing = true;

            //find out what is legal for the aggregate
            _options = new AggregateBuilderOptionsFactory().Create(_aggregate);

            //set enablednesss based on legality
            cbExtractable.Enabled    = _options.ShouldBeEnabled(AggregateEditorSection.Extractable, _aggregate);
            cbExtractable.Checked    = _aggregate.IsExtractable;
            ddPivotDimension.Enabled = _options.ShouldBeEnabled(AggregateEditorSection.PIVOT, _aggregate);
            gbAxis.Enabled           = _options.ShouldBeEnabled(AggregateEditorSection.AXIS, _aggregate);

            //add included/excluded dimensions
            selectColumnUI1.SetUp(Activator, _options, _aggregate);

            tbID.Text = _aggregate.ID.ToString();

            SetNameText();

            DetermineFromTables();

            PopulateHavingText();

            var axisIfAny           = _aggregate.GetAxisIfAny();
            var _axisDimensionIfAny = axisIfAny != null ? axisIfAny.AggregateDimension : null;
            var _pivotIfAny         = _aggregate.PivotDimension;

            PopulatePivotDropdown(_axisDimensionIfAny, _pivotIfAny);

            PopulateAxis(_axisDimensionIfAny, _pivotIfAny);

            PopulateTopX();

            if (databaseObject.IsCohortIdentificationAggregate)
            {
                var cic = databaseObject.GetCohortIdentificationConfigurationIfAny();
                if (cic != null)
                {
                    CommonFunctionality.AddToMenu(new ExecuteCommandActivate(activator, cic), "Open Cohort Query...");
                }
            }
            else
            {
                CommonFunctionality.AddToMenu(new ExecuteCommandShow(activator, databaseObject.Catalogue, 0, true));
            }

            CommonFunctionality.Add(new ExecuteCommandExecuteAggregateGraph(activator, databaseObject));
            CommonFunctionality.Add(new ExecuteCommandViewSample(activator, databaseObject));

            CommonFunctionality.AddToMenu(new ExecuteCommandViewSqlParameters(activator, databaseObject));

            CommonFunctionality.AddChecks(databaseObject);
            CommonFunctionality.StartChecking();

            //enforcing the naming convention on cic aggregates can result in ObjectSaverButton incorrectly getting enabled
            GetObjectSaverButton()?.Enable(false);

            isRefreshing = false;
        }
Exemplo n.º 24
0
        public override void SetDatabaseObject(IActivateItems activator, ExternalDatabaseServer databaseObject)
        {
            base.SetDatabaseObject(activator, databaseObject);

            if (_navigationTrack == null)
            {
                //what happens when user clicks back/forward
                _navigationTrack = new NavigationTrack <LogViewerFilter>(f => true, f =>
                {
                    if (f.LoggingTable != LoggingTables.None)
                    {
                        var cmd = new ExecuteCommandViewLogs(activator, f);
                        cmd.Execute();
                    }
                });

                //set the initial filter
                _navigationTrack.Append(Filter);
                _back = new ToolStripButton("Back", FamFamFamIcons.Back, (s, e) => _navigationTrack.Back(true))
                {
                    DisplayStyle = ToolStripItemDisplayStyle.Image
                };
            }

            CommonFunctionality.Add(_back);

            CommonFunctionality.Add(label1);
            CommonFunctionality.Add(tbContentFilter);

            CommonFunctionality.Add(label2);
            CommonFunctionality.Add(tbTop);

            CommonFunctionality.Add(cbPreferNewer);

            CommonFunctionality.AddToMenu(new ExecuteCommandViewLogs(activator, new LogViewerFilter(LoggingTables.DataLoadTask))
            {
                OverrideCommandName = "All Tasks"
            });
            CommonFunctionality.AddToMenu(new ExecuteCommandViewLogs(activator, new LogViewerFilter(LoggingTables.DataLoadRun))
            {
                OverrideCommandName = "All Runs"
            });
            CommonFunctionality.AddToMenu(new ExecuteCommandViewLogs(activator, new LogViewerFilter(LoggingTables.FatalError))
            {
                OverrideCommandName = "All Errors"
            });
            CommonFunctionality.AddToMenu(new ExecuteCommandViewLogs(activator, new LogViewerFilter(LoggingTables.TableLoadRun))
            {
                OverrideCommandName = "All Tables Loaded"
            });
            CommonFunctionality.AddToMenu(new ExecuteCommandViewLogs(activator, new LogViewerFilter(LoggingTables.DataSource))
            {
                OverrideCommandName = "All Data Sources"
            });
            CommonFunctionality.AddToMenu(new ExecuteCommandViewLogs(activator, new LogViewerFilter(LoggingTables.ProgressLog))
            {
                OverrideCommandName = "All Progress Logs"
            });


            if (!databaseObject.DiscoverExistence(DataAccessContext.Logging, out string reason))
            {
                activator.KillForm(ParentForm, "Database " + databaseObject + " did not exist:" + reason);
                return;
            }

            LogManager = new LogManager(databaseObject);
            FetchDataTable();
        }
        public void SetCollection(IActivateItems activator, IPersistableObjectCollection collection)
        {
            _collection = (IViewSQLAndResultsCollection)collection;

            CommonFunctionality.ClearToolStrip();

            btnExecuteSql.Image = activator.CoreIconProvider.GetImage(RDMPConcept.SQL, OverlayKind.Execute);

            var overlayer = new IconOverlayProvider();

            btnResetSql.Image = overlayer.GetOverlay(FamFamFamIcons.text_align_left, OverlayKind.Problem);

            if (_scintilla == null)
            {
                // figure out what DBMS we are targetting
                var syntax = _collection.GetQuerySyntaxHelper();

                // Create the SQL editor for that language
                ScintillaTextEditorFactory factory = new ScintillaTextEditorFactory();
                _scintilla = factory.Create(null, SyntaxLanguage.SQL, syntax);
                splitContainer1.Panel1.Controls.Add(_scintilla);
                _scintilla.TextChanged += _scintilla_TextChanged;
                _scintilla.KeyUp       += ScintillaOnKeyUp;

                // Setup autocomplete menu for the DBMS language
                _autoComplete = new AutoCompleteProviderWin(syntax);
                _collection.AdjustAutocomplete(_autoComplete);
                _autoComplete.RegisterForEvents(_scintilla);
            }

            SetItemActivator(activator);

            CommonFunctionality.Add(btnExecuteSql);
            CommonFunctionality.Add(btnResetSql);

            foreach (var c in _timeoutControls.GetControls())
            {
                CommonFunctionality.Add(c);
            }

            foreach (DatabaseEntity d in _collection.GetToolStripObjects())
            {
                CommonFunctionality.AddToMenu(new ExecuteCommandShow(activator, d, 0, true));
            }

            CommonFunctionality.Add(new ToolStripSeparator());
            CommonFunctionality.Add(_serverHeader);

            try
            {
                var dap = _collection.GetDataAccessPoint();
                _serverHeader.Text  = $"Server: {dap.Server} Database: {dap.Database}";
                _serverHeader.Image = _databaseTypeIconProvider.GetImage(dap.DatabaseType);
            }
            catch (Exception)
            {
                _serverHeader.Text = "Server:Unknown";
            }


            RefreshUIFromDatabase();
        }