November Happy Hour will be moved to Thursday December 5th.

Class NodeContentCommitter

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
System.Object
NodeContentCommitter
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 NodeContentCommitter : ICatalogContentCommitter
Remarks

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

Constructors

NodeContentCommitter(ICatalogSystem, ReferenceConverter, ParentEvaluator, UniqueValueGenerator, MetaDataCommitter, IAssetServiceEx, MetaClassToContentTypeMap, IApplicationContext)

Initializes a new instance of the NodeContentCommitter class.

Declaration
public NodeContentCommitter(ICatalogSystem catalogContext, ReferenceConverter referenceConverter, ParentEvaluator parentEvaluator, UniqueValueGenerator uniqueValueGenerator, MetaDataCommitter metaDataCommitter, IAssetServiceEx assetService, MetaClassToContentTypeMap metaClassToContentTypeMap, IApplicationContext applicationContext)
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.

IAssetServiceEx 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

Methods

CommitAssets(NodeContent, CatalogNodeDto, 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 CatalogNodeDto CommitAssets(NodeContent content, CatalogNodeDto node, int nodeId)
Parameters
Type Name Description
NodeContent content

The content.

CatalogNodeDto node

The node.

System.Int32 nodeId

The node id.

Returns
Type Description
CatalogNodeDto

The updated CatalogNodeDto

CreateNew(NodeContent)

Creates a new node corresponding to the content.

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

The content.

Returns
Type Description
System.Int32

The ID of the new node.

CreateNew(NodeContent, Boolean)

Creates a new node corresponding to the content.

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

Delete(ContentReference)

Deletes specific node content.

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

The node 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 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(NodeContent, Int32)

Updates an existing node.

Declaration
protected virtual void UpdateExisting(NodeContent content, int nodeId)
Parameters
Type Name Description
NodeContent content

The node.

System.Int32 nodeId

The node id.

UpdateExisting(NodeContent, Int32, Boolean)

Updates an existing node.

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

The node.

System.Int32 nodeId

The node id.

System.Boolean syncDraft

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

UpdateExisting(IEnumerable<NodeContent>, Boolean)

Updates an existing node.

Declaration
protected virtual void UpdateExisting(IEnumerable<NodeContent> contents, bool syncDraft)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<NodeContent> contents

The nodes.

System.Boolean syncDraft

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

UpdateSeoData(NodeContent, CatalogNodeDto, Int32)

Update seo data from the content to the dto.

Declaration
protected virtual void UpdateSeoData(NodeContent content, CatalogNodeDto node, int nodeId)
Parameters
Type Name Description
NodeContent content

The content.

CatalogNodeDto node

The node.

System.Int32 nodeId

The node id.

UpdateStaticAttributes(NodeContent, CatalogNodeDto, Int32)

Updates the static attributes.

Declaration
protected virtual CatalogNodeDto UpdateStaticAttributes(NodeContent content, CatalogNodeDto node, int nodeId)
Parameters
Type Name Description
NodeContent content

The content.

CatalogNodeDto node

The node.

System.Int32 nodeId
Returns
Type Description
CatalogNodeDto

The updated CatalogNodeDto

ValidateCode(String, Int32)

Validates the code.

Declaration
protected virtual void ValidateCode(string code, int nodeId = 0)
Parameters
Type Name Description
System.String code

The code.

System.Int32 nodeId

The node Id.

Exceptions
Type Condition
System.ArgumentException

Thrown if the code is not unique.

Implements