Configuring bootstrap files

In this lesson, you are configuring the bootstrap files that are required to support the new languages to your HCL Commerce instance. You must update the main bootstrap file and create the multi-language bootstrap files and load the files to add the language support.

In this step of the tutorial, you complete the following tasks: customize bootstrap files to include a new locale; create multi-language bootstrap files. The list of supported languages is defined in the LANGUAGE table. To support a new language, you must first add the language to this table. The wcs.bootstrap_base.xml file includes language entry elements for all locales available in HCL Commerce.
Note: Bootstrap files are XML files that are used to populate database tables with information after the schema is created.

About this task

HCL Commerce comes with many languages ready to be used by a store. Each language is associated with a particular country. In this tutorial, you load Canadian languages and the Canadian currency. First, locate the wcs.bootstrap_base.xml file within the WCDE_installdir\schema\data\xml directory and include the new store languages. You can reuse an entry in the file:
<language language_id="&en_US;" localename="en_US" language="en" country="US" encoding="UTF-8" mimecharset="iso-8859-1" />
Note: When you specify the language_id value for your new language, use a negative numerical value that starts at -1000. Do not use values from -1 to -999 because these values are reserved for IBM use.
Update attributes for Canadian English and Canadian French languages.
language_id
An identifier to uniquely identify the display format.
language
The name of the language, where en represents English, and fr represents French.
country
The country or region for the language. CA represents Canada.
localename
A Java locale that is used to represent a political, geographical, or cultural region that has a distinct language and customs for formatting. The locale name is the two-letter ISO 639 language code, followed by the two-letter ISO 3166 country code, which is separated by an underscore. The language value and the country value separated by an underscore (_).
encoding
The encoding value that the browser uses to display the page for this language. The value is typically the same encoding value used in your property files (UTF-8).
mimecharset
The character encoding used for MIME messaging. This value is different from the value used by browsers. For example, the de-facto character encoding for MIME messaging in Japan is iso-2022-jp, while the most commonly used character encoding in all other applications is Shift_JIS. In this example, the following mime charset is used.
iso-8859-1
iso-8859-15
The resulting language entries for Canada are
 <language language_id="&en_CA;" localename="en_CA" language="en" country="CA" encoding="UTF-8" mimecharset="iso-8859-1" /> 
 <language language_id="&fr_CA;" localename="fr_CA" language="fr" country="CA" encoding="UTF-8" mimecharset="iso-8859-15" /> 

The following steps are required to update and reload the main HCL Commerce bootstrap file:

Procedure

  1. Create the bootstrap files for your new languages.
    In these steps, for the variable myLang, use the locale name, for example, en_CA and fr_CA.
    1. Go to the following directory:
      • WCDE_installdir\schema\data\xml
    2. Create a bootstrap file that is called wcs.bootstrap_myLang.xml and open the file for editing.
    3. Add the following code:
      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE import SYSTEM "wcs.dtd" [
      <!ENTITY bootbase SYSTEM "./wcs.bootstrap_myLang_base.xml">
      
      ]>
      <import>
      &bootbase;
      
      </import>
    4. Save and close the file.
    5. Create a bootstrap file that is called wcs.bootstrap_myLang_base.xml and open the file for editing.
    6. Open the wcs.bootstrap_base.xml.
    7. Search for the following element in the wcs.bootstrap_base.xml file:
       <language language_id="&en_US;" localename="en_US" language="en" country="US" encoding="UTF-8" mimecharset="iso-8859-1" /> 
    8. In the new wcs.bootstrap_myLang_base.xml file, create two language element entries modeled after the language in your wcs.bootstrap_base.xml file.
      This update enables bootstrap files to reference the language primary keys:
      <language language_id="&en_CA;" localename="en_CA" language="en" country="CA" encoding="UTF-8" mimecharset="iso-8859-1" />
      <language language_id="&fr_CA;" localename="fr_CA" language="fr" country="CA" encoding="UTF-8" mimecharset="iso-8859-15" />
    9. Search for the following element in the wcs.bootstrap_base.xml:
      <langpair storeent_id="-1" language_id="&en_US;" language_id_alt="&en_US;" sequence="100" />
    10. In the new wcs.bootstrap_myLang_base.xml file, create two language pair element entries modeled after the language in your wcs.bootstrap_base.xml file.
      <langpair storeent_id="-1" language_id="&en_CA;" language_id_alt="&en_US;" sequence="100" />
      <langpair storeent_id="-1" language_id="&fr_CA;" language_id_alt="&en_US;" sequence="100" />
    11. Check your results:
      • Your wcs.bootstrap_en_CA_base.xml file resembles the following snippet:
        <language language_id="&en_CA;" localename="en_CA" language="en" country="CA" encoding="UTF-8" mimecharset="iso-8859-1" />
        <langpair storeent_id="-1" language_id="&en_CA;" language_id_alt="&en_US;" sequence="100" />
      • Your wcs.bootstrap_fr_CA_base.xml file resembles the following snippet:
        <language language_id="&fr_CA;" localename="fr_CA" language="fr" country="CA" encoding="UTF-8" mimecharset="iso-8859-15" />
        <langpair storeent_id="-1" language_id="&fr_CA;" language_id_alt="&en_US;" sequence="100" />
    12. Save your changes to the wcs.bootstrap_myLang_base.xml files and close the files.
  2. Edit the wcs.dtd file:
    1. Go to the following directory and locate the wcs.dtd file:
      • HCL Commerce DeveloperWCDE_installdir\schema\data\xml
    2. Back up the file and rename the backup wcs.dtd.original.
    3. Open the wcs.dtd file. Find the line:
      <!ENTITY en_US "-1">
    4. Add these entries:
      <!ENTITY en_CA "-24">
      <!ENTITY fr_CA "-25">
    5. Save this file.
  3. Create multilanguage bootstrap files for Canadian English:
    1. Go to the following directory and locate the wcs.bootstrap_multi_en_US_base.xml file:
      • HCL Commerce DeveloperWCDE_installdir\schema\data\xml
    2. Make a copy of this file and name the copy wcs.bootstrap_multi_en_CA_base.xml
    3. Open the wcs.bootstrap_multi_en_CA_base.xml file. Replace all references from &en_US; to &en_CA;.
      This change references the new locale multi-base file.
    4. Search for <languageds language_id="&en_CA;" description="United States English" language_id_desc="-1" />
    5. Create two languageds element entries.
      The value of the description displays on store pages and in the HCL Commerce tools when a user selects a language.
      <languageds language_id="&en_CA;" description="Canadian English" language_id_desc="-24" />
      <languageds language_id="&en_CA;" description="Canadian French"  language_id_desc="-25" />
    6. Add language descriptions for all other supported languages to allow other languages to have a translation for this locale:
      <languageds language_id="-1" description="Canadian English" language_id_desc="&en_CA;" />
      <languageds language_id="-2" description="Canadian English" language_id_desc="&en_CA;" /> 
      <languageds language_id="-3" description="Canadian English" language_id_desc="&en_CA;" /> 
      <languageds language_id="-4" description="Canadian English" language_id_desc="&en_CA;" /> 
      <languageds language_id="-5" description="Canadian English" language_id_desc="&en_CA;" /> 
      <languageds language_id="-6" description="Canadian English" language_id_desc="&en_CA;" /> 
      <languageds language_id="-7" description="Canadian English" language_id_desc="&en_CA;" /> 
      <languageds language_id="-8" description="Canadian English" language_id_desc="&en_CA;" /> 
      <languageds language_id="-9" description="Canadian English" language_id_desc="&en_CA;" /> 
      <languageds language_id="-10" description="Canadian English" language_id_desc="&en_CA;" /> 
      <languageds language_id="-20" description="Canadian English" language_id_desc="&en_CA;" /> 
      <languageds language_id="-21" description="Canadian English" language_id_desc="&en_CA;" /> 
      <languageds language_id="-22" description="Canadian English" language_id_desc="&en_CA;" /> 
      <languageds language_id="-23" description="Canadian English" language_id_desc="&en_CA;" /> 
      <languageds language_id="-24" description="Canadian English" language_id_desc="&en_CA;" /> 
      <languageds language_id="-25" description="Canadian English" language_id_desc="&en_CA;" /> 
      
      
      Note: Alternately, add supported languages in each of the wcs.bootstrap_multi_locale_base.xml files.
    7. Save this file.
  4. Create multilanguage bootstrap files for Canadian French:
    1. Go to the following directory and locate the wcs.bootstrap_multi_fr_FR_base.xml file:
      • HCL Commerce DeveloperWCDE_installdir\schema\data\xml
    2. Make a copy of this file and name the copy wcs.bootstrap_multi_fr_CA_base.xml
    3. Open the wcs.bootstrap_multi_fr_CA_base.xml file. Replace all references of &fr_FR; to &fr_CA; (value used in language_id).
    4. Search for <languageds language_id="&fr_CA;" description="Français" language_id_desc="-2" />
    5. Create two languageds element entries to allow the Canadian English language to translate into other languages:
      <languageds language_id="&fr_CA;" description="Canadian English" language_id_desc="-24" />
      <languageds language_id="&fr_CA;" description="Canadian French" language_id_desc="-25" />
      
    6. Add language descriptions for all other supported languages to allow other languages to have a translation for this locale.
      Instead of updating every wcs.bootstrap_multi_locale_base.xml file, you must provide an entry for each locale within the Canadian French locale file.
      <languageds language_id="-1" description="Canadian French" language_id_desc="&fr_CA;" />
      <languageds language_id="-2" description="Canadian French" language_id_desc="&fr_CA;" />
      <languageds language_id="-3" description="Canadian French" language_id_desc="&fr_CA;" />
      <languageds language_id="-4" description="Canadian French" language_id_desc="&fr_CA;" />
      <languageds language_id="-5" description="Canadian French" language_id_desc="&fr_CA;" />
      <languageds language_id="-6" description="Canadian French" language_id_desc="&fr_CA;" />
      <languageds language_id="-7" description="Canadian French" language_id_desc="&fr_CA;" />
      <languageds language_id="-8" description="Canadian French" language_id_desc="&fr_CA;" />
      <languageds language_id="-9" description="Canadian French" language_id_desc="&fr_CA;" />
      <languageds language_id="-10" description="Canadian French" language_id_desc="&fr_CA;" />
      <languageds language_id="-20" description="Canadian French" language_id_desc="&fr_CA;" /> 
      <languageds language_id="-21" description="Canadian French" language_id_desc="&fr_CA;" /> 
      <languageds language_id="-22" description="Canadian French" language_id_desc="&fr_CA;" /> 
      <languageds language_id="-23" description="Canadian French" language_id_desc="&fr_CA;" /> 
      <languageds language_id="-24" description="Canadian French" language_id_desc="&fr_CA;" /> 
      <languageds language_id="-25" description="Canadian French" language_id_desc="&fr_CA;" /> 
      
      
    7. Save this file.
  5. Create the remaining multi-language bootstrap files for the Canadian English language.
    1. Go to the following directory:
      • HCL Commerce DeveloperWCDE_installdir\schema\data\xml
    2. Locate the file wcs.bootstrap_multi_en_US.xml
    3. Make a copy of the file and rename it from wcs.bootstrap_multi_en_US.xml to wcs.bootstrap_multi_en_CA.xml.
    4. Open the file that is created in the previous step for editing; replace all references of en_US to en_CA.
    5. Save the file.
    6. Locate all the remaining files that start with wcs.bootstrap_multi_en_US_*.xml (excluding wcs.bootstrap_multi_en_US_base.xml, as this file was already created and updated in preceding steps):
      • wcs.bootstrap_multi_en_US_contract.xml
      • wcs.bootstrap_multi_en_US_epromotion.xml
      • wcs.bootstrap_multi_en_US_member.xml
      • wcs.bootstrap_multi_en_US_order.xml
      • wcs.bootstrap_multi_en_US_return.xml
      • wcs.bootstrap_multi_en_US_runtime.xml
      • wcs.bootstrap_multi_en_US_tickler.xml
    7. Make a copy of each file found in the previous step and rename it from wcs.bootstrap_multi_en_US_*.xml to wcs.bootstrap_multi_en_CA_*.xml:
      • wcs.bootstrap_multi_en_CA_contract.xml
      • wcs.bootstrap_multi_en_CA_epromotion.xml
      • wcs.bootstrap_multi_en_CA_member.xml
      • wcs.bootstrap_multi_en_CA_order.xml
      • wcs.bootstrap_multi_en_CA_return.xml
      • wcs.bootstrap_multi_en_CA_runtime.xml
      • wcs.bootstrap_multi_en_CA_tickler.xml
    8. Open each of the files that are created in the previous step for editing; replace all references of &en_US; to &en_CA; (value used in language_id).
    9. Save all the files.
  6. Create the remaining multi-language bootstrap files for the Canadian French language.
    1. Go to the following directory:
      • HCL Commerce DeveloperWCDE_installdir\schema\data\xml
    2. Locate the file wcs.bootstrap_multi_fr_FR.xml
    3. Make a copy of the file and rename it from wcs.bootstrap_multi_fr_FR.xml to wcs.bootstrap_multi_fr_CA.xml.
    4. Open the file that is created in the previous step for editing; replace all references of fr_FR to fr_CA.
    5. Save the file.
    6. Locate all the remaining files that start with wcs.bootstrap_multi_fr_FR_*.xml (excluding wcs.bootstrap_multi_en_US_base.xml, as this file was already created and updated in preceding steps):
      • wcs.bootstrap_multi_fr_FR_contract.xml
      • wcs.bootstrap_multi_fr_FR_epromotion.xml
      • wcs.bootstrap_multi_fr_FR_member.xml
      • wcs.bootstrap_multi_fr_FR_order.xml
      • wcs.bootstrap_multi_fr_FR_return.xml
      • wcs.bootstrap_multi_fr_FR_runtime.xml
      • wcs.bootstrap_multi_fr_FR_tickler.xml
    7. Make a copy of each file found in the previous step and rename it from wcs.bootstrap_multi_fr_FR_*.xml to wcs.bootstrap_multi_fr_CA_*.xml:
      • wcs.bootstrap_multi_fr_CA_contract.xml
      • wcs.bootstrap_multi_fr_CA_epromotion.xml
      • wcs.bootstrap_multi_fr_CA_member.xml
      • wcs.bootstrap_multi_fr_CA_order.xml
      • wcs.bootstrap_multi_fr_CA_return.xml
      • wcs.bootstrap_multi_fr_CA_runtime.xml
      • wcs.bootstrap_multi_fr_CA_tickler.xml
    8. Open each of the files that are created in the previous step for editing; replace all references of &fr_FR; to &fr_CA; (value used in language_id).
    9. Save all the files.
  7. Create the features bootstrap files for both new languages.
    1. Go to the following directory:
      • HCL Commerce DeveloperWCDE_installdir\schema\data\xml
    2. Locate the wcs.features_bootstrap_en_US.xml and wcs.features_bootstrap_fr_FR.xml files.
    3. Make a copy of the files and rename it them to reflect your locales. That is, wcs.features_bootstrap_en_CA.xml and wcs.features_bootstrap_fr_CA.xml.
    4. Open the files that were created in the previous step for editing; replace all references of the old locale names with the new locale names. That is, replace all references of &en_US; to &en_CA; for the Canadian English file, and &fr_FR; to &fr_CA; for the Canadian French file (value used in language_id).
    5. Create the file wcs.features_bootstrap.xml and include wcs.features_bootstrap_en_CA.xml. Make a copy of WCDE_installdir\schema\data\xml\wcs.features_bootstrap.xml.template named wcs.features_bootstrap.xml. Update this file with the following contents:
       <?xml version="1.0" encoding="UTF-8"?>
         <!DOCTYPE import SYSTEM "wcs.dtd" [<!ENTITY boot_en_CA SYSTEM "./wcs.features_bootstrap_en_CA.xml">]>
         <import>
               &boot_en_CA;
         </import>
      
      For Canadian French, update the file using fr_CA.
    6. Save the files.
  8. Load the main bootstrap files:
    The massload utility has been deprecated in HCL Commerce Version 9 in favor of dataload. The utility needs three XML files for each of Canadian English and Canadian French languages:
    • wcs.bootstrap_en_CA.xml/wcs.bootstrap_fr_CA.xml
    • wcs.bootstrap_multi_en_CA.xml/wcs.bootstrap_multi_fr_CA.xml
    • wcs.features_en_CA.xml/wcs.features_fr_CA.xml
    Before using the dataload utility, set WCDE_installdir\dataload\massload\wc-dataload-env.xml according to the environment. Here is an example that updates <_config:Database info with db2.
    <_config:Database type="db2" name="mall" user="<user>" password="<encryped password>" server="<hostname>" schema="<schema>" >
             <_config:property name="port" value="${port,50000}" />
       </_config:Database>.
    
    To load the main bootstrap for Canadian English:
    1. Edit the configuration file WCDE_installdir\dataload\massload\wc-dataload.xml. Modify <_config:DataSourceLocation and set the load file to wcs.bootstrap_en_CA.xml.  For example:
      <_config:DataSourceLocation location="../../schema/data/xml/wcs.bootstrap_en_CA.xml " />
    2. Open a command prompt and run the dataload utility. See Running utilities from the Utility server Docker container.
      WCDE_installdir\bin>dataload.bat ..\dataload\massload\wc-dataload.xml 
      Repeat these two steps to load the main bootstrap for Canadian French.
  9. Load the multilanguage bootstrap files to add the language support to HCL Commerce:
    1. Edit the configuration file <_config:DataSourceLocation> of  WCDE_installdir\dataload\massload\wc-dataload.xml  and define the load file as wcs.bootstrap_multi_en_CA.xml. For example:
      <_config:DataSourceLocation location="../../schema/data/xml/wcs.bootstrap_multi_en_CA.xml" />
    2. Open a command prompt and run the dataload utility. See Running utilities from the Utility server Docker container.
      WCDE_installdir\bin>dataload.bat ..\dataload\massload\wc-dataload.xml
    3. For Canadian French, repeat these two steps.
    After you load the new language bootstrap files into the database, HCL Commerce can include related multicultural data into the system.
  10. Similar to the previous step, load the features bootstrap files for both new languages, wcs.features_bootstrap_en_CA.xml and wcs.features_bootstrap_fr_CA.xml.
    1. Edit the configuration file <_config:DataSourceLocation> of  WCDE_installdir\dataload\massload\wc-dataload.xml and define the load file as wcs.features_bootstrap.xml. For example:
      <_config:DataSourceLocation location="../../schema/data/xml/wcs.features_bootstrap.xml" />
    2. Open a command prompt and run the dataload utility. See Running utilities from the Utility server Docker container.
      WCDE_installdir\bin>dataload.bat ..\dataload\massload\wc-dataload.xml
    3. For Canadian French, change the <!ENTITY filename to wcs.features_bootstrap_fr_CA.xml in wcs.features_bootstrap.xml and repeat steps a-b.
  11. Index the new languages in HCL Commerce Search, so that the search utilities, storefront, and the Management Center can recognize them.

Results

Your main bootstrap is updated to include your new languages and new language-specific bootstrap files. In the next step of the tutorial, you learn how to include the new languages in your HCL Commerce instance.