Class EntryContentBaseCommitter
This type/member supports the EPiServer infrastructure and is not intended to be used directly from your code.
Commits changes for EntryContentBase instances to the ECF database.
Inheritance
Implements
Inherited Members
Namespace: EPiServer.Commerce.Catalog.Provider.Persistence
Assembly: EPiServer.Business.Commerce.dll
Version: 13.30.0Syntax
public class EntryContentBaseCommitter : ICatalogContentCommitter
Remarks
This committer works with published version only. Use the ContentVersionCommitter to work with draft version.
Constructors
EntryContentBaseCommitter(ICatalogSystem, ReferenceConverter, CatalogContentLoader, ParentEvaluator, UniqueValueGenerator, MetaDataCommitter, IRelationRepository, IAssetServiceEx, MetaClassToContentTypeMap, IApplicationContext, CatalogContentMoveHandler)
Declaration
[Obsolete("Use constructor without CatalogContentLoader parameter. This will be removed in the next major version.")]
public EntryContentBaseCommitter(ICatalogSystem catalogContext, ReferenceConverter referenceConverter, CatalogContentLoader contentLoader, ParentEvaluator parentEvaluator, UniqueValueGenerator uniqueValueGenerator, MetaDataCommitter metaDataCommitter, IRelationRepository relationRepository, IAssetServiceEx assetService, MetaClassToContentTypeMap metaClassToContentTypeMap, IApplicationContext applicationContext, CatalogContentMoveHandler catalogContentMoveHandler)
Parameters
Type | Name | Description |
---|---|---|
ICatalogSystem | catalogContext | |
ReferenceConverter | referenceConverter | |
CatalogContentLoader | contentLoader | |
ParentEvaluator | parentEvaluator | |
UniqueValueGenerator | uniqueValueGenerator | |
MetaDataCommitter | metaDataCommitter | |
IRelationRepository | relationRepository | |
IAssetServiceEx | assetService | |
MetaClassToContentTypeMap | metaClassToContentTypeMap | |
IApplicationContext | applicationContext | |
CatalogContentMoveHandler | catalogContentMoveHandler |
EntryContentBaseCommitter(ICatalogSystem, ReferenceConverter, ParentEvaluator, UniqueValueGenerator, MetaDataCommitter, IRelationRepository, IAssetServiceEx, MetaClassToContentTypeMap, IApplicationContext, CatalogContentMoveHandler)
Initializes a new instance of the EntryContentBaseCommitter class.
Declaration
public EntryContentBaseCommitter(ICatalogSystem catalogContext, ReferenceConverter referenceConverter, ParentEvaluator parentEvaluator, UniqueValueGenerator uniqueValueGenerator, MetaDataCommitter metaDataCommitter, IRelationRepository relationRepository, IAssetServiceEx assetService, MetaClassToContentTypeMap metaClassToContentTypeMap, IApplicationContext applicationContext, CatalogContentMoveHandler catalogContentMoveHandler)
Parameters
Type | Name | Description |
---|---|---|
ICatalogSystem | catalogContext | The catalog context. |
ReferenceConverter | referenceConverter | The reference converter. |
ParentEvaluator | parentEvaluator | The parent evaluator. |
UniqueValueGenerator | uniqueValueGenerator | The unique value generator. |
MetaDataCommitter | metaDataCommitter | The meta data committer. |
IRelationRepository | relationRepository | The relation repository. |
IAssetServiceEx | assetService | The asset service. |
MetaClassToContentTypeMap | metaClassToContentTypeMap | The meta class to content type map. |
IApplicationContext | applicationContext | The application context. |
CatalogContentMoveHandler | catalogContentMoveHandler | The catalog content move handler. |
Properties
ForContentType
Gets the type the committer can commit.
Declaration
public CatalogContentType ForContentType { get; }
Property Value
Type | Description |
---|---|
CatalogContentType | CatalogContentType |
Methods
CommitAssets(EntryContentBase, CatalogEntryDto, Int32)
This type/member supports the EPiServer infrastructure and is not intended to be used directly from your code.
Commits the assets.
Declaration
protected virtual CatalogEntryDto CommitAssets(EntryContentBase content, CatalogEntryDto entry, int entryId)
Parameters
Type | Name | Description |
---|---|---|
EntryContentBase | content | The content. |
CatalogEntryDto | entry | The entry dto. |
System.Int32 | entryId | The entry id |
Returns
Type | Description |
---|---|
CatalogEntryDto |
CreateNew(EntryContentBase)
Creates a new entry corresponding to the content.
Declaration
protected virtual int CreateNew(EntryContentBase content)
Parameters
Type | Name | Description |
---|---|---|
EntryContentBase | content | The content. |
Returns
Type | Description |
---|---|
System.Int32 | The ID of the new entry. |
CreateNew(EntryContentBase, Boolean)
Creates a new entry corresponding to the content.
Declaration
protected virtual int CreateNew(EntryContentBase content, bool syncDraft)
Parameters
Type | Name | Description |
---|---|---|
EntryContentBase | content | The content. |
System.Boolean | syncDraft | Flag to indicate whether the saved content will be synced back to content provider. |
Returns
Type | Description |
---|---|
System.Int32 | The ID of the new entry. |
CreateNew(IEnumerable<EntryContentBase>, Boolean)
Creates new entries.
Declaration
protected virtual IEnumerable<int> CreateNew(IEnumerable<EntryContentBase> contents, bool syncDraft)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<EntryContentBase> | contents | The contents. |
System.Boolean | syncDraft | Flag to indicate whether the saved content will be synced back to content provider. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.Int32> | The collection of ID of the new entries. |
Delete(ContentReference)
Deletes specific entry content.
Declaration
public virtual void Delete(ContentReference contentLink)
Parameters
Type | Name | Description |
---|---|---|
EPiServer.Core.ContentReference | contentLink | The entry content link. |
Save(CatalogContentBase)
This type/member supports the EPiServer infrastructure and is not intended to be used directly from your code.
Saves the specified content, new or updated.
Declaration
public virtual ContentReference Save(CatalogContentBase content)
Parameters
Type | Name | Description |
---|---|---|
CatalogContentBase | content | The content. |
Returns
Type | Description |
---|---|
EPiServer.Core.ContentReference | The content reference, newly generated if the content was new. |
Remarks
By default, content will be synced back to content provider. In order prevent this, use the overload method with syncDraft flag instead, or modify the DisableVersionSync app setting.
Exceptions
Type | Condition |
---|---|
System.ArgumentException | This class only supports content of the type specified by ForContentType. |
Save(CatalogContentBase, Boolean)
This type/member supports the EPiServer infrastructure and is not intended to be used directly from your code.
Saves the specified content, new or updated.
Declaration
public virtual ContentReference Save(CatalogContentBase content, bool syncDraft)
Parameters
Type | Name | Description |
---|---|---|
CatalogContentBase | content | The content. |
System.Boolean | syncDraft | Flag to indicate whether the saved content will be synced back to content provider. |
Returns
Type | Description |
---|---|
EPiServer.Core.ContentReference | The content reference, newly generated if the content was new. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | This class only supports content of the type specified by ForContentType. |
Save(IEnumerable<CatalogContentBase>, Boolean)
Saves a batch of content.
Declaration
public virtual IEnumerable<ContentReference> Save(IEnumerable<CatalogContentBase> contents, bool syncDraft)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<CatalogContentBase> | contents | The contents. |
System.Boolean | syncDraft | Flag to indicate if this action should sync drafts or not. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<EPiServer.Core.ContentReference> | A list of content references for saved contents, newly generated if the content was new. |
Remarks
By default, content will be synced back to content provider. In order prevent this, use the overload method with syncDraft flag instead, or modify the DisableVersionSync app setting.
SetRelations(ParentsInfo, Int32)
This type/member supports the EPiServer infrastructure and is not intended to be used directly from your code.
Sets the relations to the parent category, if one is selected, and to parent entry if the content is a variation of a product or part of a bundle or package.
Declaration
protected virtual void SetRelations(ParentsInfo parentsInfo, int entryId)
Parameters
Type | Name | Description |
---|---|---|
ParentsInfo | parentsInfo | The parents info. |
System.Int32 | entryId | The entry id. |
SetVariationData(EntryContentBase, CatalogEntryDto)
Sets the variation data.
Declaration
protected virtual void SetVariationData(EntryContentBase content, CatalogEntryDto entry)
Parameters
Type | Name | Description |
---|---|---|
EntryContentBase | content | The content. |
CatalogEntryDto | entry | The entry. |
UpdateExisting(EntryContentBase, Int32)
Updates an existing entry.
Declaration
protected virtual void UpdateExisting(EntryContentBase content, int entryId)
Parameters
Type | Name | Description |
---|---|---|
EntryContentBase | content | The entry. |
System.Int32 | entryId | The entry id. |
UpdateExisting(EntryContentBase, Int32, Boolean)
Updates an existing entry.
Declaration
protected virtual void UpdateExisting(EntryContentBase content, int entryId, bool syncDraft)
Parameters
Type | Name | Description |
---|---|---|
EntryContentBase | content | The entry. |
System.Int32 | entryId | The entry id. |
System.Boolean | syncDraft | Flag to indicate whether the saved content will be synced back to content provider. |
UpdateExisting(IEnumerable<EntryContentBase>, Boolean)
Updates an existing entry.
Declaration
protected virtual void UpdateExisting(IEnumerable<EntryContentBase> contents, bool syncDraft)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<EntryContentBase> | contents | The entries. |
System.Boolean | syncDraft | Flag to indicate whether the saved content will be synced back to content provider. |
UpdateSeoData(EntryContentBase, CatalogEntryDto, Int32)
Update seo data from the content to the dto.
Declaration
protected virtual void UpdateSeoData(EntryContentBase content, CatalogEntryDto entry, int catalogEntryId)
Parameters
Type | Name | Description |
---|---|---|
EntryContentBase | content | The content. |
CatalogEntryDto | entry | The entry. |
System.Int32 | catalogEntryId | The entry id. |
UpdateStaticAttributes(EntryContentBase, CatalogEntryDto, Int32)
Updates the static attributes.
Declaration
protected virtual CatalogEntryDto UpdateStaticAttributes(EntryContentBase content, CatalogEntryDto entry, int catalogEntryId)
Parameters
Type | Name | Description |
---|---|---|
EntryContentBase | content | The content. |
CatalogEntryDto | entry | The entry. |
System.Int32 | catalogEntryId | The catalog entry id. |
Returns
Type | Description |
---|---|
CatalogEntryDto |
ValidateCode(String, Int32)
Validates the code.
Declaration
protected virtual void ValidateCode(string code, int entryId = 0)
Parameters
Type | Name | Description |
---|---|---|
System.String | code | The code. |
System.Int32 | entryId | The entry Id. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown if the code is not unique. |