Class PackageDataInstallation
Inheritance
Namespace: Umbraco.Cms.Infrastructure.Packaging
Assembly: Umbraco.Infrastructure.dll
Syntax
public class PackageDataInstallation
Constructors
View SourcePackageDataInstallation(IDataValueEditorFactory, ILogger<PackageDataInstallation>, IFileService, IMacroService, ILocalizationService, IDataTypeService, IEntityService, IContentTypeService, IContentService, PropertyEditorCollection, IScopeProvider, IShortStringHelper, IOptions<GlobalSettings>, IConfigurationEditorJsonSerializer, IMediaService, IMediaTypeService, IHostingEnvironment)
Declaration
public PackageDataInstallation(IDataValueEditorFactory dataValueEditorFactory, ILogger<PackageDataInstallation> logger, IFileService fileService, IMacroService macroService, ILocalizationService localizationService, IDataTypeService dataTypeService, IEntityService entityService, IContentTypeService contentTypeService, IContentService contentService, PropertyEditorCollection propertyEditors, IScopeProvider scopeProvider, IShortStringHelper shortStringHelper, IOptions<GlobalSettings> globalSettings, IConfigurationEditorJsonSerializer serializer, IMediaService mediaService, IMediaTypeService mediaTypeService, IHostingEnvironment hostingEnvironment)
Parameters
Type | Name | Description |
---|---|---|
IDataValueEditorFactory | dataValueEditorFactory | |
ILogger<PackageDataInstallation> | logger | |
IFileService | fileService | |
IMacroService | macroService | |
ILocalizationService | localizationService | |
IDataTypeService | dataTypeService | |
IEntityService | entityService | |
IContentTypeService | contentTypeService | |
IContentService | contentService | |
PropertyEditorCollection | propertyEditors | |
IScopeProvider | scopeProvider | |
IShortStringHelper | shortStringHelper | |
IOptions<GlobalSettings> | globalSettings | |
IConfigurationEditorJsonSerializer | serializer | |
IMediaService | mediaService | |
IMediaTypeService | mediaTypeService | |
IHostingEnvironment | hostingEnvironment |
PackageDataInstallation(IDataValueEditorFactory, ILogger<PackageDataInstallation>, IFileService, IMacroService, ILocalizationService, IDataTypeService, IEntityService, IContentTypeService, IContentService, PropertyEditorCollection, IScopeProvider, IShortStringHelper, IConfigurationEditorJsonSerializer, IMediaService, IMediaTypeService)
Declaration
public PackageDataInstallation(IDataValueEditorFactory dataValueEditorFactory, ILogger<PackageDataInstallation> logger, IFileService fileService, IMacroService macroService, ILocalizationService localizationService, IDataTypeService dataTypeService, IEntityService entityService, IContentTypeService contentTypeService, IContentService contentService, PropertyEditorCollection propertyEditors, IScopeProvider scopeProvider, IShortStringHelper shortStringHelper, IConfigurationEditorJsonSerializer serializer, IMediaService mediaService, IMediaTypeService mediaTypeService)
Parameters
Type | Name | Description |
---|---|---|
IDataValueEditorFactory | dataValueEditorFactory | |
ILogger<PackageDataInstallation> | logger | |
IFileService | fileService | |
IMacroService | macroService | |
ILocalizationService | localizationService | |
IDataTypeService | dataTypeService | |
IEntityService | entityService | |
IContentTypeService | contentTypeService | |
IContentService | contentService | |
PropertyEditorCollection | propertyEditors | |
IScopeProvider | scopeProvider | |
IShortStringHelper | shortStringHelper | |
IConfigurationEditorJsonSerializer | serializer | |
IMediaService | mediaService | |
IMediaTypeService | mediaTypeService |
Methods
View SourceImportContentBase<TContentBase, TContentTypeComposition>(IEnumerable<XElement>, Int32, IDictionary<String, TContentTypeComposition>, Int32, IContentTypeBaseService<TContentTypeComposition>, IContentServiceBase<TContentBase>)
Imports and saves package xml as IContent
Declaration
public IEnumerable<TContentBase> ImportContentBase<TContentBase, TContentTypeComposition>(IEnumerable<XElement> roots, int parentId, IDictionary<string, TContentTypeComposition> importedDocumentTypes, int userId, IContentTypeBaseService<TContentTypeComposition> typeService, IContentServiceBase<TContentBase> service)
where TContentBase : class, IContentBase where TContentTypeComposition : IContentTypeComposition
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<System.Xml.Linq.XElement> | roots | The root contents to import from |
System.Int32 | parentId | Optional parent Id for the content being imported |
IDictionary<System.String, TContentTypeComposition> | importedDocumentTypes | A dictionary of already imported document types (basically used as a cache) |
System.Int32 | userId | Optional Id of the user performing the import |
IContentTypeBaseService<TContentTypeComposition> | typeService | The content type base service |
IContentServiceBase<TContentBase> | service | The content service base |
Returns
Type | Description |
---|---|
IEnumerable<TContentBase> | An enumerable list of generated content |
Type Parameters
Name | Description |
---|---|
TContentBase | |
TContentTypeComposition |
ImportContentBase<TContentBase, TContentTypeComposition>(IEnumerable<CompiledPackageContentBase>, IDictionary<String, TContentTypeComposition>, Int32, IContentTypeBaseService<TContentTypeComposition>, IContentServiceBase<TContentBase>)
Declaration
public IReadOnlyList<TContentBase> ImportContentBase<TContentBase, TContentTypeComposition>(IEnumerable<CompiledPackageContentBase> docs, IDictionary<string, TContentTypeComposition> importedDocumentTypes, int userId, IContentTypeBaseService<TContentTypeComposition> typeService, IContentServiceBase<TContentBase> service)
where TContentBase : class, IContentBase where TContentTypeComposition : IContentTypeComposition
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<CompiledPackageContentBase> | docs | |
IDictionary<System.String, TContentTypeComposition> | importedDocumentTypes | |
System.Int32 | userId | |
IContentTypeBaseService<TContentTypeComposition> | typeService | |
IContentServiceBase<TContentBase> | service |
Returns
Type | Description |
---|---|
IReadOnlyList<TContentBase> |
Type Parameters
Name | Description |
---|---|
TContentBase | |
TContentTypeComposition |
ImportDataTypes(IReadOnlyCollection<XElement>, Int32)
Imports and saves package xml as IDataType
Declaration
public IReadOnlyList<IDataType> ImportDataTypes(IReadOnlyCollection<XElement> dataTypeElements, int userId)
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyCollection<System.Xml.Linq.XElement> | dataTypeElements | Xml to import |
System.Int32 | userId | Optional id of the user |
Returns
Type | Description |
---|---|
IReadOnlyList<IDataType> | An enumerable list of generated DataTypeDefinitions |
ImportDataTypes(IReadOnlyCollection<XElement>, Int32, out IEnumerable<EntityContainer>)
Imports and saves package xml as IDataType
Declaration
public IReadOnlyList<IDataType> ImportDataTypes(IReadOnlyCollection<XElement> dataTypeElements, int userId, out IEnumerable<EntityContainer> entityContainersInstalled)
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyCollection<System.Xml.Linq.XElement> | dataTypeElements | Xml to import |
System.Int32 | userId | Optional id of the user |
IEnumerable<EntityContainer> | entityContainersInstalled | Collection of entity containers installed by the package to be populated with those created in installing data types. |
Returns
Type | Description |
---|---|
IReadOnlyList<IDataType> | An enumerable list of generated DataTypeDefinitions |
ImportDictionaryItem(XElement, Int32, Nullable<Guid>)
Declaration
public IEnumerable<IDictionaryItem> ImportDictionaryItem(XElement dictionaryItemElement, int userId, Guid? parentId)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.Linq.XElement | dictionaryItemElement | |
System.Int32 | userId | |
System.Nullable<Guid> | parentId |
Returns
Type | Description |
---|---|
IEnumerable<IDictionaryItem> |
ImportDictionaryItems(IEnumerable<XElement>, Int32)
Imports and saves the 'DictionaryItems' part of the package xml as a list of IDictionaryItem
Declaration
public IReadOnlyList<IDictionaryItem> ImportDictionaryItems(IEnumerable<XElement> dictionaryItemElementList, int userId)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<System.Xml.Linq.XElement> | dictionaryItemElementList | Xml to import |
System.Int32 | userId |
Returns
Type | Description |
---|---|
IReadOnlyList<IDictionaryItem> | An enumerable list of dictionary items |
ImportDocumentType(XElement, Int32)
Declaration
public IReadOnlyList<IContentType> ImportDocumentType(XElement docTypeElement, int userId)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.Linq.XElement | docTypeElement | |
System.Int32 | userId |
Returns
Type | Description |
---|---|
IReadOnlyList<IContentType> |
ImportDocumentTypes(IEnumerable<XElement>, Int32)
Imports and saves package xml as IContentType
Declaration
public IReadOnlyList<IContentType> ImportDocumentTypes(IEnumerable<XElement> docTypeElements, int userId)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<System.Xml.Linq.XElement> | docTypeElements | Xml to import |
System.Int32 | userId | Optional id of the User performing the operation. Default is zero (admin). |
Returns
Type | Description |
---|---|
IReadOnlyList<IContentType> | An enumerable list of generated ContentTypes |
ImportDocumentTypes(IEnumerable<XElement>, Int32, out IEnumerable<EntityContainer>)
Imports and saves package xml as IContentType
Declaration
public IReadOnlyList<IContentType> ImportDocumentTypes(IEnumerable<XElement> docTypeElements, int userId, out IEnumerable<EntityContainer> entityContainersInstalled)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<System.Xml.Linq.XElement> | docTypeElements | Xml to import |
System.Int32 | userId | Optional id of the User performing the operation. Default is zero (admin). |
IEnumerable<EntityContainer> | entityContainersInstalled | Collection of entity containers installed by the package to be populated with those created in installing data types. |
Returns
Type | Description |
---|---|
IReadOnlyList<IContentType> | An enumerable list of generated ContentTypes |
ImportDocumentTypes<T>(IReadOnlyCollection<XElement>, Boolean, Int32, IContentTypeBaseService<T>)
Imports and saves package xml as IContentType
Declaration
public IReadOnlyList<T> ImportDocumentTypes<T>(IReadOnlyCollection<XElement> unsortedDocumentTypes, bool importStructure, int userId, IContentTypeBaseService<T> service)
where T : class, IContentTypeComposition
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyCollection<System.Xml.Linq.XElement> | unsortedDocumentTypes | Xml to import |
System.Boolean | importStructure | Boolean indicating whether or not to import the |
System.Int32 | userId | Optional id of the User performing the operation. Default is zero (admin). |
IContentTypeBaseService<T> | service | The content type service. |
Returns
Type | Description |
---|---|
IReadOnlyList<T> | An enumerable list of generated ContentTypes |
Type Parameters
Name | Description |
---|---|
T |
ImportDocumentTypes<T>(IReadOnlyCollection<XElement>, Boolean, Int32, IContentTypeBaseService<T>, out IEnumerable<EntityContainer>)
Imports and saves package xml as IContentType
Declaration
public IReadOnlyList<T> ImportDocumentTypes<T>(IReadOnlyCollection<XElement> unsortedDocumentTypes, bool importStructure, int userId, IContentTypeBaseService<T> service, out IEnumerable<EntityContainer> entityContainersInstalled)
where T : class, IContentTypeComposition
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyCollection<System.Xml.Linq.XElement> | unsortedDocumentTypes | Xml to import |
System.Boolean | importStructure | Boolean indicating whether or not to import the |
System.Int32 | userId | Optional id of the User performing the operation. Default is zero (admin). |
IContentTypeBaseService<T> | service | The content type service |
IEnumerable<EntityContainer> | entityContainersInstalled | Collection of entity containers installed by the package to be populated with those created in installing data types. |
Returns
Type | Description |
---|---|
IReadOnlyList<T> | An enumerable list of generated ContentTypes |
Type Parameters
Name | Description |
---|---|
T |
ImportLanguages(IEnumerable<XElement>, Int32)
Imports and saves the 'Languages' part of a package xml as a list of ILanguage
Declaration
public IReadOnlyList<ILanguage> ImportLanguages(IEnumerable<XElement> languageElements, int userId)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<System.Xml.Linq.XElement> | languageElements | Xml to import |
System.Int32 | userId | Optional id of the User performing the operation |
Returns
Type | Description |
---|---|
IReadOnlyList<ILanguage> | An enumerable list of generated languages |
ImportMacroPartialViews(IEnumerable<XElement>, Int32)
Declaration
public IReadOnlyList<IPartialView> ImportMacroPartialViews(IEnumerable<XElement> macroPartialViewsElements, int userId)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<System.Xml.Linq.XElement> | macroPartialViewsElements | |
System.Int32 | userId |
Returns
Type | Description |
---|---|
IReadOnlyList<IPartialView> |
ImportMacros(IEnumerable<XElement>, Int32)
Imports and saves the 'Macros' part of a package xml as a list of IMacro
Declaration
public IReadOnlyList<IMacro> ImportMacros(IEnumerable<XElement> macroElements, int userId)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<System.Xml.Linq.XElement> | macroElements | Xml to import |
System.Int32 | userId | Optional id of the User performing the operation |
Returns
Type | Description |
---|---|
IReadOnlyList<IMacro> |
ImportMediaTypes(IEnumerable<XElement>, Int32)
Imports and saves package xml as IContentType
Declaration
public IReadOnlyList<IMediaType> ImportMediaTypes(IEnumerable<XElement> docTypeElements, int userId)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<System.Xml.Linq.XElement> | docTypeElements | Xml to import |
System.Int32 | userId | Optional id of the User performing the operation. Default is zero (admin). |
Returns
Type | Description |
---|---|
IReadOnlyList<IMediaType> | An enumerable list of generated ContentTypes |
ImportMediaTypes(IEnumerable<XElement>, Int32, out IEnumerable<EntityContainer>)
Imports and saves package xml as IContentType
Declaration
public IReadOnlyList<IMediaType> ImportMediaTypes(IEnumerable<XElement> docTypeElements, int userId, out IEnumerable<EntityContainer> entityContainersInstalled)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<System.Xml.Linq.XElement> | docTypeElements | Xml to import |
System.Int32 | userId | Optional id of the User performing the operation. Default is zero (admin). |
IEnumerable<EntityContainer> | entityContainersInstalled | Collection of entity containers installed by the package to be populated with those created in installing data types. |
Returns
Type | Description |
---|---|
IReadOnlyList<IMediaType> | An enumerable list of generated ContentTypes |
ImportPartialViews(IEnumerable<XElement>, Int32)
Declaration
public IReadOnlyList<IPartialView> ImportPartialViews(IEnumerable<XElement> partialViewElements, int userId)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<System.Xml.Linq.XElement> | partialViewElements | |
System.Int32 | userId |
Returns
Type | Description |
---|---|
IReadOnlyList<IPartialView> |
ImportScripts(IEnumerable<XElement>, Int32)
Declaration
public IReadOnlyList<IScript> ImportScripts(IEnumerable<XElement> scriptElements, int userId)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<System.Xml.Linq.XElement> | scriptElements | |
System.Int32 | userId |
Returns
Type | Description |
---|---|
IReadOnlyList<IScript> |
ImportStylesheets(IEnumerable<XElement>, Int32)
Declaration
public IReadOnlyList<IFile> ImportStylesheets(IEnumerable<XElement> stylesheetElements, int userId)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<System.Xml.Linq.XElement> | stylesheetElements | |
System.Int32 | userId |
Returns
Type | Description |
---|---|
IReadOnlyList<IFile> |
ImportTemplate(XElement, Int32)
Declaration
public IEnumerable<ITemplate> ImportTemplate(XElement templateElement, int userId)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.Linq.XElement | templateElement | |
System.Int32 | userId |
Returns
Type | Description |
---|---|
IEnumerable<ITemplate> |
ImportTemplates(IReadOnlyCollection<XElement>, Int32)
Imports and saves package xml as ITemplate
Declaration
public IReadOnlyList<ITemplate> ImportTemplates(IReadOnlyCollection<XElement> templateElements, int userId)
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyCollection<System.Xml.Linq.XElement> | templateElements | Xml to import |
System.Int32 | userId | Optional user id |
Returns
Type | Description |
---|---|
IReadOnlyList<ITemplate> | An enumerable list of generated Templates |
InstallPackageData(CompiledPackage, Int32)
Declaration
public InstallationSummary InstallPackageData(CompiledPackage compiledPackage, int userId)
Parameters
Type | Name | Description |
---|---|---|
CompiledPackage | compiledPackage | |
System.Int32 | userId |
Returns
Type | Description |
---|---|
InstallationSummary |