Methods for retrieving configuration parameters from the STORECONF table

We can use the StoreConfigurationRegistry to access store configuration values in the STORECONF database table from either Java code or JSP files.

The StoreConfigurationRegistry is a cache for the STORECONF table. The STORECONF table contains configuration-related parameters (name-value pairs) for specific stores. For example, the table contains a number of default configuration values for WebSphere Commerce Search. The table can also store custom configuration values, such as the Facebook application ID for a store that is integrated with Facebook. We can load any custom values to the table by using SQL statements or the Data Load utility. For instructions on how to load data to this table, see Adding extension logic to all store pages.

The STORECONF data is not propagated from staging to production. Therefore, we can have configurations and test systems set up in the staging environment that are different from your production environment.

As an alternative to the StoreConfigurationRegistry, we can use the store REST resource with the IBM_Store_Conf profile to access data in the STORECONF table. See the store REST resource.


Java code example

From Java code, we can access the StoreConfigurationRegistry directly. The following example code retrieves the value for a parameter in the STORECONF table for a specified store:

Where:


JSP file example

We can use the <wcst:storeconf> tag in a store JSP file to access configuration parameters from the STORECONF table. The <wcst:storeconf> tag reads from the StoreConfigurationRegistry cache to provide access to the configuration parameters. This tag is provided with the WebSphere Commerce Stores tag library (stores.tld). In the default JSTLEnvironmentSetup.jspf file for the Aurora starter store, the library is included, as shown here:

The following example shows how to use the tag in a store page to get the parameter named wc.store.displayListPriceInProductPage from the STORECONF table:

The <wcst:storeconf> tag accepts three parameters:


Related concepts
Aurora starter store


Related tasks
Developing Aurora starter store pages