Tuesday, 1 October 2013

Category Pages for Mobile Devices - ( default Devicefmt_id taking precedence over the configured devicefmt_id. )

If you landed up here, You were most probably looking for how you could have a totally different set of catalog asset , for one of the various smart devices .

You will have to define the new catalog Asset in the DISPCGPREL table. This table holds the page names used to display CatalogGroups . The selection of page name is based on Store , MemberGroup , DeviceType  , CatalogGroup & Language . 
Catgroup_id = 0  implies that the page is for all catalogs . 
storeent_id = 0 implies that the page for the catalogGroup is for all stores published . 
Mbrgrp_id = 0 implies that the page is for anybody accessing the site. 

DEvicefmt_id = -1 defines that the device accessing the page is a web browser.

Entirely different pages can be displayed for CatalogGroups based on the language as is evident.
Problem :
You have defined a new configuration in the DISPCGPREL table for a non-default device format, that is, a value not -1, however the new configuration is not used. Instead, a category-specific page for the default device format is instead used
You want to configure a unique  Categories display page for a mobile device.  or 

You want to configure a unique subCategories display page for a mobile device.

Resolving the problem


For example, if you have defined the following entries in the DISPCGPREL table:
  1. CATGROUP_ID = 10001, DEVICEFMT_ID = -1, RANK = 2, PAGENAME = /Store/Page1.jsp,
  2. CATGROUP_ID = 0, DEVICEFMT_ID = -2, RANK = 2, PAGENAME = /Store/Page2.jsp
Zero is the fallback value for the catalog group and -1 is the default device format.
WebSphere Commerce implements the following query to retrieve the page based on these parameters:

  • Store
  • MemberGroup
  • DeviceType
  • CatalogGroup
  • Language

SELECT T1.DEVICEFMT_ID, T1.MBRGRP_ID, T1.DESCRIPTION, T1.PAGENAME, T1.OID, T1.FIELD1, T1.RANK, T1.STOREENT_ID, T1.FIELD2, T1.DISPCGPREL_ID, T1.CATGROUP_ID, T1.LANGUAGE_ID, T1.OPTCOUNTER
FROM DISPCGPREL T1
WHERE (T1.STOREENT_ID IN(?,?) or T1.STOREENT_ID=0)
and (T1.catgroup_id=? or T1.catgroup_id=0)
and (T1.devicefmt_id=? or T1.devicefmt_id=-1)
and (T1.MBRGRP_ID=? or T1.MBRGRP_ID=0)
and (T1.LANGUAGE_ID=? or T1.LANGUAGE_ID is null)
order by T1.mbrgrp_id desc, T1.CATGROUP_id desc, T1.STOREENT_ID desc, T1.RANK asc


If a request is made using the following parameters: CATGROUP_ID = 10001 and DEVICEFMT_ID= -2,
given that the catalog group has precedence, /Store/Page1.jsp is returned. This page corresponds
to the row with DEVICEFMT_ID = -1, not -2.


To force the page with devicefmt -2 to be returned, you must insert a new row in the table
for the specific catalog group with a rank that is lower than the rank used for the default device format (-1).
For example:

  1. CATGROUP_ID = 10001, DEVICEFMT_ID = -1, RANK = 2, PAGENAME = /Store/Page1.jsp .
  2. CATGROUP_ID = 0, DEVICEFMT_ID = -2, RANK = 2, PAGENAME = /Store/Page2.jsp .
  3. CATGROUP_ID = 10001, DEVICEFMT_ID = -2, RANK = 1, PAGENAME = /Store/Page2.jsp .

If you query again using CATGROUP_ID = 10001 and DEVICEFMT_ID= -2, row 3 is returned, which is specific for device format -2 .

IBM Websphere Commerce



IBM Websphere Commerce is an e-Commerce Product marketed by IBM. It is a designed to be an unified platform that will cater marketing , sales ,customer , order capturing, order processing , inventory , payment processing needs , as a single package. The platform is built to be open ended , extensible in nature.

It offers the ability to do e-Commerce - directly with the consumers (B2C)  , with other businesses ( B2B ) ( wholesalers , retailers , organizations , governments ) or indirectly through channel partners.

Channels are classified by the number of intermediaries between producer and consumer . ( The retailer becomes one of the indirect intermediaries in the channel ).

Websphere Commerce ( WCS ) uses open standards such as XML and web services conforming to  OAGIS Specifications ( implemented as part of version 7.0 ) which makes is easy to integrate.
Third party applictions providing certain features ,either due functional superiority or legacy requirements or business needs , can be integrated with websphere Commerce.



Wednesday, 7 November 2012

POST 1 : Why write this blog. ?



There are quite a few reasons for starting to pen down this technical blog. I think I should have started this about 2 years ago.There are things that I had known and forgotten. Hope this helps .
 Anyways, as the saying goes, It's better late than never.
Hope I am able to give back a little to all the help I have taken from the web  and  help a few lost souls who stumble upon the blog