Search Results for

    Show / Hide Table of Contents
    View Source

    Class PackagesRepository

    Manages the storage of installed/created package definitions

    Inheritance
    object
    Namespace: Umbraco.Cms.Core.Packaging
    Assembly: Umbraco.Core.dll
    Syntax
    [Obsolete("Packages have now been moved to the database instead of local files, please use CreatedPackageSchemaRepository instead")]
    public class PackagesRepository : ICreatedPackagesRepository, IPackageDefinitionRepository

    Constructors

    View Source

    PackagesRepository(IContentService, IContentTypeService, IDataTypeService, IFileService, ILocalizationService, IHostingEnvironment, IEntityXmlSerializer, IOptions<GlobalSettings>, IMediaService, IMediaTypeService, MediaFileManager, FileSystems, string, string?, string?, string?)

    Constructor

    Declaration
    public PackagesRepository(IContentService contentService, IContentTypeService contentTypeService, IDataTypeService dataTypeService, IFileService fileService, 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)
    Parameters
    Type Name Description
    IContentService contentService
    IContentTypeService contentTypeService
    IDataTypeService dataTypeService
    IFileService fileService
    ILocalizationService languageService
    IHostingEnvironment hostingEnvironment
    IEntityXmlSerializer serializer
    IOptions<GlobalSettings> globalSettings
    IMediaService mediaService
    IMediaTypeService mediaTypeService
    MediaFileManager mediaFileManager
    FileSystems fileSystems
    string packageRepositoryFileName

    The file name for storing the package definitions (i.e. "createdPackages.config")

    string tempFolderPath
    string packagesFolderPath
    string mediaFolderPath

    Methods

    View Source

    Delete(int)

    Deletes a package definition from storage.

    Declaration
    public void Delete(int id)
    Parameters
    Type Name Description
    int id

    The identifier of the package definition to delete.

    View Source

    DeleteLocalRepositoryFiles()

    Deletes the local repository files including the packages configuration file and folder.

    Declaration
    public void DeleteLocalRepositoryFiles()
    View Source

    ExportPackage(PackageDefinition)

    Creates the package file and returns it's physical path

    Declaration
    public string ExportPackage(PackageDefinition definition)
    Parameters
    Type Name Description
    PackageDefinition definition
    Returns
    Type Description
    string
    View Source

    GetAll()

    Gets all package definitions from storage.

    Declaration
    public IEnumerable<PackageDefinition?> GetAll()
    Returns
    Type Description
    IEnumerable<PackageDefinition>

    An enumerable collection of all PackageDefinition instances.

    View Source

    GetById(int)

    Gets a package definition by its integer identifier.

    Declaration
    public PackageDefinition? GetById(int id)
    Parameters
    Type Name Description
    int id

    The identifier of the package definition.

    Returns
    Type Description
    PackageDefinition

    The PackageDefinition if found; otherwise, null.

    View Source

    GetByKey(Guid)

    Gets a package definition by its unique key.

    Declaration
    public PackageDefinition? GetByKey(Guid key)
    Parameters
    Type Name Description
    Guid key

    The unique key of the package definition.

    Returns
    Type Description
    PackageDefinition

    The PackageDefinition if found; otherwise, null.

    Remarks

    Default implementation returns null as the class is obsolete.

    View Source

    SavePackage(PackageDefinition)

    Persists a package definition to storage.

    Declaration
    public bool SavePackage(PackageDefinition definition)
    Parameters
    Type Name Description
    PackageDefinition definition

    The package definition to save.

    Returns
    Type Description
    bool

    true if creating/updating the package was successful; otherwise, false.

    • View Source
    In this article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX