Class CatalogContentProvider
Content provider for Commerce object
Inheritance
Namespace: EPiServer.Commerce.Catalog.Provider
Assembly: EPiServer.Business.Commerce.dll
Version: 12.17.2Syntax
public class CatalogContentProvider : ContentProvider
Constructors
CatalogContentProvider()
Initializes a new instance of the CatalogContentProvider class.
Declaration
public CatalogContentProvider()
CatalogContentProvider(IContentLoader, CatalogContentLoader, ReferenceConverter, CatalogContentMoveHandler, IPriceService, IInventoryService, ICatalogSystem, ISynchronizedObjectInstanceCache, CatalogContentCommitterHandler, CatalogContentVersionStore, ContentGuidAdmin, CatalogContentDB, IContentCacheKeyCreator)
Initializes a new instance of the CatalogContentProvider class.
Declaration
[Obsolete("Use constructor without IRelationRepository instead. Will remain at least until July 2018.")]
public CatalogContentProvider(IContentLoader contentLoader, CatalogContentLoader catalogContentLoader, ReferenceConverter referenceConverter, CatalogContentMoveHandler catalogContentMoveHandler, IPriceService priceService, IInventoryService inventoryService, ICatalogSystem catalogSystem, ISynchronizedObjectInstanceCache objectInstanceCache, CatalogContentCommitterHandler catalogContentCommitterHandler, CatalogContentVersionStore contentVersionStore, ContentGuidAdmin contentGuidAdmin, CatalogContentDB catalogContentDB, IContentCacheKeyCreator contentCacheKeyCreator)
Parameters
| Type | Name | Description |
|---|---|---|
| EPiServer.IContentLoader | contentLoader | The content loader. |
| CatalogContentLoader | catalogContentLoader | The catalog content loader. |
| ReferenceConverter | referenceConverter | The reference converter. |
| CatalogContentMoveHandler | catalogContentMoveHandler | The catalog content move handler. |
| IPriceService | priceService | The price service. |
| IInventoryService | inventoryService | The inventory service. |
| ICatalogSystem | catalogSystem | The catalog system. |
| EPiServer.Framework.Cache.ISynchronizedObjectInstanceCache | objectInstanceCache | The object instance cache. |
| CatalogContentCommitterHandler | catalogContentCommitterHandler | The committer to commit changes to the ECF database. |
| CatalogContentVersionStore | contentVersionStore | The catalog content version store. |
| ContentGuidAdmin | contentGuidAdmin | The catalog guid admin. |
| CatalogContentDB | catalogContentDB | The catalog content DB. |
| EPiServer.Core.IContentCacheKeyCreator | contentCacheKeyCreator | Handles generation of Cache keys. |
CatalogContentProvider(IContentLoader, CatalogContentLoader, ReferenceConverter, CatalogContentMoveHandler, IPriceService, IInventoryService, ICatalogSystem, ISynchronizedObjectInstanceCache, CatalogContentCommitterHandler, CatalogContentVersionStore, ContentGuidAdmin, CatalogContentDB, IContentCacheKeyCreator, IRelationRepository)
Initializes a new instance of the CatalogContentProvider class.
Declaration
[Obsolete("Use constructor without IRelationRepository instead. Will remain at least until January 2019.")]
public CatalogContentProvider(IContentLoader contentLoader, CatalogContentLoader catalogContentLoader, ReferenceConverter referenceConverter, CatalogContentMoveHandler catalogContentMoveHandler, IPriceService priceService, IInventoryService inventoryService, ICatalogSystem catalogSystem, ISynchronizedObjectInstanceCache objectInstanceCache, CatalogContentCommitterHandler catalogContentCommitterHandler, CatalogContentVersionStore contentVersionStore, ContentGuidAdmin contentGuidAdmin, CatalogContentDB catalogContentDB, IContentCacheKeyCreator contentCacheKeyCreator, IRelationRepository relationRepository)
Parameters
| Type | Name | Description |
|---|---|---|
| EPiServer.IContentLoader | contentLoader | The content loader. |
| CatalogContentLoader | catalogContentLoader | The catalog content loader. |
| ReferenceConverter | referenceConverter | The reference converter. |
| CatalogContentMoveHandler | catalogContentMoveHandler | The catalog content move handler. |
| IPriceService | priceService | The price service. |
| IInventoryService | inventoryService | The inventory service. |
| ICatalogSystem | catalogSystem | The catalog system. |
| EPiServer.Framework.Cache.ISynchronizedObjectInstanceCache | objectInstanceCache | The object instance cache. |
| CatalogContentCommitterHandler | catalogContentCommitterHandler | The committer to commit changes to the ECF database. |
| CatalogContentVersionStore | contentVersionStore | The catalog content version store. |
| ContentGuidAdmin | contentGuidAdmin | The catalog guid admin. |
| CatalogContentDB | catalogContentDB | The catalog content DB. |
| EPiServer.Core.IContentCacheKeyCreator | contentCacheKeyCreator | Handles generation of Cache keys. |
| IRelationRepository | relationRepository | The repository that handles relations. |
CatalogContentProvider(IContentLoader, CatalogContentLoader, ReferenceConverter, CatalogContentMoveHandler, IPriceService, IInventoryService, ICatalogSystem, ISynchronizedObjectInstanceCache, CatalogContentCommitterHandler, CatalogContentVersionStore, ContentGuidAdmin, CatalogContentDB, IContentCacheKeyCreator, IRelationRepository, CatalogContentAccessControlManager)
Initializes a new instance of the CatalogContentProvider class.
Declaration
[Obsolete("Use constructor without IRelationRepository instead. Will remain at least until September 2019.")]
public CatalogContentProvider(IContentLoader contentLoader, CatalogContentLoader catalogContentLoader, ReferenceConverter referenceConverter, CatalogContentMoveHandler catalogContentMoveHandler, IPriceService priceService, IInventoryService inventoryService, ICatalogSystem catalogSystem, ISynchronizedObjectInstanceCache objectInstanceCache, CatalogContentCommitterHandler catalogContentCommitterHandler, CatalogContentVersionStore contentVersionStore, ContentGuidAdmin contentGuidAdmin, CatalogContentDB catalogContentDB, IContentCacheKeyCreator contentCacheKeyCreator, IRelationRepository relationRepository, CatalogContentAccessControlManager catalogContentAccessControlManager)
Parameters
| Type | Name | Description |
|---|---|---|
| EPiServer.IContentLoader | contentLoader | The content loader. |
| CatalogContentLoader | catalogContentLoader | The catalog content loader. |
| ReferenceConverter | referenceConverter | The reference converter. |
| CatalogContentMoveHandler | catalogContentMoveHandler | The catalog content move handler. |
| IPriceService | priceService | The price service. |
| IInventoryService | inventoryService | The inventory service. |
| ICatalogSystem | catalogSystem | The catalog system. |
| EPiServer.Framework.Cache.ISynchronizedObjectInstanceCache | objectInstanceCache | The object instance cache. |
| CatalogContentCommitterHandler | catalogContentCommitterHandler | The committer to commit changes to the ECF database. |
| CatalogContentVersionStore | contentVersionStore | The catalog content version store. |
| ContentGuidAdmin | contentGuidAdmin | The catalog guid admin. |
| CatalogContentDB | catalogContentDB | The catalog content DB. |
| EPiServer.Core.IContentCacheKeyCreator | contentCacheKeyCreator | Handles generation of Cache keys. |
| IRelationRepository | relationRepository | The repository that handles relations. |
| CatalogContentAccessControlManager | catalogContentAccessControlManager | The catalog content access control manager. |
CatalogContentProvider(IContentLoader, CatalogContentLoader, ReferenceConverter, CatalogContentMoveHandler, IPriceService, IInventoryService, ICatalogSystem, ISynchronizedObjectInstanceCache, CatalogContentCommitterHandler, CatalogContentVersionStore, ContentGuidAdmin, CatalogContentDB, IContentCacheKeyCreator, CatalogContentAccessControlManager)
Initializes a new instance of the CatalogContentProvider class.
Declaration
public CatalogContentProvider(IContentLoader contentLoader, CatalogContentLoader catalogContentLoader, ReferenceConverter referenceConverter, CatalogContentMoveHandler catalogContentMoveHandler, IPriceService priceService, IInventoryService inventoryService, ICatalogSystem catalogSystem, ISynchronizedObjectInstanceCache objectInstanceCache, CatalogContentCommitterHandler catalogContentCommitterHandler, CatalogContentVersionStore contentVersionStore, ContentGuidAdmin contentGuidAdmin, CatalogContentDB catalogContentDB, IContentCacheKeyCreator contentCacheKeyCreator, CatalogContentAccessControlManager catalogContentAccessControlManager)
Parameters
| Type | Name | Description |
|---|---|---|
| EPiServer.IContentLoader | contentLoader | The content loader. |
| CatalogContentLoader | catalogContentLoader | The catalog content loader. |
| ReferenceConverter | referenceConverter | The reference converter. |
| CatalogContentMoveHandler | catalogContentMoveHandler | The catalog content move handler. |
| IPriceService | priceService | The price service. |
| IInventoryService | inventoryService | The inventory service. |
| ICatalogSystem | catalogSystem | The catalog system. |
| EPiServer.Framework.Cache.ISynchronizedObjectInstanceCache | objectInstanceCache | The object instance cache. |
| CatalogContentCommitterHandler | catalogContentCommitterHandler | The committer to commit changes to the ECF database. |
| CatalogContentVersionStore | contentVersionStore | The catalog content version store. |
| ContentGuidAdmin | contentGuidAdmin | The catalog guid admin. |
| CatalogContentDB | catalogContentDB | The catalog content DB. |
| EPiServer.Core.IContentCacheKeyCreator | contentCacheKeyCreator | Handles generation of Cache keys. |
| CatalogContentAccessControlManager | catalogContentAccessControlManager | The catalog content access control manager. |
Fields
DefaultProviderKey
Default key of the CatalogContentProvider, used in the automatic registration of the content provider and in in creating EPiServer.Core.ContentReferences to catalog content in it.
Declaration
public const string DefaultProviderKey = "CatalogContent"
Field Value
| Type | Description |
|---|---|
| System.String |
Properties
ProviderCapabilities
Gets the capabilities that this content provider supports.
Declaration
public override ContentProviderCapabilities ProviderCapabilities { get; }
Property Value
| Type | Description |
|---|---|
| EPiServer.Core.ContentProviderCapabilities |
ProviderKey
Gets the provider key.
Declaration
public override string ProviderKey { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
VersionRepository
Gets the version repository for catalog content.
Declaration
public override IContentVersionRepository VersionRepository { get; }
Property Value
| Type | Description |
|---|---|
| EPiServer.Core.IContentVersionRepository |
Methods
Copy(ContentReference, ContentReference, Boolean, AccessLevel)
Copies the specified content to the destination.
Declaration
public override ContentReference Copy(ContentReference contentLink, ContentReference destinationLink, bool publishOnDestination, AccessLevel requiredSourceAccess)
Parameters
| Type | Name | Description |
|---|---|---|
| EPiServer.Core.ContentReference | contentLink | The content link of the content to copy. |
| EPiServer.Core.ContentReference | destinationLink | The destination link. |
| System.Boolean | publishOnDestination | if set to |
| EPiServer.Security.AccessLevel | requiredSourceAccess | The required source access. |
Returns
| Type | Description |
|---|---|
| EPiServer.Core.ContentReference |
CopyPrices(EntryContentBase, EntryContentBase)
Copies the prices. This method will be called after content has been copied.
Declaration
protected virtual void CopyPrices(EntryContentBase source, EntryContentBase target)
Parameters
| Type | Name | Description |
|---|---|---|
| EntryContentBase | source | The content to copy prices from. |
| EntryContentBase | target | The content which just has been created. |
CopyWarehouseInventories(EntryContentBase, EntryContentBase)
Copies the warehouse inventories. This method will be called after content has been copied.
Declaration
protected virtual void CopyWarehouseInventories(EntryContentBase source, EntryContentBase target)
Parameters
| Type | Name | Description |
|---|---|---|
| EntryContentBase | source | The content to copy prices from. |
| EntryContentBase | target | The content which just has been created. |
Delete(ContentReference, Boolean)
Delete a content.
Declaration
public override void Delete(ContentReference contentLink, bool forceDelete)
Parameters
| Type | Name | Description |
|---|---|---|
| EPiServer.Core.ContentReference | contentLink | A link to the content that should be deleted. |
| System.Boolean | forceDelete | Set to |
DeleteSecurityEntity(String, SecurityEntityType)
Declaration
public override void DeleteSecurityEntity(string userOrRoleName, SecurityEntityType entityUserRole)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | userOrRoleName | |
| EPiServer.Security.SecurityEntityType | entityUserRole |
GetCatalogItemAssetDataTable(String)
Declaration
protected virtual CatalogRelationDto.CatalogItemAssetDataTable GetCatalogItemAssetDataTable(string mediaDataAssetKey)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | mediaDataAssetKey |
Returns
| Type | Description |
|---|---|
| CatalogRelationDto.CatalogItemAssetDataTable |
GetPagesWithPropertyDefinition(PropertyDefinition, Boolean, Boolean)
Gets the catalog contents with instance of property definition.
Declaration
public override IList<ContentUsage> GetPagesWithPropertyDefinition(PropertyDefinition propertyDefinition, bool onlyNoneMasterLanguage, bool onlyPublished)
Parameters
| Type | Name | Description |
|---|---|---|
| EPiServer.DataAbstraction.PropertyDefinition | propertyDefinition | The definition. |
| System.Boolean | onlyNoneMasterLanguage | if set to |
| System.Boolean | onlyPublished | if set to |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IList<EPiServer.DataAbstraction.ContentUsage> |
GetReferencesToContentItems(IEnumerable<ContentReference>)
Gets all references to the specified product content, for example, any entry that uses these content links. Override method to get all references to the given items.
Declaration
public override IList<ReferenceInformation> GetReferencesToContentItems(IEnumerable<ContentReference> contentLinks)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<EPiServer.Core.ContentReference> | contentLinks | The content links to check references for. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IList<EPiServer.DataAbstraction.ReferenceInformation> | A list of items that hold some kind of reference to the specified content. |
IsContentTypeUsed(ContentType)
Performs a check if specified EPiServer.DataAbstraction.ContentType is used.
Declaration
public override bool IsContentTypeUsed(ContentType contentType)
Parameters
| Type | Name | Description |
|---|---|---|
| EPiServer.DataAbstraction.ContentType | contentType | The contentType to return references for. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
IsPropertyDefinitionUsed(PropertyDefinition)
Determines whether there is data store on specified propertyDefinition.
Declaration
public override bool IsPropertyDefinitionUsed(PropertyDefinition propertyDefinition)
Parameters
| Type | Name | Description |
|---|---|---|
| EPiServer.DataAbstraction.PropertyDefinition | propertyDefinition | The property definition. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
ListContentOfContentType(ContentType)
Gets a list of references to catalog content of specified EPiServer.DataAbstraction.ContentType.
Declaration
public override IList<ContentUsage> ListContentOfContentType(ContentType contentType)
Parameters
| Type | Name | Description |
|---|---|---|
| EPiServer.DataAbstraction.ContentType | contentType | The contentType to return references for. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IList<EPiServer.DataAbstraction.ContentUsage> |
ListDelayedPublish()
Lists the content versions that are scheduled for publish.
Declaration
public override IEnumerable<IContent> ListDelayedPublish()
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<EPiServer.Core.IContent> |
ListMatchingSegments(ContentReference, String)
Lists references to all children content items that have matching routing/url segments.
Declaration
protected override IList<MatchingSegmentResult> ListMatchingSegments(ContentReference parentLink, string urlSegment)
Parameters
| Type | Name | Description |
|---|---|---|
| EPiServer.Core.ContentReference | parentLink | The parent link. |
| System.String | urlSegment | The URL segment. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IList<EPiServer.Core.MatchingSegmentResult> |
LoadChildrenReferencesAndTypes(ContentReference, String, out Boolean)
Loads the children references and types.
Declaration
protected override IList<GetChildrenReferenceResult> LoadChildrenReferencesAndTypes(ContentReference contentLink, string languageID, out bool languageSpecific)
Parameters
| Type | Name | Description |
|---|---|---|
| EPiServer.Core.ContentReference | contentLink | The content link to the parent. |
| System.String | languageID | The language ID. |
| System.Boolean | languageSpecific | Output parameter which will be assigned false because catalog child listings are the same for all languages. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IList<EPiServer.Core.GetChildrenReferenceResult> |
LoadContent(ContentReference, ILanguageSelector)
Load content for given contentlink.
Declaration
protected override IContent LoadContent(ContentReference contentLink, ILanguageSelector languageSelector)
Parameters
| Type | Name | Description |
|---|---|---|
| EPiServer.Core.ContentReference | contentLink | The content link. |
| EPiServer.Core.ILanguageSelector | languageSelector | The language selector. |
Returns
| Type | Description |
|---|---|
| EPiServer.Core.IContent | An instance of CatalogContent |
LoadContents(IList<ContentReference>, ILanguageSelector)
Loads multiple catalog content instances from their references.
Declaration
protected override IEnumerable<IContent> LoadContents(IList<ContentReference> contentReferences, ILanguageSelector selector)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IList<EPiServer.Core.ContentReference> | contentReferences | The content references. |
| EPiServer.Core.ILanguageSelector | selector | The language selector. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<EPiServer.Core.IContent> |
Move(ContentReference, ContentReference)
Moves the specified content to the destination.
Declaration
public override void Move(ContentReference contentLink, ContentReference destinationLink)
Parameters
| Type | Name | Description |
|---|---|---|
| EPiServer.Core.ContentReference | contentLink | The content link of the content to move. |
| EPiServer.Core.ContentReference | destinationLink | The destination link. |
Exceptions
| Type | Condition |
|---|---|
| System.InvalidOperationException | Only catalog entries and nodes can be moved. |
ResolveContent(ContentReference)
Tries to resolve a Content from a EPiServer.Core.ContentReference.
Declaration
protected override ContentResolveResult ResolveContent(ContentReference contentLink)
Parameters
| Type | Name | Description |
|---|---|---|
| EPiServer.Core.ContentReference | contentLink | The content link. |
Returns
| Type | Description |
|---|---|
| EPiServer.Web.ContentResolveResult | A EPiServer.Web.ContentResolveResult with the identifiers for the content or null if no content was matched. |
Remarks
The ContentUri relies on correct routing for the content, if no matching routes are registered, it will return a Uri to the root.
ResolveContent(Guid)
Tries to resolve a Content from a System.Guid.
Declaration
protected override ContentResolveResult ResolveContent(Guid contentGuid)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Guid | contentGuid | The content link. |
Returns
| Type | Description |
|---|---|
| EPiServer.Web.ContentResolveResult | A EPiServer.Web.ContentResolveResult with the identifiers for the content or null if no content was matched. |
Remarks
The ContentUri relies on correct routing for the content, if no matching routes are registered, it will return a Uri to the root.
Save(IContent, SaveAction)
Save catalog content to storage with specified action.
Declaration
public override ContentReference Save(IContent content, SaveAction action)
Parameters
| Type | Name | Description |
|---|---|---|
| EPiServer.Core.IContent | content | The content. |
| EPiServer.DataAccess.SaveAction | action | The action. |
Returns
| Type | Description |
|---|---|
| EPiServer.Core.ContentReference |
SaveSecurityDescriptor(ContentReference, IContentSecurityDescriptor, SecuritySaveType)
Declaration
public override void SaveSecurityDescriptor(ContentReference contentLink, IContentSecurityDescriptor contentSecurityDescriptor, SecuritySaveType securitySaveType)
Parameters
| Type | Name | Description |
|---|---|---|
| EPiServer.Core.ContentReference | contentLink | |
| EPiServer.Security.IContentSecurityDescriptor | contentSecurityDescriptor | |
| EPiServer.Security.SecuritySaveType | securitySaveType |
SetCacheSettings(ContentReference, IEnumerable<GetChildrenReferenceResult>, CacheSettings)
Adds dependencies to keys from MasterCacheKeys to react to item adds/removes and changed relations
Declaration
protected override void SetCacheSettings(ContentReference contentReference, IEnumerable<GetChildrenReferenceResult> children, CacheSettings cacheSettings)
Parameters
| Type | Name | Description |
|---|---|---|
| EPiServer.Core.ContentReference | contentReference | |
| System.Collections.Generic.IEnumerable<EPiServer.Core.GetChildrenReferenceResult> | children | |
| EPiServer.Core.CacheSettings | cacheSettings |
SetCacheSettings(ContentReference, String, IEnumerable<MatchingSegmentResult>, CacheSettings)
Adds dependencies to keys from MasterCacheKeys to react to item adds/removes and changed relations
Declaration
protected override void SetCacheSettings(ContentReference parentLink, string urlSegment, IEnumerable<MatchingSegmentResult> childrenMatches, CacheSettings cacheSettings)
Parameters
| Type | Name | Description |
|---|---|---|
| EPiServer.Core.ContentReference | parentLink | The parent link. |
| System.String | urlSegment | The URL segment. |
| System.Collections.Generic.IEnumerable<EPiServer.Core.MatchingSegmentResult> | childrenMatches | The children matches. |
| EPiServer.Core.CacheSettings | cacheSettings | The cache settings. |
SetCacheSettings(IContent, CacheSettings)
Adds dependencies to keys from MasterCacheKeys to react to changes in the entry (with relations) / node / catalog the content is based on
Declaration
protected override void SetCacheSettings(IContent content, CacheSettings cacheSettings)
Parameters
| Type | Name | Description |
|---|---|---|
| EPiServer.Core.IContent | content | The content that is about to be added to cache. |
| EPiServer.Core.CacheSettings | cacheSettings | The cache settings. |
ValidateForPublishing(IContent)
Validate content before publishing.
Declaration
protected override IEnumerable<ValidationError> ValidateForPublishing(IContent content)
Parameters
| Type | Name | Description |
|---|---|---|
| EPiServer.Core.IContent | content | The content. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<EPiServer.Validation.ValidationError> | An enumerable with EPiServer.Validation.ValidationError |