Skip to content
Draft
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
165 commits
Select commit Hold shift + click to select a range
da6f3bf
start to add dataste providers
JFriel Apr 25, 2025
9f7a04e
update icons
JFriel Apr 25, 2025
3adaffc
fix tests
JFriel Apr 25, 2025
e7dbbf3
fix patch
JFriel Apr 25, 2025
eb38289
tidy up
JFriel Apr 25, 2025
ee442b6
add documentation
JFriel Apr 25, 2025
ddca36a
fix up tests
JFriel Apr 25, 2025
5772a07
update help text
JFriel Apr 25, 2025
f0ed05f
fix patch
JFriel Apr 25, 2025
c6ac672
remove constraint
JFriel Apr 25, 2025
1196e88
add missing command
JFriel Apr 28, 2025
c95d556
fix ids
JFriel Apr 28, 2025
938e0a0
fix build
JFriel Apr 28, 2025
fe1297a
fix tests
JFriel Apr 28, 2025
1ae5332
add provider edit
JFriel Apr 28, 2025
dfc492c
add linkage
JFriel Apr 28, 2025
1f36e5f
fix instance create
JFriel Apr 28, 2025
582c7d6
add http clinet to provider
JFriel Apr 28, 2025
e912c61
fix tests
JFriel Apr 28, 2025
d7af0a7
fix update
JFriel Apr 28, 2025
853d2b7
fix update
JFriel Apr 28, 2025
1669334
add generic dataset provider ui
JFriel Apr 29, 2025
c975ab8
fix return types
JFriel Apr 29, 2025
1ec74e1
fix autoupdate
JFriel Apr 29, 2025
f51be91
fix update
JFriel Apr 29, 2025
7cb508b
remove unused function
JFriel Apr 30, 2025
5c6e6c1
fix split regex
JFriel Apr 30, 2025
aa47b8b
fix up
JFriel May 1, 2025
fdaee38
tidy up
JFriel May 6, 2025
4ea67a4
fix up ui
JFriel May 6, 2025
b247ca3
tidy up and add tests
JFriel May 6, 2025
c4ac978
fix abstract
JFriel May 6, 2025
e99cc19
add view
JFriel May 6, 2025
fee8ade
add virtual
JFriel May 6, 2025
c94b115
add tests
JFriel May 12, 2025
e8423f0
add basic dataset variable document
JFriel Jun 25, 2025
bffe9f8
improve lookups
JFriel Jun 25, 2025
4692bd6
speed up catalogues
JFriel Jul 24, 2025
94f28ab
cohorts ui
JFriel Jul 24, 2025
d39978d
more speed improvements
JFriel Jul 24, 2025
fe389a1
tidy up
JFriel Jul 24, 2025
2b206d8
fix us tests
JFriel Jul 28, 2025
f69c43d
tidy up tests
JFriel Jul 28, 2025
289284c
tidy up code
JFriel Jul 28, 2025
cf8ddfc
Merge branch 'feature/datasets' of https://github.com/HicServices/RDM…
JFriel Jul 28, 2025
11ce148
update version name
JFriel Jul 28, 2025
10b7c50
fix test
JFriel Jul 28, 2025
5939577
Potential fix for code scanning alert no. 12121: Virtual call in cons…
JFriel Jul 28, 2025
ea43a8b
update shared assembly
JFriel Jul 28, 2025
1c077ba
Merge branch 'task/rdmp-323-right-click' of https://github.com/HicSer…
JFriel Jul 28, 2025
5695040
Merge pull request #2215 from HicServices/task/rdmp-323-right-click
rdteviotdale Jul 28, 2025
bca043d
add handling for orphaned filters
JFriel Jul 30, 2025
9a056bb
add changelog
JFriel Jul 30, 2025
c26698c
Merge pull request #2217 from HicServices/task/fix-menu-nor-load
rdteviotdale Jul 30, 2025
69d73b4
revert filter finder
JFriel Jul 31, 2025
494b2e8
bump deps
JFriel Jul 31, 2025
b340ad6
Merge pull request #2218 from HicServices/task/RDMP-323-improve-right…
bpeacock001 Jul 31, 2025
b469c4f
update changelog
JFriel Jul 31, 2025
1794a07
Merge pull request #2219 from HicServices/task/prep-9.0.1
bpeacock001 Jul 31, 2025
9266201
add remote sql executer
JFriel Aug 20, 2025
ff32bcb
Merge pull request #2227 from HicServices/task/RDMP-331-post-load-sql…
rdteviotdale Sep 5, 2025
52560b8
Task/rdmp 294 improve logging display (#2160)
JFriel Sep 5, 2025
f77576e
allow use of cic filters in extractions (#2221)
JFriel Sep 5, 2025
bba73a1
RDMP-315 Flag Log view (#2222)
JFriel Sep 5, 2025
1921b17
Merge branch 'develop' of https://github.com/HicServices/RDMP into ta…
JFriel Sep 15, 2025
cb96938
add basic test
JFriel Sep 15, 2025
21204f3
expect file
JFriel Sep 15, 2025
382670a
better handling
JFriel Sep 15, 2025
2df76b4
tidy up code
JFriel Sep 15, 2025
bfab55b
Merge pull request #2234 from HicServices/task/RDMP-320-dataset-varia…
rdteviotdale Sep 17, 2025
d707f7d
remove cold storage
JFriel Sep 26, 2025
181e535
re-add catalogue filter
JFriel Sep 26, 2025
2ee7903
remove ui non extractable filter
JFriel Sep 26, 2025
2a59d04
add make internal
JFriel Sep 26, 2025
5776bc1
cohort selection
JFriel Sep 26, 2025
fb71c1c
limit extractions
JFriel Sep 26, 2025
617008d
remove extractability change
JFriel Sep 26, 2025
77b6aeb
add try catch
JFriel Sep 29, 2025
c8013d8
bump runner
JFriel Sep 29, 2025
1731aa6
add key
JFriel Sep 29, 2025
45b9ee3
add quotes
JFriel Sep 29, 2025
9026dbf
tidy up
JFriel Sep 29, 2025
e8b8a27
update key
JFriel Sep 29, 2025
431b42f
add env
JFriel Sep 29, 2025
29093ab
remove here string
JFriel Sep 29, 2025
5938de0
tidy up build
JFriel Sep 29, 2025
0d27544
more env setting
JFriel Sep 29, 2025
ce441fa
add for tests
JFriel Sep 29, 2025
c63a66d
update key location
JFriel Sep 29, 2025
5c5d054
use correct drive
JFriel Sep 29, 2025
0b062ca
use temp
JFriel Sep 29, 2025
7ae0d78
use temp
JFriel Sep 29, 2025
d626f4e
updaye build
JFriel Sep 29, 2025
8c6d6c2
tidy up
JFriel Sep 29, 2025
c0af3f9
add changelog
JFriel Oct 2, 2025
24e993c
update from codeql
JFriel Oct 2, 2025
f9e424b
fix build
JFriel Oct 2, 2025
121c340
fix project specific
JFriel Oct 2, 2025
2d67e33
Merge pull request #2237 from HicServices/task/RDMP-334-extractability
rdteviotdale Oct 2, 2025
f883190
Task/rdmp 333 export catalogues to confluence (#2238)
JFriel Oct 13, 2025
c784a90
Move RSA Loading to runtime (#2240)
JFriel Oct 13, 2025
2fa9584
Task/rdmp 339 prep v9.0.3 (#2242)
JFriel Oct 21, 2025
5b63c3c
Allow RSA keys to be accessed via network shares (#2245)
JFriel Oct 21, 2025
e363c41
add safer default pipeline
JFriel Oct 24, 2025
4cae2db
add changelog
JFriel Oct 24, 2025
14882b4
add changerlog
JFriel Oct 24, 2025
229ecfd
tidy up
JFriel Oct 24, 2025
6120e97
revert confluence
JFriel Oct 24, 2025
5482fd8
Merge pull request #2246 from HicServices/bugfix/RDMP-335-use-deleted…
rdteviotdale Oct 24, 2025
45a7c90
proep for 9.0.3 release
JFriel Nov 3, 2025
44dd01a
improve project specific handling
JFriel Nov 3, 2025
b9c49a7
Merge pull request #2252 from HicServices/task/CM-674-prep
rdteviotdale Nov 3, 2025
502ed75
update tests
JFriel Nov 3, 2025
a60bb30
Merge pull request #2253 from HicServices/task/RDMP-341-harden-projec…
rdteviotdale Nov 3, 2025
8bbfaa4
Merge branch 'develop' of https://github.com/HicServices/RDMP into ta…
JFriel Nov 5, 2025
df21b52
update tests
JFriel Nov 5, 2025
b011c9b
add todo
JFriel Nov 5, 2025
59e8b8d
[Bugfix] Distinct Selectables (#2235)
JFriel Nov 6, 2025
b0b004b
Bump actions/setup-dotnet from 4.3.1 to 5.0.0 (#2230)
dependabot[bot] Nov 6, 2025
af171d9
Bump github/codeql-action from 3 to 4 (#2241)
dependabot[bot] Nov 6, 2025
eee3bf5
Bump shogo82148/actions-setup-perl from 1.34.0 to 1.36.0 (#2247)
dependabot[bot] Nov 6, 2025
b7228db
Bump actions/checkout from 4 to 5 (#2226)
dependabot[bot] Nov 6, 2025
b5a71a5
add flat view toggle
JFriel Nov 6, 2025
4f08be9
add ui
JFriel Nov 10, 2025
819a6ce
add icon
JFriel Nov 10, 2025
8c154c7
add node
JFriel Nov 10, 2025
98325b5
add icon
JFriel Nov 10, 2025
50f9e96
add use commands
JFriel Nov 10, 2025
258ccb7
improved project template nodes
JFriel Nov 10, 2025
20d5680
add db patch
JFriel Nov 10, 2025
ecf81ad
add other mapping
JFriel Nov 11, 2025
e014319
Merge branch 'develop' into task/RDMP-334-flat-view
JFriel Nov 11, 2025
ab34897
update readonly check and docs
JFriel Nov 11, 2025
17459c8
improve template namer
JFriel Nov 11, 2025
af34f39
add tests
JFriel Nov 11, 2025
e416951
update version number
JFriel Nov 11, 2025
2aa7efd
codeql updates
JFriel Nov 11, 2025
a1dd0ee
fix test
JFriel Nov 11, 2025
0a1decd
add missing documentation
JFriel Nov 11, 2025
3de5ae1
tidy up from review
JFriel Nov 11, 2025
79b15a9
update docs
JFriel Nov 11, 2025
8bad511
update docs
JFriel Nov 11, 2025
d216ae7
add links
JFriel Nov 11, 2025
c6a06ba
update delete commit requirements
JFriel Nov 12, 2025
5079de6
tidy up
JFriel Nov 14, 2025
083f681
Merge pull request #2255 from HicServices/task/RDMP-334-flat-view
rdteviotdale Nov 14, 2025
bbd9738
prevent drag and drop
JFriel Nov 17, 2025
bf4bdb4
update cic clone
JFriel Nov 17, 2025
ae31de5
cohort sets
JFriel Nov 17, 2025
e96f74f
Merge branch 'develop' into bugfix/RDMP-336-delete-log-message
JFriel Nov 17, 2025
830730b
codeql
JFriel Nov 17, 2025
8fe70d8
Merge pull request #2263 from HicServices/bugfix/RDMP-345-internal-ca…
rdteviotdale Nov 18, 2025
1254b13
Merge pull request #2262 from HicServices/bugfix/RDMP-336-delete-log-…
rdteviotdale Nov 18, 2025
46bf722
Merge branch 'develop' into task/RDMP-342-cic-templates
JFriel Nov 18, 2025
c65317d
Merge pull request #2260 from HicServices/task/RDMP-342-cic-templates
rdteviotdale Nov 18, 2025
1464eea
Task/rdmp 343 Cross-Project Commits Flow (#2261)
JFriel Nov 19, 2025
3327a31
Task/rdmp 328 extraction archive triggers (#2254)
JFriel Nov 19, 2025
bd1abfe
Prep v9.1.0 (#2272)
JFriel Nov 24, 2025
00a3e53
allow service workers
JFriel Nov 25, 2025
a4d245f
update confluence builder
JFriel Nov 25, 2025
bcedcc1
add changelog
JFriel Nov 25, 2025
8822be4
Update ExecuteCommandExportCataloguesToConfluence.cs
JFriel Nov 26, 2025
6acbe45
Merge pull request #2275 from HicServices/task/confluence-service-worker
rdteviotdale Nov 26, 2025
4fcaf9d
prep release (#2281)
JFriel Dec 2, 2025
ca03270
Merge branch 'develop' of https://github.com/HicServices/RDMP into ta…
JFriel Dec 9, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public void TestDatasetCreationOKExtendedParameters()
{
var cmd = new ExecuteCommandCreateDataset(GetMockActivator(), "dataset2","somedoi","some source");
Assert.DoesNotThrow(cmd.Execute);
var founddataset = GetMockActivator().RepositoryLocator.CatalogueRepository.GetAllObjects<Core.Curation.Data.Dataset>().First(static ds => ds.Name == "dataset2" && ds.DigitalObjectIdentifier == "somedoi" && ds.Source == "some source");
var founddataset = GetMockActivator().RepositoryLocator.CatalogueRepository.GetAllObjects<Core.Curation.Data.Datasets.Dataset>().First(static ds => ds.Name == "dataset2" && ds.DigitalObjectIdentifier == "somedoi" && ds.Source == "some source");
Assert.That(founddataset,Is.Not.Null);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@ public void TestDeleteExistingDataset()
{
var cmd = new ExecuteCommandCreateDataset(GetMockActivator(), "dataset");
Assert.DoesNotThrow(() => cmd.Execute());
Assert.That(GetMockActivator().RepositoryLocator.CatalogueRepository.GetAllObjects<Rdmp.Core.Curation.Data.Dataset>(), Has.Length.EqualTo(1));
var founddataset = GetMockActivator().RepositoryLocator.CatalogueRepository.GetAllObjects<Core.Curation.Data.Dataset>().First(static ds => ds.Name == "dataset");
Assert.That(GetMockActivator().RepositoryLocator.CatalogueRepository.GetAllObjects<Core.Curation.Data.Datasets.Dataset>(), Has.Length.EqualTo(1));
var founddataset = GetMockActivator().RepositoryLocator.CatalogueRepository.GetAllObjects<Core.Curation.Data.Datasets.Dataset>().First(static ds => ds.Name == "dataset");
var delCmd = new ExecuteCommandDeleteDataset(GetMockActivator(), founddataset);
Assert.DoesNotThrow(() => delCmd.Execute());
Assert.That(GetMockActivator().RepositoryLocator.CatalogueRepository.GetAllObjects<Rdmp.Core.Curation.Data.Dataset>(), Is.Empty);
Assert.That(GetMockActivator().RepositoryLocator.CatalogueRepository.GetAllObjects<Core.Curation.Data.Datasets.Dataset>(), Is.Empty);
}

[Test]
public void TestDeleteNonExistantDataset()
{
Assert.That(GetMockActivator().RepositoryLocator.CatalogueRepository.GetAllObjects<Rdmp.Core.Curation.Data.Dataset>(), Is.Empty);
var founddataset = new Core.Curation.Data.Dataset();
Assert.That(GetMockActivator().RepositoryLocator.CatalogueRepository.GetAllObjects<Core.Curation.Data.Datasets.Dataset>(), Is.Empty);
var founddataset = new Core.Curation.Data.Datasets.Dataset();
var delCmd = new ExecuteCommandDeleteDataset(GetMockActivator(), founddataset);
Assert.Throws<NullReferenceException>(() => delCmd.Execute());
Assert.That(GetMockActivator().RepositoryLocator.CatalogueRepository.GetAllObjects<Rdmp.Core.Curation.Data.Dataset>(), Is.Empty);
Assert.That(GetMockActivator().RepositoryLocator.CatalogueRepository.GetAllObjects<Core.Curation.Data.Datasets.Dataset>(), Is.Empty);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,10 @@ public void TestLinkCatalogueToDataset()

var cmd = new ExecuteCommandCreateDataset(GetMockActivator(), "dataset");
Assert.DoesNotThrow(cmd.Execute);
var founddataset = GetMockActivator().RepositoryLocator.CatalogueRepository.GetAllObjects<Core.Curation.Data.Dataset>().First();
var founddataset = GetMockActivator().RepositoryLocator.CatalogueRepository.GetAllObjects<Core.Curation.Data.Datasets.Dataset>().First();
var foundCatalogue = GetMockActivator().RepositoryLocator.CatalogueRepository.GetAllObjects<Catalogue>().First(static c => c.Name == "Dataset1");
var linkCmd = new ExecuteCommandLinkCatalogueToDataset(GetMockActivator(), foundCatalogue, founddataset);
Assert.DoesNotThrow(linkCmd.Execute);
var columInfo = GetMockActivator().RepositoryLocator.CatalogueRepository.GetAllObjects<ColumnInfo>();
foreach (var ci in columInfo)
{
Assert.That(ci.Dataset_ID, Is.EqualTo(founddataset.ID));
}
founddataset.DeleteInDatabase();
foundCatalogue.DeleteInDatabase();

Expand Down Expand Up @@ -72,29 +67,17 @@ public void TestLinkCatalogueToDatasetNotAll()

var cmd = new ExecuteCommandCreateDataset(GetMockActivator(), "dataset");
Assert.DoesNotThrow(cmd.Execute);
var founddataset = GetMockActivator().RepositoryLocator.CatalogueRepository.GetAllObjects<Core.Curation.Data.Dataset>().First();
var founddataset = GetMockActivator().RepositoryLocator.CatalogueRepository.GetAllObjects<Core.Curation.Data.Datasets.Dataset>().First();
var foundCatalogue = GetMockActivator().RepositoryLocator.CatalogueRepository.GetAllObjects<Catalogue>().First(c => c.Name == "Dataset1");
var linkCmd = new ExecuteCommandLinkCatalogueToDataset(GetMockActivator(), foundCatalogue, founddataset, false);
Assert.DoesNotThrow(linkCmd.Execute);
var columInfo = GetMockActivator().RepositoryLocator.CatalogueRepository.GetAllObjects<CatalogueItem>().Where(ci => _cata1.CatalogueItems.Contains(ci));
foreach (var ci in columInfo)
{
Assert.That(ci.ColumnInfo.Dataset_ID, Is.EqualTo(founddataset.ID));
}

var columInfo2 = GetMockActivator().RepositoryLocator.CatalogueRepository.GetAllObjects<CatalogueItem>().Where(ci => _cata2.CatalogueItems.Contains(ci));
foreach (var ci in columInfo2)
{
Assert.That(ci.ColumnInfo.Dataset_ID, Is.Null);
}

}
[Test]
public void TestLinkCatalogueToDatasetBadCatalogue()
{
var cmd = new ExecuteCommandCreateDataset(GetMockActivator(), "dataset");
Assert.DoesNotThrow(cmd.Execute);
var founddataset = GetMockActivator().RepositoryLocator.CatalogueRepository.GetAllObjects<Core.Curation.Data.Dataset>().First();
var founddataset = GetMockActivator().RepositoryLocator.CatalogueRepository.GetAllObjects<Core.Curation.Data.Datasets.Dataset>().First();
var linkCmd = new ExecuteCommandLinkCatalogueToDataset(GetMockActivator(), null, founddataset, false);
Assert.Throws<ImpossibleCommandException>(linkCmd.Execute);
}
Expand All @@ -104,12 +87,12 @@ public void TestLinkCatalogueToDatasetBadDataset()
{
var cmd = new ExecuteCommandCreateDataset(GetMockActivator(), "dataset");
Assert.DoesNotThrow(cmd.Execute);
var founddataset = GetMockActivator().RepositoryLocator.CatalogueRepository.GetAllObjects<Core.Curation.Data.Dataset>().First();
var linkCmd = new ExecuteCommandLinkCatalogueToDataset(GetMockActivator(), new Catalogue(GetMockActivator().RepositoryLocator.CatalogueRepository,"catalogue"), null, false);
var founddataset = GetMockActivator().RepositoryLocator.CatalogueRepository.GetAllObjects<Core.Curation.Data.Datasets.Dataset>().First();
var linkCmd = new ExecuteCommandLinkCatalogueToDataset(GetMockActivator(), new Catalogue(GetMockActivator().RepositoryLocator.CatalogueRepository, "catalogue"), null, false);
Assert.Throws<ImpossibleCommandException>(linkCmd.Execute);
}

[Test]
[Test]
public void TestLinkCatalogueToDatasetBadEverything()
{
var linkCmd = new ExecuteCommandLinkCatalogueToDataset(GetMockActivator(), null, null, false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public void TestLinkColumnInfoToDataset()

var cmd = new ExecuteCommandCreateDataset(GetMockActivator(), "dataset");
Assert.DoesNotThrow(() => cmd.Execute());
var founddataset = GetMockActivator().RepositoryLocator.CatalogueRepository.GetAllObjects<Core.Curation.Data.Dataset>().First();
var founddataset = GetMockActivator().RepositoryLocator.CatalogueRepository.GetAllObjects<Core.Curation.Data.Datasets.Dataset>().First();
var linkCmd = new ExecuteCommandLinkColumnInfoToDataset(GetMockActivator(), _c1, founddataset);
Assert.DoesNotThrow(() => linkCmd.Execute());
var columInfo = GetMockActivator().RepositoryLocator.CatalogueRepository.GetAllObjects<ColumnInfo>();
Expand Down Expand Up @@ -67,7 +67,7 @@ public void TestLinkColumnInfoToDatasetNotAll()

var cmd = new ExecuteCommandCreateDataset(GetMockActivator(), "dataset");
Assert.DoesNotThrow(() => cmd.Execute());
var founddataset = GetMockActivator().RepositoryLocator.CatalogueRepository.GetAllObjects<Core.Curation.Data.Dataset>().First();
var founddataset = GetMockActivator().RepositoryLocator.CatalogueRepository.GetAllObjects<Core.Curation.Data.Datasets.Dataset>().First();
var linkCmd = new ExecuteCommandLinkColumnInfoToDataset(GetMockActivator(), _c1, founddataset, false);
Assert.DoesNotThrow(() => linkCmd.Execute());
var columInfo = GetMockActivator().RepositoryLocator.CatalogueRepository.GetAllObjects<CatalogueItem>().Where(ci => _cata1.CatalogueItems.Contains(ci));
Expand All @@ -87,7 +87,7 @@ public void TestLinkCatalogueToDatasetBadColumnInfo()
{
var cmd = new ExecuteCommandCreateDataset(GetMockActivator(), "dataset");
Assert.DoesNotThrow(() => cmd.Execute());
var founddataset = GetMockActivator().RepositoryLocator.CatalogueRepository.GetAllObjects<Core.Curation.Data.Dataset>().First();
var founddataset = GetMockActivator().RepositoryLocator.CatalogueRepository.GetAllObjects<Core.Curation.Data.Datasets.Dataset>().First();
var linkCmd = new ExecuteCommandLinkColumnInfoToDataset(GetMockActivator(), null, founddataset, false);
Assert.Throws<NullReferenceException>(() => linkCmd.Execute());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Rdmp.Core.Curation.Data;

namespace Rdmp.Core.CommandExecution.AtomicCommands;

public class ExecuteCommandCreateDataset : BasicCommandExecution
Expand All @@ -24,7 +23,7 @@ public ExecuteCommandCreateDataset(IBasicActivateItems activator, [DemandsInitia
public override void Execute()
{
base.Execute();
var dataset = new Curation.Data.Dataset(BasicActivator.RepositoryLocator.CatalogueRepository, _name) { DigitalObjectIdentifier = _doi, Source = _source };
var dataset = new Rdmp.Core.Curation.Data.Datasets.Dataset(BasicActivator.RepositoryLocator.CatalogueRepository, _name) { DigitalObjectIdentifier = _doi, Source = _source };
dataset.SaveToDatabase();
_activator.Publish(dataset);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
namespace Rdmp.Core.CommandExecution.AtomicCommands;
public sealed class ExecuteCommandDeleteDataset: BasicCommandExecution
{
private readonly Curation.Data.Dataset _dataset;
private readonly Curation.Data.Datasets.Dataset _dataset;
private readonly IBasicActivateItems _activator;
public ExecuteCommandDeleteDataset(IBasicActivateItems activator, [DemandsInitialization("The Dataset to delete")]Curation.Data.Dataset dataset)
public ExecuteCommandDeleteDataset(IBasicActivateItems activator, [DemandsInitialization("The Dataset to delete")]Curation.Data.Datasets.Dataset dataset)
{
_dataset = dataset;
_activator = activator;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
using Rdmp.Core.Curation.Data.Datasets;
using Rdmp.Core.Curation.Data;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NPOI.OpenXmlFormats.Vml.Office;

namespace Rdmp.Core.CommandExecution.AtomicCommands
{
public class ExecuteCommandImportExistingCataloguesIntoExternalDatasetProvider : BasicCommandExecution, IAtomicCommand
{

private readonly IBasicActivateItems _activator;
private readonly IDatasetProvider _provider;
private readonly bool _includeExtractable;
private readonly bool _includeInternal;
private readonly bool _includeProjectSpecific;
private readonly bool _includeDeprecated;

public ExecuteCommandImportExistingCataloguesIntoExternalDatasetProvider(IBasicActivateItems activator, IDatasetProvider provider, bool includeExtractable, bool includeInternal, bool includeProjectSpecific, bool includeDeprecated)
{
_activator = activator;
_provider = provider;
_includeExtractable = includeExtractable;
_includeInternal = includeInternal;
_includeProjectSpecific = includeProjectSpecific;
_includeDeprecated = includeDeprecated;
}


public override void Execute()
{
var catalogues = _activator.RepositoryLocator.CatalogueRepository.GetAllObjects<Catalogue>().ToList();
if (!_includeInternal)
{
catalogues = catalogues.Where(c => !c.IsInternalDataset).ToList();
}
if (!_includeProjectSpecific)
{
catalogues = catalogues.Where(c => !c.IsProjectSpecific(_activator.RepositoryLocator.DataExportRepository)).ToList();
}
if (!_includeDeprecated)
{
catalogues = catalogues.Where(c => !c.IsDeprecated).ToList();
}
if (!_includeExtractable)
{
catalogues = catalogues.Where(c => !c.GetExtractabilityStatus(_activator.RepositoryLocator.DataExportRepository).IsExtractable).ToList();
}
//todo check this catalogue filtering works
foreach (var catalogue in catalogues)
{
var dataset = _provider.Create(catalogue);
var ds = _provider.AddExistingDatasetWithReturn(null, dataset.GetID());
var cmd = new ExecuteCommandLinkCatalogueToDataset(_activator, catalogue, ds);
cmd.Execute();
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@
using System;
using Rdmp.Core.Curation.Data;
using System.Linq;
using Rdmp.Core.Curation.Data.Datasets;

namespace Rdmp.Core.CommandExecution.AtomicCommands;

public sealed class ExecuteCommandLinkCatalogueToDataset : BasicCommandExecution
{
private readonly Catalogue _catalogue;
private readonly Curation.Data.Dataset _dataset;
private readonly Curation.Data.Datasets.Dataset _dataset;
private readonly bool _linkAll;
public ExecuteCommandLinkCatalogueToDataset(IBasicActivateItems activator, [DemandsInitialization("The catalogue To link")]Catalogue catalogue, [DemandsInitialization("The dataset to link to")]Curation.Data.Dataset dataset, bool linkAllOtherColumns = true) : base(activator)
public ExecuteCommandLinkCatalogueToDataset(IBasicActivateItems activator, [DemandsInitialization("The catalogue To link")]Catalogue catalogue, [DemandsInitialization("The dataset to link to")]Curation.Data.Datasets.Dataset dataset, bool linkAllOtherColumns = true) : base(activator)
{
_catalogue = catalogue;
_dataset = dataset;
Expand All @@ -29,21 +30,9 @@ public ExecuteCommandLinkCatalogueToDataset(IBasicActivateItems activator, [Dema
public override void Execute()
{
base.Execute();
var items = _catalogue.CatalogueItems.ToList();
foreach (var ci in items.Select(static item => item.ColumnInfo).Where(ci => ci?.Dataset_ID != _dataset.ID))
{
ci.Dataset_ID = _dataset.ID;
ci.SaveToDatabase();
if (!_linkAll) continue;

var databaseName = ci.Name[..ci.Name.LastIndexOf('.')];
var catalogueItems = ci.CatalogueRepository.GetAllObjects<ColumnInfo>().Where(ci => ci.Name[..ci.Name.LastIndexOf(".", StringComparison.Ordinal)] == databaseName).ToList();
foreach (var aci in catalogueItems)
{
aci.Dataset_ID = _dataset.ID;
aci.SaveToDatabase();
}
}
var linkage = new CatalogueDatasetLinkage(_catalogue.CatalogueRepository, _catalogue, _dataset);
linkage.SaveToDatabase();
Publish(linkage);

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ namespace Rdmp.Core.CommandExecution.AtomicCommands;
public sealed class ExecuteCommandLinkColumnInfoToDataset : BasicCommandExecution
{
private readonly ColumnInfo _columnInfo;
private readonly Curation.Data.Dataset _dataset;
private readonly Curation.Data.Datasets.Dataset _dataset;
private readonly bool _linkAll;
public ExecuteCommandLinkColumnInfoToDataset(IBasicActivateItems activator, [DemandsInitialization("The column to link")] ColumnInfo columnInfo, [DemandsInitialization("The dataset to link to")] Curation.Data.Dataset dataset, bool linkAllOtherColumns = true) : base(activator)
public ExecuteCommandLinkColumnInfoToDataset(IBasicActivateItems activator, [DemandsInitialization("The column to link")] ColumnInfo columnInfo, [DemandsInitialization("The dataset to link to")] Curation.Data.Datasets.Dataset dataset, bool linkAllOtherColumns = true) : base(activator)
{
_columnInfo = columnInfo;
_dataset = dataset;
Expand Down
22 changes: 22 additions & 0 deletions Rdmp.Core/Curation/Data/Catalogue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
using FAnsi.Discovery;
using FAnsi.Discovery.QuerySyntax;
using Rdmp.Core.CohortCreation.Execution;
using Rdmp.Core.CommandExecution;
using Rdmp.Core.Curation.Data.Aggregation;
using Rdmp.Core.Curation.Data.DataLoad;
using Rdmp.Core.Curation.Data.Datasets;
using Rdmp.Core.Curation.Data.Defaults;
using Rdmp.Core.Curation.Data.ImportExport;
using Rdmp.Core.Curation.Data.Serialization;
Expand All @@ -30,6 +32,7 @@
using Rdmp.Core.ReusableLibraryCode.Annotations;
using Rdmp.Core.ReusableLibraryCode.Checks;
using Rdmp.Core.ReusableLibraryCode.DataAccess;
using Rdmp.Core.Startup;
using Rdmp.Core.Ticketing;

namespace Rdmp.Core.Curation.Data;
Expand Down Expand Up @@ -1147,6 +1150,25 @@ internal Catalogue(ShareManager shareManager, ShareDefinition shareDefinition)
/// <inheritdoc/>
public override string ToString() => Name;

public List<Datasets.Dataset> GetLinkedDatasets()
{
return CatalogueRepository.GetAllObjectsWhere<CatalogueDatasetLinkage>("Catalogue_ID", this.ID).Select(l => l.Dataset).Distinct().ToList();
}

public override void SaveToDatabase()
{
base.SaveToDatabase();
foreach (var dataset in CatalogueRepository.GetAllObjectsWhere<CatalogueDatasetLinkage>("Catalogue_ID", this.ID).Where(cdl => cdl.Autoupdate).Select(cld => cld.Dataset))
{
var provider = CatalogueRepository.GetObjectByID<DatasetProviderConfiguration>((int)dataset.Provider_ID);
var providerConfiguration = CatalogueRepository.GetObjectByID<DatasetProviderConfiguration>((int)dataset.Provider_ID);
var repositoryProvider = new UserSettingsRepositoryFinder();
var activator = new ThrowImmediatelyActivator(repositoryProvider, ThrowImmediatelyCheckNotifier.Quiet);
var providerInstance = providerConfiguration.GetProviderInstance(activator);
providerInstance.UpdateUsingCatalogue(dataset, this);
}
}

/// <summary>
/// Sorts alphabetically based on <see cref="Name"/>
/// </summary>
Expand Down
Loading