/// <summary> /// Initializes a new instance of the <see cref="CreatedPackageSchemaRepository" /> class. /// </summary> public CreatedPackageSchemaRepository( IUmbracoDatabaseFactory umbracoDatabaseFactory, IHostingEnvironment hostingEnvironment, IOptions <GlobalSettings> globalSettings, FileSystems fileSystems, IEntityXmlSerializer serializer, IDataTypeService dataTypeService, ILocalizationService localizationService, IFileService fileService, IMediaService mediaService, IMediaTypeService mediaTypeService, IContentService contentService, MediaFileManager mediaFileManager, IMacroService macroService, IContentTypeService contentTypeService, string?mediaFolderPath = null, string?tempFolderPath = null) { _umbracoDatabase = umbracoDatabaseFactory.CreateDatabase(); _hostingEnvironment = hostingEnvironment; _fileSystems = fileSystems; _serializer = serializer; _dataTypeService = dataTypeService; _localizationService = localizationService; _fileService = fileService; _mediaService = mediaService; _mediaTypeService = mediaTypeService; _contentService = contentService; _mediaFileManager = mediaFileManager; _macroService = macroService; _contentTypeService = contentTypeService; _xmlParser = new PackageDefinitionXmlParser(); _createdPackagesFolderPath = mediaFolderPath ?? Constants.SystemDirectories.CreatedPackages; _tempFolderPath = tempFolderPath ?? Constants.SystemDirectories.TempData + "/PackageFiles"; }
/// <summary> /// Constructor /// </summary> /// <param name="contentService"></param> /// <param name="contentTypeService"></param> /// <param name="dataTypeService"></param> /// <param name="fileService"></param> /// <param name="macroService"></param> /// <param name="languageService"></param> /// <param name="hostingEnvironment"></param> /// <param name="serializer"></param> /// <param name="globalSettings"></param> /// <param name="packageRepositoryFileName"> /// The file name for storing the package definitions (i.e. "createdPackages.config") /// </param> /// <param name="tempFolderPath"></param> /// <param name="packagesFolderPath"></param> /// <param name="mediaFolderPath"></param> /// <param name="mediaService"></param> /// <param name="mediaTypeService"></param> /// <param name="mediaFileManager"></param> /// <param name="fileSystems"></param> public PackagesRepository( IContentService contentService, IContentTypeService contentTypeService, IDataTypeService dataTypeService, IFileService fileService, IMacroService macroService, ILocalizationService languageService, IHostingEnvironment hostingEnvironment, IEntityXmlSerializer serializer, IOptions <GlobalSettings> globalSettings, IMediaService mediaService, IMediaTypeService mediaTypeService, MediaFileManager mediaFileManager, FileSystems fileSystems, string packageRepositoryFileName, string?tempFolderPath = null, string?packagesFolderPath = null, string?mediaFolderPath = null) { if (string.IsNullOrWhiteSpace(packageRepositoryFileName)) { throw new ArgumentException("Value cannot be null or whitespace.", nameof(packageRepositoryFileName)); } _contentService = contentService; _contentTypeService = contentTypeService; _dataTypeService = dataTypeService; _fileService = fileService; _macroService = macroService; _languageService = languageService; _serializer = serializer; _hostingEnvironment = hostingEnvironment; _packageRepositoryFileName = packageRepositoryFileName; _tempFolderPath = tempFolderPath ?? Constants.SystemDirectories.TempData.EnsureEndsWith('/') + "PackageFiles"; _packagesFolderPath = packagesFolderPath ?? Constants.SystemDirectories.Packages; _createdPackagesFolderPath = mediaFolderPath ?? Constants.SystemDirectories.CreatedPackages; _parser = new PackageDefinitionXmlParser(); _mediaService = mediaService; _mediaTypeService = mediaTypeService; _mediaFileManager = mediaFileManager; _fileSystems = fileSystems; }
/// <summary> /// Initializes a new instance of the <see cref="CreatedPackageSchemaRepository"/> class. /// </summary> public CreatedPackageSchemaRepository( IUmbracoDatabase umbracoDatabase, IHostingEnvironment hostingEnvironment, IOptions <GlobalSettings> globalSettings, FileSystems fileSystems, IEntityXmlSerializer serializer, IDataTypeService dataTypeService, ILocalizationService localizationService, IFileService fileService, IMediaService mediaService, IMediaTypeService mediaTypeService, IContentService contentService, MediaFileManager mediaFileManager, IMacroService macroService, IContentTypeService contentTypeService, string mediaFolderPath = null, string tempFolderPath = null) { _umbracoDatabase = umbracoDatabase; _hostingEnvironment = hostingEnvironment; _fileSystems = fileSystems; _serializer = serializer; _dataTypeService = dataTypeService; _localizationService = localizationService; _fileService = fileService; _mediaService = mediaService; _mediaTypeService = mediaTypeService; _contentService = contentService; _mediaFileManager = mediaFileManager; _macroService = macroService; _contentTypeService = contentTypeService; _xmlParser = new PackageDefinitionXmlParser(); _mediaFolderPath = mediaFolderPath ?? Path.Combine(globalSettings.Value.UmbracoMediaPhysicalRootPath, Constants.SystemDirectories.CreatedPackages); _tempFolderPath = tempFolderPath ?? Constants.SystemDirectories.TempData.EnsureEndsWith('/') + "PackageFiles"; }
/// <summary> /// Initializes a new instance of the <see cref="MovePackageXMLToDb" /> class. /// </summary> public MovePackageXMLToDb(IMigrationContext context, PackagesRepository packagesRepository) : base(context) { _packagesRepository = packagesRepository; _xmlParser = new PackageDefinitionXmlParser(); }