Merge branch temp8 into feature/IContentType-removale-from-IContent
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -17,6 +17,7 @@ using Umbraco.Core.Xml;
|
||||
using Umbraco.Examine;
|
||||
using Umbraco.Core.Cache;
|
||||
using Umbraco.Core.Services;
|
||||
using Umbraco.Core.Services.Implement;
|
||||
using Umbraco.Web.Composing;
|
||||
|
||||
namespace Umbraco.Web.PublishedCache.XmlPublishedCache
|
||||
@@ -37,14 +38,14 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
|
||||
// method GetExamineManagerSafe().
|
||||
//
|
||||
private readonly ISearcher _searchProvider;
|
||||
private readonly IIndex _indexProvider;
|
||||
private readonly XmlStore _xmlStore;
|
||||
private readonly PublishedContentTypeCache _contentTypeCache;
|
||||
private readonly IEntityXmlSerializer _entitySerializer;
|
||||
|
||||
// must be specified by the ctor
|
||||
private readonly ICacheProvider _cacheProvider;
|
||||
|
||||
public PublishedMediaCache(XmlStore xmlStore, IMediaService mediaService, IUserService userService, ICacheProvider cacheProvider, PublishedContentTypeCache contentTypeCache)
|
||||
public PublishedMediaCache(XmlStore xmlStore, IMediaService mediaService, IUserService userService, ICacheProvider cacheProvider, PublishedContentTypeCache contentTypeCache, IEntityXmlSerializer entitySerializer)
|
||||
: base(false)
|
||||
{
|
||||
_mediaService = mediaService ?? throw new ArgumentNullException(nameof(mediaService));
|
||||
@@ -53,6 +54,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
|
||||
_cacheProvider = cacheProvider;
|
||||
_xmlStore = xmlStore;
|
||||
_contentTypeCache = contentTypeCache;
|
||||
_entitySerializer = entitySerializer;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -61,18 +63,18 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
|
||||
/// <param name="mediaService"></param>
|
||||
/// <param name="userService"></param>
|
||||
/// <param name="searchProvider"></param>
|
||||
/// <param name="indexProvider"></param>
|
||||
/// <param name="cacheProvider"></param>
|
||||
/// <param name="contentTypeCache"></param>
|
||||
internal PublishedMediaCache(IMediaService mediaService, IUserService userService, ISearcher searchProvider, BaseIndexProvider indexProvider, ICacheProvider cacheProvider, PublishedContentTypeCache contentTypeCache)
|
||||
/// <param name="entitySerializer"></param>
|
||||
internal PublishedMediaCache(IMediaService mediaService, IUserService userService, ISearcher searchProvider, ICacheProvider cacheProvider, PublishedContentTypeCache contentTypeCache, IEntityXmlSerializer entitySerializer)
|
||||
: base(false)
|
||||
{
|
||||
_mediaService = mediaService ?? throw new ArgumentNullException(nameof(mediaService));
|
||||
_userService = userService ?? throw new ArgumentNullException(nameof(userService));
|
||||
_searchProvider = searchProvider ?? throw new ArgumentNullException(nameof(searchProvider));
|
||||
_indexProvider = indexProvider ?? throw new ArgumentNullException(nameof(indexProvider));
|
||||
_cacheProvider = cacheProvider;
|
||||
_contentTypeCache = contentTypeCache;
|
||||
_entitySerializer = entitySerializer;
|
||||
}
|
||||
|
||||
static PublishedMediaCache()
|
||||
@@ -553,14 +555,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
|
||||
return Enumerable.Empty<IPublishedContent>();
|
||||
}
|
||||
|
||||
var serialized = EntityXmlSerializer.Serialize(
|
||||
Current.Services.MediaService,
|
||||
Current.Services.DataTypeService,
|
||||
Current.Services.UserService,
|
||||
Current.Services.LocalizationService,
|
||||
Current.UrlSegmentProviders,
|
||||
media,
|
||||
true);
|
||||
var serialized = _entitySerializer.Serialize(media, true);
|
||||
|
||||
var mediaIterator = serialized.CreateNavigator().Select("/");
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
|
||||
private readonly IGlobalSettings _globalSettings;
|
||||
private readonly IDefaultCultureAccessor _defaultCultureAccessor;
|
||||
private readonly ISiteDomainHelper _siteDomainHelper;
|
||||
private readonly IEntityXmlSerializer _entitySerializer;
|
||||
|
||||
#region Constructors
|
||||
|
||||
@@ -42,20 +43,20 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
|
||||
IPublishedContentTypeFactory publishedContentTypeFactory,
|
||||
IScopeProvider scopeProvider,
|
||||
ICacheProvider requestCache,
|
||||
IEnumerable<IUrlSegmentProvider> segmentProviders,
|
||||
IPublishedSnapshotAccessor publishedSnapshotAccessor, IVariationContextAccessor variationContextAccessor,
|
||||
IDocumentRepository documentRepository, IMediaRepository mediaRepository, IMemberRepository memberRepository,
|
||||
IDefaultCultureAccessor defaultCultureAccessor,
|
||||
ILogger logger,
|
||||
IGlobalSettings globalSettings,
|
||||
ISiteDomainHelper siteDomainHelper,
|
||||
IEntityXmlSerializer entitySerializer,
|
||||
MainDom mainDom,
|
||||
bool testing = false, bool enableRepositoryEvents = true)
|
||||
: this(serviceContext, publishedContentTypeFactory, scopeProvider, requestCache, segmentProviders,
|
||||
: this(serviceContext, publishedContentTypeFactory, scopeProvider, requestCache,
|
||||
publishedSnapshotAccessor, variationContextAccessor,
|
||||
documentRepository, mediaRepository, memberRepository,
|
||||
defaultCultureAccessor,
|
||||
logger, globalSettings, siteDomainHelper, null, mainDom, testing, enableRepositoryEvents)
|
||||
logger, globalSettings, siteDomainHelper, entitySerializer, null, mainDom, testing, enableRepositoryEvents)
|
||||
{ }
|
||||
|
||||
// used in some tests
|
||||
@@ -69,27 +70,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
|
||||
ILogger logger,
|
||||
IGlobalSettings globalSettings,
|
||||
ISiteDomainHelper siteDomainHelper,
|
||||
PublishedContentTypeCache contentTypeCache,
|
||||
MainDom mainDom,
|
||||
bool testing, bool enableRepositoryEvents)
|
||||
: this(serviceContext, publishedContentTypeFactory, scopeProvider, requestCache, Enumerable.Empty<IUrlSegmentProvider>(),
|
||||
publishedSnapshotAccessor, variationContextAccessor,
|
||||
documentRepository, mediaRepository, memberRepository,
|
||||
defaultCultureAccessor,
|
||||
logger, globalSettings, siteDomainHelper, contentTypeCache, mainDom, testing, enableRepositoryEvents)
|
||||
{ }
|
||||
|
||||
private PublishedSnapshotService(ServiceContext serviceContext,
|
||||
IPublishedContentTypeFactory publishedContentTypeFactory,
|
||||
IScopeProvider scopeProvider,
|
||||
ICacheProvider requestCache,
|
||||
IEnumerable<IUrlSegmentProvider> segmentProviders,
|
||||
IPublishedSnapshotAccessor publishedSnapshotAccessor, IVariationContextAccessor variationContextAccessor,
|
||||
IDocumentRepository documentRepository, IMediaRepository mediaRepository, IMemberRepository memberRepository,
|
||||
IDefaultCultureAccessor defaultCultureAccessor,
|
||||
ILogger logger,
|
||||
IGlobalSettings globalSettings,
|
||||
ISiteDomainHelper siteDomainHelper,
|
||||
IEntityXmlSerializer entitySerializer,
|
||||
PublishedContentTypeCache contentTypeCache,
|
||||
MainDom mainDom,
|
||||
bool testing, bool enableRepositoryEvents)
|
||||
@@ -100,9 +81,9 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
|
||||
_contentTypeCache = contentTypeCache
|
||||
?? new PublishedContentTypeCache(serviceContext.ContentTypeService, serviceContext.MediaTypeService, serviceContext.MemberTypeService, publishedContentTypeFactory, logger);
|
||||
|
||||
_xmlStore = new XmlStore(serviceContext, scopeProvider, _routesCache,
|
||||
_contentTypeCache, segmentProviders, publishedSnapshotAccessor, mainDom, testing, enableRepositoryEvents,
|
||||
documentRepository, mediaRepository, memberRepository, globalSettings);
|
||||
_xmlStore = new XmlStore(serviceContext.ContentTypeService, serviceContext.ContentService, scopeProvider, _routesCache,
|
||||
_contentTypeCache, publishedSnapshotAccessor, mainDom, testing, enableRepositoryEvents,
|
||||
documentRepository, mediaRepository, memberRepository, globalSettings, entitySerializer);
|
||||
|
||||
_domainService = serviceContext.DomainService;
|
||||
_memberService = serviceContext.MemberService;
|
||||
@@ -113,6 +94,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
|
||||
_requestCache = requestCache;
|
||||
_globalSettings = globalSettings;
|
||||
_siteDomainHelper = siteDomainHelper;
|
||||
_entitySerializer = entitySerializer;
|
||||
}
|
||||
|
||||
public override void Dispose()
|
||||
@@ -157,7 +139,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
|
||||
|
||||
return new PublishedSnapshot(
|
||||
new PublishedContentCache(_xmlStore, domainCache, _requestCache, _globalSettings, _siteDomainHelper, _contentTypeCache, _routesCache, previewToken),
|
||||
new PublishedMediaCache(_xmlStore, _mediaService, _userService, _requestCache, _contentTypeCache),
|
||||
new PublishedMediaCache(_xmlStore, _mediaService, _userService, _requestCache, _contentTypeCache, _entitySerializer),
|
||||
new PublishedMemberCache(_xmlStore, _requestCache, _memberService, _contentTypeCache),
|
||||
domainCache);
|
||||
}
|
||||
|
||||
@@ -44,15 +44,16 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
|
||||
private readonly IMediaRepository _mediaRepository;
|
||||
private readonly IMemberRepository _memberRepository;
|
||||
private readonly IGlobalSettings _globalSettings;
|
||||
private readonly IEntityXmlSerializer _entitySerializer;
|
||||
private XmlStoreFilePersister _persisterTask;
|
||||
private volatile bool _released;
|
||||
private bool _withRepositoryEvents;
|
||||
|
||||
private readonly IPublishedSnapshotAccessor _publishedSnapshotAccessor;
|
||||
private readonly PublishedContentTypeCache _contentTypeCache;
|
||||
private readonly IEnumerable<IUrlSegmentProvider> _segmentProviders;
|
||||
private readonly RoutesCache _routesCache;
|
||||
private readonly ServiceContext _serviceContext; // fixme WHY
|
||||
private readonly IContentTypeService _contentTypeService;
|
||||
private readonly IContentService _contentService;
|
||||
private readonly IScopeProvider _scopeProvider;
|
||||
|
||||
#region Constructors
|
||||
@@ -61,22 +62,23 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
|
||||
/// Initializes a new instance of the <see cref="XmlStore"/> class.
|
||||
/// </summary>
|
||||
/// <remarks>The default constructor will boot the cache, load data from file or database, /// wire events in order to manage changes, etc.</remarks>
|
||||
public XmlStore(ServiceContext serviceContext, IScopeProvider scopeProvider, RoutesCache routesCache, PublishedContentTypeCache contentTypeCache,
|
||||
IEnumerable<IUrlSegmentProvider> segmentProviders, IPublishedSnapshotAccessor publishedSnapshotAccessor, MainDom mainDom, IDocumentRepository documentRepository, IMediaRepository mediaRepository, IMemberRepository memberRepository, IGlobalSettings globalSettings)
|
||||
: this(serviceContext, scopeProvider, routesCache, contentTypeCache, segmentProviders, publishedSnapshotAccessor, mainDom, false, false, documentRepository, mediaRepository, memberRepository, globalSettings)
|
||||
public XmlStore(IContentTypeService contentTypeService, IContentService contentService, IScopeProvider scopeProvider, RoutesCache routesCache, PublishedContentTypeCache contentTypeCache,
|
||||
IPublishedSnapshotAccessor publishedSnapshotAccessor, MainDom mainDom, IDocumentRepository documentRepository, IMediaRepository mediaRepository, IMemberRepository memberRepository, IGlobalSettings globalSettings, IEntityXmlSerializer entitySerializer)
|
||||
: this(contentTypeService, contentService, scopeProvider, routesCache, contentTypeCache, publishedSnapshotAccessor, mainDom, false, false, documentRepository, mediaRepository, memberRepository, globalSettings, entitySerializer)
|
||||
{ }
|
||||
|
||||
// internal for unit tests
|
||||
// no file nor db, no config check
|
||||
// fixme - er, we DO have a DB?
|
||||
internal XmlStore(ServiceContext serviceContext, IScopeProvider scopeProvider, RoutesCache routesCache, PublishedContentTypeCache contentTypeCache,
|
||||
IEnumerable<IUrlSegmentProvider> segmentProviders, IPublishedSnapshotAccessor publishedSnapshotAccessor, MainDom mainDom,
|
||||
bool testing, bool enableRepositoryEvents, IDocumentRepository documentRepository, IMediaRepository mediaRepository, IMemberRepository memberRepository, IGlobalSettings globalSettings)
|
||||
internal XmlStore(IContentTypeService contentTypeService, IContentService contentService, IScopeProvider scopeProvider, RoutesCache routesCache, PublishedContentTypeCache contentTypeCache,
|
||||
IPublishedSnapshotAccessor publishedSnapshotAccessor, MainDom mainDom,
|
||||
bool testing, bool enableRepositoryEvents, IDocumentRepository documentRepository, IMediaRepository mediaRepository, IMemberRepository memberRepository, IGlobalSettings globalSettings, IEntityXmlSerializer entitySerializer)
|
||||
{
|
||||
if (testing == false)
|
||||
EnsureConfigurationIsValid();
|
||||
|
||||
_serviceContext = serviceContext;
|
||||
_contentTypeService = contentTypeService;
|
||||
_contentService = contentService;
|
||||
_scopeProvider = scopeProvider;
|
||||
_routesCache = routesCache;
|
||||
_contentTypeCache = contentTypeCache;
|
||||
@@ -85,8 +87,8 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
|
||||
_mediaRepository = mediaRepository;
|
||||
_memberRepository = memberRepository;
|
||||
_globalSettings = globalSettings;
|
||||
_entitySerializer = entitySerializer;
|
||||
_xmlFileName = IOHelper.MapPath(SystemFiles.GetContentCacheXml(_globalSettings));
|
||||
_segmentProviders = segmentProviders;
|
||||
|
||||
if (testing)
|
||||
{
|
||||
@@ -399,7 +401,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
|
||||
try
|
||||
{
|
||||
var dtdInner = new StringBuilder();
|
||||
var contentTypes = _serviceContext.ContentTypeService.GetAll();
|
||||
var contentTypes = _contentTypeService.GetAll();
|
||||
// though aliases should be safe and non null already?
|
||||
var aliases = contentTypes.Select(x => x.Alias.ToSafeAlias()).WhereNotNull();
|
||||
foreach (var alias in aliases)
|
||||
@@ -556,7 +558,7 @@ AND (umbracoNode.id=@id)";
|
||||
|
||||
public XmlDocument GetPreviewXml(int contentId, bool includeSubs)
|
||||
{
|
||||
var content = _serviceContext.ContentService.GetById(contentId);
|
||||
var content = _contentService.GetById(contentId);
|
||||
|
||||
var doc = (XmlDocument)Xml.Clone();
|
||||
if (content == null) return doc;
|
||||
@@ -1065,7 +1067,7 @@ ORDER BY umbracoNode.level, umbracoNode.sortOrder";
|
||||
continue;
|
||||
}
|
||||
|
||||
var content = _serviceContext.ContentService.GetById(payload.Id);
|
||||
var content = _contentService.GetById(payload.Id);
|
||||
var current = safeXml.Xml.GetElementById(payload.Id.ToInvariantString());
|
||||
|
||||
if (content == null || content.Published == false || content.Trashed)
|
||||
@@ -1536,7 +1538,7 @@ ORDER BY umbracoNode.level, umbracoNode.sortOrder";
|
||||
var entity = args.Entity;
|
||||
|
||||
// serialize edit values for preview
|
||||
var editXml = EntityXmlSerializer.Serialize(_serviceContext.ContentService, _serviceContext.DataTypeService, _serviceContext.UserService, _serviceContext.LocalizationService, _segmentProviders, entity, false).ToDataString();
|
||||
var editXml = _entitySerializer.Serialize(entity, false).ToDataString();
|
||||
|
||||
// change below to write only one row - not one per version
|
||||
var dto1 = new PreviewXmlDto
|
||||
@@ -1565,7 +1567,7 @@ ORDER BY umbracoNode.level, umbracoNode.sortOrder";
|
||||
return;
|
||||
|
||||
// serialize published values for content cache
|
||||
var publishedXml = EntityXmlSerializer.Serialize(_serviceContext.ContentService, _serviceContext.DataTypeService, _serviceContext.UserService, _serviceContext.LocalizationService, _segmentProviders, entity, true).ToDataString();
|
||||
var publishedXml = _entitySerializer.Serialize(entity, true).ToDataString();
|
||||
var dto2 = new ContentXmlDto { NodeId = entity.Id, Xml = publishedXml };
|
||||
OnRepositoryRefreshed(db, dto2);
|
||||
|
||||
@@ -1581,7 +1583,7 @@ ORDER BY umbracoNode.level, umbracoNode.sortOrder";
|
||||
if (entity.Trashed)
|
||||
db.Execute("DELETE FROM cmsContentXml WHERE nodeId=@id", new { id = entity.Id });
|
||||
|
||||
var xml = EntityXmlSerializer.Serialize(_serviceContext.MediaService, _serviceContext.DataTypeService, _serviceContext.UserService, _serviceContext.LocalizationService, _segmentProviders, entity).ToDataString();
|
||||
var xml = _entitySerializer.Serialize(entity).ToDataString();
|
||||
|
||||
var dto1 = new ContentXmlDto { NodeId = entity.Id, Xml = xml };
|
||||
OnRepositoryRefreshed(db, dto1);
|
||||
@@ -1592,7 +1594,7 @@ ORDER BY umbracoNode.level, umbracoNode.sortOrder";
|
||||
var db = args.Scope.Database;
|
||||
var entity = args.Entity;
|
||||
|
||||
var xml = EntityXmlSerializer.Serialize(_serviceContext.DataTypeService, _serviceContext.LocalizationService, entity).ToDataString();
|
||||
var xml = _entitySerializer.Serialize(entity).ToDataString();
|
||||
|
||||
var dto1 = new ContentXmlDto { NodeId = entity.Id, Xml = xml };
|
||||
OnRepositoryRefreshed(db, dto1);
|
||||
@@ -1749,7 +1751,7 @@ WHERE cmsContentXml.nodeId IN (
|
||||
var descendants = _documentRepository.GetPage(query, pageIndex++, groupSize, out total, null, Ordering.By("Path"));
|
||||
const bool published = true; // contentXml contains published content!
|
||||
var items = descendants.Select(c => new ContentXmlDto { NodeId = c.Id, Xml =
|
||||
EntityXmlSerializer.Serialize(_serviceContext.ContentService, _serviceContext.DataTypeService, _serviceContext.UserService, _serviceContext.LocalizationService, _segmentProviders, c, published).ToDataString() }).ToArray();
|
||||
_entitySerializer.Serialize(c, published).ToDataString() }).ToArray();
|
||||
db.BulkInsertRecords(items);
|
||||
processed += items.Length;
|
||||
} while (processed < total);
|
||||
@@ -1824,7 +1826,7 @@ WHERE cmsPreviewXml.nodeId IN (
|
||||
var items = descendants.Select(c => new PreviewXmlDto
|
||||
{
|
||||
NodeId = c.Id,
|
||||
Xml = EntityXmlSerializer.Serialize(_serviceContext.ContentService, _serviceContext.DataTypeService, _serviceContext.UserService, _serviceContext.LocalizationService, _segmentProviders, c, published).ToDataString()
|
||||
Xml = _entitySerializer.Serialize(c, published).ToDataString()
|
||||
}).ToArray();
|
||||
db.BulkInsertRecords(items);
|
||||
processed += items.Length;
|
||||
@@ -1894,7 +1896,7 @@ WHERE cmsContentXml.nodeId IN (
|
||||
{
|
||||
var descendants = _mediaRepository.GetPage(query, pageIndex++, groupSize, out total, null, Ordering.By("Path"));
|
||||
var items = descendants.Select(m => new ContentXmlDto { NodeId = m.Id, Xml =
|
||||
EntityXmlSerializer.Serialize(_serviceContext.MediaService, _serviceContext.DataTypeService, _serviceContext.UserService, _serviceContext.LocalizationService, _segmentProviders, m).ToDataString() }).ToArray();
|
||||
_entitySerializer.Serialize(m).ToDataString() }).ToArray();
|
||||
db.BulkInsertRecords(items);
|
||||
processed += items.Length;
|
||||
} while (processed < total);
|
||||
@@ -1962,7 +1964,7 @@ WHERE cmsContentXml.nodeId IN (
|
||||
do
|
||||
{
|
||||
var descendants = _memberRepository.GetPage(query, pageIndex++, groupSize, out total, null, Ordering.By("Path"));
|
||||
var items = descendants.Select(m => new ContentXmlDto { NodeId = m.Id, Xml = EntityXmlSerializer.Serialize(_serviceContext.DataTypeService, _serviceContext.LocalizationService, m).ToDataString() }).ToArray();
|
||||
var items = descendants.Select(m => new ContentXmlDto { NodeId = m.Id, Xml = _entitySerializer.Serialize(m).ToDataString() }).ToArray();
|
||||
db.BulkInsertRecords(items);
|
||||
processed += items.Length;
|
||||
} while (processed < total);
|
||||
|
||||
Reference in New Issue
Block a user