Class ProductCategoryFieldService
- Namespace
- Dynamicweb.Ecommerce
- Assembly
- Dynamicweb.Ecommerce.dll
public class ProductCategoryFieldService : ICacheStorage<string, IDictionary<string, Field>>, ICacheStorage<string>, ICacheStorage
- Inheritance
-
ProductCategoryFieldService
- Implements
- Inherited Members
Constructors
ProductCategoryFieldService()
public ProductCategoryFieldService()
Methods
AddReferenceFields(IEnumerable<string>, string)
Adds reference fields to target category.
public void AddReferenceFields(IEnumerable<string> systemFieldUniqueIds, string targetCategoryId)
Parameters
systemFieldUniqueIdsIEnumerable<string>- The field unique ids to be referenced. GetUniqueId()
targetCategoryIdstring- Target category id. Must be common or property category type.
ClearCache()
Resets all keys to the default value for objects stored in the object cache
public void ClearCache()
ClearCache(IEnumerable<string>)
Resets the specified keys to the default value for objects stored in the object cache
public void ClearCache(IEnumerable<string> keys)
Parameters
keysIEnumerable<string>- Keys to reset
ClearCache(string)
Resets the specified key to the default value for objects stored in the object cache
public void ClearCache(string key)
Parameters
keystring- Key to reset
CreateField(string, Category, string, string, string, string, FieldListPresentationType, FieldOptionCollection, string)
Creates new category field for the category
public Field CreateField(string id, Category category, string templateTag, string label, string type, string defaultValue, FieldListPresentationType presentation, FieldOptionCollection options, string description)
Parameters
idstring- Field id
categoryCategory- The category
templateTagstring- Field template tag
labelstring- Field label
typestring- Field Type
defaultValuestring- Field Default value(for list types)
presentationFieldListPresentationType- Field list presentation type(for list types)
optionsFieldOptionCollection- Field list options(for list types)
descriptionstring- Field description
Returns
CreateField(string, Category, string, string, string, string, FieldListPresentationType, FieldOptionCollection, string, string)
Creates new category field for the category
public Field CreateField(string id, Category category, string templateTag, string label, string type, string defaultValue, FieldListPresentationType presentation, FieldOptionCollection options, string description, string languageId)
Parameters
idstring- Field id
categoryCategory- The category
templateTagstring- Field template tag
labelstring- Field label
typestring- Field Type
defaultValuestring- Field Default value(for list types)
presentationFieldListPresentationType- Field list presentation type(for list types)
optionsFieldOptionCollection- Field list options(for list types)
descriptionstring- Field description
languageIdstring
Returns
DeleteField(Field)
Deletes the field.
public void DeleteField(Field theField)
Parameters
theFieldField- The field to remove.
GetCategoryBasedParentGroups(Group)
[Obsolete]
public IEnumerable<Group> GetCategoryBasedParentGroups(Group group)
Parameters
groupGroup
Returns
GetCategoryBasedParentGroups(Group, string)
[Obsolete("Use 'GetCategoryBasedParentGroups' without language instead")]
public IEnumerable<Group> GetCategoryBasedParentGroups(Group group, string languageId)
Parameters
Returns
GetCategoryBasedParentGroups(Product)
[Obsolete]
public IEnumerable<Group> GetCategoryBasedParentGroups(Product product)
Parameters
productProduct
Returns
GetCategoryBasedParentGroups(Product, string)
[Obsolete("Use 'GetCategoryBasedParentGroups' with languageId instead")]
public IEnumerable<Group> GetCategoryBasedParentGroups(Product product, string languageId)
Parameters
Returns
GetFieldById(string, string)
Gets category field by id and cartegory id
public Field GetFieldById(string categoryId, string fieldId)
Parameters
Returns
GetFieldById(string, string, string)
[Obsolete("Use GetFieldById(string categoryId, string fieldId) instead.")]
public Field GetFieldById(string categoryId, string fieldId, string languageId)
Parameters
Returns
GetFieldsByCategoryId(string)
public FieldCollection GetFieldsByCategoryId(string categoryId)
Parameters
categoryIdstring
Returns
GetFieldsByCategoryId(string, string)
[Obsolete("Use the overload without 'languageId'.")]
public FieldCollection GetFieldsByCategoryId(string categoryId, string languageId)
Parameters
Returns
GetInheritedCategories(IEnumerable<Group>, bool)
public IEnumerable<Category> GetInheritedCategories(IEnumerable<Group> groups, bool includeProductProperties)
Parameters
groupsIEnumerable<Group>includeProductPropertiesbool
Returns
GetInheritedCategories(IEnumerable<Group>, string, bool)
[Obsolete("Use 'GetInheritedCategories' without language instead")]
public IEnumerable<Category> GetInheritedCategories(IEnumerable<Group> groups, string languageId, bool includeProductProperties)
Parameters
groupsIEnumerable<Group>languageIdstringincludeProductPropertiesbool
Returns
SaveField(Field)
Saves this instance.
public void SaveField(Field theField)
Parameters
theFieldField
ShowField(Field, Product)
Return a boolean, which indicates whether or not the field should be shown. This is calculated based on the 'HideIfFieldHasNoValue' and the value of the field.
public bool ShowField(Field field, Product product)
Parameters
Returns
UpdateReferenceFields(Field)
Update all reference fields by SetLabel(string, string), SetDescription(string, string), PresentationType, HideEmpty, FieldOptions, SetValidationErrorMessage(string, string) and DoNotRender for specified systemfield
public void UpdateReferenceFields(Field theField)
Parameters
theFieldField