Download as pdf or txt
Download as pdf or txt
You are on page 1of 15

Salmon Developer Training:

• Module: Attribute Dictionary


Agenda
Attribute Dictionary
• Overview
• Data Model
• Defining Attributes
• Descriptive Attributes
• Loading Attributes
• Sample Load File
• Updating Attributes
• Assigning Attributes to Products
Overview
The attribute dictionary is a repository for attributes and their associated values.
An attribute within the dictionary can be linked to a single or multiple products.
Changing an attribute value in the attribute dictionary changes the attribute value
for all products that the attribute value has been linked to.
Predefined value attributes – are attributes with fixed values and can be
reused by multiple products consistently.
Assigned value attributes - are specified individually for each product.
Attributes are maintained within the staging environment and propagated to
Production.
Salmon projects using WCv7 FEP1 and later, are required to use the Attribute
Dictionary and not the classic Attribute Model as more and more OOTB
functionality relies on it.
Data Model (Full)
Data Model (Contd)

Catentry CatentryAttr

Attr AttrVal

AttrDesc AttrValDesc
Data Model (Contd)
Attr - stores attribute dictionary attributes. These attributes can be used for descriptive or
defining purposes (SKU resolution), and can be shared by catalog entries.
Attrdesc – stores language specific attribute description.
AttrVal – stores an attribute value that can be a sharable global attribute value or a local
attribute value defined for a catalog entry.
AttrValDesc – stores the language specific attribute value description
CatentryAttr - stores the link between the catalog entry and the attribute dictionary
attribute and the relevant attribute dictionary attribute value. This is where an attribute is
used as defining or descriptive by setting the usage field to the appropriate value.
Catentry - This table holds information relating to a catalog entry. Examples of catalog
entries include products, items, packages, and bundles.
Defining Attributes
Defining attributes are the values used in SKU resolution; such as
colour or size.

Defining attributes have predefined values. For example, the defining


attribute ‘size’ might have predefined values of ‘small’, ‘medium’, and
‘large’. Each possible combination of attributes and attribute values
creates a SKU. If we take the ‘size’ attribute and assign it to the product
T-Shirt then we will have one product (T-shirt) with three SKUs (small T-
Shirt, medium T-Shirt and a large T-Shirt).

Typically, defining attributes are displayed in a list on the storefront for


the Customer to select from, so if we are displaying T-Shirts we may
have a dropdown containing ‘small’, ‘medium’, and ‘large’.

An attribute is set as a defining attribute by setting the usage field to ‘1’


on the CatentryAttr record.
Descriptive Attributes
Descriptive attributes are additional descriptions for an product.

They DO NOT assist in SKU resolution.

They are providing additional information to whoever needs to know


(WFE, Sales Agents, Third Parties etc).

For example we may have a descriptive attribute ‘Guarantee Period’


and this attribute holds in months the length of time the product is
guaranteed for. This can be surfaced on the WFE or sent on an
interface to a third party.

An attribute is set as a descriptive attribute by setting the usage field to


‘2’ on the CatentryAttr record.
Loading Attributes
• There are many ways to load attributes into WC; idresload file, WC Data
Loader, third party interface …… and the decision as to which method to use
will depend on the project’s TA and be heavily influenced by where the product
data is being mastered.
• WC Data Loader uses under the covers the BOD framework.
• To load attributes via idresload an XML file needs to be maintained within
DeploymentAssets/db/idresload (eg: attributedictionary.xml)
• This file will be loaded via an Ant script with the script residing within
DeploymentAssets/ant/scripts/build.data.attributedictionary.xml
• All entries use IdResolver and Massloader
• Must use DBLoadMacros.DTD for environment specific entries
Sample Load File
<attrdict attrdict_id="@ATTR_DICT_ID;"
storeent_id="&DATALOAD_CATALOG_ASSET_STORE_ID;" />

<attr attr_id="@Size@ATTR_DICT_ID;" identifier="Size"


attrtype_id="STRING" attrdict_id="@ATTR_DICT_ID;"
storeent_id="&DATALOAD_CATALOG_ASSET_STORE_ID;" displayable="1"
searchable="0" comparable="0" attrusage="1" />

<attrdesc attr_id="@Size@ATTR_DICT_ID;" language_id="&en_US;"


attrtype_id="STRING" name="Size" description="Size" />

<attrval attrval_id="@Size@ATTR_DICT_ID;@Small"
attr_id="@Size@ATTR_DICT_ID;" identifier="Small" valusage="1"
storeent_id="&DATALOAD_CATALOG_ASSET_STORE_ID;" />

<attrvaldesc attrval_id="@Size@ATTR_DICT_ID;@Small"
language_id="&en_US;" attr_id="@Size@ATTR_DICT_ID;" value="Small"
valusage="1" sequence="0" stringvalue="Small" />

<attrval attrval_id="@Size@ATTR_DICT_ID;@Medium"
attr_id="@Size@ATTR_DICT_ID;" identifier="Medium" valusage="1"
storeent_id="&DATALOAD_CATALOG_ASSET_STORE_ID;" />

<attrvaldesc attrval_id="@Size@ATTR_DICT_ID;@Medium"
language_id="&en_US;" attr_id="@Size@ATTR_DICT_ID;" value="Medium"
valusage="1" sequence="0" stringvalue="Medium" />

<attrval attrval_id="@Size@ATTR_DICT_ID;@Large"
attr_id="@Size@ATTR_DICT_ID;" identifier="Large" valusage="1"
storeent_id="&DATALOAD_CATALOG_ASSET_STORE_ID;" />

<attrvaldesc attrval_id="@Size@ATTR_DICT_ID;@Large"
language_id="&en_US;" attr_id="@Size@ATTR_DICT_ID;" value="Large"
valusage="1" sequence="0" stringvalue="Large" />
Sample load File
Sample file shows how to set up the Size attribute with 3 attribute values ‘Small’,
‘Medium’ and ‘Large’
Displayable 0 = Not displayable on WFE, 1 or Null = Displayable
Searchable 1 = Searchable and the value will be picked up by SOLR
automatically, 0 = Not Searchable
Comparable Part of WC Compare functionality. 1 = attribute can be compared, 0 =
Cannot compare attribute
ValUsage 1 = Predefined, Null = Assigned
Sequence Affects the display Order of the attribute values on the WFE.
If the dropdown sequence because of popularity for the size attribute
was Medium, Small, Large rather than Small, Medium, Large then
assigning Medium a sequence of 1, Small a sequence of 2 and Large
a sequence of 3 would achieve this.
Updating Attributes
• When you change an attribute value the attribute value is updated for all
catalog entries that it is linked to.
• When you change defining attributes, any updates to the properties or
predefined values are automatically reflected within all catalog entries that use
the attribute.
• Changing a catalog entry to have say it’s ‘LowStock’ attribute changed from
‘Yes’ to ‘No’ doesn’t require the attribute value to be updated as both values
would exist as predefined values. The relevant catentryattr record needs to be
changed to link the required attr and attrval records to the catalog entry.
Assigning Attributes to Products
• Assigning attributes to products is done by creating catentryattr records that
link the catalog entry to the relevant attribute and attribute value records.
• The method for doing this is dependant on where the product data is being
mastered and how that data is being fed into WC.
• Since WC is not a PIM its quite normal to receive product data via an interface
and this interface would then be responsible for maintaining attributes and
assign them to products.
• As previously stated there are many ways to get data into WC and because
this module is using idresload then any interface process would output an
idresload xml file.
<catentryattr attr_id="500" attrval_id="702" usage="1" sequence="1.0"
catentry_id="8231465" />
Best Practices

• The Attribute Dictionary isn’t supported by it’s own EJB.


• In this case and in the case where ever IBM tables are not supported by
EJBs the options available to the developer are the BOD framework or
the ServerJDBCHelperAccessBean class.
• The ServerJDBCHelperAccessBean class is well documented in the
Developer Coding Standards – please refer to standards document for
further information.
• The BOD framework is covered by an advanced training module
Practical

• During the practical Lab Exercise, you will load


new values into the Attribute Dictionary and
access these at runtime.

You might also like