public CustomContentValueSetBuilder(PropertyEditorCollection propertyEditors, UrlSegmentProviderCollection urlSegmentProviders, IUserService userService, bool publishedValuesOnly) : this(propertyEditors, urlSegmentProviders, userService, Current.ScopeProvider, publishedValuesOnly) { }
public MediaValueSetBuilder(PropertyEditorCollection propertyEditors, UrlSegmentProviderCollection urlSegmentProviders, IUserService userService) : base(propertyEditors, false) { _urlSegmentProviders = urlSegmentProviders; _userService = userService; }
public CustomMediaValueSetBuilder(PropertyEditorCollection propertyEditors, UrlSegmentProviderCollection urlSegmentProviders, IUserService userService, ILogger logger) : base(propertyEditors, urlSegmentProviders, userService, logger) { _urlSegmentProviders = urlSegmentProviders; _logger = logger; }
public CustomContentValueSetBuilder(PropertyEditorCollection propertyEditors, UrlSegmentProviderCollection urlSegmentProviders, IUserService userService, IScopeProvider scopeProvider, bool publishedValuesOnly) : base(propertyEditors, urlSegmentProviders, userService, scopeProvider, publishedValuesOnly) { _urlSegmentProviders = urlSegmentProviders; }
public ContentValueSetBuilder(PropertyEditorCollection propertyEditors, UrlSegmentProviderCollection urlSegmentProviders, IUserService userService, bool publishedValuesOnly) : base(propertyEditors, publishedValuesOnly) { _urlSegmentProviders = urlSegmentProviders; _userService = userService; }
public ContentValueSetBuilder(PropertyEditorCollection propertyEditors, UrlSegmentProviderCollection urlSegmentProviders, IUserService userService, IShortStringHelper shortStringHelper, IScopeProvider scopeProvider, bool publishedValuesOnly) : base(propertyEditors, publishedValuesOnly) { _urlSegmentProviders = urlSegmentProviders; _userService = userService; _shortStringHelper = shortStringHelper; _scopeProvider = scopeProvider; }
public MediaValueSetBuilder( PropertyEditorCollection propertyEditors, UrlSegmentProviderCollection urlSegmentProviders, MediaUrlGeneratorCollection mediaUrlGenerators, IUserService userService, IShortStringHelper shortStringHelper, IOptions <ContentSettings> contentSettings) : base(propertyEditors, false) { _urlSegmentProviders = urlSegmentProviders; _mediaUrlGenerators = mediaUrlGenerators; _userService = userService; _shortStringHelper = shortStringHelper; _contentSettings = contentSettings.Value; }
public EntityXmlSerializer( IContentService contentService, IMediaService mediaService, IDataTypeService dataTypeService, IUserService userService, ILocalizationService localizationService, IContentTypeService contentTypeService, UrlSegmentProviderCollection urlSegmentProviders) { _contentTypeService = contentTypeService; _mediaService = mediaService; _contentService = contentService; _dataTypeService = dataTypeService; _userService = userService; _localizationService = localizationService; _urlSegmentProviders = urlSegmentProviders; }
/// <summary> /// Initializes a new instance of the <see cref="NuCacheContentRepository"/> class. /// </summary> public NuCacheContentRepository( IScopeAccessor scopeAccessor, AppCaches appCaches, ILogger <NuCacheContentRepository> logger, IMemberRepository memberRepository, IDocumentRepository documentRepository, IMediaRepository mediaRepository, IShortStringHelper shortStringHelper, UrlSegmentProviderCollection urlSegmentProviders, IContentCacheDataSerializerFactory contentCacheDataSerializerFactory, IOptions <NuCacheSettings> nucacheSettings) : base(scopeAccessor, appCaches) { _logger = logger; _memberRepository = memberRepository; _documentRepository = documentRepository; _mediaRepository = mediaRepository; _shortStringHelper = shortStringHelper; _urlSegmentProviders = urlSegmentProviders; _contentCacheDataSerializerFactory = contentCacheDataSerializerFactory; _nucacheSettings = nucacheSettings; }
public EntityXmlSerializer( IContentService contentService, IMediaService mediaService, IDataTypeService dataTypeService, IUserService userService, ILocalizationService localizationService, IContentTypeService contentTypeService, UrlSegmentProviderCollection urlSegmentProviders, IShortStringHelper shortStringHelper, PropertyEditorCollection propertyEditors, IConfigurationEditorJsonSerializer configurationEditorJsonSerializer) { _contentTypeService = contentTypeService; _mediaService = mediaService; _contentService = contentService; _dataTypeService = dataTypeService; _userService = userService; _localizationService = localizationService; _urlSegmentProviders = urlSegmentProviders; _shortStringHelper = shortStringHelper; _propertyEditors = propertyEditors; _configurationEditorJsonSerializer = configurationEditorJsonSerializer; }
/// <summary> /// Gets a ServiceContext. /// </summary> /// <param name="scopeAccessor"></param> /// <param name="cache">A cache.</param> /// <param name="logger">A logger.</param> /// <param name="globalSettings"></param> /// <param name="eventMessagesFactory">An event messages factory.</param> /// <param name="urlSegmentProviders">Some url segment providers.</param> /// <param name="container">A container.</param> /// <param name="scopeProvider"></param> /// <returns>A ServiceContext.</returns> /// <remarks>Should be used sparingly for integration tests only - for unit tests /// just mock the services to be passed to the ctor of the ServiceContext.</remarks> public ServiceContext GetServiceContext( IScopeProvider scopeProvider, IScopeAccessor scopeAccessor, CacheHelper cache, ILogger logger, IGlobalSettings globalSettings, IUmbracoSettingsSection umbracoSettings, IEventMessagesFactory eventMessagesFactory, UrlSegmentProviderCollection urlSegmentProviders, TypeLoader typeLoader, IFactory factory = null) { if (scopeProvider == null) { throw new ArgumentNullException(nameof(scopeProvider)); } if (scopeAccessor == null) { throw new ArgumentNullException(nameof(scopeAccessor)); } if (cache == null) { throw new ArgumentNullException(nameof(cache)); } if (logger == null) { throw new ArgumentNullException(nameof(logger)); } if (eventMessagesFactory == null) { throw new ArgumentNullException(nameof(eventMessagesFactory)); } var scheme = Mock.Of <IMediaPathScheme>(); var config = Mock.Of <IContentSection>(); var mediaFileSystem = new MediaFileSystem(Mock.Of <IFileSystem>(), config, scheme, logger); var externalLoginService = GetLazyService <IExternalLoginService>(factory, c => new ExternalLoginService(scopeProvider, logger, eventMessagesFactory, GetRepo <IExternalLoginRepository>(c))); var publicAccessService = GetLazyService <IPublicAccessService>(factory, c => new PublicAccessService(scopeProvider, logger, eventMessagesFactory, GetRepo <IPublicAccessRepository>(c))); var domainService = GetLazyService <IDomainService>(factory, c => new DomainService(scopeProvider, logger, eventMessagesFactory, GetRepo <IDomainRepository>(c))); var auditService = GetLazyService <IAuditService>(factory, c => new AuditService(scopeProvider, logger, eventMessagesFactory, GetRepo <IAuditRepository>(c), GetRepo <IAuditEntryRepository>(c))); var localizedTextService = GetLazyService <ILocalizedTextService>(factory, c => new LocalizedTextService( new Lazy <LocalizedTextServiceFileSources>(() => { var mainLangFolder = new DirectoryInfo(IOHelper.MapPath(SystemDirectories.Umbraco + "/config/lang/")); var appPlugins = new DirectoryInfo(IOHelper.MapPath(SystemDirectories.AppPlugins)); var configLangFolder = new DirectoryInfo(IOHelper.MapPath(SystemDirectories.Config + "/lang/")); var pluginLangFolders = appPlugins.Exists == false ? Enumerable.Empty <LocalizedTextServiceSupplementaryFileSource>() : appPlugins.GetDirectories() .SelectMany(x => x.GetDirectories("Lang")) .SelectMany(x => x.GetFiles("*.xml", SearchOption.TopDirectoryOnly)) .Where(x => Path.GetFileNameWithoutExtension(x.FullName).Length == 5) .Select(x => new LocalizedTextServiceSupplementaryFileSource(x, false)); //user defined langs that overwrite the default, these should not be used by plugin creators var userLangFolders = configLangFolder.Exists == false ? Enumerable.Empty <LocalizedTextServiceSupplementaryFileSource>() : configLangFolder .GetFiles("*.user.xml", SearchOption.TopDirectoryOnly) .Where(x => Path.GetFileNameWithoutExtension(x.FullName).Length == 10) .Select(x => new LocalizedTextServiceSupplementaryFileSource(x, true)); return(new LocalizedTextServiceFileSources( logger, cache.RuntimeCache, mainLangFolder, pluginLangFolders.Concat(userLangFolders))); }), logger)); var runtimeState = Mock.Of <IRuntimeState>(); var idkMap = new IdkMap(scopeProvider); var localizationService = GetLazyService <ILocalizationService>(factory, c => new LocalizationService(scopeProvider, logger, eventMessagesFactory, GetRepo <IDictionaryRepository>(c), GetRepo <IAuditRepository>(c), GetRepo <ILanguageRepository>(c))); var userService = GetLazyService <IUserService>(factory, c => new UserService(scopeProvider, logger, eventMessagesFactory, runtimeState, GetRepo <IUserRepository>(c), GetRepo <IUserGroupRepository>(c), globalSettings)); var dataTypeService = GetLazyService <IDataTypeService>(factory, c => new DataTypeService(scopeProvider, logger, eventMessagesFactory, GetRepo <IDataTypeRepository>(c), GetRepo <IDataTypeContainerRepository>(c), GetRepo <IAuditRepository>(c), GetRepo <IEntityRepository>(c), GetRepo <IContentTypeRepository>(c))); var contentService = GetLazyService <IContentService>(factory, c => new ContentService(scopeProvider, logger, eventMessagesFactory, mediaFileSystem, GetRepo <IDocumentRepository>(c), GetRepo <IEntityRepository>(c), GetRepo <IAuditRepository>(c), GetRepo <IContentTypeRepository>(c), GetRepo <IDocumentBlueprintRepository>(c), GetRepo <ILanguageRepository>(c))); var notificationService = GetLazyService <INotificationService>(factory, c => new NotificationService(scopeProvider, userService.Value, contentService.Value, localizationService.Value, logger, GetRepo <INotificationsRepository>(c), globalSettings, umbracoSettings.Content)); var serverRegistrationService = GetLazyService <IServerRegistrationService>(factory, c => new ServerRegistrationService(scopeProvider, logger, eventMessagesFactory, GetRepo <IServerRegistrationRepository>(c))); var memberGroupService = GetLazyService <IMemberGroupService>(factory, c => new MemberGroupService(scopeProvider, logger, eventMessagesFactory, GetRepo <IMemberGroupRepository>(c))); var memberService = GetLazyService <IMemberService>(factory, c => new MemberService(scopeProvider, logger, eventMessagesFactory, memberGroupService.Value, mediaFileSystem, GetRepo <IMemberRepository>(c), GetRepo <IMemberTypeRepository>(c), GetRepo <IMemberGroupRepository>(c), GetRepo <IAuditRepository>(c))); var mediaService = GetLazyService <IMediaService>(factory, c => new MediaService(scopeProvider, mediaFileSystem, logger, eventMessagesFactory, GetRepo <IMediaRepository>(c), GetRepo <IAuditRepository>(c), GetRepo <IMediaTypeRepository>(c), GetRepo <IEntityRepository>(c))); var contentTypeService = GetLazyService <IContentTypeService>(factory, c => new ContentTypeService(scopeProvider, logger, eventMessagesFactory, contentService.Value, GetRepo <IContentTypeRepository>(c), GetRepo <IAuditRepository>(c), GetRepo <IDocumentTypeContainerRepository>(c), GetRepo <IEntityRepository>(c))); var mediaTypeService = GetLazyService <IMediaTypeService>(factory, c => new MediaTypeService(scopeProvider, logger, eventMessagesFactory, mediaService.Value, GetRepo <IMediaTypeRepository>(c), GetRepo <IAuditRepository>(c), GetRepo <IMediaTypeContainerRepository>(c), GetRepo <IEntityRepository>(c))); var fileService = GetLazyService <IFileService>(factory, c => new FileService(scopeProvider, logger, eventMessagesFactory, GetRepo <IStylesheetRepository>(c), GetRepo <IScriptRepository>(c), GetRepo <ITemplateRepository>(c), GetRepo <IPartialViewRepository>(c), GetRepo <IPartialViewMacroRepository>(c), GetRepo <IAuditRepository>(c))); var memberTypeService = GetLazyService <IMemberTypeService>(factory, c => new MemberTypeService(scopeProvider, logger, eventMessagesFactory, memberService.Value, GetRepo <IMemberTypeRepository>(c), GetRepo <IAuditRepository>(c), GetRepo <IEntityRepository>(c))); var entityService = GetLazyService <IEntityService>(factory, c => new EntityService( scopeProvider, logger, eventMessagesFactory, contentService.Value, contentTypeService.Value, mediaService.Value, mediaTypeService.Value, dataTypeService.Value, memberService.Value, memberTypeService.Value, idkMap, GetRepo <IEntityRepository>(c))); var macroService = GetLazyService <IMacroService>(factory, c => new MacroService(scopeProvider, logger, eventMessagesFactory, GetRepo <IMacroRepository>(c), GetRepo <IAuditRepository>(c))); var packagingService = GetLazyService <IPackagingService>(factory, c => new PackagingService(logger, contentService.Value, contentTypeService.Value, mediaService.Value, macroService.Value, dataTypeService.Value, fileService.Value, localizationService.Value, entityService.Value, userService.Value, scopeProvider, urlSegmentProviders, GetRepo <IAuditRepository>(c), GetRepo <IContentTypeRepository>(c), new PropertyEditorCollection(new DataEditorCollection(Enumerable.Empty <DataEditor>())))); var relationService = GetLazyService <IRelationService>(factory, c => new RelationService(scopeProvider, logger, eventMessagesFactory, entityService.Value, GetRepo <IRelationRepository>(c), GetRepo <IRelationTypeRepository>(c))); var treeService = GetLazyService <IApplicationTreeService>(factory, c => new ApplicationTreeService(logger, cache, typeLoader)); var tagService = GetLazyService <ITagService>(factory, c => new TagService(scopeProvider, logger, eventMessagesFactory, GetRepo <ITagRepository>(c))); var sectionService = GetLazyService <ISectionService>(factory, c => new SectionService(userService.Value, treeService.Value, scopeProvider, cache)); var redirectUrlService = GetLazyService <IRedirectUrlService>(factory, c => new RedirectUrlService(scopeProvider, logger, eventMessagesFactory, GetRepo <IRedirectUrlRepository>(c))); var consentService = GetLazyService <IConsentService>(factory, c => new ConsentService(scopeProvider, logger, eventMessagesFactory, GetRepo <IConsentRepository>(c))); return(new ServiceContext( publicAccessService, domainService, auditService, localizedTextService, tagService, contentService, userService, memberService, mediaService, contentTypeService, mediaTypeService, dataTypeService, fileService, localizationService, packagingService, serverRegistrationService, entityService, relationService, treeService, sectionService, macroService, memberTypeService, memberGroupService, notificationService, externalLoginService, redirectUrlService, consentService)); }