Load database asset groups
To load XML data for a single database asset group into the WebSphere Commerce database:
- Review Overview of loading store data
- Plan your loading process and decide which database asset group you you will load.
Whether you want to load the entire set of store database assets as instructed in Loading a store or a single database asset group, the basic process remains the same. In the next steps, you will use or create the following files for your loading process:
- One or more database asset files, depending on which group you choose.
For example, if you load the store database group assets, you will need a store.xml file and a separate store.xml file for each locale your 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...
WC_installdir/starterstoresNote that not all database asset groups require locale specific information.
- 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.
- 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.
- 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 Nondatabase asset groupForeignKeys.dtd.
- A third DTD file containing the definition of all the WebSphere Commerce tables. The wcs.dtd file already exists in WebSphere Commerce, located in...
WC_installdir/schema/xmlYou may need to include this file in the main database asset group DTD file. If you have not customized the WebSphere Commerce schema, then use this file without modification.
- Create the database asset XML files for the group you 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"?>. You must ensure that the encoding you specify matches the actual encoding of the file.
- 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 your 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 your store supports. If your store is unilingual, then only reference one file. If your store supports more than one language, then you would require a reference for each language. The above extract assumes that your store supports the English and French languages.
- 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 your 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.
Ensure that 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...
WC_installdir/starterstores
- locale/store.xml
- files are needed for each language your store supports, located under the preceding directories. If your store is unilingual, then you would only reference one file. If your store supports more than one language, then you would require a locale-specific file for each language. The above extract assumes your store supports the English and French languages.
- 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_IDWhen 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 your XML file. Using the following example for the store database asset group as your guide, you can create your DTD file based on this extract, called Nondatabase 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 your 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:
- 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;.
- 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.
- Once all the data files have been created, run the idresren utility against the database asset group XML file to resolve the data.
- 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:
- Run the AccountImport command as described in Publishing business account assets.
- If applicable, publish contracts as described in Publishing contract assets.
- Complete the tasks in Publishing storefront assets and store configuration files by copying to the WebSphere Commerce Server
Related concepts
Related tasks
Related reference