Ejemplo: Organización

Utilice el programa de utilidad de carga de datos para cargar datos de organización en la base de datos de HCL Commerce.

Este ejemplo utiliza un archivo CSV para mostrar cómo insertar, sustituir o eliminar los datos. También puede crear y utilizar un archivo con formato XML para insertar, sustituir o eliminar los datos. Si decide crear y utilizar un archivo con formato XML, asegúrese de que los elementos XML utilizan los mismos nombres que los nombres de columna CSV.

Definiciones de columnas CSV y de elementos XML

orgEntityName
(Serie) El nombre de la organización o unidad organizativa. Por ejemplo, Retail Department. Este campo no puede ser nulo.
parentDN
(Serie) El nombre distinguido de la organización padre. Por ejemplo, o=sample organization,o=seller organization,o=root organization.
orgEntityType
(Serie) El tipo de entidad de organización. Los valores válidos son:
  • Organización
  • OrganizationUnit
Este campo no puede ser nulo.
status
(Serie) Especifica si la organización está bloqueada. Los valores válidos son:
  • Locked
  • Unlocked
administratorLastName
(Serie) El apellido del administrador. Por ejemplo, Hall.
administratorFirstName
(Serie) El nombre del administrador. Por ejemplo, Mary.
administratorMiddleName
(Serie) El segundo nombre del administrador. Por ejemplo, Patricia.
address1
(Serie) La línea de dirección 1. Por ejemplo, 42 Sample Way.
address2
(Serie) La línea de dirección 2.
address3
(Serie) La línea de dirección 3.
city
(Serie) La ciudad del administrador. Por ejemplo, Toronto.
estado
(Serie) El estado del administrador. Por ejemplo, Ontario.
country
(Serie) El país del administrador. Por ejemplo, Canadá.
zipCode
(Serie) El código postal del administrador. Por ejemplo, M1M 1W1.

Archivo CSV con datos de archivo de ejemplo

En este ejemplo, el archivo CSV contiene datos de organización de ejemplo.

El archivo CSV con unos datos de organización de ejemplo.

Debido a la gran cantidad de campos de este archivo CSV, la tabla siguiente se divide en dos secciones:
Archivo CSV con formato con cabeceras de columna
orgEntityName parentDN orgEntityType status administratorLastName administratorFirstName administratorMiddleName
Sample Organization o=seller organization,o=root organization Organización Unlocked Redmond Sam Arnold
HR Department o=sample organization,o=seller organization,o=root organization OrganizationUnit Bloqueado Personnel Susan Amy
Retail Department o=sample organization,o=seller organization,o=root organization OrganizationUnit Hall Mary Patricia
Archivo CSV con formato con cabeceras de columna
address1 address2 address3 city estado country zip code
1 Sample Way Toronto Barcelona CA M1M 1W1
42 Sample Way Toronto Barcelona CA M1M 1W1
42 Sample Way Toronto Barcelona CA M1M 1W1

Correlación de datos

El siguiente fragmento de código del archivo de configuración wc-loader-organization.xml muestra cómo correlacionar cada valor con una vía de acceso del esquema lógico de objetos de negocio.
<_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>

Mediador de objetos de negocio

El nombre de la clase de mediador es com.ibm.commerce.member.dataload.mediator.OrganizationMediator.
Nota: Cuando utiliza un mediador que se proporciona con HCL Commerce con el programa de utilidad de carga de datos, el programa de utilidad de carga de datos da por supuesto que está cargando datos para todas las columnas para un objeto de negocio. Si desea actualizar los datos solamente en columnas específicas, configure una lista de exclusión de columnas para el proceso de carga. Una lista de exclusión de columnas hace que el programa de utilidad de carga de datos ignore columnas concretas durante la operación de carga. Si no utiliza una lista de exclusión de columnas, el programa de utilidad actualiza todas las columnas de la fila de una fila de tabla de base de datos cuando el programa de utiliza actualiza la fila. Si el valor se establece en el archivo de entrada, el programa de utilidad puede sustituir el valor de columna existente por un valor predeterminado o establecer el valor en nulo. Para obtener más información, consulte Configuración de una lista de exclusión de columnas.