A property in the catalog system is used to define a specific characteristic of a product or a category in a catalog. For eg. a property named Description can be used to describe a product or a category in a catalog. Properties can be grouped together in a definition, which then serves as a template for creating products or categories in a catalog.
A property definition has a data type, minimum and maximum constraints on the values it can contain, default values, built in attributes to extend its usability and display names for multiple languages. In addition it is also possible to extend the property definitions by adding custom attributes. A property in the catalog system functionally corresponds to a column in a table in SQL server.
When you create a property you have to specify a name for the property and the datatype. The datatype constrains the type of values that can be stored in that property. The catalog system supports the following datatypes: Integer, BigInteger, Float, Double, Boolean, String, Datetime, Currency, FilePath, Enumeration and Text. Each of these datatypes map to corresponding datatypes in Sql server. The FilePath datatype translates to a 256 character string and the enumeration datatype translates to a set of predefined values for the property with each value not exceeding 128 characters.
In addition to specifying a datatype, you can also specify a default value for the property and the minimum and maximum values that the property can contain. The CatalogManager.GetPropertyAttributes method returns a recordset containing all the attributes for a property. The following are the attributes a property can have:
- PropertyName, contains the name of the property and is specified when you create the property.
- DataType, contains the datatype of the property and is specified when you create the property. Other than converting string properties to Text properties, other data type conversions are not allowed.
Each datatype has corresponding attributes for specifying default values, and minimum and maximum values allowed for that property. The default value is used when a product or a category is created in a catalog and the minimum and maximum values ensure that value assigned to the property in a product or a category does not exceed the specified ranges.
- u_Defaultvalue, contains the default value for non-multilingual string, enumeration and filepath properties.Default values are not supported for Text properties.
- i_DefaultValue, contains the default value for integer and biginteger properties.
- dt_DefaultValue, contains the default value for datetime properties.
- cy_DefaultValue, contains the default value for currency properties.
- fp_DefaultValue, contains the default value for float and real properties.
- i_MinValue and i_MaxValue, contain the minimum and maximum values integer and biginteger properties can have.
- dt_MinValue and dt_MaxValue, contain the minimum and maximum values datetime properties can have.
- fp_MinValue and fp_MaxValue, contain the minimum and maximum values float and double properties can have.
- cy_MinValue and cy_MaxValue, contain the minimum and maximum values currency properties can have.
- MinLength and MaxLength contains the minimum and maximum lengths string properties can have. For filepath properties the MaxLength is 256 and for enumeration properties the maxlength is 128. Text properties do not have these constraints.
In addition to the above attributes, a property has a set of built in attributes which extend their usability in the catalog system. These attributes are
- IsFreeTextSearchable, attribute applies to string, filepath, enumeration and text properties only. If set to true, the contents of these properties will be added to the fulltext catalogs thereby facilitating fulltext searches.
- IncludeInSpecSearch, attribute allows a property to be used in specification searches.
- DisplayOnSite, attribute can be used to display the contents of the property in a product or a category on the site for runtime users.
- DisplayName, attribute can be used to associate a display name for the property. The property name can be an internal name while the display name can be a meaningful name that can be displayed to users.
- AssignAll, attribute allows a property to be implicitly added to all the existing and new product definitions. If this attribute is set then any new product definition will implicitly include this property. Note that this functionality is provided by Business Desk only and not implemented in the catalog system.
- ExportToDW, attribute causes the contents of this property (in catalogs) to be exported to the Commerce Server data warehouse.
- LanguageSensitive, attribute allows a string, filepath, enumeration and text property to be multilingual. A multilingual property can contain information in multiple languages. For eg. a multilingual Description property can contain descriptions for products and categories in all the languages supported by the catalog (say english, german and japanese).
- IsRequired, attribute ensures that the property always has a value when creating products or categories. This corresponds to the nullable feature of a column in sql server.
- DisplayInProductsList, atribute is used by Business Desk to control which properties are displayed in the catalog editor. When you open a catalog in Business Desk the products list will display all the properties which have the DisplayInProductsList set.