-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
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
authored and
a.vorobiev
committed
Feb 1, 2022
1 parent
41de278
commit 91e85cb
Showing
387 changed files
with
10,839 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -286,4 +286,4 @@ __pycache__/ | |
*.btm.cs | ||
*.odx.cs | ||
*.xsd.cs | ||
/*/*.orig | ||
/**/*.orig |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// -------------------------------------------------------------------------------------------------------------------- | ||
// <copyright file="AttachmentTestFixture.cs" company="RHEA System S.A."> | ||
// Copyright (c) 2015-2021 RHEA System S.A. | ||
// | ||
// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft | ||
// | ||
// This file is part of CDP4-SDK Community Edition | ||
// | ||
// The CDP4-SDK Community Edition is free software; you can redistribute it and/or | ||
// modify it under the terms of the GNU Lesser General Public | ||
// License as published by the Free Software Foundation; either | ||
// version 3 of the License, or (at your option) any later version. | ||
// | ||
// The CDP4-SDK Community Edition is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
// Lesser General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU Lesser General Public License | ||
// along with this program; if not, write to the Free Software Foundation, | ||
// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
// </copyright> | ||
// -------------------------------------------------------------------------------------------------------------------- | ||
|
||
namespace CDP4Common.Tests.Poco | ||
{ | ||
using System; | ||
|
||
using CDP4Common.EngineeringModelData; | ||
using CDP4Common.SiteDirectoryData; | ||
|
||
using NUnit.Framework; | ||
|
||
[TestFixture] | ||
internal class AttachmentTestFixture | ||
{ | ||
private Attachment attachment; | ||
|
||
[SetUp] | ||
public void Setup() | ||
{ | ||
this.attachment = new Attachment(Guid.NewGuid(), null, null); | ||
this.attachment.FileName = "filerev"; | ||
|
||
this.attachment.FileType.Add(new FileType(Guid.NewGuid(), null, null) { Extension = "ext1" }); | ||
this.attachment.FileType.Add(new FileType(Guid.NewGuid(), null, null) { Extension = "ext2" }); | ||
} | ||
|
||
[Test] | ||
public void VerifyPathForFileRevisionLocatedInFileStore() | ||
{ | ||
Assert.AreEqual("filerev.ext1.ext2", this.attachment.Path); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// -------------------------------------------------------------------------------------------------------------------- | ||
// <copyright file="AttachmentTestFixture.cs" company="RHEA System S.A."> | ||
// Copyright (c) 2015-2021 RHEA System S.A. | ||
// | ||
// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft | ||
// | ||
// This file is part of CDP4-SDK Community Edition | ||
// | ||
// The CDP4-SDK Community Edition is free software; you can redistribute it and/or | ||
// modify it under the terms of the GNU Lesser General Public | ||
// License as published by the Free Software Foundation; either | ||
// version 3 of the License, or (at your option) any later version. | ||
// | ||
// The CDP4-SDK Community Edition is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
// Lesser General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU Lesser General Public License | ||
// along with this program; if not, write to the Free Software Foundation, | ||
// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
// </copyright> | ||
// -------------------------------------------------------------------------------------------------------------------- | ||
|
||
namespace CDP4Common.Tests.Poco | ||
{ | ||
using System; | ||
|
||
using CDP4Common.EngineeringModelData; | ||
using CDP4Common.SiteDirectoryData; | ||
|
||
using NUnit.Framework; | ||
|
||
[TestFixture] | ||
internal class AttachmentTestFixture | ||
{ | ||
private Attachment attachment; | ||
|
||
[SetUp] | ||
public void Setup() | ||
{ | ||
this.attachment = new Attachment(Guid.NewGuid(), null, null); | ||
this.attachment.FileName = "filerev"; | ||
|
||
this.attachment.FileType.Add(new FileType(Guid.NewGuid(), null, null) { Extension = "ext1" }); | ||
this.attachment.FileType.Add(new FileType(Guid.NewGuid(), null, null) { Extension = "ext2" }); | ||
} | ||
|
||
[Test] | ||
public void VerifyPathForFileRevisionLocatedInFileStore() | ||
{ | ||
Assert.AreEqual("filerev.ext1.ext2", this.attachment.Path); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,180 @@ | ||
// -------------------------------------------------------------------------------------------------------------------- | ||
// <copyright file="ArchitectureDiagram.cs" company="RHEA System S.A."> | ||
// Copyright (c) 2015-2021 RHEA System S.A. | ||
// | ||
// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski | ||
// | ||
// This file is part of COMET-SDK Community Edition | ||
// This is an auto-generated class. Any manual changes to this file will be overwritten! | ||
// | ||
// The COMET-SDK Community Edition is free software; you can redistribute it and/or | ||
// modify it under the terms of the GNU Lesser General Public | ||
// License as published by the Free Software Foundation; either | ||
// version 3 of the License, or (at your option) any later version. | ||
// | ||
// The COMET-SDK Community Edition is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
// Lesser General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU Lesser General Public License | ||
// along with this program; if not, write to the Free Software Foundation, | ||
// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
// -------------------------------------------------------------------------------------------------------------------- | ||
|
||
namespace CDP4Common.DTO | ||
{ | ||
using System; | ||
using System.Collections; | ||
using System.Collections.Concurrent; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Runtime.Serialization; | ||
using System.Xml.Serialization; | ||
using CDP4Common.CommonData; | ||
using CDP4Common.DiagramData; | ||
using CDP4Common.EngineeringModelData; | ||
using CDP4Common.ReportingData; | ||
using CDP4Common.SiteDirectoryData; | ||
using CDP4Common.Types; | ||
|
||
/// <summary> | ||
/// A Data Transfer Object representation of the <see cref="ArchitectureDiagram"/> class. | ||
/// </summary> | ||
[DataContract] | ||
[CDPVersion("1.3.0")] | ||
[Container(typeof(Iteration), "DiagramCanvas")] | ||
public sealed partial class ArchitectureDiagram : DiagramCanvas, IOwnedThing | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="ArchitectureDiagram"/> class. | ||
/// </summary> | ||
public ArchitectureDiagram() | ||
{ | ||
} | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="ArchitectureDiagram"/> class. | ||
/// </summary> | ||
/// <param name="iid"> | ||
/// The unique identifier. | ||
/// </param> | ||
/// <param name="rev"> | ||
/// The revision number. | ||
/// </param> | ||
public ArchitectureDiagram(Guid iid, int rev) : base(iid: iid, rev: rev) | ||
{ | ||
} | ||
|
||
/// <summary> | ||
/// Gets or sets the unique identifier of the referenced Owner. | ||
/// </summary> | ||
[UmlInformation(aggregation: AggregationKind.None, isDerived: false, isOrdered: false, isNullable: false, isPersistent: true)] | ||
[DataMember] | ||
public Guid Owner { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the unique identifier of the referenced TopArchitectureElement. | ||
/// </summary> | ||
[UmlInformation(aggregation: AggregationKind.None, isDerived: false, isOrdered: false, isNullable: true, isPersistent: true)] | ||
[DataMember] | ||
public Guid? TopArchitectureElement { get; set; } | ||
|
||
/// <summary> | ||
/// Gets the route for the current <see ref="ArchitectureDiagram"/>. | ||
/// </summary> | ||
public override string Route | ||
{ | ||
get { return this.ComputedRoute(); } | ||
} | ||
|
||
/// <summary> | ||
/// Instantiate a <see cref="CDP4Common.DiagramData.ArchitectureDiagram"/> from a <see cref="ArchitectureDiagram"/> | ||
/// </summary> | ||
/// <param name="cache">The cache that stores all the <see cref="CommonData.Thing"/>s</param>. | ||
/// <param name="uri">The <see cref="Uri"/> of the <see cref="CDP4Common.DiagramData.ArchitectureDiagram"/></param>. | ||
/// <returns>A new <see cref="CommonData.Thing"/></returns> | ||
public override CommonData.Thing InstantiatePoco(ConcurrentDictionary<CacheKey, Lazy<CommonData.Thing>> cache, Uri uri) | ||
{ | ||
return new CDP4Common.DiagramData.ArchitectureDiagram(this.Iid, cache, uri); | ||
} | ||
|
||
/// <summary> | ||
/// Resolves the properties of a copied <see cref="Thing"/> based on the original and a collection of copied <see cref="Thing"/>. | ||
/// </summary> | ||
/// <param name="originalThing">The original <see cref="Thing"/></param>. | ||
/// <param name="originalCopyMap">The map containig all instance of copied <see cref="Thing"/>s with their original</param>. | ||
public override void ResolveCopy(Thing originalThing, IReadOnlyDictionary<Thing, Thing> originalCopyMap) | ||
{ | ||
var original = originalThing as ArchitectureDiagram; | ||
if (original == null) | ||
{ | ||
throw new InvalidOperationException("The originalThing cannot be null or is of the incorrect type"); | ||
} | ||
|
||
foreach (var guid in original.Bounds) | ||
{ | ||
var copy = originalCopyMap.SingleOrDefault(kvp => kvp.Key.Iid == guid); | ||
if (Equals(copy, default(KeyValuePair<Thing, Thing>))) | ||
{ | ||
throw new InvalidOperationException(string.Format("The copy could not be found for {0}", guid)); | ||
} | ||
|
||
this.Bounds.Add(copy.Value.Iid); | ||
} | ||
|
||
this.CreatedOn = original.CreatedOn; | ||
|
||
this.Description = original.Description; | ||
|
||
foreach (var guid in original.DiagramElement) | ||
{ | ||
var copy = originalCopyMap.SingleOrDefault(kvp => kvp.Key.Iid == guid); | ||
if (Equals(copy, default(KeyValuePair<Thing, Thing>))) | ||
{ | ||
throw new InvalidOperationException(string.Format("The copy could not be found for {0}", guid)); | ||
} | ||
|
||
this.DiagramElement.Add(copy.Value.Iid); | ||
} | ||
|
||
foreach (var guid in original.ExcludedDomain) | ||
{ | ||
var copy = originalCopyMap.SingleOrDefault(kvp => kvp.Key.Iid == guid); | ||
this.ExcludedDomain.Add(copy.Value == null ? guid : copy.Value.Iid); | ||
} | ||
|
||
foreach (var guid in original.ExcludedPerson) | ||
{ | ||
var copy = originalCopyMap.SingleOrDefault(kvp => kvp.Key.Iid == guid); | ||
this.ExcludedPerson.Add(copy.Value == null ? guid : copy.Value.Iid); | ||
} | ||
|
||
this.ModifiedOn = original.ModifiedOn; | ||
|
||
this.Name = original.Name; | ||
|
||
var copyOwner = originalCopyMap.SingleOrDefault(kvp => kvp.Key.Iid == original.Owner); | ||
this.Owner = copyOwner.Value == null ? original.Owner : copyOwner.Value.Iid; | ||
|
||
this.PublicationState = original.PublicationState; | ||
|
||
this.ThingPreference = original.ThingPreference; | ||
|
||
var copyTopArchitectureElement = originalCopyMap.SingleOrDefault(kvp => kvp.Key.Iid == original.TopArchitectureElement); | ||
this.TopArchitectureElement = copyTopArchitectureElement.Value == null ? original.TopArchitectureElement : copyTopArchitectureElement.Value.Iid; | ||
} | ||
|
||
/// <summary> | ||
/// Resolves the references of a copied <see cref="Thing"/> based on a original to copy map. | ||
/// </summary> | ||
/// <param name="originalCopyMap">The map containig all instance of copied <see cref="Thing"/>s with their original</param>. | ||
/// <returns>True if a modification was done in the process of this method</returns>. | ||
public override bool ResolveCopyReference(IReadOnlyDictionary<Thing, Thing> originalCopyMap) | ||
{ | ||
var hasChanges = false; | ||
|
||
return hasChanges; | ||
} | ||
} | ||
} |
Oops, something went wrong.