Sample: Loading marketing data

This sample demonstrates how to load marketing data into the WebSphere Commerce database with the Data Load utility. After you load the data, Management Center users can view and manage the marketing objects in the Marketing tool. By following this sample, you load data for marketing activities, e-Marketing Spots, customer segments, marketing content, and associated attachments for the marketing objects.

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.

Notes:
  • 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.
  • WebSphere Commerce EnterpriseIf 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.

The sample configuration files that are used to configure the Data Load utility are in the following directory and subdirectories:
  • LinuxAIXWC_installdir/samples/DataLoad/Marketing
  • WindowsWC_installdir\samples\DataLoad\Marketing
  • WebSphere Commerce DeveloperWCDE_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.

Note: When you run this sample, the utility loads data for all supported and configured marketing object types. The data for each object type is included in separate input files. If you want to load data for only specific marketing objects, you can configure the Data Load utility when you run the utility from a command-line utility to load only specific objects. Use the -DLoadOrder parameter when you run the utility to identify the specific objects to load. If you want to load multiple business objects, include the list of load item names for the objects in comma-separated list. Enclose the list in double quotation marks. For example, the following parameter indicates that the utility is to load only the business object load items for marketing activities:-DLoadOrder="MarketingCampaign, MarketingActivity, MarketingElement, MarketingElementNVP"

Sample input and configuration files

The sample directory includes the following Data Load utility 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 WebSphere 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.
The following table lists the input files that you use to load the sample data. The table also identifies the business object mediators and business object configuration files that the Data Load utility uses to load the sample data.

Input files for loading marketing data.

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 identfier 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:
  • For marketing content, the utility assumes that the value is the COLLATERAL.NAME. The mediator then converts the value to the COLLATERAL_ID and saves the value in the DMEMSPOTDEF.CONTENT column.
  • For catalog entry content, the utility assumes that the value is the CATENTRY.PARTNUMBER. The mediator then converts the value to the CATENTRY_ID and saves the value in the DMEMSPOTDEF.CONTENT column.
  • For category content, the utility assumes that the value is the CATGROUP.IDENTIFIER. The mediator then converts the value to the CATGROUP_ID and saves the value in the DMEMSPOTDEF.CONTENT column.
  • For any other content type, the value is stored in the DMEMSPOTDEF.CONTENT column as-is.
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 identfier 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:
  • For a list of catalog entry ID values, the Data Extract utility converts the ID values to the catalog entry part numbers. When you load the data, the Data Load utility converts each part number to the appropriate CATENTRY_ID value in the target database.
  • For a list of category ID values, the Data Extract utility converts the ID values to the category identifier. When you load the data, the Data Load utility converts the identifier to the appropriate CATGROUP_ID values.
  • For a list of attribute dictionary attribute ID values, the Data Extract utility converts the ID values to the external attribute identifier. When you load the data, the Data Load utility converts the identifier to the appropriate ATTR_ID values.
  • For a list of attribute value IDs for attribute dictionary attributes, the Data Extract utility converts the ID values to the external attribute value identifier. When you load the data, the Data Load utility converts the identifier to the appropriate ATTRVAL_ID values.
  • For a list of content ID values, the Data Extract utility converts the ID values to the marketing content name. When you load the data, the Data Load utility converts the content name to the appropriate COLLATERAL_ID values.
  • For e-Marketing Spot ID values, the Data Extract utility converts the ID values to the e-Marketing Spot name and usage type. The name and usage type are separated by a line ('|') separator character, for example, "ShoppingCartRight_CatEntries|MARKETING". The default usage type is MARKETING. When you load the data, the Data Load utility converts the part number to the appropriate EMSPOT_ID value.
  • For promotion ID values, the Data Extract utility converts the ID values to the promotion administrative name. When you load the data, the Data Load utility converts the name to the appropriate PX_PROMOTION_ID value.
  • For a list of customer segment ID values, the Data Extract utility converts the ID values to the customer segment member group name. When you load the data, the Data Load utility converts the name to the appropriate MBRGRP_ID value.
  • For email message ID values, the Data Extract utility converts the ID values to the email message name. When you load the data, the Data Load utility converts the message name to the appropriate EMLMSG_ID value.
  • For any other name value, the Data Extract utility does not convert the value for the value column or element.

Procedure

  1. Copy the sample configuration files and directories to a local directory.
  2. 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 WebSphere 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.
  3. Open a command-line utility and go to the appropriate directory:
    • LinuxAIXWC_installdir/bin
    • WindowsWC_installdir\bin
    • WebSphere Commerce DeveloperWCDE_installdir\bin
  4. Enter the following command to run the sample data load order file and load the information that included in this sample:
    • LinuxAIX./dataload.sh ../samples/DataLoad/Marketing/wc-dataload.xml
    • Windowsdataload.bat ..\samples\DataLoad\Marketing\wc-dataload.xml
    • WebSphere Commerce Developerdataload ..\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 WebSphere 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.