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:

  2. Replace the values in the STORE_ID column with the value of the store ID.

  3. (DB2) (Oracle) Update the following file with the database-specific information such as the store identifier, database type, name, user, password, port number, and schema name:

    Note: If the 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.

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

    (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 our changes and close the file.

  5. (Developer) On a command line, go to the WCDE_installdir\bin directory.

  6. (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.

  7. Enter the following command:

    • (Linux) ./dataload.sh ../samples/DataLoad/Location/PointOfInterest/wc-dataload.xml

    • (Developer) dataload.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:

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

After verifying the results, we can test the store check-in functionality in the Management Center and in the mobile storefront.


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.