Loading the attribute dictionary

To use any attribute dictionary data you create, you must first load the data into WebSphere Commerce. This topic uses the mass load utility to load data into your database.

Procedure

  1. Make a backup copy of the existing wcs.dtd file under the following directory:
    • WebSphere Commerce Developerworkspace_dir\wc\xml\schema\dtd
    • WC_installdir\AppServer\profiles\demo\installedApps\WC_demo_cell\WC_demo.ear\xml\schema\dtd
  2. Open the wcs.dtd in a text editor.
  3. Locate component-services.dtd under the following directory; then open it in a text editor:
    • WebSphere Commerce DeveloperWCDE_installdir\components\component-services\xml
    • WC_installdir\components\component-services\xml
  4. Copy the following content (in bold) from the component-services.xml file:
    <!ELEMENT import (( attrtype | attr | attrdesc | attrval | attrvaldesc | 
    catentryattr | attrdict | attrdictgrp | attrdictgrpdesc | attrdictgrpattrrel | attrdictgrprel | 
    dmcampaign | dmtemplatetype | dmacttype | dmactivity | dmelementtype | dmeletemplate | dmelement | dmtriglstn | 
    dmelementnvp | dmpage | dmemspotpage | dmemspotord | dmemspotcmd | dmemspotdef | 
    dmexptype | px_promocd | px_promoaudit | px_promoauth | px_description | px_element | 
    px_elementnvp)*)>
    
    and merge it with the import element in the wcs.dtd file:
    Note: You must add the | character.
    tfalgtypds | tfalregdsc | tfdomain | tfdomdsc | tfexteng | 
    tfsbdomain | tfsbdomdsc | tftradeng | tftrengdsc | tickler | 
    tklacthist | tklractdsc | tklraction | tklrreason | tklrrsndsc | 
    tmpbolist | tmpcmplist | tmpffclist | tmpprocid | tmpradtl | 
    tmprctlist | torcpmap | tradeposcn | trading | transport | 
    trdattach | trddepamt | trddesc | trdpscnxml | trdpuramt | 
    trdrefamt | trdtype | trdtypedsc | txcdclass | txcdscheme | 
    userdemo | userprof | userpvcdev | userpwdhst | userreg | users | 
    usrtraffic | utmerinfo | utregip | vendor | vendordesc | 
    versionspc | wcsdictnry | wcsdtnryds | wcsgbldata | wmmmap | 
    wsalesvw | wtaxinfo | wusrtrvw | attrtype | attr | attrdesc | attrval | attrvaldesc | 
    catentryattr | attrdict | attrdictgrp | attrdictgrpdesc | attrdictgrpattrrel | attrdictgrprel | 
    dmcampaign | dmtemplatetype | dmacttype | dmactivity | dmelementtype | dmeletemplate | dmelement | dmtriglstn | 
    dmelementnvp | dmpage | dmemspotpage | dmemspotord | dmemspotcmd | dmemspotdef | 
    dmexptype | px_promocd | px_promoaudit | px_promoauth | px_description | px_element | 
    px_elementnv)*)>
    
  5. Copy all the element definitions of the new tables from the component-services.xml file and paste the element definitions at the end of the wcs.dtd file:
    <!ELEMENT attr EMPTY>
    <!ATTLIST attr
       attr_id      CDATA   #REQUIRED
       identifier   CDATA   #REQUIRED
       attrtype_id  CDATA   #REQUIRED
       attrdict_id  CDATA   #IMPLIED
       storeent_id  CDATA   #REQUIRED
       optcounter   CDATA   "0"
    >
    … 
    
    <!ELEMENT px_elementnvp EMPTY>
    <!ATTLIST px_elementnvp
       px_elementnvp_id     CDATA   #REQUIRED
       px_element_id        CDATA   #REQUIRED
       name                 CDATA   #REQUIRED
       value                CDATA   #REQUIRED
       optcounter           CDATA   "0"
    >
    
  6. Prepare the massload data in an XML file; then place the file in the following directory:
    • WebSphere Commerce Developer\xml\schema\
    • WC_installdir\AppServer\profiles\demo\installedApps\WC_demo_cell\WC_demo.ear\xml\schema\
    Note: If you place this file in different directory, you must modify the relative path to the wcs.dtd file.
  7. Apache Derby Ensure that the server is not running.
  8. Open a command window, go to the directory where you put the mass load XML file and run the following command:
    • WebSphere Commerce DeveloperWCDE_installdir\bin\idresgen.bat CreateAttributeDictionaryAttributeData.catentry.xml outputxml dbname user password schemaname
    • WC_installdir\bin\idresgen.bat CreateAttributeDictionaryAttributeData.catentry.xml outputxml dbname user password schemaname
    Apache DerbyNote: A database does not need the dbname, user, password and schemaname.
  9. Run massload with the outputxml from the previous step as input:
    • WebSphere Commerce DeveloperWCDE_installdir\bin\massload.bat outputxml dbname user password schemaname
    • WC_installdir\bin\massload.bat outputxml dbname user password schemaname
  10. Check the database to make sure that the data is loaded.

What to do next

Now, you can enable the attribute dictionary for your site.