Skip to content

Commit

Permalink
PMN-2023.3 Release
Browse files Browse the repository at this point in the history
  • Loading branch information
PopMedNet-Team committed Oct 20, 2023
1 parent 3ae4a7a commit 1857d85
Show file tree
Hide file tree
Showing 77 changed files with 865 additions and 7,881 deletions.
6 changes: 3 additions & 3 deletions Build/CommonAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
[assembly: AssemblyCopyright("Copyright © PopMedNet 2011-2023")]
[assembly: ComVisible(false)]
//Please Also update The Click Once version under Lpp.Dns.DataMartClient Properties > publish > Version Number
[assembly: AssemblyVersion( /*<VERSION>*/ "7.10.0.0" /*</VERSION>*/ )]
[assembly: AssemblyFileVersion( /*<VERSION>*/ "7.10.0.0" /*</VERSION>*/ )]
[assembly: AssemblyInformationalVersion("2023.2")]
[assembly: AssemblyVersion( /*<VERSION>*/ "7.11.0.0" /*</VERSION>*/ )]
[assembly: AssemblyFileVersion( /*<VERSION>*/ "7.11.0.0" /*</VERSION>*/ )]
[assembly: AssemblyInformationalVersion("2023.3")]
6 changes: 3 additions & 3 deletions Build/DataMartClientCommonAssemlbyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
[assembly: AssemblyCopyright("Copyright © PopMedNet 2011-2023")]
[assembly: ComVisible(false)]
//Please Also update The Click Once version under Lpp.Dns.DataMartClient Properties > publish > Version Number
[assembly: AssemblyVersion( /*<VERSION>*/ "7.10.0.0" /*</VERSION>*/ )]
[assembly: AssemblyFileVersion( /*<VERSION>*/ "7.10.0.0" /*</VERSION>*/ )]
[assembly: AssemblyInformationalVersion("2023.2")]
[assembly: AssemblyVersion( /*<VERSION>*/ "7.11.0.0" /*</VERSION>*/ )]
[assembly: AssemblyFileVersion( /*<VERSION>*/ "7.11.0.0" /*</VERSION>*/ )]
[assembly: AssemblyInformationalVersion("2023.3")]
6 changes: 3 additions & 3 deletions Build/DomainManagerCommonAssemlbyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
[assembly: AssemblyCopyright("Copyright © PopMedNet 2011-2023")]
[assembly: ComVisible(false)]

[assembly: AssemblyVersion( /*<VERSION>*/ "7.10.0.*" /*</VERSION>*/ )]
[assembly: AssemblyVersion( /*<VERSION>*/ "7.11.0.*" /*</VERSION>*/ )]

//Need to keep the file private part equal to 3000 or above for RavenDB as Embedded usage in adapter packages.
[assembly: AssemblyFileVersion( /*<VERSION>*/ "7.10.0.3000" /*</VERSION>*/ )]
[assembly: AssemblyInformationalVersion("2023.2")]
[assembly: AssemblyFileVersion( /*<VERSION>*/ "7.11.0.3000" /*</VERSION>*/ )]
[assembly: AssemblyInformationalVersion("2023.3")]
4 changes: 2 additions & 2 deletions DistributedNetworkSolution.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29503.13
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lpp.Dns.Portal", "Lpp.Dns.Portal\Lpp.Dns.Portal.csproj", "{E59FAF38-4394-4D29-837F-BAE706488021}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{206D225A-1300-4D2F-89DA-BD45C5CEE912}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Plugins", "Plugins", "{BC2F0AA5-7058-473B-88C2-C42AFEF79BA1}"
Expand Down Expand Up @@ -45,8 +47,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{9A357B
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "General", "General", "{1BFBC81B-E4A2-4F93-BA7F-0CE4AD1F5F9A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lpp.Dns.Portal", "Lpp.Dns.Portal\Lpp.Dns.Portal.csproj", "{E59FAF38-4394-4D29-837F-BAE706488021}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lpp.Dns.Model.Test", "Tests\Lpp.Dns.Model.Test\Lpp.Dns.Model.Test.csproj", "{C33B004C-E787-43E0-AF9D-9B3998AEE1A7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lpp.Dns.Tests", "Tests\Lpp.Dns.Tests\Lpp.Dns.Tests.csproj", "{8AB06E5A-4025-41D8-98E2-60B271508317}"
Expand Down
234 changes: 115 additions & 119 deletions Lpp.Adapters/Lpp.Dns.DataMart.Client.DomainManger/ProxyModelMetadata.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,123 +6,119 @@

namespace Lpp.Dns.DataMart.Client.DomainManger
{
[Serializable]
public class ProxyModelMetadata : MarshalByRefObject, Lpp.Dns.DataMart.Model.IModelMetadata
{
readonly Lpp.Dns.DataMart.Model.IModelMetadata metadata;

public ProxyModelMetadata() {
metadata = new EmptyModelMetaData();
}

public ProxyModelMetadata(Model.IModelMetadata data)
{
metadata = data;
}

public override object InitializeLifetimeService()
{
return null;
}

public string ModelName
{
get
{
return metadata.ModelName;
}
set { }
}

public Guid ModelId
{
get
{
return metadata.ModelId;
}
set { }
}

public string Version
{
get
{
return metadata.Version;
}
set { }
}

public IDictionary<string, bool> Capabilities
{
get
{
return metadata.Capabilities;
}
set
{ }
}

public IDictionary<string, string> Properties
{
get
{
return metadata.Properties;
}
set { }
}

public ICollection<Model.Settings.ProcessorSetting> Settings
{
get
{
return metadata.Settings;
}
set { }
}

public IEnumerable<Model.Settings.SQLProvider> SQlProviders
{
get { return metadata.SQlProviders; }
set { }
}

public sealed class EmptyModelMetaData : Lpp.Dns.DataMart.Model.IModelMetadata
{
public string ModelName
{
get { return "Empty Model"; }
}

public Guid ModelId
{
get { return Guid.Empty; }
}

public string Version
{
get { return "1.0.0.0"; }
}

public IDictionary<string, bool> Capabilities
{
get { return new Dictionary<string,bool>(); }
}

public IDictionary<string, string> Properties
{
get { return new Dictionary<string, string>(); }
}

public ICollection<Model.Settings.ProcessorSetting> Settings
{
get { return new List<Model.Settings.ProcessorSetting>(); }
}

public IEnumerable<Model.Settings.SQLProvider> SQlProviders
{
get { return new Model.Settings.SQLProvider[0]; }
}
}

}
[Serializable]
public class ProxyModelMetadata : MarshalByRefObject, Lpp.Dns.DataMart.Model.IModelMetadata
{
readonly Lpp.Dns.DataMart.Model.IModelMetadata metadata;

public ProxyModelMetadata()
{
metadata = new EmptyModelMetaData();
}

public ProxyModelMetadata(Model.IModelMetadata data)
{
metadata = data;
}

public override object InitializeLifetimeService()
{
return null;
}

public string ModelName
{
get
{
return metadata.ModelName;
}
}

public Guid ModelId
{
get
{
return metadata.ModelId;
}
}

public string Version
{
get
{
return metadata.Version;
}
}

public IDictionary<string, bool> Capabilities
{
get
{
return metadata.Capabilities;
}
}

public IDictionary<string, string> Properties
{
get
{
return metadata.Properties;
}
}

public ICollection<Model.Settings.ProcessorSetting> Settings
{
get
{
return metadata.Settings;
}
}

public IEnumerable<Model.Settings.SQLProvider> SQlProviders
{
get
{
return metadata.SQlProviders;
}
}

public sealed class EmptyModelMetaData : Lpp.Dns.DataMart.Model.IModelMetadata
{
public string ModelName
{
get { return "Empty Model"; }
}

public Guid ModelId
{
get { return Guid.Empty; }
}

public string Version
{
get { return "1.0.0.0"; }
}

public IDictionary<string, bool> Capabilities
{
get { return new Dictionary<string, bool>(); }
}

public IDictionary<string, string> Properties
{
get { return new Dictionary<string, string>(); }
}

public ICollection<Model.Settings.ProcessorSetting> Settings
{
get { return new List<Model.Settings.ProcessorSetting>(); }
}

public IEnumerable<Model.Settings.SQLProvider> SQlProviders
{
get { return new Model.Settings.SQLProvider[0]; }
}
}

}
}
Binary file not shown.
2 changes: 1 addition & 1 deletion Lpp.Dns.Api/App_Start/TermsRegistrationManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public IEnumerable<IModelTermProvider> Interrogate(IEnumerable<string> identifie
foreach (string identifier in identifiers)
{

var pgks = packages.Where(f => System.Text.RegularExpressions.Regex.IsMatch(System.IO.Path.GetFileName(f), identifier + @".\d*.\d*.\d*.\d*.zip", System.Text.RegularExpressions.RegexOptions.IgnoreCase | System.Text.RegularExpressions.RegexOptions.Singleline)).ToArray();
var pgks = packages.Where(f => System.Text.RegularExpressions.Regex.IsMatch(System.IO.Path.GetFileName(f), identifier + @".\d*.\d*.\d*.\d*.zip", System.Text.RegularExpressions.RegexOptions.IgnoreCase | System.Text.RegularExpressions.RegexOptions.Singleline, TimeSpan.FromSeconds(3))).ToArray();
if (pgks == null || pgks.Length == 0)
continue;

Expand Down
27 changes: 20 additions & 7 deletions Lpp.Dns.Api/DMCS/DMCSController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ static DMCSController()

static readonly log4net.ILog Logger = log4net.LogManager.GetLogger(typeof(DMCSController));
static readonly IEnumerable<Type> PostProcessorTypes;
static object _lock = new object();
static readonly object _lock = new object();
/// <summary>
/// Gets the current Utilities.Security.ApiIdentity.
/// </summary>
Expand Down Expand Up @@ -529,13 +529,26 @@ public async Task<HttpResponseMessage> AddResponseDocument()
/// <returns></returns>
public async Task PostProcessDocument(Guid identityID, Lpp.Dns.DTO.DMCS.DMCSResponseDocument documentMetadata, string cachedDocumentFileName)
{
using (var db = new DataContext())
string canonicalCachedDocumentFileName = Path.GetFullPath(cachedDocumentFileName);

using (var db = new DataContext())
{
Data.Document postProcessDocument = await db.Documents.FindAsync(documentMetadata.DocumentID);

if (!File.Exists(cachedDocumentFileName))
string uploadPath = System.Web.Configuration.WebConfigurationManager.AppSettings["DocumentsUploadFolder"] ?? string.Empty;
if (string.IsNullOrEmpty(uploadPath))
uploadPath = System.Web.HttpContext.Current.Server.MapPath("~/App_Data/Uploads/");

if(!canonicalCachedDocumentFileName.StartsWith(uploadPath, StringComparison.OrdinalIgnoreCase))
{
//throw error is the start of the cached document path does not match the system cach folder path.
Logger.Error($"[RequestID: {documentMetadata.RequestID}, DataMartID: {documentMetadata.DataMartID}, UserID: {identityID}] Error post-processing document: The canonicalCachedDocumentFileName does not start with a path that matches the system cache root: " + canonicalCachedDocumentFileName);
throw new ArgumentException("The supplied cached document filename is not valid.", nameof(cachedDocumentFileName));
}

if (!File.Exists(canonicalCachedDocumentFileName))
{
using (var writer = File.OpenWrite(cachedDocumentFileName))
using (var writer = File.OpenWrite(canonicalCachedDocumentFileName))
using (var documentStream = postProcessDocument.GetStream(db))
{
documentStream.CopyTo(writer);
Expand All @@ -550,8 +563,8 @@ public async Task PostProcessDocument(Guid identityID, Lpp.Dns.DTO.DMCS.DMCSResp
Logger.Debug($"[RequestID: { documentMetadata.RequestID }, DataMartID: { documentMetadata.DataMartID }, UserID: { identityID }] Starting post-processing document: { Newtonsoft.Json.JsonConvert.SerializeObject(documentMetadata) } ");

IPostProcessDocumentContent postProcess = Activator.CreateInstance(item) as IPostProcessDocumentContent;
postProcess.Initialize(db, Path.GetDirectoryName(cachedDocumentFileName));
await postProcess.ExecuteAsync(postProcessDocument, Path.GetFileName(cachedDocumentFileName));
postProcess.Initialize(db, Path.GetDirectoryName(canonicalCachedDocumentFileName));
await postProcess.ExecuteAsync(postProcessDocument, Path.GetFileName(canonicalCachedDocumentFileName));
}
catch (Exception ex)
{
Expand All @@ -562,7 +575,7 @@ public async Task PostProcessDocument(Guid identityID, Lpp.Dns.DTO.DMCS.DMCSResp

try
{
File.Delete(cachedDocumentFileName);
File.Delete(canonicalCachedDocumentFileName);
}
catch { }
}
Expand Down

0 comments on commit 1857d85

Please sign in to comment.