Store configuration samples

You can load configuration properties for a store into your WebSphere Commerce database by using the Data Load utility. This sample demonstrates how to load store configuration name value properties into the STORECONF database table.

Note: Data in the STORECONF table is available to all users (generic, anonymous, and registered), Therefore, sensitive information should not be stored in this table.

About this sample

This sample loads information for configure extension logic for all store pages into the STORECONF store configuration database table. All store page JSP files retrieve a list of configuration entries that are associated with the store ID for store pages from this database table.

WebSphere Commerce EnterpriseIf your site uses an extended sites store model, you can load information to configure extension logic to all store pages for any or all stores. When files with extension logic are included in store configuration properties, store JSP files dynamically retrieve and include the logic within the files when the store page renders. You can also load filepaths as the value for configuration properties with an input file, however this sample does not demonstrate how to load this type of information. For more information about adding extension logic to store pages, see Adding extension logic to all store pages.

When you load this sample, data is added into following tables within the STORECONF database table:
STOREENT_ID
The store identifier, which identifies the store that is updated to include the configuration properties on store pages. For example, 10001
NAME
The name of the configuration property. The value of the name field must be unique for a store in the STORECONF table.
VALUE
The value for the configuration entry.
You can load the information for this sample in both CSV or XML formatted input files. The following procedure, however, loads only the CSV input files. If you prefer to work with the data within the XML formatted files, you can edit the sample configuration files to use the XML files. The sample input files are located within the following directory:
  • AIXLinuxWC_installdir/samples/DataLoad/StoreConfiguration
  • WindowsWC_installdir\samples\DataLoad\StoreConfiguration
  • WebSphere Commerce DeveloperWCDE_installdir\samples\DataLoad\StoreConfiguration
Input source files for loading store configuration properties. This table also lists the business object mediators that are used by the Data Load utility to load the configuration data.
Sample input file Description
CSV
  • StoreConfiguration.csv
XML
  • StoreConfiguration.xml

The Data Load utility uses this sample input file to load the name and values for configuration properties and associates the configuration with a store ID.

The Data Load utility uses the table object mediator and the following business object configuration file to load the data within this input file:

Business object mediator

com.ibm.commerce.foundation.businessobjectmediator.TableObjectMediator

Business object configuration file
  • AIXLinuxWC_installdir/samples/DataLoad/StoreConfiguration/wc-loader-store-configuration.xml
  • WindowsWC_installdir\samples\DataLoad\StoreConfiguration\wc-loader-store-configuration.xml
  • WebSphere Commerce DeveloperWCDE_installdir\samples\DataLoad\StoreConfiguration\wc-loader-store-configuration.xml

For more information about the table object mediator, see Data Load utility table-based mediator and builder.

Procedure

  1. In a file manager, go to the following directory:
    • AIXLinuxWC_installdir/samples/DataLoad/StoreConfiguration
    • WindowsWC_installdir\samples\DataLoad\StoreConfiguration
    • WebSphere Commerce DeveloperWCDE_installdir\samples\DataLoad\StoreConfiguration
  2. Open the wc-dataload-env.xml data load environment configuration file for editing. Update the file to set the environment settings within the file to match your environment setting. For more information about this configuration file, see Configuring the data load environment settings.
  3. Open a command-line utility and go to the appropriate directory:
    • AIXLinuxWC_installdir/bin
    • WindowsWC_installdir\bin
    • WebSphere Commerce DeveloperWCDE_installdir\bin
  4. Enter the following command to run the sample data load order file for loading store configuration information:
    • AIXLinux./dataload.sh ../samples/DataLoad/StoreConfiguration/wc-dataload-store-configuration.xml
    • Windowsdataload.bat ..\samples\DataLoad\StoreConfiguration\wc-dataload-store-configuration.xml
    • WebSphere Commerce Developerdataload ..\samples\DataLoad\StoreConfiguration\wc-dataload-store-configuration.xml
    The load order configuration file identifies the order that the Data Load utility loads the sample CSV files. The load order file also identifies the appropriate business object configuration file to use to load each input file. For more information about load order configuration files, Configuring the data load order.

    For more information about configuring and running the Data Load utility, see Configuring and running the Data Load utility.

Verifying results

Verify that the Commerce Composer tool store configuration information is loaded by reviewing the data load summary report. For more information about the location and contents of this summary report, see Verifying the results of the data load.

You can also verify that the sample data is loaded by running the following SQL statements against your WebSphere Commerce database:
select * from STORECONF;
Ensure that the data within the sample input files exists within the database table for the appropriate store.

Removing the sample data from the WebSphere Commerce database

To remove the sample data from your database, run the sample again but with the value for the delete column for all entries within the files set to 1. By setting the value for this column to 1, the Data Load utility deletes the data that is identified in the CSV file from your database.