private void ForwardEngineer(DiscoveredTable targetTableName)
        {
            var extractionPicker = new ConfigureCatalogueExtractabilityUI(Activator, new TableInfoImporter(Activator.RepositoryLocator.CatalogueRepository, targetTableName), "File '" + _selectedFile.FullName + "'", _projectSpecific)
            {
                TargetFolder = TargetFolder,
                TableCreated = targetTableName
            };

            extractionPicker.ShowDialog();

            var catalogue = extractionPicker.CatalogueCreatedIfAny;

            if (catalogue is DatabaseEntity de)
            {
                Activator.RefreshBus.Publish(this, new RefreshObjectEventArgs(de));

                MessageBox.Show("Successfully imported new Dataset '" + catalogue + "'." +
                                "\r\n" +
                                "The edit functionality will now open.");

                Activator.WindowArranger.SetupEditAnything(this, catalogue);
            }
            if (cbAutoClose.Checked)
            {
                this.Close();
            }
            else
            {
                MessageBox.Show("Creation completed successfully, close the Form when you are finished reviewing the output");
            }
        }
        private void ConfigureAndExecutePipeline1OnPipelineExecutionFinishedsuccessfully(object sender, PipelineEngineEventArgs args)
        {
            //pipeline executed successfully
            if (_alsoForwardEngineerCatalogue)
            {
                string targetTable = null;

                try
                {
                    var dest = (DataTableUploadDestination)args.PipelineEngine.DestinationObject;
                    targetTable = dest.TargetTableName;
                    var table = _database.ExpectTable(targetTable);

                    var ui = new ConfigureCatalogueExtractabilityUI(_activator, new TableInfoImporter(_repositoryLocator.CatalogueRepository, table), "File '" + _file.FullName + "'", _projectSpecific);
                    ui.ShowDialog();

                    var cata = CatalogueCreatedIfAny = ui.CatalogueCreatedIfAny;

                    if (cata != null)
                    {
                        MessageBox.Show("Catalogue " + cata.Name + " successfully created");
                    }
                    else
                    {
                        MessageBox.Show("User cancelled Catalogue creation, data has been loaded and TableInfo/ColumnInfos exist in Data Catalogue but there will be no Catalogue");
                    }

                    this.ParentForm.Close();
                }
                catch (Exception e)
                {
                    ExceptionViewer.Show("Failed to import TableInfo/Forward Engineer Catalogue from " + _database.ToString() + "(Table was " + (targetTable ?? "Null!") + ")" + " - see Exception for details", e);
                }
            }
        }
Ejemplo n.º 3
0
        public override ICatalogue CreateAndConfigureCatalogue(ITableInfo tableInfo, ColumnInfo[] extractionIdentifierColumns, string initialDescription, IProject projectSpecific, CatalogueFolder folder)
        {
            var ui = new ConfigureCatalogueExtractabilityUI(this, tableInfo, initialDescription, projectSpecific);

            ui.TargetFolder = folder;
            ui.ShowDialog();

            return(ui.CatalogueCreatedIfAny);
        }
        void ui_PipelineExecutionFinishedsuccessfully(object sender, PipelineEngineEventArgs args)
        {
            if (!_table.Exists())
            {
                throw new Exception("Pipeline execute succesfully but the expected table '" + _table + "' did not exist");
            }

            var importer = new TableInfoImporter(Activator.RepositoryLocator.CatalogueRepository, _table);

            var createCatalogue = new ConfigureCatalogueExtractabilityUI(Activator, importer, "Execution of '" + _aggregateConfiguration + "' (AggregateConfiguration ID =" + _aggregateConfiguration.ID + ")", _projectSpecific);

            createCatalogue.ShowDialog();
        }
        public override void Execute()
        {
            base.Execute();

            var ui = new ConfigureCatalogueExtractabilityUI(Activator, _tableInfo, "Existing Table", null);

            ui.ShowDialog();
            var cata = ui.CatalogueCreatedIfAny;

            if (cata != null)
            {
                Publish(cata);
                Emphasise(cata);
            }
        }
Ejemplo n.º 6
0
        private void btnImport_Click(object sender, EventArgs e)
        {
            if (_allowImportAsCatalogue)
            {
                var ui = new ConfigureCatalogueExtractabilityUI(Activator, Importer, "Existing Table", _projectSpecific)
                {
                    TargetFolder = TargetFolder
                };
                ui.ShowDialog();
                TableInfoCreatedIfAny = ui.TableInfoCreated;
            }
            else
            {
                // logic to add credentials
                // parent.SetCredentials();
                Importer.DoImport(out var ti, out var cols);

                if (ti is DatabaseEntity de)
                {
                    Activator.Publish(de);
                }

                TableInfoCreatedIfAny = ti;
            }

            try
            {
                DialogResult = DialogResult.OK;

                var ti = TableInfoCreatedIfAny;

                if (ti != null)
                {
                    if (ti.IsTableValuedFunction && ti.GetAllParameters().Any())
                    {
                        var options = new ParameterCollectionUIOptionsFactory().Create(ti);
                        ParameterCollectionUI.ShowAsDialog(Activator, options, true);
                    }
                    MessageBox.Show("Successfully imported table '" + ti + "'");
                }

                Close();
            }
            catch (SqlException exception)
            {
                MessageBox.Show("Problem importing table :" + exception.Message);
            }
        }
Ejemplo n.º 7
0
        private void btnImport_Click(object sender, EventArgs e)
        {
            if (_allowImportAsCatalogue)
            {
                var ui = new ConfigureCatalogueExtractabilityUI(Activator, Importer, "Existing Table", null);
                ui.ShowDialog();
                TableInfoCreatedIfAny = ui.TableInfoCreated;
            }
            else
            {
                // logic to add credentials
                // parent.SetCredentials();
                TableInfo    ti;
                ColumnInfo[] cols;
                Importer.DoImport(out ti, out cols);
                Activator.RefreshBus.Publish(this, new RefreshObjectEventArgs(ti));
                TableInfoCreatedIfAny = ti;
            }

            try
            {
                DialogResult = DialogResult.OK;

                var ti = TableInfoCreatedIfAny;

                if (ti.IsTableValuedFunction && ti.GetAllParameters().Any())
                {
                    var options = new ParameterCollectionUIOptionsFactory().Create(ti);
                    ParameterCollectionUI.ShowAsDialog(options, true);
                }

                MessageBox.Show("Successfully imported table '" + ti + "'");
                Close();
            }
            catch (SqlException exception)
            {
                MessageBox.Show("Problem importing table :" + exception.Message);
            }
        }