Interface IWebPageUrlRetriever
Retrieves URLs of web pages.
public interface IWebPageUrlRetriever
- Extension Methods
Methods
Retrieve(IWebPageFieldsSource, string, CancellationToken)
Retrieves URL for a web page represented by a model that implements IWebPageFieldsSource interface and for the languageName.
Task<WebPageUrl> Retrieve(IWebPageFieldsSource webPageFieldsSource, string languageName, CancellationToken cancellationToken = default)
Parameters
webPageFieldsSourceIWebPageFieldsSourceWeb page model that implements IWebPageFieldsSource with data retrieved from the database.
languageNamestringLanguage code.
cancellationTokenCancellationTokenCancellation instruction.
Returns
- Task<WebPageUrl>
Remarks
In case the languageName doesn't match the language of the model, the URL is retrieved from the database for the languageName.
To construct the resulting URL use ForWebsite(ContentTypeQueryParameters, string, PathMatch, bool) or ForWebsite(ContentTypeQueryParameters, string, PathMatch[], bool)
with 'includeUrlPath' flag set to true.
Exceptions
- ArgumentNullException
Thrown when
webPageFieldsSourceis null.- ArgumentException
Thrown when SystemFields in
webPageFieldsSourceis null.- InvalidOperationException
Thrown when
webPageFieldsSourcemodel does not contain web page identifier specified in SystemFields system data. Thrown when content language identified bylanguageNamedoes not exist. Thrown when web page identified by WebPageItemID in SystemFields does not exist.
Retrieve(IWebPageFieldsSource, CancellationToken)
Retrieves URL for a web page represented by a model that implements IWebPageFieldsSource interface.
Task<WebPageUrl> Retrieve(IWebPageFieldsSource webPageFieldsSource, CancellationToken cancellationToken = default)
Parameters
webPageFieldsSourceIWebPageFieldsSourceWeb page model that implements IWebPageFieldsSource with data retrieved from the database.
cancellationTokenCancellationTokenCancellation instruction.
Returns
- Task<WebPageUrl>
Remarks
To construct the resulting URL use ForWebsite(ContentTypeQueryParameters, string, PathMatch, bool) or ForWebsite(ContentTypeQueryParameters, string, PathMatch[], bool)
with 'includeUrlPath' flag set to true.
Exceptions
- ArgumentNullException
Thrown when
webPageFieldsSourceis null.- ArgumentException
Thrown when SystemFields in
webPageFieldsSourceis null.- InvalidOperationException
Thrown when
webPageFieldsSourcemodel does not contain web page identifier or content language identifier specified in SystemFields system data. Thrown when web page identified by WebPageItemID in SystemFields does not exist.
Retrieve(IReadOnlyCollection<Guid>, string, string, bool, CancellationToken)
Retrieves the URLs for a web page language variants identified by webPageItemGuids, websiteChannelName and languageName.
Task<IDictionary<Guid, WebPageUrl>> Retrieve(IReadOnlyCollection<Guid> webPageItemGuids, string websiteChannelName, string languageName, bool forPreview = false, CancellationToken cancellationToken = default)
Parameters
webPageItemGuidsIReadOnlyCollection<Guid>Web page item identifiers.
websiteChannelNamestringWebsite channel name.
languageNamestringLanguage code.
forPreviewboolIndicates whether the latest version of the URL should be retrieved. The default value is
false.cancellationTokenCancellationTokenCancellation instruction.
Returns
- Task<IDictionary<Guid, WebPageUrl>>
Remarks
The method doesn't cache the retrieved URLs.
Exceptions
- ArgumentNullException
Thrown when
webPageItemGuids,languageNameorwebsiteChannelNameis null.- InvalidOperationException
Thrown when website channel identified by
websiteChannelNameor when content language identified bylanguageNamedoes not exists.
Retrieve(Guid, string, bool, CancellationToken)
Retrieves the URL for a web page language variant identified by webPageItemGuid and languageName.
Task<WebPageUrl> Retrieve(Guid webPageItemGuid, string languageName, bool forPreview = false, CancellationToken cancellationToken = default)
Parameters
webPageItemGuidGuidWeb page item identifier.
languageNamestringLanguage code.
forPreviewboolIndicates whether the latest version of the URL should be retrieved. The default value is
false.cancellationTokenCancellationTokenCancellation instruction.
Returns
- Task<WebPageUrl>
Remarks
The method caches the retrieved URL unless retrieving the latest version of the URL for preview.
Exceptions
- ArgumentNullException
Thrown when
languageNameis null.- InvalidOperationException
Thrown when web page identified by
webPageItemGuidor when content language identified bylanguageNamedoes not exists.
Retrieve(int, string, bool, CancellationToken)
Retrieves the URL for a web page language variant identified by webPageItemId and languageName.
Task<WebPageUrl> Retrieve(int webPageItemId, string languageName, bool forPreview = false, CancellationToken cancellationToken = default)
Parameters
webPageItemIdintWeb page item identifier.
languageNamestringLanguage code.
forPreviewboolIndicates whether the latest version of the URL should be retrieved. The default value is
false.cancellationTokenCancellationTokenCancellation instruction.
Returns
- Task<WebPageUrl>
Remarks
The method caches the retrieved URL unless retrieving the latest version of the URL for preview.
Exceptions
- ArgumentNullException
Thrown when
languageNameis null.- InvalidOperationException
Thrown when web page identified by
webPageItemIdor when content language identified bylanguageNamedoes not exists.
Retrieve(string, string, int, string, CancellationToken)
Retrieves URL for a web page represented by webPageUrlPath, webPageTreePath, websiteChannelId and languageName.
Task<WebPageUrl> Retrieve(string webPageUrlPath, string webPageTreePath, int websiteChannelId, string languageName, CancellationToken cancellationToken = default)
Parameters
webPageUrlPathstringWeb page URL path.
webPageTreePathstringWeb page tree path.
websiteChannelIdintWebsite channel identifier.
languageNamestringLanguage code.
cancellationTokenCancellationTokenCancellation instruction.
Returns
- Task<WebPageUrl>
Remarks
To construct the resulting URL use ForWebsite(ContentTypeQueryParameters, string, PathMatch, bool) or ForWebsite(ContentTypeQueryParameters, string, PathMatch[], bool)
with 'includeUrlPath' flag set to true.
Exceptions
- InvalidOperationException
Thrown when
webPageTreePathis null or empty. Thrown when website channel identified bywebsiteChannelIddoes not exist. Thrown when content language identified bylanguageNamedoes not exist.- ArgumentNullException
Thrown when
languageNameis null.
Retrieve(string, string, string, bool, CancellationToken)
Retrieves the URL for a web page language variant identified by webPageTreePath, websiteChannelName and languageName.
Task<WebPageUrl> Retrieve(string webPageTreePath, string websiteChannelName, string languageName, bool forPreview = false, CancellationToken cancellationToken = default)
Parameters
webPageTreePathstringWeb page tree path.
websiteChannelNamestringWebsite channel name.
languageNamestringLanguage code.
forPreviewboolIndicates whether the latest version of the URL should be retrieved. The default value is
false.cancellationTokenCancellationTokenCancellation instruction.
Returns
- Task<WebPageUrl>
Remarks
The method caches the retrieved URL unless retrieving the latest version of the URL for preview.
Exceptions
- ArgumentNullException
Thrown when
languageName,webPageTreePathorwebsiteChannelNameis null.- InvalidOperationException
Thrown when web page identified by
webPageTreePathor when website channel identified bywebsiteChannelNameor when content language identified bylanguageNamedoes not exists.