Create or Edit an Import Template

While users with sufficient permissions can create and edit import templates, it is recommended that the system administrator verifies and tests them to make sure they work correctly. Import templates should be tested with one or two records on your development environment before using them on your production system.

The configuration options are the same for creating and editing import templates. The only difference is in how the Manage Import Template editor is opened.

To create or edit an import template:

  1. Open the Import Template tab: Open the Feature Sidebar, open the Administration folder, open the Templates folder, and select Import Template.

  2. To create an import template, click the Add button in the Import Template tab’s Activity Bar. A new import template will be opened in the Manage Import Template editor tab. The Manage Import Template editor tab will initially contain only the Details page, however, after you enter the required fields in the Details page and click the Save and Continue button, the remaining Manage Import Template editor pages will appear and all the pages can be edited as described in the following steps.
  3. To edit an existing import template, select the import template and click the Edit button in the Import Template pane’s Activity Bar. The import template will be opened in the Manage Import Template editor tab.
  4. The Manage Import Template editor has three pages of configuration options: Edit the configuration options as desired.
  5. To save your changes to the import template, open the Attribute Mapping page of the Manage Import Template editor and click Save. For changes to Related Repositories to be saved, at least on attribute must be mapped.

Details

The Manage Import Template editor opens in the Details page, which contains the following configuration settings:

  • Name: (Required) The name of the import template. This field can support multi-language translations.

  • Description: (Optional) A description of the import template. This field can support multi-language translations.

  • Root Repository: The top-level repository that values will be imported into. Once the Details page has been saved for the first time, this field may no longer be changed.

  • TypeCode: Standard or Category as defined below. Once the Details page has been saved for the first time, this field may no longer be changed.

    Option Pros Cons
    Standard (All versions of EnterWorks.) Able to use VTL scripts or triggers to alter records that have been imported. Default system configuration limits an import file to 1000 columns or less (depending on the data types of the columns). The limit can be changed by modifying the max.file.download.size shared configuration property.
    Category (Enable 9 and later only.) Able to import files with a virtually unlimited number of columns. (Typically, in files with a large number of columns, most columns are mapped to category attributes.) Not able to use VTL scripts or triggers to alter records that have been imported. Also, you can only import into a single repository.
  • Advanced Import Class Path: Specifies a class path for the JAVA class that will be invoked upon using the import template. This only appears if Type Code is Standard.

  • Contents Replacement: If the Contents Replacement checkbox is marked, all records in the root repository will be replaced with the imported records. This option will not appear the first time the Details page is saved. Also, it is only available if the import only affects the root repository. No linked repository records can be replaced.

    WARNING: This option should be used only if all repository records are to be deleted and replaced with the data being imported.

    In order to use the Contents Replacement function, the repository must include a status attribute that will be used to mark records that existed in the repository prior to the import but were not replaced with a record from the import file. This status attribute is defined with the special function indicator of Status. The value indicated in Inactive Status Value is entered into the status attribute in records that were not replaced.

  • Inactive Status Value: (Required if Contents Replacement is marked): Defines the value to be entered in the status attribute used to indicate records that were not replaced when a file was imported. This only appears if Contents Replacement is marked.

Edit the Details page’s configuration options as desired. Click Next to continue to the Related Repositories page.

Related Repositories

The Related Repositories page allows the user to specify which repositories to include in the import. To do so:

  1. Click the arrow icons to expand the repository tree to expose any linked repositories.
  2. To include a repository in the import template, check the checkbox to the left of its name. You cannot check a child repository until you have checked all its parent repositories.
  3. Edit the Related Repositories page’s configuration options as desired.
  4. When you are finished selecting the related repositories, click the Save and Continue button to continue to the Attribute Mapping page. The changes you made on the Related Repositories page will only be saved if you have already added attributes on the Attribute Mapping page. Otherwise, you will move to the Attribute Mapping page but your changes will not be saved.

Attribute Mapping

The Attribute Mapping page allows you to specify which target attributes will be included in the import template.

The Attribute Mapping displays the list of target attributes currently defined for the template. The display order of the attributes can be changed by clicking the head of the columns. You can search for attributes by using the search box at the top of the page.

Changes made on the Attribute Mapping page will not be saved until the Save button has been clicked. In order to save successfully, you must have included at least one key target attribute.

The functions available on the Attribute Mapping page are:

Add Attributes to the Template's Attribute List

To add a target attribute to the template's attribute list:

  1. In the Attribute Mapping page, click the Select Attributes button on the Manage Import Template tab's Activity bar. The Attribute Mapping editor will appear.
  2. The following controls affect the list of attributes displayed that can be added to the template's attribute list:
    • Repository: The Repository dropdown lists the target repositories included on the Related Repositories page. Selecting a repository will cause its attributes to be displayed in the list of available attributes.

    • Category: This option appears for repositories that have a taxonomy. Clicking in the Category box will display the taxonomy node tree. Selecting a node will cause its category attributes to be displayed in the list of available attributes.

    • Attribute Filter: To filter the available attributes list based on attribute name, in the Attribute Filter field, type in consecutive alpha-numeric characters that appear in the desired attribute name(s). The Target Attribute list will display all attributes in all tabs that contain the filter string.

  3. To add an attribute, select it, then use the right arrow button to add the attribute to the template's list of attributes.
  4. When you are finished adding target attributes, to close the Attribute Mapping editor, either click the left arrow icon at the top right of the Attribute Mapping editor, or click anywhere outside of the editor.
  5. To save your changes to the template's attribute list, click the Save button.

Add Attributes to the Template's Attribute List Using an Imported Sample File

To define an import template's attribute list, you can import a sample file that has the same columns as the files you want to import. This is different from importing an actual template which imports a template definition file in XML format, (see Import an Import Template).

When you import a sample file, the attributes will be added to the template's list of attributes. The names of the imported columns will be stored in both the attributes list's source and target columns. If the names of the target attributes are different, you must map the new attributes to the correct target attributes, as described in Manage Attribute Mapping.

To add attributes by importing a sample file:

  1. In the Attribute Mapping page, click the More icon on the Manage Import Template tab's Activity bar, and select Import Template. An Import Template - Import window will appear. Set the configuration options as desired:
    • File Name: Select the sample file you want to import.

    • Advanced Options:

      • File Format: Select the file's format.

      • File Encoding: Select the file's encoding.

  2. When you are finished editing the configuration options, click the OK button. The columns in the file will be added to the template's attribute list.
  3. If necessary, map the new attributes to the correct target attributes as described in Manage Attribute Mapping.
  4. To save your changes to the template's attribute list, click the Save button.

Remove an Attribute from the Template's Attribute List

To remove an attribute from the template's attribute list:

  1. In the Attribute Mapping page, select the attribute to remove.
  2. Click the Delete button on the Manage Import Template tab's Activity bar. The attribute will be removed from the template's list of included attributes.
  3. To save your changes to the template's attribute list, click the Save button.

Manage Attribute Mapping

The configuration options for each target attribute listed on the Attribute Mapping page can be edited by clicking its value. The options are:

  • Source Column: The name of the column in the source file that will be mapped to the target attribute. Note that this name must match the name of the column in the source file.

  • Target Attribute: The name of the target attribute that the source column will be mapped to. To edit this field, click it and select a different attribute from the related repositories.

  • Target Repository: The repository that contains the target attribute.

  • Is Key: Specifies if the attribute is a primary key. EnterWorks will use primary key(s) to determine if a record already exists in the target repository and it should be updated, or if a new record needs to be created.

  • Key Order: This field is automatically filled. If you have more than one key per target repository, this field specifies the order of the keys. While this field is editable, it is seldom changed from the automatic setting.

  • Default Value: If a default value is specified and the source file does not include a value for a record’s attribute, the default value will be used.

To save your changes to the template's attribute list, click the Save button.

Use an Import Template to Export a Sample Import File

You can export a sample import file based on the template you currently have defined. This is different from exporting an actual template which exports a template definition file in XML format, (see Export an Import Template).

To export a sample import file:

  1. In the Attribute Mapping page, click the More icon on the Manage Import Template tab's Activity bar, and select Export Template. A sample import file will be exported.