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:
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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; }
|
||||
|
||||
@@ -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()
|
||||
{ }
|
||||
}
|
||||
}
|
||||
|
||||
26
src/Umbraco.Web/PublishedCache/NuCache/NuCacheComposer.cs
Normal file
26
src/Umbraco.Web/PublishedCache/NuCache/NuCacheComposer.cs
Normal 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>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user