Thursday, March 17, 2016

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 ... thumbnail 1 summary
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.


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

3 comments

Unknown said...

Hi ,
I have a problem statement similar to this. I have a category which has child products and subcategories . I require the products to be indexed in an order as child products first followed by the products of the subcategories(specified in order).How can this be achieved ? Will the above solution help?

Ajay Agrawal said...

Hi Savitha,

Thanks for referring to my Blog. Product index order can be managed during indexing process and can be just one ordering. A product can be associated with multiple categories so in this case what would be the product ordering in this case.

As per my suggestion, manipulate the record ordering using Endeca sort to display based on category.

are you looking for sorting or any specific reason to have indexing order?

Thanks,
Ajay Agrawal

Unknown said...

Hi. Thanks for your post. It is very help ful.

The sorting is woring as expected but still the index is not triggered when the product orders (fixedChildProducts) updated through BCC. Is there a way to trigger the index after the project completion in BCC with the fixedChildProducts property change?

Thanks,
Dinesh

Post a Comment

Note: Only a member of this blog may post a comment.

Text Widget