• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

HicServices / RDMP / 7002411191

27 Nov 2023 08:27AM UTC coverage: 56.726% (-0.006%) from 56.732%
7002411191

Pull #1687

github

JFriel
ignore certain dqe types
Pull Request #1687: Add handling for DQE Types

10700 of 20317 branches covered (0.0%)

Branch coverage included in aggregate %.

0 of 9 new or added lines in 1 file covered. (0.0%)

30547 of 52396 relevant lines covered (58.3%)

7319.61 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/Rdmp.Core/CommandExecution/AtomicCommands/ExecuteCommandExportDatabaseToDir.cs
1
// Copyright (c) The University of Dundee 2018-2023
2
// This file is part of the Research Data Management Platform (RDMP).
3
// 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.
4
// 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.
5
// You should have received a copy of the GNU General Public License along with RDMP. If not, see <https://www.gnu.org/licenses/>.
6

7
using System;
8
using System.Collections.Generic;
9
using System.IO;
10
using System.Linq;
11
using System.Linq.Expressions;
12
using Rdmp.Core.Curation.Data;
13
using Rdmp.Core.Repositories;
14

15
namespace Rdmp.Core.CommandExecution.AtomicCommands;
16

17
// Dump all compatible objects from the current platform database(s) into a
18
// YAML/JSON directory for SQL-free operation.
19
public class ExecuteCommandExportDatabaseToDir : BasicCommandExecution
20
{
21
    private readonly IBasicActivateItems _activator;
22
    private readonly DirectoryInfo _target;
23

24
    public ExecuteCommandExportDatabaseToDir(IBasicActivateItems activator, [DemandsInitialization("Where the platform directory should be created")] string target)
×
25
    {
26
        _target = new DirectoryInfo(target);
×
27
        _activator = activator;
×
28
    }
×
29

NEW
30
    private readonly List<string> ignoreList = new() { "Rdmp.Core.DataQualityEngine.Data.DQEGraphAnnotation", "Rdmp.Core.DataQualityEngine.Data.Evaluation" };
×
31

32
    public override void Execute()
33
    {
34
        base.Execute();
×
35
        var repo = new YamlRepository(_target);
×
36
        foreach (var t in repo.GetCompatibleTypes())
×
37
        {
NEW
38
            if (ignoreList.Contains(t.FullName)) continue;
×
39
            try
40
            {
NEW
41
                Console.WriteLine(t.FullName);
×
NEW
42
                foreach (var o in _activator.GetRepositoryFor(t).GetAllObjects(t))
×
NEW
43
                    repo.SaveToDatabase(o);
×
NEW
44
            }
×
NEW
45
            catch(Exception)
×
46
            {
NEW
47
                Console.WriteLine($"Unable to find repo for {t.FullName}");
×
NEW
48
            }
×
49

50
        }
51
    }
×
52
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc