Search Results for

    Show / Hide Table of Contents
    View Source

    Class PublishStatusService

    Abstract base class for publish status services, providing shared cache logic for tracking which content items are published and in which cultures.

    Inheritance
    object
    Namespace: Umbraco.Cms.Core.Services.Navigation
    Assembly: Umbraco.Core.dll
    Syntax
    public abstract class PublishStatusService

    Constructors

    View Source

    PublishStatusService(UmbracoObjectTypes, ILogger)

    Initializes a new instance of the PublishStatusService class.

    Declaration
    protected PublishStatusService(UmbracoObjectTypes entityType, ILogger logger)
    Parameters
    Type Name Description
    UmbracoObjectTypes entityType

    The object type this service tracks publish status for.

    ILogger logger

    The logger for diagnostic output.

    Properties

    View Source

    DefaultCulture

    Gets or sets the default culture ISO code used when no culture is specified.

    Declaration
    protected string? DefaultCulture { get; set; }
    Property Value
    Type Description
    string

    Methods

    View Source

    IsPublished(Guid, string)

    Checks if an item is published in a specific culture.

    Declaration
    protected bool IsPublished(Guid key, string culture)
    Parameters
    Type Name Description
    Guid key

    The item's key.

    string culture

    The culture to check.

    Returns
    Type Description
    bool

    true if the item is published in the specified culture; otherwise, false.

    View Source

    IsPublishedInAnyCulture(Guid)

    Checks if an item is published in any culture.

    Declaration
    protected bool IsPublishedInAnyCulture(Guid key)
    Parameters
    Type Name Description
    Guid key

    The item's key.

    Returns
    Type Description
    bool

    true if the item has any published culture; otherwise, false.

    View Source

    PopulateCache(IDictionary<Guid, ISet<string>>)

    Populates the cache from a dictionary of publish statuses, replacing any existing entries.

    Declaration
    protected void PopulateCache(IDictionary<Guid, ISet<string>> publishStatus)
    Parameters
    Type Name Description
    IDictionary<Guid, ISet<string>> publishStatus

    A dictionary mapping item keys to their published culture codes.

    View Source

    RemoveStatus(Guid)

    Removes an item from the publish status cache.

    Declaration
    protected void RemoveStatus(Guid key)
    Parameters
    Type Name Description
    Guid key

    The item's key.

    View Source

    SetStatus(Guid, ISet<string>)

    Adds or updates the publish status for a single item in the cache.

    Declaration
    protected void SetStatus(Guid key, ISet<string> publishedCultures)
    Parameters
    Type Name Description
    Guid key

    The item's key.

    ISet<string> publishedCultures

    The set of culture codes for which the item is published.

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