From 5948654d1294e70a610dfa858c3b7d748cab0b28 Mon Sep 17 00:00:00 2001 From: Thomas Fuchs Date: Sun, 24 Jul 2022 19:38:45 +0200 Subject: [PATCH 01/12] Update VERSION --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 9f7a8aa9..5ea0b34f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -5.13.1 +5.13.2 From 03470b31b2f94c49c4573e327633669120aa6b7b Mon Sep 17 00:00:00 2001 From: Wjatscheslaw Sujev Date: Wed, 10 Aug 2022 17:41:14 +0200 Subject: [PATCH 02/12] Added missing step id to have the possibility to identify the corresponding step in the workplan --- src/Moryx.AbstractionLayer/Activities/Activity.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Moryx.AbstractionLayer/Activities/Activity.cs b/src/Moryx.AbstractionLayer/Activities/Activity.cs index aaaec6ce..72f0bfeb 100644 --- a/src/Moryx.AbstractionLayer/Activities/Activity.cs +++ b/src/Moryx.AbstractionLayer/Activities/Activity.cs @@ -46,6 +46,11 @@ public abstract class Activity : IActivity /// public string Name { get; set; } + /// + /// Id of the corresponding workplan step + /// + public long StepId { get; set; } + #endregion /// From b2b586a74514098cabb81326bf4d909a5daedba0 Mon Sep 17 00:00:00 2001 From: Marisa Goergen Date: Tue, 23 Aug 2022 12:36:17 +0200 Subject: [PATCH 03/12] Invoking a method without return value creates no error --- .../ResourceManagementController.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Moryx.AbstractionLayer.Resources.Endpoints/ResourceManagementController.cs b/src/Moryx.AbstractionLayer.Resources.Endpoints/ResourceManagementController.cs index 3fbf2528..d3217288 100644 --- a/src/Moryx.AbstractionLayer.Resources.Endpoints/ResourceManagementController.cs +++ b/src/Moryx.AbstractionLayer.Resources.Endpoints/ResourceManagementController.cs @@ -108,8 +108,6 @@ public ActionResult InvokeMethod(long id, string method, Entry parameters entry = EntryConvert.InvokeMethod(r.Descriptor, new MethodEntry { Name = method, Parameters = parameters }, _serialization); return true; }); - if (entry is null) - return Conflict("Method could not be invoked."); return entry; } From 653f9064599753aeb8da01ec2f2764495bb4c87b Mon Sep 17 00:00:00 2001 From: Marcel Vielhaus <37485711+1nf0rmagician@users.noreply.github.com> Date: Tue, 30 Aug 2022 08:20:34 +0200 Subject: [PATCH 04/12] Update README.md Add future packages to listing --- README.md | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 27fbd37e..82e29c55 100644 --- a/README.md +++ b/README.md @@ -32,22 +32,22 @@ The **MORYX AbstractionLayer** is the environment for the digital twins of resou If you want to start developing with or for MORYX, the easiest way is our [template repository](https://github.com/PHOENIXCONTACT/MORYX-Template). It comes with two empty solutions, the necessary package feeds and preinstalled empty MORYX runtime. Add projects and packages to backend and frontend solutions depending on your specific requirements. Install stable releases via Nuget; development releases are available via MyGet. -| Package Name | Release (NuGet) | CI (MyGet) | -|--------------|-----------------|------------| -| `Moryx.AbstractionLayer` | [![NuGet](https://img.shields.io/nuget/v/Moryx.AbstractionLayer.svg)](https://www.nuget.org/packages/Moryx.AbstractionLayer/) | [![MyGet](https://img.shields.io/myget/moryx/vpre/Moryx.AbstractionLayer)](https://www.myget.org/feed/moryx/package/nuget/Moryx.AbstractionLayer) | -| `Moryx.AbstractionLayer.TestTools` | [![NuGet](https://img.shields.io/nuget/v/Moryx.AbstractionLayer.TestTools.svg)](https://www.nuget.org/packages/Moryx.AbstractionLayer.TestTools/) | [![MyGet](https://img.shields.io/myget/moryx/vpre/Moryx.AbstractionLayer.TestTools)](https://www.myget.org/feed/moryx/package/nuget/Moryx.AbstractionLayer.TestTools) | -| `Moryx.AbstractionLayer.Products.Endpoints` | [![NuGet](https://img.shields.io/nuget/v/Moryx.AbstractionLayer.Products.Endpoints.svg)](https://www.nuget.org/packages/Moryx.AbstractionLayer.Products.Endpoints/) | [![MyGet](https://img.shields.io/myget/moryx/vpre/Moryx.AbstractionLayer.Products.Endpoints)](https://www.myget.org/feed/moryx/package/nuget/Moryx.AbstractionLayer.Products.Endpoints) | -| `Moryx.AbstractionLayer.Resources.Endpoints` | [![NuGet](https://img.shields.io/nuget/v/Moryx.AbstractionLayer.Resources.Endpoints.svg)](https://www.nuget.org/packages/Moryx.AbstractionLayer.Resources.Endpoints/) | [![MyGet](https://img.shields.io/myget/moryx/vpre/Moryx.AbstractionLayer.Resources.Endpoints)](https://www.myget.org/feed/moryx/package/nuget/Moryx.AbstractionLayer.Resources.Endpoints) | -| `Moryx.Notifications` | [![NuGet](https://img.shields.io/nuget/v/Moryx.Notifications.svg)](https://www.nuget.org/packages/Moryx.Notifications/) | [![MyGet](https://img.shields.io/myget/moryx/vpre/Moryx.Notifications)](https://www.myget.org/feed/moryx/package/nuget/Moryx.Notifications) | -| `Moryx.Products.Management` | [![NuGet](https://img.shields.io/nuget/v/Moryx.Products.Management.svg)](https://www.nuget.org/packages/Moryx.Products.Management/) | [![MyGet](https://img.shields.io/myget/moryx/vpre/Moryx.Products.Management)](https://www.myget.org/feed/moryx/package/nuget/Moryx.Products.Management) | -| `Moryx.Products.Model` | [![NuGet](https://img.shields.io/nuget/v/Moryx.Products.Model.svg)](https://www.nuget.org/packages/Moryx.Products.Model/) | [![MyGet](https://img.shields.io/myget/moryx/vpre/Moryx.Products.Model)](https://www.myget.org/feed/moryx/package/nuget/Moryx.Products.Model) | -| `Moryx.Resources.Interaction` | [![NuGet](https://img.shields.io/nuget/v/Moryx.Resources.Interaction.svg)](https://www.nuget.org/packages/Moryx.Resources.Interaction/) | [![MyGet](https://img.shields.io/myget/moryx/vpre/Moryx.Resources.Interaction)](https://www.myget.org/feed/moryx/package/nuget/Moryx.Resources.Interaction) | -| `Moryx.Resources.Management` | [![NuGet](https://img.shields.io/nuget/v/Moryx.Resources.Management.svg)](https://www.nuget.org/packages/Moryx.Resources.Management/) | [![MyGet](https://img.shields.io/myget/moryx/vpre/Moryx.Resources.Management)](https://www.myget.org/feed/moryx/package/nuget/Moryx.Resources.Management) | -| `Moryx.AbstractionLayer.UI` | [![NuGet](https://img.shields.io/nuget/v/Moryx.AbstractionLayer.UI.svg)](https://www.nuget.org/packages/Moryx.AbstractionLayer.UI/) | [![MyGet](https://img.shields.io/myget/moryx/vpre/Moryx.AbstractionLayer.UI)](https://www.myget.org/feed/moryx/package/nuget/Moryx.AbstractionLayer.UI) | -| `Moryx.Products.UI` | [![NuGet](https://img.shields.io/nuget/v/Moryx.Products.UI.svg)](https://www.nuget.org/packages/Moryx.Products.UI/) | [![MyGet](https://img.shields.io/myget/moryx/vpre/Moryx.Products.UI)](https://www.myget.org/feed/moryx/package/nuget/Moryx.Products.UI) | -| `Moryx.Products.UI.Interaction` | [![NuGet](https://img.shields.io/nuget/v/Moryx.Products.UI.Interaction.svg)](https://www.nuget.org/packages/Moryx.Products.UI.Interaction/) | [![MyGet](https://img.shields.io/myget/moryx/vpre/Moryx.Products.UI.Interaction)](https://www.myget.org/feed/moryx/package/nuget/Moryx.Products.UI.Interaction) | -| `Moryx.Resources.UI` | [![NuGet](https://img.shields.io/nuget/v/Moryx.Resources.UI.svg)](https://www.nuget.org/packages/Moryx.Resources.UI/) | [![MyGet](https://img.shields.io/myget/moryx/vpre/Moryx.Resources.UI)](https://www.myget.org/feed/moryx/package/nuget/Moryx.Resources.UI) | -| `Moryx.Resources.UI.Interaction` | [![NuGet](https://img.shields.io/nuget/v/Moryx.Resources.UI.Interaction.svg)](https://www.nuget.org/packages/Moryx.Resources.UI.Interaction/) | [![MyGet](https://img.shields.io/myget/moryx/vpre/Moryx.Resources.UI.Interaction)](https://www.myget.org/feed/moryx/package/nuget/Moryx.Resources.UI.Interaction) | +| Package Name | Release (NuGet) | CI (MyGet) | Future (MyGet) | +|--------------|-----------------|------------|------------| +| `Moryx.AbstractionLayer` | [![NuGet](https://img.shields.io/nuget/v/Moryx.AbstractionLayer.svg)](https://www.nuget.org/packages/Moryx.AbstractionLayer/) | [![MyGet](https://img.shields.io/myget/moryx/vpre/Moryx.AbstractionLayer)](https://www.myget.org/feed/moryx/package/nuget/Moryx.AbstractionLayer) | [![MyGet](https://img.shields.io/myget/moryx-future/vpre/Moryx.AbstractionLayer)](https://www.myget.org/feed/moryx-future/package/nuget/Moryx.AbstractionLayer) | +| `Moryx.AbstractionLayer.TestTools` | [![NuGet](https://img.shields.io/nuget/v/Moryx.AbstractionLayer.TestTools.svg)](https://www.nuget.org/packages/Moryx.AbstractionLayer.TestTools/) | [![MyGet](https://img.shields.io/myget/moryx/vpre/Moryx.AbstractionLayer.TestTools)](https://www.myget.org/feed/moryx/package/nuget/Moryx.AbstractionLayer.TestTools) | [![MyGet](https://img.shields.io/myget/moryx-future/vpre/Moryx.AbstractionLayer.TestTools)](https://www.myget.org/feed/moryx-future/package/nuget/Moryx.AbstractionLayer.TestTools) | +| `Moryx.AbstractionLayer.Products.Endpoints` | [![NuGet](https://img.shields.io/nuget/v/Moryx.AbstractionLayer.Products.Endpoints.svg)](https://www.nuget.org/packages/Moryx.AbstractionLayer.Products.Endpoints/) | [![MyGet](https://img.shields.io/myget/moryx/vpre/Moryx.AbstractionLayer.Products.Endpoints)](https://www.myget.org/feed/moryx/package/nuget/Moryx.AbstractionLayer.Products.Endpoints) | [![MyGet](https://img.shields.io/myget/moryx-future/vpre/Moryx.AbstractionLayer.Products.Endpoints)](https://www.myget.org/feed/moryx-future/package/nuget/Moryx.AbstractionLayer.Products.Endpoints) | +| `Moryx.AbstractionLayer.Resources.Endpoints` | [![NuGet](https://img.shields.io/nuget/v/Moryx.AbstractionLayer.Resources.Endpoints.svg)](https://www.nuget.org/packages/Moryx.AbstractionLayer.Resources.Endpoints/) | [![MyGet](https://img.shields.io/myget/moryx/vpre/Moryx.AbstractionLayer.Resources.Endpoints)](https://www.myget.org/feed/moryx/package/nuget/Moryx.AbstractionLayer.Resources.Endpoints) | [![MyGet](https://img.shields.io/myget/moryx-future/vpre/Moryx.AbstractionLayer.Resources.Endpoints)](https://www.myget.org/feed/moryx-future/package/nuget/Moryx.AbstractionLayer.Resources.Endpoints) | +| `Moryx.Notifications` | [![NuGet](https://img.shields.io/nuget/v/Moryx.Notifications.svg)](https://www.nuget.org/packages/Moryx.Notifications/) | [![MyGet](https://img.shields.io/myget/moryx/vpre/Moryx.Notifications)](https://www.myget.org/feed/moryx/package/nuget/Moryx.Notifications) | [![MyGet](https://img.shields.io/myget/moryx-future/vpre/Moryx.Notifications)](https://www.myget.org/feed/moryx-future/package/nuget/Moryx.Notifications) | +| `Moryx.Products.Management` | [![NuGet](https://img.shields.io/nuget/v/Moryx.Products.Management.svg)](https://www.nuget.org/packages/Moryx.Products.Management/) | [![MyGet](https://img.shields.io/myget/moryx/vpre/Moryx.Products.Management)](https://www.myget.org/feed/moryx/package/nuget/Moryx.Products.Management) | [![MyGet](https://img.shields.io/myget/moryx-future/vpre/Moryx.Products.Management)](https://www.myget.org/feed/moryx-future/package/nuget/Moryx.Products.Management) | +| `Moryx.Products.Model` | [![NuGet](https://img.shields.io/nuget/v/Moryx.Products.Model.svg)](https://www.nuget.org/packages/Moryx.Products.Model/) | [![MyGet](https://img.shields.io/myget/moryx/vpre/Moryx.Products.Model)](https://www.myget.org/feed/moryx/package/nuget/Moryx.Products.Model) | [![MyGet](https://img.shields.io/myget/moryx-future/vpre/Moryx.Products.Model)](https://www.myget.org/feed/moryx-future/package/nuget/Moryx.Products.Model) | +| `Moryx.Resources.Interaction` | [![NuGet](https://img.shields.io/nuget/v/Moryx.Resources.Interaction.svg)](https://www.nuget.org/packages/Moryx.Resources.Interaction/) | [![MyGet](https://img.shields.io/myget/moryx/vpre/Moryx.Resources.Interaction)](https://www.myget.org/feed/moryx/package/nuget/Moryx.Resources.Interaction) | | +| `Moryx.Resources.Management` | [![NuGet](https://img.shields.io/nuget/v/Moryx.Resources.Management.svg)](https://www.nuget.org/packages/Moryx.Resources.Management/) | [![MyGet](https://img.shields.io/myget/moryx/vpre/Moryx.Resources.Management)](https://www.myget.org/feed/moryx/package/nuget/Moryx.Resources.Management) | [![MyGet](https://img.shields.io/myget/moryx-future/vpre/Moryx.Resources.Management)](https://www.myget.org/feed/moryx-future/package/nuget/Moryx.Resources.Management) | +| `Moryx.AbstractionLayer.UI` | [![NuGet](https://img.shields.io/nuget/v/Moryx.AbstractionLayer.UI.svg)](https://www.nuget.org/packages/Moryx.AbstractionLayer.UI/) | [![MyGet](https://img.shields.io/myget/moryx/vpre/Moryx.AbstractionLayer.UI)](https://www.myget.org/feed/moryx/package/nuget/Moryx.AbstractionLayer.UI) | | +| `Moryx.Products.UI` | [![NuGet](https://img.shields.io/nuget/v/Moryx.Products.UI.svg)](https://www.nuget.org/packages/Moryx.Products.UI/) | [![MyGet](https://img.shields.io/myget/moryx/vpre/Moryx.Products.UI)](https://www.myget.org/feed/moryx/package/nuget/Moryx.Products.UI) | | +| `Moryx.Products.UI.Interaction` | [![NuGet](https://img.shields.io/nuget/v/Moryx.Products.UI.Interaction.svg)](https://www.nuget.org/packages/Moryx.Products.UI.Interaction/) | [![MyGet](https://img.shields.io/myget/moryx/vpre/Moryx.Products.UI.Interaction)](https://www.myget.org/feed/moryx/package/nuget/Moryx.Products.UI.Interaction) | +| `Moryx.Resources.UI` | [![NuGet](https://img.shields.io/nuget/v/Moryx.Resources.UI.svg)](https://www.nuget.org/packages/Moryx.Resources.UI/) | [![MyGet](https://img.shields.io/myget/moryx/vpre/Moryx.Resources.UI)](https://www.myget.org/feed/moryx/package/nuget/Moryx.Resources.UI) | | +| `Moryx.Resources.UI.Interaction` | [![NuGet](https://img.shields.io/nuget/v/Moryx.Resources.UI.Interaction.svg)](https://www.nuget.org/packages/Moryx.Resources.UI.Interaction/) | [![MyGet](https://img.shields.io/myget/moryx/vpre/Moryx.Resources.UI.Interaction)](https://www.myget.org/feed/moryx/package/nuget/Moryx.Resources.UI.Interaction) | | Whether you want to debug and experiment with this repository or build an application based on the Abstraction Layers packages you need to follow a few simple steps to setup each of the modules. For both modules this requires the package *Moryx.Runtime.Maintenance.Web* and its [database configuration](http://localhost/maintenanceweb/#/databases). From de80e210f30d1601a3d327c2f16eea6a7fc804ea Mon Sep 17 00:00:00 2001 From: Christian Siewert Date: Thu, 29 Sep 2022 15:53:28 +0200 Subject: [PATCH 05/12] Catch exception when starting a resource, after adding it, fails When a resource cannot be started for some reason and throws an exception, after it was successfully, this should not lead to any errors. If an exception occurs, it will be logged, so that users can take action. --- .../Resources/ResourceManager.cs | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/Moryx.Resources.Management/Resources/ResourceManager.cs b/src/Moryx.Resources.Management/Resources/ResourceManager.cs index 49b88ebb..de7a6306 100644 --- a/src/Moryx.Resources.Management/Resources/ResourceManager.cs +++ b/src/Moryx.Resources.Management/Resources/ResourceManager.cs @@ -184,8 +184,7 @@ private void AddResource(Resource instance, bool registerEvents) case ResourceStartupPhase.Starting: case ResourceStartupPhase.Started: // Resources those are created during the start of a resource are automatically initialized and started also. - wrapped.Initialize(); - wrapped.Start(); + InitializeAndStart(wrapped); break; case ResourceStartupPhase.Stopping: case ResourceStartupPhase.Stopped: @@ -200,6 +199,19 @@ private void AddResource(Resource instance, bool registerEvents) RaiseResourceAdded(publicResource); } + private void InitializeAndStart(ResourceWrapper wrappedResource) + { + wrappedResource.Initialize(); + try + { + wrappedResource.Start(); + } + catch (Exception ex) + { + Logger.LogException(LogLevel.Warning, ex, "Could not start resource {0}-{1}!", wrappedResource.Target.Id, wrappedResource.Target.Name); + } + } + /// /// Register a resources events /// @@ -311,8 +323,9 @@ public void Save(Resource resource) throw; } - foreach (var instance in newResources) - AddResource(instance, true); + foreach (var instance in newResources) { + AddResource(instance, true); + } } } } From df1b35dac8f5575894e9fc5872185df7b3e0e085 Mon Sep 17 00:00:00 2001 From: matho mathias camara Date: Fri, 30 Sep 2022 07:47:09 +0200 Subject: [PATCH 06/12] Exception handled --- .../ProductManagementController.cs | 13 ++++++++++--- .../Products/IProductManagement.cs | 3 ++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/Moryx.AbstractionLayer.Products.Endpoints/ProductManagementController.cs b/src/Moryx.AbstractionLayer.Products.Endpoints/ProductManagementController.cs index a294bd71..217f72e6 100644 --- a/src/Moryx.AbstractionLayer.Products.Endpoints/ProductManagementController.cs +++ b/src/Moryx.AbstractionLayer.Products.Endpoints/ProductManagementController.cs @@ -163,10 +163,17 @@ public ActionResult GetTypeById(long id) { if (id == 0) return BadRequest($"Id was 0"); - var productType = _productManagement.LoadType(id); - if (productType == null) + try + { + var productType = _productManagement.LoadType(id); + if (productType == null) + return NotFound(); + return _productConverter.ConvertProduct(productType, false); + } + catch (ProductNotFoundException) + { return NotFound(); - return _productConverter.ConvertProduct(productType, false); + } } [HttpDelete] diff --git a/src/Moryx.AbstractionLayer/Products/IProductManagement.cs b/src/Moryx.AbstractionLayer/Products/IProductManagement.cs index 2ce1ce17..81c2e3af 100644 --- a/src/Moryx.AbstractionLayer/Products/IProductManagement.cs +++ b/src/Moryx.AbstractionLayer/Products/IProductManagement.cs @@ -24,11 +24,12 @@ public interface IProductManagement : IRecipeProvider, IWorkplans /// /// Load product type by id /// + /// Thrown when the product with the given id doesn't exist. IProductType LoadType(long id); /// /// Load product type by identity - /// + /// IProductType LoadType(ProductIdentity identity); /// From 0c812f6e830656bdfb73c542d2b1d97576742377 Mon Sep 17 00:00:00 2001 From: matho mathias camara Date: Fri, 30 Sep 2022 07:47:09 +0200 Subject: [PATCH 07/12] Exception handled --- .../ProductManagementController.cs | 9 ++++++++- .../Products/IProductManagement.cs | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Moryx.AbstractionLayer.Products.Endpoints/ProductManagementController.cs b/src/Moryx.AbstractionLayer.Products.Endpoints/ProductManagementController.cs index a294bd71..363d5d6a 100644 --- a/src/Moryx.AbstractionLayer.Products.Endpoints/ProductManagementController.cs +++ b/src/Moryx.AbstractionLayer.Products.Endpoints/ProductManagementController.cs @@ -163,7 +163,14 @@ public ActionResult GetTypeById(long id) { if (id == 0) return BadRequest($"Id was 0"); - var productType = _productManagement.LoadType(id); + IProductType productType=null; + try + { + productType = _productManagement.LoadType(id); + } + catch (ProductNotFoundException) + { + } if (productType == null) return NotFound(); return _productConverter.ConvertProduct(productType, false); diff --git a/src/Moryx.AbstractionLayer/Products/IProductManagement.cs b/src/Moryx.AbstractionLayer/Products/IProductManagement.cs index 2ce1ce17..75a570c7 100644 --- a/src/Moryx.AbstractionLayer/Products/IProductManagement.cs +++ b/src/Moryx.AbstractionLayer/Products/IProductManagement.cs @@ -24,11 +24,13 @@ public interface IProductManagement : IRecipeProvider, IWorkplans /// /// Load product type by id /// + /// Thrown when the product with the given id doesn't exist. IProductType LoadType(long id); /// /// Load product type by identity /// + /// Thrown when the product with the given id doesn't exist. IProductType LoadType(ProductIdentity identity); /// From 2ecbafd2bdc1dd4900f51da1ecce3abcdad5fe33 Mon Sep 17 00:00:00 2001 From: matho mathias camara Date: Tue, 11 Oct 2022 09:03:29 +0200 Subject: [PATCH 08/12] initial --- .../ProductManagementController.cs | 19 +-- .../Moryx.AbstractionLayer.csproj | 6 + .../Properties/String.it.resx | 129 ++++++++++++++++ .../Properties/Strings.Designer.cs | 42 +++-- .../Properties/Strings.de.resx | 146 +++++++++++------- .../Properties/Strings.resx | 146 +++++++++++------- 6 files changed, 347 insertions(+), 141 deletions(-) create mode 100644 src/Moryx.AbstractionLayer/Properties/String.it.resx diff --git a/src/Moryx.AbstractionLayer.Products.Endpoints/ProductManagementController.cs b/src/Moryx.AbstractionLayer.Products.Endpoints/ProductManagementController.cs index 363d5d6a..0f4d3ff1 100644 --- a/src/Moryx.AbstractionLayer.Products.Endpoints/ProductManagementController.cs +++ b/src/Moryx.AbstractionLayer.Products.Endpoints/ProductManagementController.cs @@ -12,6 +12,7 @@ using Moryx.AbstractionLayer.Products.Endpoints.Model; using Moryx.Serialization; using System.Net; +using Moryx.AbstractionLayer.Properties; namespace Moryx.AbstractionLayer.Products.Endpoints { @@ -108,7 +109,7 @@ public ActionResult SaveType(ProductModel newTypeModel) var type = ReflectionTool.GetPublicClasses(t => t.Name == newTypeModel.Type) .FirstOrDefault(); if (type == null) - return NotFound(); + return NotFound(Strings.TYPE_NOT_FOUND); var productType = (ProductType)Activator.CreateInstance(type); var newType = _productConverter.ConvertProductBack(newTypeModel, productType); return _productManagement.SaveType(newType); @@ -137,7 +138,7 @@ public ActionResult GetTypeByIdentity(string identity = null) var productIdentity = new ProductIdentity(identityArray[0],Convert.ToInt16(identityArray[1])); var productType = _productManagement.LoadType(productIdentity); if (productType == null) - return NotFound(); + return NotFound(Strings.TYPE_NOT_FOUND); return new ProductModel[] { _productConverter.ConvertProduct(productType, false) }; } @@ -172,7 +173,7 @@ public ActionResult GetTypeById(long id) { } if (productType == null) - return NotFound(); + return NotFound(Strings.TYPE_NOT_FOUND); return _productConverter.ConvertProduct(productType, false); } @@ -184,7 +185,7 @@ public ActionResult DeleteType(long id) { var result = _productManagement.DeleteProduct(id); if (!result) - return NotFound(); + return NotFound(Strings.TYPE_NOT_FOUND); return result; } @@ -252,7 +253,7 @@ public ActionResult GetInstance(long id) return BadRequest($"Id was 0"); var productInstance = _productManagement.GetInstance(id); if (productInstance == null) - return NotFound(); + return NotFound(string.Format(Strings.ProductNotFoundException_Message,id)); return _productConverter.ConvertProductInstance(productInstance); } @@ -292,7 +293,7 @@ public ActionResult SaveInstance(ProductInstanceModel instanceModel) var type = ReflectionTool.GetPublicClasses(t => t.Name == instanceModel.Type) .FirstOrDefault(); if (type == null) - return NotFound(); + return NotFound(string.Format(Strings.ProductNotFoundException_Message,"null")); var productType = (IProductType)Activator.CreateInstance(type); var productInstance = _productConverter.ConvertProductInstanceBack(instanceModel, productType); _productManagement.SaveInstance(productInstance); @@ -312,7 +313,7 @@ public ActionResult GetRecipe(long id) return BadRequest($"Id was 0"); var recipe = _productManagement.LoadRecipe(id); if (recipe == null) - return NotFound(); + return NotFound(string.Format(Strings.RecipeNotFoundException_Message,id)); return ProductConverter.ConvertRecipe(recipe); } @@ -328,7 +329,7 @@ public ActionResult SaveRecipe(RecipeModel recipe) var type = ReflectionTool.GetPublicClasses(t => t.Name == recipe.Type) .FirstOrDefault(); if (type == null) - return NotFound(); + return NotFound(string.Format(Strings.RecipeNotFoundException_Message, "null")); var productRecipe = (IProductRecipe)Activator.CreateInstance(type); return _productManagement.SaveRecipe(_productConverter.ConvertRecipeBack(recipe, productRecipe, null)); } @@ -360,7 +361,7 @@ public ActionResult CreateRecipe(string recipeType) // TODO: Use type wrapper var type = ReflectionTool.GetPublicClasses(t => t.Name == recipeType).FirstOrDefault(); if (type == null) - return NotFound($"Recipe type {recipeType} not found!"); + return NotFound(string.Format(Strings.RECIPE_TYPE_NOT_FOUND, recipeType)); var recipe = (IProductRecipe)Activator.CreateInstance(type); return ProductConverter.ConvertRecipe(recipe); diff --git a/src/Moryx.AbstractionLayer/Moryx.AbstractionLayer.csproj b/src/Moryx.AbstractionLayer/Moryx.AbstractionLayer.csproj index 7e6e0eed..ef46bdde 100644 --- a/src/Moryx.AbstractionLayer/Moryx.AbstractionLayer.csproj +++ b/src/Moryx.AbstractionLayer/Moryx.AbstractionLayer.csproj @@ -21,6 +21,12 @@ + + PublicResXFileCodeGenerator + + + PublicResXFileCodeGenerator + PublicResXFileCodeGenerator Strings.Designer.cs diff --git a/src/Moryx.AbstractionLayer/Properties/String.it.resx b/src/Moryx.AbstractionLayer/Properties/String.it.resx new file mode 100644 index 00000000..1d69f391 --- /dev/null +++ b/src/Moryx.AbstractionLayer/Properties/String.it.resx @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Prodotto non trovato per id: {0} + + + Tipo di ricetta {0} non trovato! + + + Il tipo indicato non è stato trovato. + + \ No newline at end of file diff --git a/src/Moryx.AbstractionLayer/Properties/Strings.Designer.cs b/src/Moryx.AbstractionLayer/Properties/Strings.Designer.cs index b1f96fb0..3022f705 100644 --- a/src/Moryx.AbstractionLayer/Properties/Strings.Designer.cs +++ b/src/Moryx.AbstractionLayer/Properties/Strings.Designer.cs @@ -19,10 +19,10 @@ namespace Moryx.AbstractionLayer.Properties { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Strings { + public class Strings { private static global::System.Resources.ResourceManager resourceMan; @@ -36,7 +36,7 @@ internal Strings() { /// Returns the cached ResourceManager instance used by this class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { + public static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Moryx.AbstractionLayer.Properties.Strings", typeof(Strings).Assembly); @@ -51,7 +51,7 @@ internal Strings() { /// resource lookups using this strongly typed resource class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { + public static global::System.Globalization.CultureInfo Culture { get { return resourceCulture; } @@ -63,7 +63,7 @@ internal Strings() { /// /// Looks up a localized string similar to The identity has conflicts with existing products and revisions!. /// - internal static string IdentityConflictException_IdentityConflictMessage { + public static string IdentityConflictException_IdentityConflictMessage { get { return ResourceManager.GetString("IdentityConflictException_IdentityConflictMessage", resourceCulture); } @@ -72,7 +72,7 @@ internal static string IdentityConflictException_IdentityConflictMessage { /// /// Looks up a localized string similar to The identity can not be used for duplicates of the template!. /// - internal static string IdentityConflictException_InvalidTemplateMessage { + public static string IdentityConflictException_InvalidTemplateMessage { get { return ResourceManager.GetString("IdentityConflictException_InvalidTemplateMessage", resourceCulture); } @@ -81,7 +81,7 @@ internal static string IdentityConflictException_InvalidTemplateMessage { /// /// Looks up a localized string similar to Product not found for id: {0}. /// - internal static string ProductNotFoundException_Message { + public static string ProductNotFoundException_Message { get { return ResourceManager.GetString("ProductNotFoundException_Message", resourceCulture); } @@ -90,16 +90,25 @@ internal static string ProductNotFoundException_Message { /// /// Looks up a localized string similar to The proxy was detached and can no longer be used!. /// - internal static string ProxyDetachedException_Message { + public static string ProxyDetachedException_Message { get { return ResourceManager.GetString("ProxyDetachedException_Message", resourceCulture); } } + /// + /// Looks up a localized string similar to Recipe type {0} not found!. + /// + public static string RECIPE_TYPE_NOT_FOUND { + get { + return ResourceManager.GetString("RECIPE_TYPE_NOT_FOUND", resourceCulture); + } + } + /// /// Looks up a localized string similar to Recipe with id '{0}' not found!. /// - internal static string RecipeNotFoundException_Message { + public static string RecipeNotFoundException_Message { get { return ResourceManager.GetString("RecipeNotFoundException_Message", resourceCulture); } @@ -108,7 +117,7 @@ internal static string RecipeNotFoundException_Message { /// /// Looks up a localized string similar to No resource found providing capabilities or too many matches: {0}. /// - internal static string ResourceNotFoundException_ByCapabilities_Message { + public static string ResourceNotFoundException_ByCapabilities_Message { get { return ResourceManager.GetString("ResourceNotFoundException_ByCapabilities_Message", resourceCulture); } @@ -117,7 +126,7 @@ internal static string ResourceNotFoundException_ByCapabilities_Message { /// /// Looks up a localized string similar to No resource found with id: {0}. /// - internal static string ResourceNotFoundException_ById_Message { + public static string ResourceNotFoundException_ById_Message { get { return ResourceManager.GetString("ResourceNotFoundException_ById_Message", resourceCulture); } @@ -126,10 +135,19 @@ internal static string ResourceNotFoundException_ById_Message { /// /// Looks up a localized string similar to The driver does not support segments. /// - internal static string SegmentsNotSupportedException_Message { + public static string SegmentsNotSupportedException_Message { get { return ResourceManager.GetString("SegmentsNotSupportedException_Message", resourceCulture); } } + + /// + /// Looks up a localized string similar to The given type was not found.. + /// + public static string TYPE_NOT_FOUND { + get { + return ResourceManager.GetString("TYPE_NOT_FOUND", resourceCulture); + } + } } } diff --git a/src/Moryx.AbstractionLayer/Properties/Strings.de.resx b/src/Moryx.AbstractionLayer/Properties/Strings.de.resx index 44e46f0b..924e7a67 100644 --- a/src/Moryx.AbstractionLayer/Properties/Strings.de.resx +++ b/src/Moryx.AbstractionLayer/Properties/Strings.de.resx @@ -1,76 +1,96 @@  + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + + + + + + + + + + + + + + + + + + - + + @@ -89,13 +109,13 @@ text/microsoft-resx - 1.3 + 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 Die Identität besitzt konflikte mit existierenden Produkten und Revisionen @@ -121,4 +141,10 @@ Resource mit Id {0} nicht gefunden! + + Der angegebene Typ wurde nicht gefunden. + + + Rezeptsorte {0} nicht gefunden! + \ No newline at end of file diff --git a/src/Moryx.AbstractionLayer/Properties/Strings.resx b/src/Moryx.AbstractionLayer/Properties/Strings.resx index a069df4f..0e6e8266 100644 --- a/src/Moryx.AbstractionLayer/Properties/Strings.resx +++ b/src/Moryx.AbstractionLayer/Properties/Strings.resx @@ -1,76 +1,96 @@  + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + + + + + + + + + + + + + + + + + + - + + @@ -89,13 +109,13 @@ text/microsoft-resx - 1.3 + 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 The identity has conflicts with existing products and revisions! @@ -121,4 +141,10 @@ No resource found with id: {0} + + The given type was not found. + + + Recipe type {0} not found! + \ No newline at end of file From 829e9d2abd13eff48dfb5d65b4a4d2bfb0f4b68c Mon Sep 17 00:00:00 2001 From: matho mathias camara Date: Tue, 11 Oct 2022 09:03:29 +0200 Subject: [PATCH 09/12] initial --- .../ProductManagementController.cs | 19 +-- .../ResourceManagementController.cs | 13 +- .../Moryx.AbstractionLayer.csproj | 6 + .../Properties/String.it.resx | 132 ++++++++++++++++ .../Properties/Strings.Designer.cs | 51 ++++-- .../Properties/Strings.de.resx | 149 +++++++++++------- .../Properties/Strings.resx | 149 +++++++++++------- 7 files changed, 372 insertions(+), 147 deletions(-) create mode 100644 src/Moryx.AbstractionLayer/Properties/String.it.resx diff --git a/src/Moryx.AbstractionLayer.Products.Endpoints/ProductManagementController.cs b/src/Moryx.AbstractionLayer.Products.Endpoints/ProductManagementController.cs index 363d5d6a..0f4d3ff1 100644 --- a/src/Moryx.AbstractionLayer.Products.Endpoints/ProductManagementController.cs +++ b/src/Moryx.AbstractionLayer.Products.Endpoints/ProductManagementController.cs @@ -12,6 +12,7 @@ using Moryx.AbstractionLayer.Products.Endpoints.Model; using Moryx.Serialization; using System.Net; +using Moryx.AbstractionLayer.Properties; namespace Moryx.AbstractionLayer.Products.Endpoints { @@ -108,7 +109,7 @@ public ActionResult SaveType(ProductModel newTypeModel) var type = ReflectionTool.GetPublicClasses(t => t.Name == newTypeModel.Type) .FirstOrDefault(); if (type == null) - return NotFound(); + return NotFound(Strings.TYPE_NOT_FOUND); var productType = (ProductType)Activator.CreateInstance(type); var newType = _productConverter.ConvertProductBack(newTypeModel, productType); return _productManagement.SaveType(newType); @@ -137,7 +138,7 @@ public ActionResult GetTypeByIdentity(string identity = null) var productIdentity = new ProductIdentity(identityArray[0],Convert.ToInt16(identityArray[1])); var productType = _productManagement.LoadType(productIdentity); if (productType == null) - return NotFound(); + return NotFound(Strings.TYPE_NOT_FOUND); return new ProductModel[] { _productConverter.ConvertProduct(productType, false) }; } @@ -172,7 +173,7 @@ public ActionResult GetTypeById(long id) { } if (productType == null) - return NotFound(); + return NotFound(Strings.TYPE_NOT_FOUND); return _productConverter.ConvertProduct(productType, false); } @@ -184,7 +185,7 @@ public ActionResult DeleteType(long id) { var result = _productManagement.DeleteProduct(id); if (!result) - return NotFound(); + return NotFound(Strings.TYPE_NOT_FOUND); return result; } @@ -252,7 +253,7 @@ public ActionResult GetInstance(long id) return BadRequest($"Id was 0"); var productInstance = _productManagement.GetInstance(id); if (productInstance == null) - return NotFound(); + return NotFound(string.Format(Strings.ProductNotFoundException_Message,id)); return _productConverter.ConvertProductInstance(productInstance); } @@ -292,7 +293,7 @@ public ActionResult SaveInstance(ProductInstanceModel instanceModel) var type = ReflectionTool.GetPublicClasses(t => t.Name == instanceModel.Type) .FirstOrDefault(); if (type == null) - return NotFound(); + return NotFound(string.Format(Strings.ProductNotFoundException_Message,"null")); var productType = (IProductType)Activator.CreateInstance(type); var productInstance = _productConverter.ConvertProductInstanceBack(instanceModel, productType); _productManagement.SaveInstance(productInstance); @@ -312,7 +313,7 @@ public ActionResult GetRecipe(long id) return BadRequest($"Id was 0"); var recipe = _productManagement.LoadRecipe(id); if (recipe == null) - return NotFound(); + return NotFound(string.Format(Strings.RecipeNotFoundException_Message,id)); return ProductConverter.ConvertRecipe(recipe); } @@ -328,7 +329,7 @@ public ActionResult SaveRecipe(RecipeModel recipe) var type = ReflectionTool.GetPublicClasses(t => t.Name == recipe.Type) .FirstOrDefault(); if (type == null) - return NotFound(); + return NotFound(string.Format(Strings.RecipeNotFoundException_Message, "null")); var productRecipe = (IProductRecipe)Activator.CreateInstance(type); return _productManagement.SaveRecipe(_productConverter.ConvertRecipeBack(recipe, productRecipe, null)); } @@ -360,7 +361,7 @@ public ActionResult CreateRecipe(string recipeType) // TODO: Use type wrapper var type = ReflectionTool.GetPublicClasses(t => t.Name == recipeType).FirstOrDefault(); if (type == null) - return NotFound($"Recipe type {recipeType} not found!"); + return NotFound(string.Format(Strings.RECIPE_TYPE_NOT_FOUND, recipeType)); var recipe = (IProductRecipe)Activator.CreateInstance(type); return ProductConverter.ConvertRecipe(recipe); diff --git a/src/Moryx.AbstractionLayer.Resources.Endpoints/ResourceManagementController.cs b/src/Moryx.AbstractionLayer.Resources.Endpoints/ResourceManagementController.cs index d3217288..44ac3ce2 100644 --- a/src/Moryx.AbstractionLayer.Resources.Endpoints/ResourceManagementController.cs +++ b/src/Moryx.AbstractionLayer.Resources.Endpoints/ResourceManagementController.cs @@ -9,6 +9,7 @@ using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.ModelBinding; +using Moryx.AbstractionLayer.Properties; using Moryx.Resources.Interaction; using Moryx.Resources.Interaction.Converter; using Moryx.Serialization; @@ -81,12 +82,12 @@ public ActionResult GetResources(ResourceQuery query) public ActionResult GetDetails(long id) { if (_resourceModification.GetAllResources(r => r.Id == id) is null) - return NotFound($"Resource '{id}' not found!"); + return NotFound(string.Format(Strings.ResourceNotFoundException_ById_Message, id)); var converter = new ResourceToModelConverter(_resourceTypeTree, _serialization); var resourceModel = _resourceModification.Read(id, r => converter.GetDetails(r)); if (resourceModel is null) - return NotFound($"Resource '{id}' not found!"); + return NotFound(string.Format(Strings.ResourceNotFoundException_ById_Message, id)); return resourceModel; } @@ -100,7 +101,7 @@ public ActionResult GetDetails(long id) public ActionResult InvokeMethod(long id, string method, Entry parameters) { if (_resourceModification.GetAllResources(r => r.Id == id) is null) - return NotFound($"Resource {id} not found!"); + return NotFound(string.Format(Strings.ResourceNotFoundException_ById_Message, id)); Entry entry = null; _resourceModification.Modify(id, r => @@ -129,7 +130,7 @@ private ActionResult Construct(string type, MethodEntry method) { var resource = (Resource)Activator.CreateInstance(_resourceTypeTree[type].ResourceType); if (resource is null) - return NotFound(); + return NotFound(Strings.RESOURCE_NOT_FOUND); if (method != null) EntryConvert.InvokeMethod(resource, method, _serialization); @@ -287,7 +288,7 @@ private void UpdateReferences(Resource instance, HashSet resourcesToSave, public ActionResult Update(long id, ResourceModel model) { if (_resourceModification.GetAllResources(r=>r.Id == id) is null) - return NotFound($"Resource {id} not found!"); + return NotFound(string.Format(Strings.ResourceNotFoundException_ById_Message, id)); _resourceModification.Modify(id, r => { var resourcesToSave = new HashSet(); @@ -309,7 +310,7 @@ public ActionResult Update(long id, ResourceModel model) public ActionResult Remove(long id) { if (_resourceModification.GetAllResources(r => r.Id == id) is null) - return NotFound($"Resource {id} not found!"); + return NotFound(string.Format(Strings.ResourceNotFoundException_ById_Message, id)); var deleted = _resourceModification.Delete(id); if (!deleted) diff --git a/src/Moryx.AbstractionLayer/Moryx.AbstractionLayer.csproj b/src/Moryx.AbstractionLayer/Moryx.AbstractionLayer.csproj index 7e6e0eed..ef46bdde 100644 --- a/src/Moryx.AbstractionLayer/Moryx.AbstractionLayer.csproj +++ b/src/Moryx.AbstractionLayer/Moryx.AbstractionLayer.csproj @@ -21,6 +21,12 @@ + + PublicResXFileCodeGenerator + + + PublicResXFileCodeGenerator + PublicResXFileCodeGenerator Strings.Designer.cs diff --git a/src/Moryx.AbstractionLayer/Properties/String.it.resx b/src/Moryx.AbstractionLayer/Properties/String.it.resx new file mode 100644 index 00000000..d759d481 --- /dev/null +++ b/src/Moryx.AbstractionLayer/Properties/String.it.resx @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Prodotto non trovato per id: {0} + + + Tipo di ricetta {0} non trovato! + + + Risorsa non trovata! + + + Il tipo indicato non è stato trovato. + + \ No newline at end of file diff --git a/src/Moryx.AbstractionLayer/Properties/Strings.Designer.cs b/src/Moryx.AbstractionLayer/Properties/Strings.Designer.cs index b1f96fb0..4b3aa293 100644 --- a/src/Moryx.AbstractionLayer/Properties/Strings.Designer.cs +++ b/src/Moryx.AbstractionLayer/Properties/Strings.Designer.cs @@ -19,10 +19,10 @@ namespace Moryx.AbstractionLayer.Properties { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Strings { + public class Strings { private static global::System.Resources.ResourceManager resourceMan; @@ -36,7 +36,7 @@ internal Strings() { /// Returns the cached ResourceManager instance used by this class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { + public static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Moryx.AbstractionLayer.Properties.Strings", typeof(Strings).Assembly); @@ -51,7 +51,7 @@ internal Strings() { /// resource lookups using this strongly typed resource class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { + public static global::System.Globalization.CultureInfo Culture { get { return resourceCulture; } @@ -63,7 +63,7 @@ internal Strings() { /// /// Looks up a localized string similar to The identity has conflicts with existing products and revisions!. /// - internal static string IdentityConflictException_IdentityConflictMessage { + public static string IdentityConflictException_IdentityConflictMessage { get { return ResourceManager.GetString("IdentityConflictException_IdentityConflictMessage", resourceCulture); } @@ -72,7 +72,7 @@ internal static string IdentityConflictException_IdentityConflictMessage { /// /// Looks up a localized string similar to The identity can not be used for duplicates of the template!. /// - internal static string IdentityConflictException_InvalidTemplateMessage { + public static string IdentityConflictException_InvalidTemplateMessage { get { return ResourceManager.GetString("IdentityConflictException_InvalidTemplateMessage", resourceCulture); } @@ -81,7 +81,7 @@ internal static string IdentityConflictException_InvalidTemplateMessage { /// /// Looks up a localized string similar to Product not found for id: {0}. /// - internal static string ProductNotFoundException_Message { + public static string ProductNotFoundException_Message { get { return ResourceManager.GetString("ProductNotFoundException_Message", resourceCulture); } @@ -90,25 +90,43 @@ internal static string ProductNotFoundException_Message { /// /// Looks up a localized string similar to The proxy was detached and can no longer be used!. /// - internal static string ProxyDetachedException_Message { + public static string ProxyDetachedException_Message { get { return ResourceManager.GetString("ProxyDetachedException_Message", resourceCulture); } } + /// + /// Looks up a localized string similar to Recipe type {0} not found!. + /// + public static string RECIPE_TYPE_NOT_FOUND { + get { + return ResourceManager.GetString("RECIPE_TYPE_NOT_FOUND", resourceCulture); + } + } + /// /// Looks up a localized string similar to Recipe with id '{0}' not found!. /// - internal static string RecipeNotFoundException_Message { + public static string RecipeNotFoundException_Message { get { return ResourceManager.GetString("RecipeNotFoundException_Message", resourceCulture); } } + /// + /// Looks up a localized string similar to Resource not found!. + /// + public static string RESOURCE_NOT_FOUND { + get { + return ResourceManager.GetString("RESOURCE_NOT_FOUND", resourceCulture); + } + } + /// /// Looks up a localized string similar to No resource found providing capabilities or too many matches: {0}. /// - internal static string ResourceNotFoundException_ByCapabilities_Message { + public static string ResourceNotFoundException_ByCapabilities_Message { get { return ResourceManager.GetString("ResourceNotFoundException_ByCapabilities_Message", resourceCulture); } @@ -117,7 +135,7 @@ internal static string ResourceNotFoundException_ByCapabilities_Message { /// /// Looks up a localized string similar to No resource found with id: {0}. /// - internal static string ResourceNotFoundException_ById_Message { + public static string ResourceNotFoundException_ById_Message { get { return ResourceManager.GetString("ResourceNotFoundException_ById_Message", resourceCulture); } @@ -126,10 +144,19 @@ internal static string ResourceNotFoundException_ById_Message { /// /// Looks up a localized string similar to The driver does not support segments. /// - internal static string SegmentsNotSupportedException_Message { + public static string SegmentsNotSupportedException_Message { get { return ResourceManager.GetString("SegmentsNotSupportedException_Message", resourceCulture); } } + + /// + /// Looks up a localized string similar to The given type was not found.. + /// + public static string TYPE_NOT_FOUND { + get { + return ResourceManager.GetString("TYPE_NOT_FOUND", resourceCulture); + } + } } } diff --git a/src/Moryx.AbstractionLayer/Properties/Strings.de.resx b/src/Moryx.AbstractionLayer/Properties/Strings.de.resx index 44e46f0b..a67a526a 100644 --- a/src/Moryx.AbstractionLayer/Properties/Strings.de.resx +++ b/src/Moryx.AbstractionLayer/Properties/Strings.de.resx @@ -1,76 +1,96 @@  + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + + + + + + + + + + + + + + + + + + - + + @@ -89,13 +109,13 @@ text/microsoft-resx - 1.3 + 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 Die Identität besitzt konflikte mit existierenden Produkten und Revisionen @@ -121,4 +141,13 @@ Resource mit Id {0} nicht gefunden! + + Der angegebene Typ wurde nicht gefunden. + + + Rezeptsorte {0} nicht gefunden! + + + Ressource nicht gefunden! + \ No newline at end of file diff --git a/src/Moryx.AbstractionLayer/Properties/Strings.resx b/src/Moryx.AbstractionLayer/Properties/Strings.resx index a069df4f..8e9eaf3c 100644 --- a/src/Moryx.AbstractionLayer/Properties/Strings.resx +++ b/src/Moryx.AbstractionLayer/Properties/Strings.resx @@ -1,76 +1,96 @@  + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + + + + + + + + + + + + + + + + + + - + + @@ -89,13 +109,13 @@ text/microsoft-resx - 1.3 + 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 The identity has conflicts with existing products and revisions! @@ -121,4 +141,13 @@ No resource found with id: {0} + + The given type was not found. + + + Recipe type {0} not found! + + + Resource not found! + \ No newline at end of file From d0d2d59ad88e1e5ad585691ada6b6787f01093dd Mon Sep 17 00:00:00 2001 From: Marcel Vielhaus <37485711+1nf0rmagician@users.noreply.github.com> Date: Tue, 11 Oct 2022 13:14:41 +0200 Subject: [PATCH 10/12] Update Strings.de.resx --- src/Moryx.AbstractionLayer/Properties/Strings.de.resx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Moryx.AbstractionLayer/Properties/Strings.de.resx b/src/Moryx.AbstractionLayer/Properties/Strings.de.resx index a67a526a..81e05163 100644 --- a/src/Moryx.AbstractionLayer/Properties/Strings.de.resx +++ b/src/Moryx.AbstractionLayer/Properties/Strings.de.resx @@ -139,15 +139,15 @@ Es wurde keine eindeutige Resource mit den angegebenen Fähigkeiten gefunden. - Resource mit Id {0} nicht gefunden! + Resource mit der Id '{0}' nicht gefunden! - Der angegebene Typ wurde nicht gefunden. + Der angegebene Typ konnte nicht gefunden werden. - Rezeptsorte {0} nicht gefunden! + Ein Rezept des Typ '{0}' konnte nicht gefunden werden. - Ressource nicht gefunden! + Die Ressource konnte nicht gefunden werden. - \ No newline at end of file + From f79e7908897ed1bc4c58b2d10323e3d76e3e3f2e Mon Sep 17 00:00:00 2001 From: matho mathias camara Date: Wed, 12 Oct 2022 10:41:06 +0200 Subject: [PATCH 11/12] Renamed String to Strings --- src/Moryx.AbstractionLayer/Moryx.AbstractionLayer.csproj | 2 +- .../Properties/{String.it.resx => Strings.it.resx} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename src/Moryx.AbstractionLayer/Properties/{String.it.resx => Strings.it.resx} (100%) diff --git a/src/Moryx.AbstractionLayer/Moryx.AbstractionLayer.csproj b/src/Moryx.AbstractionLayer/Moryx.AbstractionLayer.csproj index ef46bdde..4b159b09 100644 --- a/src/Moryx.AbstractionLayer/Moryx.AbstractionLayer.csproj +++ b/src/Moryx.AbstractionLayer/Moryx.AbstractionLayer.csproj @@ -21,7 +21,7 @@ - + PublicResXFileCodeGenerator diff --git a/src/Moryx.AbstractionLayer/Properties/String.it.resx b/src/Moryx.AbstractionLayer/Properties/Strings.it.resx similarity index 100% rename from src/Moryx.AbstractionLayer/Properties/String.it.resx rename to src/Moryx.AbstractionLayer/Properties/Strings.it.resx From db7cd06c5d039c0b4b20d5e342e51e1f5b6caa12 Mon Sep 17 00:00:00 2001 From: matho mathias camara Date: Fri, 18 Nov 2022 13:24:29 +0100 Subject: [PATCH 12/12] update the GetProductCustomization function. --- .../ProductManagementController.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Moryx.AbstractionLayer.Products.Endpoints/ProductManagementController.cs b/src/Moryx.AbstractionLayer.Products.Endpoints/ProductManagementController.cs index 0f4d3ff1..095a0bbe 100644 --- a/src/Moryx.AbstractionLayer.Products.Endpoints/ProductManagementController.cs +++ b/src/Moryx.AbstractionLayer.Products.Endpoints/ProductManagementController.cs @@ -13,6 +13,7 @@ using Moryx.Serialization; using System.Net; using Moryx.AbstractionLayer.Properties; +using Moryx.Configuration; namespace Moryx.AbstractionLayer.Products.Endpoints { @@ -44,7 +45,7 @@ public ActionResult GetProductCustomization() Importers = _productManagement.Importers.Select(i => new ProductImporter { Name = i.Key, - Parameters = EntryConvert.EncodeObject(i.Value) + Parameters = EntryConvert.EncodeObject(i.Value, new PossibleValuesSerialization(null, new ValueProviderExecutor(new ValueProviderExecutorSettings().AddDefaultValueProvider()))) }).ToArray() }; }