Table of Contents

Class GroupMatrixValueService

Namespace
Dynamicweb.Ecommerce.Products.Categories
Assembly
Dynamicweb.Ecommerce.dll

Reads and saves the matrix a product group holds for a matrix field.

public abstract class GroupMatrixValueService : ICacheStorage<string, IReadOnlyList<GroupMatrixValueRow>>, ICacheStorage<string>, ICacheStorage
Inheritance
GroupMatrixValueService
Implements
Inherited Members

Properties

Info

Information about the object cache

public abstract CacheInformation Info { get; }

Property Value

CacheInformation

Methods

ClearCache()

Resets all keys to the default value for objects stored in the object cache

public abstract void ClearCache()

ClearCache(IEnumerable<string>)

Resets the specified keys to the default value for objects stored in the object cache

public abstract void ClearCache(IEnumerable<string> keys)

Parameters

keys IEnumerable<string>

Keys to reset

ClearCache(string)

Resets the specified key to the default value for objects stored in the object cache

public abstract void ClearCache(string key)

Parameters

key string

Key to reset

GetMatrixFieldCells(string, string, string)

Gets the matrix cells groupId holds for a matrix field as an editor working in languageId needs them: row by row in the group's row order, each with the value in force and the value it would fall back to. A column that allows changes across languages falls back to the default language; any other column is owned by the default language and is shown as inherited elsewhere.

public abstract GroupMatrixCells GetMatrixFieldCells(string groupId, string languageId, string matrixCategoryId)

Parameters

groupId string

The id of the group holding the matrix.

languageId string

The language being edited.

matrixCategoryId string

The matrix field's column category (MatrixAttributeGroupId).

Returns

GroupMatrixCells

The cells in display order. RowId carries the row id, which stays with a row when the rows are reordered, and SortOrder the row's position.

GetProductGroupCells(string, string, string)

Gets the matrix a product's groups define for a matrix field: the rows of the nearest group with rows of its own - looking through the product's groups primary first, each followed by the groups it inherits from, the order a plain product value is looked up in - and each cell's value as those groups hold it in languageId. Unlike a plain value, the groups a group inherits from follow its inherit setting in the default language, so every language shares one set of rows; and a group's cells only count while it inherits from the group that defines the rows.

public abstract IReadOnlyList<MatrixCellView> GetProductGroupCells(string productId, string languageId, string matrixCategoryId)

Parameters

productId string

The id of the product.

languageId string

The language the product is read in.

matrixCategoryId string

The matrix field's column category (MatrixAttributeGroupId).

Returns

IReadOnlyList<MatrixCellView>

The cells in display order, each carrying the group row id as RowId; empty when none of the product's groups has rows, so the product defines its own.

SaveMatrixFieldValues(string, string, string, IReadOnlyList<MatrixFieldRowData>)

Saves the matrix groupId holds for a matrix field in languageId. The default language saves the rows as posted - adding, removing and reordering them - and every column it can edit; any other language keeps the rows and saves only the columns that allow changes across languages. Nothing is saved when the posted rows carry stored row ids but neither the group nor any group it inherits from has rows any more: the rows the editor showed were removed while it was open.

public abstract void SaveMatrixFieldValues(string groupId, string languageId, string matrixCategoryId, IReadOnlyList<MatrixFieldRowData> rows)

Parameters

groupId string

The id of the group holding the matrix.

languageId string

The language being saved.

matrixCategoryId string

The matrix field's column category (MatrixAttributeGroupId).

rows IReadOnlyList<MatrixFieldRowData>

The rows as posted, in display order. A row carries the RowId it was read with, or none when it was added in the editor.

SetCacheType<TObjectCache>()

Changes the storage container

public abstract void SetCacheType<TObjectCache>() where TObjectCache : ServiceCache<string, IReadOnlyList<GroupMatrixValueRow>>

Type Parameters

TObjectCache
To top