Understanding Device Detection and Routing in WebSphere Commerce
jwbarnes 06000271DW Visits (8684)
An often asked question is how to take your existing store and make it a mobile store? If you look in the information center, you can find numerous topics about devices, mappings, and the features that come with the mobile starter store. All of these options may be daunting and can confuse you, when simply you may want to experiment with mobile technologies.
A few things to be aware of is that device detection is turned off for stores by default. The reason being is that if you are not concerned about redirecting to various views based on device, then there is no reason to add in the check for a device. So with that understanding you have to do some steps before you get different views for your store.
The easiest way to approach this would be to deploy the MadisonsMobile.sar to your store. But you may be concerned about the changes that might happen to your store. This is understandable and I would suggest trying this in a development environment first. Do understand that when you deploy the store, it will enable device detection, adding some jsps enhanced for mobile devices, adding new device mappings, and adding forwards for various devices to the struts config.
It is important to understand that this is your main entry point with device detection
Let's say the device you are using with that URL is an iPhone, and the device detection uses regular expression to compare the user-agent string to the pattern, like the following:
In this cause the device is assigned an id of -21. Once it has the device id, it will now check your struts config for forwards for this device by using the format of docname / storeID / deviceFormatID
So it will first look for StoreView/10101/-21 and you have the following mappings in your struts config:
The best match is chosen first, So in this case the view will be forwarded to /mob
Now that we understand how the mapping and redirection happens lets examine the scenario where you want to enable device direction without deploying the sar. The easiest way to do that is to update the storelevel field in the store table to include the word MOBILE. Take the following entry:
(Click image to enlarge)
You would update the storelevel to 'MOBILE,MC' so it looks like this:
(Click image to enlarge)
So now after a restart of the server, device detection will happen. But at this point you have made no changes to the struts config so all requests will still go to the normal locations. What you need to decide now is what jsps and views you want to be different between the mobile and your normal site. The best place to start would be to open the mobile sar. Find this file stru
So you would need to add similar entries to your struts config to handle your mobile views as well as your views you want to be difference for an id. This would get you the basics of having a mobile store, but is certainly not recommended. It would also allow you to have greater control on the items you wanted to have different between mobile and standard stores.