
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.
The sample is pre-configured to work with a Derby database by default.
Procedure
- 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, you must manually update the values in the STORE_ID column
of the CSV file.Open the point of interest CSV file from the following location:
- WC_installdir/components/location-services/samples/DataLoad/Location/PointOfInterest/PointOfInterest.csv
WCDE_installdir\components\location-services\samples\DataLoad\Location\PointOfInterest\PointOfInterest.csv
- Replace the values in the STORE_ID column with the value of your store ID.
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 thestoreIdentifier
property in the wc-dataload-env.xml file, rather than the asset store identifier.- WC_installdir/components/location-services/samples/DataLoad/Location/wc-dataload-env.xml
WCDE_installdir\components\location-services\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:
<_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" dbDriverType="thin" /> --> <!-- database setting for AIX/DB2 server --> <!-- <_config:Database type="db2" name="<database name>" user="<user>" password="<password>" server="<server>" port="<port>" schema="<schema>" /> -->
- Save your changes and close the file.
- Open a command prompt and navigate to the following directory:
- WC_installdir/bin
WCDE_installdir\bin
- Enter the following command:
./dataload.sh ../components/location-services/samples/DataLoad/Location/PointOfInterest/wc-dataload.xml
dataload.bat ..\components\location-services\samples\DataLoad\Location\PointOfInterest\wc-dataload.xml
- 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.
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 WebSphere 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.