Loading user data

You can load user data to the WebSphere Commerce database tables by using loading utilities, SQL, or access beans.

About this task

When you load user data into the database, you must load the following database tables:

Optionally, you can also load the following tables:

Use the following as a reference when you load these tables.

  • MEMBER (MEMBER_ID( **1**), TYPE='U', STATE=1)
  • USERS (USERS_ID=MEMBER.MEMBER_ID, DN ( **2**), REGISTERTYPE='R', PROFILETYPE=( **3**) , LANGUAGE_ID)
  • USERREG (USERS_ID=USERS.USERS_ID, STATUS=1, LOGONID, SALT ( **4**), LOGONPASSWORD ( **5**), PASSWORDEXPIRED=0 )
  • ADDRBOOK (MEMBER_ID=USERS.USERS_ID)
  • ADDRESS (MEMBER_ID=USERS.USERS_ID, STATUS='P', NICKNAME=USERREG.LOGONID, SELFADDRESS=1 (**6**))
  • MBRREL ( **7**)
  • MBRROLE ( **8**)
Where:
**1**
The MEMBER_ID primary key space (KEYS table) is shared by the USERS, ORGENTITY, and MBRGRP tables.
**2**
The DN should be lowercase and in the following format: "uid=" + logonid + "," + parent_organization_DN"
**3**
Type 'C' is for consumer direct users; 'B' is for a business direct users. Consumer direct users are listed in the WebSphere Commerce Accelerator. B2B direct users are listed in the Organization Administration Console.
**4**
A random string that is unique to each user. This string is appended to the password before hashing.
**5**
The encrypted logon password that is generated when you use the wcs_password utility, which takes the plain text password and SALT value as input values.
**6**
A user can have only one permanent self-address (SELFADDRESS=1, STATUS='P'). This is the address that is associated with the user registration. Other permanent addresses in the user address book should have SELFADDRESS=0 and STATUS='P'. Any old addresses that change are marked temporary (STATUS='T').
**7**
One row in the MBRREL table should be created for each ancestor. For example, if you are creating a user under the default organization, then create one record to indicate that the parent (sequence=1) is the default organization, and the grandparent (sequence = 2) is the root organization.
**8**
The MBRROLE table defines the roles that the user plays in the system. By default, you want a user that registers to a store to have the Registered Customer role (-29) in the store organization.
There are different methods for loading data into your tables:
  • Data Load utility: Refer to the Data Load utility to load your user data.
  • Massload utility: Refer to the massload utility to load your user data.

    Feature Pack 6 or laterThe massload utility is deprecated for WebSphere Commerce Version 7 Feature Pack 6. The Data Load utility is the recommended command-line loading utility. If you are currently using the mass load utility, you are recommended to switch to the Data Load utility to load your CSV and XML input files into your target database. If your system contains scheduled and automated processes that use massload, it is recommended that you update these processes to use the Data Load utility. Other WebSphere Commerce utilities that use the massload utility, such as the acpload utility, continue to use the massload utility in WebSphere Commerce Version 7 Feature Pack 6. If you have business reasons to continue using the massload utility, you can continue to use this utility. For more information about the Data Load utility, see Overview of the Data Load utility. You can switch to the Data Load utility by using the TableObjectMediator to load your data when no business object mediator exists for the data that you are loading. For more about the TableObjectMediator formation, see Data Load utility table-based mediator and builder.

  • SQL: Use SQL to load the user data. The current MEMBER.MEMBER_ID value to use can be found by completing the following steps:
    Note: The MEMBER.MEMBER_ID and USERS.USERS_ID must be the same, and the USERS table primary key ranges from 1 to 6999999999999999999.
    1. Stop the WebSphere Commerce Server.
    2. After the SQL inserts are completed, load the KEYS table. You must load the KEYS table so that the WebSphere Commerce Server inserts data with a primary key value greater that the ones that were used in the manual insert. Run the following SQL:
      update keys set counter = (select max(users_id) from users) where tablename = 'users'
    3. Start the WebSphere Commerce Server. The next user_id that is used by WebSphere Commerce to create a new user is at the counter value +1.
  • Access Beans: Use the following access beans:
    • To populate the MEMBER, USERS and MBRREL tables, use the following access bean: com.ibm.commerce.user.objects.UserAccessBean
      Note: If you call the setParentMember() method on the UserAccessBean, it creates the rows in the MBRREL table automatically
    • To populate the ADDRBOOK and ADDRESS tables, use the following access bean: com.ibm.commerce.user.objects.AddressAccessBean
    • To populate the MBRROLE table, use the following access bean: com.ibm.commerce.user.objects.MemberRoleAccessBean
    • To populate the USERPROF table, use the following access bean: com.ibm.commerce.user.objects.UserProfileAccessBean
    • To populate the BUSPROF table, use the following access bean: com.ibm.commerce.user.objects.BusinessProfileAccessBean
    • To populate the USERDEMO table, use the following access bean: com.ibm.commerce.user.objects.DemographicsAccessBean
    • To populate the MBRATTRVAL table, use one of the following access beans, depending on the data type: com.ibm.commerce.user.objects.MemberAttributeStringValueAccessBean com.ibm.commerce.user.objects.MemberAttributeIntegerValueAccessBean com.ibm.commerce.user.objects.MemberAttributeFloatValueAccessBean com.ibm.commerce.user.objects.MemberAttributeDatetimeValueAccessBean