Skip to content

Commit

Permalink
Merge branch 'develop' into release/3.0.0.X
Browse files Browse the repository at this point in the history
  • Loading branch information
tznind committed Jun 3, 2019
2 parents ffcc315 + 0a0bb01 commit c6dd068
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
using MapsDirectlyToDatabaseTable;
using Rdmp.Core.Curation.Data;
using Rdmp.Core.Curation.Data.Aggregation;
using Rdmp.Core.Curation.Data.Cohort;
using Rdmp.Core.Curation.Data.Dashboarding;
using Rdmp.Core.Curation.Data.DataLoad;
using Rdmp.Core.Curation.Data.Defaults;
using Rdmp.Core.Curation.Data.ImportExport;
using Rdmp.Core.Providers;
using Rdmp.Core.QueryBuilding;
using Rdmp.Core.Repositories;
Expand All @@ -25,8 +25,6 @@
using Rdmp.UI.CommandExecution.AtomicCommands;
using Rdmp.UI.Copying;
using Rdmp.UI.DataLoadUIs.LoadMetadataUIs.LoadDiagram;
using Rdmp.UI.DataViewing;
using Rdmp.UI.DataViewing.Collections;
using Rdmp.UI.ExtractionUIs.FilterUIs;
using Rdmp.UI.ExtractionUIs.JoinsAndLookups;
using Rdmp.UI.Icons.IconProvision;
Expand All @@ -37,7 +35,6 @@
using Rdmp.UI.Refreshing;
using Rdmp.UI.Rules;
using Rdmp.UI.SimpleDialogs;
using Rdmp.UI.SubComponents;
using Rdmp.UI.SubComponents.Graphs;
using Rdmp.UI.TestsAndSetup.ServicePropogation;
using ResearchDataManagementPlatform.WindowManagement.ContentWindowTracking.Persistence;
Expand Down Expand Up @@ -211,7 +208,7 @@ public Form ShowWindow(Control singleControlForm, bool asDocument = false)
public bool DeleteWithConfirmation(object sender, IDeleteable deleteable)
{
var databaseObject = deleteable as DatabaseEntity;

//If there is some special way of describing the effects of deleting this object e.g. Selected Datasets
var customMessageDeletable = deleteable as IDeletableWithCustomMessage;

Expand All @@ -229,6 +226,19 @@ public bool DeleteWithConfirmation(object sender, IDeleteable deleteable)
if (databaseObject != null)
idText = " ID=" + databaseObject.ID;

if (databaseObject != null)
{
var exports = RepositoryLocator.CatalogueRepository.GetReferencesTo<ObjectExport>(databaseObject).ToArray();
if(exports.Any(e=>e.Exists()))
if(MessageBox.Show("This object has been shared as an ObjectExport. Deleting it may prevent you loading any saved copies. Do you want to delete the ObjectExport definition?","Delete ObjectExport",MessageBoxButtons.YesNo) == DialogResult.Yes)
{
foreach(ObjectExport e in exports)
e.DeleteInDatabase();
}
else
return false;
}

DialogResult result = MessageBox.Show(
(overrideConfirmationText?? ("Are you sure you want to delete '" + deleteable + "' from the database?")) +Environment.NewLine + "(" + deleteable.GetType().Name + idText +")",
"Delete " + deleteable.GetType().Name,
Expand Down
2 changes: 1 addition & 1 deletion Rdmp.Core/Curation/Data/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public string GetShortName()
}

/// <summary>
/// The master version of the <see cref="Plugin"/> (not the dlls inside - See <see cref="LoadModuleAssembly.DllFileVersion"/>).
/// The master version of the <see cref="Plugin"/>
/// <para>Not currently used</para>
/// </summary>
public Version PluginVersion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public static string SerializeObject(object value, IRDMPPlatformRepositoryServic

var settings = new JsonSerializerSettings
{
TypeNameHandling = TypeNameHandling.Objects,
TypeNameHandling = TypeNameHandling.None,
TypeNameAssemblyFormatHandling = TypeNameAssemblyFormatHandling.Simple,
Converters = new JsonConverter[] {databaseEntityJsonConverter}
};
Expand Down Expand Up @@ -56,7 +56,7 @@ public static object DeserializeObject(string value, Type type,IRDMPPlatformRepo

var settings = new JsonSerializerSettings
{
TypeNameHandling = TypeNameHandling.Objects,
TypeNameHandling = TypeNameHandling.None,
TypeNameAssemblyFormatHandling = TypeNameAssemblyFormatHandling.Simple,
Converters = new JsonConverter[] {databaseEntityJsonConverter, lazyJsonConverter}
};
Expand Down
54 changes: 30 additions & 24 deletions Rdmp.Core/Startup/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -244,36 +244,42 @@ private void LoadMEF(ICatalogueRepository catalogueRepository)

var existingFiles = subdir.GetFiles("*"+PackPluginRunner.PluginPackageSuffix).ToList();

foreach(var lma in compatiblePlugins[i].LoadModuleAssemblies.Where(l=>!existingFiles.Any(f=>f.Name.Equals(l.Plugin.Name))))
lma.DownloadAssembly(subdir);

//if we have not downloaded this yet
if(!existingFiles.Any(f=>f.Name.Equals(compatiblePlugins[i].Name)))
compatiblePlugins[i].LoadModuleAssemblies.SingleOrDefault()?.DownloadAssembly(subdir);
else
_mefCheckNotifier.OnCheckPerformed(new CheckEventArgs("Found existing file '" + compatiblePlugins[i].Name +"' so didn't bother downloading it.",CheckResult.Success));

foreach(var archive in subdir.GetFiles("*"+PackPluginRunner.PluginPackageSuffix).ToList())
{
//get rid of any old out dirs
var outDir = subdir.EnumerateDirectories("out").SingleOrDefault();

bool mustUnzip = true;

//if theres already an unpacked version
if(outDir != null && outDir.Exists)
try
{
outDir.Delete(true);
}
catch(Exception ex)
{
_mefCheckNotifier.OnCheckPerformed(new CheckEventArgs("Could not delete directory '" + outDir.FullName+"'",CheckResult.Warning,ex));
}

outDir = subdir.CreateSubdirectory("out");

using(var zf = ZipFile.OpenRead(archive.FullName))
try
{
zf.ExtractToDirectory(outDir.FullName);
}
catch(Exception ex)
{
_mefCheckNotifier.OnCheckPerformed(new CheckEventArgs("Could not extract Plugin to '" + outDir.FullName+"'",CheckResult.Warning,ex));
}
{
//if the directory has no files we have to unzip - otherwise it has an unzipped version already yay
mustUnzip = !outDir.GetFiles("*.dll",SearchOption.AllDirectories).Any();
}
else
outDir = subdir.CreateSubdirectory("out");

if(mustUnzip)
using(var zf = ZipFile.OpenRead(archive.FullName))
try
{
zf.ExtractToDirectory(outDir.FullName);
}
catch(Exception ex)
{
_mefCheckNotifier.OnCheckPerformed(new CheckEventArgs("Could not extract Plugin to '" + outDir.FullName+"'",CheckResult.Warning,ex));
}
else
_mefCheckNotifier.OnCheckPerformed(new CheckEventArgs("Found existing directory '" + outDir.FullName+"' so didn't bother unzipping.",CheckResult.Success));


toLoad.Add(_environmentInfo.GetPluginSubDirectory(outDir.CreateSubdirectory("lib")));

//tell them we downloaded it
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,9 @@ private void miAddParameter_Click(object sender, EventArgs e)
{
Random r = new Random();

#pragma warning disable SCS0005 // Weak random generator: This is only used to create an initial value for a parameter.
var dialog = new TypeTextOrCancelDialog("Parameter Name", "Name", 100, "@MyParam" + r.Next());
#pragma warning restore SCS0005 // Weak random generator
if (dialog.ShowDialog() == DialogResult.OK)
{
var newParameter = Options.CreateNewParameter(dialog.ResultText.Trim());
Expand Down
6 changes: 3 additions & 3 deletions SharedAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
[assembly: AssemblyCulture("")]

// These should be replaced with correct values by the release process
[assembly: AssemblyVersion("3.0.13")]
[assembly: AssemblyFileVersion("3.0.13")]
[assembly: AssemblyInformationalVersion("3.0.13-rc")]
[assembly: AssemblyVersion("3.0.14")]
[assembly: AssemblyFileVersion("3.0.14")]
[assembly: AssemblyInformationalVersion("3.0.14-rc")]
6 changes: 3 additions & 3 deletions rakefile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
load 'rakeconfig.rb'
$MSBUILD15CMD = MSBUILD15CMD.gsub(/\\/,"/")

task :ci_low_warnings, [:config,:level] => [:assemblyinfo, :build_low_warning]
task :ci_low_warnings, [:config,:level,:aserrors] => [:assemblyinfo, :build_low_warning]

task :ci_continuous, [:config] => [:setup_connection, :assemblyinfo, :build, :tests]

Expand Down Expand Up @@ -43,9 +43,9 @@
sh "\"#{$MSBUILD15CMD}\" #{SOLUTION} \/t:Clean;Build \/p:Configuration=Release"
end

task :build_low_warning, [:config,:level] => :restorepackages do |msb, args|
task :build_low_warning, [:config,:level,:aserrors] => :restorepackages do |msb, args|
args.with_defaults(:level => 1)
sh "\"#{$MSBUILD15CMD}\" #{SOLUTION} \/t:Clean;Build \/p:Configuration=#{args.config} \/p:WarningLevel=#{args.level} \/p:TreatWarningsAsErrors=false"
sh "\"#{$MSBUILD15CMD}\" #{SOLUTION} \/t:Clean;Build \/p:Configuration=#{args.config} \/v:detailed \/p:WarningLevel=#{args.level} \/p:TreatWarningsAsErrors=#{args.aserrors}"
end

task :createtestdb, [:config] do |t, args|
Expand Down

0 comments on commit c6dd068

Please sign in to comment.