Search Results for

    Show / Hide Table of Contents
    View Source

    Interface IDocumentUrlService

    Defines operations for handling document URLs.

    Namespace: Umbraco.Cms.Core.Services
    Assembly: Umbraco.Core.dll
    Syntax
    public interface IDocumentUrlService

    Methods

    View Source

    CreateOrUpdateUrlSegmentsAsync(IEnumerable<IContent>)

    Creates or updates the URL segments for a collection of documents.

    Declaration
    Task CreateOrUpdateUrlSegmentsAsync(IEnumerable<IContent> documents)
    Parameters
    Type Name Description
    IEnumerable<IContent> documents

    The document collection.

    Returns
    Type Description
    Task
    View Source

    CreateOrUpdateUrlSegmentsAsync(Guid)

    Creates or updates the URL segments for a single document.

    Declaration
    Task CreateOrUpdateUrlSegmentsAsync(Guid key)
    Parameters
    Type Name Description
    Guid key

    The document key.

    Returns
    Type Description
    Task
    View Source

    CreateOrUpdateUrlSegmentsWithDescendantsAsync(Guid)

    Creates or updates the URL segments for a document and it's descendants.

    Declaration
    Task CreateOrUpdateUrlSegmentsWithDescendantsAsync(Guid key)
    Parameters
    Type Name Description
    Guid key

    The document key.

    Returns
    Type Description
    Task
    View Source

    DeleteUrlsFromCacheAsync(IEnumerable<Guid>)

    Deletes all URLs from the cache for a collection of document keys.

    Declaration
    Task DeleteUrlsFromCacheAsync(IEnumerable<Guid> documentKeys)
    Parameters
    Type Name Description
    IEnumerable<Guid> documentKeys

    The collection of document keys.

    Returns
    Type Description
    Task
    View Source

    GetDocumentKeyByRoute(string, string?, int?, bool)

    Gets a document key by route.

    Declaration
    Guid? GetDocumentKeyByRoute(string route, string? culture, int? documentStartNodeId, bool isDraft)
    Parameters
    Type Name Description
    string route

    The route.

    string culture

    The culture code.

    int? documentStartNodeId

    The document start node Id.

    bool isDraft

    Whether to get the url of the draft or published document.

    Returns
    Type Description
    Guid?

    The document key, or null if not found.

    View Source

    GetDocumentKeyByUri(Uri, bool)

    Gets a document key by System.Uri.

    Declaration
    Guid? GetDocumentKeyByUri(Uri uri, bool isDraft)
    Parameters
    Type Name Description
    Uri uri

    The uniform resource identifier.

    bool isDraft

    Whether to get the url of the draft or published document.

    Returns
    Type Description
    Guid?

    The document key, or null if not found.

    View Source

    GetLegacyRouteFormat(Guid, string?, bool)

    Gets the legacy route format for a document key and culture.

    Declaration
    string GetLegacyRouteFormat(Guid key, string? culture, bool isDraft)
    Parameters
    Type Name Description
    Guid key

    The key of the document.

    string culture

    The culture code.

    bool isDraft

    Whether to get the url of the draft or published document.

    Returns
    Type Description
    string
    View Source

    GetUrlSegment(Guid, string, bool)

    Gets a single URL segment from a document key and culture. Preview urls are returned if isDraft is true.

    Declaration
    string? GetUrlSegment(Guid documentKey, string culture, bool isDraft)
    Parameters
    Type Name Description
    Guid documentKey

    The key of the document.

    string culture

    The culture code.

    bool isDraft

    Whether to get the url of the draft or published document.

    Returns
    Type Description
    string

    A URL segment for the document.

    Remarks

    If more than one segment is available, the first retrieved and indicated as primary will be returned.

    View Source

    GetUrlSegments(Guid, string, bool)

    Gets the URL segments from a document key and culture. Preview urls are returned if isDraft is true.

    Declaration
    IEnumerable<string> GetUrlSegments(Guid documentKey, string culture, bool isDraft)
    Parameters
    Type Name Description
    Guid documentKey

    The key of the document.

    string culture

    The culture code.

    bool isDraft

    Whether to get the url of the draft or published document.

    Returns
    Type Description
    IEnumerable<string>

    The URL segments for the document.

    View Source

    HasAny()

    Gets a value indicating whether any URLs have been cached.

    Declaration
    bool HasAny()
    Returns
    Type Description
    bool
    View Source

    InitAsync(bool, CancellationToken)

    Initializes the service and ensure the content in the database is correct with the current configuration.

    Declaration
    Task InitAsync(bool forceEmpty, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    bool forceEmpty

    Forces an early return when we know there are no routes (i.e. on install).

    CancellationToken cancellationToken

    The cancellation token.

    Returns
    Type Description
    Task
    View Source

    RebuildAllUrlsAsync()

    Rebuilds all document URLs.

    Declaration
    Task RebuildAllUrlsAsync()
    Returns
    Type Description
    Task
    • Edit this page
    • View Source
    In this article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX