November Happy Hour will be moved to Thursday December 5th.

Class ContentProviderMap

Class that handles routing/calls to all content providers.

Inheritance
System.Object
ContentProviderMap
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.Core
Assembly: EPiServer.dll
Version: 8.11.0
Syntax
public class ContentProviderMap

Constructors

ContentProviderMap(PermanentContentLinkMapper)

Initializes a new instance of the ContentProviderMap class initialized with specified providers.

Declaration
public ContentProviderMap(PermanentContentLinkMapper pageLinkMapStore)
Parameters
Type Name Description
PermanentContentLinkMapper pageLinkMapStore

The link mapper.

Remarks

When using this constructor the class also needs to be explicitly initialized using Initialize(ProviderSettingsCollection).

Properties

CustomProvidersExist

Gets a value indicating whether there exist other providers than Default provider

Declaration
public bool CustomProvidersExist { get; }
Property Value
Type Description
System.Boolean

true if other providers than Default provider otherwise, false.

Methods

AddProvider(ContentProvider)

Adds a content provider including entry points for the content provider to the map.

Declaration
public virtual void AddProvider(ContentProvider provider)
Parameters
Type Name Description
ContentProvider provider

The content provider.

GetDefaultProvider()

Gets the default provider, that is the provider that is registered with key String.Empty.

Declaration
public virtual ContentProvider GetDefaultProvider()
Returns
Type Description
ContentProvider

Default content provider

GetProvider(ContentReference)

Gets the content provider that serves the content specified by the given content reference

Declaration
public virtual ContentProvider GetProvider(ContentReference contentLink)
Parameters
Type Name Description
ContentReference contentLink

The content link.

Returns
Type Description
ContentProvider

GetProvider(String)

Gets the content provider instance registered with given id.

Declaration
public virtual ContentProvider GetProvider(string providerId)
Parameters
Type Name Description
System.String providerId

The provider id.

Returns
Type Description
ContentProvider

The content provider registered with the given id

GetStartPage(ContentReference)

Gets the start page for the site serving the page.

Declaration
[Obsolete("Use SiteDefinitionResolver instead")]
public PageReference GetStartPage(ContentReference contentLink)
Parameters
Type Name Description
ContentReference contentLink

The content link.

Returns
Type Description
PageReference
Exceptions
Type Condition
System.ArgumentException

is thrown if no content provider is registered with given RemoteSite given in contentLink

Initialize(ProviderSettingsCollection)

Initializes the provider map with the given data factory and builds up the page providers.

Declaration
public void Initialize(ProviderSettingsCollection contentProviders)
Parameters
Type Name Description
System.Configuration.ProviderSettingsCollection contentProviders

The page provider configuration.

IsEntryPoint(ContentReference)

Determines whether the specified contentLink is registered as an entrypoint

Declaration
public bool IsEntryPoint(ContentReference contentLink)
Parameters
Type Name Description
ContentReference contentLink

The content link.

Returns
Type Description
System.Boolean

true if the specified contentLink is registered as a content provider; otherwise, false.

Iterate(Action<ContentProvider>)

Method that let passed in delegate operate on each registered content provider

Declaration
public void Iterate(Action<ContentProvider> contentProviderHandler)
Parameters
Type Name Description
System.Action<ContentProvider> contentProviderHandler

The content provider handler.

Iterate(Func<ContentProvider, Boolean>)

Method that let passed in delegate operate on each registered content provider

Declaration
public void Iterate(Func<ContentProvider, bool> contentProviderFunction)
Parameters
Type Name Description
System.Func<ContentProvider, System.Boolean> contentProviderFunction

The delegate function called for each provider. If function returns true the iteration is stopped.

RemoveProvider(String)

Remove any loaded ContentProvider

Declaration
public virtual bool RemoveProvider(string providerName)
Parameters
Type Name Description
System.String providerName

Name of the provider.

Returns
Type Description
System.Boolean

True if remove succeded

Extension Methods