diff --git a/.github/configs/codeql.yml b/.github/configs/codeql.yml new file mode 100644 index 0000000000..9c211adfac --- /dev/null +++ b/.github/configs/codeql.yml @@ -0,0 +1,12 @@ +name: CodeQL Configuration + +paths-ignore: + - "**/*.md" + - "**/*.txt" + - "**/obj/**" + - "**/bin/**" + - "**/*.Designer.cs" + +query-filters: + - exclude: + id: cs/catch-of-all-exceptions \ No newline at end of file diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000000..592920dbf8 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,24 @@ +## Proposed Change + +Summarise your proposed changes here, including any notes for reviewers. + +## Type of change + +What types of changes does your code introduce? Tick all that apply. + +- [ ] Bugfix (non-breaking change which fixes an issue) +- [ ] New Feature (non-breaking change which adds functionality) +- [ ] Breaking Change (fix or feature that would cause existing functionality to not work as expected) +- [ ] Documentation-Only Update +- [ ] Other (if none of the other choices apply) + +## Checklist + +By opening this PR, I confirm that I have: + +- [ ] Ensured that the PR branch is in sync with the target branch (i.e. it is automatically merge-able) +- [ ] Created or updated any tests if relevant +- [ ] Have validated this change against the [Test Plan](https://github.com/HicServices/RDMP/blob/develop/Documentation/CodeTutorials/TestPlan.md) +- [ ] Requested a review by one of the repository maintainers +- [ ] Have written new documentation or updated existing documentation to detail any new or updated functionality and how to use it +- [ ] Have added an entry into the changelog diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 17ae601489..533ecd6b08 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -66,7 +66,7 @@ jobs: mv `find coverage -type f` db-ui.lcov dotnet test Rdmp.Core.Tests/Rdmp.Core.Tests.csproj --nologo --collect:"XPlat Code Coverage" --no-build --verbosity minimal -c Release --results-directory coverage -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=lcov mv `find coverage -type f` db-core.lcov - - uses: coverallsapp/github-action@v2.2.3 + - uses: coverallsapp/github-action@v2.3.0 with: github-token: ${{ secrets.github_token }} files: ./db-ui.lcov ./db-core.lcov @@ -128,7 +128,7 @@ jobs: mv `find coverage -type f` fs-ui.lcov dotnet test Rdmp.Core.Tests/Rdmp.Core.Tests.csproj --nologo --collect:"XPlat Code Coverage" --no-build --verbosity minimal -c Release --results-directory coverage -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=lcov mv `find coverage -type f` fs-core.lcov - - uses: coverallsapp/github-action@v2.2.3 + - uses: coverallsapp/github-action@v2.3.0 with: github-token: ${{ secrets.github_token }} files: ./fs-ui.lcov ./fs-core.lcov diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index f1d1df2a90..3f3fa860d4 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -31,6 +31,7 @@ jobs: with: languages: ${{ matrix.language }} queries: +security-and-quality + config-file: ./.github/configs/codeql.yml - name: Build run: dotnet build diff --git a/CHANGELOG.md b/CHANGELOG.md index 24183a1ec9..a92cb4b639 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,25 @@ + + + # Changelog All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [8.1.6] - 2024-05-27 + +## Changed + +- Improve error messages for Multi-ExtractionIdentifier extractions +- Add prompt to rename container when adding a cohort filter +- Allow for column selection when using the RemoteTableAttacher +- Fix to remove stack trace button from non error popups +- Add ability to set Extraction Category as "Not Extractable" +- Replace BadMedicine v1.2.1 with SynthEHR v2.0.0 +- Fix issue with RDMP being slow to load when having numerous Load Metadatas +- Fix issue creating logging databases on PostgreSQL servers + ## [8.1.5] - 2024-04-03 ## Changed diff --git a/Directory.Packages.props b/Directory.Packages.props index 4a768920e5..f112585108 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -3,26 +3,26 @@ - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + - - - - + + + + - + - + @@ -34,9 +34,9 @@ - + - + diff --git a/Documentation/CodeTutorials/Packages.md b/Documentation/CodeTutorials/Packages.md index f5391fd72c..89579262da 100644 --- a/Documentation/CodeTutorials/Packages.md +++ b/Documentation/CodeTutorials/Packages.md @@ -25,7 +25,7 @@ | LibArchive.Net | [GitHub](https://github.com/jas88/libarchive.net) | [BSD](https://opensource.org/license/bsd-2-clause/) | Access archive formats without the LZMA bugs of SharpCompress | | | [NLog](https://nlog-project.org/) | [GitHub](https://github.com/NLog/NLog) | [BSD 3-Clause](https://github.com/NLog/NLog/blob/dev/LICENSE.txt) | Flexible user configurable logging | | | HIC.FAnsiSql |[GitHub](https://github.com/HicServices/FAnsiSql) | [GPL 3.0](https://www.gnu.org/licenses/gpl-3.0.html) | [DBMS] abstraction layer | -| HIC.BadMedicine | [GitHub](https://github.com/HicServices/BadMedicine) | [GPL 3.0](https://www.gnu.org/licenses/gpl-3.0.html) | Generate Test Datasets for tests/exericses | +| HIC.SynthEHR | [GitHub](https://github.com/HicServices/SynthEHR) | [GPL 3.0](https://www.gnu.org/licenses/gpl-3.0.html) | Generate Test Datasets for tests/exericses | | SSH.NET | [GitHub](https://github.com/sshnet/SSH.NET) | [MIT](https://github.com/sshnet/SSH.NET/blob/develop/LICENSE) | Enables fetching files from SFTP servers | | Moq 4 | [GitHub](https://github.com/moq/moq4) |[BSD 3](https://github.com/moq/moq4/blob/master/License.txt) | Mock objects during unit testing | | [Newtonsoft.Json](https://www.newtonsoft.com/json) | [GitHub](https://github.com/JamesNK/Newtonsoft.Json) | [MIT](https://opensource.org/licenses/MIT) | Serialization of objects for sharing/transmission | diff --git a/Documentation/CodeTutorials/PluginWriting.md b/Documentation/CodeTutorials/PluginWriting.md index de284ee2ab..1fe842faf2 100644 --- a/Documentation/CodeTutorials/PluginWriting.md +++ b/Documentation/CodeTutorials/PluginWriting.md @@ -1436,7 +1436,7 @@ When packaging `dotnet publish` results you can exclude dlls that already come w ``` ``` diff --git a/Documentation/CodeTutorials/TestPlan.md b/Documentation/CodeTutorials/TestPlan.md new file mode 100644 index 0000000000..5a5afe2cf5 --- /dev/null +++ b/Documentation/CodeTutorials/TestPlan.md @@ -0,0 +1,56 @@ +# RDMP Test Plan +The RDMP test plan outlines the questions that should be asked of new changes to help ensure the correct changes are being made at the correct time. +These questions are designed to help highlight any steps in the testing process that may have been missed. + +If you are looking to release a new version with this change, please look at the [Release Testing](#release_testing) section below. + +## Generating Test Data +There is functionality to generate example data built into RDMP. This functionality has a 'nightmare' mode, which can generate large amounts of data for testing purposes. +This mode can be enabled when creating platform databases by adding the 'Nightmare' flag to the example data settings during platform creation. +Additional data can be used by using the 'Factor' flag to increase the amount of data, this will multiply the number of objects created by your specified Factor. + +## Questions To Ask +### Does this change add a database migration? +If the change adds a database migration, ask yourself the following questions: +* Is the change backwards compatable? +* Have I tested the change with a fresh install of RDMP? +* Have I tested the change through the upgrade path with populated data that my change affects? +* Should this change be included in a patch release? or be part of the next minor release? Or even a major release? + * Patch releases contain small improvements and should be usable interchangably with other versions within the same minor version e.g v8.1.4 and v8.1.5 + * Minor released contain new functionality and should be backwards compatable with other versions in the same major version e.g. v8.1.0 and v8.2.0 + * Major releases contain changes that are not backwards compatable + +### Does this change add new functionality? +If the change adds new functionality, ask yourself the following questions: +* Is the functionality usable via the GUI? If no ,why not? +* Is the functionality usable via the CLI? If no, why not? +* Has the functionalty been covered via unit tests? +* Has the functionalty been manually tested? + * Has the happy path been tested? + * This is the expected path, where users are paying attention and are on their best behaviour + * Has the sad path been tested? + * This is where the user tries to be as obtuse as possible +* Does this change do any data processing? If so, check the performance questions below + +### Does this change have any impact on performance? +If the change adds or amends functionality that processes data +* Is the functionality performant? + * Can the space/time complexity of the functions be reduced? +* Does the functionality handle large datasets (>1GB) efficiently? + + +### What assumptions have been made? +* Have any assumptions about how this functionality will be used been made? +* Have any assumptions about the input data been made? Can these assumptions be extracted out into configuration? + +## Release Testing +The release testing process should be completed once the release is feature complete and no more code changes are due to take place. +This testing is to ensure that all code changes made during this release play nicely together and have no unintended side effcts. +It may be useful at this point to revisit each piece of functionality and ensure they work as expected and perform some user acceptance testing on them, in light with the questions above. +### What's changed? +* Does the changelog accuratly reflect the pull request changes made? +* If there are database migrations, are they all correctly sequenced and not overlapping? +* Does the release work as epxected with a fresh install and via the upgrade path? +* Is all functionality documented? +* Are all version numbers bumped correctly? +* Do all of the managed plugins work with the new release without issues or warnings? \ No newline at end of file diff --git a/Documentation/CodeTutorials/UserManual.md b/Documentation/CodeTutorials/UserManual.md index 224539fccc..dec9f2755c 100644 --- a/Documentation/CodeTutorials/UserManual.md +++ b/Documentation/CodeTutorials/UserManual.md @@ -129,7 +129,7 @@ _\* Unless using [file system backend](./YamlRepository.md)_ ## Example Data Example data can be setup on install by ticking the 'Example Datasets' checkbox during platform database setup. -New example data can be generated through the `Diagnostics=>Generate Test Data` menu. Or with the [BadMedicine](https://github.com/HicServices/BadMedicine) command line tool. +New example data can be generated through the `Diagnostics=>Generate Test Data` menu. Or with the [SynthEHR](https://github.com/HicServices/SynthEHR) command line tool. ## Importing a flat file as a new dataset If you have some CSV files (or Excel/Fixed Width) that you want to load into your database, you can do so with the RDMP bulk import tool. @@ -384,7 +384,7 @@ drop trigger Prescribing_OnUpdate; Each data load in RDMP has a single [LoadMetadata] object which acts as the root for the configuration. A given configuration will load one or more tables (which must have primary keys). The tables loaded includes all the tables that underly the [Catalogues] which are ­associated with the [LoadMetadata]. For example if a Catalogue 'Biochemistry' includes a join on two tables 'Header' and 'Results' then a [LoadMetadata] which includes 'Biochemistry' would include both the 'Header' and 'Results' tables. -Create a new Biochemistry CSV file with [BadMedicine] and add a primary key to the 'Biochemistry' table in your example data. The key should be a composite primary key of: +Create a new Biochemistry CSV file with [SynthEHR] and add a primary key to the 'Biochemistry' table in your example data. The key should be a composite primary key of: - chi - SampleDate @@ -458,7 +458,7 @@ Set the following properties: ### Running the load -Place the Biochemistry.csv file generated by [BadMedicine] into the ForLoading directory of your load (e.g. `C:\temp\biochem\Data\ForLoading`). +Place the Biochemistry.csv file generated by [SynthEHR] into the ForLoading directory of your load (e.g. `C:\temp\biochem\Data\ForLoading`). Right click the [LoadMetadata] and select 'Check and Execute' @@ -838,7 +838,7 @@ _The question mark after ExtractionConfiguration means match all where the Proje [AggregateConfiguration]: ./Glossary.md#AggregateConfiguration -[BadMedicine]: https://github.com/HicServices/BadMedicine +[SynthEHR]: https://github.com/HicServices/SynthEHR [Catalogue]: ./Glossary.md#Catalogue [Catalogues]: ./Glossary.md#Catalogue [CohortIdentificationConfiguration]: ./Glossary.md#CohortIdentificationConfiguration diff --git a/Documentation/DataLoadEngine/RemoteAttachers.md b/Documentation/DataLoadEngine/RemoteAttachers.md index a3ba7a784f..2026d3bb7a 100644 --- a/Documentation/DataLoadEngine/RemoteAttachers.md +++ b/Documentation/DataLoadEngine/RemoteAttachers.md @@ -48,7 +48,8 @@ The full configuration options are | Delta Reading Look Forward Days | If using the Delta Reading fetch duration, this is how many days forward in time you wish to look each time | | Set Delta Reading To Last Seen Date Post Load | Optional overwrite to the Delta Reading fetch option. Will use the most recently seen date in the fetched data rather than the adding the forward look days amount onto the stored minimum date | | Culture | Optionally specify a custom date format | -| Explicit Date Time Format | Optionally specify a specific datetime format +| Explicit Date Time Format | Optionally specify a specific datetime format +| Selected Columns | Optionally select which columns you wish to pull from the remote server (defaults to "*" ) ## Configuring the Remote Database Attacher The Remote Database Attacher has a number of configuration options the required fields are: @@ -68,4 +69,11 @@ The Remote Database Attacher has a number of configuration options the required | Delta Reading Look Forward Days | If using the Delta Reading fetch duration, this is how many days forward in time you wish to look each time | | Set Delta Reading To Last Seen Date Post Load | Optional overwrite to the Delta Reading fetch option. Will use the most recently seen date in the fetched data rather than the adding the forward look days amount onto the stored minimum date | | Culture | Optionally specify a custom date format | -| Explicit Date Time Format | Optionally specify a specific datetime format +| Explicit Date Time Format | Optionally specify a specific datetime format +| Selected Columns | Optionally select which columns you wish to pull from the remote server (defaults to "*" ) + + +## Using Historical Loading with custom SQL +By default, historical fetch configuration will be ignored in custome select SQL. +To enable the use of hostorical fetching, include the string "$RDMPDefinedWhereClause" in the where clause of your query +e.e. "Select * from Biochemistry Where $RDMPDefinedWhereClause" diff --git a/Rdmp.Core.Tests/CommandExecution/ExecuteCommandLinkCoulmnInfoWithDatasetTests.cs b/Rdmp.Core.Tests/CommandExecution/ExecuteCommandLinkCoulmnInfoWithDatasetTests.cs index 2fb4d0a7b9..02848abedf 100644 --- a/Rdmp.Core.Tests/CommandExecution/ExecuteCommandLinkCoulmnInfoWithDatasetTests.cs +++ b/Rdmp.Core.Tests/CommandExecution/ExecuteCommandLinkCoulmnInfoWithDatasetTests.cs @@ -34,7 +34,6 @@ public void TestLinkColumnInfoToDataset() var cmd = new ExecuteCommandCreateDataset(GetMockActivator(), "dataset"); Assert.DoesNotThrow(() => cmd.Execute()); var founddataset = GetMockActivator().RepositoryLocator.CatalogueRepository.GetAllObjects().First(); - var foundCatalogue = GetMockActivator().RepositoryLocator.CatalogueRepository.GetAllObjects().Where(c => c.Name == "Dataset1").First(); var linkCmd = new ExecuteCommandLinkColumnInfoToDataset(GetMockActivator(), _c1, founddataset); Assert.DoesNotThrow(() => linkCmd.Execute()); var columInfo = GetMockActivator().RepositoryLocator.CatalogueRepository.GetAllObjects(); @@ -69,7 +68,6 @@ public void TestLinkColumnInfoToDatasetNotAll() var cmd = new ExecuteCommandCreateDataset(GetMockActivator(), "dataset"); Assert.DoesNotThrow(() => cmd.Execute()); var founddataset = GetMockActivator().RepositoryLocator.CatalogueRepository.GetAllObjects().First(); - var foundCatalogue = GetMockActivator().RepositoryLocator.CatalogueRepository.GetAllObjects().Where(c => c.Name == "Dataset1").First(); var linkCmd = new ExecuteCommandLinkColumnInfoToDataset(GetMockActivator(), _c1, founddataset, false); Assert.DoesNotThrow(() => linkCmd.Execute()); var columInfo = GetMockActivator().RepositoryLocator.CatalogueRepository.GetAllObjects().Where(ci => _cata1.CatalogueItems.Contains(ci)); @@ -99,7 +97,6 @@ public void TestLinkColumInfoToDatasetBadDataset() { var cmd = new ExecuteCommandCreateDataset(GetMockActivator(), "dataset"); Assert.DoesNotThrow(() => cmd.Execute()); - var founddataset = GetMockActivator().RepositoryLocator.CatalogueRepository.GetAllObjects().First(); var linkCmd = new ExecuteCommandLinkColumnInfoToDataset(GetMockActivator(), new ColumnInfo(), null, false); Assert.Throws(() => linkCmd.Execute()); } diff --git a/Rdmp.Core.Tests/Curation/Integration/MetadataLoggingConfigurationChecksTests.cs b/Rdmp.Core.Tests/Curation/Integration/MetadataLoggingConfigurationChecksTests.cs index e51660c7c5..c41141f7e2 100644 --- a/Rdmp.Core.Tests/Curation/Integration/MetadataLoggingConfigurationChecksTests.cs +++ b/Rdmp.Core.Tests/Curation/Integration/MetadataLoggingConfigurationChecksTests.cs @@ -21,9 +21,8 @@ public class MetadataLoggingConfigurationChecksTests : UnitTests public void Test_NoLoggingTask() { var lmd = WhenIHaveA(); - var cata1 = lmd.GetAllCatalogues().Single(); - var cata2 = WhenIHaveA(); - lmd.LinkToCatalogue(cata2); + var cata = WhenIHaveA(); + lmd.LinkToCatalogue(cata); Assert.That(lmd.GetAllCatalogues().Count(), Is.EqualTo(2)); var checks = new MetadataLoggingConfigurationChecks(lmd); diff --git a/Rdmp.Core.Tests/Curation/Unit/ExerciseData/TestBiochemistryCreation.cs b/Rdmp.Core.Tests/Curation/Unit/ExerciseData/TestBiochemistryCreation.cs index fa7e8fd6b4..e0bc461d5e 100644 --- a/Rdmp.Core.Tests/Curation/Unit/ExerciseData/TestBiochemistryCreation.cs +++ b/Rdmp.Core.Tests/Curation/Unit/ExerciseData/TestBiochemistryCreation.cs @@ -6,8 +6,8 @@ using System; using System.IO; -using BadMedicine; -using BadMedicine.Datasets; +using SynthEHR; +using SynthEHR.Datasets; using NUnit.Framework; namespace Rdmp.Core.Tests.Curation.Unit.ExerciseData; diff --git a/Rdmp.Core.Tests/Curation/Unit/ExerciseData/TestDemographyCreation.cs b/Rdmp.Core.Tests/Curation/Unit/ExerciseData/TestDemographyCreation.cs index 80990b790a..a66abbb6cd 100644 --- a/Rdmp.Core.Tests/Curation/Unit/ExerciseData/TestDemographyCreation.cs +++ b/Rdmp.Core.Tests/Curation/Unit/ExerciseData/TestDemographyCreation.cs @@ -6,8 +6,8 @@ using System; using System.IO; -using BadMedicine; -using BadMedicine.Datasets; +using SynthEHR; +using SynthEHR.Datasets; using NUnit.Framework; namespace Rdmp.Core.Tests.Curation.Unit.ExerciseData; diff --git a/Rdmp.Core.Tests/Curation/Unit/ExerciseData/TestPrescribingCreation.cs b/Rdmp.Core.Tests/Curation/Unit/ExerciseData/TestPrescribingCreation.cs index 4b57512035..15bd4e42fe 100644 --- a/Rdmp.Core.Tests/Curation/Unit/ExerciseData/TestPrescribingCreation.cs +++ b/Rdmp.Core.Tests/Curation/Unit/ExerciseData/TestPrescribingCreation.cs @@ -7,8 +7,8 @@ using System; using System.IO; using System.Linq; -using BadMedicine; -using BadMedicine.Datasets; +using SynthEHR; +using SynthEHR.Datasets; using NUnit.Framework; namespace Rdmp.Core.Tests.Curation.Unit.ExerciseData; diff --git a/Rdmp.Core.Tests/DataExport/DataExtraction/ExecuteFullExtractionToDatabaseMSSqlDestinationTest.cs b/Rdmp.Core.Tests/DataExport/DataExtraction/ExecuteFullExtractionToDatabaseMSSqlDestinationTest.cs index 885aa46c65..31c934055f 100644 --- a/Rdmp.Core.Tests/DataExport/DataExtraction/ExecuteFullExtractionToDatabaseMSSqlDestinationTest.cs +++ b/Rdmp.Core.Tests/DataExport/DataExtraction/ExecuteFullExtractionToDatabaseMSSqlDestinationTest.cs @@ -8,7 +8,7 @@ using System.Data; using System.IO; using System.Linq; -using BadMedicine.Datasets; +using SynthEHR.Datasets; using FAnsi.Discovery; using NUnit.Framework; using Rdmp.Core.Curation.Data; diff --git a/Rdmp.Core.Tests/DataLoad/Engine/Integration/DataTableUploadDestinationTests.cs b/Rdmp.Core.Tests/DataLoad/Engine/Integration/DataTableUploadDestinationTests.cs index 17a8f8d52c..758604e6c5 100644 --- a/Rdmp.Core.Tests/DataLoad/Engine/Integration/DataTableUploadDestinationTests.cs +++ b/Rdmp.Core.Tests/DataLoad/Engine/Integration/DataTableUploadDestinationTests.cs @@ -1251,7 +1251,9 @@ public void TwoBatch_BooleanResizingTest(DatabaseType dbType, bool giveNullValue destination.ProcessPipelineData(dt1, toConsole, token); - Assert.That(db.ExpectTable("DataTableUploadDestinationTests").DiscoverColumn("TestedCol").DataType.SQLType, Is.EqualTo("bit")); + // MS SQL is odd and uses "bit" as a boolean, MySQL has a boolean type but aliases it to tinyint(1) + Assert.That(db.ExpectTable("DataTableUploadDestinationTests").DiscoverColumn("TestedCol").DataType?.SQLType, + Is.EqualTo(dbType == DatabaseType.MicrosoftSQLServer ? "bit" : "tinyint(1)")); destination.ProcessPipelineData(dt2, toMemory, token); diff --git a/Rdmp.Core.Tests/QueryCaching/QueryCachingCrossServerTests.cs b/Rdmp.Core.Tests/QueryCaching/QueryCachingCrossServerTests.cs index 8243b7c9e9..01ad053091 100644 --- a/Rdmp.Core.Tests/QueryCaching/QueryCachingCrossServerTests.cs +++ b/Rdmp.Core.Tests/QueryCaching/QueryCachingCrossServerTests.cs @@ -7,8 +7,8 @@ using System; using System.Linq; using System.Threading; -using BadMedicine; -using BadMedicine.Datasets; +using SynthEHR; +using SynthEHR.Datasets; using FAnsi; using FAnsi.Discovery; using NUnit.Framework; diff --git a/Rdmp.Core/CohortCreation/Execution/ExamplePluginCohortCompiler.cs b/Rdmp.Core/CohortCreation/Execution/ExamplePluginCohortCompiler.cs index 0a4dfcd05e..9452966095 100644 --- a/Rdmp.Core/CohortCreation/Execution/ExamplePluginCohortCompiler.cs +++ b/Rdmp.Core/CohortCreation/Execution/ExamplePluginCohortCompiler.cs @@ -9,7 +9,7 @@ using System.Data; using System.Linq; using System.Threading; -using BadMedicine; +using SynthEHR; using Rdmp.Core.Curation.Data; using Rdmp.Core.Curation.Data.Aggregation; using Rdmp.Core.QueryCaching.Aggregation; diff --git a/Rdmp.Core/CommandExecution/AtomicCommands/ExecuteCommandChangeExtractionCategory.cs b/Rdmp.Core/CommandExecution/AtomicCommands/ExecuteCommandChangeExtractionCategory.cs index f8a80e4f55..0e71a835df 100644 --- a/Rdmp.Core/CommandExecution/AtomicCommands/ExecuteCommandChangeExtractionCategory.cs +++ b/Rdmp.Core/CommandExecution/AtomicCommands/ExecuteCommandChangeExtractionCategory.cs @@ -69,17 +69,25 @@ public override void Execute() Show("Cannot set the Extraction Category to 'Core' for a Project Specific Catalogue item. It will be saved as 'Project Specific'."); } - if (ExecuteWithCommit(() => ExecuteImpl(c.Value), $"Set ExtractionCategory to '{c}'", _extractionInformations)) + if (ExecuteWithCommit(() => ExecuteImpl(c.Value), c == ExtractionCategory.NotExtractable ? "Make Not Extractable" : $"Set ExtractionCategory to '{c}'", _extractionInformations)) //publish the root Catalogue Publish(_extractionInformations.First()); } private void ExecuteImpl(ExtractionCategory category) { + foreach (var ei in _extractionInformations) { - ei.ExtractionCategory = category; - ei.SaveToDatabase(); + if (category == ExtractionCategory.NotExtractable) + { + ei.DeleteInDatabase(); + } + else + { + ei.ExtractionCategory = category; + ei.SaveToDatabase(); + } } } } \ No newline at end of file diff --git a/Rdmp.Core/CommandExecution/AtomicCommands/ExecuteCommandGenerateTestData.cs b/Rdmp.Core/CommandExecution/AtomicCommands/ExecuteCommandGenerateTestData.cs index 6c06f5f793..6f242aa184 100644 --- a/Rdmp.Core/CommandExecution/AtomicCommands/ExecuteCommandGenerateTestData.cs +++ b/Rdmp.Core/CommandExecution/AtomicCommands/ExecuteCommandGenerateTestData.cs @@ -7,13 +7,13 @@ using System; using System.IO; using System.Linq; -using BadMedicine; -using BadMedicine.Datasets; +using SynthEHR; +using SynthEHR.Datasets; namespace Rdmp.Core.CommandExecution.AtomicCommands; /// -/// Generates CSV files on disk for RDMP example datasets (based on BadMedicine library) +/// Generates CSV files on disk for RDMP example datasets (based on SynthEHR library) /// public class ExecuteCommandGenerateTestData : BasicCommandExecution { diff --git a/Rdmp.Core/CommandLine/DatabaseCreation/ExampleDatasetsCreation.cs b/Rdmp.Core/CommandLine/DatabaseCreation/ExampleDatasetsCreation.cs index 720c1b5d31..65fb921237 100644 --- a/Rdmp.Core/CommandLine/DatabaseCreation/ExampleDatasetsCreation.cs +++ b/Rdmp.Core/CommandLine/DatabaseCreation/ExampleDatasetsCreation.cs @@ -9,8 +9,8 @@ using System.IO; using System.Linq; using System.Text.RegularExpressions; -using BadMedicine; -using BadMedicine.Datasets; +using SynthEHR; +using SynthEHR.Datasets; using FAnsi; using FAnsi.Discovery; using FAnsi.Discovery.ConnectionStringDefaults; @@ -44,8 +44,8 @@ namespace Rdmp.Core.CommandLine.DatabaseCreation; /// public partial class ExampleDatasetsCreation { - private IRDMPPlatformRepositoryServiceLocator _repos; - private IBasicActivateItems _activator; + private readonly IRDMPPlatformRepositoryServiceLocator _repos; + private readonly IBasicActivateItems _activator; public const int NumberOfPeople = 5000; public const int NumberOfRowsPerDataset = 10000; @@ -389,9 +389,6 @@ private ExtractableCohort CommitCohortToNewProject(CohortIdentificationConfigura }; project.SaveToDatabase(); - //create a cohort - var auditLogBuilder = new ExtractableCohortAuditLogBuilder(); - var request = new CohortCreationRequest(project, new CohortDefinition(null, cohortName, 1, projectNumber, externalCohortTable), _repos.DataExportRepository, ExtractableCohortAuditLogBuilder.GetDescription(cic)) @@ -644,7 +641,7 @@ private ICatalogue ImportCatalogue(ITableInfo ti) var forwardEngineer = new ForwardEngineerCatalogue(ti, ti.ColumnInfos); forwardEngineer.ExecuteForwardEngineering(out var cata, out _, out var eis); - //get descriptions of the columns from BadMedicine + //get descriptions of the columns from SynthEHR cata.Description = Trim(Descriptions.Get(cata.Name)); if (cata.Description != null) { diff --git a/Rdmp.Core/CommandLine/DatabaseCreation/NightmareDatasets.cs b/Rdmp.Core/CommandLine/DatabaseCreation/NightmareDatasets.cs index 1e334414b9..d540b5f4ee 100644 --- a/Rdmp.Core/CommandLine/DatabaseCreation/NightmareDatasets.cs +++ b/Rdmp.Core/CommandLine/DatabaseCreation/NightmareDatasets.cs @@ -7,8 +7,8 @@ using System; using System.Collections.Generic; using System.IO; -using BadMedicine; -using BadMedicine.Datasets; +using SynthEHR; +using SynthEHR.Datasets; using FAnsi.Discovery; using Rdmp.Core.CohortCommitting.Pipeline; using Rdmp.Core.Curation.Data; diff --git a/Rdmp.Core/Curation/Data/ExtractionCategory.cs b/Rdmp.Core/Curation/Data/ExtractionCategory.cs index a05045513e..bd1f215d61 100644 --- a/Rdmp.Core/Curation/Data/ExtractionCategory.cs +++ b/Rdmp.Core/Curation/Data/ExtractionCategory.cs @@ -45,5 +45,10 @@ public enum ExtractionCategory /// /// Value can only be used for fetching ExtractionInformations. This means that all will be returned. You cannot set a column to have an ExtractionCategory of Any /// - Any + Any, + + /// + /// Value used for improved UI experience, will be set to null when executed + /// + NotExtractable } \ No newline at end of file diff --git a/Rdmp.Core/Curation/Data/SafeDirectoryCatalog.cs b/Rdmp.Core/Curation/Data/SafeDirectoryCatalog.cs index c740a32743..7f2d24a705 100644 --- a/Rdmp.Core/Curation/Data/SafeDirectoryCatalog.cs +++ b/Rdmp.Core/Curation/Data/SafeDirectoryCatalog.cs @@ -71,7 +71,7 @@ public static class SafeDirectoryCatalog "autoupdater.net.resources.dll", "azure.core.dll", "azure.identity.dll", - "badmedicine.core.dll", + "syntehr.core.dll", "bouncycastle.crypto.dll", "clretwrc.dll", "clrjit.dll", @@ -98,7 +98,6 @@ public static class SafeDirectoryCatalog "libarchive.net.dll", "mapsdirectlytodatabasetable.dll", "mathnet.numerics.dll", - "microsoft.bcl.asyncinterfaces.dll", "microsoft.csharp.dll", "microsoft.data.sqlclient.dll", "microsoft.data.sqlclient.sni.dll", @@ -404,4 +403,4 @@ public static class SafeDirectoryCatalog "wpfgfx_cor3.dll", "yamldotnet.dll" }; -} \ No newline at end of file +} diff --git a/Rdmp.Core/DataExport/Checks/SelectedDataSetsChecker.cs b/Rdmp.Core/DataExport/Checks/SelectedDataSetsChecker.cs index fa3baf87bf..b26bc58b24 100644 --- a/Rdmp.Core/DataExport/Checks/SelectedDataSetsChecker.cs +++ b/Rdmp.Core/DataExport/Checks/SelectedDataSetsChecker.cs @@ -137,7 +137,7 @@ public void Check(ICheckNotifier notifier) { notifier.OnCheckPerformed( new CheckEventArgs( - $"Could not generate valid extraction SQL for dataset {ds} in configuration {config}", + $"Could not generate valid extraction SQL for dataset {ds} in configuration {config}. {e.Message}", CheckResult.Fail, e)); return; } diff --git a/Rdmp.Core/DataLoad/Modules/Attachers/RemoteTableAttacher.cs b/Rdmp.Core/DataLoad/Modules/Attachers/RemoteTableAttacher.cs index 953a7e9db9..96878f4dc8 100644 --- a/Rdmp.Core/DataLoad/Modules/Attachers/RemoteTableAttacher.cs +++ b/Rdmp.Core/DataLoad/Modules/Attachers/RemoteTableAttacher.cs @@ -1,4 +1,4 @@ -// Copyright (c) The University of Dundee 2018-2019 +// Copyright (c) The University of Dundee 2018-2024 // This file is part of the Research Data Management Platform (RDMP). // RDMP is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. // RDMP is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -6,6 +6,7 @@ using System; using System.Data; +using System.Diagnostics; using System.Linq; using System.Text.RegularExpressions; using FAnsi; @@ -15,7 +16,6 @@ using Rdmp.Core.Curation.Data.DataLoad; using Rdmp.Core.DataFlowPipeline; using Rdmp.Core.DataFlowPipeline.Requirements; -using Rdmp.Core.DataLoad.Engine.Attachers; using Rdmp.Core.DataLoad.Engine.Job; using Rdmp.Core.DataLoad.Engine.Job.Scheduling; using Rdmp.Core.DataLoad.Engine.Pipeline.Destinations; @@ -27,6 +27,7 @@ using Rdmp.Core.ReusableLibraryCode.DataAccess; using Rdmp.Core.ReusableLibraryCode.Progress; using TypeGuesser; +using static NPOI.HSSF.Util.HSSFColor; namespace Rdmp.Core.DataLoad.Modules.Attachers; @@ -94,6 +95,9 @@ public RemoteTableAttacher() : base() DefaultValue = DatabaseType.MicrosoftSQLServer)] public DatabaseType DatabaseType { get; set; } + [DemandsInitialization("The Columns you wish to pull from the remote table", DefaultValue = "*")] + public string SelectedColumns { get; set; } = "*"; + private const string StartDateParameter = "@startDate"; private const string EndDateParameter = "@endDate"; @@ -359,9 +363,16 @@ public override ExitCodeType Attach(IDataLoadJob job, GracefulCancellationToken var syntax = _remoteDatabase.Server.GetQuerySyntaxHelper(); - var sql = !string.IsNullOrWhiteSpace(RemoteSelectSQL) - ? RemoteSelectSQL - : $"Select * from {syntax.EnsureWrapped(RemoteTableName)} {SqlHistoricalDataFilter(job.LoadMetadata,DatabaseType)}"; + string sql; + if (!string.IsNullOrWhiteSpace(RemoteSelectSQL)) + { + var injectedWhereClause = SqlHistoricalDataFilter(job.LoadMetadata, DatabaseType).Replace(" WHERE", ""); + sql = Regex.Replace(RemoteSelectSQL, "\\$RDMPDefinedWhereClause", injectedWhereClause); + } + else + { + sql = $"Select {SelectedColumns} from {syntax.EnsureWrapped(RemoteTableName)} {SqlHistoricalDataFilter(job.LoadMetadata, DatabaseType)}"; + } var scheduleMismatch = false; //if there is a load progress @@ -457,7 +468,7 @@ public override ExitCodeType Attach(IDataLoadJob job, GracefulCancellationToken if (SetDeltaReadingToLatestSeenDatePostLoad) { - FindMostRecentDateInLoadedData(rawSyntax, _dbInfo.Server.DatabaseType ,rawTableName, job); + FindMostRecentDateInLoadedData(rawSyntax, _dbInfo.Server.DatabaseType, rawTableName, job); } diff --git a/Rdmp.Core/Databases/LoggingDatabasePatcher.cs b/Rdmp.Core/Databases/LoggingDatabasePatcher.cs index b51c2af37e..83fc914f4a 100644 --- a/Rdmp.Core/Databases/LoggingDatabasePatcher.cs +++ b/Rdmp.Core/Databases/LoggingDatabasePatcher.cs @@ -81,29 +81,30 @@ public override Patch GetInitialCreateScriptContents(DiscoveredDatabase db) sql.AppendLine( $"{db.Helper.GetCreateTableSql(db, "z_RowErrorType", new[] { new DatabaseColumnRequest("ID", new DatabaseTypeRequest(typeof(int))) { AllowNulls = false, IsPrimaryKey = true }, new DatabaseColumnRequest("type", new DatabaseTypeRequest(typeof(string), 20) { Unicode = true }) }, null, true).TrimEnd()};"); - - sql.AppendLine(@" - -INSERT INTO z_DataLoadTaskStatus(ID, status, description) VALUES(1, 'Open', NULL); -INSERT INTO z_DataLoadTaskStatus (ID, status, description) VALUES(2, 'Ready', NULL); -INSERT INTO z_DataLoadTaskStatus (ID, status, description) VALUES(3, 'Committed', NULL); -INSERT INTO z_FatalErrorStatus(ID, status) VALUES(1, 'Outstanding'); -INSERT INTO z_FatalErrorStatus (ID, status) VALUES(2, 'Resolved'); -INSERT INTO z_FatalErrorStatus (ID, status) VALUES(3, 'Blocked'); -INSERT INTO z_RowErrorType(ID, type) VALUES(1, 'LoadRow'); -INSERT INTO z_RowErrorType (ID, type) VALUES(2, 'Duplication'); -INSERT INTO z_RowErrorType (ID, type) VALUES(3, 'Validation'); -INSERT INTO z_RowErrorType (ID, type) VALUES(4, 'DatabaseOperation'); -INSERT INTO z_RowErrorType (ID, type) VALUES(5, 'Unknown'); - -/*create datasets*/ -INSERT INTO DataSet (dataSetID, name, description, time_period, SLA_required, supplier_name, supplier_tel_no, supplier_email, contact_name, contact_position, currentContactInstitutions, contact_tel_no, contact_email, frequency, method) VALUES(N'DataExtraction', 'DataExtraction', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO DataSet (dataSetID, name, description, time_period, SLA_required, supplier_name, supplier_tel_no, supplier_email, contact_name, contact_position, currentContactInstitutions, contact_tel_no, contact_email, frequency, method) VALUES(N'Internal', 'Internal', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - -/*create tasks*/ -INSERT INTO DataLoadTask(ID, description, name, userAccount, statusID, isTest, dataSetID) VALUES(1, 'Internal', 'Internal', 'Thomas', 1, 0, 'Internal'); -INSERT INTO DataLoadTask (ID, description, name, userAccount, statusID, isTest, dataSetID) VALUES(2, 'DataExtraction', 'DataExtraction', 'Thomas', 1, 0, 'DataExtraction'); -"); + var sh = db.Server.GetQuerySyntaxHelper(); + sql.AppendLine($""" + + INSERT INTO {db.ExpectTable("z_DataLoadTaskStatus").GetWrappedName()} ({sh.EnsureWrapped("ID")}, {sh.EnsureWrapped("status")}, {sh.EnsureWrapped("description")}) VALUES(1, 'Open', NULL); + INSERT INTO {db.ExpectTable("z_DataLoadTaskStatus").GetWrappedName()} ({sh.EnsureWrapped("ID")}, {sh.EnsureWrapped("status")}, {sh.EnsureWrapped("description")}) VALUES(2, 'Ready', NULL); + INSERT INTO {db.ExpectTable("z_DataLoadTaskStatus").GetWrappedName()} ({sh.EnsureWrapped("ID")}, {sh.EnsureWrapped("status")}, {sh.EnsureWrapped("description")}) VALUES(3, 'Committed', NULL); + INSERT INTO {db.ExpectTable("z_FatalErrorStatus").GetWrappedName()} ({sh.EnsureWrapped("ID")}, {sh.EnsureWrapped("status")}) VALUES(1, 'Outstanding'); + INSERT INTO {db.ExpectTable("z_FatalErrorStatus").GetWrappedName()} ({sh.EnsureWrapped("ID")}, {sh.EnsureWrapped("status")}) VALUES(2, 'Resolved'); + INSERT INTO {db.ExpectTable("z_FatalErrorStatus").GetWrappedName()} ({sh.EnsureWrapped("ID")}, {sh.EnsureWrapped("status")}) VALUES(3, 'Blocked'); + INSERT INTO {db.ExpectTable("z_RowErrorType").GetWrappedName()} ({sh.EnsureWrapped("ID")}, {sh.EnsureWrapped("type")}) VALUES(1, 'LoadRow'); + INSERT INTO {db.ExpectTable("z_RowErrorType").GetWrappedName()} ({sh.EnsureWrapped("ID")}, {sh.EnsureWrapped("type")}) VALUES(2, 'Duplication'); + INSERT INTO {db.ExpectTable("z_RowErrorType").GetWrappedName()} ({sh.EnsureWrapped("ID")}, {sh.EnsureWrapped("type")}) VALUES(3, 'Validation'); + INSERT INTO {db.ExpectTable("z_RowErrorType").GetWrappedName()} ({sh.EnsureWrapped("ID")}, {sh.EnsureWrapped("type")}) VALUES(4, 'DatabaseOperation'); + INSERT INTO {db.ExpectTable("z_RowErrorType").GetWrappedName()} ({sh.EnsureWrapped("ID")}, {sh.EnsureWrapped("type")}) VALUES(5, 'Unknown'); + + /*create datasets*/ + INSERT INTO {db.ExpectTable("DataSet").GetWrappedName()} ({sh.EnsureWrapped("dataSetID")}, {sh.EnsureWrapped("name")}, {sh.EnsureWrapped("description")}, {sh.EnsureWrapped("time_period")}, {sh.EnsureWrapped("SLA_required")}, {sh.EnsureWrapped("supplier_name")}, {sh.EnsureWrapped("supplier_tel_no")}, {sh.EnsureWrapped("supplier_email")}, {sh.EnsureWrapped("contact_name")}, {sh.EnsureWrapped("contact_position")}, {sh.EnsureWrapped("currentContactInstitutions")}, {sh.EnsureWrapped("contact_tel_no")}, {sh.EnsureWrapped("contact_email")}, {sh.EnsureWrapped("frequency")}, {sh.EnsureWrapped("method")}) VALUES(N'DataExtraction', 'DataExtraction', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + INSERT INTO {db.ExpectTable("DataSet").GetWrappedName()} ({sh.EnsureWrapped("dataSetID")}, {sh.EnsureWrapped("name")}, {sh.EnsureWrapped("description")}, {sh.EnsureWrapped("time_period")}, {sh.EnsureWrapped("SLA_required")}, {sh.EnsureWrapped("supplier_name")}, {sh.EnsureWrapped("supplier_tel_no")}, {sh.EnsureWrapped("supplier_email")}, {sh.EnsureWrapped("contact_name")}, {sh.EnsureWrapped("contact_position")}, {sh.EnsureWrapped("currentContactInstitutions")}, {sh.EnsureWrapped("contact_tel_no")}, {sh.EnsureWrapped("contact_email")}, {sh.EnsureWrapped("frequency")}, {sh.EnsureWrapped("method")}) VALUES(N'Internal', 'Internal', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + + /*create tasks*/ + INSERT INTO {db.ExpectTable("DataLoadTask").GetWrappedName()} ({sh.EnsureWrapped("ID")}, {sh.EnsureWrapped("description")}, {sh.EnsureWrapped("name")}, {sh.EnsureWrapped("userAccount")}, {sh.EnsureWrapped("statusID")}, {sh.EnsureWrapped("isTest")}, {sh.EnsureWrapped("dataSetID")}) VALUES(1, 'Internal', 'Internal', 'Thomas', 1, 0, 'Internal'); + INSERT INTO {db.ExpectTable("DataLoadTask").GetWrappedName()} ({sh.EnsureWrapped("ID")}, {sh.EnsureWrapped("description")}, {sh.EnsureWrapped("name")}, {sh.EnsureWrapped("userAccount")}, {sh.EnsureWrapped("statusID")}, {sh.EnsureWrapped("isTest")}, {sh.EnsureWrapped("dataSetID")}) VALUES(2, 'DataExtraction', 'DataExtraction', 'Thomas', 1, 0, 'DataExtraction'); + + """); return new Patch(InitialScriptName, header + sql); diff --git a/Rdmp.Core/Icons/IconProvision/StateBasedIconProviders/ExtractionInformationStateBasedIconProvider.cs b/Rdmp.Core/Icons/IconProvision/StateBasedIconProviders/ExtractionInformationStateBasedIconProvider.cs index 24ca4a6d46..ebb4089aba 100644 --- a/Rdmp.Core/Icons/IconProvision/StateBasedIconProviders/ExtractionInformationStateBasedIconProvider.cs +++ b/Rdmp.Core/Icons/IconProvision/StateBasedIconProviders/ExtractionInformationStateBasedIconProvider.cs @@ -35,6 +35,8 @@ internal sealed class ExtractionInformationStateBasedIconProvider : IObjectState private static readonly Image NoIconAvailable = Image.Load(CatalogueIcons.NoIconAvailable); + private static readonly Image ExtractionInformationNotExtractable = IconOverlayProvider.GetOverlayNoCache(ExtractionInformationCore, OverlayKind.Delete); + public Image GetImageIfSupportedObject(object o) { if (o is ExtractionCategory cat) @@ -67,6 +69,7 @@ private static Image GetImage(ExtractionCategory category) ExtractionCategory.Deprecated => ExtractionInformationDeprecated, ExtractionCategory.ProjectSpecific => ExtractionInformationProjectSpecific, ExtractionCategory.Any => NoIconAvailable, + ExtractionCategory.NotExtractable => ExtractionInformationNotExtractable, _ => throw new ArgumentOutOfRangeException(nameof(category)) }; } diff --git a/Rdmp.Core/Logging/TableLoadInfo.cs b/Rdmp.Core/Logging/TableLoadInfo.cs index 4cc6485969..a80491cebf 100644 --- a/Rdmp.Core/Logging/TableLoadInfo.cs +++ b/Rdmp.Core/Logging/TableLoadInfo.cs @@ -8,7 +8,7 @@ using System.Data; using System.Threading; using Amazon.Auth.AccessControlPolicy; -using BadMedicine; +using SynthEHR; using FAnsi.Connections; using FAnsi.Discovery; using Rdmp.Core.ReusableLibraryCode.Settings; diff --git a/Rdmp.Core/Providers/CatalogueChildProvider.cs b/Rdmp.Core/Providers/CatalogueChildProvider.cs index 20901ecf65..daf3321216 100644 --- a/Rdmp.Core/Providers/CatalogueChildProvider.cs +++ b/Rdmp.Core/Providers/CatalogueChildProvider.cs @@ -54,6 +54,8 @@ public class CatalogueChildProvider : ICoreChildProvider { //Load System public LoadMetadata[] AllLoadMetadatas { get; set; } + + private LoadMetadataCatalogueLinkage[] AllLoadMetadataLinkage { get; set; } public ProcessTask[] AllProcessTasks { get; set; } public ProcessTaskArgument[] AllProcessTasksArguments { get; set; } @@ -247,6 +249,7 @@ public CatalogueChildProvider(ICatalogueRepository repository, IChildProvider[] AllDatasets = GetAllObjects(repository); AllLoadMetadatas = GetAllObjects(repository); + AllLoadMetadataLinkage = GetAllObjects(repository); AllProcessTasks = GetAllObjects(repository); AllProcessTasksArguments = GetAllObjects(repository); AllLoadProgresses = GetAllObjects(repository); @@ -390,12 +393,10 @@ public CatalogueChildProvider(ICatalogueRepository repository, IChildProvider[] LoadMetadataRootFolder = FolderHelper.BuildFolderTree(AllLoadMetadatas); AddChildren(LoadMetadataRootFolder, new DescendancyList(LoadMetadataRootFolder)); - CohortIdentificationConfigurationRootFolder = FolderHelper.BuildFolderTree(AllCohortIdentificationConfigurations); AddChildren(CohortIdentificationConfigurationRootFolder, new DescendancyList(CohortIdentificationConfigurationRootFolder)); - var templateAggregateConfigurationIds = new HashSet( repository.GetExtendedProperties(ExtendedProperty.IsTemplate) @@ -413,7 +414,6 @@ public CatalogueChildProvider(ICatalogueRepository repository, IChildProvider[] dec.SetBetterRouteExists(); AddToDictionaries(new HashSet(TemplateAggregateConfigurations), dec); - //Some AggregateConfigurations are 'Patient Index Tables', this happens when there is an existing JoinableCohortAggregateConfiguration declared where //the AggregateConfiguration_ID is the AggregateConfiguration.ID. We can inject this knowledge now so to avoid database lookups later (e.g. at icon provision time) var joinableDictionaryByAggregateConfigurationId = @@ -824,7 +824,6 @@ private void AddChildren(FolderNode folder, DescendancyList descen //add loads in folder foreach (var lmd in folder.ChildObjects) AddChildren(lmd, descendancy.Add(lmd)); - // Children are the folders + objects AddToDictionaries(new HashSet( folder.ChildFolders.Cast() @@ -987,23 +986,24 @@ private void AddChildren(ProcessTask procesTask, DescendancyList descendancy) private void AddChildren(AllCataloguesUsedByLoadMetadataNode allCataloguesUsedByLoadMetadataNode, DescendancyList descendancy) { - var chilObjects = new HashSet(); + var childObjects = new HashSet(); + + var loadMetadataId = allCataloguesUsedByLoadMetadataNode.LoadMetadata.ID; + + var linkedCatalogueIDs = AllLoadMetadataLinkage.Where(link => link.LoadMetadataID == loadMetadataId).Select(link => link.CatalogueID); List usedCatalogues = new(); - foreach (var catalogue in AllCatalogues) + foreach (var catalogueId in linkedCatalogueIDs) { - var lmds = catalogue.LoadMetadatas(); - if (lmds.Any() && lmds.Select(lmd => lmd.ID).ToList().Contains(allCataloguesUsedByLoadMetadataNode.LoadMetadata.ID)) - { - usedCatalogues.Add(catalogue); - chilObjects.Add(new CatalogueUsedByLoadMetadataNode(allCataloguesUsedByLoadMetadataNode.LoadMetadata, - catalogue)); - } + var foundCatalogue = AllCatalogues.Where(c => c.ID == catalogueId).FirstOrDefault(); + if (foundCatalogue is null) continue; + usedCatalogues.Add(foundCatalogue); + childObjects.Add(new CatalogueUsedByLoadMetadataNode(allCataloguesUsedByLoadMetadataNode.LoadMetadata, + foundCatalogue)); } - allCataloguesUsedByLoadMetadataNode.UsedCatalogues = usedCatalogues; - AddToDictionaries(chilObjects, descendancy); + AddToDictionaries(childObjects, descendancy); } #endregion diff --git a/Rdmp.Core/Rdmp.Core.csproj b/Rdmp.Core/Rdmp.Core.csproj index 9d087e5d2e..53659c989a 100644 --- a/Rdmp.Core/Rdmp.Core.csproj +++ b/Rdmp.Core/Rdmp.Core.csproj @@ -303,7 +303,7 @@ - + diff --git a/Rdmp.Core/ReusableLibraryCode/Settings/UserSettings.cs b/Rdmp.Core/ReusableLibraryCode/Settings/UserSettings.cs index 94e5bd34a0..d835ff0c42 100644 --- a/Rdmp.Core/ReusableLibraryCode/Settings/UserSettings.cs +++ b/Rdmp.Core/ReusableLibraryCode/Settings/UserSettings.cs @@ -1,4 +1,4 @@ -// Copyright (c) The University of Dundee 2018-2019 +// Copyright (c) The University of Dundee 2018-2024 // This file is part of the Research Data Management Platform (RDMP). // RDMP is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. // RDMP is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -171,6 +171,13 @@ public static bool EnableCommits } + public static bool PromptRenameOnCohortFilterChange + { + get => AppSettings.GetValueOrDefault("PromptRenameOnCohortFilterChange", true); + set => AppSettings.AddOrUpdateValue("PromptRenameOnCohortFilterChange", value); + } + + #region Catalogue flag visibility settings public static bool ShowInternalCatalogues diff --git a/Rdmp.UI.Tests/UITimeoutAttribute.cs b/Rdmp.UI.Tests/UITimeoutAttribute.cs index c5cbc7169f..a6e6b7505c 100644 --- a/Rdmp.UI.Tests/UITimeoutAttribute.cs +++ b/Rdmp.UI.Tests/UITimeoutAttribute.cs @@ -42,13 +42,13 @@ public TimeoutCommand(TestCommand innerCommand, int timeout) : base(innerCommand _timeout = timeout; } - [LibraryImport("user32.dll")] + [LibraryImport("user32.dll", SetLastError = true, EntryPoint = "SendMessageW", StringMarshalling = StringMarshalling.Utf16)] private static partial IntPtr SendMessage(IntPtr hWnd, uint Msg, int wParam, IntPtr lParam); [DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)] private static extern int GetClassName(IntPtr hWnd, StringBuilder lpClassName, int nMaxCount); - [LibraryImport("user32.dll")] + [LibraryImport("user32.dll", SetLastError = true, EntryPoint = "GetDlgItemW", StringMarshalling = StringMarshalling.Utf16)] private static partial IntPtr GetDlgItem(IntPtr hDlg, int nIDDlgItem); private string YesNoDialog = "#32770"; diff --git a/Rdmp.UI/LocationsMenu/ChoosePlatformDatabasesUI.Designer.cs b/Rdmp.UI/LocationsMenu/ChoosePlatformDatabasesUI.Designer.cs index fe75ce878d..62dd81d2d2 100644 --- a/Rdmp.UI/LocationsMenu/ChoosePlatformDatabasesUI.Designer.cs +++ b/Rdmp.UI/LocationsMenu/ChoosePlatformDatabasesUI.Designer.cs @@ -33,622 +33,628 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { - this.label1 = new System.Windows.Forms.Label(); - this.tbCatalogueConnectionString = new Rdmp.UI.SimpleControls.ConnectionStringTextBox(); - this.btnSaveAndClose = new System.Windows.Forms.Button(); - this.gbUseExisting = new System.Windows.Forms.GroupBox(); - this.btnBack2 = new System.Windows.Forms.Button(); - this.pReferenceADataExport = new System.Windows.Forms.Panel(); - this.btnCreateYamlFile = new System.Windows.Forms.Button(); - this.btnBrowseForDataExport = new System.Windows.Forms.Button(); - this.tbDataExportManagerConnectionString = new Rdmp.UI.SimpleControls.ConnectionStringTextBox(); - this.btnCheckDataExportManager = new System.Windows.Forms.Button(); - this.pReferenceACatalogue = new System.Windows.Forms.Panel(); - this.btnBrowseForCatalogue = new System.Windows.Forms.Button(); - this.btnCheckCatalogue = new System.Windows.Forms.Button(); - this.label8 = new System.Windows.Forms.Label(); - this.label2 = new System.Windows.Forms.Label(); - this.checksUI1 = new Rdmp.UI.ChecksUI.ChecksUI(); - this.btnCreateSuite = new System.Windows.Forms.Button(); - this.label5 = new System.Windows.Forms.Label(); - this.tbSuiteServer = new System.Windows.Forms.TextBox(); - this.tbDatabasePrefix = new System.Windows.Forms.TextBox(); - this.label6 = new System.Windows.Forms.Label(); - this.btnCreateNew = new System.Windows.Forms.Button(); - this.pChooseOption = new System.Windows.Forms.Panel(); - this.btnUseExisting = new System.Windows.Forms.Button(); - this.label7 = new System.Windows.Forms.Label(); - this.gbCreateNew = new System.Windows.Forms.GroupBox(); - this.gbSqlAuthentication = new System.Windows.Forms.GroupBox(); - this.tbUsername = new System.Windows.Forms.TextBox(); - this.label3 = new System.Windows.Forms.Label(); - this.label4 = new System.Windows.Forms.Label(); - this.tbPassword = new System.Windows.Forms.TextBox(); - this.gbExampleDatasets = new System.Windows.Forms.GroupBox(); - this.label10 = new System.Windows.Forms.Label(); - this.label12 = new System.Windows.Forms.Label(); - this.tbPeopleCount = new System.Windows.Forms.TextBox(); - this.label11 = new System.Windows.Forms.Label(); - this.tbRowCount = new System.Windows.Forms.TextBox(); - this.cbCreateExampleDatasets = new System.Windows.Forms.CheckBox(); - this.cbCreateLoggingServer = new System.Windows.Forms.CheckBox(); - this.tbSeed = new System.Windows.Forms.TextBox(); - this.tbOtherKeywords = new System.Windows.Forms.TextBox(); - this.tbCreateDatabaseTimeout = new System.Windows.Forms.TextBox(); - this.label14 = new System.Windows.Forms.Label(); - this.label13 = new System.Windows.Forms.Label(); - this.label9 = new System.Windows.Forms.Label(); - this.btnBack1 = new System.Windows.Forms.Button(); - this.pResults = new System.Windows.Forms.Panel(); - this.gbUseExisting.SuspendLayout(); - this.pReferenceADataExport.SuspendLayout(); - this.pReferenceACatalogue.SuspendLayout(); - this.pChooseOption.SuspendLayout(); - this.gbCreateNew.SuspendLayout(); - this.gbSqlAuthentication.SuspendLayout(); - this.gbExampleDatasets.SuspendLayout(); - this.pResults.SuspendLayout(); - this.SuspendLayout(); + label1 = new System.Windows.Forms.Label(); + tbCatalogueConnectionString = new ConnectionStringTextBox(); + btnSaveAndClose = new System.Windows.Forms.Button(); + gbUseExisting = new System.Windows.Forms.GroupBox(); + btnBack2 = new System.Windows.Forms.Button(); + pReferenceADataExport = new System.Windows.Forms.Panel(); + btnCreateYamlFile = new System.Windows.Forms.Button(); + btnBrowseForDataExport = new System.Windows.Forms.Button(); + tbDataExportManagerConnectionString = new ConnectionStringTextBox(); + btnCheckDataExportManager = new System.Windows.Forms.Button(); + pReferenceACatalogue = new System.Windows.Forms.Panel(); + btnBrowseForCatalogue = new System.Windows.Forms.Button(); + btnCheckCatalogue = new System.Windows.Forms.Button(); + label8 = new System.Windows.Forms.Label(); + label2 = new System.Windows.Forms.Label(); + checksUI1 = new ChecksUI.ChecksUI(); + btnCreateSuite = new System.Windows.Forms.Button(); + label5 = new System.Windows.Forms.Label(); + tbSuiteServer = new System.Windows.Forms.TextBox(); + tbDatabasePrefix = new System.Windows.Forms.TextBox(); + label6 = new System.Windows.Forms.Label(); + btnCreateNew = new System.Windows.Forms.Button(); + pChooseOption = new System.Windows.Forms.Panel(); + btnUseExisting = new System.Windows.Forms.Button(); + label7 = new System.Windows.Forms.Label(); + gbCreateNew = new System.Windows.Forms.GroupBox(); + cbCreateExampleDatasets = new System.Windows.Forms.CheckBox(); + cbCreateLoggingServer = new System.Windows.Forms.CheckBox(); + gbSqlAuthentication = new System.Windows.Forms.GroupBox(); + tbUsername = new System.Windows.Forms.TextBox(); + label3 = new System.Windows.Forms.Label(); + label4 = new System.Windows.Forms.Label(); + tbPassword = new System.Windows.Forms.TextBox(); + gbExampleDatasets = new System.Windows.Forms.GroupBox(); + label10 = new System.Windows.Forms.Label(); + label12 = new System.Windows.Forms.Label(); + tbPeopleCount = new System.Windows.Forms.TextBox(); + label11 = new System.Windows.Forms.Label(); + tbRowCount = new System.Windows.Forms.TextBox(); + tbSeed = new System.Windows.Forms.TextBox(); + tbOtherKeywords = new System.Windows.Forms.TextBox(); + tbCreateDatabaseTimeout = new System.Windows.Forms.TextBox(); + label14 = new System.Windows.Forms.Label(); + label13 = new System.Windows.Forms.Label(); + label9 = new System.Windows.Forms.Label(); + btnBack1 = new System.Windows.Forms.Button(); + pResults = new System.Windows.Forms.Panel(); + btnUseYamlFile = new System.Windows.Forms.Button(); + gbUseExisting.SuspendLayout(); + pReferenceADataExport.SuspendLayout(); + pReferenceACatalogue.SuspendLayout(); + pChooseOption.SuspendLayout(); + gbCreateNew.SuspendLayout(); + gbSqlAuthentication.SuspendLayout(); + gbExampleDatasets.SuspendLayout(); + pResults.SuspendLayout(); + SuspendLayout(); // // label1 // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(97, 25); - this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(64, 15); - this.label1.TabIndex = 0; - this.label1.Text = "Catalogue:"; + label1.AutoSize = true; + label1.Location = new System.Drawing.Point(97, 25); + label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + label1.Name = "label1"; + label1.Size = new System.Drawing.Size(64, 15); + label1.TabIndex = 0; + label1.Text = "Catalogue:"; // // tbCatalogueConnectionString // - this.tbCatalogueConnectionString.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.tbCatalogueConnectionString.DatabaseType = FAnsi.DatabaseType.MicrosoftSQLServer; - this.tbCatalogueConnectionString.ForeColor = System.Drawing.Color.Black; - this.tbCatalogueConnectionString.Location = new System.Drawing.Point(84, 8); - this.tbCatalogueConnectionString.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.tbCatalogueConnectionString.Name = "tbCatalogueConnectionString"; - this.tbCatalogueConnectionString.Size = new System.Drawing.Size(937, 23); - this.tbCatalogueConnectionString.TabIndex = 1; - this.tbCatalogueConnectionString.KeyUp += new System.Windows.Forms.KeyEventHandler(this.tbCatalogueConnectionString_KeyUp); + tbCatalogueConnectionString.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; + tbCatalogueConnectionString.DatabaseType = FAnsi.DatabaseType.MicrosoftSQLServer; + tbCatalogueConnectionString.ForeColor = System.Drawing.Color.Black; + tbCatalogueConnectionString.Location = new System.Drawing.Point(84, 8); + tbCatalogueConnectionString.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + tbCatalogueConnectionString.Name = "tbCatalogueConnectionString"; + tbCatalogueConnectionString.Size = new System.Drawing.Size(937, 23); + tbCatalogueConnectionString.TabIndex = 1; + tbCatalogueConnectionString.KeyUp += tbCatalogueConnectionString_KeyUp; // // btnSaveAndClose // - this.btnSaveAndClose.Location = new System.Drawing.Point(537, 167); - this.btnSaveAndClose.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.btnSaveAndClose.Name = "btnSaveAndClose"; - this.btnSaveAndClose.Size = new System.Drawing.Size(320, 27); - this.btnSaveAndClose.TabIndex = 10; - this.btnSaveAndClose.Text = "Save and Close"; - this.btnSaveAndClose.UseVisualStyleBackColor = true; - this.btnSaveAndClose.Click += new System.EventHandler(this.btnSaveAndClose_Click); + btnSaveAndClose.Location = new System.Drawing.Point(537, 167); + btnSaveAndClose.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + btnSaveAndClose.Name = "btnSaveAndClose"; + btnSaveAndClose.Size = new System.Drawing.Size(320, 27); + btnSaveAndClose.TabIndex = 10; + btnSaveAndClose.Text = "Save and Close"; + btnSaveAndClose.UseVisualStyleBackColor = true; + btnSaveAndClose.Click += btnSaveAndClose_Click; // // gbUseExisting // - this.gbUseExisting.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.gbUseExisting.Controls.Add(this.btnBack2); - this.gbUseExisting.Controls.Add(this.pReferenceADataExport); - this.gbUseExisting.Controls.Add(this.btnSaveAndClose); - this.gbUseExisting.Controls.Add(this.pReferenceACatalogue); - this.gbUseExisting.Controls.Add(this.label8); - this.gbUseExisting.Controls.Add(this.label1); - this.gbUseExisting.Location = new System.Drawing.Point(7, 14); - this.gbUseExisting.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.gbUseExisting.Name = "gbUseExisting"; - this.gbUseExisting.Padding = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.gbUseExisting.Size = new System.Drawing.Size(1226, 201); - this.gbUseExisting.TabIndex = 8; - this.gbUseExisting.TabStop = false; - this.gbUseExisting.Text = "Connect to existing Platform Databases (Enter Connection Strings)"; - this.gbUseExisting.Visible = false; + gbUseExisting.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; + gbUseExisting.Controls.Add(btnBack2); + gbUseExisting.Controls.Add(pReferenceADataExport); + gbUseExisting.Controls.Add(btnSaveAndClose); + gbUseExisting.Controls.Add(pReferenceACatalogue); + gbUseExisting.Controls.Add(label8); + gbUseExisting.Controls.Add(label1); + gbUseExisting.Location = new System.Drawing.Point(7, 14); + gbUseExisting.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + gbUseExisting.Name = "gbUseExisting"; + gbUseExisting.Padding = new System.Windows.Forms.Padding(4, 3, 4, 3); + gbUseExisting.Size = new System.Drawing.Size(1226, 201); + gbUseExisting.TabIndex = 8; + gbUseExisting.TabStop = false; + gbUseExisting.Text = "Connect to existing Platform Databases (Enter Connection Strings)"; + gbUseExisting.Visible = false; // // btnBack2 // - this.btnBack2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.btnBack2.Location = new System.Drawing.Point(7, 167); - this.btnBack2.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.btnBack2.Name = "btnBack2"; - this.btnBack2.Size = new System.Drawing.Size(88, 27); - this.btnBack2.TabIndex = 10; - this.btnBack2.Text = "<< Back"; - this.btnBack2.UseVisualStyleBackColor = true; - this.btnBack2.Click += new System.EventHandler(this.btnBack_Click); + btnBack2.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; + btnBack2.Location = new System.Drawing.Point(7, 167); + btnBack2.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + btnBack2.Name = "btnBack2"; + btnBack2.Size = new System.Drawing.Size(88, 27); + btnBack2.TabIndex = 10; + btnBack2.Text = "<< Back"; + btnBack2.UseVisualStyleBackColor = true; + btnBack2.Click += btnBack_Click; // // pReferenceADataExport // - this.pReferenceADataExport.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.pReferenceADataExport.Controls.Add(this.btnCreateYamlFile); - this.pReferenceADataExport.Controls.Add(this.btnBrowseForDataExport); - this.pReferenceADataExport.Controls.Add(this.tbDataExportManagerConnectionString); - this.pReferenceADataExport.Controls.Add(this.btnCheckDataExportManager); - this.pReferenceADataExport.Location = new System.Drawing.Point(192, 93); - this.pReferenceADataExport.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.pReferenceADataExport.Name = "pReferenceADataExport"; - this.pReferenceADataExport.Size = new System.Drawing.Size(1027, 60); - this.pReferenceADataExport.TabIndex = 9; + pReferenceADataExport.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; + pReferenceADataExport.Controls.Add(btnUseYamlFile); + pReferenceADataExport.Controls.Add(btnCreateYamlFile); + pReferenceADataExport.Controls.Add(btnBrowseForDataExport); + pReferenceADataExport.Controls.Add(tbDataExportManagerConnectionString); + pReferenceADataExport.Controls.Add(btnCheckDataExportManager); + pReferenceADataExport.Location = new System.Drawing.Point(192, 93); + pReferenceADataExport.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + pReferenceADataExport.Name = "pReferenceADataExport"; + pReferenceADataExport.Size = new System.Drawing.Size(1027, 60); + pReferenceADataExport.TabIndex = 9; // // btnCreateYamlFile // - this.btnCreateYamlFile.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.btnCreateYamlFile.Location = new System.Drawing.Point(914, 32); - this.btnCreateYamlFile.Name = "btnCreateYamlFile"; - this.btnCreateYamlFile.Size = new System.Drawing.Size(108, 23); - this.btnCreateYamlFile.TabIndex = 9; - this.btnCreateYamlFile.Text = "Save as yaml..."; - this.btnCreateYamlFile.UseVisualStyleBackColor = true; - this.btnCreateYamlFile.Click += new System.EventHandler(this.btnCreateYamlFile_Click); + btnCreateYamlFile.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right; + btnCreateYamlFile.Location = new System.Drawing.Point(914, 32); + btnCreateYamlFile.Name = "btnCreateYamlFile"; + btnCreateYamlFile.Size = new System.Drawing.Size(108, 23); + btnCreateYamlFile.TabIndex = 9; + btnCreateYamlFile.Text = "Save as yaml..."; + btnCreateYamlFile.UseVisualStyleBackColor = true; + btnCreateYamlFile.Click += btnCreateYamlFile_Click; // // btnBrowseForDataExport // - this.btnBrowseForDataExport.Location = new System.Drawing.Point(4, 3); - this.btnBrowseForDataExport.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.btnBrowseForDataExport.Name = "btnBrowseForDataExport"; - this.btnBrowseForDataExport.Size = new System.Drawing.Size(75, 27); - this.btnBrowseForDataExport.TabIndex = 8; - this.btnBrowseForDataExport.Text = "Browse..."; - this.btnBrowseForDataExport.UseVisualStyleBackColor = true; - this.btnBrowseForDataExport.Click += new System.EventHandler(this.btnBrowseForDataExport_Click); + btnBrowseForDataExport.Location = new System.Drawing.Point(4, 3); + btnBrowseForDataExport.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + btnBrowseForDataExport.Name = "btnBrowseForDataExport"; + btnBrowseForDataExport.Size = new System.Drawing.Size(75, 27); + btnBrowseForDataExport.TabIndex = 8; + btnBrowseForDataExport.Text = "Browse..."; + btnBrowseForDataExport.UseVisualStyleBackColor = true; + btnBrowseForDataExport.Click += btnBrowseForDataExport_Click; // // tbDataExportManagerConnectionString // - this.tbDataExportManagerConnectionString.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.tbDataExportManagerConnectionString.DatabaseType = FAnsi.DatabaseType.MicrosoftSQLServer; - this.tbDataExportManagerConnectionString.ForeColor = System.Drawing.Color.Black; - this.tbDataExportManagerConnectionString.Location = new System.Drawing.Point(84, 3); - this.tbDataExportManagerConnectionString.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.tbDataExportManagerConnectionString.Name = "tbDataExportManagerConnectionString"; - this.tbDataExportManagerConnectionString.Size = new System.Drawing.Size(938, 23); - this.tbDataExportManagerConnectionString.TabIndex = 5; + tbDataExportManagerConnectionString.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; + tbDataExportManagerConnectionString.DatabaseType = FAnsi.DatabaseType.MicrosoftSQLServer; + tbDataExportManagerConnectionString.ForeColor = System.Drawing.Color.Black; + tbDataExportManagerConnectionString.Location = new System.Drawing.Point(84, 3); + tbDataExportManagerConnectionString.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + tbDataExportManagerConnectionString.Name = "tbDataExportManagerConnectionString"; + tbDataExportManagerConnectionString.Size = new System.Drawing.Size(938, 23); + tbDataExportManagerConnectionString.TabIndex = 5; // // btnCheckDataExportManager // - this.btnCheckDataExportManager.Location = new System.Drawing.Point(4, 30); - this.btnCheckDataExportManager.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.btnCheckDataExportManager.Name = "btnCheckDataExportManager"; - this.btnCheckDataExportManager.Size = new System.Drawing.Size(75, 27); - this.btnCheckDataExportManager.TabIndex = 7; - this.btnCheckDataExportManager.Text = "Check"; - this.btnCheckDataExportManager.UseVisualStyleBackColor = true; - this.btnCheckDataExportManager.Click += new System.EventHandler(this.btnCheckDataExportManager_Click); + btnCheckDataExportManager.Location = new System.Drawing.Point(4, 30); + btnCheckDataExportManager.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + btnCheckDataExportManager.Name = "btnCheckDataExportManager"; + btnCheckDataExportManager.Size = new System.Drawing.Size(75, 27); + btnCheckDataExportManager.TabIndex = 7; + btnCheckDataExportManager.Text = "Check"; + btnCheckDataExportManager.UseVisualStyleBackColor = true; + btnCheckDataExportManager.Click += btnCheckDataExportManager_Click; // // pReferenceACatalogue // - this.pReferenceACatalogue.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.pReferenceACatalogue.Controls.Add(this.tbCatalogueConnectionString); - this.pReferenceACatalogue.Controls.Add(this.btnBrowseForCatalogue); - this.pReferenceACatalogue.Controls.Add(this.btnCheckCatalogue); - this.pReferenceACatalogue.Location = new System.Drawing.Point(192, 22); - this.pReferenceACatalogue.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.pReferenceACatalogue.Name = "pReferenceACatalogue"; - this.pReferenceACatalogue.Size = new System.Drawing.Size(1027, 66); - this.pReferenceACatalogue.TabIndex = 8; + pReferenceACatalogue.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; + pReferenceACatalogue.Controls.Add(tbCatalogueConnectionString); + pReferenceACatalogue.Controls.Add(btnBrowseForCatalogue); + pReferenceACatalogue.Controls.Add(btnCheckCatalogue); + pReferenceACatalogue.Location = new System.Drawing.Point(192, 22); + pReferenceACatalogue.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + pReferenceACatalogue.Name = "pReferenceACatalogue"; + pReferenceACatalogue.Size = new System.Drawing.Size(1027, 66); + pReferenceACatalogue.TabIndex = 8; // // btnBrowseForCatalogue // - this.btnBrowseForCatalogue.Location = new System.Drawing.Point(4, 6); - this.btnBrowseForCatalogue.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.btnBrowseForCatalogue.Name = "btnBrowseForCatalogue"; - this.btnBrowseForCatalogue.Size = new System.Drawing.Size(75, 27); - this.btnBrowseForCatalogue.TabIndex = 3; - this.btnBrowseForCatalogue.Text = "Browse..."; - this.btnBrowseForCatalogue.UseVisualStyleBackColor = true; - this.btnBrowseForCatalogue.Click += new System.EventHandler(this.btnBrowseForCatalogue_Click); + btnBrowseForCatalogue.Location = new System.Drawing.Point(4, 6); + btnBrowseForCatalogue.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + btnBrowseForCatalogue.Name = "btnBrowseForCatalogue"; + btnBrowseForCatalogue.Size = new System.Drawing.Size(75, 27); + btnBrowseForCatalogue.TabIndex = 3; + btnBrowseForCatalogue.Text = "Browse..."; + btnBrowseForCatalogue.UseVisualStyleBackColor = true; + btnBrowseForCatalogue.Click += btnBrowseForCatalogue_Click; // // btnCheckCatalogue // - this.btnCheckCatalogue.Location = new System.Drawing.Point(4, 32); - this.btnCheckCatalogue.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.btnCheckCatalogue.Name = "btnCheckCatalogue"; - this.btnCheckCatalogue.Size = new System.Drawing.Size(75, 27); - this.btnCheckCatalogue.TabIndex = 3; - this.btnCheckCatalogue.Text = "Check"; - this.btnCheckCatalogue.UseVisualStyleBackColor = true; - this.btnCheckCatalogue.Click += new System.EventHandler(this.btnCheckCatalogue_Click); + btnCheckCatalogue.Location = new System.Drawing.Point(4, 32); + btnCheckCatalogue.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + btnCheckCatalogue.Name = "btnCheckCatalogue"; + btnCheckCatalogue.Size = new System.Drawing.Size(75, 27); + btnCheckCatalogue.TabIndex = 3; + btnCheckCatalogue.Text = "Check"; + btnCheckCatalogue.UseVisualStyleBackColor = true; + btnCheckCatalogue.Click += btnCheckCatalogue_Click; // // label8 // - this.label8.AutoSize = true; - this.label8.Location = new System.Drawing.Point(56, 88); - this.label8.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.label8.Name = "label8"; - this.label8.Size = new System.Drawing.Size(121, 15); - this.label8.TabIndex = 4; - this.label8.Text = "Data Export Manager:"; + label8.AutoSize = true; + label8.Location = new System.Drawing.Point(56, 88); + label8.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + label8.Name = "label8"; + label8.Size = new System.Drawing.Size(121, 15); + label8.TabIndex = 4; + label8.Text = "Data Export Manager:"; // // label2 // - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(4, 10); - this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(42, 15); - this.label2.TabIndex = 11; - this.label2.Text = "Result:"; + label2.AutoSize = true; + label2.Location = new System.Drawing.Point(4, 10); + label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + label2.Name = "label2"; + label2.Size = new System.Drawing.Size(42, 15); + label2.TabIndex = 11; + label2.Text = "Result:"; // // checksUI1 // - this.checksUI1.AllowsYesNoToAll = true; - this.checksUI1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.checksUI1.Location = new System.Drawing.Point(4, 29); - this.checksUI1.Margin = new System.Windows.Forms.Padding(5, 3, 5, 3); - this.checksUI1.Name = "checksUI1"; - this.checksUI1.Size = new System.Drawing.Size(867, 441); - this.checksUI1.TabIndex = 0; + checksUI1.AllowsYesNoToAll = true; + checksUI1.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; + checksUI1.Location = new System.Drawing.Point(4, 29); + checksUI1.Margin = new System.Windows.Forms.Padding(5, 3, 5, 3); + checksUI1.Name = "checksUI1"; + checksUI1.Size = new System.Drawing.Size(867, 441); + checksUI1.TabIndex = 0; // // btnCreateSuite // - this.btnCreateSuite.Location = new System.Drawing.Point(108, 144); - this.btnCreateSuite.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.btnCreateSuite.Name = "btnCreateSuite"; - this.btnCreateSuite.Size = new System.Drawing.Size(75, 27); - this.btnCreateSuite.TabIndex = 2; - this.btnCreateSuite.Text = "Create"; - this.btnCreateSuite.UseVisualStyleBackColor = true; - this.btnCreateSuite.Click += new System.EventHandler(this.btnCreateSuite_Click); + btnCreateSuite.Location = new System.Drawing.Point(108, 144); + btnCreateSuite.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + btnCreateSuite.Name = "btnCreateSuite"; + btnCreateSuite.Size = new System.Drawing.Size(75, 27); + btnCreateSuite.TabIndex = 2; + btnCreateSuite.Text = "Create"; + btnCreateSuite.UseVisualStyleBackColor = true; + btnCreateSuite.Click += btnCreateSuite_Click; // // label5 // - this.label5.AutoSize = true; - this.label5.Location = new System.Drawing.Point(54, 30); - this.label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(42, 15); - this.label5.TabIndex = 1; - this.label5.Text = "Server:"; + label5.AutoSize = true; + label5.Location = new System.Drawing.Point(54, 30); + label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + label5.Name = "label5"; + label5.Size = new System.Drawing.Size(42, 15); + label5.TabIndex = 1; + label5.Text = "Server:"; // // tbSuiteServer // - this.tbSuiteServer.Location = new System.Drawing.Point(108, 27); - this.tbSuiteServer.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.tbSuiteServer.Name = "tbSuiteServer"; - this.tbSuiteServer.Size = new System.Drawing.Size(166, 23); - this.tbSuiteServer.TabIndex = 0; - this.tbSuiteServer.Text = "localhost\\sqlexpress"; + tbSuiteServer.Location = new System.Drawing.Point(108, 27); + tbSuiteServer.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + tbSuiteServer.Name = "tbSuiteServer"; + tbSuiteServer.Size = new System.Drawing.Size(166, 23); + tbSuiteServer.TabIndex = 0; + tbSuiteServer.Text = "localhost\\sqlexpress"; // // tbDatabasePrefix // - this.tbDatabasePrefix.Location = new System.Drawing.Point(108, 56); - this.tbDatabasePrefix.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.tbDatabasePrefix.Name = "tbDatabasePrefix"; - this.tbDatabasePrefix.Size = new System.Drawing.Size(166, 23); - this.tbDatabasePrefix.TabIndex = 1; - this.tbDatabasePrefix.Text = "RDMP_"; + tbDatabasePrefix.Location = new System.Drawing.Point(108, 56); + tbDatabasePrefix.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + tbDatabasePrefix.Name = "tbDatabasePrefix"; + tbDatabasePrefix.Size = new System.Drawing.Size(166, 23); + tbDatabasePrefix.TabIndex = 1; + tbDatabasePrefix.Text = "RDMP_"; // // label6 // - this.label6.AutoSize = true; - this.label6.Location = new System.Drawing.Point(10, 59); - this.label6.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(91, 15); - this.label6.TabIndex = 3; - this.label6.Text = "Database Prefix:"; + label6.AutoSize = true; + label6.Location = new System.Drawing.Point(10, 59); + label6.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + label6.Name = "label6"; + label6.Size = new System.Drawing.Size(91, 15); + label6.TabIndex = 3; + label6.Text = "Database Prefix:"; // // btnCreateNew // - this.btnCreateNew.Location = new System.Drawing.Point(4, 42); - this.btnCreateNew.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.btnCreateNew.Name = "btnCreateNew"; - this.btnCreateNew.Size = new System.Drawing.Size(259, 27); - this.btnCreateNew.TabIndex = 13; - this.btnCreateNew.Text = "I want to create new Platform Databases"; - this.btnCreateNew.UseVisualStyleBackColor = true; - this.btnCreateNew.Click += new System.EventHandler(this.btnCreateNew_Click); + btnCreateNew.Location = new System.Drawing.Point(4, 42); + btnCreateNew.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + btnCreateNew.Name = "btnCreateNew"; + btnCreateNew.Size = new System.Drawing.Size(259, 27); + btnCreateNew.TabIndex = 13; + btnCreateNew.Text = "I want to create new Platform Databases"; + btnCreateNew.UseVisualStyleBackColor = true; + btnCreateNew.Click += btnCreateNew_Click; // // pChooseOption // - this.pChooseOption.Controls.Add(this.btnUseExisting); - this.pChooseOption.Controls.Add(this.btnCreateNew); - this.pChooseOption.Controls.Add(this.label7); - this.pChooseOption.Location = new System.Drawing.Point(330, 347); - this.pChooseOption.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.pChooseOption.Name = "pChooseOption"; - this.pChooseOption.Size = new System.Drawing.Size(758, 115); - this.pChooseOption.TabIndex = 14; + pChooseOption.Controls.Add(btnUseExisting); + pChooseOption.Controls.Add(btnCreateNew); + pChooseOption.Controls.Add(label7); + pChooseOption.Location = new System.Drawing.Point(330, 347); + pChooseOption.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + pChooseOption.Name = "pChooseOption"; + pChooseOption.Size = new System.Drawing.Size(758, 115); + pChooseOption.TabIndex = 14; // // btnUseExisting // - this.btnUseExisting.Location = new System.Drawing.Point(270, 42); - this.btnUseExisting.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.btnUseExisting.Name = "btnUseExisting"; - this.btnUseExisting.Size = new System.Drawing.Size(471, 27); - this.btnUseExisting.TabIndex = 13; - this.btnUseExisting.Text = "Our organisation already has RDMP Platform Databases that I want to connect to"; - this.btnUseExisting.UseVisualStyleBackColor = true; - this.btnUseExisting.Click += new System.EventHandler(this.btnUseExisting_Click); + btnUseExisting.Location = new System.Drawing.Point(270, 42); + btnUseExisting.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + btnUseExisting.Name = "btnUseExisting"; + btnUseExisting.Size = new System.Drawing.Size(471, 27); + btnUseExisting.TabIndex = 13; + btnUseExisting.Text = "Our organisation already has RDMP Platform Databases that I want to connect to"; + btnUseExisting.UseVisualStyleBackColor = true; + btnUseExisting.Click += btnUseExisting_Click; // // label7 // - this.label7.AutoSize = true; - this.label7.Location = new System.Drawing.Point(4, 9); - this.label7.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.label7.Name = "label7"; - this.label7.Size = new System.Drawing.Size(199, 15); - this.label7.TabIndex = 0; - this.label7.Text = "Which best describes your situation?"; + label7.AutoSize = true; + label7.Location = new System.Drawing.Point(4, 9); + label7.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + label7.Name = "label7"; + label7.Size = new System.Drawing.Size(199, 15); + label7.TabIndex = 0; + label7.Text = "Which best describes your situation?"; // // gbCreateNew // - this.gbCreateNew.Controls.Add(this.cbCreateExampleDatasets); - this.gbCreateNew.Controls.Add(this.cbCreateLoggingServer); - this.gbCreateNew.Controls.Add(this.gbSqlAuthentication); - this.gbCreateNew.Controls.Add(this.gbExampleDatasets); - this.gbCreateNew.Controls.Add(this.tbOtherKeywords); - this.gbCreateNew.Controls.Add(this.tbCreateDatabaseTimeout); - this.gbCreateNew.Controls.Add(this.label14); - this.gbCreateNew.Controls.Add(this.label13); - this.gbCreateNew.Controls.Add(this.label9); - this.gbCreateNew.Controls.Add(this.tbSuiteServer); - this.gbCreateNew.Controls.Add(this.btnBack1); - this.gbCreateNew.Controls.Add(this.tbDatabasePrefix); - this.gbCreateNew.Controls.Add(this.label5); - this.gbCreateNew.Controls.Add(this.btnCreateSuite); - this.gbCreateNew.Controls.Add(this.label6); - this.gbCreateNew.Location = new System.Drawing.Point(559, 252); - this.gbCreateNew.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.gbCreateNew.Name = "gbCreateNew"; - this.gbCreateNew.Padding = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.gbCreateNew.Size = new System.Drawing.Size(888, 180); - this.gbCreateNew.TabIndex = 15; - this.gbCreateNew.TabStop = false; - this.gbCreateNew.Text = "Create New Platform Databases"; - this.gbCreateNew.Visible = false; + gbCreateNew.Controls.Add(cbCreateExampleDatasets); + gbCreateNew.Controls.Add(cbCreateLoggingServer); + gbCreateNew.Controls.Add(gbSqlAuthentication); + gbCreateNew.Controls.Add(gbExampleDatasets); + gbCreateNew.Controls.Add(tbOtherKeywords); + gbCreateNew.Controls.Add(tbCreateDatabaseTimeout); + gbCreateNew.Controls.Add(label14); + gbCreateNew.Controls.Add(label13); + gbCreateNew.Controls.Add(label9); + gbCreateNew.Controls.Add(tbSuiteServer); + gbCreateNew.Controls.Add(btnBack1); + gbCreateNew.Controls.Add(tbDatabasePrefix); + gbCreateNew.Controls.Add(label5); + gbCreateNew.Controls.Add(btnCreateSuite); + gbCreateNew.Controls.Add(label6); + gbCreateNew.Location = new System.Drawing.Point(559, 252); + gbCreateNew.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + gbCreateNew.Name = "gbCreateNew"; + gbCreateNew.Padding = new System.Windows.Forms.Padding(4, 3, 4, 3); + gbCreateNew.Size = new System.Drawing.Size(888, 180); + gbCreateNew.TabIndex = 15; + gbCreateNew.TabStop = false; + gbCreateNew.Text = "Create New Platform Databases"; + gbCreateNew.Visible = false; + // + // cbCreateExampleDatasets + // + cbCreateExampleDatasets.AutoSize = true; + cbCreateExampleDatasets.Location = new System.Drawing.Point(543, 33); + cbCreateExampleDatasets.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + cbCreateExampleDatasets.Name = "cbCreateExampleDatasets"; + cbCreateExampleDatasets.Size = new System.Drawing.Size(118, 19); + cbCreateExampleDatasets.TabIndex = 9; + cbCreateExampleDatasets.Text = "Example Datasets"; + cbCreateExampleDatasets.UseVisualStyleBackColor = true; + cbCreateExampleDatasets.CheckedChanged += cbCreateExampleDatasets_CheckedChanged; + // + // cbCreateLoggingServer + // + cbCreateLoggingServer.AutoSize = true; + cbCreateLoggingServer.Checked = true; + cbCreateLoggingServer.CheckState = System.Windows.Forms.CheckState.Checked; + cbCreateLoggingServer.Location = new System.Drawing.Point(543, 156); + cbCreateLoggingServer.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + cbCreateLoggingServer.Name = "cbCreateLoggingServer"; + cbCreateLoggingServer.Size = new System.Drawing.Size(147, 19); + cbCreateLoggingServer.TabIndex = 9; + cbCreateLoggingServer.Text = "Create a logging server"; + cbCreateLoggingServer.UseVisualStyleBackColor = true; // // gbSqlAuthentication // - this.gbSqlAuthentication.Controls.Add(this.tbUsername); - this.gbSqlAuthentication.Controls.Add(this.label3); - this.gbSqlAuthentication.Controls.Add(this.label4); - this.gbSqlAuthentication.Controls.Add(this.tbPassword); - this.gbSqlAuthentication.Location = new System.Drawing.Point(281, 25); - this.gbSqlAuthentication.Name = "gbSqlAuthentication"; - this.gbSqlAuthentication.Size = new System.Drawing.Size(237, 76); - this.gbSqlAuthentication.TabIndex = 15; - this.gbSqlAuthentication.TabStop = false; - this.gbSqlAuthentication.Text = "Sql Authentication*"; + gbSqlAuthentication.Controls.Add(tbUsername); + gbSqlAuthentication.Controls.Add(label3); + gbSqlAuthentication.Controls.Add(label4); + gbSqlAuthentication.Controls.Add(tbPassword); + gbSqlAuthentication.Location = new System.Drawing.Point(281, 25); + gbSqlAuthentication.Name = "gbSqlAuthentication"; + gbSqlAuthentication.Size = new System.Drawing.Size(237, 76); + gbSqlAuthentication.TabIndex = 15; + gbSqlAuthentication.TabStop = false; + gbSqlAuthentication.Text = "Sql Authentication*"; // // tbUsername // - this.tbUsername.Location = new System.Drawing.Point(80, 17); - this.tbUsername.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.tbUsername.Name = "tbUsername"; - this.tbUsername.Size = new System.Drawing.Size(149, 23); - this.tbUsername.TabIndex = 3; + tbUsername.Location = new System.Drawing.Point(80, 17); + tbUsername.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + tbUsername.Name = "tbUsername"; + tbUsername.Size = new System.Drawing.Size(149, 23); + tbUsername.TabIndex = 3; // // label3 // - this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(12, 22); - this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(63, 15); - this.label3.TabIndex = 6; - this.label3.Text = "Username:"; + label3.AutoSize = true; + label3.Location = new System.Drawing.Point(12, 22); + label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + label3.Name = "label3"; + label3.Size = new System.Drawing.Size(63, 15); + label3.TabIndex = 6; + label3.Text = "Username:"; // // label4 // - this.label4.AutoSize = true; - this.label4.Location = new System.Drawing.Point(15, 45); - this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(60, 15); - this.label4.TabIndex = 6; - this.label4.Text = "Password:"; + label4.AutoSize = true; + label4.Location = new System.Drawing.Point(15, 45); + label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + label4.Name = "label4"; + label4.Size = new System.Drawing.Size(60, 15); + label4.TabIndex = 6; + label4.Text = "Password:"; // // tbPassword // - this.tbPassword.Location = new System.Drawing.Point(80, 42); - this.tbPassword.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.tbPassword.Name = "tbPassword"; - this.tbPassword.Size = new System.Drawing.Size(149, 23); - this.tbPassword.TabIndex = 4; - this.tbPassword.UseSystemPasswordChar = true; + tbPassword.Location = new System.Drawing.Point(80, 42); + tbPassword.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + tbPassword.Name = "tbPassword"; + tbPassword.Size = new System.Drawing.Size(149, 23); + tbPassword.TabIndex = 4; + tbPassword.UseSystemPasswordChar = true; // // gbExampleDatasets // - this.gbExampleDatasets.Controls.Add(this.label10); - this.gbExampleDatasets.Controls.Add(this.label12); - this.gbExampleDatasets.Controls.Add(this.tbPeopleCount); - this.gbExampleDatasets.Controls.Add(this.label11); - this.gbExampleDatasets.Controls.Add(this.tbRowCount); - this.gbExampleDatasets.Controls.Add(this.tbSeed); - this.gbExampleDatasets.Enabled = false; - this.gbExampleDatasets.Location = new System.Drawing.Point(536, 33); - this.gbExampleDatasets.Name = "gbExampleDatasets"; - this.gbExampleDatasets.Size = new System.Drawing.Size(230, 100); - this.gbExampleDatasets.TabIndex = 14; - this.gbExampleDatasets.TabStop = false; + gbExampleDatasets.Controls.Add(label10); + gbExampleDatasets.Controls.Add(label12); + gbExampleDatasets.Controls.Add(tbPeopleCount); + gbExampleDatasets.Controls.Add(label11); + gbExampleDatasets.Controls.Add(tbRowCount); + gbExampleDatasets.Controls.Add(tbSeed); + gbExampleDatasets.Enabled = false; + gbExampleDatasets.Location = new System.Drawing.Point(536, 33); + gbExampleDatasets.Name = "gbExampleDatasets"; + gbExampleDatasets.Size = new System.Drawing.Size(230, 100); + gbExampleDatasets.TabIndex = 14; + gbExampleDatasets.TabStop = false; // // label10 // - this.label10.AutoSize = true; - this.label10.Location = new System.Drawing.Point(51, 25); - this.label10.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.label10.Name = "label10"; - this.label10.Size = new System.Drawing.Size(35, 15); - this.label10.TabIndex = 10; - this.label10.Text = "Seed:"; + label10.AutoSize = true; + label10.Location = new System.Drawing.Point(51, 25); + label10.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + label10.Name = "label10"; + label10.Size = new System.Drawing.Size(35, 15); + label10.TabIndex = 10; + label10.Text = "Seed:"; // // label12 // - this.label12.AutoSize = true; - this.label12.Location = new System.Drawing.Point(7, 49); - this.label12.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.label12.Name = "label12"; - this.label12.Size = new System.Drawing.Size(82, 15); - this.label12.TabIndex = 10; - this.label12.Text = "Person Count:"; + label12.AutoSize = true; + label12.Location = new System.Drawing.Point(7, 49); + label12.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + label12.Name = "label12"; + label12.Size = new System.Drawing.Size(82, 15); + label12.TabIndex = 10; + label12.Text = "Person Count:"; // // tbPeopleCount // - this.tbPeopleCount.Location = new System.Drawing.Point(94, 46); - this.tbPeopleCount.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.tbPeopleCount.Name = "tbPeopleCount"; - this.tbPeopleCount.Size = new System.Drawing.Size(129, 23); - this.tbPeopleCount.TabIndex = 11; - this.tbPeopleCount.TextChanged += new System.EventHandler(this.Tb_TextChanged); + tbPeopleCount.Location = new System.Drawing.Point(94, 46); + tbPeopleCount.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + tbPeopleCount.Name = "tbPeopleCount"; + tbPeopleCount.Size = new System.Drawing.Size(129, 23); + tbPeopleCount.TabIndex = 11; + tbPeopleCount.TextChanged += Tb_TextChanged; // // label11 // - this.label11.AutoSize = true; - this.label11.Location = new System.Drawing.Point(20, 74); - this.label11.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.label11.Name = "label11"; - this.label11.Size = new System.Drawing.Size(69, 15); - this.label11.TabIndex = 10; - this.label11.Text = "Row Count:"; + label11.AutoSize = true; + label11.Location = new System.Drawing.Point(20, 74); + label11.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + label11.Name = "label11"; + label11.Size = new System.Drawing.Size(69, 15); + label11.TabIndex = 10; + label11.Text = "Row Count:"; // // tbRowCount // - this.tbRowCount.Location = new System.Drawing.Point(94, 71); - this.tbRowCount.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.tbRowCount.Name = "tbRowCount"; - this.tbRowCount.Size = new System.Drawing.Size(129, 23); - this.tbRowCount.TabIndex = 11; - this.tbRowCount.TextChanged += new System.EventHandler(this.Tb_TextChanged); + tbRowCount.Location = new System.Drawing.Point(94, 71); + tbRowCount.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + tbRowCount.Name = "tbRowCount"; + tbRowCount.Size = new System.Drawing.Size(129, 23); + tbRowCount.TabIndex = 11; + tbRowCount.TextChanged += Tb_TextChanged; // - // cbCreateExampleDatasets - // - this.cbCreateExampleDatasets.AutoSize = true; - this.cbCreateExampleDatasets.Location = new System.Drawing.Point(543, 33); - this.cbCreateExampleDatasets.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.cbCreateExampleDatasets.Name = "cbCreateExampleDatasets"; - this.cbCreateExampleDatasets.Size = new System.Drawing.Size(118, 19); - this.cbCreateExampleDatasets.TabIndex = 9; - this.cbCreateExampleDatasets.Text = "Example Datasets"; - this.cbCreateExampleDatasets.UseVisualStyleBackColor = true; - this.cbCreateExampleDatasets.CheckedChanged += new System.EventHandler(this.cbCreateExampleDatasets_CheckedChanged); - // - // cbCreateLoggingServer - // - this.cbCreateLoggingServer.AutoSize = true; - this.cbCreateLoggingServer.Location = new System.Drawing.Point(543, 156); - this.cbCreateLoggingServer.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.cbCreateLoggingServer.Name = "cbCreateLoggingServer"; - this.cbCreateLoggingServer.Size = new System.Drawing.Size(118, 19); - this.cbCreateLoggingServer.TabIndex = 9; - this.cbCreateLoggingServer.Checked = true; - this.cbCreateLoggingServer.Text = Core.GlobalStrings.CreateALoggingServer; - this.cbCreateLoggingServer.UseVisualStyleBackColor = true; // tbSeed // - this.tbSeed.Location = new System.Drawing.Point(94, 22); - this.tbSeed.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.tbSeed.Name = "tbSeed"; - this.tbSeed.Size = new System.Drawing.Size(129, 23); - this.tbSeed.TabIndex = 11; - this.tbSeed.Text = "500"; - this.tbSeed.TextChanged += new System.EventHandler(this.Tb_TextChanged); + tbSeed.Location = new System.Drawing.Point(94, 22); + tbSeed.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + tbSeed.Name = "tbSeed"; + tbSeed.Size = new System.Drawing.Size(129, 23); + tbSeed.TabIndex = 11; + tbSeed.Text = "500"; + tbSeed.TextChanged += Tb_TextChanged; // // tbOtherKeywords // - this.tbOtherKeywords.Location = new System.Drawing.Point(108, 115); - this.tbOtherKeywords.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.tbOtherKeywords.Name = "tbOtherKeywords"; - this.tbOtherKeywords.Size = new System.Drawing.Size(410, 23); - this.tbOtherKeywords.TabIndex = 13; + tbOtherKeywords.Location = new System.Drawing.Point(108, 115); + tbOtherKeywords.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + tbOtherKeywords.Name = "tbOtherKeywords"; + tbOtherKeywords.Size = new System.Drawing.Size(410, 23); + tbOtherKeywords.TabIndex = 13; // // tbCreateDatabaseTimeout // - this.tbCreateDatabaseTimeout.Location = new System.Drawing.Point(108, 85); - this.tbCreateDatabaseTimeout.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.tbCreateDatabaseTimeout.Name = "tbCreateDatabaseTimeout"; - this.tbCreateDatabaseTimeout.Size = new System.Drawing.Size(90, 23); - this.tbCreateDatabaseTimeout.TabIndex = 13; - this.tbCreateDatabaseTimeout.Text = "30"; + tbCreateDatabaseTimeout.Location = new System.Drawing.Point(108, 85); + tbCreateDatabaseTimeout.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + tbCreateDatabaseTimeout.Name = "tbCreateDatabaseTimeout"; + tbCreateDatabaseTimeout.Size = new System.Drawing.Size(90, 23); + tbCreateDatabaseTimeout.TabIndex = 13; + tbCreateDatabaseTimeout.Text = "30"; // // label14 // - this.label14.AutoSize = true; - this.label14.Location = new System.Drawing.Point(10, 118); - this.label14.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.label14.Name = "label14"; - this.label14.Size = new System.Drawing.Size(94, 15); - this.label14.TabIndex = 12; - this.label14.Text = "Other Keywords:"; + label14.AutoSize = true; + label14.Location = new System.Drawing.Point(10, 118); + label14.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + label14.Name = "label14"; + label14.Size = new System.Drawing.Size(94, 15); + label14.TabIndex = 12; + label14.Text = "Other Keywords:"; // // label13 // - this.label13.AutoSize = true; - this.label13.Location = new System.Drawing.Point(10, 88); - this.label13.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.label13.Name = "label13"; - this.label13.Size = new System.Drawing.Size(91, 15); - this.label13.TabIndex = 12; - this.label13.Text = "Create Timeout:"; + label13.AutoSize = true; + label13.Location = new System.Drawing.Point(10, 88); + label13.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + label13.Name = "label13"; + label13.Size = new System.Drawing.Size(91, 15); + label13.TabIndex = 12; + label13.Text = "Create Timeout:"; // // label9 // - this.label9.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.label9.AutoSize = true; - this.label9.Location = new System.Drawing.Point(318, 156); - this.label9.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.label9.Name = "label9"; - this.label9.Size = new System.Drawing.Size(564, 15); - this.label9.TabIndex = 8; - this.label9.Text = "(* Username and Password are Optional. If omitted then Integrated Security will " + - "be used - recommended)"; + label9.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right; + label9.AutoSize = true; + label9.Location = new System.Drawing.Point(318, 156); + label9.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + label9.Name = "label9"; + label9.Size = new System.Drawing.Size(564, 15); + label9.TabIndex = 8; + label9.Text = "(* Username and Password are Optional. If omitted then Integrated Security will be used - recommended)"; // // btnBack1 // - this.btnBack1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.btnBack1.Location = new System.Drawing.Point(8, 144); - this.btnBack1.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.btnBack1.Name = "btnBack1"; - this.btnBack1.Size = new System.Drawing.Size(88, 27); - this.btnBack1.TabIndex = 5; - this.btnBack1.Text = "<< Back"; - this.btnBack1.UseVisualStyleBackColor = true; - this.btnBack1.Click += new System.EventHandler(this.btnBack_Click); + btnBack1.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; + btnBack1.Location = new System.Drawing.Point(8, 144); + btnBack1.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + btnBack1.Name = "btnBack1"; + btnBack1.Size = new System.Drawing.Size(88, 27); + btnBack1.TabIndex = 5; + btnBack1.Text = "<< Back"; + btnBack1.UseVisualStyleBackColor = true; + btnBack1.Click += btnBack_Click; // // pResults // - this.pResults.Controls.Add(this.checksUI1); - this.pResults.Controls.Add(this.label2); - this.pResults.Location = new System.Drawing.Point(14, 223); - this.pResults.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.pResults.Name = "pResults"; - this.pResults.Size = new System.Drawing.Size(874, 473); - this.pResults.TabIndex = 16; + pResults.Controls.Add(checksUI1); + pResults.Controls.Add(label2); + pResults.Location = new System.Drawing.Point(14, 223); + pResults.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + pResults.Name = "pResults"; + pResults.Size = new System.Drawing.Size(874, 473); + pResults.TabIndex = 16; + // + // btnUseYamlFile + // + btnUseYamlFile.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right; + btnUseYamlFile.Location = new System.Drawing.Point(800, 32); + btnUseYamlFile.Name = "btnUseYamlFile"; + btnUseYamlFile.Size = new System.Drawing.Size(108, 23); + btnUseYamlFile.TabIndex = 10; + btnUseYamlFile.Text = "Use yaml File"; + btnUseYamlFile.UseVisualStyleBackColor = true; + btnUseYamlFile.Click += btnUseYamlFile_Click; // // ChoosePlatformDatabasesUI // - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(1477, 710); - this.Controls.Add(this.gbCreateNew); - this.Controls.Add(this.pChooseOption); - this.Controls.Add(this.gbUseExisting); - this.Controls.Add(this.pResults); - this.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.Name = "ChoosePlatformDatabasesUI"; - this.Text = "Platform Databases"; - this.KeyUp += new System.Windows.Forms.KeyEventHandler(this.ChooseDatabase_KeyUp); - this.gbUseExisting.ResumeLayout(false); - this.gbUseExisting.PerformLayout(); - this.pReferenceADataExport.ResumeLayout(false); - this.pReferenceADataExport.PerformLayout(); - this.pReferenceACatalogue.ResumeLayout(false); - this.pReferenceACatalogue.PerformLayout(); - this.pChooseOption.ResumeLayout(false); - this.pChooseOption.PerformLayout(); - this.gbCreateNew.ResumeLayout(false); - this.gbCreateNew.PerformLayout(); - this.gbSqlAuthentication.ResumeLayout(false); - this.gbSqlAuthentication.PerformLayout(); - this.gbExampleDatasets.ResumeLayout(false); - this.gbExampleDatasets.PerformLayout(); - this.pResults.ResumeLayout(false); - this.pResults.PerformLayout(); - this.ResumeLayout(false); - + AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + ClientSize = new System.Drawing.Size(1477, 710); + Controls.Add(gbCreateNew); + Controls.Add(pChooseOption); + Controls.Add(gbUseExisting); + Controls.Add(pResults); + Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + Name = "ChoosePlatformDatabasesUI"; + Text = "Platform Databases"; + KeyUp += ChooseDatabase_KeyUp; + gbUseExisting.ResumeLayout(false); + gbUseExisting.PerformLayout(); + pReferenceADataExport.ResumeLayout(false); + pReferenceADataExport.PerformLayout(); + pReferenceACatalogue.ResumeLayout(false); + pReferenceACatalogue.PerformLayout(); + pChooseOption.ResumeLayout(false); + pChooseOption.PerformLayout(); + gbCreateNew.ResumeLayout(false); + gbCreateNew.PerformLayout(); + gbSqlAuthentication.ResumeLayout(false); + gbSqlAuthentication.PerformLayout(); + gbExampleDatasets.ResumeLayout(false); + gbExampleDatasets.PerformLayout(); + pResults.ResumeLayout(false); + pResults.PerformLayout(); + ResumeLayout(false); } #endregion @@ -700,5 +706,6 @@ private void InitializeComponent() private System.Windows.Forms.Label label14; private System.Windows.Forms.Label label13; private System.Windows.Forms.GroupBox gbSqlAuthentication; + private System.Windows.Forms.Button btnUseYamlFile; } } \ No newline at end of file diff --git a/Rdmp.UI/LocationsMenu/ChoosePlatformDatabasesUI.cs b/Rdmp.UI/LocationsMenu/ChoosePlatformDatabasesUI.cs index 7b943af695..8d1318961d 100644 --- a/Rdmp.UI/LocationsMenu/ChoosePlatformDatabasesUI.cs +++ b/Rdmp.UI/LocationsMenu/ChoosePlatformDatabasesUI.cs @@ -1,4 +1,4 @@ -// Copyright (c) The University of Dundee 2018-2019 +// Copyright (c) The University of Dundee 2018-2024 // This file is part of the Research Data Management Platform (RDMP). // RDMP is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. // RDMP is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -25,6 +25,7 @@ using Rdmp.UI.ChecksUI; using Rdmp.UI.DataLoadUIs.ModuleUIs; using Rdmp.UI.SimpleDialogs; +using YamlDotNet.RepresentationModel; using YamlDotNet.Serialization; namespace Rdmp.UI.LocationsMenu; @@ -379,6 +380,45 @@ private void btnBack_Click(object sender, EventArgs e) SetState(State.PickNewOrExisting); } + private void btnUseYamlFile_Click(object sender, EventArgs e) + { + using var fb = new OpenFileDialog(); + var result = fb.ShowDialog(); + if (result == DialogResult.OK) + { + try + { + var location = new DirectoryInfo(fb.FileName); + using (var reader = new StreamReader(location.FullName)) + { + // Load the stream + var yaml = new YamlStream(); + yaml.Load(reader); + var docs = yaml.Documents.First().AllNodes.Select(n => n.ToString()); + string catalogueConnectionString = null; + string dataExportConnectionString = null; + foreach (var item in docs.Select((value, i) => new { i, value })) + { + var value = item.value; + + if (value == "CatalogueConnectionString") catalogueConnectionString = docs.ToList()[item.i + 1]; + if (value == "DataExportConnectionString") dataExportConnectionString = docs.ToList()[item.i + 1]; + } + if (catalogueConnectionString != null) tbCatalogueConnectionString.Text = catalogueConnectionString; + if (dataExportConnectionString != null) tbDataExportManagerConnectionString.Text = dataExportConnectionString; + + } + } + catch (Exception) + { + //Unable to parse yaml file + tbCatalogueConnectionString.Text = null; + tbDataExportManagerConnectionString.Text = null; + } + + }; + } + private void btnBrowseForCatalogue_Click(object sender, EventArgs e) { var dialog = new ServerDatabaseTableSelectorDialog("Catalogue Database", false, false, null); diff --git a/Rdmp.UI/LocationsMenu/ChoosePlatformDatabasesUI.resx b/Rdmp.UI/LocationsMenu/ChoosePlatformDatabasesUI.resx index f298a7be80..af32865ec1 100644 --- a/Rdmp.UI/LocationsMenu/ChoosePlatformDatabasesUI.resx +++ b/Rdmp.UI/LocationsMenu/ChoosePlatformDatabasesUI.resx @@ -1,4 +1,64 @@ - + + + diff --git a/Rdmp.UI/RichTextBoxEx.cs b/Rdmp.UI/RichTextBoxEx.cs index 9e85425284..f7fb25913b 100644 --- a/Rdmp.UI/RichTextBoxEx.cs +++ b/Rdmp.UI/RichTextBoxEx.cs @@ -47,13 +47,13 @@ private struct CHARFORMAT2_STRUCT public byte bReserved1; } - [LibraryImport("user32.dll")] + [LibraryImport("user32.dll", SetLastError = true, EntryPoint = "SendMessageW", StringMarshalling = StringMarshalling.Utf16)] private static partial IntPtr SendMessage(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam); private const int WM_USER = 0x0400; private const int EM_GETCHARFORMAT = WM_USER + 58; private const int EM_SETCHARFORMAT = WM_USER + 68; - + private const int SCF_SELECTION = 0x0001; private const int SCF_WORD = 0x0002; private const int SCF_ALL = 0x0004; diff --git a/Rdmp.UI/SimpleControls/ObjectSaverButton.cs b/Rdmp.UI/SimpleControls/ObjectSaverButton.cs index 4f13b38999..03bd2fcdaa 100644 --- a/Rdmp.UI/SimpleControls/ObjectSaverButton.cs +++ b/Rdmp.UI/SimpleControls/ObjectSaverButton.cs @@ -1,4 +1,4 @@ -// Copyright (c) The University of Dundee 2018-2019 +// Copyright (c) The University of Dundee 2018-2024 // This file is part of the Research Data Management Platform (RDMP). // RDMP is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. // RDMP is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -237,4 +237,6 @@ public void CheckForUnsavedChangesAnOfferToSave() else _o.RevertToDatabaseState(); } + + public bool IsEnabled => _isEnabled; } \ No newline at end of file diff --git a/Rdmp.UI/SimpleControls/ServerDatabaseTableSelector.cs b/Rdmp.UI/SimpleControls/ServerDatabaseTableSelector.cs index c2b62d1993..150217a752 100644 --- a/Rdmp.UI/SimpleControls/ServerDatabaseTableSelector.cs +++ b/Rdmp.UI/SimpleControls/ServerDatabaseTableSelector.cs @@ -10,6 +10,7 @@ using System.Data.Common; using System.Linq; using System.Threading; +using System.Threading.Tasks; using System.Windows.Forms; using FAnsi; using FAnsi.Discovery; @@ -189,7 +190,8 @@ private void UpdateDatabaseListAsync(object sender, DoWorkEventArgs e) _workerRefreshDatabasesToken = new CancellationTokenSource(); try { - _listDatabasesAsyncResult = _helper.ListDatabasesAsync(builder, _workerRefreshDatabasesToken.Token); + _listDatabasesAsyncResult = _helper.ListDatabasesAsync(builder, _workerRefreshDatabasesToken.Token) + .ToBlockingEnumerable(_workerRefreshDatabasesToken.Token).ToArray(); } catch (OperationCanceledException) { diff --git a/Rdmp.UI/SimpleDialogs/ConfigurePrimaryKeyCollisionResolverUI.cs b/Rdmp.UI/SimpleDialogs/ConfigurePrimaryKeyCollisionResolverUI.cs index 8fb84dcbb7..6802272fc3 100644 --- a/Rdmp.UI/SimpleDialogs/ConfigurePrimaryKeyCollisionResolverUI.cs +++ b/Rdmp.UI/SimpleDialogs/ConfigurePrimaryKeyCollisionResolverUI.cs @@ -362,6 +362,6 @@ private bool AllAreSameDirection() .Count() == 1; //if count of distinct directions is 1 then they are all in the same direction } - [LibraryImport("user32.dll")] + [LibraryImport("user32.dll", SetLastError = true, EntryPoint = "GetScrollPosW", StringMarshalling = StringMarshalling.Utf16)] private static partial int GetScrollPos(IntPtr hWnd, Orientation nBar); } \ No newline at end of file diff --git a/Rdmp.UI/SimpleDialogs/Reports/DataGeneratorUI.cs b/Rdmp.UI/SimpleDialogs/Reports/DataGeneratorUI.cs index da1a45cd80..55a01375fb 100644 --- a/Rdmp.UI/SimpleDialogs/Reports/DataGeneratorUI.cs +++ b/Rdmp.UI/SimpleDialogs/Reports/DataGeneratorUI.cs @@ -8,8 +8,8 @@ using System.IO; using System.Threading; using System.Windows.Forms; -using BadMedicine; -using BadMedicine.Datasets; +using SynthEHR; +using SynthEHR.Datasets; namespace Rdmp.UI.SimpleDialogs.Reports; diff --git a/Rdmp.UI/SimpleDialogs/Reports/GenerateTestDataUI.cs b/Rdmp.UI/SimpleDialogs/Reports/GenerateTestDataUI.cs index 2f03de650f..ebd0b00d07 100644 --- a/Rdmp.UI/SimpleDialogs/Reports/GenerateTestDataUI.cs +++ b/Rdmp.UI/SimpleDialogs/Reports/GenerateTestDataUI.cs @@ -10,8 +10,8 @@ using System.IO; using System.Linq; using System.Windows.Forms; -using BadMedicine; -using BadMedicine.Datasets; +using SynthEHR; +using SynthEHR.Datasets; using Rdmp.Core.CommandExecution; using Rdmp.UI.ItemActivation; using Rdmp.UI.TestsAndSetup.ServicePropogation; diff --git a/Rdmp.UI/SimpleDialogs/UserSettingsUI.Designer.cs b/Rdmp.UI/SimpleDialogs/UserSettingsUI.Designer.cs index 2de66db057..acec818087 100644 --- a/Rdmp.UI/SimpleDialogs/UserSettingsUI.Designer.cs +++ b/Rdmp.UI/SimpleDialogs/UserSettingsUI.Designer.cs @@ -93,6 +93,7 @@ private void InitializeComponent() userSettingsToolTips = new System.Windows.Forms.ToolTip(components); tbFind = new System.Windows.Forms.TextBox(); label14 = new System.Windows.Forms.Label(); + cbPromptFilterRename = new System.Windows.Forms.CheckBox(); groupBox1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)olvErrorCodes).BeginInit(); groupBox2.SuspendLayout(); @@ -521,6 +522,7 @@ private void InitializeComponent() // // groupBox8 // + groupBox8.Controls.Add(cbPromptFilterRename); groupBox8.Controls.Add(cbExpandAllInCohortBuilder); groupBox8.Controls.Add(cbStrictValidationForCohortBuilderContainers); groupBox8.Controls.Add(cbShowCohortWizard); @@ -766,6 +768,18 @@ private void InitializeComponent() label14.TabIndex = 26; label14.Text = "Find Setting:"; // + // cbPromptFilterRename + // + cbPromptFilterRename.AutoSize = true; + cbPromptFilterRename.Checked = true; + cbPromptFilterRename.CheckState = System.Windows.Forms.CheckState.Checked; + cbPromptFilterRename.Location = new System.Drawing.Point(6, 89); + cbPromptFilterRename.Name = "cbPromptFilterRename"; + cbPromptFilterRename.Size = new System.Drawing.Size(222, 19); + cbPromptFilterRename.TabIndex = 4; + cbPromptFilterRename.Text = "Prompt For Rename on Filter Change"; + cbPromptFilterRename.UseVisualStyleBackColor = true; + // // UserSettingsFileUI // AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); @@ -870,5 +884,6 @@ private void InitializeComponent() private System.Windows.Forms.CheckBox cbUseLocalFileSystem; private System.Windows.Forms.Label label16; private System.Windows.Forms.TextBox tbLogLocation; + private System.Windows.Forms.CheckBox cbPromptFilterRename; } } \ No newline at end of file diff --git a/Rdmp.UI/SimpleDialogs/UserSettingsUI.cs b/Rdmp.UI/SimpleDialogs/UserSettingsUI.cs index d69e474228..8b1a46032f 100644 --- a/Rdmp.UI/SimpleDialogs/UserSettingsUI.cs +++ b/Rdmp.UI/SimpleDialogs/UserSettingsUI.cs @@ -1,4 +1,4 @@ -// Copyright (c) The University of Dundee 2018-2019 +// Copyright (c) The University of Dundee 2018-2024 // This file is part of the Research Data Management Platform (RDMP). // RDMP is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. // RDMP is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -103,6 +103,7 @@ public UserSettingsFileUI(IActivateItems activator) RegisterCheckbox(cbAlwaysJoinEverything, nameof(UserSettings.AlwaysJoinEverything)); RegisterCheckbox(cbAutoRunSqlQueries, nameof(UserSettings.AutoRunSqlQueries)); RegisterCheckbox(cbExpandAllInCohortBuilder, nameof(UserSettings.ExpandAllInCohortBuilder)); + RegisterCheckbox(cbPromptFilterRename, nameof(UserSettings.PromptRenameOnCohortFilterChange)); RegisterCheckbox(cbUseAliasInsteadOfTransformInGroupByAggregateGraphs, nameof(UserSettings.UseAliasInsteadOfTransformInGroupByAggregateGraphs)); RegisterCheckbox(cbUseLocalFileSystem, nameof(UserSettings.UseLocalFileSystem)); diff --git a/Rdmp.UI/SimpleDialogs/WideMessageBox.cs b/Rdmp.UI/SimpleDialogs/WideMessageBox.cs index 4c3d296266..7c1601df18 100644 --- a/Rdmp.UI/SimpleDialogs/WideMessageBox.cs +++ b/Rdmp.UI/SimpleDialogs/WideMessageBox.cs @@ -68,7 +68,7 @@ public WideMessageBox(WideMessageBoxArgs args) //can only write to clipboard in STA threads btnCopyToClipboard.Visible = Thread.CurrentThread.GetApartmentState() == ApartmentState.STA; - btnViewStackTrace.Visible = true; + btnViewStackTrace.Visible = args.Theme == WideMessageBoxTheme.Exception; //try to resize form to fit bounds Size = GetPreferredSizeOfTextControl(richTextBox1); diff --git a/Rdmp.UI/TestsAndSetup/ServicePropogation/RDMPSingleDatabaseObjectControl.cs b/Rdmp.UI/TestsAndSetup/ServicePropogation/RDMPSingleDatabaseObjectControl.cs index 0e6b457d36..ebb4de7600 100644 --- a/Rdmp.UI/TestsAndSetup/ServicePropogation/RDMPSingleDatabaseObjectControl.cs +++ b/Rdmp.UI/TestsAndSetup/ServicePropogation/RDMPSingleDatabaseObjectControl.cs @@ -1,4 +1,4 @@ -// Copyright (c) The University of Dundee 2018-2019 +// Copyright (c) The University of Dundee 2018-2024 // This file is part of the Research Data Management Platform (RDMP). // RDMP is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. // RDMP is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -12,7 +12,12 @@ using Rdmp.Core.CommandExecution; using Rdmp.Core.CommandExecution.AtomicCommands; using Rdmp.Core.Curation.Data; +using Rdmp.Core.Curation.Data.Aggregation; +using Rdmp.Core.Curation.Data.Cohort; using Rdmp.Core.MapsDirectlyToDatabaseTable; +using Rdmp.Core.Repositories; +using Rdmp.Core.ReusableLibraryCode.Settings; +using Rdmp.UI.ExtractionUIs.FilterUIs; using Rdmp.UI.ItemActivation; using Rdmp.UI.Refreshing; using Rdmp.UI.Rules; @@ -128,6 +133,11 @@ public virtual void SetDatabaseObject(IActivateItems activator, T databaseObject ObjectSaverButton1.BeforeSave += BeforeSave_FinishCommitInProgressIfAny; ObjectSaverButton1.AfterSave += AfterSave_BeginNewCommitIfApplicable; } + if (this.GetType() == typeof(ExtractionFilterUI) && UserSettings.PromptRenameOnCohortFilterChange) + { + ObjectSaverButton1.BeforeSave -= BeforeSave_PromptRenameOfExtractionFilterContainer; + ObjectSaverButton1.BeforeSave += BeforeSave_PromptRenameOfExtractionFilterContainer; + } ObjectSaverButton1.SetupFor(this, databaseObject, activator); } @@ -141,6 +151,32 @@ public virtual void SetDatabaseObject(IActivateItems activator, T databaseObject } } + protected bool BeforeSave_PromptRenameOfExtractionFilterContainer(DatabaseEntity _) + { + if (!ObjectSaverButton1.IsEnabled) return true; + AggregateFilter af; + try + { + af = (AggregateFilter)_; + } + catch (Exception) + { + //DatabaseEntity was not an aggregateFilter + return true; + } + AggregateFilterContainer afc = af.CatalogueRepository.GetAllObjectsWhere("ID", af.FilterContainer_ID).FirstOrDefault(); + if (afc != null) + { + AggregateConfiguration ac = afc.GetAggregate(); + if (ac != null) + { + var rename = new ExecuteCommandRename(Activator, ac); + rename.Execute(); + } + } + return true; + } + protected bool BeforeSave_FinishCommitInProgressIfAny(DatabaseEntity _) { @@ -308,6 +344,7 @@ protected override void Dispose(bool disposing) if (ObjectSaverButton1 != null) { ObjectSaverButton1.BeforeSave -= BeforeSave_FinishCommitInProgressIfAny; + ObjectSaverButton1.BeforeSave -= BeforeSave_PromptRenameOfExtractionFilterContainer; ObjectSaverButton1.AfterSave -= AfterSave_BeginNewCommitIfApplicable; } } diff --git a/Rdmp.UI/TransparentHelpSystem/TransparentHelpForm.cs b/Rdmp.UI/TransparentHelpSystem/TransparentHelpForm.cs index 8f9c97c536..0a245b0c50 100644 --- a/Rdmp.UI/TransparentHelpSystem/TransparentHelpForm.cs +++ b/Rdmp.UI/TransparentHelpSystem/TransparentHelpForm.cs @@ -22,7 +22,7 @@ public partial class TransparentHelpForm : Form private readonly Control _host; private Control _highlight; - [LibraryImport("user32.dll", SetLastError = true)] + [LibraryImport("user32.dll", SetLastError = true, EntryPoint = "ShowWindowW", StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] private static partial bool ShowWindow(IntPtr hWnd, int nCmdShow); diff --git a/SharedAssemblyInfo.cs b/SharedAssemblyInfo.cs index bd9a535fe3..706372d65a 100644 --- a/SharedAssemblyInfo.cs +++ b/SharedAssemblyInfo.cs @@ -10,6 +10,6 @@ [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -[assembly: AssemblyVersion("8.1.5")] -[assembly: AssemblyFileVersion("8.1.5")] -[assembly: AssemblyInformationalVersion("8.1.5")] +[assembly: AssemblyVersion("8.1.6")] +[assembly: AssemblyFileVersion("8.1.6")] +[assembly: AssemblyInformationalVersion("8.1.6")] diff --git a/Tests.Common/Scenarios/BulkTestsData.cs b/Tests.Common/Scenarios/BulkTestsData.cs index 250bb66478..5b3f1f064b 100644 --- a/Tests.Common/Scenarios/BulkTestsData.cs +++ b/Tests.Common/Scenarios/BulkTestsData.cs @@ -7,8 +7,8 @@ using System; using System.Data; using System.Linq; -using BadMedicine; -using BadMedicine.Datasets; +using SynthEHR; +using SynthEHR.Datasets; using FAnsi.Discovery; using Rdmp.Core.Curation; using Rdmp.Core.Curation.Data; diff --git a/Tests.Common/Scenarios/TestsRequiringA.cs b/Tests.Common/Scenarios/TestsRequiringA.cs index a337056a7e..4776022c63 100644 --- a/Tests.Common/Scenarios/TestsRequiringA.cs +++ b/Tests.Common/Scenarios/TestsRequiringA.cs @@ -7,8 +7,8 @@ using System; using System.Collections.Generic; using System.Linq; -using BadMedicine; -using BadMedicine.Datasets; +using SynthEHR; +using SynthEHR.Datasets; using FAnsi.Discovery; using FAnsi.Discovery.TableCreation; using Rdmp.Core.Curation.Data; diff --git a/Tests.Common/Scenarios/TestsRequiringADle.cs b/Tests.Common/Scenarios/TestsRequiringADle.cs index 2afd38f535..a11bdc1f74 100644 --- a/Tests.Common/Scenarios/TestsRequiringADle.cs +++ b/Tests.Common/Scenarios/TestsRequiringADle.cs @@ -4,8 +4,8 @@ // RDMP is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. // You should have received a copy of the GNU General Public License along with RDMP. If not, see . -using BadMedicine; -using BadMedicine.Datasets; +using SynthEHR; +using SynthEHR.Datasets; using FAnsi.Discovery; using NUnit.Framework; using Rdmp.Core.CommandLine.Options; diff --git a/directory.build.props b/directory.build.props index 44541712ba..5daa1d1147 100644 --- a/directory.build.props +++ b/directory.build.props @@ -1,7 +1,7 @@ 11.0 - 8.1.5 + 8.1.4 true \ No newline at end of file diff --git a/rdmp-client.xml b/rdmp-client.xml index 9ead7676a0..c0a16d535d 100644 --- a/rdmp-client.xml +++ b/rdmp-client.xml @@ -1,7 +1,7 @@ - 8.1.4.0 - https://github.com/HicServices/RDMP/releases/download/v8.1.4/rdmp-8.1.4-client.zip + 8.1.6.0 + https://github.com/HicServices/RDMP/releases/download/v8.1.6/rdmp-8.1.6-client.zip https://github.com/HicServices/RDMP/blob/main/CHANGELOG.md#7 true \ No newline at end of file