Example: Organization
Use the Data Load utility to load organization data into the WebSphere Commerce database.This example uses a CSV file to demonstrate how to insert, replace, or delete your data. We 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
- orgEntityName
- (String) The name of the organization or organization unit. For example, Retail Department. This field cannot be null.
- parentDN
- (String) The distinguished name of the parent organization. For example, o=sample organization,o=seller organization,o=root organization.
- orgEntityType
- (String) The type of organization entity. Valid values are:
- Organization
- OrganizationUnit
This field cannot be null.
- status
- (String) Specifies whether the organization is locked. Valid values are:
- Locked
- Unlocked
- administratorLastName
- (String) The last name of the administrator. For example, Hall.
- administratorFirstName
- (String) The first name of the administrator. For example, Mary.
- administratorMiddleName
- (String) The middle name of the administrator. For example, Patricia.
- address1
- (String) The address line 1. For example, 42 Sample Way.
- address2
- (String) The address line 2.
- address3
- (String) The address line 3.
- city
- (String) The city for the administrator. For example, Toronto.
- state
- (String) The state for the administrator. For example, Ontario.
- country
- (String) The country for the administrator. For example, Canada.
- zipCode
- (String) The postal code for the administrator. For example, M1M 1W1.
CSV file with sample organization data
In this example, the CSV file contains sample organization data.CSV file with sample organization data. Due to the large number of fields in this CSV file, the following table is split into two sections:
Formatted CSV file with column headings
orgEntityName parentDN orgEntityType status administratorLastName administratorFirstName administratorMiddleName Sample Organization o=seller organization,o=root organization Organization Unlocked Redmond Sam Arnold HR Department o=sample organization,o=seller organization,o=root organization OrganizationUnit Locked Personnel Susan Amy Retail Department o=sample organization,o=seller organization,o=root organization OrganizationUnit Hall Mary Patricia
Formatted CSV file with column headings
address1 address2 address3 city state country zip code 1 Sample Way Toronto ON CA M1M 1W1 42 Sample Way Toronto ON CA M1M 1W1 42 Sample Way Toronto ON CA M1M 1W1
Mapping data
The following code snippet from the wc-loader-organization.xml configuration file demonstrates how to map each value to a business object logical schema path.<_config:DataMapping> <!-- The unique reference number of the organization --> <_config:mapping xpath="OrganizationIdentifier/UniqueID" value="orgEntityId" /> <!-- The distinguished name of the organization --> <_config:mapping xpath="OrganizationIdentifier/DistinguishedName" value="distinguishedName" /> <!-- The unique reference number of the parent organization --> <_config:mapping xpath="ParentOrganizationIdentifier/UniqueID" value="parentMemberId" /> <!-- The distinguished name of the parent organization --> <_config:mapping xpath="ParentOrganizationIdentifier/DistinguishedName" value="parentDN" /> <!-- The organization name --> <_config:mapping xpath="OrganizationName" value="orgEntityName" /> <!-- The business category --> <_config:mapping xpath="BusinessCategory" value="businessCategory" /> <!-- The description --> <_config:mapping xpath="Description/value" value="description" /> <!-- The legal identifier --> <_config:mapping xpath="LegalIdentifier" value="legalId" /> <!-- The language id <_config:mapping xpath="ContactInfo/language" value="language" /> --> <!-- The address id <_config:mapping xpath="ContactInfo/ContactInfoIdentifier/UniqueID" value="addressId" /> --> <!-- The nickname --> <_config:mapping xpath="ContactInfo/ContactInfoIdentifier/ExternalIdentifier/ContactInfoNickName" value="nickName" /> <!-- The orgentity id --> <_config:mapping xpath="ContactInfo/ContactInfoIdentifier/ExternalIdentifier/OrganizationIdentifier/UniqueID" value="orgEntityId" /> <!-- The distinguished name --> <_config:mapping xpath="ContactInfo/ContactInfoIdentifier/ExternalIdentifier/OrganizationIdentifier/DistinguishedName" value="distinguishedName" /> <!-- The title --> <_config:mapping xpath="ContactInfo/ContactName/PersonTitle" value="personTitle" /> <!-- The business title --> <_config:mapping xpath="ContactInfo/ContactName/BusinessTitle" value="businessTitle" /> <!-- The last name --> <_config:mapping xpath="ContactInfo/ContactName/LastName" value="lastName" /> <!-- The first name --> <_config:mapping xpath="ContactInfo/ContactName/FirstName" value="firstName" /> <!-- The middle name --> <_config:mapping xpath="ContactInfo/ContactName/MiddleName" value="middleName" /> <!-- The address type --> <_config:mapping xpath="ContactInfo/Address/type" value="SB" valueFrom="Fixed" /> <!-- The primary address flag --> <_config:mapping xpath="ContactInfo/Address/primary" value="primary" /> <!-- The address line 1 --> <_config:mapping xpath="ContactInfo/Address/AddressLine[0]" value="address1" /> <!-- The address line 2 --> <_config:mapping xpath="ContactInfo/Address/AddressLine[1]" value="address2" /> <!-- The address line 3 --> <_config:mapping xpath="ContactInfo/Address/AddressLine[2]" value="address3" /> <!-- The internal office address line --> <_config:mapping xpath="ContactInfo/Address/InternalOfficeAddress" value="internalOfficeAddress" /> <!-- The city --> <_config:mapping xpath="ContactInfo/Address/City" value="city" /> <!-- The state or province name --> <_config:mapping xpath="ContactInfo/Address/StateOrProvinceName" value="state" /> <!-- The country --> <_config:mapping xpath="ContactInfo/Address/Country" value="country" /> <!-- The postal code --> <_config:mapping xpath="ContactInfo/Address/PostalCode" value="zipCode" /> <!-- The address user data field X <_config:mapping xpath="ContactInfo/Address/UserData/UserDataField/X" value="addressUserDataFieldX" /> --> <!-- The primary phone number --> <_config:mapping xpath="ContactInfo/Telephone1/Value" value="phone1" /> <!-- The primary phone number type --> <_config:mapping xpath="ContactInfo/Telephone1/type" value="phone1Type" /> <!-- The primary phone number listed indicator --> <_config:mapping xpath="ContactInfo/Telephone1/publish" value="publishPhone1" /> <!-- The primary phone number user data field X <_config:mapping xpath="ContactInfo/Telephone1/UserData/UserDataField/X" value="phone1UserDataFieldX" /> --> <!-- The secondary phone number --> <_config:mapping xpath="ContactInfo/Telephone2/Value" value="phone2" /> <!-- The secondary phone number type --> <_config:mapping xpath="ContactInfo/Telephone2/type" value="phone2Type" /> <!-- The secondary phone number listed indicator --> <_config:mapping xpath="ContactInfo/Telephone2/publish" value="publishPhone2" /> <!-- The secondary phone number user data field X <_config:mapping xpath="ContactInfo/Telephone2/UserData/UserDataField/X" value="phone2UserDataFieldX" /> --> <!-- The best calling time --> <_config:mapping xpath="ContactInfo/BestCallingTime" value="bestCallingTime" /> <!-- The primary email address --> <_config:mapping xpath="ContactInfo/EmailAddress1/Value" value="email1" /> <!-- The primary email address user data field X <_config:mapping xpath="ContactInfo/EmailAddress1/UserData/UserDataField/X" value="email1UserDataFieldX" /> --> <!-- The secondary email address --> <_config:mapping xpath="ContactInfo/EmailAddress2/Value" value="email2" /> <!-- The secondary email address user data field X <_config:mapping xpath="ContactInfo/EmailAddress2/UserData/UserDataField/X" value="email2UserDataFieldX" /> --> <!-- The primary fax number --> <_config:mapping xpath="ContactInfo/Fax1/Value" value="fax1" /> <!-- The primary fax number user data field X <_config:mapping xpath="ContactInfo/Fax1/UserData/UserDataField/X" value="fax1UserDataFieldX" /> --> <!-- The secondary fax number --> <_config:mapping xpath="ContactInfo/Fax2/Value" value="fax2" /> <!-- The secondary fax number user data field X <_config:mapping xpath="ContactInfo/Fax2/UserData/UserDataField/X" value="fax2UserDataFieldX" /> --> <!-- The primary mobile phone number --> <_config:mapping xpath="ContactInfo/MobilePhone1/Value" value="mobilePhone1" /> <!-- The country of the primary mobile phone number --> <_config:mapping xpath="ContactInfo/MobilePhone1/Country" value="mobilePhone1Country" /> <!-- The primary mobile phone number user data field X <_config:mapping xpath="ContactInfo/MobilePhone1/UserData/UserDataField/X" value="mobilePhone1UserDataFieldX" /> --> <!-- The organization name --> <_config:mapping xpath="ContactInfo/OrganizationName" value="organizationName" /> <!-- The organization unit name --> <_config:mapping xpath="ContactInfo/OrganizationUnitName" value="organizationUnitName" /> <!-- The geographical shipping code --> <_config:mapping xpath="ContactInfo/GeographicalShippingCode" value="shippingGeoCode" /> <!-- The geographical tax code --> <_config:mapping xpath="ContactInfo/GeographicalTaxCode" value="taxGeoCode" /> <!-- The address Field1 --> <_config:mapping xpath="ContactInfo/Attributes/addressField1" value="addressField1" /> <!-- The address Field2 --> <_config:mapping xpath="ContactInfo/Attributes/addressField2" value="addressField2" /> <!-- The address Field3 --> <_config:mapping xpath="ContactInfo/Attributes/addressField3" value="addressField3" /> <!-- The billing code --> <_config:mapping xpath="ContactInfo/Attributes/billingCode" value="billingCode" /> <!-- The billing code type --> <_config:mapping xpath="ContactInfo/Attributes/billingCodeType" value="billingCodeType" /> <!-- The package suppression --> <_config:mapping xpath="ContactInfo/Attributes/packageSuppression" value="packageSuppression" /> <!-- The ContactInfo user data field X <_config:mapping xpath="ContactInfo/UserData/UserDataField/X" value="contactInfoUserDataFieldX" /> --> <!-- The context attribute <_config:mapping xpath="ContextAttribute/Name" value="contextAttributeX" /> <_config:mapping xpath="ContextAttribute/AttributeValue/Value" value="contextAttributeValueX" /> <_config:mapping xpath="ContextAttribute/AttributeValue/StoreID" value="contextAttributeXStoreId" /> --> <!-- The orgentity Field1 --> <_config:mapping xpath="Attributes/orgEntityField1" value="orgEntityField1" /> <!-- The orgentity Field2 --> <_config:mapping xpath="Attributes/orgEntityField2" value="orgEntityField2" /> <!-- The orgentity Field3 --> <_config:mapping xpath="Attributes/orgEntityField3" value="orgEntityField3" /> <!-- The administrator first name --> <_config:mapping xpath="Attributes/administratorFirstName" value="administratorFirstName" /> <!-- The administrator last name --> <_config:mapping xpath="Attributes/administratorLastName" value="administratorLastName" /> <!-- The administrator middle name --> <_config:mapping xpath="Attributes/administratorMiddleName" value="administratorMiddleName" /> <!-- The tax payer id --> <_config:mapping xpath="Attributes/taxPayerId" value="taxPayerId" /> <!-- The user data field X <_config:mapping xpath="UserData/UserDataField/X" value="userDataFieldX" /> --> <!-- The registration approval status --> <_config:mapping xpath="registrationApprovalStatus" value="registrationApprovalStatus" /> <!-- The organization entity status --> <_config:mapping xpath="status" value="status" /> <!-- The organization entity type --> <_config:mapping xpath="type" value="orgEntityType" /> </_config:DataMapping>
Business object mediator
The mediator class name is OrganizationMediator.Note: When we use a mediator that is provided with WebSphere Commerce with the Data Load utility, the utility assumes that we are loading data for all columns for a business object. 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. See Configure a column exclusion list.