Example: Member group

Use the Data Load utility to load member group data into the HCL Commerce database. You can also load member groups into a workspace since they are considered managed assets.

This example uses a CSV file to demonstrate how to insert, replace, or delete your data. You can also create and use an XML formatted file to insert, replace, or delete your data. If you choose to create and use an XML formatted file, ensure that your XML elements use the same names as are used for CSV column names.

CSV column and XML element definitions

(String) The name of the member group. For example, AccessGroup1.
(String) The member group usage type. For example, GeneralPurpose.
(String) The short description for the member group. For example, Access Group 1.
(String) The long description for the member group.
(Integer) The language identifier for the member group.

CSV file with sample organization data

In this example, the CSV file contains sample member group data.

CSV file with sample member group data.

Formatted CSV file with column headings
memberGroupName usage shortDescription longDescription langId
TestMemberGroup GeneralPurpose Test Member Group Member group for general purpose testers
AccessGroup1 AccessControl Access group 1 Member group for granting access control

Mapping data

The following code snippet from the wc-loader-member-group.xml configuration file demonstrates how to map each value to a business object logical schema path.
        <_config:mapping xpath="MemberGroupIdentifier/UniqueID" value="memberGroupId" />
        <_config:mapping xpath="MemberGroupIdentifier/ExternalIdentifier/Name" value="memberGroupName" />
        <_config:mapping xpath="MemberGroupIdentifier/ExternalIdentifier/ownerID" value="ownerId" />
        <_config:mapping xpath="MemberGroupIdentifier/ExternalIdentifier/StoreIdentifier/UniqueID" value="storeId" />
        <_config:mapping xpath="MemberGroupIdentifier/ExternalIdentifier/StoreIdentifier/ExternalIdentifier/NameIdentifier" value="storeIdentifier" />
        <_config:mapping xpath="LastUpdate" value="lastUpdate" />
        <_config:mapping xpath="LastUpdatedBy" value="lastUpdatedByLogonId" />
        <_config:mapping xpath="MemberGroupDescription[0]/ShortDescription" value="shortDescription" />
        <_config:mapping xpath="MemberGroupDescription[0]/LongDescription" value="longDescription" />
        <_config:mapping xpath="MemberGroupDescription[0]/language" value="langId" />
        <_config:mapping xpath="Usage[0]" value="usage" />

        <_config:mapping xpath="" value="delete"   deleteValue="1"/>


Business object mediator

The mediator class name is com.ibm.commerce.member.dataload.mediator.MemberGroupMediator.
Note: When you use a mediator that is provided with HCL Commerce with the Data Load utility, the utility assumes that you are loading data for all columns for a business object. If you want to update the data in only specific columns, configure a column exclusion list for the load process. A column exclusion list causes the Data Load utility to ignore specific columns during the load operation. If you do not use a column exclusion list, the utility updates all columns in the row of a database table row when the utility updates the row. If no value is set in the input file, the utility can replace the existing column value with a default value or set the value to be null. For more information, see Configuring a column exclusion list.