Sample: Loading point of interest (POI) data

This sample demonstrates how to load points of interest into the database with the Data Load utility.

About this sample

This sample loads point of interest locations into the POINTOFINTEREST table and point of interest descriptions into the POIDESC table.

Procedure

  1. The sample data for point of interest locations uses a default STORE_ID value of 10202. If store publish uses a different Store ID value, update the values in the STORE_ID column of the CSV file.
    Open the point of interest CSV file from the following location:
    • Linuxutilities_root/samples/DataLoad
    • HCL Commerce DeveloperWCDE_installdir\samples\DataLoad
  2. Replace the values in the STORE_ID column with the value of your store ID.
  3. Update the following file with your database-specific information such as the store identifier, database type, name, user, password, port number, and schema name:
    Note: If your site uses the extended site store model, load data against the individual extended site stores instead of the asset store. Store locations can vary among the individual extended site stores. Use the individual extended site identifier for the storeIdentifier property in the wc-dataload-env.xml file, rather than the asset store identifier.
    • Linuxutilities_root/samples/DataLoad/Location/wc-dataload-env.xml
    • HCL Commerce DeveloperWCDE_installdir\samples\DataLoad\Location\wc-dataload-env.xml

    Use the wcs_encrypt command to generate an encrypted string of your password. Record the ASCII encrypted string. For example:

    HCL Commerce Developer
    
    <_config:BusinessContext storeIdentifier="Madisons" 
    languageId="-1" currency="USD"> 
    
    </_config:BusinessContext> 
    
    <!-- database setting for derby in Toolkit --> 
    <_config:Database type="derby" name="..\db\mall" schema="APP"/> 
    
    <!-- database setting for Oracle -->	
    <!-- 
    <_config:Database name="<database name>" user="<user>" password="<password>" 
    port="1521" schema="<schema name>" server="<server>" type="Oracle" /> 
    -->	
    
    <!-- database setting for DB2 server --> 
    <!-- 
    <_config:Database type="db2" name="<database name>" user="<user>" password="<password>" server="<server>" port="<port>" schema="<schema>" /> 
    --> 
    
  4. Save your changes and close the file.
  5. HCL Commerce DeveloperOn a command line, go to the WCDE_installdir\bin directory.
  6. 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.
  7. Enter the following command:
    • Linux./dataload.sh ../samples/DataLoad/Location/PointOfInterest/wc-dataload.xml
    • HCL Commerce Developerdataload.bat ..\samples\DataLoad\Location\PointOfInterest\wc-dataload.xml
  8. Refresh the Point of Interest registry.

Verifying the results

The wc-dataload.xml configuration file calls the wc-loader-pointofinterest.xml configuration file to load the point of interest location data from the PointOfInterest.csv source file.

The wc-dataload.xml file then calls the wc-loader-poidesc.xml configuration file to load the points of interest description data from the POIDesc.csv.

To verify that the point of interest location data was loaded into the database, run the following SQL command:

select * from pointofinterest 
To verify that the point of interest description data was loaded into the database, run the following SQL command:

select * from poidesc
After verifying the results, you can test the store check-in functionality in the Management Center and in the mobile storefront.

Removing the sample data from the HCL 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.