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
Implements
Inherited Members
Namespace: EPiServer.Commerce.Catalog.Provider.Persistence
Assembly: EPiServer.Business.Commerce.dll
Version: 12.17.2Syntax
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, IAssetService, MetaClassToContentTypeMap, IApplicationContext)
Initializes a new instance of the NodeContentCommitter class.
Declaration
public NodeContentCommitter(ICatalogSystem catalogContext, ReferenceConverter referenceConverter, ParentEvaluator parentEvaluator, UniqueValueGenerator uniqueValueGenerator, MetaDataCommitter metaDataCommitter, IAssetService 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. |
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 |
Methods
CommitAssets(NodeContent, CatalogNodeDto)
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)
Parameters
Type | Name | Description |
---|---|---|
NodeContent | content | The content. |
CatalogNodeDto | node | The entry. |
Returns
Type | Description |
---|---|
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. |
SetSeoData(NodeContent, CatalogNodeDto)
Sets the seo data.
Declaration
protected virtual void SetSeoData(NodeContent content, CatalogNodeDto node)
Parameters
Type | Name | Description |
---|---|---|
NodeContent | content | The content. |
CatalogNodeDto | node | The node. |
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. |
UpdateStaticAttributes(NodeContent, CatalogNodeDto)
Updates the static attributes.
Declaration
protected virtual CatalogNodeDto UpdateStaticAttributes(NodeContent content, CatalogNodeDto node)
Parameters
Type | Name | Description |
---|---|---|
NodeContent | content | The content. |
CatalogNodeDto | node | The node. |
Returns
Type | Description |
---|---|
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. |