WebSphere Commerce EnterpriseIntroduced in Feature Pack 1WebSphere Commerce Professional

Loading data into workspaces using the Data Load utility

The Data Load utility now supports loading data into a workspace. By loading data into a workspace you can make and preview changes to managed assets, without affecting what is running on your site.

About this task

By loading data into a workspace, you can gain the following benefits:
  • You can preview changes to managed assets without affecting what is running on your site. If you find any errors, you can correct them before the data is committed to the production-ready data on the authoring server.
  • You can add an approval process. Before any data changes are committed to the production-ready data, they must be approved.
If you are loading data into a workspace, take note of the following considerations:
  • Data that resolves into managed assets are loaded directly into the workspace. Data that resolves into non-managed assets are loaded directly into the production-ready data on the authoring server.
  • If you load managed assets and non-managed assets together when workspace is enabled, you might get an ID resolver exception or a foreign key violation exception. To prevent getting an ID resolver exception or a foreign key violation exception:
    1. Load the managed assets data.
    2. Approve the managed assets data.
    3. Load the non-managed assets data.
  • When you are loading data into a workspace, the Data Load utility respects the locking policy set in the workspace. For more information about workspaces locking policies, see Workspaces locking policies.
  • Introduced in Feature Pack 3The following constraints in the workspace write schema are relaxed:
    • Foreign keys to associated tables are dropped.
    • Unique indexes are relaxed to indexes.
    For more information about the workspace write schema, see Workspaces data model.

Procedure

  1. Enable workspace loading for the Data Load utility.
    Specify the attributes for your enabling workspace loading within the business context element of the wc-dataload-env.xml data load environment configuration file:
    <_config:BusinessContext storeIdentifier="Madisons" catalogIdentifier="Madisons" langId="-1" currency="USD"
    	workspaceIdentifier="W_10001" taskGroupIdentifier="G_10001" taskIdentifier="T_10001">
    </_config:BusinessContext>
    The following workspace attributes can be specified in the business context element:
    workspaceIdentifier
    The workspace code is the system generated identifier for the workspace, not the name that is assigned to the workspace by the Workspace Manager.
    taskGroupIdentifier
    The task group code is the system generated identifier for the task groups. This code is not the name that is assigned to the task group by the Workspace Manager. Specify either this attribute or the taskGroupName attribute.
    taskGroupName
    The name that is assigned to the task group by the Workspace Manager. Specify either this attribute or the taskGroupIdentifier attribute. Since multiple task groups can have the same task group name, when you specify this attribute, ensure that there is only one working task group with the specified task group name. Otherwise, the Data Load utility throws an exception.
    taskIdentifier
    The task code is the system generated identifier for the task, not the name that is assigned to the task by the Workspace Manager. Specify either this attribute or the taskName attribute.
    taskName
    The name that is assigned to the task by the Workspace Manager. Specify either this attribute or the taskIdentifier attribute. Since multiple tasks can have the same task name, when you specify this attribute, ensure that there is only one working task with the specified task name. Otherwise, the Data Load utility throws an exception.
  2. Run the Data Load utility to load data into the workspace.
    Note: When you load data into a workspace, do not use the unique ID in your input file. If you use the unique ID and a foreign key or unique index violation occurs, the data load into the workspace does not detect these errors. An exception occurs only when the content data is approved.
    Example 1
    1. Specify the catalog group unique ID (the generated primary key) in the input file when you load a catalog entry with the parent catalog group.
    2. Load the input file into the base schema. A foreign key violation is reported since the unique catalog group ID does not exist in the database.
    3. Load the same input file into a workspace. It is successfully loaded since there are no foreign key constraints in the workspace write schema.
    4. A foreign constraint exception is received when the content data is approved.
    Example 2
    1. Specify both the catalog group unique ID (the generated primary key) and the catalog group identifier (part of the unique index) in the input file.
    2. The catalog group identifier is already in the database. Also, the catalog group unique ID specified in the input file is different from the ID stored in the database for the same catalog group identifier.
    3. Load the input file into the base schema. A unique index violation exception is reported.
    4. Load the same input file into a workspace. It is successfully loaded since the unique index in the workspace is dropped.
    5. A unique index violation exception is received when the content data is approved.