Registering a store feature in the marketing database schema

In this lesson, use the idresgen utility along with the massload utility to insert data for the new store feature into the database. The tables EMSPOT and DMEMSPOTDEF are used to contain this information. The EMSPOT contains the entry for the new feature, DMEMSPOTDEF contains the configuration information for the new feature.

About this task

Procedure

  1. Navigate to WCDE_installdir > schema > xml
  2. Edit the wcs.dtd file to set the USAGETYPE attribute for EMSPOT table to#IMPLIED instead of a default value of MARKETING
    Feature Pack 2Feature Pack 3
    Note: This step is done by default in Feature Pack 4 and Feature Pack 5.
    1. Locate the following code snippet:
      <!ELEMENT emspot EMPTY>
      <!ATTLIST emspot
       empspot_id		CDATA		#IMPLIED
       storeent_id		CDATA		#IMPLIED
       name			CDATA		#IMPLIED
       description		CDATA		#IMPLIED
       supportedtypes		CDATA		#IMPLIED
       lastupdate		CDATA		#IMPLIED
       defaultrule		CDATA		#IMPLIED
       optcounter		CDATA		#IMPLIED
        usagetype		CDATA		"MARKETING">
    2. Replace the usagetype attribute entry for this table with the following code:
      usagetype		CDATA		#IMPLIED
    3. Save your changes and close the file.
  3. Define the xml file for the feature entry. The xml file resolves the emspot_id and dmemspotdef_id attributes. The values prefixed with @counter_ indicate that this attribute entry must be resolved with the KEYS table when run through the idresgen utility.
    1. Navigate to WCDE_installdir > schema > xml.
    2. In the xml folder, create a file called wcs.ContactToolTip.xml.
    3. Open wcs.ContactToolTip.xml for editing.
    4. Add the following code snippet:
      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE import SYSTEM "wcs.dtd">
      <import>
      <emspot
             EMSPOT_ID="@counter_0000000114"
             STOREENT_ID="10001"
             NAME="ContactDisplayToolTip"
             DESCRIPTION="ContactCardFeature"
             USAGETYPE="STOREFEATURE">
      </emspot>
      <dmemspotdef
             DMEMSPOTDEF_ID="@counter_0000000115"
             EMSPOT_ID="@counter_0000000114"
             STOREENT_ID="10001"
             CONTENTTYPE="FeatureEnabled"
             CONTENT="false">
      </dmemspotdef>
      </import>
      Note: If required, edit the store ID for the Madisons starter store in the code to meet your correct value.
    5. Save your changes and close the file.
  4. Run the wcs.ContactToolTip.xml file through the idresgen utility to create a resolved xml file to use with the massload utility.
    1. Open a Command Prompt.
    2. Navigate to WCDE_installdir > bin.
      Apache DerbyNote: Ensure the WebSphere Application Server is stopped.
    3. Run the idresgen utility on the wcs.ContactToolTip.xml file.
      Apache Derby
       idresgen <input xml filename> <output xml filename>
      For example:
      idresgen ..\schema\xml\wcs.ContactToolTip.xml ..\schema\xml\wcs.ContactToolTip_resolved.xml
      Note: The wcs.dtd file must be located in the same folder as wcs.ContactToolTip.xml

      For more information, see idresgen utility.

  5. Insert the new store feature data into EMSPOT and DMEMSPOTDEF tables by running the massload utility on the resolved output XML file:
    1. Open a Command Prompt.
    2. Navigate to WCDE_installdir > bin.
    3. Run the massload utility on the wcs.ContactToolTip_resolved.xml resolved output xml file:
      Apache Derby
        massload <input xml filename>
      For example:
      massload ..\schema\xml\wcs.ContactToolTip_resolved.xml

      For more information, see massload utility (Development environment).

Results