Skip to content

Commit d1cffea

Browse files
Jtikekar/reverting nullables (#353)
* Revert nullables, Revert DTO-nullables, Add Metadata-serializer * Upgrading to API version 3.0.2 * Remove child elements from MetadataDTOs (3.0.2) * Support for Metadata as per 3.0.2 * Support for /submodel-elements and Get + $path * Fix for ExceptionHandling * Support for $Path * Support for Level in case of Operation Element * Rebasing and resoling conflicts Revert nullables, Revert DTO-nullables, Add Metadata-serializer * rebase and resolve conflicts epgrading to API version 3.0.2 * Remove child elements from MetadataDTOs (3.0.2) * Resolve conflicts Support for Metadata as per 3.0.2 * Resolve conflicts Support for /submodel-elements and Get + $path * Fix for ExceptionHandling * Resolve conflicts Support for $Path * Support for Level in case of Operation Element * Resolve issues after rebase * Headers added * Remove null check on DataSpecRef * Support for encoded AssetId in GetAllShells * Upgrade to 3.0.3, Change in incorrect level and extent handling * Upgrade to BugFix version 3.0.3 * Update to BugFix Version 3.0.3 * Fix bugs w.r.t., Path and submodel service * Upgrade CD APIs to 3.0.3 * Fix tests * Removing support of Path on AnnotatedRelationshipElement * Support for API Versioning * Resolove conflicts with main Revert nullables, Revert DTO-nullables, Add Metadata-serializer * Resolve conflicts with main Upgrading to API version 3.0.2 * resolve conflicts with main Remove child elements from MetadataDTOs (3.0.2) * Resolve conflicts with main Support for Metadata as per 3.0.2 * Resolve conflicts with main Support for /submodel-elements and Get + $path * Resolve conflicts with main Support for $Path * Support for Level in case of Operation Element * Remove null check on DataSpecRef * Headers added * Support for encoded AssetId in GetAllShells * Upgrade to 3.0.3, Change in incorrect level and extent handling * Upgrade to BugFix version 3.0.3 * Update to BugFix Version 3.0.3 * Fix bugs w.r.t., Path and submodel service * Upgrade CD APIs to 3.0.3 * Fix tests * Removing support of Path on AnnotatedRelationshipElement * Support for API Versioning * Correct errors after rebase --------- Co-authored-by: martaf <[email protected]>
1 parent bfe41ae commit d1cffea

File tree

103 files changed

+10912
-8397
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+10912
-8397
lines changed
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>net8.0</TargetFramework>
3+
<TargetFramework>net6.0</TargetFramework>
44
<Nullable>enable</Nullable>
55
<Configurations>Debug;Release;DebugSlow</Configurations>
66
<Platforms>AnyCPU</Platforms>
77
<LangVersion>8</LangVersion>
88

99
<PackageId>AasCore.Aas3_0</PackageId>
10-
<Version>0.3.0.1-aasV3-alpha-latest</Version>
10+
<Version>1.0.0-rc1</Version>
1111
<Authors>Marko Ristin</Authors>
1212
<Description>
1313
An SDK for manipulating, verifying and de/serializing Asset Administration Shells.
@@ -18,8 +18,8 @@
1818
<PackageLicenseUrl>https://raw.githubusercontent.com/aas-core-works/aas-core3.0-csharp/main/LICENSE</PackageLicenseUrl>
1919
<PackageProjectUrl>https://github.com/aas-core-works/aas-core3.0-csharp</PackageProjectUrl>
2020
<PackageTags>aas;asset administration shell;iiot;industry internet of things;industrie 4.0;i4.0</PackageTags>
21-
<ErrorOnDuplicatePublishOutputFiles>false</ErrorOnDuplicatePublishOutputFiles>
2221
</PropertyGroup>
2322
<ItemGroup>
23+
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
2424
</ItemGroup>
2525
</Project>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/********************************************************************************
2+
* Copyright (c) {2019 - 2024} Contributors to the Eclipse Foundation
3+
*
4+
* See the NOTICE file(s) distributed with this work for additional
5+
* information regarding copyright ownership.
6+
*
7+
* This program and the accompanying materials are made available under the
8+
* terms of the Apache License Version 2.0 which is available at
9+
* https://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* SPDX-License-Identifier: Apache-2.0
12+
********************************************************************************/
13+
14+
using System;
15+
16+
namespace AasCore.Aas3_0.Attributes
17+
{
18+
/// <summary>
19+
/// This attribute indicates, that it should e.g. serialized in JSON.
20+
/// </summary>
21+
[AttributeUsage(AttributeTargets.Field, AllowMultiple = true)]
22+
public class CountForHash : Attribute
23+
{
24+
}
25+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/********************************************************************************
2+
* Copyright (c) {2019 - 2024} Contributors to the Eclipse Foundation
3+
*
4+
* See the NOTICE file(s) distributed with this work for additional
5+
* information regarding copyright ownership.
6+
*
7+
* This program and the accompanying materials are made available under the
8+
* terms of the Apache License Version 2.0 which is available at
9+
* https://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* SPDX-License-Identifier: Apache-2.0
12+
********************************************************************************/
13+
14+
namespace AasCore.Aas3_0.Attributes
15+
{
16+
/// <summary>
17+
/// This attribute indicates, that the field / property is searchable
18+
/// </summary>
19+
[System.AttributeUsage(System.AttributeTargets.Field | System.AttributeTargets.Property, AllowMultiple = true)]
20+
public class MetaModelName : System.Attribute
21+
{
22+
public string name;
23+
public MetaModelName(string name)
24+
{
25+
this.name = name;
26+
}
27+
}
28+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/********************************************************************************
2+
* Copyright (c) {2019 - 2024} Contributors to the Eclipse Foundation
3+
*
4+
* See the NOTICE file(s) distributed with this work for additional
5+
* information regarding copyright ownership.
6+
*
7+
* This program and the accompanying materials are made available under the
8+
* terms of the Apache License Version 2.0 which is available at
9+
* https://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* SPDX-License-Identifier: Apache-2.0
12+
********************************************************************************/
13+
14+
namespace AasCore.Aas3_0.Attributes
15+
{
16+
/// <summary>
17+
/// This attribute indicates, that the field / property shall be skipped for reflection
18+
/// in order to avoid cycles
19+
/// </summary>
20+
[System.AttributeUsage(System.AttributeTargets.Field | System.AttributeTargets.Property, AllowMultiple = true)]
21+
public class SkipForReflection : System.Attribute
22+
{
23+
}
24+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/********************************************************************************
2+
* Copyright (c) {2019 - 2024} Contributors to the Eclipse Foundation
3+
*
4+
* See the NOTICE file(s) distributed with this work for additional
5+
* information regarding copyright ownership.
6+
*
7+
* This program and the accompanying materials are made available under the
8+
* terms of the Apache License Version 2.0 which is available at
9+
* https://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* SPDX-License-Identifier: Apache-2.0
12+
********************************************************************************/
13+
14+
namespace AasCore.Aas3_0.Attributes
15+
{
16+
/// <summary>
17+
/// This attribute indicates, that the field / property shall be skipped for searching, because it is not
18+
/// directly displayed in Package Explorer
19+
/// </summary>
20+
[System.AttributeUsage(System.AttributeTargets.Field | System.AttributeTargets.Property, AllowMultiple = true)]
21+
public class SkipForSearch : System.Attribute
22+
{
23+
}
24+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/********************************************************************************
2+
* Copyright (c) {2019 - 2024} Contributors to the Eclipse Foundation
3+
*
4+
* See the NOTICE file(s) distributed with this work for additional
5+
* information regarding copyright ownership.
6+
*
7+
* This program and the accompanying materials are made available under the
8+
* terms of the Apache License Version 2.0 which is available at
9+
* https://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* SPDX-License-Identifier: Apache-2.0
12+
********************************************************************************/
13+
14+
namespace AasCore.Aas3_0.Attributes
15+
{
16+
/// <summary>
17+
/// This attribute indicates, that the field / property is searchable
18+
/// </summary>
19+
[System.AttributeUsage(System.AttributeTargets.Field | System.AttributeTargets.Property, AllowMultiple = true)]
20+
public class TextSearchable : System.Attribute
21+
{
22+
}
23+
}
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
/********************************************************************************
2+
* Copyright (c) {2019 - 2024} Contributors to the Eclipse Foundation
3+
*
4+
* See the NOTICE file(s) distributed with this work for additional
5+
* information regarding copyright ownership.
6+
*
7+
* This program and the accompanying materials are made available under the
8+
* terms of the Apache License Version 2.0 which is available at
9+
* https://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* SPDX-License-Identifier: Apache-2.0
12+
********************************************************************************/
13+
14+
using AasCore.Aas3_0;
15+
using System;
16+
using System.Collections.Generic;
17+
using System.Text.Json.Serialization;
18+
using System.Xml.Serialization;
19+
20+
namespace AdminShellNS.DiaryData
21+
{
22+
public class DiaryDataDef
23+
{
24+
public enum TimeStampKind { Create, Update }
25+
26+
[XmlIgnore]
27+
[JsonIgnore]
28+
private DateTime[] _timeStamp = new DateTime[2];
29+
30+
[XmlIgnore]
31+
[JsonIgnore]
32+
public DateTime[] TimeStamp { get { return _timeStamp; } }
33+
34+
/// <summary>
35+
/// List of entries, timewise one after each other (entries are timestamped).
36+
/// Note: Default is <c>Entries = null</c>, as handling of many many AAS elements does not
37+
/// create additional overhead of creating empty lists. An empty list shall be avoided.
38+
/// </summary>
39+
public List<IAasDiaryEntry> Entries = null;
40+
41+
public static void AddAndSetTimestamps(IReferable element, IAasDiaryEntry de, bool isCreate = false)
42+
{
43+
// trivial
44+
if (element == null || de == null || element.DiaryData == null)
45+
return;
46+
47+
// add entry
48+
if (element.DiaryData.Entries == null)
49+
element.DiaryData.Entries = new List<IAasDiaryEntry>();
50+
element.DiaryData.Entries.Add(de);
51+
52+
// figure out which timestamp
53+
var tsk = TimeStampKind.Update;
54+
if (isCreate)
55+
{
56+
tsk = TimeStampKind.Create;
57+
}
58+
59+
// set this timestamp (and for the parents, as well)
60+
IDiaryData el = element;
61+
while (el?.DiaryData != null)
62+
{
63+
// itself
64+
el.DiaryData.TimeStamp[(int)tsk] = DateTime.UtcNow;
65+
66+
// go up
67+
el = (el as IReferable)?.Parent as IDiaryData;
68+
}
69+
}
70+
}
71+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/********************************************************************************
2+
* Copyright (c) {2019 - 2024} Contributors to the Eclipse Foundation
3+
*
4+
* See the NOTICE file(s) distributed with this work for additional
5+
* information regarding copyright ownership.
6+
*
7+
* This program and the accompanying materials are made available under the
8+
* terms of the Apache License Version 2.0 which is available at
9+
* https://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* SPDX-License-Identifier: Apache-2.0
12+
********************************************************************************/
13+
14+
namespace AdminShellNS.DiaryData
15+
{
16+
public interface IAasDiaryEntry
17+
{
18+
}
19+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/********************************************************************************
2+
* Copyright (c) {2019 - 2024} Contributors to the Eclipse Foundation
3+
*
4+
* See the NOTICE file(s) distributed with this work for additional
5+
* information regarding copyright ownership.
6+
*
7+
* This program and the accompanying materials are made available under the
8+
* terms of the Apache License Version 2.0 which is available at
9+
* https://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* SPDX-License-Identifier: Apache-2.0
12+
********************************************************************************/
13+
14+
using System;
15+
using System.Collections.Generic;
16+
using System.Linq;
17+
using System.Text;
18+
using System.Threading.Tasks;
19+
20+
namespace AdminShellNS.DiaryData
21+
{
22+
public interface IDiaryData
23+
{
24+
DiaryDataDef DiaryData { get; }
25+
}
26+
}

0 commit comments

Comments
 (0)