Updating the wc-devices.xml with the extended device configuration

In this lesson, you update the wc-devices.xml with an additional device group to detect the cookies added in the previous lesson. When the cookie is detected, the internal ID is set to the device corresponding to the value of the cookie.For more information about device configuration, see wc-devices.xml.

Procedure

To update the wc-devices.xml file:
  1. Go to WCDE_installdir/workspace/WC/xml/config/com.ibm.commerce.foundation-fep/
  2. Open wc-devices.xml.
  3. Update the schema in use from wc-devices.xsd to wc-devices-fep.xsd to use the extended device detection framework. Locate the following code block:
    <_config:Devices
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    	xsi:schemaLocation="http://www.ibm.com/xmlns/prod/commerce/foundation/config ../xsd/wc-devices.xsd" 
    xmlns:_config="http://www.ibm.com/xmlns/prod/commerce/foundation/config">

    Replace the code with the following code block:

    <_config:Devices
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    	xsi:schemaLocation="http://www.ibm.com/xmlns/prod/commerce/foundation/config ../xsd/wc-devices-fep.xsd" 
    xmlns:_config="http://www.ibm.com/xmlns/prod/commerce/foundation/config">
  4. Copy the following code snippet into the <_config:Devices> block. Ensure that it is the first <_config:Devices> entry, so that this device group takes precedence.
    <_config:DeviceGroup impl="com.ibm.commerce.foundation.server.services.httpdevice.CookieDeviceGroupImpl" keyName="WC_MOBILEDEVICEID">
    <_config:Device name="Forced Desktop" value="0" internalID="-1" channelID="-1"/>
    <_config:Device name="Forced Smartphone" value="1" internalID="-21" channelID="-6"/>
    <_config:Device name="Forced Tablet" value="2" internalID="-31" channelID="-6"/>
    </_config:DeviceGroup>
  5. Save the file.
  6. Restart the server.