From 423f03f50f51749329a5259eaf7b7c6bc31667d1 Mon Sep 17 00:00:00 2001 From: AlexanderWollbrink <68860592+AlexanderWollbrink@users.noreply.github.com> Date: Fri, 7 Jun 2024 14:40:14 +0200 Subject: [PATCH] *fix for supplementary files not appearing (#219) --- src/AasxCsharpLibrary/AdminShellPackageEnv.cs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/AasxCsharpLibrary/AdminShellPackageEnv.cs b/src/AasxCsharpLibrary/AdminShellPackageEnv.cs index 2d862f92..71080f59 100644 --- a/src/AasxCsharpLibrary/AdminShellPackageEnv.cs +++ b/src/AasxCsharpLibrary/AdminShellPackageEnv.cs @@ -1540,8 +1540,9 @@ public ListOfAasSupplementaryFile GetListOfSupplementaryFiles() // get the origin from the package PackagePart originPart = null; - xs = _openPackage.GetRelationshipsByType( - "http://admin-shell.io/aasx/relationships/aasx-origin"); + xs = _openPackage.GetRelationshipsByType("http://admin-shell.io/aasx/relationships/aasx-origin"); + var test = xs.Count(); + if(xs.Count() <= 0) xs = _openPackage.GetRelationshipsByType("http://www.admin-shell.io/aasx/relationships/aasx-origin"); foreach (var x in xs) if (x.SourceUri.ToString() == "/") { @@ -1558,7 +1559,8 @@ public ListOfAasSupplementaryFile GetListOfSupplementaryFiles() { // get the specs from the origin PackagePart specPart = null; - xs = originPart.GetRelationshipsByType("http://www.admin-shell.io/aasx/relationships/aas-spec"); + xs = originPart.GetRelationshipsByType("http://admin-shell.io/aasx/relationships/aas-spec"); + if(xs.Count() <= 0) xs = originPart.GetRelationshipsByType("http://www.admin-shell.io/aasx/relationships/aas-spec"); foreach (var x in xs) { //specPart = _openPackage.GetPart(x.TargetUri); @@ -1573,8 +1575,8 @@ public ListOfAasSupplementaryFile GetListOfSupplementaryFiles() if (specPart != null) { // get the supplementaries from the package, derived from spec - xs = specPart.GetRelationshipsByType("http://www.admin-shell.io/aasx/relationships/aas-suppl"); - if(xs == null) xs = specPart.GetRelationshipsByType("http://www.admin-shell.io/aasx/relationships/aas-suppl"); + xs = specPart.GetRelationshipsByType("http://admin-shell.io/aasx/relationships/aas-suppl"); + if(xs.Count() <= 0) xs = specPart.GetRelationshipsByType("http://www.admin-shell.io/aasx/relationships/aas-suppl"); foreach (var x in xs) { result.Add(