Store configuration samples
We can load configuration properties for a store into the WebSphere Commerce database 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 associated with the store ID for store pages from this database table.(Enterprise) If the site uses an extended sites store model, we 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. We can also load file paths 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.
We 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, we can edit the sample configuration files to use the XML files. The sample input files are located within the following directory:
- (Linux) utilities_root/samples/DataLoad/StoreConfiguration
(Developer) WCDE_installdir\samples\DataLoad\StoreConfiguration
Input source files for loading store configuration properties. This table also lists the business object mediators 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
- (Linux) utilities_root/samples/DataLoad/StoreConfiguration/wc-loader-store-configuration.XML
(Developer) WCDE_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
- In a file manager, go to the following directory:
- (Linux) utilities_root/samples/DataLoad/StoreConfiguration
(Developer) WCDE_installdir\samples\DataLoad\StoreConfiguration
- 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 the environment setting. For more information about this configuration file, see Configure the data load environment settings.
(Developer) On a command line, go to the WCDE_installdir\bin directory.
- (Linux) Open a command line in the Utility server Docker container. Change the directory to utilities_root/bin directory.
For information about entering and leaving containers, see Running utilities from the Utility server Docker container.- Enter the following command to run the sample data load order file for loading store configuration information:
- (Linux) ./dataload.sh ../samples/DataLoad/StoreConfiguration/wc-dataload-store-configuration.xml
(Developer) dataload ..\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,
Configure the data load order.For more information about configuring and running the Data Load utility, see Configure 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. We can also verify that the sample data is loaded by running the following SQL statements against the 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 the 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 the database.