Search Results for

    Show / Hide Table of Contents
    View Source

    Class DocumentPublishStatusService

    Implements IDocumentPublishStatusQueryService and IDocumentPublishStatusManagementService verifying and managing the published status of documents.

    Inheritance
    object
    PublishStatusService
    Namespace: Umbraco.Cms.Core.Services.Navigation
    Assembly: Umbraco.Core.dll
    Syntax
    public class DocumentPublishStatusService : PublishStatusService, IPublishStatusManagementService, IDocumentPublishStatusManagementService, IPublishStatusQueryService, IDocumentPublishStatusQueryService

    Constructors

    View Source

    DocumentPublishStatusService(ILogger<DocumentPublishStatusService>, IPublishStatusRepository, ICoreScopeProvider, ILanguageService, IDocumentNavigationQueryService)

    Initializes a new instance of the DocumentPublishStatusService class.

    Declaration
    public DocumentPublishStatusService(ILogger<DocumentPublishStatusService> logger, IPublishStatusRepository publishStatusRepository, ICoreScopeProvider coreScopeProvider, ILanguageService languageService, IDocumentNavigationQueryService documentNavigationQueryService)
    Parameters
    Type Name Description
    ILogger<DocumentPublishStatusService> logger

    The logger for diagnostic output.

    IPublishStatusRepository publishStatusRepository

    The repository for accessing document publish status data.

    ICoreScopeProvider coreScopeProvider

    The provider for creating database scopes.

    ILanguageService languageService

    The service for retrieving language information.

    IDocumentNavigationQueryService documentNavigationQueryService

    The service for querying document navigation structure.

    Methods

    View Source

    AddOrUpdateStatusAsync(Guid, CancellationToken)

    Adds or updates the publish status for a specific document in the cache.

    Declaration
    public Task AddOrUpdateStatusAsync(Guid documentKey, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    Guid documentKey

    The unique key of the document to update.

    CancellationToken cancellationToken

    A token to cancel the operation.

    Returns
    Type Description
    Task

    A task that represents the asynchronous operation.

    View Source

    AddOrUpdateStatusWithDescendantsAsync(Guid, CancellationToken)

    Adds or updates the publish status for a document and all its descendants in the cache.

    Declaration
    public Task AddOrUpdateStatusWithDescendantsAsync(Guid rootDocumentKey, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    Guid rootDocumentKey

    The unique key of the root document.

    CancellationToken cancellationToken

    A token to cancel the operation.

    Returns
    Type Description
    Task

    A task that represents the asynchronous operation.

    View Source

    HasPublishedAncestorPath(Guid)

    Verifies if a document has a published ancestor path (i.e. all ancestors are themselves published in at least one culture).

    Declaration
    public bool HasPublishedAncestorPath(Guid contentKey)
    Parameters
    Type Name Description
    Guid contentKey
    Returns
    Type Description
    bool

    True if document has a published ancestor path.

    View Source

    HasPublishedAncestorPath(Guid, string)

    Verifies if a document has a published ancestor path (i.e. all ancestors are themselves published in the specified culture).

    Declaration
    public bool HasPublishedAncestorPath(Guid contentKey, string culture)
    Parameters
    Type Name Description
    Guid contentKey
    string culture

    The culture.

    Returns
    Type Description
    bool

    True if document has a published ancestor path.

    View Source

    InitializeAsync(CancellationToken)

    Initializes the document publish status cache by loading all published document statuses from the database.

    Declaration
    public Task InitializeAsync(CancellationToken cancellationToken)
    Parameters
    Type Name Description
    CancellationToken cancellationToken

    A token to cancel the operation.

    Returns
    Type Description
    Task

    A task that represents the asynchronous initialization operation.

    View Source

    IsPublished(Guid, string)

    Checks if a document is published in a specific culture.

    Declaration
    public bool IsPublished(Guid documentKey, string culture)
    Parameters
    Type Name Description
    Guid documentKey

    The document's key.

    string culture

    The culture.

    Returns
    Type Description
    bool

    True if document is published in the specified culture.

    View Source

    IsPublishedInAnyCulture(Guid)

    Checks if a document is published in any culture.

    Declaration
    public bool IsPublishedInAnyCulture(Guid documentKey)
    Parameters
    Type Name Description
    Guid documentKey

    The document's key.

    Returns
    Type Description
    bool

    True if document has any published culture.

    View Source

    RemoveAsync(Guid, CancellationToken)

    Removes a document from the publish status cache.

    Declaration
    public Task RemoveAsync(Guid documentKey, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    Guid documentKey

    The unique key of the document to remove.

    CancellationToken cancellationToken

    A token to cancel the operation.

    Returns
    Type Description
    Task

    A task that represents the asynchronous operation.

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