Load data into workspaces using the Data Load utility
The Data Load utility supports loading data into a workspace. By loading data into a workspace we can make and preview changes to managed assets, without affecting what is running on the site.
Task info
By loading data into a workspace, we can gain the following benefits:
- We can preview changes to managed assets without affecting what is running on the site. If you find any errors, we can correct them before the data is committed to the production-ready data on the authoring environment.
- We can add an approval process. Before any data changes are committed to the production-ready data, they must be approved.
If we 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, we 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:
- Load the managed assets data.
- Approve the managed assets data.
- Load the non-managed assets data.
- When we 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.
- The 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
- Enable workspace loading for the Data Load utility. Specify the attributes for our enabling workspace loading within the business context element of the wc-dataload-env.xml data load environment configuration file:
<_config:BusinessContext storeIdentifier="AuroraESite" catalogIdentifier="Extended Sites Catalog Asset Store" 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 assigned to the task group by the Workspace Manager. Specify either this attribute or the taskGroupName attribute.
- taskGroupName
- The name 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 assigned to the task by the Workspace Manager. Specify either this attribute or the taskName attribute.
- taskName
- The name 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.
- 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
- Specify the catalog group unique ID (the generated primary key) in the input file when loading a catalog entry with the parent catalog group.
- 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.
- Load the same input file into a workspace. It is successfully loaded since there are no foreign key constraints in the workspace write schema.
- A foreign constraint exception is received when the content data is approved.
- Example 2
- 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.
- 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.
- Load the input file into the base schema. A unique index violation exception is reported.
- Load the same input file into a workspace. It is successfully loaded since the unique index in the workspace is dropped.
- A unique index violation exception is received when the content data is approved.
Related concepts
Overview of the Data Load utility