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 |
---|---|---|
IData |
dataValueEditorFactory | |
ILogger<Package |
logger | |
IFile |
fileService | |
IMacro |
macroService | |
ILocalization |
localizationService | |
IData |
dataTypeService | |
IEntity |
entityService | |
IContent |
contentTypeService | |
IContent |
contentService | |
Property |
propertyEditors | |
IScope |
scopeProvider | |
IShort |
shortStringHelper | |
IOptions<Global |
globalSettings | |
IConfiguration |
serializer | |
IMedia |
mediaService | |
IMedia |
mediaTypeService | |
IHosting |
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 |
---|---|---|
IData |
dataValueEditorFactory | |
ILogger<Package |
logger | |
IFile |
fileService | |
IMacro |
macroService | |
ILocalization |
localizationService | |
IData |
dataTypeService | |
IEntity |
entityService | |
IContent |
contentTypeService | |
IContent |
contentService | |
Property |
propertyEditors | |
IScope |
scopeProvider | |
IShort |
shortStringHelper | |
IConfiguration |
serializer | |
IMedia |
mediaService | |
IMedia |
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. |
roots | The root contents to import from |
System. |
parentId | Optional parent Id for the content being imported |
IDictionary<System. |
importedDocumentTypes | A dictionary of already imported document types (basically used as a cache) |
System. |
userId | Optional Id of the user performing the import |
IContent |
typeService | The content type base service |
IContent |
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<Compiled |
docs | |
IDictionary<System. |
importedDocumentTypes | |
System. |
userId | |
IContent |
typeService | |
IContent |
service |
Returns
Type | Description |
---|---|
IRead |
Type Parameters
Name | Description |
---|---|
TContentBase | |
TContentTypeComposition |
ImportDataTypes(IReadOnlyCollection<XElement>, Int32)
Imports and saves package xml as IData
Declaration
public IReadOnlyList<IDataType> ImportDataTypes(IReadOnlyCollection<XElement> dataTypeElements, int userId)
Parameters
Type | Name | Description |
---|---|---|
IRead |
dataTypeElements | Xml to import |
System. |
userId | Optional id of the user |
Returns
Type | Description |
---|---|
IRead |
An enumerable list of generated DataTypeDefinitions |
ImportDataTypes(IReadOnlyCollection<XElement>, Int32, out IEnumerable<EntityContainer>)
Imports and saves package xml as IData
Declaration
public IReadOnlyList<IDataType> ImportDataTypes(IReadOnlyCollection<XElement> dataTypeElements, int userId, out IEnumerable<EntityContainer> entityContainersInstalled)
Parameters
Type | Name | Description |
---|---|---|
IRead |
dataTypeElements | Xml to import |
System. |
userId | Optional id of the user |
IEnumerable<Entity |
entityContainersInstalled | Collection of entity containers installed by the package to be populated with those created in installing data types. |
Returns
Type | Description |
---|---|
IRead |
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. |
dictionaryItemElement | |
System. |
userId | |
System. |
parentId |
Returns
Type | Description |
---|---|
IEnumerable<IDictionary |
ImportDictionaryItems(IEnumerable<XElement>, Int32)
Imports and saves the 'DictionaryItems' part of the package xml as a list of IDictionary
Declaration
public IReadOnlyList<IDictionaryItem> ImportDictionaryItems(IEnumerable<XElement> dictionaryItemElementList, int userId)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<System. |
dictionaryItemElementList | Xml to import |
System. |
userId |
Returns
Type | Description |
---|---|
IRead |
An enumerable list of dictionary items |
ImportDocumentType(XElement, Int32)
Declaration
public IReadOnlyList<IContentType> ImportDocumentType(XElement docTypeElement, int userId)
Parameters
Type | Name | Description |
---|---|---|
System. |
docTypeElement | |
System. |
userId |
Returns
Type | Description |
---|---|
IRead |
ImportDocumentTypes(IEnumerable<XElement>, Int32)
Imports and saves package xml as IContent
Declaration
public IReadOnlyList<IContentType> ImportDocumentTypes(IEnumerable<XElement> docTypeElements, int userId)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<System. |
docTypeElements | Xml to import |
System. |
userId | Optional id of the User performing the operation. Default is zero (admin). |
Returns
Type | Description |
---|---|
IRead |
An enumerable list of generated ContentTypes |
ImportDocumentTypes(IEnumerable<XElement>, Int32, out IEnumerable<EntityContainer>)
Imports and saves package xml as IContent
Declaration
public IReadOnlyList<IContentType> ImportDocumentTypes(IEnumerable<XElement> docTypeElements, int userId, out IEnumerable<EntityContainer> entityContainersInstalled)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<System. |
docTypeElements | Xml to import |
System. |
userId | Optional id of the User performing the operation. Default is zero (admin). |
IEnumerable<Entity |
entityContainersInstalled | Collection of entity containers installed by the package to be populated with those created in installing data types. |
Returns
Type | Description |
---|---|
IRead |
An enumerable list of generated ContentTypes |
ImportDocumentTypes<T>(IReadOnlyCollection<XElement>, Boolean, Int32, IContentTypeBaseService<T>)
Imports and saves package xml as IContent
Declaration
public IReadOnlyList<T> ImportDocumentTypes<T>(IReadOnlyCollection<XElement> unsortedDocumentTypes, bool importStructure, int userId, IContentTypeBaseService<T> service)
where T : class, IContentTypeComposition
Parameters
Type | Name | Description |
---|---|---|
IRead |
unsortedDocumentTypes | Xml to import |
System. |
importStructure | Boolean indicating whether or not to import the |
System. |
userId | Optional id of the User performing the operation. Default is zero (admin). |
IContent |
service | The content type service. |
Returns
Type | Description |
---|---|
IRead |
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 IContent
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 |
---|---|---|
IRead |
unsortedDocumentTypes | Xml to import |
System. |
importStructure | Boolean indicating whether or not to import the |
System. |
userId | Optional id of the User performing the operation. Default is zero (admin). |
IContent |
service | The content type service |
IEnumerable<Entity |
entityContainersInstalled | Collection of entity containers installed by the package to be populated with those created in installing data types. |
Returns
Type | Description |
---|---|
IRead |
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. |
languageElements | Xml to import |
System. |
userId | Optional id of the User performing the operation |
Returns
Type | Description |
---|---|
IRead |
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. |
macroPartialViewsElements | |
System. |
userId |
Returns
Type | Description |
---|---|
IRead |
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. |
macroElements | Xml to import |
System. |
userId | Optional id of the User performing the operation |
Returns
Type | Description |
---|---|
IRead |
ImportMediaTypes(IEnumerable<XElement>, Int32)
Imports and saves package xml as IContent
Declaration
public IReadOnlyList<IMediaType> ImportMediaTypes(IEnumerable<XElement> docTypeElements, int userId)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<System. |
docTypeElements | Xml to import |
System. |
userId | Optional id of the User performing the operation. Default is zero (admin). |
Returns
Type | Description |
---|---|
IRead |
An enumerable list of generated ContentTypes |
ImportMediaTypes(IEnumerable<XElement>, Int32, out IEnumerable<EntityContainer>)
Imports and saves package xml as IContent
Declaration
public IReadOnlyList<IMediaType> ImportMediaTypes(IEnumerable<XElement> docTypeElements, int userId, out IEnumerable<EntityContainer> entityContainersInstalled)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<System. |
docTypeElements | Xml to import |
System. |
userId | Optional id of the User performing the operation. Default is zero (admin). |
IEnumerable<Entity |
entityContainersInstalled | Collection of entity containers installed by the package to be populated with those created in installing data types. |
Returns
Type | Description |
---|---|
IRead |
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. |
partialViewElements | |
System. |
userId |
Returns
Type | Description |
---|---|
IRead |
ImportScripts(IEnumerable<XElement>, Int32)
Declaration
public IReadOnlyList<IScript> ImportScripts(IEnumerable<XElement> scriptElements, int userId)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<System. |
scriptElements | |
System. |
userId |
Returns
Type | Description |
---|---|
IRead |
ImportStylesheets(IEnumerable<XElement>, Int32)
Declaration
public IReadOnlyList<IFile> ImportStylesheets(IEnumerable<XElement> stylesheetElements, int userId)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<System. |
stylesheetElements | |
System. |
userId |
Returns
Type | Description |
---|---|
IRead |
ImportTemplate(XElement, Int32)
Declaration
public IEnumerable<ITemplate> ImportTemplate(XElement templateElement, int userId)
Parameters
Type | Name | Description |
---|---|---|
System. |
templateElement | |
System. |
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 |
---|---|---|
IRead |
templateElements | Xml to import |
System. |
userId | Optional user id |
Returns
Type | Description |
---|---|
IRead |
An enumerable list of generated Templates |
InstallPackageData(CompiledPackage, Int32)
Declaration
public InstallationSummary InstallPackageData(CompiledPackage compiledPackage, int userId)
Parameters
Type | Name | Description |
---|---|---|
Compiled |
compiledPackage | |
System. |
userId |
Returns
Type | Description |
---|---|
Installation |