From 6959e595f56be770bab8b41b6c8932fe712057ce Mon Sep 17 00:00:00 2001 From: Stephan Date: Sat, 28 Apr 2018 16:35:33 +0200 Subject: [PATCH] IPublishedContent.UrlSegment --- .../Models/PublishedContent/IPublishedContent.cs | 2 +- .../Models/PublishedContent/PublishedContentWrapped.cs | 2 +- .../Cache/PublishedCache/PublishedMediaCacheTests.cs | 2 +- src/Umbraco.Tests/Published/NestedContentTests.cs | 2 +- .../PublishedContent/PublishedContentDataTableTests.cs | 4 ++-- .../PublishedContent/PublishedContentMoreTests.cs | 6 +++--- .../PublishedContent/SolidPublishedSnapshot.cs | 2 +- src/Umbraco.Tests/TestHelpers/Stubs/TestPublishedContent.cs | 2 +- src/Umbraco.Web/Models/PublishedContentBase.cs | 2 +- .../PublishedCache/NuCache/Navigable/NavigableContent.cs | 2 +- src/Umbraco.Web/PublishedCache/NuCache/PublishedContent.cs | 2 +- src/Umbraco.Web/PublishedCache/PublishedMember.cs | 2 +- .../XmlPublishedCache/DictionaryPublishedContent.cs | 2 +- .../XmlPublishedCache/PublishedContentCache.cs | 2 +- .../PublishedCache/XmlPublishedCache/XmlPublishedContent.cs | 2 +- src/Umbraco.Web/umbraco.presentation/page.cs | 2 +- 16 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/Umbraco.Core/Models/PublishedContent/IPublishedContent.cs b/src/Umbraco.Core/Models/PublishedContent/IPublishedContent.cs index 23f5bbff8d..e8de7efeda 100644 --- a/src/Umbraco.Core/Models/PublishedContent/IPublishedContent.cs +++ b/src/Umbraco.Core/Models/PublishedContent/IPublishedContent.cs @@ -44,7 +44,7 @@ namespace Umbraco.Core.Models.PublishedContent /// this is the name for the 'current' culture. /// /// FIXME rename UrlSegment + culture aware - string UrlName { get; } // fixme rename, segment! + string UrlSegment { get; } /// /// Gets the sort order of the content item. diff --git a/src/Umbraco.Core/Models/PublishedContent/PublishedContentWrapped.cs b/src/Umbraco.Core/Models/PublishedContent/PublishedContentWrapped.cs index f8a4e16bd2..8d4888cf25 100644 --- a/src/Umbraco.Core/Models/PublishedContent/PublishedContentWrapped.cs +++ b/src/Umbraco.Core/Models/PublishedContent/PublishedContentWrapped.cs @@ -61,7 +61,7 @@ namespace Umbraco.Core.Models.PublishedContent public virtual string Name => _content.Name; /// - public virtual string UrlName => _content.UrlName; + public virtual string UrlSegment => _content.UrlSegment; /// public virtual int SortOrder => _content.SortOrder; diff --git a/src/Umbraco.Tests/Cache/PublishedCache/PublishedMediaCacheTests.cs b/src/Umbraco.Tests/Cache/PublishedCache/PublishedMediaCacheTests.cs index 78a75af835..64194ebb47 100644 --- a/src/Umbraco.Tests/Cache/PublishedCache/PublishedMediaCacheTests.cs +++ b/src/Umbraco.Tests/Cache/PublishedCache/PublishedMediaCacheTests.cs @@ -393,7 +393,7 @@ namespace Umbraco.Tests.Cache.PublishedCache Assert.AreEqual(keyVal, doc.Key); Assert.AreEqual(templateIdVal, doc.TemplateId); Assert.AreEqual(sortOrderVal, doc.SortOrder); - Assert.AreEqual(urlNameVal, doc.UrlName); + Assert.AreEqual(urlNameVal, doc.UrlSegment); Assert.AreEqual(nodeTypeAliasVal, doc.ContentType.Alias); Assert.AreEqual(nodeTypeIdVal, doc.ContentType.Id); Assert.AreEqual(writerNameVal, doc.WriterName); diff --git a/src/Umbraco.Tests/Published/NestedContentTests.cs b/src/Umbraco.Tests/Published/NestedContentTests.cs index d86b7f0e6b..ea5fa6f7e6 100644 --- a/src/Umbraco.Tests/Published/NestedContentTests.cs +++ b/src/Umbraco.Tests/Published/NestedContentTests.cs @@ -275,7 +275,7 @@ namespace Umbraco.Tests.Published public override string Name { get; } public override PublishedCultureInfos GetCulture(string culture = ".") => throw new NotSupportedException(); public override IReadOnlyDictionary Cultures => throw new NotSupportedException(); - public override string UrlName { get; } + public override string UrlSegment { get; } public override string WriterName { get; } public override string CreatorName { get; } public override int WriterId { get; } diff --git a/src/Umbraco.Tests/PublishedContent/PublishedContentDataTableTests.cs b/src/Umbraco.Tests/PublishedContent/PublishedContentDataTableTests.cs index 56c60446ef..af63d2244b 100644 --- a/src/Umbraco.Tests/PublishedContent/PublishedContentDataTableTests.cs +++ b/src/Umbraco.Tests/PublishedContent/PublishedContentDataTableTests.cs @@ -142,7 +142,7 @@ namespace Umbraco.Tests.PublishedContent TemplateId = 5, UpdateDate = DateTime.Now, Path = "-1,3", - UrlName = "home-page", + UrlSegment = "home-page", Name = "Page" + Guid.NewGuid().ToString(), Version = Guid.NewGuid(), WriterId = 1, @@ -207,7 +207,7 @@ namespace Umbraco.Tests.PublishedContent public string Name { get; set; } public PublishedCultureInfos GetCulture(string culture = ".") => throw new NotSupportedException(); public IReadOnlyDictionary Cultures => throw new NotSupportedException(); - public string UrlName { get; set; } + public string UrlSegment { get; set; } public string WriterName { get; set; } public string CreatorName { get; set; } public int WriterId { get; set; } diff --git a/src/Umbraco.Tests/PublishedContent/PublishedContentMoreTests.cs b/src/Umbraco.Tests/PublishedContent/PublishedContentMoreTests.cs index 61c37d6a51..465034db05 100644 --- a/src/Umbraco.Tests/PublishedContent/PublishedContentMoreTests.cs +++ b/src/Umbraco.Tests/PublishedContent/PublishedContentMoreTests.cs @@ -220,7 +220,7 @@ namespace Umbraco.Tests.PublishedContent Id = 1, SortOrder = 0, Name = "Content 1", - UrlName = "content-1", + UrlSegment = "content-1", Path = "/1", Level = 1, Url = "/content-1", @@ -243,7 +243,7 @@ namespace Umbraco.Tests.PublishedContent Id = 2, SortOrder = 1, Name = "Content 2", - UrlName = "content-2", + UrlSegment = "content-2", Path = "/2", Level = 1, Url = "/content-2", @@ -266,7 +266,7 @@ namespace Umbraco.Tests.PublishedContent Id = 3, SortOrder = 2, Name = "Content 2Sub", - UrlName = "content-2sub", + UrlSegment = "content-2sub", Path = "/3", Level = 1, Url = "/content-2sub", diff --git a/src/Umbraco.Tests/PublishedContent/SolidPublishedSnapshot.cs b/src/Umbraco.Tests/PublishedContent/SolidPublishedSnapshot.cs index 307ef459fb..38ba7e771b 100644 --- a/src/Umbraco.Tests/PublishedContent/SolidPublishedSnapshot.cs +++ b/src/Umbraco.Tests/PublishedContent/SolidPublishedSnapshot.cs @@ -178,7 +178,7 @@ namespace Umbraco.Tests.PublishedContent public string Name { get; set; } public PublishedCultureInfos GetCulture(string culture = ".") => throw new NotSupportedException(); public IReadOnlyDictionary Cultures => throw new NotSupportedException(); - public string UrlName { get; set; } + public string UrlSegment { get; set; } public string WriterName { get; set; } public string CreatorName { get; set; } public int WriterId { get; set; } diff --git a/src/Umbraco.Tests/TestHelpers/Stubs/TestPublishedContent.cs b/src/Umbraco.Tests/TestHelpers/Stubs/TestPublishedContent.cs index 042794e573..14a0979091 100644 --- a/src/Umbraco.Tests/TestHelpers/Stubs/TestPublishedContent.cs +++ b/src/Umbraco.Tests/TestHelpers/Stubs/TestPublishedContent.cs @@ -32,7 +32,7 @@ namespace Umbraco.Tests.TestHelpers.Stubs return Cultures.TryGetValue(culture, out var cultureInfos) ? cultureInfos : null; } public IReadOnlyDictionary Cultures { get; set; } - public string UrlName { get; set; } + public string UrlSegment { get; set; } public string DocumentTypeAlias => ContentType.Alias; public int DocumentTypeId { get; set; } public string WriterName { get; set; } diff --git a/src/Umbraco.Web/Models/PublishedContentBase.cs b/src/Umbraco.Web/Models/PublishedContentBase.cs index 084ca1fee2..0fe7bc0fc7 100644 --- a/src/Umbraco.Web/Models/PublishedContentBase.cs +++ b/src/Umbraco.Web/Models/PublishedContentBase.cs @@ -43,7 +43,7 @@ namespace Umbraco.Web.Models public abstract string Name { get; } /// - public abstract string UrlName { get; } + public abstract string UrlSegment { get; } /// public abstract int SortOrder { get; } diff --git a/src/Umbraco.Web/PublishedCache/NuCache/Navigable/NavigableContent.cs b/src/Umbraco.Web/PublishedCache/NuCache/Navigable/NavigableContent.cs index 2357d17273..2fe7a26d45 100644 --- a/src/Umbraco.Web/PublishedCache/NuCache/Navigable/NavigableContent.cs +++ b/src/Umbraco.Web/PublishedCache/NuCache/Navigable/NavigableContent.cs @@ -28,7 +28,7 @@ namespace Umbraco.Web.PublishedCache.NuCache.Navigable XmlString(i++, _content.TemplateId), XmlString(i++, _content.WriterId), XmlString(i++, _content.CreatorId), - XmlString(i++, _content.UrlName), + XmlString(i++, _content.UrlSegment), XmlString(i, _content.IsDraft) }; } diff --git a/src/Umbraco.Web/PublishedCache/NuCache/PublishedContent.cs b/src/Umbraco.Web/PublishedCache/NuCache/PublishedContent.cs index d2a4e2f539..5b6c8ca783 100644 --- a/src/Umbraco.Web/PublishedCache/NuCache/PublishedContent.cs +++ b/src/Umbraco.Web/PublishedCache/NuCache/PublishedContent.cs @@ -191,7 +191,7 @@ namespace Umbraco.Web.PublishedCache.NuCache } /// - public override string UrlName + public override string UrlSegment { get { diff --git a/src/Umbraco.Web/PublishedCache/PublishedMember.cs b/src/Umbraco.Web/PublishedCache/PublishedMember.cs index 084daf6457..8983f1e152 100644 --- a/src/Umbraco.Web/PublishedCache/PublishedMember.cs +++ b/src/Umbraco.Web/PublishedCache/PublishedMember.cs @@ -148,7 +148,7 @@ namespace Umbraco.Web.PublishedCache public override IReadOnlyDictionary Cultures => throw new NotSupportedException(); - public override string UrlName => throw new NotSupportedException(); + public override string UrlSegment => throw new NotSupportedException(); //TODO: ARGH! need to fix this - this is not good because it uses ApplicationContext.Current public override string WriterName => _member.GetCreatorProfile().Name; diff --git a/src/Umbraco.Web/PublishedCache/XmlPublishedCache/DictionaryPublishedContent.cs b/src/Umbraco.Web/PublishedCache/XmlPublishedCache/DictionaryPublishedContent.cs index 5ef600ba76..b72425085e 100644 --- a/src/Umbraco.Web/PublishedCache/XmlPublishedCache/DictionaryPublishedContent.cs +++ b/src/Umbraco.Web/PublishedCache/XmlPublishedCache/DictionaryPublishedContent.cs @@ -158,7 +158,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache public override IReadOnlyDictionary Cultures => throw new NotSupportedException(); - public override string UrlName => _urlName; + public override string UrlSegment => _urlName; public override string WriterName => _creatorName; diff --git a/src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedContentCache.cs b/src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedContentCache.cs index 57d9e0a980..7aac1ed017 100644 --- a/src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedContentCache.cs +++ b/src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedContentCache.cs @@ -266,7 +266,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache while (hasDomains == false && n != null) // n is null at root { // get the url - var urlName = n.UrlName; + var urlName = n.UrlSegment; pathParts.Add(urlName); // move to parent node diff --git a/src/Umbraco.Web/PublishedCache/XmlPublishedCache/XmlPublishedContent.cs b/src/Umbraco.Web/PublishedCache/XmlPublishedCache/XmlPublishedContent.cs index eba0312a46..3ad30b4d3f 100644 --- a/src/Umbraco.Web/PublishedCache/XmlPublishedCache/XmlPublishedContent.cs +++ b/src/Umbraco.Web/PublishedCache/XmlPublishedCache/XmlPublishedContent.cs @@ -217,7 +217,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache } } - public override string UrlName + public override string UrlSegment { get { diff --git a/src/Umbraco.Web/umbraco.presentation/page.cs b/src/Umbraco.Web/umbraco.presentation/page.cs index e49bdff9ec..b37a5d42e0 100644 --- a/src/Umbraco.Web/umbraco.presentation/page.cs +++ b/src/Umbraco.Web/umbraco.presentation/page.cs @@ -505,7 +505,7 @@ namespace umbraco } } - public string UrlName + public string UrlSegment { get { throw new NotImplementedException(); } }