Merge branch temp8 into temp8-di2690

This commit is contained in:
Stephan
2018-10-08 19:22:20 +02:00
575 changed files with 21133 additions and 20521 deletions

View File

@@ -90,7 +90,7 @@ namespace Umbraco.Web.PublishedCache.NuCache
// determines whether a property has value
public override bool HasValue(string culture = null, string segment = null)
{
ContextualizeVariation(ref culture, ref segment);
_content.VariationContextAccessor.ContextualizeVariation(_variations, ref culture, ref segment);
var value = GetSourceValue(culture, segment);
var hasValue = PropertyType.IsValue(value, PropertyValueLevel.Source);
@@ -194,7 +194,7 @@ namespace Umbraco.Web.PublishedCache.NuCache
public override object GetSourceValue(string culture = null, string segment = null)
{
ContextualizeVariation(ref culture, ref segment);
_content.VariationContextAccessor.ContextualizeVariation(_variations, ref culture, ref segment);
if (culture == "" && segment == "")
return _sourceValue;
@@ -206,19 +206,9 @@ namespace Umbraco.Web.PublishedCache.NuCache
}
}
private void ContextualizeVariation(ref string culture, ref string segment)
{
if (culture != null && segment != null) return;
// use context values
var publishedVariationContext = _content.VariationContextAccessor?.VariationContext;
if (culture == null) culture = _variations.VariesByCulture() ? publishedVariationContext?.Culture : "";
if (segment == null) segment = _variations.VariesBySegment() ? publishedVariationContext?.Segment : "";
}
public override object GetValue(string culture = null, string segment = null)
{
ContextualizeVariation(ref culture, ref segment);
_content.VariationContextAccessor.ContextualizeVariation(_variations, ref culture, ref segment);
object value;
lock (_locko)
@@ -239,7 +229,7 @@ namespace Umbraco.Web.PublishedCache.NuCache
public override object GetXPathValue(string culture = null, string segment = null)
{
ContextualizeVariation(ref culture, ref segment);
_content.VariationContextAccessor.ContextualizeVariation(_variations, ref culture, ref segment);
lock (_locko)
{

View File

@@ -303,7 +303,7 @@ namespace Umbraco.Web.PublishedCache.NuCache
var kits = _dataSource.GetAllContentSources(scope);
_contentStore.SetAll(kits);
sw.Stop();
_logger.Debug<PublishedSnapshotService>("Loaded content from database ({ElapsedMilliseconds}ms)", sw.ElapsedMilliseconds);
_logger.Debug<PublishedSnapshotService>("Loaded content from database ({Duration}ms)", sw.ElapsedMilliseconds);
}
private void LoadContentFromLocalDbLocked(IScope scope)
@@ -317,7 +317,7 @@ namespace Umbraco.Web.PublishedCache.NuCache
var kits = _localContentDb.Select(x => x.Value).OrderBy(x => x.Node.Level);
_contentStore.SetAll(kits);
sw.Stop();
_logger.Debug<PublishedSnapshotService>("Loaded content from local db ({ElapsedMilliseconds}ms)", sw.ElapsedMilliseconds);
_logger.Debug<PublishedSnapshotService>("Loaded content from local db ({Duration}ms)", sw.ElapsedMilliseconds);
}
// keep these around - might be useful
@@ -370,7 +370,7 @@ namespace Umbraco.Web.PublishedCache.NuCache
var kits = _dataSource.GetAllMediaSources(scope);
_mediaStore.SetAll(kits);
sw.Stop();
_logger.Debug<PublishedSnapshotService>("Loaded media from database ({ElapsedMilliseconds}ms)", sw.ElapsedMilliseconds);
_logger.Debug<PublishedSnapshotService>("Loaded media from database ({Duration}ms)", sw.ElapsedMilliseconds);
}
private void LoadMediaFromLocalDbLocked(IScope scope)
@@ -384,7 +384,7 @@ namespace Umbraco.Web.PublishedCache.NuCache
var kits = _localMediaDb.Select(x => x.Value);
_mediaStore.SetAll(kits);
sw.Stop();
_logger.Debug<PublishedSnapshotService>("Loaded media from local db ({ElapsedMilliseconds}ms)", sw.ElapsedMilliseconds);
_logger.Debug<PublishedSnapshotService>("Loaded media from local db ({Duration}ms)", sw.ElapsedMilliseconds);
}
// keep these around - might be useful
@@ -1196,7 +1196,7 @@ namespace Umbraco.Web.PublishedCache.NuCache
foreach (var (culture, name) in names)
{
cultureData[culture] = new CultureVariation { Name = name, Date = content.GetCultureDate(culture) ?? DateTime.MinValue };
cultureData[culture] = new CultureVariation { Name = name, Date = content.GetUpdateDate(culture) ?? DateTime.MinValue };
}
//the dictionary that will be serialized
@@ -1277,7 +1277,7 @@ WHERE cmsContentNu.nodeId IN (
long total;
do
{
var descendants = _documentRepository.GetPage(query, pageIndex++, groupSize, out total, "Path", Direction.Ascending, true);
var descendants = _documentRepository.GetPage(query, pageIndex++, groupSize, out total, null, Ordering.By("Path"));
var items = new List<ContentNuDto>();
foreach (var c in descendants)
{
@@ -1344,7 +1344,7 @@ WHERE cmsContentNu.nodeId IN (
long total;
do
{
var descendants = _mediaRepository.GetPage(query, pageIndex++, groupSize, out total, "Path", Direction.Ascending, true);
var descendants = _mediaRepository.GetPage(query, pageIndex++, groupSize, out total, null, Ordering.By("Path"));
var items = descendants.Select(m => GetDto(m, false)).ToArray();
db.BulkInsertRecords(items);
processed += items.Length;
@@ -1402,7 +1402,7 @@ WHERE cmsContentNu.nodeId IN (
long total;
do
{
var descendants = _memberRepository.GetPage(query, pageIndex++, groupSize, out total, "Path", Direction.Ascending, true);
var descendants = _memberRepository.GetPage(query, pageIndex++, groupSize, out total, null, Ordering.By("Path"));
var items = descendants.Select(m => GetDto(m, false)).ToArray();
db.BulkInsertRecords(items);
processed += items.Length;

View File

@@ -1746,7 +1746,7 @@ WHERE cmsContentXml.nodeId IN (
long total;
do
{
var descendants = _documentRepository.GetPage(query, pageIndex++, groupSize, out total, "Path", Direction.Ascending, true);
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();
@@ -1819,7 +1819,7 @@ WHERE cmsPreviewXml.nodeId IN (
{
// .GetPagedResultsByQuery implicitely adds ({Constants.DatabaseSchema.Tables.Document}.newest = 1) which
// is what we want for preview (ie latest version of a content, published or not)
var descendants = _documentRepository.GetPage(query, pageIndex++, groupSize, out total, "Path", Direction.Ascending, true);
var descendants = _documentRepository.GetPage(query, pageIndex++, groupSize, out total, null, Ordering.By("Path"));
const bool published = true; // previewXml contains edit content!
var items = descendants.Select(c => new PreviewXmlDto
{
@@ -1892,7 +1892,7 @@ WHERE cmsContentXml.nodeId IN (
long total;
do
{
var descendants = _mediaRepository.GetPage(query, pageIndex++, groupSize, out total, "Path", Direction.Ascending, true);
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();
db.BulkInsertRecords(items);
@@ -1961,7 +1961,7 @@ WHERE cmsContentXml.nodeId IN (
long total;
do
{
var descendants = _memberRepository.GetPage(query, pageIndex++, groupSize, out total, "Path", Direction.Ascending, true);
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();
db.BulkInsertRecords(items);
processed += items.Length;