Пример #1
0
 public ConfigureIndexOptions(
     IUmbracoIndexConfig umbracoIndexConfig,
     IOptions <IndexCreatorSettings> settings)
 {
     _umbracoIndexConfig = umbracoIndexConfig;
     _settings           = settings.Value;
 }
        public IValueSetValidator MemberValidator(IUmbracoIndexConfig config)
        {
            var includeFields = config?.IncludeFields?.Select(x => x.Name);

            var excludeFields = config?.IncludeFields?.Select(x => x.Name);

            return(new MemberValueSetValidator(config?.IncludeTypes, config?.ExcludeTypes, includeFields, excludeFields));
        }
        public IContentValueSetValidator PublishedContentValidator(IUmbracoIndexConfig config)
        {
            var includePublished = config?.IncludePublished ?? true;

            var includeProtected = config?.IncludeProtected ?? false;

            return(new ContentValueSetValidator(includePublished, includeProtected, _publicAccessService, null, config?.IncludeTypes, config?.ExcludeTypes));
        }
 public ElasticIndexCreator(IProfilingLogger profilingLogger,
                            ILocalizationService languageService,
                            IPublicAccessService publicAccessService, IUmbracoIndexConfig umbracoIndexConfig)
 {
     ProfilingLogger      = profilingLogger ?? throw new System.ArgumentNullException(nameof(profilingLogger));
     LanguageService      = languageService ?? throw new System.ArgumentNullException(nameof(languageService));
     UmbracoIndexConfig   = umbracoIndexConfig;
     _publicAccessService =
         publicAccessService ?? throw new System.ArgumentNullException(nameof(publicAccessService));
 }
        public CustomUmbracoIndexesCreator(IProfilingLogger profilingLogger,
                                           ILocalizationService languageService, IUmbracoIndexConfig umbracoIndexConfig)
        {
            _profilingLogger = profilingLogger
                               ?? throw new ArgumentNullException(nameof(profilingLogger));

            _languageService = languageService
                               ?? throw new ArgumentNullException(nameof(languageService));

            _umbracoIndexConfig = umbracoIndexConfig
                                  ?? throw new ArgumentNullException(nameof(umbracoIndexConfig));
        }
Пример #6
0
        // TODO: we should inject the different IValueSetValidator so devs can just register them instead of overriding this class?

        public UmbracoIndexesCreator(
            ITypeFinder typeFinder,
            IProfilingLogger profilingLogger,
            ILocalizationService languageService,
            IPublicAccessService publicAccessService,
            IMemberService memberService, IUmbracoIndexConfig umbracoIndexConfig) : base(typeFinder)
        {
            ProfilingLogger     = profilingLogger ?? throw new System.ArgumentNullException(nameof(profilingLogger));
            LanguageService     = languageService ?? throw new System.ArgumentNullException(nameof(languageService));
            PublicAccessService = publicAccessService ?? throw new System.ArgumentNullException(nameof(publicAccessService));
            MemberService       = memberService ?? throw new System.ArgumentNullException(nameof(memberService));
            UmbracoIndexConfig  = umbracoIndexConfig;
        }
 public IContentValueSetValidator ContentValidator(IUmbracoIndexConfig config)
 {
     return(new ContentValueSetValidator(false, true, _publicAccessService, null, config?.IncludeTypes, config?.ExcludeTypes));
 }