Exemple : Organisation
Utilisez l'utilitaire de chargement de données pour charger des données d'organisation dans la base de données HCL Commerce.
Cet exemple utilise un fichier CSV pour expliquer comment insérer, remplacer ou supprimer vos données. Vous pouvez aussi créer et utiliser un fichier au format XML pour insérer, remplacer ou supprimer vos données. Si vous choisissez de créer et d'utiliser un fichier au format XML, assurez-vous que vos éléments XML utilisent les mêmes noms que ceux des colonnes CSV.
définitions de colonne CSV et d'élément XML
- orgEntityName
- (Chaîne) Nom de l'organisation ou de l'unité organisationnelle. Par exemple, Service Vente au détail. Cette zone ne peut pas être Null.
- parentDN
- (Chaîne) Nom distinctif de l'organisation parent. Par exemple,
o=sample organization,o=seller organization,o=root organization. - orgEntityType
- (Chaîne) Type d'entité d'organisation. Les valeurs admises sont les suivantes :
- Organisation
- OrganizationUnit
- état
- (Chaîne) Indique si l'organisation est verrouillée. Les valeurs admises sont les suivantes :
- Verrouillé
- Déverrouillée
- administratorLastName
- (Chaîne) Nom de l'administrateur. Par exemple, Hall.
- administratorFirstName
- (Chaîne) Prénom de l'administrateur. Par exemple, Mary.
- administratorMiddleName
- (Chaîne) Deuxième prénom de l'administrateur. Par exemple, Patricia.
- address1
- (Chaîne) Ligne d'adresse 1. Par exemple, 42 avenue Sample.
- address2
- (Chaîne) Ligne d'adresse 2.
- address3
- (Chaîne) Ligne d'adresse 3.
- city
- (Chaîne) Ville de l'administrateur. Par exemple, Toronto.
- état
- (Chaîne) Etat de l'administrateur. Par exemple, Ontario.
- country
- (Chaîne) Pays de l'administrateur. Par exemple, Canada.
- zipCode
- (Chaîne) Code postal de l'administrateur. Par exemple, M1M 1W1.
Fichier CSV avec exemples de données d'organisation
Dans cet exemple, le fichier CSV contient des exemples de données d'organisation.Fichier CSV avec exemples de données d'organisation.
En raison du nombre élevé de zones dans le fichier CSV, le tableau suivant a été scindé en deux sections :
| orgEntityName | parentDN | orgEntityType | état | administratorLastName | administratorFirstName | administratorMiddleName |
|---|---|---|---|---|---|---|
| Exemple d'organisation | o=seller organization,o=root organization | Organisation | Déverrouillée | Redmond | Sam | Arnold |
| Département RH | o=sample organization,o=seller organization,o=root organization | OrganizationUnit | Verrouillé | Personnel | Susan | Amy |
| Département Commerce de détail | o=sample organization,o=seller organization,o=root organization | OrganizationUnit | Hall | Mary | Patricia |
| address1 | address2 | address3 | city | état | country | zip code |
|---|---|---|---|---|---|---|
| 1, avenue Sample | Toronto | EN FONCTION | Californie | M1M 1W1 | ||
| 42, avenue Sample | Toronto | EN FONCTION | Californie | M1M 1W1 | ||
| 42, avenue Sample | Toronto | EN FONCTION | Californie | M1M 1W1 |
Données de mappage
Le fragment de code suivant du fichier de configuration wc-loader-organization.xml illustre comment mapper chaque valeur à un chemin de schéma logique d'objet métier.<_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>Médiateur d'objet métier
Le nom de la classe du médiateur est com.ibm.commerce.member.dataload.mediator.OrganizationMediator.Remarque : Lorsque vous utilisez un médiateur qui est fourni avec HCL Commerce avec l'utilitaire de chargement des données, l'utilitaire suppose que vous chargez des données dans toutes les colonnes d'un objet métier. Si vous souhaitez mettre à jour les données dans des colonnes spécifiques seulement, configurez une liste d'exclusion de colonne pour le processus de chargement. Une liste d'exclusion de colonne amène l'utilitaire de chargement de données à ignorer des colonnes spécifiques au cours de l'opération de chargement. Si vous n'utilisez pas de liste d'exclusion de colonne, l'utilitaire met à jour toutes les colonnes dans la ligne d'une table base de données lorsque l'utilitaire met la ligne à jour. Si aucune valeur n'est définie dans le fichier d'entrée, l'utilitaire peut remplacer la valeur de colonne existante par une valeur par défaut ou définir que la valeur sera nulle. Pour plus d'informations, voir Configuration d'une liste d'exclusion de colonnes.