Store Locator samples

You can load Store Locator data into your HCL Commerce database by using the Data Load utility. This sample demonstrates how to load Store Locator data into the STLOC database table.

About this sample

This sample loads physical store-related information into STLOC and related tables.

You can load the information for this sample in both CSV or XML formatted input files. The following procedure loads only the CSV input files; however, if you prefer to work with the data in the XML formatted files, you can edit the Store Locator files to use the XML files. The sample input files are located in the following directory:
  • Linuxutilities_root/samples/DataLoad/StoreLocator
  • HCL Commerce DeveloperWCDE_installdir\samples\DataLoad\StoreLocator

Sample csv files

geonode.csv
Defines the geographical nodes (regions, countries, and states) that can be used to organize store locations.
geonode,
geoName,type,delete
Britain,CNTY,0
Wales,PROV,0
Column Name Description Example
geoName The unique identifier for the geographical node. This is a primary key and is referenced by other files. Britain and Wales
type The type of geographical node. Defines the classification (For example, country, province, and city). CNTY (Country) and PROV (Province/State)
delete Flag to indicate deletion. Set to 1 to delete the record, 0 otherwise. 0 (Keep)
geotree.csv
Defines the hierarchical relationship between geographical nodes, establishing a geographical tree structure.
geotree,
parentGeoNode,childGeoNode,delete
,Britain,0
Britain,Wales,0
Column Name Description Example
parentGeoNode The unique identifier of the parent geographical node. This column should be empty for the top-level node in the tree (For example, top-level country). Britain (Parent of Wales), Blank (Top-level)
childGeoNode The unique identifier of the child geographical node. Britain (Child of top-level), Wales (Child of Britain)
delete Flag to indicate deletion. Set to 1 to delete the record, 0 otherwise. 0 (Keep)
storelocation.csv
Defines the core physical store location details and their connection to the geographical hierarchy.
storelocation
physicalStore,phone,fax,address1,address2,address3,city,state,country,zipcode,active,latitude,longitude,geoNode,delete
Cardiff Center,555.444.7777,555.444.7788,25 Victoria Street,,,Cardiff,Wales,Britain,M99 7Z8,,52.48,-52.48,Wales,0
Column Name Description Example
physicalStore The unique identifier for the physical store. This is the primary key for the store location. Cardiff Center
phone The telephone number of the store. 555.444.7777
fax The fax number of the store. 555.444.7788
address1 The first line of the street address. 25 Victoria Street
address2 The second line of the street address (optional). (Empty/NaN)
address3 The third line of the street address (optional). (Empty/NaN)
city The city of the store location. Cardiff
state The state or province of the store location. Wales
country The country of the store location. Britain
zipcode The ZIP or postal code of the store location. M99 7Z8
active Flag indicating if the store location is active. Common values are 1 (active) or 0 (inactive). 1
latitude The geographical latitude of the store location. 52.48
longitude The geographical longitude of the store. -52.48
geoNode The unique identifier of the geographical node that this store belongs to, referencing geonode.csv. Wales
delete A flag that indicates deletion. Set to 1 to delete the record, 0 otherwise. 0 (Keep)
storelocationattr.csv
Defines extended, attribute-based properties for the physical store locations (For example, store services and features such as Electronics Hub).
storelocationattr
physicalStore,attributeName,displayName,value,displayValue,image,displayable,sequence,delete
Column Name Description Example
physicalStore The unique identifier for the physical store, matching physicalStore in storelocation.csv. Cardiff Center
attributeName The unique name of the store attribute, used for system identification. ElectronicsHub
displayName The human-readable name of the attribute. Gadget-Freak
value The actual value of the attribute. True
displayValue The display value of the attribute; often the same as value for simple types. True
image Path or name of an associated image file. (Empty/NaN)
displayable Flag indicating if the attribute should be displayed on the storefront. 1 means display. 1
sequence The display order of the attribute relative to others. 2.0
delete Deletion flag. Set to 1 to delete the record, 0 to keep. 0 (Keep)
storelocationdesc.csv
Provides additional descriptive, language-specific information for the physical store location, including images and custom fields.
storelocationdesc
physicalStore,image1,image2,field1,field2,field3,delete
Column Name Description Example
physicalStore The unique identifier (foreign key) for the physical store, matching physicalStore in storelocation.csv. Cardiff Center
image1 Path or name of the first image file for the store. (Optional) (Empty/NaN)
image2 Path or name of the second image file for the store. (Optional) (Empty/NaN)
field1 Custom field 1 for additional store details. (Optional) (Empty/NaN)
field2 Custom field 2 for additional store details. (Optional) (Empty/NaN)
field3 Custom field 3 for additional store details. (Optional) (Empty/NaN)
delete Deletion flag. Set to 1 to delete the record, 0 to keep. (Optional) 0 (Keep)

Procedure

  1. In a file manager, go to the following directory:
    • Linuxutilities_root/samples/DataLoad/StoreLocator
    • HCL Commerce DeveloperWCDE_installdir\samples\DataLoad\StoreLocator
  2. Open the wc-dataload-env.xml data load environment configuration file. Update the file to set the environment settings within the file to match the environment settings. For more information about this configuration file, see Configuring the data load environment settings.
  3. HCL Commerce DeveloperOn a command line, go to the WCDE_installdir\bin directory.
  4. LinuxOpen a command line in the . Change the directory to utilities_root/bin directory. For information about entering and leaving containers, see Running utilities from the Utility server Docker container.
  5. Enter the following command to run the sample data load order file for loading store configuration information:
    • Linux./dataload.sh ../samples/DataLoad/StoreLocator/wc-dataload-store-locator.xml
    • HCL Commerce Developerdataload ..\samples\DataLoad\StoreLocator\wc-dataload-store-locator.xml
    The load order configuration file identifies the order in which 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 the Commerce Composer tool Store Locator 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.

Verify the sample data by running the following SQL statement against the HCL Commerce database:
select * from STLOC;
Ensure that the data within the sample input files exists within the database table for the appropriate store.

Removing the sample data from the HCL Commerce database

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