Renamed the project to Umbraco.PublishedCache.NuCache - and move non NuCache related stuff to abstractions and infrastructure.

This commit is contained in:
Bjarke Berg
2020-02-06 14:40:46 +01:00
parent 0bc843b06d
commit d147b182ee
50 changed files with 28 additions and 27 deletions

View File

@@ -8,7 +8,7 @@ using Umbraco.Core.Xml;
namespace Umbraco.Web.PublishedCache
{
abstract class PublishedCacheBase : IPublishedCache
public abstract class PublishedCacheBase : IPublishedCache
{
private readonly IVariationContextAccessor _variationContextAccessor;

View File

@@ -5,7 +5,7 @@ using Umbraco.Web.Cache;
namespace Umbraco.Web.PublishedCache
{
abstract class PublishedSnapshotServiceBase : IPublishedSnapshotService
public abstract class PublishedSnapshotServiceBase : IPublishedSnapshotService
{
protected PublishedSnapshotServiceBase(IPublishedSnapshotAccessor publishedSnapshotAccessor, IVariationContextAccessor variationContextAccessor)
{

View File

@@ -25,7 +25,7 @@ namespace Umbraco.Web.PublishedCache
private readonly ReaderWriterLockSlim _lock = new ReaderWriterLockSlim();
// default ctor
internal PublishedContentTypeCache(IContentTypeService contentTypeService, IMediaTypeService mediaTypeService, IMemberTypeService memberTypeService, IPublishedContentTypeFactory publishedContentTypeFactory, ILogger logger)
public PublishedContentTypeCache(IContentTypeService contentTypeService, IMediaTypeService mediaTypeService, IMemberTypeService memberTypeService, IPublishedContentTypeFactory publishedContentTypeFactory, ILogger logger)
{
_contentTypeService = contentTypeService;
_mediaTypeService = mediaTypeService;

View File

@@ -8,7 +8,7 @@ namespace Umbraco.Web.PublishedCache.NuCache
// represents a content "node" ie a pair of draft + published versions
// internal, never exposed, to be accessed from ContentStore (only!)
[DebuggerDisplay("Id: {Id}, Path: {Path}")]
internal class ContentNode
public class ContentNode
{
// special ctor for root pseudo node
public ContentNode()
@@ -113,7 +113,7 @@ namespace Umbraco.Web.PublishedCache.NuCache
// everything that is common to both draft and published versions
// keep this as small as possible
public readonly int Id;
public readonly Guid Uid;
public IPublishedContentType ContentType;

View File

@@ -4,7 +4,7 @@ using Umbraco.Web.PublishedCache.NuCache.DataSource;
namespace Umbraco.Web.PublishedCache.NuCache
{
// what's needed to actually build a content node
internal struct ContentNodeKit
public struct ContentNodeKit
{
public ContentNode Node;
public int ContentTypeId;

View File

@@ -26,7 +26,7 @@ namespace Umbraco.Web.PublishedCache.NuCache
/// This class's logic is based on the <see cref="SnapDictionary{TKey, TValue}"/> class but has been slightly modified to suit these purposes.
/// </para>
/// </remarks>
internal class ContentStore
public class ContentStore
{
// this class is an extended version of SnapDictionary
// most of the snapshots management code, etc is an exact copy

View File

@@ -4,7 +4,7 @@ using System.Collections.Generic;
namespace Umbraco.Web.PublishedCache.NuCache.DataSource
{
// represents everything that is specific to edited or published version
internal class ContentData
public class ContentData
{
public string Name { get; set; }
public string UrlSegment { get; set; }

View File

@@ -6,7 +6,7 @@ namespace Umbraco.Web.PublishedCache.NuCache.DataSource
/// <summary>
/// Represents the culture variation information on a content item
/// </summary>
internal class CultureVariation
public class CultureVariation
{
[JsonProperty("name")]
public string Name { get; set; }

View File

@@ -3,7 +3,7 @@ using Newtonsoft.Json;
namespace Umbraco.Web.PublishedCache.NuCache.DataSource
{
internal class PropertyData
public class PropertyData
{
private string _culture;
private string _segment;

View File

@@ -11,7 +11,7 @@ using Umbraco.Web.PublishedCache.NuCache.Navigable;
namespace Umbraco.Web.PublishedCache.NuCache
{
internal class MediaCache : PublishedCacheBase, IPublishedMediaCache, INavigableData, IDisposable
public class MediaCache : PublishedCacheBase, IPublishedMediaCache, INavigableData, IDisposable
{
private readonly ContentStore.Snapshot _snapshot;
private readonly IVariationContextAccessor _variationContextAccessor;

View File

@@ -2,6 +2,7 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<RootNamespace>Umbraco.Infrastructure.PublishedCache</RootNamespace>
</PropertyGroup>
<ItemGroup>

View File

@@ -5,7 +5,6 @@ using Moq;
using NUnit.Framework;
using Umbraco.Core.Scoping;
using Umbraco.Web.PublishedCache.NuCache;
using Umbraco.Web.PublishedCache.NuCache.Snap;
namespace Umbraco.Tests.Cache
{
@@ -223,7 +222,7 @@ namespace Umbraco.Tests.Cache
{
var d = new SnapDictionary<int, string>();
d.Test.CollectAuto = false;
// gen 1
d.Set(1, "one");
Assert.AreEqual(1, d.Test.GetValues(1).Length);
@@ -321,7 +320,7 @@ namespace Umbraco.Tests.Cache
{
var d = new SnapDictionary<int, string>();
d.Test.CollectAuto = false;
Assert.AreEqual(0, d.Test.GetValues(1).Length);
// gen 1
@@ -416,7 +415,7 @@ namespace Umbraco.Tests.Cache
{
var d = new SnapDictionary<int, string>();
d.Test.CollectAuto = false;
// gen 1
d.Set(1, "one");
Assert.AreEqual(1, d.Test.GetValues(1).Length);
@@ -578,7 +577,7 @@ namespace Umbraco.Tests.Cache
{
var d = new SnapDictionary<int, string>();
d.Test.CollectAuto = false;
d.Set(1, "one");
d.Set(2, "two");
@@ -875,7 +874,7 @@ namespace Umbraco.Tests.Cache
{
var d = new SnapDictionary<int, string>();
d.Test.CollectAuto = false;
// gen 1
d.Set(1, "one");
@@ -960,7 +959,7 @@ namespace Umbraco.Tests.Cache
var d = new SnapDictionary<int, string>();
var t = d.Test;
t.CollectAuto = false;
// gen 1
d.Set(1, "one");
var s1 = d.CreateSnapshot();

View File

@@ -564,9 +564,6 @@
<Project>{fbe7c065-dac0-4025-a78b-63b24d3ab00b}</Project>
<Name>Umbraco.Configuration</Name>
</ProjectReference>
<ProjectReference Include="..\Umbraco.Infrastructure.PublishedCache\Umbraco.Infrastructure.PublishedCache.csproj">
<Project>{f6de8da0-07cc-4ef2-8a59-2bc81dbb3830}</Project>
<Name>Umbraco.Infrastructure.PublishedCache</Name>
<ProjectReference Include="..\Umbraco.Examine.Lucene\Umbraco.Examine.Lucene.csproj">
<Project>{0fad7d2a-d7dd-45b1-91fd-488bb6cdacea}</Project>
<Name>Umbraco.Examine.Lucene</Name>
@@ -587,6 +584,10 @@
<Project>{33085570-9bf2-4065-a9b0-a29d920d13ba}</Project>
<Name>Umbraco.Persistance.SqlCe</Name>
</ProjectReference>
<ProjectReference Include="..\Umbraco.PublishedCache.NuCache\Umbraco.PublishedCache.NuCache.csproj">
<Project>{f6de8da0-07cc-4ef2-8a59-2bc81dbb3830}</Project>
<Name>Umbraco.PublishedCache.NuCache</Name>
</ProjectReference>
<ProjectReference Include="..\Umbraco.Web\Umbraco.Web.csproj">
<Project>{651E1350-91B6-44B7-BD60-7207006D7003}</Project>
<Name>Umbraco.Web</Name>
@@ -655,4 +656,4 @@
<Message Text="NuGetPackageFolders: $(NuGetPackageFolders)" Importance="high" />
<Message Text="NuGetPackages: $(NuGetPackages)" Importance="high" />
</Target>
</Project>
</Project>

View File

@@ -120,14 +120,14 @@
<Project>{0fad7d2a-d7dd-45b1-91fd-488bb6cdacea}</Project>
<Name>Umbraco.Examine.Lucene</Name>
</ProjectReference>
<ProjectReference Include="..\Umbraco.Infrastructure.PublishedCache\Umbraco.Infrastructure.PublishedCache.csproj">
<Project>{f6de8da0-07cc-4ef2-8a59-2bc81dbb3830}</Project>
<Name>Umbraco.Infrastructure.PublishedCache</Name>
</ProjectReference>
<ProjectReference Include="..\Umbraco.ModelsBuilder.Embedded\Umbraco.ModelsBuilder.Embedded.csproj">
<Project>{52ac0ba8-a60e-4e36-897b-e8b97a54ed1c}</Project>
<Name>Umbraco.ModelsBuilder.Embedded</Name>
</ProjectReference>
<ProjectReference Include="..\Umbraco.PublishedCache.NuCache\Umbraco.PublishedCache.NuCache.csproj">
<Project>{f6de8da0-07cc-4ef2-8a59-2bc81dbb3830}</Project>
<Name>Umbraco.PublishedCache.NuCache</Name>
</ProjectReference>
<ProjectReference Include="..\Umbraco.Web\Umbraco.Web.csproj">
<Project>{651e1350-91b6-44b7-bd60-7207006d7003}</Project>
<Name>Umbraco.Web</Name>

View File

@@ -111,7 +111,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Umbraco.Persistance.SqlCe",
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}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Umbraco.PublishedCache.NuCache", "Umbraco.PublishedCache.NuCache\Umbraco.PublishedCache.NuCache.csproj", "{F6DE8DA0-07CC-4EF2-8A59-2BC81DBB3830}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Umbraco.Examine", "Umbraco.Examine\Umbraco.Examine.csproj", "{F9B7FE05-0F93-4D0D-9C10-690B33ECBBD8}"
EndProject