Interface IPackagingService
Provides operations for installing, exporting, and managing Umbraco packages.
Namespace: Umbraco.Cms.Core.Services
Assembly: Umbraco.Core.dll
Syntax
public interface IPackagingService : IService
Methods
View SourceCreateCreatedPackageAsync(PackageDefinition, Guid)
Creates a new package.
Declaration
Task<Attempt<PackageDefinition, PackageOperationStatus>> CreateCreatedPackageAsync(PackageDefinition package, Guid userKey)
Parameters
| Type | Name | Description |
|---|---|---|
| PackageDefinition | package | PackageDefinitionmodel for the package to create. |
| Guid | userKey | Key of the user performing the create. |
Returns
| Type | Description |
|---|---|
| Task<Attempt<PackageDefinition, PackageOperationStatus>> |
DeleteCreatedPackageAsync(Guid, Guid)
Deletes a created package by key.
Declaration
Task<Attempt<PackageDefinition?, PackageOperationStatus>> DeleteCreatedPackageAsync(Guid key, Guid userKey)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | key | The key of the package. |
| Guid | userKey | Key of the user deleting the package. |
Returns
| Type | Description |
|---|---|
| Task<Attempt<PackageDefinition, PackageOperationStatus>> |
ExportCreatedPackage(PackageDefinition)
Creates the package file and returns it's physical path
Declaration
string ExportCreatedPackage(PackageDefinition definition)
Parameters
| Type | Name | Description |
|---|---|---|
| PackageDefinition | definition |
Returns
| Type | Description |
|---|---|
| string |
GetAllInstalledPackagesAsync()
Returns the advertised installed packages
Declaration
Task<IEnumerable<InstalledPackage>> GetAllInstalledPackagesAsync()
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<InstalledPackage>> |
GetCompiledPackageInfo(XDocument)
Returns a CompiledPackage result from an umbraco package file (zip)
Declaration
CompiledPackage GetCompiledPackageInfo(XDocument packageXml)
Parameters
| Type | Name | Description |
|---|---|---|
| XDocument | packageXml |
Returns
| Type | Description |
|---|---|
| CompiledPackage |
GetCreatedPackageById(int)
Returns a created package by id
Declaration
PackageDefinition? GetCreatedPackageById(int id)
Parameters
| Type | Name | Description |
|---|---|---|
| int | id |
Returns
| Type | Description |
|---|---|
| PackageDefinition |
GetCreatedPackageByKeyAsync(Guid)
Returns a created package by key.
Declaration
Task<PackageDefinition?> GetCreatedPackageByKeyAsync(Guid key)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | key | The key of the package. |
Returns
| Type | Description |
|---|---|
| Task<PackageDefinition> | The package or null if the package was not found. |
GetCreatedPackagesAsync(int, int)
Returns the created packages as a paged model.
Declaration
Task<PagedModel<PackageDefinition>> GetCreatedPackagesAsync(int skip, int take)
Parameters
| Type | Name | Description |
|---|---|---|
| int | skip | The amount of items to skip. |
| int | take | The amount of items to take. |
Returns
| Type | Description |
|---|---|
| Task<PagedModel<PackageDefinition>> |
GetInstalledPackageByName(string)
Gets an installed package by its name.
Declaration
InstalledPackage? GetInstalledPackageByName(string packageName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | packageName | The name of the package. |
Returns
| Type | Description |
|---|---|
| InstalledPackage | The InstalledPackage if found; otherwise, |
GetInstalledPackagesFromMigrationPlansAsync(int, int)
Returns installed packages collected from the package migration plans.
Declaration
Task<PagedModel<InstalledPackage>> GetInstalledPackagesFromMigrationPlansAsync(int skip, int take)
Parameters
| Type | Name | Description |
|---|---|---|
| int | skip | |
| int | take |
Returns
| Type | Description |
|---|---|
| Task<PagedModel<InstalledPackage>> |
GetPackageFileStream(PackageDefinition)
Gets the package file stream.
Declaration
Stream? GetPackageFileStream(PackageDefinition definition)
Parameters
| Type | Name | Description |
|---|---|---|
| PackageDefinition | definition |
Returns
| Type | Description |
|---|---|
| Stream |
InstallCompiledPackageData(FileInfo, int)
Installs the data, entities, objects contained in an umbraco package file (zip)
Declaration
InstallationSummary InstallCompiledPackageData(FileInfo packageXmlFile, int userId = -1)
Parameters
| Type | Name | Description |
|---|---|---|
| FileInfo | packageXmlFile | |
| int | userId |
Returns
| Type | Description |
|---|---|
| InstallationSummary |
InstallCompiledPackageData(XDocument?, int)
Installs the data, entities, objects contained in an umbraco package XML document.
Declaration
InstallationSummary InstallCompiledPackageData(XDocument? packageXml, int userId = -1)
Parameters
| Type | Name | Description |
|---|---|---|
| XDocument | packageXml | The package XML document. |
| int | userId | The user identifier performing the installation. |
Returns
| Type | Description |
|---|---|
| InstallationSummary | An InstallationSummary containing the results of the installation. |
UpdateCreatedPackageAsync(PackageDefinition, Guid)
Updates a created package.
Declaration
Task<Attempt<PackageDefinition, PackageOperationStatus>> UpdateCreatedPackageAsync(PackageDefinition package, Guid userKey)
Parameters
| Type | Name | Description |
|---|---|---|
| PackageDefinition | package | PackageDefinitionmodel for the package to update. |
| Guid | userKey | Key of the user performing the update. |
Returns
| Type | Description |
|---|---|
| Task<Attempt<PackageDefinition, PackageOperationStatus>> |