Administer > Transforming, loading, and extracting data > Overview of the mass load utilities > Load data using the mass load utility


Load database asset groups

You can load XML data for a single database asset group into the WebSphere Commerce database.


Procedure

  1. Review the following information:

    1. Overview of loading store data, which provides the background information of the loading utilities.

  2. Plan your loading process and decide which database asset group we will load. In the next steps, we will use or create the following files for the loading process:

    1. One or more database asset files, depending on which group you choose. For example, if you load the store database group assets, we will need a store.xml file and a separate store.xml file for each locale the store supports. Examples of such files are contained within the WebSphere Commerce starter store archives. The starter store archives are organized by business model in the WC_INSTALL/starterstores directory. Note that not all database asset groups require locale specific information.

    2. A new XML file which consolidates all the XML database asset files, contains the XML entity references, and contains the root element for the database assets. This is referred to as the main database asset group XML file. You can find this file in the sample package, called store-all-assets.xml.

    3. A new DTD file which defines all the data types required by the XML files from a database asset group, referred to as the main database asset group DTD file. You can find this file in the sample package, called store-all-assets.dtd.

    4. A second DTD file which defines the external dependencies. You may need to include this file in the main database asset group DTD file. You can find this file in the sample package, called Non database asset groupForeignKeys.dtd.

    5. A third DTD file containing the definition of all the WebSphere Commerce tables. The wcs.dtd file already exists in WebSphere Commerce, located in the WC_INSTALL/schema/xml directory.You may need to include this file in the main database asset group DTD file. If you have not customized the WebSphere Commerce schema, then you can use this file without modification.

  3. Create the database asset XML files for the group we will load. The database asset files should not contain any DTD declaration or page directives at the start of the file since this may cause conflicts when the files are concatenated. Also, for simplicity you may decide not to create any root elements. The only file that must have a root element is the main database asset group XML file.

    If you have database asset files for more than one language, then each file must begin with <?xml encoding = locale specific encoding>. For example, English database asset files should specify <?xml encoding = "UTF-8"?>, but French files should specify <?xml encoding = "ISO-8859-1"?>. Verify the encoding you specify matches the actual encoding of the file.

  4. Create the main database asset group XML file for each group you want to load. This file contains reference entities to include various XML files in one database asset group, or more. By using external reference entities, you can concatenate the XML files to simplify the idresgen utility process and the load process. Also, the internal aliases used within each XML file can be external to another XML data file within a group or across groups when loading more than one group at a time. An XML parser would substitute the contents of the file referenced by the external reference entity in place of the external reference.

    Use the following example for loading the single store database asset group as the guide, you can create your database asset group XML file based on this extract:

    <?xml version="1.0"?>
    <!DOCTYPE import SYSTEM "store-assets.dtd">
    <import> &store.xml; &en_US_store.xml; &fr_FR_store.xml;
    </import>
    

    where

    import

    is the root element of the XML document. The root element has already been defined in the wcs.dtd file, provided with WebSphere Commerce, and includes the definitions for all the WebSphere Commerce database tables. However, if you customized the WebSphere Commerce schema, you may need to use a different root element. You can generate a new DTD file that reflects the customized schema or you can update the wcs.dtd file.

    store-assets.dtd

    refers to the name of the main database asset group DTD file you will create in the next step.

    &store.xml;

    is an XML entity reference to the database asset group XML file. The path and location are defined in the database asset group DTD file. This name will change to match the assets files already created for each group.

    locale_store.xml;

    is needed for each language the store supports. If the store is unilingual, then only reference one file. If the store supports more than one language, then you would require a reference for each language. The above extract assumes that the store supports the English and French languages.

  5. Create a main database asset group DTD file that defines the preceding entities and the other DTD files required by the group.

    Use the following example for loading the single store database asset group as your guide, you can create the main database asset group DTD file for any data group:

    <!ENTITY % wcs.dtd SYSTEM "
    absolute path for WebSphere Commerce 
    wcs.dtd file"> %wcs.dtd; 
    <!ENTITY % ForeignKeys.dtd SYSTEM "ForeignKeys.dtd"> %ForeignKeys.dtd;
    <!ENTITY store.xml SYSTEM "store.xml">
    <!ENTITY en_US_store.xml SYSTEM "en_US/store.xml">
    <!ENTITY fr_FR_store.xml SYSTEM "fr_FR/store.xml">
    

    where

    wcs.dtd

    refers to the DTD file containing data defined outside its database asset group. This file, provided with WebSphere Commerce, also resolves and defines the root element used in the database asset group XML file.

    ForeignKeys.dtd

    refers to the DTD file which defines elements other than the root element. This file contains all the XML entity reference declarations and definitions for the external dependencies outside the database asset group. As such, the XML files have references to foreign key values that are not created as part of the database asset group and must already be loaded into the database before this group.

    Verify the path is correctly identified. In this example, the file is in the same directory as the database asset group DTD file.

    store.xml, en_US_store.xml, and fr_FR_store.xml are the external reference entities used in the database asset group XML file. To use the reference, follow the entity reference convention: &alias_name;.

    store.xml

    refers to the data file for the group from which the database assets are loaded. This name will change to match the database assets files already created for each group. Note that the locale-specific XML files are under the WC_INSTALL/starterstores directory.

    locale/store.xml

    files are needed for each language the store supports, located under the preceding directories. If the store is unilingual, then you would only reference one file. If the store supports more than one language, then you would require a locale-specific file for each language. The above extract assumes the store supports the English and French languages.

  6. Each database asset group requires information defined outside its domain or its set of data, as each group may have external dependencies. You can provide this data in a DTD file. For example, the store database asset group has the following external dependencies:

      bootstrap.LANGUAGE.LANGUAGE_ID, bootstrap.MEMBER.MEMBER_ID, bootstrap.SETCURR.SETCURR_ID, fulfillment.FFMCENTER.FFMCENTER_ID
    

    When loading a data group or the entire set of store data, the following external dependencies must be defined from the WebSphere Commerce database.

    To use this data, follow the corresponding XML entity reference. For example, to use the data defined by the ffmcenter_id entity, you would write &ffmcenter_id; in the XML file. Using the following example for the store database asset group as the guide, you can create the DTD file based on this extract, called Non database asset groupForeignKeys.dtd:

    <!ENTITY en_US "-1">
    <!ENTITY fr_FR "-2">
    <!ENTITY de_DE "-3">
    <!ENTITY it_IT "-4">
    <!ENTITY es_ES "-5">
    <!ENTITY pt_BR "-6">
    <!ENTITY zh_CN "-7">
    <!ENTITY zh_TW "-8">
    <!ENTITY ko_KR "-9">
    <!ENTITY ja_JP "-10">
    <!ENTITY MEMBER_ID "-2000">
    <!ENTITY ffmcenter_id "10001">
    

    where

    MEMBER_ID

    is the internal reference number that identifies the owner of the store.

    ffmcenter

    is the reference number for the store's fulfillment center. Since your store can use more than one fulfillment center, more than one can be defined in the ForeignKeys.dtd file.

    locale

    is the WebSphere Commerce reference number for each locale (identified by country or region and language). The values are located in the LANGUAGE database table.
    Notes:

    1. If you are splitting an existing store archive into database asset groups, ensure that all references to, as an example, alias @ffmcenter_id are replaced with the corresponding entity reference: &ffmcenter_id;.

    2. If you are referencing a member ID that already exists in the database, then you can replace the internal alias used in the starter store data with &MEMBER_ID;. If not, you can include the XML needed to resolve the member ID using @member_id.

  7. Once all the data files have been created, run the idresren utility against the database asset group XML file to resolve the data.

  8. Run the Load command on the resolved data file. To verify your loading process, refer to the log files:

    The log files are located under:

  9. Run the AccountImport command as described in Publishing business account assets.

  10. If applicable, publish contracts as described in Publishing contract assets.

  11. Complete the tasks in Publishing storefront assets and store configuration files by copying to the WebSphere Commerce Server


Related concepts

Overview of loading store data

Store publish process


Related tasks

Publish business accounts and contracts

Related reference

idresgen utility

massload utility (Server environment)


+

Search Tips   |   Advanced Search