Merge remote-tracking branch 'origin/temp8' into feature/IContentType-removale-from-IContent

# Conflicts:
#	src/Umbraco.Core/ContentExtensions.cs
#	src/Umbraco.Core/Models/Content.cs
#	src/Umbraco.Tests/Models/ContentTests.cs
#	src/Umbraco.Tests/Models/Mapping/ContentWebModelMappingTests.cs
#	src/Umbraco.Tests/Models/VariationTests.cs
#	src/Umbraco.Tests/Scoping/ScopedNuCacheTests.cs
#	src/Umbraco.Tests/Services/ContentTypeServiceVariantsTests.cs
#	src/Umbraco.Tests/Web/Controllers/ContentControllerTests.cs
#	src/Umbraco.Web.UI/Umbraco/dialogs/ChangeDocType.aspx.cs
This commit is contained in:
Bjarke Berg
2019-01-11 08:29:29 +01:00
627 changed files with 10531 additions and 10745 deletions

View File

@@ -29,6 +29,11 @@ namespace Umbraco.Web.PublishedCache.NuCache
#region Constructor
// fixme ISSUE
// after the current snapshot has been resync-ed
// it's too late for UmbracoContext which has captured previewDefault and stuff into these ctor vars
// but, no, UmbracoContext returns snapshot.Content which comes from elements SO a resync should create a new cache
public ContentCache(bool previewDefault, ContentStore.Snapshot snapshot, ICacheProvider snapshotCache, ICacheProvider elementsCache, DomainHelper domainHelper, IGlobalSettings globalSettings, ILocalizationService localizationService)
: base(previewDefault)
{

View File

@@ -30,9 +30,12 @@ namespace Umbraco.Web.PublishedCache.NuCache.DataSource
PrimitiveSerializer.Int32.WriteTo(value.VersionId, stream);
PrimitiveSerializer.DateTime.WriteTo(value.VersionDate, stream);
PrimitiveSerializer.Int32.WriteTo(value.WriterId, stream);
PrimitiveSerializer.Int32.WriteTo(value.TemplateId, stream);
if (value.TemplateId.HasValue)
{
PrimitiveSerializer.Int32.WriteTo(value.TemplateId.Value, stream);
}
PropertiesSerializer.WriteTo(value.Properties, stream);
CultureVariationsSerializer.WriteTo(value.CultureInfos, stream);
}
}
}
}

View File

@@ -10,7 +10,7 @@ namespace Umbraco.Web.PublishedCache.NuCache.DataSource
public int VersionId { get; set; }
public DateTime VersionDate { get; set; }
public int WriterId { get; set; }
public int TemplateId { get; set; }
public int? TemplateId { get; set; }
public bool Published { get; set; }
public IDictionary<string, PropertyData[]> Properties { get; set; }

View File

@@ -1,30 +1,18 @@
using Umbraco.Core.Components;
using Umbraco.Web.PublishedCache.NuCache.DataSource;
namespace Umbraco.Web.PublishedCache.NuCache
{
public class NuCacheComponent : UmbracoComponentBase, IUmbracoCoreComponent
public sealed class NuCacheComponent : IComponent
{
public override void Compose(Composition composition)
{
base.Compose(composition);
// register the NuCache database data source
composition.Container.Register<IDataSource, DatabaseDataSource>();
// register the NuCache published snapshot service
// must register default options, required in the service ctor
composition.Container.Register(factory => new PublishedSnapshotService.Options());
composition.SetPublishedSnapshotService<PublishedSnapshotService>();
// add the NuCache health check (hidden from type finder)
// todo - no NuCache health check yet
//composition.HealthChecks().Add<NuCacheIntegrityHealthCheck>();
}
public void Initialize(IPublishedSnapshotService service)
public NuCacheComponent(IPublishedSnapshotService service)
{
// nothing - this just ensures that the service is created at boot time
}
public void Initialize()
{ }
public void Terminate()
{ }
}
}

View File

@@ -0,0 +1,26 @@
using Umbraco.Core.Components;
using Umbraco.Core.Composing;
using Umbraco.Web.PublishedCache.NuCache.DataSource;
namespace Umbraco.Web.PublishedCache.NuCache
{
public class NuCacheComposer : ComponentComposer<NuCacheComponent>, ICoreComposer
{
public override void Compose(Composition composition)
{
base.Compose(composition);
// register the NuCache database data source
composition.Register<IDataSource, DatabaseDataSource>();
// register the NuCache published snapshot service
// must register default options, required in the service ctor
composition.Register(factory => new PublishedSnapshotService.Options());
composition.SetPublishedSnapshotService<PublishedSnapshotService>();
// add the NuCache health check (hidden from type finder)
// todo - no NuCache health check yet
//composition.HealthChecks().Add<NuCacheIntegrityHealthCheck>();
}
}
}

View File

@@ -215,7 +215,7 @@ namespace Umbraco.Web.PublishedCache.NuCache
public override string Path => _contentNode.Path;
/// <inheritdoc />
public override int TemplateId => _contentData.TemplateId;
public override int? TemplateId => _contentData.TemplateId;
/// <inheritdoc />
public override int CreatorId => _contentNode.CreatorId;

View File

@@ -80,7 +80,7 @@ namespace Umbraco.Web.PublishedCache.NuCache
//private static int _singletonCheck;
public PublishedSnapshotService(Options options, MainDom mainDom, IRuntimeState runtime,
public PublishedSnapshotService(Options options, IMainDom mainDom, IRuntimeState runtime,
ServiceContext serviceContext, IPublishedContentTypeFactory publishedContentTypeFactory, IdkMap idkMap,
IPublishedSnapshotAccessor publishedSnapshotAccessor, IVariationContextAccessor variationContextAccessor,
ILogger logger, IScopeProvider scopeProvider,