Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 6 additions & 1 deletion .github/workflows/build-and-package-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ jobs:

Write-Output "::set-output name=version::$version"

- name: Install .NET core
- name: Install .NET core 6.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.x'

- name: Install .NET core 3.1
uses: actions/setup-dotnet@v1
with:
dotnet-version: '3.1.100'
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build-and-publish-docker-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches:
- main
- master
- masterV3
- '*/Fix-*-docker*'

release:
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/check-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ on:
pull_request:
branches:
- master
- masterV3
types: [opened, synchronize, reopened, edited]

push:
branches:
- master
- masterV3

jobs:
Check-release:
Expand Down Expand Up @@ -36,7 +38,12 @@ jobs:

Write-Output "::set-output name=timestamp::$timestamp"

- name: Install .NET core
- name: Install .NET core 6.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.x'

- name: Install .NET core 3.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: '3.1.100'
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/check-style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ on:
pull_request:
branches:
- master
- masterV3
types: [opened, synchronize, reopened, edited]

push:
branches:
- master
- masterV3

jobs:
Check-style:
Expand Down
10 changes: 5 additions & 5 deletions src/AasxServerStandardBib/AasEntityBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ public void CreateAddInstanceObjects(AasCore.Aas3_0_RC02.Environment env)
targetNodeRec.uanode.NodeId))
{
lax.uanode.AddReference(this.AasTypes.HasAasReference.GetTypeNodeId(), false,
targetNodeRec.uanode.NodeId);
targetNodeRec.uanode.NodeId);
}
}

Expand All @@ -260,7 +260,7 @@ public void CreateAddInstanceObjects(AasCore.Aas3_0_RC02.Environment env)
targetNodeRec.uanode.NodeId))
{
lax.uanode.AddReference(this.AasTypes.HasDictionaryEntry.GetTypeNodeId(), false,
targetNodeRec.uanode.NodeId);
targetNodeRec.uanode.NodeId);
}
foundAtAll = true;
}
Expand All @@ -284,7 +284,7 @@ public void CreateAddInstanceObjects(AasCore.Aas3_0_RC02.Environment env)
nr.uanode?.NodeId))
{
lax.uanode.AddReference(this.AasTypes.HasDictionaryEntry.GetTypeNodeId(), false,
nr.uanode?.NodeId);
nr.uanode?.NodeId);
}
}
else
Expand All @@ -305,7 +305,7 @@ public void CreateAddInstanceObjects(AasCore.Aas3_0_RC02.Environment env)
miss?.NodeId))
{
lax.uanode.AddReference(this.AasTypes.HasDictionaryEntry.GetTypeNodeId(), false,
miss?.NodeId);
miss?.NodeId);
}

// put it into the NodeRecords, that it can be re-used?? no!!
Expand Down Expand Up @@ -584,7 +584,7 @@ public PropertyState<T> CreateAddPropertyState<T>(
{
if (!parent.ReferenceExists(referenceTypeFromParentId, false, x.NodeId))
{
parent.AddReference(referenceTypeFromParentId, false, x.NodeId);
parent.AddReference(referenceTypeFromParentId, false, x.NodeId);
}
if (referenceTypeFromParentId == ReferenceTypeIds.HasComponent)
x.AddReference(referenceTypeFromParentId, true, parent.NodeId);
Expand Down
12 changes: 6 additions & 6 deletions src/AasxServerStandardBib/AasxHttpContextHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -727,12 +727,12 @@ protected static void SendJsonResponse(Grapevine.Interfaces.Server.IHttpContext
}

//TODO:jtikekar remove
if(context.Request.RawUrl.Equals("/aas/0/core") && obj is ExpandoObject findAasReturn)
if (context.Request.RawUrl.Equals("/aas/0/core") && obj is ExpandoObject findAasReturn)
{
var value = new JsonObject();
foreach (KeyValuePair<string, object> kvp in findAasReturn)
{
if(kvp.Key.Equals("AAS"))
if (kvp.Key.Equals("AAS"))
{
value["AAS"] = Jsonization.Serialize.ToJsonObject((AssetAdministrationShell)kvp.Value);
}
Expand Down Expand Up @@ -3427,8 +3427,8 @@ public static bool checkAccessLevelWithError(out string error, string currentRol
int iRole = 0;
while (securityRole != null && iRole < securityRole.Count && securityRole[iRole].name != null)
{
if (aasOrSubmodel == "aas" && securityRole[iRole].objType == "aas")
/* (aasOrSubmodel == "submodel" && securityRole[iRole].objType == "sm")) */
if (aasOrSubmodel == "aas" && securityRole[iRole].objType == "aas")
/* (aasOrSubmodel == "submodel" && securityRole[iRole].objType == "sm")) */
{
if (objectAasOrSubmodel != null && securityRole[iRole].objReference == objectAasOrSubmodel &&
securityRole[iRole].permission == neededRights)
Expand Down Expand Up @@ -3626,7 +3626,7 @@ public static bool checkUsage(out string error, securityRoleClass sr)
}
if (actualTime.Value == null || actualTime.Value == "")
{
actualTime.Value = DateTime.UtcNow.ToString();
actualTime.Value = DateTime.UtcNow.ToString();
actualCount.Value = null;
}
if (actualCount.Value == null || actualCount.Value == "")
Expand Down Expand Up @@ -3675,7 +3675,7 @@ public bool checkAccessRights(IHttpContext context, string currentRole, string o
{
if (checkAccessLevel(currentRole, operation, neededRights,
objPath, aasOrSubmodel, objectAasOrSubmodel))
return true;
return true;

if (currentRole == null)
{
Expand Down
6 changes: 3 additions & 3 deletions src/AasxServerStandardBib/AasxRestServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public static void initListOfRepositories()
}

// query
[RestRoute(HttpMethod = HttpMethod.GET, PathInfo = "^/queryregistry/([^/]+)(/|)$")]
[RestRoute(HttpMethod = HttpMethod.GET, PathInfo = "^/queryregistry/([^/]+)(/|)$")]
[RestRoute(HttpMethod = HttpMethod.POST, PathInfo = "^/queryregistry/(/|)$")]
public IHttpContext Queryregistry(IHttpContext context)
{
Expand Down Expand Up @@ -260,7 +260,7 @@ private static bool comp(string op, string left, string right)
{
string legal = "012345679.";

foreach (var c in left+right)
foreach (var c in left + right)
{
if (Char.IsDigit(c))
continue;
Expand Down Expand Up @@ -309,7 +309,7 @@ private static bool comp(string op, string left, string right)
int l = Convert.ToInt32(left);
int r = Convert.ToInt32(right);

switch(op)
switch (op)
{
case "==num":
return l == r;
Expand Down
2 changes: 1 addition & 1 deletion src/AasxServerStandardBib/AdminShellPackageEnv.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1161,7 +1161,7 @@ public async Task ReplaceSupplementaryFileInPackageAsync(string sourceUri, strin
{
_openPackage.DeletePart(new Uri(sourceUri, UriKind.RelativeOrAbsolute));

}
}
var targetUri = PackUriHelper.CreatePartUri(new Uri(targetFile, UriKind.RelativeOrAbsolute));
PackagePart packagePart = _openPackage.CreatePart(targetUri, targetContentType);
fileContent.Position = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace AasxServerStandardBib.Exceptions
{
internal class NotImplementedException :Exception
internal class NotImplementedException : Exception
{
public NotImplementedException(string message) : base(message)
{
Expand Down
6 changes: 3 additions & 3 deletions src/AasxServerStandardBib/Extenstions/ExtendEnvironment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ public static AssetAdministrationShell FindAasById(this AasCore.Aas3_0_RC02.Envi
}

var aasList = environment.AssetAdministrationShells.Where(a => a.Id.Equals(aasId));
if(aasList.Any())
if (aasList.Any())
{
return aasList.First();
}
Expand All @@ -411,9 +411,9 @@ public static ConceptDescription FindConceptDescriptionById(this AasCore.Aas3_0_
}

var conceptDescriptionList = environment.ConceptDescriptions.Where(c => c.Id.Equals(conceptDescriptionId));
if(conceptDescriptionList.Any())
if (conceptDescriptionList.Any())
{
return conceptDescriptionList.First();
return conceptDescriptionList.First();
}

return null;
Expand Down
2 changes: 1 addition & 1 deletion src/AasxServerStandardBib/SecurityClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1298,7 +1298,7 @@ public static void createCfpTree(int envIndex, DateTime timeStamp)
{
assetCfp.Add(assetId, cfp);

}
}
if (i == envIndex)
root = cfp;
}
Expand Down
2 changes: 1 addition & 1 deletion src/AasxServerWindows/AasxServerWindows.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<TargetFramework>net6.0-windows</TargetFramework>
<OutputType>Exe</OutputType>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<UseWindowsForms>true</UseWindowsForms>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,7 @@ public static void initRegistry(DateTime timestamp, bool initAgain = false)
if (!initAgain && init)
return;

AasxServer.Program.initializingRegistry= true;
AasxServer.Program.initializingRegistry = true;

init = true;
if (initAgain)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class OutputModifierContext
private bool _includeChildren = true;
private List<string> idShortPaths;
public Submodel submodel = null;
public AssetAdministrationShellEnvironmentService aasEnvService= null;
public AssetAdministrationShellEnvironmentService aasEnvService = null;
public string Level
{
get => _level;
Expand Down
2 changes: 1 addition & 1 deletion src/IO.Swagger.V1RC03/Controllers/AASQueryAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public virtual IActionResult GetQueryRegistryOnly([FromRoute][Required] string s

// return new ObjectResult(result);
}

[ApiExplorerSettings(IgnoreApi = true)]
[HttpPost]
[Route("/queryregistry")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ public virtual IActionResult GetAllSubmodels([FromQuery] string semanticId, [Fro
public virtual IActionResult GetAssetAdministrationShellById([FromRoute][Required] string aasIdentifier)
{
_aasEnvService.SecurityCheckInit(HttpContext, "/shells", "GET");

var decodedAasId = _decoderService.Decode("aasIdentifier", aasIdentifier);

var output = _aasEnvService.GetAssetAdministrationShellById(decodedAasId, out _);
Expand Down Expand Up @@ -638,7 +638,7 @@ public virtual IActionResult GetOperationAsyncResultSubmodelRepo([FromRoute][Req
[SwaggerOperation("GetSubmodel")]
[SwaggerResponse(statusCode: 200, type: typeof(Submodel), description: "Requested Submodel")]
[SwaggerResponse(statusCode: 0, type: typeof(Result), description: "Default error handling for unmentioned status codes")]
public virtual IActionResult GetSubmodel([FromRoute][Required] string aasIdentifier,[FromRoute][Required] string submodelIdentifier,
public virtual IActionResult GetSubmodel([FromRoute][Required] string aasIdentifier, [FromRoute][Required] string submodelIdentifier,
[FromQuery] LevelEnum level, [FromQuery] ContentEnum content, [FromQuery] ExtentEnum extent)
{
_aasEnvService.SecurityCheckInit(HttpContext, "/submodels", "GET");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace IO.Swagger.V1RC03.Controllers
public interface IAASQueryAPIController
{
IActionResult GetQuery([FromRoute, Required] string searchQuery);
IActionResult GetQueryRegistryOnly([FromRoute, Required] string searchQuery);
IActionResult GetQueryRegistryOnly([FromRoute, Required] string searchQuery);
IActionResult GetQueryRegistry([FromRoute, Required] string searchQuery);
// IActionResult PostQuery([FromBody, Required] string searchQuery);
Task<IActionResult> PostQueryAsync();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@ public string GetAASXByPackageId(string packageId, out byte[] content, out long
System.IO.File.Delete(copyFileName);
return fileName;
}
else if(requestedPackage != null && string.IsNullOrEmpty(requestedFileName))
else if (requestedPackage != null && string.IsNullOrEmpty(requestedFileName))
{
//File does not exist, may be AAS is added by REST-API
//Check if AAS exists
if(requestedPackage.AasEnv.AssetAdministrationShells.Count != 0)
if (requestedPackage.AasEnv.AssetAdministrationShells.Count != 0)
{
string newFileName = Path.Combine(AasxHttpContextHelper.DataPath, requestedPackage.AasEnv.AssetAdministrationShells[0].IdShort + ".aasx");
using (new FileStream(newFileName, FileMode.CreateNew)) { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ public void SecurityCheck(string objPath = "", string aasOrSubmodel = null, obje

checkAccessRights(_securityContext.accessRights, _securityContext.route, _securityContext.neededRights,
objPath, aasOrSubmodel, objectAasOrSubmodel);
}
}

public bool SecurityCheckTestOnly(string objPath = "", string aasOrSubmodel = null, object objectAasOrSubmodel = null)
{
if (!AasxRestServerLibrary.AasxHttpContextHelper.withAuthentification)
return(true);
return (true);

return checkAccessRights(_securityContext.accessRights, _securityContext.route, _securityContext.neededRights,
objPath, aasOrSubmodel, objectAasOrSubmodel, true);
Expand All @@ -90,7 +90,7 @@ public static bool checkAccessRightsWithAllow(string currentRole, string operati
string objPath = "", string aasOrSubmodel = null, object objectAasOrSubmodel = null, bool testOnly = false)
{
string error = "Access not allowed";
withAllow= false;
withAllow = false;

if (Program.secretStringAPI != null)
{
Expand All @@ -104,7 +104,7 @@ public static bool checkAccessRightsWithAllow(string currentRole, string operati
if (AasxRestServerLibrary.AasxHttpContextHelper.checkAccessLevelWithError(
out error, currentRole, operation, neededRights, out withAllow,
objPath, aasOrSubmodel, objectAasOrSubmodel))
return true;
return true;

if (currentRole == null)
{
Expand Down Expand Up @@ -1005,10 +1005,10 @@ public Submodel CreateSubmodel(Submodel body, string aasIdentifier = null)
}

//Check if corresponding AAS exist. If yes, then add to the same environment
if(!string.IsNullOrEmpty(aasIdentifier))
if (!string.IsNullOrEmpty(aasIdentifier))
{
var aasFound = IsAssetAdministrationShellPresent(aasIdentifier, out AssetAdministrationShell aas, out int packageIndex);
if(aasFound)
if (aasFound)
{
body.SetAllParents(DateTime.UtcNow);
_packages[packageIndex].AasEnv.Submodels.Add(body);
Expand Down Expand Up @@ -1439,29 +1439,29 @@ public void UpdateFileByPathSubmodelRepo(string submodelIdentifier, string idSho
if (fileElement is File file)
{
//Check if file has location
if(!string.IsNullOrEmpty(file.Value))
if (!string.IsNullOrEmpty(file.Value))
{
//check if it is external location
if(file.Value.StartsWith("http") || file.Value.StartsWith("https"))
if (file.Value.StartsWith("http") || file.Value.StartsWith("https"))
{
_logger.LogWarning($"Value of the Submodel-Element File with IdShort {file.IdShort} is an external link.");
throw new NotImplementedException($"File location for {file.IdShort} is external {file.Value}. Currently this fuctionality is not supported.");
}
//Check if a directory
else if(file.Value.StartsWith('/') || file.Value.StartsWith('\\'))
else if (file.Value.StartsWith('/') || file.Value.StartsWith('\\'))
{
_logger.LogInformation($"Value of the Submodel-Element File with IdShort {file.IdShort} is a File-Path.");
//check if the value consists file extension
string sourcePath;
if(Path.HasExtension(file.Value))
if (Path.HasExtension(file.Value))
{
sourcePath = Path.GetDirectoryName(file.Value); //This should get platform specific path, without file name
}
else
{
sourcePath = Path.Combine(file.Value);
}

var targetFile = Path.Combine(sourcePath, fileName);
targetFile = targetFile.Replace('/', Path.DirectorySeparatorChar);
Task task = _packages[packageIndex].ReplaceSupplementaryFileInPackageAsync(file.Value, targetFile, contentType, fileContent);
Expand All @@ -1485,7 +1485,7 @@ public void UpdateFileByPathSubmodelRepo(string submodelIdentifier, string idSho
file.Value = FormatFileName(targetFile);
AasxServer.Program.signalNewData(2);
}

}
else
{
Expand Down
Loading