Merge branch temp8 into temp8-di2690
This commit is contained in:
@@ -57,7 +57,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
|
||||
ValidateAndSetProperty(valueDictionary, val => _sortOrder = Int32.Parse(val), "sortOrder");
|
||||
ValidateAndSetProperty(valueDictionary, val => _name = val, "nodeName", "__nodeName");
|
||||
ValidateAndSetProperty(valueDictionary, val => _urlName = val, "urlName");
|
||||
ValidateAndSetProperty(valueDictionary, val => _documentTypeAlias = val, "nodeTypeAlias", LuceneIndexer.ItemTypeFieldName);
|
||||
ValidateAndSetProperty(valueDictionary, val => _documentTypeAlias = val, "nodeTypeAlias", LuceneIndex.ItemTypeFieldName);
|
||||
ValidateAndSetProperty(valueDictionary, val => _documentTypeId = Int32.Parse(val), "nodeType");
|
||||
//ValidateAndSetProperty(valueDictionary, val => _writerName = val, "writerName");
|
||||
ValidateAndSetProperty(valueDictionary, val => _creatorName = val, "creatorName", "writerName"); //this is a bit of a hack fix for: U4-1132
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
|
||||
// method GetExamineManagerSafe().
|
||||
//
|
||||
private readonly ISearcher _searchProvider;
|
||||
private readonly IIndexer _indexProvider;
|
||||
private readonly IIndex _indexProvider;
|
||||
private readonly XmlStore _xmlStore;
|
||||
private readonly PublishedContentTypeCache _contentTypeCache;
|
||||
|
||||
@@ -240,8 +240,9 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
|
||||
|
||||
try
|
||||
{
|
||||
//by default use the internal index
|
||||
return eMgr.GetSearcher(Constants.Examine.InternalIndexer);
|
||||
if (eMgr.TryGetIndex(Constants.Examine.InternalIndexer, out var index))
|
||||
return index.GetSearcher();
|
||||
throw new InvalidOperationException($"No index found by name {Constants.Examine.InternalIndexer}");
|
||||
}
|
||||
catch (FileNotFoundException)
|
||||
{
|
||||
@@ -353,13 +354,13 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
|
||||
return null;
|
||||
}
|
||||
|
||||
internal CacheValues ConvertFromSearchResult(SearchResult searchResult)
|
||||
internal CacheValues ConvertFromSearchResult(ISearchResult searchResult)
|
||||
{
|
||||
// note: fixing fields in 7.x, removed by Shan for 8.0
|
||||
|
||||
return new CacheValues
|
||||
{
|
||||
Values = searchResult.Fields,
|
||||
Values = searchResult.Values,
|
||||
FromExamine = true
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Cache;
|
||||
using Umbraco.Core.Components;
|
||||
using Umbraco.Core.Composing;
|
||||
using Umbraco.Core.Services;
|
||||
using Umbraco.Core.Strings;
|
||||
using Umbraco.Core.Logging;
|
||||
using Umbraco.Core.Scoping;
|
||||
using Umbraco.Web.HealthCheck.Checks.DataIntegrity;
|
||||
using Umbraco.Core.Configuration;
|
||||
using Umbraco.Core.Models.PublishedContent;
|
||||
using Umbraco.Core.Persistence.Repositories;
|
||||
using Umbraco.Web.Routing;
|
||||
|
||||
namespace Umbraco.Web.PublishedCache.XmlPublishedCache
|
||||
{
|
||||
[DisableComponent] // is not enabled by default
|
||||
public class XmlCacheComponent : UmbracoComponentBase, IUmbracoCoreComponent
|
||||
{
|
||||
public override void Compose(Composition composition)
|
||||
{
|
||||
base.Compose(composition);
|
||||
|
||||
// register the XML facade service
|
||||
composition.SetPublishedSnapshotService(factory => new PublishedSnapshotService(
|
||||
factory.GetInstance<ServiceContext>(),
|
||||
factory.GetInstance<IPublishedContentTypeFactory>(),
|
||||
factory.GetInstance<IScopeProvider>(),
|
||||
factory.GetInstance<CacheHelper>().RequestCache,
|
||||
factory.GetInstance<UrlSegmentProviderCollection>(),
|
||||
factory.GetInstance<IPublishedSnapshotAccessor>(),
|
||||
factory.GetInstance<IVariationContextAccessor>(),
|
||||
factory.GetInstance<IDocumentRepository>(),
|
||||
factory.GetInstance<IMediaRepository>(),
|
||||
factory.GetInstance<IMemberRepository>(),
|
||||
factory.GetInstance<IDefaultCultureAccessor>(),
|
||||
factory.GetInstance<ILogger>(),
|
||||
factory.GetInstance<IGlobalSettings>(),
|
||||
factory.GetInstance<ISiteDomainHelper>(),
|
||||
factory.GetInstance<MainDom>()));
|
||||
|
||||
// add the Xml cache health check (hidden from type finder)
|
||||
composition.HealthChecks().Add<XmlDataIntegrityHealthCheck>();
|
||||
}
|
||||
|
||||
public void Initialize(IPublishedSnapshotService service)
|
||||
{
|
||||
// nothing - this just ensures that the service is created at boot time
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user