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
Namespace: Umbraco.Cms.Core.Services.Navigation
Assembly: Umbraco.Core.dll
Syntax
public abstract class PublishStatusService
Constructors
View SourcePublishStatusService(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 SourceDefaultCulture
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 SourceIsPublished(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 |
|
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 |
|
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. |
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. |
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. |