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: 10.8.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, ILinksRepository, IAssetService, MetaClassToContentTypeMap)
Initializes a new instance of the EntryContentBaseCommitter class.
Declaration
[Obsolete("Use constructor with IApplicationContext instead. Will remain at least until July 2017.")]
public EntryContentBaseCommitter(ICatalogSystem catalogContext, ReferenceConverter referenceConverter, CatalogContentLoader contentLoader, ParentEvaluator parentEvaluator, UniqueValueGenerator uniqueValueGenerator, MetaDataCommitter metaDataCommitter, ILinksRepository linksRepository, IAssetService assetService, MetaClassToContentTypeMap metaClassToContentTypeMap)
Parameters
| Type | Name | Description |
|---|---|---|
| ICatalogSystem | catalogContext | The catalog context. |
| ReferenceConverter | referenceConverter | The reference converter. |
| CatalogContentLoader | contentLoader | The content loader. |
| ParentEvaluator | parentEvaluator | The parent evaluator. |
| UniqueValueGenerator | uniqueValueGenerator | The unique value generator. |
| MetaDataCommitter | metaDataCommitter | The meta data committer. |
| ILinksRepository | linksRepository | The links repository. |
| IAssetService | assetService | The asset service. |
| MetaClassToContentTypeMap | metaClassToContentTypeMap | The meta class to content type map. |
EntryContentBaseCommitter(ICatalogSystem, ReferenceConverter, CatalogContentLoader, ParentEvaluator, UniqueValueGenerator, MetaDataCommitter, ILinksRepository, IAssetService, MetaClassToContentTypeMap, ApplicationContext)
Initializes a new instance of the EntryContentBaseCommitter class.
Declaration
[Obsolete("Use constructor with IApplicationContext instead. Will remain at least until July 2017.")]
public EntryContentBaseCommitter(ICatalogSystem catalogContext, ReferenceConverter referenceConverter, CatalogContentLoader contentLoader, ParentEvaluator parentEvaluator, UniqueValueGenerator uniqueValueGenerator, MetaDataCommitter metaDataCommitter, ILinksRepository linksRepository, IAssetService assetService, MetaClassToContentTypeMap metaClassToContentTypeMap, ApplicationContext applicationContext)
Parameters
| Type | Name | Description |
|---|---|---|
| ICatalogSystem | catalogContext | The catalog context. |
| ReferenceConverter | referenceConverter | The reference converter. |
| CatalogContentLoader | contentLoader | The content loader. |
| ParentEvaluator | parentEvaluator | The parent evaluator. |
| UniqueValueGenerator | uniqueValueGenerator | The unique value generator. |
| MetaDataCommitter | metaDataCommitter | The meta data committer. |
| ILinksRepository | linksRepository | The links repository. |
| IAssetService | assetService | The asset service. |
| MetaClassToContentTypeMap | metaClassToContentTypeMap | The meta class to content type map. |
| ApplicationContext | applicationContext | The application context. |
EntryContentBaseCommitter(ICatalogSystem, ReferenceConverter, CatalogContentLoader, ParentEvaluator, UniqueValueGenerator, MetaDataCommitter, ILinksRepository, IAssetService, MetaClassToContentTypeMap, IApplicationContext)
Initializes a new instance of the EntryContentBaseCommitter class.
Declaration
public EntryContentBaseCommitter(ICatalogSystem catalogContext, ReferenceConverter referenceConverter, CatalogContentLoader contentLoader, ParentEvaluator parentEvaluator, UniqueValueGenerator uniqueValueGenerator, MetaDataCommitter metaDataCommitter, ILinksRepository linksRepository, IAssetService assetService, MetaClassToContentTypeMap metaClassToContentTypeMap, IApplicationContext applicationContext)
Parameters
| Type | Name | Description |
|---|---|---|
| ICatalogSystem | catalogContext | The catalog context. |
| ReferenceConverter | referenceConverter | The reference converter. |
| CatalogContentLoader | contentLoader | The content loader. |
| ParentEvaluator | parentEvaluator | The parent evaluator. |
| UniqueValueGenerator | uniqueValueGenerator | The unique value generator. |
| MetaDataCommitter | metaDataCommitter | The meta data committer. |
| ILinksRepository | linksRepository | The links repository. |
| IAssetService | assetService | The asset service. |
| MetaClassToContentTypeMap | metaClassToContentTypeMap | The meta class to content type map. |
| IApplicationContext | applicationContext | The application context. |
Properties
ForContentType
Gets the type the committer can commit.
Declaration
public CatalogContentType ForContentType { get; }
Property Value
| Type | Description |
|---|---|
| CatalogContentType | CatalogContentType |
ForType
Returns the supported type: EntryContentBase
Declaration
[Obsolete("Use ForContentType instead. Will remain at least until August 2016.")]
public Type ForType { get; }
Property Value
| Type | Description |
|---|---|
| System.Type |
Methods
CommitAssets(EntryContentBase, CatalogEntryDto)
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)
Parameters
| Type | Name | Description |
|---|---|---|
| EntryContentBase | content | The content. |
| CatalogEntryDto | entry | The entry. |
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. |
Delete(CatalogContentBase)
Deletes the specified content
Declaration
[Obsolete("Use Delete(ContentReference contentLink) instead. Will remain at least until August 2016.")]
public virtual void Delete(CatalogContentBase content)
Parameters
| Type | Name | Description |
|---|---|---|
| CatalogContentBase | content | The content to delete |
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. |
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. |
SetSeoData(EntryContentBase, CatalogEntryDto)
Sets the seo data.
Declaration
protected virtual void SetSeoData(EntryContentBase content, CatalogEntryDto entry)
Parameters
| Type | Name | Description |
|---|---|---|
| EntryContentBase | content | The content. |
| CatalogEntryDto | entry | The entry. |
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. |
UpdateSerializedMetaData(EntryContentBase, CatalogEntryDto)
Updates the serialized meta data.
Declaration
[Obsolete("This method is no longer used, will remain at least until August 2016.")]
protected virtual CatalogEntryDto UpdateSerializedMetaData(EntryContentBase content, CatalogEntryDto entry)
Parameters
| Type | Name | Description |
|---|---|---|
| EntryContentBase | content | The content. |
| CatalogEntryDto | entry | The entry. |
Returns
| Type | Description |
|---|---|
| CatalogEntryDto |
UpdateStaticAttributes(EntryContentBase, CatalogEntryDto)
Updates the static attributes.
Declaration
protected virtual CatalogEntryDto UpdateStaticAttributes(EntryContentBase content, CatalogEntryDto entry)
Parameters
| Type | Name | Description |
|---|---|---|
| EntryContentBase | content | The content. |
| CatalogEntryDto | entry | The entry. |
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. |