From 171fce2ecb0870f1c4a6a38a6425f803e3ddba29 Mon Sep 17 00:00:00 2001 From: Andy Butland Date: Thu, 30 Jan 2020 20:05:16 +0100 Subject: [PATCH] Moved PublishedCache from Umbraco.Web into .Net standard project. Returned to compiling state with a number of things to check and some temporarily commented out functionality. --- .../PublishedContent}/PublishedContentBase.cs | 2 +- .../IPublishedSnapshotService.cs | 4 ++ .../CompositionExtensions.cs | 41 ++++++++++++++ .../DefaultCultureAccessor.cs | 0 .../NuCache/CacheKeys.cs | 0 .../NuCache/ContentCache.cs | 0 .../NuCache/ContentNode.cs | 0 .../NuCache/ContentNodeKit.cs | 0 .../NuCache/ContentStore.cs | 0 .../DataSource/BTree.ContentDataSerializer.cs | 0 .../BTree.ContentNodeKitSerializer.cs | 0 ....DictionaryOfCultureVariationSerializer.cs | 0 ...Tree.DictionaryOfPropertyDataSerializer.cs | 0 .../NuCache/DataSource/BTree.cs | 0 .../NuCache/DataSource/ContentData.cs | 0 .../NuCache/DataSource/ContentNestedData.cs | 0 .../NuCache/DataSource/ContentSourceDto.cs | 0 .../NuCache/DataSource/CultureVariation.cs | 0 .../NuCache/DataSource/DatabaseDataSource.cs | 14 +++-- .../NuCache/DataSource/IDataSource.cs | 0 .../NuCache/DataSource/PropertyData.cs | 0 .../NuCache/DataSource/SerializerBase.cs | 0 .../NuCache/DomainCache.cs | 0 .../NuCache/MediaCache.cs | 0 .../NuCache/MemberCache.cs | 2 - .../NuCache/Navigable/INavigableData.cs | 0 .../NuCache/Navigable/NavigableContent.cs | 0 .../NuCache/Navigable/NavigableContentType.cs | 0 .../Navigable/NavigablePropertyType.cs | 0 .../NuCache/Navigable/RootContent.cs | 0 .../NuCache/Navigable/Source.cs | 0 .../NuCache/NuCacheComponent.cs | 0 .../NuCache/NuCacheComposer.cs | 1 + .../NuCache/Property.cs | 0 .../NuCache/PublishedContent.cs | 29 ++-------- .../NuCache/PublishedMember.cs | 0 .../NuCache/PublishedSnapshot.cs | 0 .../NuCache/PublishedSnapshotService.cs | 6 +-- .../PublishedSnapshotServiceOptions.cs | 0 .../NuCache/Snap/GenObj.cs | 0 .../NuCache/Snap/GenRef.cs | 0 .../NuCache/Snap/LinkedNode.cs | 0 .../NuCache/SnapDictionary.cs | 0 .../NuCache/readme.md | 0 .../PublishedCacheBase.cs | 9 ++-- .../PublishedContentTypeCache.cs | 0 .../PublishedElement.cs | 2 +- .../PublishedElementPropertyBase.cs | 0 .../PublishedMember.cs | 0 .../PublishedSnapshotServiceBase.cs | 6 +++ ...braco.Infrastructure.PublishedCache.csproj | 26 +++++++++ .../Umbraco.ModelsBuilder.Embedded.csproj | 4 ++ .../XmlPublishedSnapshotService.cs | 5 ++ .../Scoping/ScopedNuCacheTests.cs | 2 +- .../ContentTypeServiceVariantsTests.cs | 2 +- src/Umbraco.Tests/Umbraco.Tests.csproj | 4 ++ src/Umbraco.Web.UI/Umbraco.Web.UI.csproj | 2 + src/Umbraco.Web/CompositionExtensions.cs | 31 ----------- .../Editors/NuCacheStatusController.cs | 16 +++--- .../Editors/PublishedStatusController.cs | 10 ++-- src/Umbraco.Web/Umbraco.Web.csproj | 54 ++----------------- src/umbraco.sln | 17 ++++-- 62 files changed, 148 insertions(+), 141 deletions(-) rename src/{Umbraco.Web/Models => Umbraco.Abstractions/Models/PublishedContent}/PublishedContentBase.cs (97%) create mode 100644 src/Umbraco.Infrastructure.PublishedCache/CompositionExtensions.cs rename src/{Umbraco.Web/PublishedCache => Umbraco.Infrastructure.PublishedCache}/DefaultCultureAccessor.cs (100%) rename src/{Umbraco.Web/PublishedCache => Umbraco.Infrastructure.PublishedCache}/NuCache/CacheKeys.cs (100%) rename src/{Umbraco.Web/PublishedCache => Umbraco.Infrastructure.PublishedCache}/NuCache/ContentCache.cs (100%) rename src/{Umbraco.Web/PublishedCache => Umbraco.Infrastructure.PublishedCache}/NuCache/ContentNode.cs (100%) rename src/{Umbraco.Web/PublishedCache => Umbraco.Infrastructure.PublishedCache}/NuCache/ContentNodeKit.cs (100%) rename src/{Umbraco.Web/PublishedCache => Umbraco.Infrastructure.PublishedCache}/NuCache/ContentStore.cs (100%) rename src/{Umbraco.Web/PublishedCache => Umbraco.Infrastructure.PublishedCache}/NuCache/DataSource/BTree.ContentDataSerializer.cs (100%) rename src/{Umbraco.Web/PublishedCache => Umbraco.Infrastructure.PublishedCache}/NuCache/DataSource/BTree.ContentNodeKitSerializer.cs (100%) rename src/{Umbraco.Web/PublishedCache => Umbraco.Infrastructure.PublishedCache}/NuCache/DataSource/BTree.DictionaryOfCultureVariationSerializer.cs (100%) rename src/{Umbraco.Web/PublishedCache => Umbraco.Infrastructure.PublishedCache}/NuCache/DataSource/BTree.DictionaryOfPropertyDataSerializer.cs (100%) rename src/{Umbraco.Web/PublishedCache => Umbraco.Infrastructure.PublishedCache}/NuCache/DataSource/BTree.cs (100%) rename src/{Umbraco.Web/PublishedCache => Umbraco.Infrastructure.PublishedCache}/NuCache/DataSource/ContentData.cs (100%) rename src/{Umbraco.Web/PublishedCache => Umbraco.Infrastructure.PublishedCache}/NuCache/DataSource/ContentNestedData.cs (100%) rename src/{Umbraco.Web/PublishedCache => Umbraco.Infrastructure.PublishedCache}/NuCache/DataSource/ContentSourceDto.cs (100%) rename src/{Umbraco.Web/PublishedCache => Umbraco.Infrastructure.PublishedCache}/NuCache/DataSource/CultureVariation.cs (100%) rename src/{Umbraco.Web/PublishedCache => Umbraco.Infrastructure.PublishedCache}/NuCache/DataSource/DatabaseDataSource.cs (96%) rename src/{Umbraco.Web/PublishedCache => Umbraco.Infrastructure.PublishedCache}/NuCache/DataSource/IDataSource.cs (100%) rename src/{Umbraco.Web/PublishedCache => Umbraco.Infrastructure.PublishedCache}/NuCache/DataSource/PropertyData.cs (100%) rename src/{Umbraco.Web/PublishedCache => Umbraco.Infrastructure.PublishedCache}/NuCache/DataSource/SerializerBase.cs (100%) rename src/{Umbraco.Web/PublishedCache => Umbraco.Infrastructure.PublishedCache}/NuCache/DomainCache.cs (100%) rename src/{Umbraco.Web/PublishedCache => Umbraco.Infrastructure.PublishedCache}/NuCache/MediaCache.cs (100%) rename src/{Umbraco.Web/PublishedCache => Umbraco.Infrastructure.PublishedCache}/NuCache/MemberCache.cs (99%) rename src/{Umbraco.Web/PublishedCache => Umbraco.Infrastructure.PublishedCache}/NuCache/Navigable/INavigableData.cs (100%) rename src/{Umbraco.Web/PublishedCache => Umbraco.Infrastructure.PublishedCache}/NuCache/Navigable/NavigableContent.cs (100%) rename src/{Umbraco.Web/PublishedCache => Umbraco.Infrastructure.PublishedCache}/NuCache/Navigable/NavigableContentType.cs (100%) rename src/{Umbraco.Web/PublishedCache => Umbraco.Infrastructure.PublishedCache}/NuCache/Navigable/NavigablePropertyType.cs (100%) rename src/{Umbraco.Web/PublishedCache => Umbraco.Infrastructure.PublishedCache}/NuCache/Navigable/RootContent.cs (100%) rename src/{Umbraco.Web/PublishedCache => Umbraco.Infrastructure.PublishedCache}/NuCache/Navigable/Source.cs (100%) rename src/{Umbraco.Web/PublishedCache => Umbraco.Infrastructure.PublishedCache}/NuCache/NuCacheComponent.cs (100%) rename src/{Umbraco.Web/PublishedCache => Umbraco.Infrastructure.PublishedCache}/NuCache/NuCacheComposer.cs (97%) rename src/{Umbraco.Web/PublishedCache => Umbraco.Infrastructure.PublishedCache}/NuCache/Property.cs (100%) rename src/{Umbraco.Web/PublishedCache => Umbraco.Infrastructure.PublishedCache}/NuCache/PublishedContent.cs (93%) rename src/{Umbraco.Web/PublishedCache => Umbraco.Infrastructure.PublishedCache}/NuCache/PublishedMember.cs (100%) rename src/{Umbraco.Web/PublishedCache => Umbraco.Infrastructure.PublishedCache}/NuCache/PublishedSnapshot.cs (100%) rename src/{Umbraco.Web/PublishedCache => Umbraco.Infrastructure.PublishedCache}/NuCache/PublishedSnapshotService.cs (99%) mode change 100755 => 100644 rename src/{Umbraco.Web/PublishedCache => Umbraco.Infrastructure.PublishedCache}/NuCache/PublishedSnapshotServiceOptions.cs (100%) rename src/{Umbraco.Web/PublishedCache => Umbraco.Infrastructure.PublishedCache}/NuCache/Snap/GenObj.cs (100%) rename src/{Umbraco.Web/PublishedCache => Umbraco.Infrastructure.PublishedCache}/NuCache/Snap/GenRef.cs (100%) rename src/{Umbraco.Web/PublishedCache => Umbraco.Infrastructure.PublishedCache}/NuCache/Snap/LinkedNode.cs (100%) rename src/{Umbraco.Web/PublishedCache => Umbraco.Infrastructure.PublishedCache}/NuCache/SnapDictionary.cs (100%) rename src/{Umbraco.Web/PublishedCache => Umbraco.Infrastructure.PublishedCache}/NuCache/readme.md (100%) rename src/{Umbraco.Web/PublishedCache => Umbraco.Infrastructure.PublishedCache}/PublishedCacheBase.cs (92%) rename src/{Umbraco.Web/PublishedCache => Umbraco.Infrastructure.PublishedCache}/PublishedContentTypeCache.cs (100%) rename src/{Umbraco.Web/PublishedCache => Umbraco.Infrastructure.PublishedCache}/PublishedElement.cs (98%) rename src/{Umbraco.Web/PublishedCache => Umbraco.Infrastructure.PublishedCache}/PublishedElementPropertyBase.cs (100%) rename src/{Umbraco.Web/PublishedCache => Umbraco.Infrastructure.PublishedCache}/PublishedMember.cs (100%) rename src/{Umbraco.Web/PublishedCache => Umbraco.Infrastructure.PublishedCache}/PublishedSnapshotServiceBase.cs (95%) create mode 100644 src/Umbraco.Infrastructure.PublishedCache/Umbraco.Infrastructure.PublishedCache.csproj diff --git a/src/Umbraco.Web/Models/PublishedContentBase.cs b/src/Umbraco.Abstractions/Models/PublishedContent/PublishedContentBase.cs similarity index 97% rename from src/Umbraco.Web/Models/PublishedContentBase.cs rename to src/Umbraco.Abstractions/Models/PublishedContent/PublishedContentBase.cs index 23fef7959e..6c6c9c4cc7 100644 --- a/src/Umbraco.Web/Models/PublishedContentBase.cs +++ b/src/Umbraco.Abstractions/Models/PublishedContent/PublishedContentBase.cs @@ -76,7 +76,7 @@ namespace Umbraco.Web.Models public abstract DateTime UpdateDate { get; } /// - public virtual string Url => this.Url(); + public virtual string Url => string.Empty; // TODO: get from this.Url(); /// public abstract IReadOnlyDictionary Cultures { get; } diff --git a/src/Umbraco.Abstractions/PublishedCache/IPublishedSnapshotService.cs b/src/Umbraco.Abstractions/PublishedCache/IPublishedSnapshotService.cs index 9949b4b3f8..96831e3112 100644 --- a/src/Umbraco.Abstractions/PublishedCache/IPublishedSnapshotService.cs +++ b/src/Umbraco.Abstractions/PublishedCache/IPublishedSnapshotService.cs @@ -160,5 +160,9 @@ namespace Umbraco.Web.PublishedCache void Notify(DomainCacheRefresher.JsonPayload[] payloads); #endregion + + string GetStatus(); + + void Collect(); } } diff --git a/src/Umbraco.Infrastructure.PublishedCache/CompositionExtensions.cs b/src/Umbraco.Infrastructure.PublishedCache/CompositionExtensions.cs new file mode 100644 index 0000000000..262c2a903c --- /dev/null +++ b/src/Umbraco.Infrastructure.PublishedCache/CompositionExtensions.cs @@ -0,0 +1,41 @@ +using System; +using Umbraco.Core; +using Umbraco.Core.Composing; +using Umbraco.Web.PublishedCache; + +namespace Umbraco.Infrastructure.PublishedCache +{ + public static class CompositionExtensions + { + /// + /// Sets the published snapshot service. + /// + /// The composition. + /// A function creating a published snapshot service. + public static void SetPublishedSnapshotService(this Composition composition, Func factory) + { + composition.RegisterUnique(factory); + } + + /// + /// Sets the published snapshot service. + /// + /// The type of the published snapshot service. + /// The composition. + public static void SetPublishedSnapshotService(this Composition composition) + where T : IPublishedSnapshotService + { + composition.RegisterUnique(); + } + + /// + /// Sets the published snapshot service. + /// + /// The composition. + /// A published snapshot service. + public static void SetPublishedSnapshotService(this Composition composition, IPublishedSnapshotService service) + { + composition.RegisterUnique(_ => service); + } + } +} diff --git a/src/Umbraco.Web/PublishedCache/DefaultCultureAccessor.cs b/src/Umbraco.Infrastructure.PublishedCache/DefaultCultureAccessor.cs similarity index 100% rename from src/Umbraco.Web/PublishedCache/DefaultCultureAccessor.cs rename to src/Umbraco.Infrastructure.PublishedCache/DefaultCultureAccessor.cs diff --git a/src/Umbraco.Web/PublishedCache/NuCache/CacheKeys.cs b/src/Umbraco.Infrastructure.PublishedCache/NuCache/CacheKeys.cs similarity index 100% rename from src/Umbraco.Web/PublishedCache/NuCache/CacheKeys.cs rename to src/Umbraco.Infrastructure.PublishedCache/NuCache/CacheKeys.cs diff --git a/src/Umbraco.Web/PublishedCache/NuCache/ContentCache.cs b/src/Umbraco.Infrastructure.PublishedCache/NuCache/ContentCache.cs similarity index 100% rename from src/Umbraco.Web/PublishedCache/NuCache/ContentCache.cs rename to src/Umbraco.Infrastructure.PublishedCache/NuCache/ContentCache.cs diff --git a/src/Umbraco.Web/PublishedCache/NuCache/ContentNode.cs b/src/Umbraco.Infrastructure.PublishedCache/NuCache/ContentNode.cs similarity index 100% rename from src/Umbraco.Web/PublishedCache/NuCache/ContentNode.cs rename to src/Umbraco.Infrastructure.PublishedCache/NuCache/ContentNode.cs diff --git a/src/Umbraco.Web/PublishedCache/NuCache/ContentNodeKit.cs b/src/Umbraco.Infrastructure.PublishedCache/NuCache/ContentNodeKit.cs similarity index 100% rename from src/Umbraco.Web/PublishedCache/NuCache/ContentNodeKit.cs rename to src/Umbraco.Infrastructure.PublishedCache/NuCache/ContentNodeKit.cs diff --git a/src/Umbraco.Web/PublishedCache/NuCache/ContentStore.cs b/src/Umbraco.Infrastructure.PublishedCache/NuCache/ContentStore.cs similarity index 100% rename from src/Umbraco.Web/PublishedCache/NuCache/ContentStore.cs rename to src/Umbraco.Infrastructure.PublishedCache/NuCache/ContentStore.cs diff --git a/src/Umbraco.Web/PublishedCache/NuCache/DataSource/BTree.ContentDataSerializer.cs b/src/Umbraco.Infrastructure.PublishedCache/NuCache/DataSource/BTree.ContentDataSerializer.cs similarity index 100% rename from src/Umbraco.Web/PublishedCache/NuCache/DataSource/BTree.ContentDataSerializer.cs rename to src/Umbraco.Infrastructure.PublishedCache/NuCache/DataSource/BTree.ContentDataSerializer.cs diff --git a/src/Umbraco.Web/PublishedCache/NuCache/DataSource/BTree.ContentNodeKitSerializer.cs b/src/Umbraco.Infrastructure.PublishedCache/NuCache/DataSource/BTree.ContentNodeKitSerializer.cs similarity index 100% rename from src/Umbraco.Web/PublishedCache/NuCache/DataSource/BTree.ContentNodeKitSerializer.cs rename to src/Umbraco.Infrastructure.PublishedCache/NuCache/DataSource/BTree.ContentNodeKitSerializer.cs diff --git a/src/Umbraco.Web/PublishedCache/NuCache/DataSource/BTree.DictionaryOfCultureVariationSerializer.cs b/src/Umbraco.Infrastructure.PublishedCache/NuCache/DataSource/BTree.DictionaryOfCultureVariationSerializer.cs similarity index 100% rename from src/Umbraco.Web/PublishedCache/NuCache/DataSource/BTree.DictionaryOfCultureVariationSerializer.cs rename to src/Umbraco.Infrastructure.PublishedCache/NuCache/DataSource/BTree.DictionaryOfCultureVariationSerializer.cs diff --git a/src/Umbraco.Web/PublishedCache/NuCache/DataSource/BTree.DictionaryOfPropertyDataSerializer.cs b/src/Umbraco.Infrastructure.PublishedCache/NuCache/DataSource/BTree.DictionaryOfPropertyDataSerializer.cs similarity index 100% rename from src/Umbraco.Web/PublishedCache/NuCache/DataSource/BTree.DictionaryOfPropertyDataSerializer.cs rename to src/Umbraco.Infrastructure.PublishedCache/NuCache/DataSource/BTree.DictionaryOfPropertyDataSerializer.cs diff --git a/src/Umbraco.Web/PublishedCache/NuCache/DataSource/BTree.cs b/src/Umbraco.Infrastructure.PublishedCache/NuCache/DataSource/BTree.cs similarity index 100% rename from src/Umbraco.Web/PublishedCache/NuCache/DataSource/BTree.cs rename to src/Umbraco.Infrastructure.PublishedCache/NuCache/DataSource/BTree.cs diff --git a/src/Umbraco.Web/PublishedCache/NuCache/DataSource/ContentData.cs b/src/Umbraco.Infrastructure.PublishedCache/NuCache/DataSource/ContentData.cs similarity index 100% rename from src/Umbraco.Web/PublishedCache/NuCache/DataSource/ContentData.cs rename to src/Umbraco.Infrastructure.PublishedCache/NuCache/DataSource/ContentData.cs diff --git a/src/Umbraco.Web/PublishedCache/NuCache/DataSource/ContentNestedData.cs b/src/Umbraco.Infrastructure.PublishedCache/NuCache/DataSource/ContentNestedData.cs similarity index 100% rename from src/Umbraco.Web/PublishedCache/NuCache/DataSource/ContentNestedData.cs rename to src/Umbraco.Infrastructure.PublishedCache/NuCache/DataSource/ContentNestedData.cs diff --git a/src/Umbraco.Web/PublishedCache/NuCache/DataSource/ContentSourceDto.cs b/src/Umbraco.Infrastructure.PublishedCache/NuCache/DataSource/ContentSourceDto.cs similarity index 100% rename from src/Umbraco.Web/PublishedCache/NuCache/DataSource/ContentSourceDto.cs rename to src/Umbraco.Infrastructure.PublishedCache/NuCache/DataSource/ContentSourceDto.cs diff --git a/src/Umbraco.Web/PublishedCache/NuCache/DataSource/CultureVariation.cs b/src/Umbraco.Infrastructure.PublishedCache/NuCache/DataSource/CultureVariation.cs similarity index 100% rename from src/Umbraco.Web/PublishedCache/NuCache/DataSource/CultureVariation.cs rename to src/Umbraco.Infrastructure.PublishedCache/NuCache/DataSource/CultureVariation.cs diff --git a/src/Umbraco.Web/PublishedCache/NuCache/DataSource/DatabaseDataSource.cs b/src/Umbraco.Infrastructure.PublishedCache/NuCache/DataSource/DatabaseDataSource.cs similarity index 96% rename from src/Umbraco.Web/PublishedCache/NuCache/DataSource/DatabaseDataSource.cs rename to src/Umbraco.Infrastructure.PublishedCache/NuCache/DataSource/DatabaseDataSource.cs index 4515e235ad..fcab4bb5df 100644 --- a/src/Umbraco.Web/PublishedCache/NuCache/DataSource/DatabaseDataSource.cs +++ b/src/Umbraco.Infrastructure.PublishedCache/NuCache/DataSource/DatabaseDataSource.cs @@ -10,7 +10,6 @@ using Umbraco.Core.Persistence; using Umbraco.Core.Persistence.Dtos; using Umbraco.Core.Scoping; using Umbraco.Core.Serialization; -using Umbraco.Web.Composing; using static Umbraco.Core.Persistence.SqlExtensionsStatics; namespace Umbraco.Web.PublishedCache.NuCache.DataSource @@ -20,6 +19,13 @@ namespace Umbraco.Web.PublishedCache.NuCache.DataSource // provides efficient database access for NuCache internal class DatabaseDataSource : IDataSource { + private readonly ILogger _logger; + + public DatabaseDataSource(ILogger logger) + { + _logger = logger ?? throw new ArgumentNullException(nameof(logger)); + } + // we want arrays, we want them all loaded, not an enumerable private Sql ContentSourcesSelect(IScope scope, Func, Sql> joins = null) @@ -181,7 +187,7 @@ namespace Umbraco.Web.PublishedCache.NuCache.DataSource return scope.Database.Query(sql).Select(CreateMediaNodeKit); } - private static ContentNodeKit CreateContentNodeKit(ContentSourceDto dto) + private ContentNodeKit CreateContentNodeKit(ContentSourceDto dto) { ContentData d = null; ContentData p = null; @@ -192,7 +198,7 @@ namespace Umbraco.Web.PublishedCache.NuCache.DataSource { if (Debugger.IsAttached) throw new Exception("Missing cmsContentNu edited content for node " + dto.Id + ", consider rebuilding."); - Current.Logger.Warn("Missing cmsContentNu edited content for node {NodeId}, consider rebuilding.", dto.Id); + _logger.Warn("Missing cmsContentNu edited content for node {NodeId}, consider rebuilding.", dto.Id); } else { @@ -219,7 +225,7 @@ namespace Umbraco.Web.PublishedCache.NuCache.DataSource { if (Debugger.IsAttached) throw new Exception("Missing cmsContentNu published content for node " + dto.Id + ", consider rebuilding."); - Current.Logger.Warn("Missing cmsContentNu published content for node {NodeId}, consider rebuilding.", dto.Id); + _logger.Warn("Missing cmsContentNu published content for node {NodeId}, consider rebuilding.", dto.Id); } else { diff --git a/src/Umbraco.Web/PublishedCache/NuCache/DataSource/IDataSource.cs b/src/Umbraco.Infrastructure.PublishedCache/NuCache/DataSource/IDataSource.cs similarity index 100% rename from src/Umbraco.Web/PublishedCache/NuCache/DataSource/IDataSource.cs rename to src/Umbraco.Infrastructure.PublishedCache/NuCache/DataSource/IDataSource.cs diff --git a/src/Umbraco.Web/PublishedCache/NuCache/DataSource/PropertyData.cs b/src/Umbraco.Infrastructure.PublishedCache/NuCache/DataSource/PropertyData.cs similarity index 100% rename from src/Umbraco.Web/PublishedCache/NuCache/DataSource/PropertyData.cs rename to src/Umbraco.Infrastructure.PublishedCache/NuCache/DataSource/PropertyData.cs diff --git a/src/Umbraco.Web/PublishedCache/NuCache/DataSource/SerializerBase.cs b/src/Umbraco.Infrastructure.PublishedCache/NuCache/DataSource/SerializerBase.cs similarity index 100% rename from src/Umbraco.Web/PublishedCache/NuCache/DataSource/SerializerBase.cs rename to src/Umbraco.Infrastructure.PublishedCache/NuCache/DataSource/SerializerBase.cs diff --git a/src/Umbraco.Web/PublishedCache/NuCache/DomainCache.cs b/src/Umbraco.Infrastructure.PublishedCache/NuCache/DomainCache.cs similarity index 100% rename from src/Umbraco.Web/PublishedCache/NuCache/DomainCache.cs rename to src/Umbraco.Infrastructure.PublishedCache/NuCache/DomainCache.cs diff --git a/src/Umbraco.Web/PublishedCache/NuCache/MediaCache.cs b/src/Umbraco.Infrastructure.PublishedCache/NuCache/MediaCache.cs similarity index 100% rename from src/Umbraco.Web/PublishedCache/NuCache/MediaCache.cs rename to src/Umbraco.Infrastructure.PublishedCache/NuCache/MediaCache.cs diff --git a/src/Umbraco.Web/PublishedCache/NuCache/MemberCache.cs b/src/Umbraco.Infrastructure.PublishedCache/NuCache/MemberCache.cs similarity index 99% rename from src/Umbraco.Web/PublishedCache/NuCache/MemberCache.cs rename to src/Umbraco.Infrastructure.PublishedCache/NuCache/MemberCache.cs index 9e2d1f4582..68d82731d8 100644 --- a/src/Umbraco.Web/PublishedCache/NuCache/MemberCache.cs +++ b/src/Umbraco.Infrastructure.PublishedCache/NuCache/MemberCache.cs @@ -6,11 +6,9 @@ using Umbraco.Core; using Umbraco.Core.Cache; using Umbraco.Core.Models; using Umbraco.Core.Models.PublishedContent; -using Umbraco.Core.Security; using Umbraco.Core.Services; using Umbraco.Core.Xml.XPath; using Umbraco.Web.PublishedCache.NuCache.Navigable; -using Umbraco.Web.Security; namespace Umbraco.Web.PublishedCache.NuCache { diff --git a/src/Umbraco.Web/PublishedCache/NuCache/Navigable/INavigableData.cs b/src/Umbraco.Infrastructure.PublishedCache/NuCache/Navigable/INavigableData.cs similarity index 100% rename from src/Umbraco.Web/PublishedCache/NuCache/Navigable/INavigableData.cs rename to src/Umbraco.Infrastructure.PublishedCache/NuCache/Navigable/INavigableData.cs diff --git a/src/Umbraco.Web/PublishedCache/NuCache/Navigable/NavigableContent.cs b/src/Umbraco.Infrastructure.PublishedCache/NuCache/Navigable/NavigableContent.cs similarity index 100% rename from src/Umbraco.Web/PublishedCache/NuCache/Navigable/NavigableContent.cs rename to src/Umbraco.Infrastructure.PublishedCache/NuCache/Navigable/NavigableContent.cs diff --git a/src/Umbraco.Web/PublishedCache/NuCache/Navigable/NavigableContentType.cs b/src/Umbraco.Infrastructure.PublishedCache/NuCache/Navigable/NavigableContentType.cs similarity index 100% rename from src/Umbraco.Web/PublishedCache/NuCache/Navigable/NavigableContentType.cs rename to src/Umbraco.Infrastructure.PublishedCache/NuCache/Navigable/NavigableContentType.cs diff --git a/src/Umbraco.Web/PublishedCache/NuCache/Navigable/NavigablePropertyType.cs b/src/Umbraco.Infrastructure.PublishedCache/NuCache/Navigable/NavigablePropertyType.cs similarity index 100% rename from src/Umbraco.Web/PublishedCache/NuCache/Navigable/NavigablePropertyType.cs rename to src/Umbraco.Infrastructure.PublishedCache/NuCache/Navigable/NavigablePropertyType.cs diff --git a/src/Umbraco.Web/PublishedCache/NuCache/Navigable/RootContent.cs b/src/Umbraco.Infrastructure.PublishedCache/NuCache/Navigable/RootContent.cs similarity index 100% rename from src/Umbraco.Web/PublishedCache/NuCache/Navigable/RootContent.cs rename to src/Umbraco.Infrastructure.PublishedCache/NuCache/Navigable/RootContent.cs diff --git a/src/Umbraco.Web/PublishedCache/NuCache/Navigable/Source.cs b/src/Umbraco.Infrastructure.PublishedCache/NuCache/Navigable/Source.cs similarity index 100% rename from src/Umbraco.Web/PublishedCache/NuCache/Navigable/Source.cs rename to src/Umbraco.Infrastructure.PublishedCache/NuCache/Navigable/Source.cs diff --git a/src/Umbraco.Web/PublishedCache/NuCache/NuCacheComponent.cs b/src/Umbraco.Infrastructure.PublishedCache/NuCache/NuCacheComponent.cs similarity index 100% rename from src/Umbraco.Web/PublishedCache/NuCache/NuCacheComponent.cs rename to src/Umbraco.Infrastructure.PublishedCache/NuCache/NuCacheComponent.cs diff --git a/src/Umbraco.Web/PublishedCache/NuCache/NuCacheComposer.cs b/src/Umbraco.Infrastructure.PublishedCache/NuCache/NuCacheComposer.cs similarity index 97% rename from src/Umbraco.Web/PublishedCache/NuCache/NuCacheComposer.cs rename to src/Umbraco.Infrastructure.PublishedCache/NuCache/NuCacheComposer.cs index 186f3908d1..06a2bdbe81 100644 --- a/src/Umbraco.Web/PublishedCache/NuCache/NuCacheComposer.cs +++ b/src/Umbraco.Infrastructure.PublishedCache/NuCache/NuCacheComposer.cs @@ -3,6 +3,7 @@ using Umbraco.Core.Composing; using Umbraco.Core.Models; using Umbraco.Core.Scoping; using Umbraco.Core.Services; +using Umbraco.Infrastructure.PublishedCache; using Umbraco.Web.PublishedCache.NuCache.DataSource; namespace Umbraco.Web.PublishedCache.NuCache diff --git a/src/Umbraco.Web/PublishedCache/NuCache/Property.cs b/src/Umbraco.Infrastructure.PublishedCache/NuCache/Property.cs similarity index 100% rename from src/Umbraco.Web/PublishedCache/NuCache/Property.cs rename to src/Umbraco.Infrastructure.PublishedCache/NuCache/Property.cs diff --git a/src/Umbraco.Web/PublishedCache/NuCache/PublishedContent.cs b/src/Umbraco.Infrastructure.PublishedCache/NuCache/PublishedContent.cs similarity index 93% rename from src/Umbraco.Web/PublishedCache/NuCache/PublishedContent.cs rename to src/Umbraco.Infrastructure.PublishedCache/NuCache/PublishedContent.cs index 1888613555..f9c6678343 100644 --- a/src/Umbraco.Web/PublishedCache/NuCache/PublishedContent.cs +++ b/src/Umbraco.Infrastructure.PublishedCache/NuCache/PublishedContent.cs @@ -4,9 +4,8 @@ using System.Linq; using Umbraco.Core; using Umbraco.Core.Cache; using Umbraco.Core.Exceptions; -using Umbraco.Core.Models; using Umbraco.Core.Models.PublishedContent; -using Umbraco.Web.Composing; +using Umbraco.Core.Services; using Umbraco.Web.Models; using Umbraco.Web.PublishedCache.NuCache.DataSource; @@ -48,28 +47,6 @@ namespace Umbraco.Web.PublishedCache.NuCache PropertiesArray = properties.ToArray(); } - private string GetProfileNameById(int id) - { - var cache = GetCurrentSnapshotCache(); - return cache == null - ? GetProfileNameByIdNoCache(id) - : (string)cache.Get(CacheKeys.ProfileName(id), () => GetProfileNameByIdNoCache(id)); - } - - private static string GetProfileNameByIdNoCache(int id) - { -#if DEBUG - var userService = Current.Services?.UserService; - if (userService == null) return "[null]"; // for tests -#else - // we don't want each published content to hold a reference to the service - // so where should they get the service from really? from the locator... - var userService = Current.Services.UserService; -#endif - var user = userService.GetProfileById(id); - return user?.Name; - } - // used when cloning in ContentNode public PublishedContent( ContentNode contentNode, @@ -171,7 +148,7 @@ namespace Umbraco.Web.PublishedCache.NuCache public override int CreatorId => _contentNode.CreatorId; /// - public override string CreatorName => GetProfileNameById(_contentNode.CreatorId); + public override string CreatorName => string.Empty; // TODO: remove (as want to avoid injecting user service to get these names) /// public override DateTime CreateDate => _contentNode.CreateDate; @@ -180,7 +157,7 @@ namespace Umbraco.Web.PublishedCache.NuCache public override int WriterId => ContentData.WriterId; /// - public override string WriterName => GetProfileNameById(ContentData.WriterId); + public override string WriterName => string.Empty; // TODO: remove (as want to avoid injecting user service to get these names) /// public override DateTime UpdateDate => ContentData.VersionDate; diff --git a/src/Umbraco.Web/PublishedCache/NuCache/PublishedMember.cs b/src/Umbraco.Infrastructure.PublishedCache/NuCache/PublishedMember.cs similarity index 100% rename from src/Umbraco.Web/PublishedCache/NuCache/PublishedMember.cs rename to src/Umbraco.Infrastructure.PublishedCache/NuCache/PublishedMember.cs diff --git a/src/Umbraco.Web/PublishedCache/NuCache/PublishedSnapshot.cs b/src/Umbraco.Infrastructure.PublishedCache/NuCache/PublishedSnapshot.cs similarity index 100% rename from src/Umbraco.Web/PublishedCache/NuCache/PublishedSnapshot.cs rename to src/Umbraco.Infrastructure.PublishedCache/NuCache/PublishedSnapshot.cs diff --git a/src/Umbraco.Web/PublishedCache/NuCache/PublishedSnapshotService.cs b/src/Umbraco.Infrastructure.PublishedCache/NuCache/PublishedSnapshotService.cs old mode 100755 new mode 100644 similarity index 99% rename from src/Umbraco.Web/PublishedCache/NuCache/PublishedSnapshotService.cs rename to src/Umbraco.Infrastructure.PublishedCache/NuCache/PublishedSnapshotService.cs index 67e334ec83..a997b6ab06 --- a/src/Umbraco.Web/PublishedCache/NuCache/PublishedSnapshotService.cs +++ b/src/Umbraco.Infrastructure.PublishedCache/NuCache/PublishedSnapshotService.cs @@ -26,11 +26,9 @@ using Umbraco.Core.Services.Changes; using Umbraco.Core.Services.Implement; using Umbraco.Core.Strings; using Umbraco.Web.Cache; -using Umbraco.Web.Install; using Umbraco.Web.PublishedCache.NuCache.DataSource; using Umbraco.Web.Routing; using File = System.IO.File; -using Current = Umbraco.Web.Composing.Current; namespace Umbraco.Web.PublishedCache.NuCache { @@ -1767,7 +1765,7 @@ AND cmsContentNu.nodeId IS NULL #region Instrument - public string GetStatus() + public override string GetStatus() { var dbCacheIsOk = VerifyContentDbCache() && VerifyMediaDbCache() @@ -1790,7 +1788,7 @@ AND cmsContentNu.nodeId IS NULL " and " + ms + " snapshot" + (ms > 1 ? "s" : "") + "."; } - public void Collect() + public override void Collect() { var contentCollect = _contentStore.CollectAsync(); var mediaCollect = _mediaStore.CollectAsync(); diff --git a/src/Umbraco.Web/PublishedCache/NuCache/PublishedSnapshotServiceOptions.cs b/src/Umbraco.Infrastructure.PublishedCache/NuCache/PublishedSnapshotServiceOptions.cs similarity index 100% rename from src/Umbraco.Web/PublishedCache/NuCache/PublishedSnapshotServiceOptions.cs rename to src/Umbraco.Infrastructure.PublishedCache/NuCache/PublishedSnapshotServiceOptions.cs diff --git a/src/Umbraco.Web/PublishedCache/NuCache/Snap/GenObj.cs b/src/Umbraco.Infrastructure.PublishedCache/NuCache/Snap/GenObj.cs similarity index 100% rename from src/Umbraco.Web/PublishedCache/NuCache/Snap/GenObj.cs rename to src/Umbraco.Infrastructure.PublishedCache/NuCache/Snap/GenObj.cs diff --git a/src/Umbraco.Web/PublishedCache/NuCache/Snap/GenRef.cs b/src/Umbraco.Infrastructure.PublishedCache/NuCache/Snap/GenRef.cs similarity index 100% rename from src/Umbraco.Web/PublishedCache/NuCache/Snap/GenRef.cs rename to src/Umbraco.Infrastructure.PublishedCache/NuCache/Snap/GenRef.cs diff --git a/src/Umbraco.Web/PublishedCache/NuCache/Snap/LinkedNode.cs b/src/Umbraco.Infrastructure.PublishedCache/NuCache/Snap/LinkedNode.cs similarity index 100% rename from src/Umbraco.Web/PublishedCache/NuCache/Snap/LinkedNode.cs rename to src/Umbraco.Infrastructure.PublishedCache/NuCache/Snap/LinkedNode.cs diff --git a/src/Umbraco.Web/PublishedCache/NuCache/SnapDictionary.cs b/src/Umbraco.Infrastructure.PublishedCache/NuCache/SnapDictionary.cs similarity index 100% rename from src/Umbraco.Web/PublishedCache/NuCache/SnapDictionary.cs rename to src/Umbraco.Infrastructure.PublishedCache/NuCache/SnapDictionary.cs diff --git a/src/Umbraco.Web/PublishedCache/NuCache/readme.md b/src/Umbraco.Infrastructure.PublishedCache/NuCache/readme.md similarity index 100% rename from src/Umbraco.Web/PublishedCache/NuCache/readme.md rename to src/Umbraco.Infrastructure.PublishedCache/NuCache/readme.md diff --git a/src/Umbraco.Web/PublishedCache/PublishedCacheBase.cs b/src/Umbraco.Infrastructure.PublishedCache/PublishedCacheBase.cs similarity index 92% rename from src/Umbraco.Web/PublishedCache/PublishedCacheBase.cs rename to src/Umbraco.Infrastructure.PublishedCache/PublishedCacheBase.cs index 1f637663e5..50ee48e1ba 100644 --- a/src/Umbraco.Web/PublishedCache/PublishedCacheBase.cs +++ b/src/Umbraco.Infrastructure.PublishedCache/PublishedCacheBase.cs @@ -94,11 +94,14 @@ namespace Umbraco.Web.PublishedCache public virtual IEnumerable GetByContentType(IPublishedContentType contentType) { + // TODO: move this extension method and get working again. + // this is probably not super-efficient, but works // some cache implementation may want to override it, though - return GetAtRoot() - .SelectMany(x => x.DescendantsOrSelf()) - .Where(x => x.ContentType.Id == contentType.Id); + return Enumerable.Empty(); + //return GetAtRoot() + // .SelectMany(x => x.DescendantsOrSelf()) + // .Where(x => x.ContentType.Id == contentType.Id); } } } diff --git a/src/Umbraco.Web/PublishedCache/PublishedContentTypeCache.cs b/src/Umbraco.Infrastructure.PublishedCache/PublishedContentTypeCache.cs similarity index 100% rename from src/Umbraco.Web/PublishedCache/PublishedContentTypeCache.cs rename to src/Umbraco.Infrastructure.PublishedCache/PublishedContentTypeCache.cs diff --git a/src/Umbraco.Web/PublishedCache/PublishedElement.cs b/src/Umbraco.Infrastructure.PublishedCache/PublishedElement.cs similarity index 98% rename from src/Umbraco.Web/PublishedCache/PublishedElement.cs rename to src/Umbraco.Infrastructure.PublishedCache/PublishedElement.cs index 618c075b9b..b7c8f77bb7 100644 --- a/src/Umbraco.Web/PublishedCache/PublishedElement.cs +++ b/src/Umbraco.Infrastructure.PublishedCache/PublishedElement.cs @@ -14,7 +14,7 @@ namespace Umbraco.Web.PublishedCache // an entirely new models factory + not even sure it makes sense at all since // sets are created manually todo yes it does! - what does this all mean? // - internal class PublishedElement : IPublishedElement + public class PublishedElement : IPublishedElement { // initializes a new instance of the PublishedElement class // within the context of a published snapshot service (eg a published content property value) diff --git a/src/Umbraco.Web/PublishedCache/PublishedElementPropertyBase.cs b/src/Umbraco.Infrastructure.PublishedCache/PublishedElementPropertyBase.cs similarity index 100% rename from src/Umbraco.Web/PublishedCache/PublishedElementPropertyBase.cs rename to src/Umbraco.Infrastructure.PublishedCache/PublishedElementPropertyBase.cs diff --git a/src/Umbraco.Web/PublishedCache/PublishedMember.cs b/src/Umbraco.Infrastructure.PublishedCache/PublishedMember.cs similarity index 100% rename from src/Umbraco.Web/PublishedCache/PublishedMember.cs rename to src/Umbraco.Infrastructure.PublishedCache/PublishedMember.cs diff --git a/src/Umbraco.Web/PublishedCache/PublishedSnapshotServiceBase.cs b/src/Umbraco.Infrastructure.PublishedCache/PublishedSnapshotServiceBase.cs similarity index 95% rename from src/Umbraco.Web/PublishedCache/PublishedSnapshotServiceBase.cs rename to src/Umbraco.Infrastructure.PublishedCache/PublishedSnapshotServiceBase.cs index 20d3e6d8e3..c7236f9c54 100644 --- a/src/Umbraco.Web/PublishedCache/PublishedSnapshotServiceBase.cs +++ b/src/Umbraco.Infrastructure.PublishedCache/PublishedSnapshotServiceBase.cs @@ -38,5 +38,11 @@ namespace Umbraco.Web.PublishedCache public virtual void Dispose() { } + + public abstract string GetStatus(); + + public virtual void Collect() + { + } } } diff --git a/src/Umbraco.Infrastructure.PublishedCache/Umbraco.Infrastructure.PublishedCache.csproj b/src/Umbraco.Infrastructure.PublishedCache/Umbraco.Infrastructure.PublishedCache.csproj new file mode 100644 index 0000000000..d4c30668c5 --- /dev/null +++ b/src/Umbraco.Infrastructure.PublishedCache/Umbraco.Infrastructure.PublishedCache.csproj @@ -0,0 +1,26 @@ + + + + netstandard2.0 + + + + + + + + + + + + + + + <_Parameter1>Umbraco.Tests + + + <_Parameter1>Umbraco.Tests.Benchmarks + + + + diff --git a/src/Umbraco.ModelsBuilder.Embedded/Umbraco.ModelsBuilder.Embedded.csproj b/src/Umbraco.ModelsBuilder.Embedded/Umbraco.ModelsBuilder.Embedded.csproj index 073a6566d0..1b9e78728d 100644 --- a/src/Umbraco.ModelsBuilder.Embedded/Umbraco.ModelsBuilder.Embedded.csproj +++ b/src/Umbraco.ModelsBuilder.Embedded/Umbraco.ModelsBuilder.Embedded.csproj @@ -105,6 +105,10 @@ {29aa69d9-b597-4395-8d42-43b1263c240a} Umbraco.Abstractions + + {f6de8da0-07cc-4ef2-8a59-2bc81dbb3830} + Umbraco.Infrastructure.PublishedCache + {3ae7bf57-966b-45a5-910a-954d7c554441} Umbraco.Infrastructure diff --git a/src/Umbraco.Tests/LegacyXmlPublishedCache/XmlPublishedSnapshotService.cs b/src/Umbraco.Tests/LegacyXmlPublishedCache/XmlPublishedSnapshotService.cs index 2e8f52a6a7..609dcd98b8 100644 --- a/src/Umbraco.Tests/LegacyXmlPublishedCache/XmlPublishedSnapshotService.cs +++ b/src/Umbraco.Tests/LegacyXmlPublishedCache/XmlPublishedSnapshotService.cs @@ -268,5 +268,10 @@ namespace Umbraco.Tests.LegacyXmlPublishedCache } #endregion + + public override string GetStatus() + { + return "Test status"; + } } } diff --git a/src/Umbraco.Tests/Scoping/ScopedNuCacheTests.cs b/src/Umbraco.Tests/Scoping/ScopedNuCacheTests.cs index eba7187147..9e351ff3c9 100644 --- a/src/Umbraco.Tests/Scoping/ScopedNuCacheTests.cs +++ b/src/Umbraco.Tests/Scoping/ScopedNuCacheTests.cs @@ -100,7 +100,7 @@ namespace Umbraco.Tests.Scoping ScopeProvider, documentRepository, mediaRepository, memberRepository, DefaultCultureAccessor, - new DatabaseDataSource(), + new DatabaseDataSource(Mock.Of()), Factory.GetInstance(), Factory.GetInstance(), new NoopPublishedModelFactory(), diff --git a/src/Umbraco.Tests/Services/ContentTypeServiceVariantsTests.cs b/src/Umbraco.Tests/Services/ContentTypeServiceVariantsTests.cs index bbd428b918..8653aa3c58 100644 --- a/src/Umbraco.Tests/Services/ContentTypeServiceVariantsTests.cs +++ b/src/Umbraco.Tests/Services/ContentTypeServiceVariantsTests.cs @@ -72,7 +72,7 @@ namespace Umbraco.Tests.Services ScopeProvider, documentRepository, mediaRepository, memberRepository, DefaultCultureAccessor, - new DatabaseDataSource(), + new DatabaseDataSource(Mock.Of()), Factory.GetInstance(), Factory.GetInstance(), Mock.Of(), diff --git a/src/Umbraco.Tests/Umbraco.Tests.csproj b/src/Umbraco.Tests/Umbraco.Tests.csproj index a06c0c0b25..1a3e2ace20 100644 --- a/src/Umbraco.Tests/Umbraco.Tests.csproj +++ b/src/Umbraco.Tests/Umbraco.Tests.csproj @@ -562,6 +562,10 @@ {fbe7c065-dac0-4025-a78b-63b24d3ab00b} Umbraco.Configuration + + {f6de8da0-07cc-4ef2-8a59-2bc81dbb3830} + Umbraco.Infrastructure.PublishedCache + {3ae7bf57-966b-45a5-910a-954d7c554441} Umbraco.Infrastructure diff --git a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj index b04c2e2dcd..f78202af7a 100644 --- a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj +++ b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj @@ -383,7 +383,9 @@ + diff --git a/src/Umbraco.Web/CompositionExtensions.cs b/src/Umbraco.Web/CompositionExtensions.cs index 27a56afc1e..ae5a4f9773 100644 --- a/src/Umbraco.Web/CompositionExtensions.cs +++ b/src/Umbraco.Web/CompositionExtensions.cs @@ -169,37 +169,6 @@ namespace Umbraco.Web composition.RegisterUnique(_ => finder); } - /// - /// Sets the published snapshot service. - /// - /// The type of the published snapshot service. - /// The composition. - public static void SetPublishedSnapshotService(this Composition composition) - where T : IPublishedSnapshotService - { - composition.RegisterUnique(); - } - - /// - /// Sets the published snapshot service. - /// - /// The composition. - /// A function creating a published snapshot service. - public static void SetPublishedSnapshotService(this Composition composition, Func factory) - { - composition.RegisterUnique(factory); - } - - /// - /// Sets the published snapshot service. - /// - /// The composition. - /// A published snapshot service. - public static void SetPublishedSnapshotService(this Composition composition, IPublishedSnapshotService service) - { - composition.RegisterUnique(_ => service); - } - /// /// Sets the site domain helper. /// diff --git a/src/Umbraco.Web/Editors/NuCacheStatusController.cs b/src/Umbraco.Web/Editors/NuCacheStatusController.cs index 86dbdd4e01..0f50682e77 100644 --- a/src/Umbraco.Web/Editors/NuCacheStatusController.cs +++ b/src/Umbraco.Web/Editors/NuCacheStatusController.cs @@ -17,14 +17,16 @@ namespace Umbraco.Web.Editors _publishedSnapshotService = publishedSnapshotService ?? throw new ArgumentNullException(nameof(publishedSnapshotService)); } - private PublishedSnapshotService PublishedSnapshotService + private IPublishedSnapshotService PublishedSnapshotService { get { - var svc = _publishedSnapshotService as PublishedSnapshotService; - if (svc == null) - throw new NotSupportedException("Not running NuCache."); - return svc; + // TODO: do we need this? + //var svc = _publishedSnapshotService as PublishedSnapshotService; + //if (svc == null) + // throw new NotSupportedException("Not running NuCache."); + // return svc; + return _publishedSnapshotService; } } @@ -32,9 +34,7 @@ namespace Umbraco.Web.Editors public string RebuildDbCache() { var service = PublishedSnapshotService; - service.RebuildContentDbCache(); - service.RebuildMediaDbCache(); - service.RebuildMemberDbCache(); + service.Rebuild(); return service.GetStatus(); } diff --git a/src/Umbraco.Web/Editors/PublishedStatusController.cs b/src/Umbraco.Web/Editors/PublishedStatusController.cs index a6272108e9..9b408e177e 100644 --- a/src/Umbraco.Web/Editors/PublishedStatusController.cs +++ b/src/Umbraco.Web/Editors/PublishedStatusController.cs @@ -17,13 +17,13 @@ namespace Umbraco.Web.Editors [HttpGet] public string GetPublishedStatusUrl() { - //if (service is PublishedCache.PublishedNoCache.PublishedSnapshotService) - // return "views/dashboard/developer/nocache.html"; + return "views/dashboard/settings/nucache.html"; - if (_publishedSnapshotService is PublishedCache.NuCache.PublishedSnapshotService) - return "views/dashboard/settings/nucache.html"; + // TODO: do we need this check? + //if (_publishedSnapshotService is PublishedCache.NuCache.PublishedSnapshotService) + // return "views/dashboard/settings/nucache.html"; - throw new NotSupportedException("Not supported: " + _publishedSnapshotService.GetType().FullName); + //throw new NotSupportedException("Not supported: " + _publishedSnapshotService.GetType().FullName); } } } diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj index 5d0517a9f3..341b57ceff 100755 --- a/src/Umbraco.Web/Umbraco.Web.csproj +++ b/src/Umbraco.Web/Umbraco.Web.csproj @@ -114,6 +114,10 @@ Umbraco.Examine {07FBC26B-2927-4A22-8D96-D644C667FECC} + + {f6de8da0-07cc-4ef2-8a59-2bc81dbb3830} + Umbraco.Infrastructure.PublishedCache + {3ae7bf57-966b-45a5-910a-954d7c554441} Umbraco.Infrastructure @@ -212,10 +216,7 @@ - - - - + @@ -261,7 +262,6 @@ - @@ -363,48 +363,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -538,7 +497,6 @@ - @@ -641,7 +599,6 @@ - @@ -810,7 +767,6 @@ - diff --git a/src/umbraco.sln b/src/umbraco.sln index 0e060fb4d3..293cbf7dae 100644 --- a/src/umbraco.sln +++ b/src/umbraco.sln @@ -1,4 +1,5 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 + +Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.29209.152 MinimumVisualStudioVersion = 10.0.40219.1 @@ -100,18 +101,20 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "IssueTemplates", "IssueTemp ..\.github\ISSUE_TEMPLATE\5_Security_issue.md = ..\.github\ISSUE_TEMPLATE\5_Security_issue.md EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Umbraco.Abstractions", "Umbraco.Abstractions\Umbraco.Abstractions.csproj", "{29AA69D9-B597-4395-8D42-43B1263C240A}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Umbraco.Abstractions", "Umbraco.Abstractions\Umbraco.Abstractions.csproj", "{29AA69D9-B597-4395-8D42-43B1263C240A}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Umbraco.ModelsBuilder.Embedded", "Umbraco.ModelsBuilder.Embedded\Umbraco.ModelsBuilder.Embedded.csproj", "{52AC0BA8-A60E-4E36-897B-E8B97A54ED1C}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Umbraco.Infrastructure", "Umbraco.Infrastructure\Umbraco.Infrastructure.csproj", "{3AE7BF57-966B-45A5-910A-954D7C554441}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Umbraco.Infrastructure", "Umbraco.Infrastructure\Umbraco.Infrastructure.csproj", "{3AE7BF57-966B-45A5-910A-954D7C554441}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Umbraco.Configuration", "Umbraco.Configuration\Umbraco.Configuration.csproj", "{FBE7C065-DAC0-4025-A78B-63B24D3AB00B}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Umbraco.Configuration", "Umbraco.Configuration\Umbraco.Configuration.csproj", "{FBE7C065-DAC0-4025-A78B-63B24D3AB00B}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Umbraco.Infrastrucure.Persistance.SqlCe", "Umbraco.Infrastrucure.Persistance.SqlCe\Umbraco.Infrastrucure.Persistance.SqlCe.csproj", "{33085570-9BF2-4065-A9B0-A29D920D13BA}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Umbraco.Infrastrucure.Persistance.SqlCe", "Umbraco.Infrastrucure.Persistance.SqlCe\Umbraco.Infrastrucure.Persistance.SqlCe.csproj", "{33085570-9BF2-4065-A9B0-A29D920D13BA}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Umbraco.TestData", "Umbraco.TestData\Umbraco.TestData.csproj", "{FB5676ED-7A69-492C-B802-E7B24144C0FC}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Umbraco.Infrastructure.PublishedCache", "Umbraco.Infrastructure.PublishedCache\Umbraco.Infrastructure.PublishedCache.csproj", "{F6DE8DA0-07CC-4EF2-8A59-2BC81DBB3830}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -164,6 +167,10 @@ Global {FB5676ED-7A69-492C-B802-E7B24144C0FC}.Debug|Any CPU.Build.0 = Debug|Any CPU {FB5676ED-7A69-492C-B802-E7B24144C0FC}.Release|Any CPU.ActiveCfg = Release|Any CPU {FB5676ED-7A69-492C-B802-E7B24144C0FC}.Release|Any CPU.Build.0 = Release|Any CPU + {F6DE8DA0-07CC-4EF2-8A59-2BC81DBB3830}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F6DE8DA0-07CC-4EF2-8A59-2BC81DBB3830}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F6DE8DA0-07CC-4EF2-8A59-2BC81DBB3830}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F6DE8DA0-07CC-4EF2-8A59-2BC81DBB3830}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE