From 94f5894b7427acdb0c664ec169cd656343865aa0 Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Tue, 12 Nov 2019 10:59:04 +0100 Subject: [PATCH] AB3649 - Moved manifest stuff --- .../Manifest/IManifestFilter.cs | 0 .../Manifest/ManifestDashboard.cs | 16 +- .../Manifest/ManifestFilterCollection.cs | 0 .../ManifestFilterCollectionBuilder.cs | 0 .../Manifest/PackageManifest.cs | 141 +++++++++--------- .../Models/IDataValueEditor.cs | 1 - .../PropertyEditors/IDataEditor.cs | 0 src/Umbraco.Core/Umbraco.Core.csproj | 7 - 8 files changed, 79 insertions(+), 86 deletions(-) rename src/{Umbraco.Core => Umbraco.Abstractions}/Manifest/IManifestFilter.cs (100%) rename src/{Umbraco.Core => Umbraco.Abstractions}/Manifest/ManifestDashboard.cs (58%) rename src/{Umbraco.Core => Umbraco.Abstractions}/Manifest/ManifestFilterCollection.cs (100%) rename src/{Umbraco.Core => Umbraco.Abstractions}/Manifest/ManifestFilterCollectionBuilder.cs (100%) rename src/{Umbraco.Core => Umbraco.Abstractions}/Manifest/PackageManifest.cs (83%) rename src/{Umbraco.Core => Umbraco.Abstractions}/Models/IDataValueEditor.cs (98%) rename src/{Umbraco.Core => Umbraco.Abstractions}/PropertyEditors/IDataEditor.cs (100%) diff --git a/src/Umbraco.Core/Manifest/IManifestFilter.cs b/src/Umbraco.Abstractions/Manifest/IManifestFilter.cs similarity index 100% rename from src/Umbraco.Core/Manifest/IManifestFilter.cs rename to src/Umbraco.Abstractions/Manifest/IManifestFilter.cs diff --git a/src/Umbraco.Core/Manifest/ManifestDashboard.cs b/src/Umbraco.Abstractions/Manifest/ManifestDashboard.cs similarity index 58% rename from src/Umbraco.Core/Manifest/ManifestDashboard.cs rename to src/Umbraco.Abstractions/Manifest/ManifestDashboard.cs index 2642ca3646..2368f07a0b 100644 --- a/src/Umbraco.Core/Manifest/ManifestDashboard.cs +++ b/src/Umbraco.Abstractions/Manifest/ManifestDashboard.cs @@ -1,28 +1,28 @@ using System; using System.ComponentModel; -using Newtonsoft.Json; -using Umbraco.Core.Composing; +using System.Runtime.Serialization; using Umbraco.Core.Dashboards; -using Umbraco.Core.IO; namespace Umbraco.Core.Manifest { + [DataContract] public class ManifestDashboard : IDashboard { - [JsonProperty("alias", Required = Required.Always)] + [DataMember(Name = "alias", IsRequired = true)] public string Alias { get; set; } - [JsonProperty("weight", DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] + //TODO this needs to be tested manually! + //[JsonProperty("weight", DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] [DefaultValue(100)] // must be equal to DashboardCollectionBuilder.DefaultWeight public int Weight { get; set; } - [JsonProperty("view", Required = Required.Always)] + [DataMember(Name = "view", IsRequired = true)] public string View { get; set; } - [JsonProperty("sections")] + [DataMember(Name = "sections")] public string[] Sections { get; set; } = Array.Empty(); - [JsonProperty("access")] + [DataMember(Name = "access")] public IAccessRule[] AccessRules { get; set; } = Array.Empty(); } } diff --git a/src/Umbraco.Core/Manifest/ManifestFilterCollection.cs b/src/Umbraco.Abstractions/Manifest/ManifestFilterCollection.cs similarity index 100% rename from src/Umbraco.Core/Manifest/ManifestFilterCollection.cs rename to src/Umbraco.Abstractions/Manifest/ManifestFilterCollection.cs diff --git a/src/Umbraco.Core/Manifest/ManifestFilterCollectionBuilder.cs b/src/Umbraco.Abstractions/Manifest/ManifestFilterCollectionBuilder.cs similarity index 100% rename from src/Umbraco.Core/Manifest/ManifestFilterCollectionBuilder.cs rename to src/Umbraco.Abstractions/Manifest/ManifestFilterCollectionBuilder.cs diff --git a/src/Umbraco.Core/Manifest/PackageManifest.cs b/src/Umbraco.Abstractions/Manifest/PackageManifest.cs similarity index 83% rename from src/Umbraco.Core/Manifest/PackageManifest.cs rename to src/Umbraco.Abstractions/Manifest/PackageManifest.cs index e50eb69467..5e10030693 100644 --- a/src/Umbraco.Core/Manifest/PackageManifest.cs +++ b/src/Umbraco.Abstractions/Manifest/PackageManifest.cs @@ -1,70 +1,71 @@ -using System; -using Newtonsoft.Json; -using Umbraco.Core.PropertyEditors; - -namespace Umbraco.Core.Manifest -{ - /// - /// Represents the content of a package manifest. - /// - public class PackageManifest - { - /// - /// Gets the source path of the manifest. - /// - /// - /// Gets the full absolute file path of the manifest, - /// using system directory separators. - /// - [JsonIgnore] - public string Source { get; set; } - - /// - /// Gets or sets the scripts listed in the manifest. - /// - [JsonProperty("javascript")] - public string[] Scripts { get; set; } = Array.Empty(); - - /// - /// Gets or sets the stylesheets listed in the manifest. - /// - [JsonProperty("css")] - public string[] Stylesheets { get; set; } = Array.Empty(); - - /// - /// Gets or sets the property editors listed in the manifest. - /// - [JsonProperty("propertyEditors")] - public IDataEditor[] PropertyEditors { get; set; } = Array.Empty(); - - /// - /// Gets or sets the parameter editors listed in the manifest. - /// - [JsonProperty("parameterEditors")] - public IDataEditor[] ParameterEditors { get; set; } = Array.Empty(); - - /// - /// Gets or sets the grid editors listed in the manifest. - /// - [JsonProperty("gridEditors")] - public GridEditor[] GridEditors { get; set; } = Array.Empty(); - - /// - /// Gets or sets the content apps listed in the manifest. - /// - [JsonProperty("contentApps")] - public ManifestContentAppDefinition[] ContentApps { get; set; } = Array.Empty(); - - /// - /// Gets or sets the dashboards listed in the manifest. - /// - [JsonProperty("dashboards")] - public ManifestDashboard[] Dashboards { get; set; } = Array.Empty(); - - /// - /// Gets or sets the sections listed in the manifest. - /// - [JsonProperty("sections")] - public ManifestSection[] Sections { get; set; } = Array.Empty(); - } -} +using System; +using System.Runtime.Serialization; +using Umbraco.Core.PropertyEditors; + +namespace Umbraco.Core.Manifest +{ + /// + /// Represents the content of a package manifest. + /// + [DataContract] + public class PackageManifest + { + /// + /// Gets the source path of the manifest. + /// + /// + /// Gets the full absolute file path of the manifest, + /// using system directory separators. + /// + [IgnoreDataMember] + public string Source { get; set; } + + /// + /// Gets or sets the scripts listed in the manifest. + /// + [DataMember(Name = "javascript")] + public string[] Scripts { get; set; } = Array.Empty(); + + /// + /// Gets or sets the stylesheets listed in the manifest. + /// + [DataMember(Name = "css")] + public string[] Stylesheets { get; set; } = Array.Empty(); + + /// + /// Gets or sets the property editors listed in the manifest. + /// + [DataMember(Name = "propertyEditors")] + public IDataEditor[] PropertyEditors { get; set; } = Array.Empty(); + + /// + /// Gets or sets the parameter editors listed in the manifest. + /// + [DataMember(Name = "parameterEditors")] + public IDataEditor[] ParameterEditors { get; set; } = Array.Empty(); + + /// + /// Gets or sets the grid editors listed in the manifest. + /// + [DataMember(Name = "gridEditors")] + public GridEditor[] GridEditors { get; set; } = Array.Empty(); + + /// + /// Gets or sets the content apps listed in the manifest. + /// + [DataMember(Name = "contentApps")] + public ManifestContentAppDefinition[] ContentApps { get; set; } = Array.Empty(); + + /// + /// Gets or sets the dashboards listed in the manifest. + /// + [DataMember(Name = "dashboards")] + public ManifestDashboard[] Dashboards { get; set; } = Array.Empty(); + + /// + /// Gets or sets the sections listed in the manifest. + /// + [DataMember(Name = "sections")] + public ManifestSection[] Sections { get; set; } = Array.Empty(); + } +} diff --git a/src/Umbraco.Core/Models/IDataValueEditor.cs b/src/Umbraco.Abstractions/Models/IDataValueEditor.cs similarity index 98% rename from src/Umbraco.Core/Models/IDataValueEditor.cs rename to src/Umbraco.Abstractions/Models/IDataValueEditor.cs index 6158711c3c..e095f3aa31 100644 --- a/src/Umbraco.Core/Models/IDataValueEditor.cs +++ b/src/Umbraco.Abstractions/Models/IDataValueEditor.cs @@ -3,7 +3,6 @@ using System.ComponentModel.DataAnnotations; using System.Xml.Linq; using Umbraco.Core.Models; using Umbraco.Core.Models.Editors; -using Umbraco.Core.Services; namespace Umbraco.Core.PropertyEditors { diff --git a/src/Umbraco.Core/PropertyEditors/IDataEditor.cs b/src/Umbraco.Abstractions/PropertyEditors/IDataEditor.cs similarity index 100% rename from src/Umbraco.Core/PropertyEditors/IDataEditor.cs rename to src/Umbraco.Abstractions/PropertyEditors/IDataEditor.cs diff --git a/src/Umbraco.Core/Umbraco.Core.csproj b/src/Umbraco.Core/Umbraco.Core.csproj index a356da0902..95373f4c21 100755 --- a/src/Umbraco.Core/Umbraco.Core.csproj +++ b/src/Umbraco.Core/Umbraco.Core.csproj @@ -184,9 +184,6 @@ - - - @@ -225,7 +222,6 @@ - @@ -276,7 +272,6 @@ - @@ -379,7 +374,6 @@ - @@ -540,7 +534,6 @@ -