View Source
Class PackagingService
Represents the Packaging Service, which provides import/export functionality for the Core models of the API
using xml representation. This is primarily used by the Package functionality.
Inheritance
System.Object
Assembly: Umbraco.Core.dll
Syntax
public class PackagingService : IPackagingService, IService
Constructors
View Source
PackagingService(IAuditService, ICreatedPackagesRepository, IInstalledPackagesRepository, IPackageInstallation)
Declaration
public PackagingService(IAuditService auditService, ICreatedPackagesRepository createdPackages, IInstalledPackagesRepository installedPackages, IPackageInstallation packageInstallation)
Parameters
Methods
View Source
DeleteCreatedPackage(Int32, Int32)
Declaration
public void DeleteCreatedPackage(int id, int userId = -1)
Parameters
Type |
Name |
Description |
System.Int32 |
id |
|
System.Int32 |
userId |
|
View Source
DeleteInstalledPackage(Int32, Int32)
Declaration
public void DeleteInstalledPackage(int packageId, int userId = -1)
Parameters
Type |
Name |
Description |
System.Int32 |
packageId |
|
System.Int32 |
userId |
|
View Source
ExportCreatedPackage(PackageDefinition)
Declaration
public string ExportCreatedPackage(PackageDefinition definition)
Parameters
Returns
Type |
Description |
System.String |
|
View Source
FetchPackageFileAsync(Guid, Version, Int32)
This will fetch an Umbraco package file from the package repository and return the file name of the downloaded package
Declaration
public async Task<FileInfo> FetchPackageFileAsync(Guid packageId, Version umbracoVersion, int userId)
Parameters
Type |
Name |
Description |
System.Guid |
packageId |
|
System.Version |
umbracoVersion |
|
System.Int32 |
userId |
The current user id performing the operation
|
Returns
Type |
Description |
System.Threading.Tasks.Task<System.IO.FileInfo> |
The file name of the downloaded package which will exist in ~/App_Data/packages
|
View Source
GetAllCreatedPackages()
Declaration
public IEnumerable<PackageDefinition> GetAllCreatedPackages()
Returns
View Source
GetAllInstalledPackages()
Declaration
public IEnumerable<PackageDefinition> GetAllInstalledPackages()
Returns
View Source
GetCompiledPackageInfo(FileInfo)
Declaration
public CompiledPackage GetCompiledPackageInfo(FileInfo packageFile)
Parameters
Type |
Name |
Description |
System.IO.FileInfo |
packageFile |
|
Returns
View Source
GetCreatedPackageById(Int32)
Declaration
public PackageDefinition GetCreatedPackageById(int id)
Parameters
Type |
Name |
Description |
System.Int32 |
id |
|
Returns
View Source
GetInstalledPackageById(Int32)
Declaration
public PackageDefinition GetInstalledPackageById(int id)
Parameters
Type |
Name |
Description |
System.Int32 |
id |
|
Returns
View Source
GetInstalledPackageByName(String)
Declaration
public IEnumerable<PackageDefinition> GetInstalledPackageByName(string name)
Parameters
Type |
Name |
Description |
System.String |
name |
|
Returns
View Source
GetPackageInstallType(String, SemVersion, out PackageDefinition)
Declaration
public PackageInstallType GetPackageInstallType(string packageName, SemVersion packageVersion, out PackageDefinition alreadyInstalled)
Parameters
Type |
Name |
Description |
System.String |
packageName |
|
SemVersion |
packageVersion |
|
PackageDefinition |
alreadyInstalled |
|
Returns
View Source
InstallCompiledPackageData(PackageDefinition, FileInfo, Int32)
Declaration
public InstallationSummary InstallCompiledPackageData(PackageDefinition packageDefinition, FileInfo packageFile, int userId = -1)
Parameters
Type |
Name |
Description |
PackageDefinition |
packageDefinition |
|
System.IO.FileInfo |
packageFile |
|
System.Int32 |
userId |
|
Returns
View Source
InstallCompiledPackageFiles(PackageDefinition, FileInfo, Int32)
Declaration
public IEnumerable<string> InstallCompiledPackageFiles(PackageDefinition packageDefinition, FileInfo packageFile, int userId = -1)
Parameters
Type |
Name |
Description |
PackageDefinition |
packageDefinition |
|
System.IO.FileInfo |
packageFile |
|
System.Int32 |
userId |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<System.String> |
|
View Source
SaveCreatedPackage(PackageDefinition)
Declaration
public bool SaveCreatedPackage(PackageDefinition definition)
Parameters
Returns
Type |
Description |
System.Boolean |
|
View Source
SaveInstalledPackage(PackageDefinition)
Declaration
public bool SaveInstalledPackage(PackageDefinition definition)
Parameters
Returns
Type |
Description |
System.Boolean |
|
View Source
UninstallPackage(String, Int32)
Declaration
public UninstallationSummary UninstallPackage(string packageName, int userId = -1)
Parameters
Type |
Name |
Description |
System.String |
packageName |
|
System.Int32 |
userId |
|
Returns
Events
View Source
ImportedPackage
Occurs after a package is imported
Declaration
public static event TypedEventHandler<IPackagingService, ImportPackageEventArgs<InstallationSummary>> ImportedPackage
Event Type
View Source
ImportingPackage
Occurs before Importing umbraco package
Declaration
public static event TypedEventHandler<IPackagingService, ImportPackageEventArgs<string>> ImportingPackage
Event Type
View Source
UninstalledPackage
Occurs after a package is uninstalled
Declaration
public static event TypedEventHandler<IPackagingService, UninstallPackageEventArgs> UninstalledPackage
Event Type