Sample: Loading marketing data
Before you begin
Ensure that any catalog entries, categories, email templates, or attachment managed files that are associated with the marketing objects that you are loading exist in the target store. When you use the Data Load utility to load marketing data, the utility creates only the marketing objects, descriptive information, and relationships. If the associated objects that the utility does not load do not exist in the target database, the load process can fail since the Data Load utility cannot resolve the unique ID values for the associated objects. If you plan to load marketing objects that need these types of associated objects, you must manually create the object before you load your marketing data.
- The Data Load utility loads data for only a single store in each load operation. You can specify the store identifier in the environment configuration file.
- If your site uses an extended sites store model, you cannot load data for all extended site stores at once. If you want to load asset store objects to extended sites stores, you must load the data into each extended site store individually.
About this sample
When you run this sample, the Data Load utility is configured to load marketing data into only the store that you specify. You can specify the store in the environment configuration file.
- utilities_root/samples/DataLoad/Marketing
- WCDE_installdir\samples\DataLoad\Marketing
You can use the Data Load utility only to insert, replace, or delete marketing objects. Running the utility in update mode to change marketing objects is not supported.
Sample input and configuration files
- wc-dataload.XML
- The data load order configuration file, which identifies the input files and the appropriate business object configuration files to use to load each input file. For more information about load order configuration files, see Configuring the data load order.
- wc-dataload-env.XML
- The data load environment configuration file, which includes the environment variables for your
HCL Commerce instance. These variables include
the following information:
- Business context variables, including the store identifier, catalog identifier, and the default language and currency for your store.
- Database environment settings, including the database type, name, and schema.
- wc-loader-object.XML
- The business object configuration files that define how the data for each marketing object is loaded into the database. These files also define the appropriate business object mediator to use to load the data for each object.
Sample CSV input file | Description and sample business object configuration file |
---|---|
MemberGroup.csv | The Data Load utility uses this sample input file to load the data to create
customer segments with descriptive information for only a specific store language. You can specify
this language in the environment configuration file business context. Business object configuration filewc-loader-member-group.XML Business object mediatorcom.ibm.commerce.member.dataload.mediator.MemberGroupMediator |
MemberGroupDescription.csv | The Data Load utility uses this sample input file to load customer segment descriptive
information for all supported languages. Business object configuration filewc-loader-member-group-description.XML Business object mediatorcom.ibm.commerce.member.dataload.mediator.MemberGroupDescriptionMediator |
MemberGroupCondition.csv | The Data Load utility uses this sample input file to load customer segment
conditions. Note: Any space characters within the input file are converted to new line characters in
the condition XML string for an object in the database. Business object configuration filewc-loader-member-group-condition.XML Business object mediatorcom.ibm.commerce.foundation.dataload.businessobjectmediator.TableObjectMediator |
Attachment.csv | The Data Load utility uses this sample input file to load attachments with descriptive
information in the default store language. Business object configuration filewc-loader-attachment.XML Business object mediatorcom.ibm.commerce.marketing.dataload.mediator.AttachmentMediator |
AttachmentDescription.csv | The Data Load utility uses this sample input file to load attachment descriptive information
for all supported languages. Business object configuration filewc-loader-attachment-description.XML Business object mediatorcom.ibm.commerce.marketing.dataload.mediator.AttachmentDescriptonMediator |
AttachmentAsset.csv | The Data Load utility uses this sample input file to load attachment
assets. Business object configuration filewc-loader-attachment-asset.XML Business object mediatorcom.ibm.commerce.marketing.dataload.mediator.AttachmentAssetMediator |
AttachmentAssetLanguage.csv | The Data Load utility uses this sample input file to load attachment asset and language
relationships. Business object configuration filewc-loader-attachment-asset-language.XML Business object mediatorcom.ibm.commerce.marketing.dataload.mediator.AttachmentAssetLanguageMediator |
MarketingContent.csv | The Data Load utility uses this sample input file to load marketing content with descriptive
information in the default store language. Business object configuration filewc-loader-marketing-content.XML Business object mediatorcom.ibm.commerce.marketing.dataload.mediator.MarketingContentMediator |
MarketingContentDescription.csv | The Data Load utility uses this sample input file to load marketing content descriptive
information for all supported languages. Business object configuration filewc-loader-marketing-content-description.XML Business object mediatorcom.ibm.commerce.marketing.dataload.mediator.MarketingContentDescriptionMediator |
MarketingContentAttachment.csv | The Data Load utility uses this sample input file to load marketing content and attachment
relationship with descriptive information in the default store language. Business object configuration filewc-loader-marketing-content-attachment.XML Business object mediatorcom.ibm.commerce.marketing.dataload.mediator.MarketingContentAttachmentMediator |
MarketingContentAttachmentDescription.csv | The Data Load utility uses this sample input file to load marketing content and attachment
relationship descriptive information for all supported languages. Business object configuration filewc-loader-marketing-content-attachment-description.XML Business object mediatorcom.ibm.commerce.marketing.dataload.mediator.MarketingContentAttachmentDescriptionMediator |
MarketingContentImageMap.csv | The Data Load utility uses this sample input file to load marketing content image
maps. Business object configuration filewc-loader-marketing-content-imagemap.XML Business object mediatorcom.ibm.commerce.marketing.dataload.mediator.MarketingContentImageMapMediator Note: If
you generate this file with the Data Extract utility, the value for the url and
htmlDefinition columns can contain external identifier values that must be
converted to internal ID values by the business object mediator. |
MarketingSpot.csv | The Data Load utility uses this sample input file to load e-Marketing Spots.
Business object configuration filewc-loader-marketing-spot.XML Business object mediatorcom.ibm.commerce.marketing.dataload.mediator.MarketingSpotMediator |
MarketingSpotDefaultContent.csv | The Data Load utility uses this sample input file to load default content information for
e-Marketing Spots. Business object configuration filewc-loader-marketing-spot-default-content.XML Business object mediatorcom.ibm.commerce.marketing.dataload.mediator.MarketingSpotDefaultContentMediator Note: If
you generate this file with the Data Extract utility, the value for the content
column can include an external identifier value that must be converted to an internal ID value by
the business object mediator. When you load an external identifier in this column, the utility first
maps the value to DefaultContent/ContentUniqueID . The utility then converts the
value based on the content type value and then stores the converted value in the database:
|
MarketingSpotDefaultTitle.csv | The Data Load utility uses this sample input file to load default title information for
e-Marketing Spots. Business object configuration filewc-loader-marketing-spot-default-title.XML Business object mediatorcom.ibm.commerce.marketing.dataload.mediator.MarketingSpotDefaultTitleMediator Note: If
you generate this file with the Data Extract utility, the value for the contentName
column can include an external identifier value that must be converted to an internal ID value by
the business object mediator. When you load an external identifier in this column, the utility first
maps the value to DefaultMarketingSpotTitle/ContentUniqueID . The business object
mediator then converts the value from the COLLATERAL.NAME database column value to the COLLATERAL_ID
value that is saved in the database. |
MarketingActivity.csv | The Data Load utility uses this sample input file to load marketing web, dialog, and email
activities, and search rules. Business object configuration filewc-loader-marketing-activity.XML Business object mediatorcom.ibm.commerce.marketing.dataload.mediator.MarketingActivityMediator |
MarketingCampaign.csv | The Data Load utility uses this sample input file to load marketing
campaigns. Business object configuration filewc-loader-marketing-campaign.XML Business object mediatorcom.ibm.commerce.marketing.dataload.mediator.MarketingCampaignMediator |
MarketingElement.csv | The Data Load utility uses this sample input file to load marketing elements for marketing
activities. Business object configuration filewc-loader-marketing-element.XML Business object mediatorcom.ibm.commerce.marketing.dataload.mediator.MarketingElementMediator |
MarketingElementNVP.csv | The Data Load utility uses this sample input file to load marketing element name-value pairs
for marketing activities. Business object configuration filewc-loader-marketing-elementnvp.XML Business object mediatorcom.ibm.commerce.marketing.dataload.mediator.MarketingElementNVPMediator Note: If
you use the Data Extract utility to generate
the MarketingElementNVP.csv file, the utility can convert the value for this
column or element when the value includes a unique ID. Depending on the name column
or element value, the Data Extract utility
converts the unique ID value for the value column or element to be the
corresponding external identifier value. When you load the data, the Data Load utility converts the values to the
appropriate unique ID value in the target database. The utilities convert the unique ID values for
the following name column or element values:
|
Procedure
- Copy the sample configuration files and directories to a local directory.
- Edit your copy of the sample environment configuration files to set the configuration variables for your environment. All of the sample configuration files that are used in this sample include values for a default HCL Commerce Developer environment that uses an Apache Derby database. If your environment settings are different, you must change the configured values in these files to match your environment. For more information about updating an environment configuration file, see Configuring the data load environment settings.
- On a command line, go to the WCDE_installdir\bin directory.
- Open 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.
- Enter the following command to run the sample data load order file and load the information that
included in this sample:
- ./dataload.sh ../samples/DataLoad/Marketing/wc-dataload.xml
- dataload ..\samples\DataLoad\Marketing\wc-dataload.xml
Verifying results
To verify that the marketing data is loaded, complete the following tasks:- Review 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.
- Review the data in your database and verify that the data in each of the sample input files matches the data in your database.
- In Management Center, verify that you can view the loaded marketing objects in the Marketing tool.
Removing the sample data from the HCL Commerce database
Edit the wc-dataload.XML load order configuration file to change the value
of the dataLoadMode
attribute from "Insert"
to
"Delete"
to run the Data Load utility in delete mode. When you run the utility in
delete mode, the utility deletes the data in your database that matches the rows in the sample input
files. You do not need to edit the value for Delete column in the input files.
Compare the data in your database with the input files to verify that the data no longer exists in your database.
In Management Center, verify that you can no longer view the marketing objects in the Marketing tool.