Skip to content

Commit 91e85cb

Browse files
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a.vorobiev
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
authored and
a.vorobiev
committed
Model version 1.3.17 and features
Header versions update Wrong Participant Permission on Behavior More forgotten participant permissions for Behaviors Fixed interface for attachments and DAL handling of file verification Architecture Diagram must have own permission set to support Modify if owned Attachment finetuning (#203) * Add Path property to Attachment * Implement Attachment functionality * Version bump * Code review changes * Fix according to review Participant Role test and session fix (#204) * Participant Role test and session fix * Refactor CanCancel and Cancel using only thread safe methods ignore file updates Bumped version number Model version 1.3.17 Wrong Participant Permission on Behavior More forgotten participant permissions for Behaviors Architecture Diagram must have own permission set to support Modify if owned Version bump Bump versions Revert "Bumped version number" This reverts commit c7b101e.
1 parent 41de278 commit 91e85cb

File tree

387 files changed

+10839
-93
lines changed

Some content is hidden

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

387 files changed

+10839
-93
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,4 +286,4 @@ __pycache__/
286286
*.btm.cs
287287
*.odx.cs
288288
*.xsd.cs
289-
/*/*.orig
289+
/**/*.orig

CDP4Common.NetCore.Tests/Helpers/TypeResolverTestFixture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public void Verify_that_GetDerivedTypes_returns_expected_results()
4949

5050
var subtypes = TypeResolver.GetDerivedTypes(subjectType, assembly).ToList();
5151

52-
Assert.That(subtypes.Count, Is.EqualTo(67));
52+
Assert.That(subtypes.Count, Is.EqualTo(68));
5353
}
5454

5555
[Test]
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
// --------------------------------------------------------------------------------------------------------------------
2+
// <copyright file="AttachmentTestFixture.cs" company="RHEA System S.A.">
3+
// Copyright (c) 2015-2021 RHEA System S.A.
4+
//
5+
// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft
6+
//
7+
// This file is part of CDP4-SDK Community Edition
8+
//
9+
// The CDP4-SDK Community Edition is free software; you can redistribute it and/or
10+
// modify it under the terms of the GNU Lesser General Public
11+
// License as published by the Free Software Foundation; either
12+
// version 3 of the License, or (at your option) any later version.
13+
//
14+
// The CDP4-SDK Community Edition is distributed in the hope that it will be useful,
15+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17+
// Lesser General Public License for more details.
18+
//
19+
// You should have received a copy of the GNU Lesser General Public License
20+
// along with this program; if not, write to the Free Software Foundation,
21+
// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22+
// </copyright>
23+
// --------------------------------------------------------------------------------------------------------------------
24+
25+
namespace CDP4Common.Tests.Poco
26+
{
27+
using System;
28+
29+
using CDP4Common.EngineeringModelData;
30+
using CDP4Common.SiteDirectoryData;
31+
32+
using NUnit.Framework;
33+
34+
[TestFixture]
35+
internal class AttachmentTestFixture
36+
{
37+
private Attachment attachment;
38+
39+
[SetUp]
40+
public void Setup()
41+
{
42+
this.attachment = new Attachment(Guid.NewGuid(), null, null);
43+
this.attachment.FileName = "filerev";
44+
45+
this.attachment.FileType.Add(new FileType(Guid.NewGuid(), null, null) { Extension = "ext1" });
46+
this.attachment.FileType.Add(new FileType(Guid.NewGuid(), null, null) { Extension = "ext2" });
47+
}
48+
49+
[Test]
50+
public void VerifyPathForFileRevisionLocatedInFileStore()
51+
{
52+
Assert.AreEqual("filerev.ext1.ext2", this.attachment.Path);
53+
}
54+
}
55+
}

CDP4Common.NetCore.Tests/Poco/ParticipantRoleTestFixture.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// --------------------------------------------------------------------------------------------------------------------
22
// <copyright file="ParticipantRoleTestFixture.cs" company="RHEA System S.A.">
3-
// Copyright (c) 2015-2020 RHEA System S.A.
3+
// Copyright (c) 2015-2021 RHEA System S.A.
44
//
5-
// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou
5+
// Author: Sam Gerené, Alex Vorobiev, Naron Phou, Patxi Ozkoidi, Alexander van Delft, Nathanael Smiechowski, Ahmed Ahmed, Simon Wood
66
//
77
// This file is part of CDP4-SDK Community Edition
88
//
@@ -38,8 +38,8 @@ internal class ParticipantRoleTestFixture
3838
public void VerifyPopulateParticipantPermissions()
3939
{
4040
var participantRole = new ParticipantRole();
41-
Assert.AreEqual(48, participantRole.ParticipantPermission.Count);
41+
Assert.AreEqual(49, participantRole.ParticipantPermission.Count);
4242
Assert.IsTrue(participantRole.ParticipantPermission.All(x => x.AccessRight == ParticipantAccessRightKind.NONE));
4343
}
4444
}
45-
}
45+
}

CDP4Common.Tests/Helpers/TypeResolverTestFixture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public void Verify_that_GetDerivedTypes_returns_expected_results()
4747

4848
var subtypes = TypeResolver.GetDerivedTypes(subjectType, assembly).ToList();
4949

50-
Assert.That(subtypes.Count, Is.EqualTo(67));
50+
Assert.That(subtypes.Count, Is.EqualTo(68));
5151
}
5252

5353
[Test]
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
// --------------------------------------------------------------------------------------------------------------------
2+
// <copyright file="AttachmentTestFixture.cs" company="RHEA System S.A.">
3+
// Copyright (c) 2015-2021 RHEA System S.A.
4+
//
5+
// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft
6+
//
7+
// This file is part of CDP4-SDK Community Edition
8+
//
9+
// The CDP4-SDK Community Edition is free software; you can redistribute it and/or
10+
// modify it under the terms of the GNU Lesser General Public
11+
// License as published by the Free Software Foundation; either
12+
// version 3 of the License, or (at your option) any later version.
13+
//
14+
// The CDP4-SDK Community Edition is distributed in the hope that it will be useful,
15+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17+
// Lesser General Public License for more details.
18+
//
19+
// You should have received a copy of the GNU Lesser General Public License
20+
// along with this program; if not, write to the Free Software Foundation,
21+
// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22+
// </copyright>
23+
// --------------------------------------------------------------------------------------------------------------------
24+
25+
namespace CDP4Common.Tests.Poco
26+
{
27+
using System;
28+
29+
using CDP4Common.EngineeringModelData;
30+
using CDP4Common.SiteDirectoryData;
31+
32+
using NUnit.Framework;
33+
34+
[TestFixture]
35+
internal class AttachmentTestFixture
36+
{
37+
private Attachment attachment;
38+
39+
[SetUp]
40+
public void Setup()
41+
{
42+
this.attachment = new Attachment(Guid.NewGuid(), null, null);
43+
this.attachment.FileName = "filerev";
44+
45+
this.attachment.FileType.Add(new FileType(Guid.NewGuid(), null, null) { Extension = "ext1" });
46+
this.attachment.FileType.Add(new FileType(Guid.NewGuid(), null, null) { Extension = "ext2" });
47+
}
48+
49+
[Test]
50+
public void VerifyPathForFileRevisionLocatedInFileStore()
51+
{
52+
Assert.AreEqual("filerev.ext1.ext2", this.attachment.Path);
53+
}
54+
}
55+
}

CDP4Common.Tests/Poco/ParticipantRoleTestFixture.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
#region Copyright
2-
// --------------------------------------------------------------------------------------------------------------------
1+
// --------------------------------------------------------------------------------------------------------------------
32
// <copyright file="ParticipantRoleTestFixture.cs" company="RHEA System S.A.">
4-
// Copyright (c) 2015-2019 RHEA System S.A.
3+
// Copyright (c) 2015-2021 RHEA System S.A.
54
//
6-
// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou
5+
// Author: Sam Gerené, Alex Vorobiev, Naron Phou, Patxi Ozkoidi, Alexander van Delft, Nathanael Smiechowski, Ahmed Ahmed, Simon Wood
76
//
87
// This file is part of CDP4-SDK Community Edition
98
//
@@ -22,13 +21,14 @@
2221
// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
2322
// </copyright>
2423
// --------------------------------------------------------------------------------------------------------------------
25-
#endregion
2624

2725
namespace CDP4Common.Tests.Poco
2826
{
2927
using System.Linq;
28+
3029
using CDP4Common.CommonData;
3130
using CDP4Common.SiteDirectoryData;
31+
3232
using NUnit.Framework;
3333

3434
[TestFixture]
@@ -38,8 +38,8 @@ internal class ParticipantRoleTestFixture
3838
public void VerifyPopulateParticipantPermissions()
3939
{
4040
var participantRole = new ParticipantRole();
41-
Assert.AreEqual(48, participantRole.ParticipantPermission.Count);
41+
Assert.AreEqual(49, participantRole.ParticipantPermission.Count);
4242
Assert.IsTrue(participantRole.ParticipantPermission.All(x => x.AccessRight == ParticipantAccessRightKind.NONE));
4343
}
4444
}
45-
}
45+
}
Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
// --------------------------------------------------------------------------------------------------------------------
2+
// <copyright file="ArchitectureDiagram.cs" company="RHEA System S.A.">
3+
// Copyright (c) 2015-2021 RHEA System S.A.
4+
//
5+
// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski
6+
//
7+
// This file is part of COMET-SDK Community Edition
8+
// This is an auto-generated class. Any manual changes to this file will be overwritten!
9+
//
10+
// The COMET-SDK Community Edition is free software; you can redistribute it and/or
11+
// modify it under the terms of the GNU Lesser General Public
12+
// License as published by the Free Software Foundation; either
13+
// version 3 of the License, or (at your option) any later version.
14+
//
15+
// The COMET-SDK Community Edition is distributed in the hope that it will be useful,
16+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
17+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18+
// Lesser General Public License for more details.
19+
//
20+
// You should have received a copy of the GNU Lesser General Public License
21+
// along with this program; if not, write to the Free Software Foundation,
22+
// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23+
// --------------------------------------------------------------------------------------------------------------------
24+
25+
namespace CDP4Common.DTO
26+
{
27+
using System;
28+
using System.Collections;
29+
using System.Collections.Concurrent;
30+
using System.Collections.Generic;
31+
using System.Linq;
32+
using System.Runtime.Serialization;
33+
using System.Xml.Serialization;
34+
using CDP4Common.CommonData;
35+
using CDP4Common.DiagramData;
36+
using CDP4Common.EngineeringModelData;
37+
using CDP4Common.ReportingData;
38+
using CDP4Common.SiteDirectoryData;
39+
using CDP4Common.Types;
40+
41+
/// <summary>
42+
/// A Data Transfer Object representation of the <see cref="ArchitectureDiagram"/> class.
43+
/// </summary>
44+
[DataContract]
45+
[CDPVersion("1.3.0")]
46+
[Container(typeof(Iteration), "DiagramCanvas")]
47+
public sealed partial class ArchitectureDiagram : DiagramCanvas, IOwnedThing
48+
{
49+
/// <summary>
50+
/// Initializes a new instance of the <see cref="ArchitectureDiagram"/> class.
51+
/// </summary>
52+
public ArchitectureDiagram()
53+
{
54+
}
55+
56+
/// <summary>
57+
/// Initializes a new instance of the <see cref="ArchitectureDiagram"/> class.
58+
/// </summary>
59+
/// <param name="iid">
60+
/// The unique identifier.
61+
/// </param>
62+
/// <param name="rev">
63+
/// The revision number.
64+
/// </param>
65+
public ArchitectureDiagram(Guid iid, int rev) : base(iid: iid, rev: rev)
66+
{
67+
}
68+
69+
/// <summary>
70+
/// Gets or sets the unique identifier of the referenced Owner.
71+
/// </summary>
72+
[UmlInformation(aggregation: AggregationKind.None, isDerived: false, isOrdered: false, isNullable: false, isPersistent: true)]
73+
[DataMember]
74+
public Guid Owner { get; set; }
75+
76+
/// <summary>
77+
/// Gets or sets the unique identifier of the referenced TopArchitectureElement.
78+
/// </summary>
79+
[UmlInformation(aggregation: AggregationKind.None, isDerived: false, isOrdered: false, isNullable: true, isPersistent: true)]
80+
[DataMember]
81+
public Guid? TopArchitectureElement { get; set; }
82+
83+
/// <summary>
84+
/// Gets the route for the current <see ref="ArchitectureDiagram"/>.
85+
/// </summary>
86+
public override string Route
87+
{
88+
get { return this.ComputedRoute(); }
89+
}
90+
91+
/// <summary>
92+
/// Instantiate a <see cref="CDP4Common.DiagramData.ArchitectureDiagram"/> from a <see cref="ArchitectureDiagram"/>
93+
/// </summary>
94+
/// <param name="cache">The cache that stores all the <see cref="CommonData.Thing"/>s</param>.
95+
/// <param name="uri">The <see cref="Uri"/> of the <see cref="CDP4Common.DiagramData.ArchitectureDiagram"/></param>.
96+
/// <returns>A new <see cref="CommonData.Thing"/></returns>
97+
public override CommonData.Thing InstantiatePoco(ConcurrentDictionary<CacheKey, Lazy<CommonData.Thing>> cache, Uri uri)
98+
{
99+
return new CDP4Common.DiagramData.ArchitectureDiagram(this.Iid, cache, uri);
100+
}
101+
102+
/// <summary>
103+
/// Resolves the properties of a copied <see cref="Thing"/> based on the original and a collection of copied <see cref="Thing"/>.
104+
/// </summary>
105+
/// <param name="originalThing">The original <see cref="Thing"/></param>.
106+
/// <param name="originalCopyMap">The map containig all instance of copied <see cref="Thing"/>s with their original</param>.
107+
public override void ResolveCopy(Thing originalThing, IReadOnlyDictionary<Thing, Thing> originalCopyMap)
108+
{
109+
var original = originalThing as ArchitectureDiagram;
110+
if (original == null)
111+
{
112+
throw new InvalidOperationException("The originalThing cannot be null or is of the incorrect type");
113+
}
114+
115+
foreach (var guid in original.Bounds)
116+
{
117+
var copy = originalCopyMap.SingleOrDefault(kvp => kvp.Key.Iid == guid);
118+
if (Equals(copy, default(KeyValuePair<Thing, Thing>)))
119+
{
120+
throw new InvalidOperationException(string.Format("The copy could not be found for {0}", guid));
121+
}
122+
123+
this.Bounds.Add(copy.Value.Iid);
124+
}
125+
126+
this.CreatedOn = original.CreatedOn;
127+
128+
this.Description = original.Description;
129+
130+
foreach (var guid in original.DiagramElement)
131+
{
132+
var copy = originalCopyMap.SingleOrDefault(kvp => kvp.Key.Iid == guid);
133+
if (Equals(copy, default(KeyValuePair<Thing, Thing>)))
134+
{
135+
throw new InvalidOperationException(string.Format("The copy could not be found for {0}", guid));
136+
}
137+
138+
this.DiagramElement.Add(copy.Value.Iid);
139+
}
140+
141+
foreach (var guid in original.ExcludedDomain)
142+
{
143+
var copy = originalCopyMap.SingleOrDefault(kvp => kvp.Key.Iid == guid);
144+
this.ExcludedDomain.Add(copy.Value == null ? guid : copy.Value.Iid);
145+
}
146+
147+
foreach (var guid in original.ExcludedPerson)
148+
{
149+
var copy = originalCopyMap.SingleOrDefault(kvp => kvp.Key.Iid == guid);
150+
this.ExcludedPerson.Add(copy.Value == null ? guid : copy.Value.Iid);
151+
}
152+
153+
this.ModifiedOn = original.ModifiedOn;
154+
155+
this.Name = original.Name;
156+
157+
var copyOwner = originalCopyMap.SingleOrDefault(kvp => kvp.Key.Iid == original.Owner);
158+
this.Owner = copyOwner.Value == null ? original.Owner : copyOwner.Value.Iid;
159+
160+
this.PublicationState = original.PublicationState;
161+
162+
this.ThingPreference = original.ThingPreference;
163+
164+
var copyTopArchitectureElement = originalCopyMap.SingleOrDefault(kvp => kvp.Key.Iid == original.TopArchitectureElement);
165+
this.TopArchitectureElement = copyTopArchitectureElement.Value == null ? original.TopArchitectureElement : copyTopArchitectureElement.Value.Iid;
166+
}
167+
168+
/// <summary>
169+
/// Resolves the references of a copied <see cref="Thing"/> based on a original to copy map.
170+
/// </summary>
171+
/// <param name="originalCopyMap">The map containig all instance of copied <see cref="Thing"/>s with their original</param>.
172+
/// <returns>True if a modification was done in the process of this method</returns>.
173+
public override bool ResolveCopyReference(IReadOnlyDictionary<Thing, Thing> originalCopyMap)
174+
{
175+
var hasChanges = false;
176+
177+
return hasChanges;
178+
}
179+
}
180+
}

0 commit comments

Comments
 (0)