Class CatalogContentCommitter

Commits instances of CatalogContent to the ECF database.

Inheritance
System.Object
CatalogContentCommitter
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.Commerce.Catalog.Provider.Persistence
Assembly: EPiServer.Business.Commerce.dll
Version: 13.30.0
Syntax
public class CatalogContentCommitter : ICatalogContentCommitter
Remarks

This committer works with published version only. Use the ContentVersionCommitter to work with draft version.

Constructors

CatalogContentCommitter(ReferenceConverter, ICatalogSystem, IApplicationContext)

Initializes a new instance of a catalog content committer.

Declaration
public CatalogContentCommitter(ReferenceConverter referenceConverter, ICatalogSystem catalogContext, IApplicationContext applicationContext)
Parameters
Type Name Description
ReferenceConverter referenceConverter

The reference converter.

ICatalogSystem catalogContext

The catalog context used when committing.

IApplicationContext applicationContext

The application context.

Properties

ForContentType

Gets the type the committer can commit.

Declaration
public virtual CatalogContentType ForContentType { get; }
Property Value
Type Description
CatalogContentType

CatalogContentType

Methods

CreateCatalogRow(CatalogContent)

Creates a new catalog row using content.

Declaration
protected virtual CatalogDto CreateCatalogRow(CatalogContent content)
Parameters
Type Name Description
CatalogContent content

The content.

Returns
Type Description
CatalogDto

CreateNew(CatalogContent)

Creates a new catalog corresponding to the content.

Declaration
protected virtual int CreateNew(CatalogContent content)
Parameters
Type Name Description
CatalogContent content

The content.

Returns
Type Description
System.Int32

The ID of the new catalog.

CreateNew(CatalogContent, Boolean)

Creates a new catalog corresponding to the content.

Declaration
protected virtual int CreateNew(CatalogContent content, bool syncDraft)
Parameters
Type Name Description
CatalogContent 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 catalog.

Delete(ContentReference)

Deletes a catalog and everything it contains, except for things that are also associated with another catalog.

Declaration
public virtual void Delete(ContentReference contentLink)
Parameters
Type Name Description
EPiServer.Core.ContentReference contentLink

The catalog link to delete

Save(CatalogContentBase)

Saves the specified CatalogContent to the ECF database.

Declaration
public virtual ContentReference Save(CatalogContentBase content)
Parameters
Type Name Description
CatalogContentBase content

The content to save.

Returns
Type Description
EPiServer.Core.ContentReference

The content reference of the saved content.

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.

Save(CatalogContentBase, Boolean)

Saves the specified CatalogContent to the ECF database.

Declaration
public virtual ContentReference Save(CatalogContentBase content, bool syncDraft)
Parameters
Type Name Description
CatalogContentBase content

The content to save.

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 of the saved content.

Save(IEnumerable<CatalogContentBase>, Boolean)

Saves a batch of content.

Declaration
public 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.

UpdateExisting(CatalogContent, Int32)

Updates an existing catalog.

Declaration
protected virtual void UpdateExisting(CatalogContent content, int catalogId)
Parameters
Type Name Description
CatalogContent content

The catalog to update.

System.Int32 catalogId

The catalog id of the content that is being updated.

UpdateExisting(CatalogContent, Int32, Boolean)

Updates an existing catalog.

Declaration
protected virtual void UpdateExisting(CatalogContent content, int catalogId, bool syncDraft)
Parameters
Type Name Description
CatalogContent content

The catalog to update.

System.Int32 catalogId

The catalog id of the content that is being updated.

System.Boolean syncDraft

Flag to indicate whether the saved content will be synced back to content provider.

UpdateStaticAttributes(CatalogContent, CatalogDto)

Updates the static attributes on the specified catalog.

Declaration
protected virtual CatalogDto UpdateStaticAttributes(CatalogContent content, CatalogDto catalogDto)
Parameters
Type Name Description
CatalogContent content

The catalog content containing the values that should be used to update the catalog.

CatalogDto catalogDto

The catalog dto that should be updated.

Returns
Type Description
CatalogDto

The updated catalog dto.

ValidateCreateCatalog(CatalogContent)

Validates if it's possible to create a catalog.

Declaration
protected virtual void ValidateCreateCatalog(CatalogContent content)
Parameters
Type Name Description
CatalogContent content

The content.

Exceptions
Type Condition
EPiServer.Core.EPiServerException

If the parent isn't the root catalog.

ValidateName(CatalogContent, Int32)

Validates that the name of the catalog is unique.

Declaration
protected virtual void ValidateName(CatalogContent content, int catalogId)
Parameters
Type Name Description
CatalogContent content

The catalog to validate.

System.Int32 catalogId

The id of the catalog.

Implements