From 4e3c0577a4b56c1b5026a38a6d944c4f24298cf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Krch?= Date: Tue, 9 Jul 2024 14:08:20 +0200 Subject: [PATCH] MT-17 cleanup --- .../Mappers/ContentItemMapper.cs | 1 - .../PageTemplateConfigurationMapper.cs | 1 - .../Services/PrimaryKeyLocatorService.cs | 29 --- .../CmsClass/EditableAreasConfiguration.cs | 187 ------------------ .../Services/CmsClass/PageSelectorItem.cs | 12 -- .../CmsClass/PageTemplateConfiguration.cs | 29 --- 6 files changed, 259 deletions(-) delete mode 100644 Migration.Toolkit.Core.KX12/Services/CmsClass/EditableAreasConfiguration.cs delete mode 100644 Migration.Toolkit.Core.KX12/Services/CmsClass/PageSelectorItem.cs delete mode 100644 Migration.Toolkit.Core.KX12/Services/CmsClass/PageTemplateConfiguration.cs diff --git a/KVA/Migration.Toolkit.Source/Mappers/ContentItemMapper.cs b/KVA/Migration.Toolkit.Source/Mappers/ContentItemMapper.cs index 4176d097..9923daa7 100644 --- a/KVA/Migration.Toolkit.Source/Mappers/ContentItemMapper.cs +++ b/KVA/Migration.Toolkit.Source/Mappers/ContentItemMapper.cs @@ -817,7 +817,6 @@ ICmsClass nodeClass { if (value is string pageReferenceJson) { -#warning [PATCHED] - [VERIFY] "NodeGuid may not be unique, use other means of searching for node!" var parsed = JObject.Parse(pageReferenceJson); foreach (var jToken in parsed.DescendantsAndSelf()) { diff --git a/KVA/Migration.Toolkit.Source/Mappers/PageTemplateConfigurationMapper.cs b/KVA/Migration.Toolkit.Source/Mappers/PageTemplateConfigurationMapper.cs index 6d010017..77e9436a 100644 --- a/KVA/Migration.Toolkit.Source/Mappers/PageTemplateConfigurationMapper.cs +++ b/KVA/Migration.Toolkit.Source/Mappers/PageTemplateConfigurationMapper.cs @@ -194,7 +194,6 @@ private void WalkProperties(int siteId, JObject properties, List>() is { Count: > 0 } items) { -#warning [PATCHED] - [CHECK] "NodeGuid may not be unique, use other means of searching for node!" properties[key] = JToken.FromObject(items.Select(x => new WebPageRelatedItem { WebPageGuid = spoiledGuidContext.EnsureNodeGuid(x.NodeGuid, siteId) diff --git a/KVA/Migration.Toolkit.Source/Services/PrimaryKeyLocatorService.cs b/KVA/Migration.Toolkit.Source/Services/PrimaryKeyLocatorService.cs index 745007f3..58e09482 100644 --- a/KVA/Migration.Toolkit.Source/Services/PrimaryKeyLocatorService.cs +++ b/KVA/Migration.Toolkit.Source/Services/PrimaryKeyLocatorService.cs @@ -82,27 +82,6 @@ public IEnumerable SelectAll(Expression().Select(x => new { x.NodeID, x.NodeGUID, x.NodeSiteID }).ToList(); -// var target = kxpContext.CmsChannels.Select(x => new { x.ChannelId, x.ChannelGuid }).ToList(); -// -// var result = source.Join(target, -// #error "NodeGuid may not be unique, use other means of searching for node!" -// a => a.NodeGUID, -// b => b.ChannelGuid, -// (a, b) => new SourceTargetKeyMapping(a.NodeID, b.ChannelId) -// ); -// -// foreach (var resultingMapping in result) -// { -// yield return resultingMapping; -// } -// -// yield break; -// } - if (sourceType == typeof(ICmsState) && memberName == nameof(ICmsState.StateID)) { var source = modelFacade.SelectAll().Select(x => new { x.StateID, x.StateName }).ToList(); @@ -216,14 +195,6 @@ public bool TryLocate(Expression> keyNameSelector, int source targetId = kxpContext.OmContacts.Where(x => x.ContactGuid == sourceGuid).Select(x => x.ContactId).Single(); return true; } - -// if (sourceType == typeof(ICmsTree)) -// { -// #error "NodeGuid may not be unique, use other means of searching for node!" -// var sourceGuid = modelFacade.SelectById(sourceId)?.NodeGUID; -// targetId = kxpContext.CmsChannels.Where(x => x.ChannelGuid == sourceGuid).Select(x => x.ChannelId).Single(); -// return true; -// } } catch (InvalidOperationException ioex) { diff --git a/Migration.Toolkit.Core.KX12/Services/CmsClass/EditableAreasConfiguration.cs b/Migration.Toolkit.Core.KX12/Services/CmsClass/EditableAreasConfiguration.cs deleted file mode 100644 index e6d6f4ba..00000000 --- a/Migration.Toolkit.Core.KX12/Services/CmsClass/EditableAreasConfiguration.cs +++ /dev/null @@ -1,187 +0,0 @@ -// namespace Migration.Toolkit.Core.KX12.Services.CmsClass; -// -// using System.Runtime.Serialization; -// using Newtonsoft.Json; -// using Newtonsoft.Json.Linq; -// -// #region Copied from Kentico assembly -// -// [DataContract(Name = "Configuration", Namespace = "")] -// public sealed class EditableAreasConfiguration -// { -// /// Editable areas within the page. -// [DataMember] -// [JsonProperty("editableAreas")] -// public List EditableAreas { get; private set; } -// -// /// -// /// Creates an instance of class. -// /// -// public EditableAreasConfiguration() => this.EditableAreas = new List(); -// } -// -// /// -// /// Represents configuration of editable area within the instance. -// /// -// [DataContract(Name = "EditableArea", Namespace = "")] -// public sealed class EditableAreaConfiguration -// { -// /// Identifier of the editable area. -// [DataMember] -// [JsonProperty("identifier")] -// public string Identifier { get; set; } -// -// /// Sections within editable area. -// [DataMember] -// [JsonProperty("sections")] -// public List Sections { get; private set; } -// -// /// -// /// A flag indicating whether the output of the individual widgets within the editable area can be cached. The default value is false. -// /// -// public bool AllowWidgetOutputCache { get; set; } -// -// /// -// /// An absolute expiration date for the cached output of the individual widgets. -// /// -// public DateTimeOffset? WidgetOutputCacheExpiresOn { get; set; } -// -// /// -// /// The length of time from the first request to cache the output of the individual widgets. -// /// -// public TimeSpan? WidgetOutputCacheExpiresAfter { get; set; } -// -// /// -// /// The time after which the cached output of the individual widgets should be evicted if it has not been accessed. -// /// -// public TimeSpan? WidgetOutputCacheExpiresSliding { get; set; } -// -// /// -// /// Creates an instance of class. -// /// -// public EditableAreaConfiguration() => this.Sections = new List(); -// } -// -// /// -// /// Represents configuration of section within the instance. -// /// -// [DataContract(Name = "Section", Namespace = "")] -// public sealed class SectionConfiguration -// { -// /// Identifier of the section. -// [DataMember] -// [JsonProperty("identifier")] -// public Guid Identifier { get; set; } -// -// /// Type section identifier. -// [DataMember] -// [JsonProperty("type")] -// public string TypeIdentifier { get; set; } -// -// /// Section properties. -// [DataMember] -// [JsonProperty("properties")] -// // public ISectionProperties Properties { get; set; } -// public JObject Properties { get; set; } -// -// /// Zones within the section. -// [DataMember] -// [JsonProperty("zones")] -// public List Zones { get; private set; } -// -// /// -// /// Creates an instance of class. -// /// -// public SectionConfiguration() => this.Zones = new List(); -// } -// -// /// -// /// Represents the zone within the configuration class. -// /// -// [DataContract(Name = "Zone", Namespace = "")] -// public sealed class ZoneConfiguration -// { -// /// Identifier of the widget zone. -// [DataMember] -// [JsonProperty("identifier")] -// public Guid Identifier { get; set; } -// -// /// Name of the widget zone. -// [DataMember] -// [JsonProperty("name")] -// public string Name { get; set; } -// -// /// List of widgets within the zone. -// [DataMember] -// [JsonProperty("widgets")] -// public List Widgets { get; private set; } -// -// /// -// /// Creates an instance of class. -// /// -// public ZoneConfiguration() => this.Widgets = new List(); -// } -// -// /// -// /// Represents the configuration of a widget within the list. -// /// -// [DataContract(Name = "Widget", Namespace = "")] -// public sealed class WidgetConfiguration -// { -// /// Identifier of the widget instance. -// [DataMember] -// [JsonProperty("identifier")] -// public Guid Identifier { get; set; } -// -// /// Type widget identifier. -// [DataMember] -// [JsonProperty("type")] -// public string TypeIdentifier { get; set; } -// -// /// Personalization condition type identifier. -// [DataMember] -// [JsonProperty("conditionType")] -// public string PersonalizationConditionTypeIdentifier { get; set; } -// -// /// List of widget variants. -// [DataMember] -// [JsonProperty("variants")] -// public List Variants { get; set; } -// -// /// -// /// Creates an instance of class. -// /// -// public WidgetConfiguration() => this.Variants = new List(); -// } -// -// /// -// /// Represents the configuration variant of a widget within the list. -// /// -// [DataContract(Name = "Variant", Namespace = "")] -// public sealed class WidgetVariantConfiguration -// { -// /// Identifier of the variant instance. -// [DataMember] -// [JsonProperty("identifier")] -// public Guid Identifier { get; set; } -// -// /// Widget variant name. -// [DataMember] -// [JsonProperty("name")] -// public string Name { get; set; } -// -// /// Widget variant properties. -// [DataMember] -// [JsonProperty("properties")] -// // public IWidgetProperties Properties { get; set; } -// public JObject Properties { get; set; } -// -// /// Widget variant personalization condition type. -// /// Only personalization condition type parameters are serialized to JSON. -// [DataMember] -// [JsonProperty("conditionTypeParameters")] -// public JObject PersonalizationConditionType { get; set; } -// } -// -// #endregion -// diff --git a/Migration.Toolkit.Core.KX12/Services/CmsClass/PageSelectorItem.cs b/Migration.Toolkit.Core.KX12/Services/CmsClass/PageSelectorItem.cs deleted file mode 100644 index d72c3d73..00000000 --- a/Migration.Toolkit.Core.KX12/Services/CmsClass/PageSelectorItem.cs +++ /dev/null @@ -1,12 +0,0 @@ -// namespace Migration.Toolkit.Core.KX12.Services.CmsClass; -// -// using Newtonsoft.Json; -// -// /// Represents an item for a page selector. -// public class PageSelectorItem -// { -// /// Node Guid of a page. -// [JsonProperty("nodeGuid")] -// #error "NodeGuid may not be unique, use other means of searching for node!" -// public Guid NodeGuid { get; set; } -// } \ No newline at end of file diff --git a/Migration.Toolkit.Core.KX12/Services/CmsClass/PageTemplateConfiguration.cs b/Migration.Toolkit.Core.KX12/Services/CmsClass/PageTemplateConfiguration.cs deleted file mode 100644 index 5679916d..00000000 --- a/Migration.Toolkit.Core.KX12/Services/CmsClass/PageTemplateConfiguration.cs +++ /dev/null @@ -1,29 +0,0 @@ -// namespace Migration.Toolkit.Core.KX12.Services.CmsClass; -// -// using System.Runtime.Serialization; -// using Newtonsoft.Json; -// using Newtonsoft.Json.Linq; -// -// /// -// /// Page template configuration for the instance. -// /// -// [DataContract(Name = "PageTemplate", Namespace = "")] -// public class PageTemplateConfiguration -// { -// /// Identifier of the page template. -// [DataMember] -// [JsonProperty("identifier")] -// public string Identifier { get; set; } -// -// /// -// /// Identifier of the page template configuration based on which the page was created. -// /// -// [DataMember] -// [JsonProperty("configurationIdentifier")] -// public Guid ConfigurationIdentifier { get; set; } -// -// /// Page template properties. -// [DataMember] -// [JsonProperty("properties")] -// public JObject Properties { get; set; } -// } \ No newline at end of file