Merge branch temp8 into feature/IContentType-removale-from-IContent

This commit is contained in:
Stephan
2019-01-17 13:33:55 +01:00
264 changed files with 6879 additions and 10999 deletions

View File

@@ -8,30 +8,29 @@ using Umbraco.Core.Models;
using Umbraco.Core.Models.PublishedContent;
using Umbraco.Core.Security;
using Umbraco.Core.Services;
using Umbraco.Core.Services.Implement;
using Umbraco.Core.Xml.XPath;
using Umbraco.Web.PublishedCache.NuCache.Navigable;
namespace Umbraco.Web.PublishedCache.NuCache
{
class MemberCache : IPublishedMemberCache, INavigableData
internal class MemberCache : IPublishedMemberCache, INavigableData
{
private readonly IPublishedSnapshotAccessor _publishedSnapshotAccessor;
public readonly IVariationContextAccessor VariationContextAccessor;
private readonly IEntityXmlSerializer _entitySerializer;
private readonly ICacheProvider _snapshotCache;
private readonly IMemberService _memberService;
private readonly IDataTypeService _dataTypeService;
private readonly ILocalizationService _localizationService;
private readonly PublishedContentTypeCache _contentTypeCache;
private readonly bool _previewDefault;
public MemberCache(bool previewDefault, ICacheProvider snapshotCache, IMemberService memberService, IDataTypeService dataTypeService, ILocalizationService localizationService, PublishedContentTypeCache contentTypeCache, IPublishedSnapshotAccessor publishedSnapshotAccessor, IVariationContextAccessor variationContextAccessor)
public MemberCache(bool previewDefault, ICacheProvider snapshotCache, IMemberService memberService, PublishedContentTypeCache contentTypeCache, IPublishedSnapshotAccessor publishedSnapshotAccessor, IVariationContextAccessor variationContextAccessor, IEntityXmlSerializer entitySerializer)
{
_snapshotCache = snapshotCache;
_publishedSnapshotAccessor = publishedSnapshotAccessor;
VariationContextAccessor = variationContextAccessor;
_entitySerializer = entitySerializer;
_memberService = memberService;
_dataTypeService = dataTypeService;
_localizationService = localizationService;
_previewDefault = previewDefault;
_contentTypeCache = contentTypeCache;
}
@@ -141,7 +140,7 @@ namespace Umbraco.Web.PublishedCache.NuCache
var result = _memberService.GetById(id);
if (result == null) return null;
var s = EntityXmlSerializer.Serialize(_dataTypeService, _localizationService, result);
var s = _entitySerializer.Serialize(result);
var n = s.GetXmlNode();
return n.CreateNavigator();
}

View File

@@ -41,6 +41,7 @@ namespace Umbraco.Web.PublishedCache.NuCache
private readonly IGlobalSettings _globalSettings;
private readonly ISiteDomainHelper _siteDomainHelper;
private readonly IContentTypeService _contentTypeService;
private readonly IEntityXmlSerializer _entitySerializer;
private readonly IDefaultCultureAccessor _defaultCultureAccessor;
// volatile because we read it with no lock
@@ -83,7 +84,8 @@ namespace Umbraco.Web.PublishedCache.NuCache
ILogger logger, IScopeProvider scopeProvider,
IDocumentRepository documentRepository, IMediaRepository mediaRepository, IMemberRepository memberRepository,
IDefaultCultureAccessor defaultCultureAccessor,
IDataSource dataSource, IGlobalSettings globalSettings, ISiteDomainHelper siteDomainHelper, IContentTypeService contentTypeService)
IDataSource dataSource, IGlobalSettings globalSettings, ISiteDomainHelper siteDomainHelper, IContentTypeService contentTypeService,
IEntityXmlSerializer entitySerializer)
: base(publishedSnapshotAccessor, variationContextAccessor)
{
//if (Interlocked.Increment(ref _singletonCheck) > 1)
@@ -102,6 +104,10 @@ namespace Umbraco.Web.PublishedCache.NuCache
_siteDomainHelper = siteDomainHelper;
_contentTypeService = contentTypeService;
// we need an Xml serializer here so that the member cache can support XPath,
// for members this is done by navigating the serialized-to-xml member
_entitySerializer = entitySerializer;
// we always want to handle repository events, configured or not
// assuming no repository event will trigger before the whole db is ready
// (ideally we'd have Upgrading.App vs Upgrading.Data application states...)
@@ -1010,7 +1016,7 @@ namespace Umbraco.Web.PublishedCache.NuCache
{
ContentCache = new ContentCache(previewDefault, contentSnap, snapshotCache, elementsCache, domainHelper, _globalSettings, _serviceContext.LocalizationService),
MediaCache = new MediaCache(previewDefault, mediaSnap, snapshotCache, elementsCache),
MemberCache = new MemberCache(previewDefault, snapshotCache, _serviceContext.MemberService, _serviceContext.DataTypeService, _serviceContext.LocalizationService, memberTypeCache, PublishedSnapshotAccessor, VariationContextAccessor),
MemberCache = new MemberCache(previewDefault, snapshotCache, _serviceContext.MemberService, memberTypeCache, PublishedSnapshotAccessor, VariationContextAccessor, _entitySerializer),
DomainCache = domainCache,
SnapshotCache = snapshotCache,
ElementsCache = elementsCache