Oracle Endeca : How to display BCC ordering of products in category pages??
In ATG, BCC is used to merchandise product data and there are other multiple features as well. Business can create/edit product and assign a product to multiple categories. As part of Endeca Indexing, category orders are maintained but product orders are not due to one product assignment to multiple categories.
Endeca does not main product ordering per category during index creation due to many to many relationships.
Solution:-
Endeca does provide multivalued properties and same can be leveraged here.
ATG provides the capability to return multiple key and value as part of GenerativePropertyAccessor.
There are two parts to implementing this solution:-
1. Endeca Indexing changes: -
We need to write an accessor that will extend GenerativePropertyAccessor class and overwrite following methods. Add one accessor entry in product-sku-output-config.xml under product Item-type.
protected Map<String, Object> getPropertyNamesAndValues(Context pContext,RepositoryItem item, String propertyName, PropertyTypeEnum arg3,boolean arg4)
{
}
Write a logic to get product ordering for a category.
1. Find out product parent categories.
2. Iterate Each parent categories and find out fixed child products under category and get ordering.
3. Create key as "cat_sort_"+categoryid and value would be fixed child products order and put into accessor hashmap.
4. You might get multiple keys under one product
Build project and Run indexing from /atg/commerce/endeca/index/ProductCatalogSimpleIndexingAdmin/ Component.
Go to jsp ref and verify product record.
cat_sort_10001:34
cat_sort_3456:12
2. Endeca cartridge handler changes: -
To display BCC Ordering, ResultsListHandler prPprocess method needs to be customized.
Following steps needs to be done:-
1. Get category id based on URL clicked from front-end using DimensionValueCacheTools.
2. Pass category id to cartridge handler and create a default sort as the combination of "cat_sort_"+categoryid and set in prePocess method as default sort.
3. Verify Front-end, this would provide BCC ordering of products per category.
Click here to get more information related to ATG-Endeca Integration.
Put your email in comments section if you want to have code
Problem Statement:-
Endeca does not main product ordering per category during index creation due to many to many relationships.
Solution:-
Endeca does provide multivalued properties and same can be leveraged here.
ATG provides the capability to return multiple key and value as part of GenerativePropertyAccessor.
There are two parts to implementing this solution:-
1. Endeca Indexing changes: -
We need to write an accessor that will extend GenerativePropertyAccessor class and overwrite following methods. Add one accessor entry in product-sku-output-config.xml under product Item-type.
protected Map<String, Object> getPropertyNamesAndValues(Context pContext,RepositoryItem item, String propertyName, PropertyTypeEnum arg3,boolean arg4)
{
}
Write a logic to get product ordering for a category.
1. Find out product parent categories.
2. Iterate Each parent categories and find out fixed child products under category and get ordering.
3. Create key as "cat_sort_"+categoryid and value would be fixed child products order and put into accessor hashmap.
4. You might get multiple keys under one product
Build project and Run indexing from /atg/commerce/endeca/index/ProductCatalogSimpleIndexingAdmin/ Component.
Go to jsp ref and verify product record.
cat_sort_10001:34
cat_sort_3456:12
2. Endeca cartridge handler changes: -
To display BCC Ordering, ResultsListHandler prPprocess method needs to be customized.
Following steps needs to be done:-
1. Get category id based on URL clicked from front-end using DimensionValueCacheTools.
2. Pass category id to cartridge handler and create a default sort as the combination of "cat_sort_"+categoryid and set in prePocess method as default sort.
3. Verify Front-end, this would provide BCC ordering of products per category.
Click here to get more information related to ATG-Endeca Integration.
Put your email in comments section if you want to have code
Discussion (3)
Technical questions and architecture discussionsJoin the Discussion