Adding extension logic to all store pages
About this task
By default, all store pages for the Aurora starter store include the JSPFExtToInclude.jspf file, which dynamically retrieves custom extension JSP files for the store pages. The JSPFExtToInclude.jspf file is used to retrieve a list of configuration entries in the STORECONF database table that belong to the store ID for the store pages. The store page JSP files then include the file that is specified in the value column for each entry.
If your site uses an extended sites store model, you can add extension logic to all store pages for any or all stores. You can add entries into the STORECONF table using the ID for either the storefront asset store or a specific store. The list of files that are added to the pages for a store, include the value for all entries for that specific store and for the storefront asset store.
<%@ include file="/Widgets/Common/EnvironmentSetup.jspf"%>
insert into storeconf (storeent_id, name, value, optcounter)values (storeent_id, 'name', 'value', 0);
Where STOREENT_ID
- The store identifier, which identifies the store that is updated to include logic on all pages. For example, 10001
NAME
- The name of the configuration entry. The prefix
'wc.pgl.jspInclude_'
must be declared in the name for a store to include logic within the body of store pages. To include logic within the header section of store pages, use the prefix'wc.pgl.jspIncludeHead_'
in the name.If your site uses logic from multiple vendors, include the vendor name in the name of the configuration entry. For example,
'wc.pgl.jspInclude_vendor_SiteMap'
Where vendor is the name of your company or the company that provides the logic. The value of the name field must be unique for a store in the STORECONF table. VALUE
- The value of the relative path for the configuration entry. This relative path points to the
extension JSP fragment file that you want to include in every store page. For example,
'/Widgets/com.myCompany.commerce.store.widgets.SiteMap/SiteMap.jsp'
insert into storeconf (storeent_id, name, value, optcounter) values (10001, 'wc.pgl.jspInclude_myCompany_SiteMap',
'/Widgets/com.myCompany.commerce.store.widgets.SiteMap/SiteMap.jsp', 0);
insert into storeconf (storeent_id, name, value) values (10152, 'wc.pgl.jspInclude_myCompany_SiteMap',
'/Widgets/com.myCompany.commerce.store.widgets.SiteMap/SiteMap.jsp', 0);
insert into storeconf (storeent_id, name, value) values (10751, 'wc.pgl.jspInclude_myCompany_SiteMap',
'/Widgets/com.myCompany.commerce.store.widgets.SiteMap/SiteMap.jsp', 0);
Procedure
-
Create the CSV file and Data Load utility configuration files for loading your store
configuration information. To help you create these files, WebSphere Commerce provides sample
CSV and configuration files. Use these sample files to model your CSV and configuration files.
-
Configure the Data Load utility
You do not need to update the copied data load order configuration file, wc-dataload-store-configuration.xml, or the business object configuration file, wc-loader-store-configuration.xml. You must configure your data load environment configuration file.
-
Run the Data Load
utility.
-
Verify that extension logic configuration property is successfully loaded into the STORECONF
table.
Run the following SQL command:
Ensure that your extension logic configuration properties display in the returned database contents. For example, the STORECONF table results can resemble:Select * from storeconf;
STOREENT_ID NAME VALUE 10001 'wc.pgl.jspInclude_myCompany_SiteMap' '/Widgets/com.myCompany.commerce.store.widgets.SiteMap/SiteMap.jsp' 10152 'wc.pgl.jspInclude_myCompany_SiteMap' '/Widgets/com.myCompany.commerce.store.widgets.SiteMap/SiteMap.jsp' 10751 'wc.pgl.jspInclude_myCompany_SiteMap' '/Widgets/com.myCompany.commerce.store.widgets.SiteMap/SiteMap.jsp'