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: 10.8.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)

Initializes a new instance of a catalog content committer.

Declaration
[Obsolete("Use constructor with IApplicationContext instead. Will remain at least until July 2017.")]
public CatalogContentCommitter(ReferenceConverter referenceConverter, ICatalogSystem catalogContext)
Parameters
Type Name Description
ReferenceConverter referenceConverter

The reference converter.

ICatalogSystem catalogContext

The catalog context used when committing.

CatalogContentCommitter(ReferenceConverter, ICatalogSystem, ApplicationContext)

Initializes a new instance of a catalog content committer.

Declaration
[Obsolete("Use constructor with IApplicationContext instead. Will remain at least until July 2017.")]
public CatalogContentCommitter(ReferenceConverter referenceConverter, ICatalogSystem catalogContext, ApplicationContext applicationContext)
Parameters
Type Name Description
ReferenceConverter referenceConverter

The reference converter.

ICatalogSystem catalogContext

The catalog context used when committing.

ApplicationContext applicationContext

The application context.

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

ForType

Returns the supported type: CatalogContent

Declaration
[Obsolete("Use ForContentType instead. Will remain at least until August 2016.")]
public virtual Type ForType { get; }
Property Value
Type Description
System.Type

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(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 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

GetApplicationId()

The application id from the current AppContext

Declaration
protected virtual Guid GetApplicationId()
Returns
Type Description
System.Guid

The current application id.

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.

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