Class PublishedUrlInfoProvider
Provides the default implementation of IPublishedUrlInfoProvider: the URLs of published content for the backoffice, together with a localized explanation for every culture that has no working URL (unpublished ancestors, missing hostnames, collisions).
Inheritance
Namespace: Umbraco.Cms.Core.Routing
Assembly: Umbraco.Core.dll
Syntax
public class PublishedUrlInfoProvider : IPublishedUrlInfoProvider
Constructors
View SourcePublishedUrlInfoProvider(IPublishedUrlProvider, ILanguageService, IPublishedRouter, IUmbracoContextAccessor, ILocalizedTextService, ILogger<PublishedUrlInfoProvider>, UriUtility, IVariationContextAccessor)
Initializes a new instance of the PublishedUrlInfoProvider class.
Declaration
[Obsolete("Please use the constructor with all parameters. Scheduled for removal in Umbraco 19.")]
public PublishedUrlInfoProvider(IPublishedUrlProvider publishedUrlProvider, ILanguageService languageService, IPublishedRouter publishedRouter, IUmbracoContextAccessor umbracoContextAccessor, ILocalizedTextService localizedTextService, ILogger<PublishedUrlInfoProvider> logger, UriUtility uriUtility, IVariationContextAccessor variationContextAccessor)
Parameters
| Type | Name | Description |
|---|---|---|
| IPublishedUrlProvider | publishedUrlProvider | The published URL provider. |
| ILanguageService | languageService | The language service. |
| IPublishedRouter | publishedRouter | The published router. |
| IUmbracoContextAccessor | umbracoContextAccessor | The Umbraco context accessor. |
| ILocalizedTextService | localizedTextService | The localized text service. |
| ILogger<PublishedUrlInfoProvider> | logger | The logger. |
| UriUtility | uriUtility | The URI utility. |
| IVariationContextAccessor | variationContextAccessor | The variation context accessor. |
PublishedUrlInfoProvider(IPublishedUrlProvider, ILanguageService, IPublishedRouter, IUmbracoContextAccessor, ILocalizedTextService, ILogger<PublishedUrlInfoProvider>, UriUtility, IVariationContextAccessor, IDocumentNavigationQueryService, IPublishStatusQueryService, IPublishedContentCache, IContentService)
Initializes a new instance of the PublishedUrlInfoProvider class.
Declaration
public PublishedUrlInfoProvider(IPublishedUrlProvider publishedUrlProvider, ILanguageService languageService, IPublishedRouter publishedRouter, IUmbracoContextAccessor umbracoContextAccessor, ILocalizedTextService localizedTextService, ILogger<PublishedUrlInfoProvider> logger, UriUtility uriUtility, IVariationContextAccessor variationContextAccessor, IDocumentNavigationQueryService navigationQueryService, IPublishStatusQueryService publishStatusQueryService, IPublishedContentCache publishedContentCache, IContentService contentService)
Parameters
| Type | Name | Description |
|---|---|---|
| IPublishedUrlProvider | publishedUrlProvider | The published URL provider. |
| ILanguageService | languageService | The language service. |
| IPublishedRouter | publishedRouter | The published router. |
| IUmbracoContextAccessor | umbracoContextAccessor | The Umbraco context accessor. |
| ILocalizedTextService | localizedTextService | The localized text service. |
| ILogger<PublishedUrlInfoProvider> | logger | The logger. |
| UriUtility | uriUtility | The URI utility. |
| IVariationContextAccessor | variationContextAccessor | The variation context accessor, used to resolve names in the culture being reported. |
| IDocumentNavigationQueryService | navigationQueryService | The document navigation query service, used to walk ancestors. |
| IPublishStatusQueryService | publishStatusQueryService | The publish status query service, used to find unpublished ancestors. |
| IPublishedContentCache | publishedContentCache | The published content cache, used to name published ancestors. |
| IContentService | contentService | The content service, used to name unpublished ancestors. |
Methods
View SourceGetAllAsync(IContent)
Gets all published urls for a content item.
Declaration
public Task<ISet<UrlInfo>> GetAllAsync(IContent content)
Parameters
| Type | Name | Description |
|---|---|---|
| IContent | content | The content to get urls for. |
Returns
| Type | Description |
|---|---|
| Task<ISet<UrlInfo>> | Set of all published url infos. |
GetAllAsync(IContent, string?)
Gets the published urls for a content item, optionally restricted to a single culture.
Declaration
public Task<ISet<UrlInfo>> GetAllAsync(IContent content, string? culture)
Parameters
| Type | Name | Description |
|---|---|---|
| IContent | content | The content to get urls for. |
| string | culture | The culture to restrict variant content urls to, or |
Returns
| Type | Description |
|---|---|
| Task<ISet<UrlInfo>> | Set of published url infos. |