Import rules for lists

Import rules for lists#

You can export custom lists to XML files and import custom lists from XML files. There are a few rules for the import process when lists that already exist are imported.

XML format#

The following listing shows an XML export for a cascaded option list with two main options (EMEA and Americas).

<?xml version='1.0' encoding='UTF-8'?>
<ns2:trackplusExchange xmlns:ns2="http://www.trackplus.com/exporter/" version="4.0.0">
    <entityExchange entityId="1002" type="TListBean">
        <entityAttribute name="name"><![CDATA[Customer List]]></entityAttribute>
        <entityAttribute name="repositoryType"><![CDATA[2]]></entityAttribute>
        <entityAttribute name="objectID"><![CDATA[1002]]></entityAttribute>
        <entityAttribute name="description"><![CDATA[A list with customers]]></entityAttribute>
        <entityAttribute name="listType"><![CDATA[3]]></entityAttribute>
        <entityAttribute name="owner"><![CDATA[1]]></entityAttribute>
        <entityAttribute name="deleted"><![CDATA[N]]></entityAttribute>
        <subEntityRelation parentAttributeName="list" type="TOptionBean">
            <trackEntity entityId="1004" type="TOptionBean">
                <entityAttribute name="label"><![CDATA[Americas]]></entityAttribute>
                <entityAttribute name="CSSSTyle"><![CDATA[]]></entityAttribute>
                <entityAttribute name="symbol"/>
                <entityAttribute name="objectID"><![CDATA[1004]]></entityAttribute>
                <entityAttribute name="isDefault"><![CDATA[N]]></entityAttribute>
                <entityAttribute name="sortOrder"><![CDATA[2]]></entityAttribute>
                <entityAttribute name="list"><![CDATA[1002]]></entityAttribute>
                <entityAttribute name="deleted"><![CDATA[N]]></entityAttribute>
            </trackEntity>
            <trackEntity entityId="1009" type="TOptionBean">
                <entityAttribute name="label"><![CDATA[EMEA]]></entityAttribute>
                <entityAttribute name="CSSSTyle"><![CDATA[]]></entityAttribute>
                <entityAttribute name="symbol"/>
                <entityAttribute name="objectID"><![CDATA[1009]]></entityAttribute>
                <entityAttribute name="isDefault"><![CDATA[N]]></entityAttribute>
                <entityAttribute name="sortOrder"><![CDATA[3]]></entityAttribute>
                <entityAttribute name="list"><![CDATA[1002]]></entityAttribute>
                <entityAttribute name="deleted"><![CDATA[N]]></entityAttribute>
            </trackEntity>
        </subEntityRelation>
        <subEntityRelation parentAttributeName="parentList" type="TListBean">
            <trackEntity entityId="1003" type="TListBean">
                <entityAttribute name="parentList"><![CDATA[1002]]></entityAttribute>
                <entityAttribute name="objectID"><![CDATA[1003]]></entityAttribute>
                <entityAttribute name="listType"><![CDATA[4]]></entityAttribute>
                <entityAttribute name="name"><![CDATA[Configure child 1]]></entityAttribute>
                <entityAttribute name="deleted"><![CDATA[N]]></entityAttribute>
                <entityAttribute name="childNumber"><![CDATA[1]]></entityAttribute>
                <subEntityRelation parentAttributeName="list" type="TOptionBean">
                    <trackEntity entityId="1007" type="TOptionBean">
                        <entityAttribute name="label"><![CDATA[GE]]></entityAttribute>
                        <entityAttribute name="CSSSTyle"><![CDATA[]]></entityAttribute>
                        <entityAttribute name="symbol"/>
                        <entityAttribute name="objectID"><![CDATA[1007]]></entityAttribute>
                        <entityAttribute name="isDefault"><![CDATA[N]]></entityAttribute>
                        <entityAttribute name="parentOption"><![CDATA[1004]]></entityAttribute>
                        <entityAttribute name="sortOrder"><![CDATA[1]]></entityAttribute>
                        <entityAttribute name="list"><![CDATA[1003]]></entityAttribute>
                        <entityAttribute name="deleted"><![CDATA[N]]></entityAttribute>
                        <referredDependency dependencyId="1004" dependencyEntityType="TOptionBean"
                            attributeName="parentOption"/>
                    </trackEntity>
                    <trackEntity entityId="1008" type="TOptionBean">
                        <entityAttribute name="label"><![CDATA[Honeywell]]></entityAttribute>
                        <entityAttribute name="CSSSTyle"><![CDATA[]]></entityAttribute>
                        <entityAttribute name="symbol"/>
                        <entityAttribute name="objectID"><![CDATA[1008]]></entityAttribute>
                        <entityAttribute name="isDefault"><![CDATA[N]]></entityAttribute>
                        <entityAttribute name="parentOption"><![CDATA[1004]]></entityAttribute>
                        <entityAttribute name="sortOrder"><![CDATA[2]]></entityAttribute>
                        <entityAttribute name="list"><![CDATA[1003]]></entityAttribute>
                        <entityAttribute name="deleted"><![CDATA[N]]></entityAttribute>
                        <referredDependency dependencyId="1004" dependencyEntityType="TOptionBean"
                            attributeName="parentOption"/>
                    </trackEntity>
                </subEntityRelation>
            </trackEntity>
        </subEntityRelation>
    </entityExchange>
</ns2:trackplusExchange>

The following table describes the entity attributes of the XML file.

Property

Description

entityId

Just a number; you can enter any number here, it is not used by the import process.

type

TListBean for the list, and TOptionBean for an entry in this list.

repositoryType

“0”=private, “1”=workspace, “2”=public.

objectID

A number. For a list (TListBean) it is not used by the import process. For an option (TOptionBean) it is used as an identifier if you want to change other properties of this option through an import.

listType

“1” for a simple, single-level list of options.

name

The name of the list. The name is visible in the Administration user interface.

owner

The primary key of the owner of this list from the table TPERSON. “1” is the user “admin”.

deleted

“Y” or “N”; marks this entry as obsolete and you can no longer select this option. It is, however, still shown in the entries in which it was used.

CSSStyle

An optional CSS style applied to a row in the item browser when an item has a property with this option.

symbol

An optional icon that can be shown in the item browser.

isDefault

Marks this option as the default.

sortOrder

Defines the order in which the options are shown in the components of the selection user interface.

label

The label of the option as the end user will see it. Please note that you can localize the option labels later using the localization editor.

list

The objectID of the list to which this option belongs. It is not used during the import process.

The following listing shows a minimized example of a list definition that can be imported into Allegra.

<?xml version='1.0' encoding='UTF-8'?>
<ns2:trackplusExchange xmlns:ns2="http://www.trackplus.com/exporter/"
version="4.0.0">
    <entityExchange entityId="1008" type="TListBean">
        <entityAttribute name="repositoryType">2</entityAttribute>
        <entityAttribute name="objectID">1008</entityAttribute>
        <entityAttribute name="listType">1</entityAttribute>
        <entityAttribute name="name">Simple global list</entityAttribute>
        <entityAttribute name="owner">1</entityAttribute>
        <entityAttribute name="deleted">N</entityAttribute>
        <subEntityRelation parentAttributeName="list" type="TOptionBean">
            <trackEntity entityId="1023" type="TOptionBean">
                <entityAttribute name="label">Entry A slg</entityAttribute>
                <entityAttribute name="list">1008</entityAttribute>
            </trackEntity>
            <trackEntity entityId="1024" type="TOptionBean">
                <entityAttribute name="label">Entry BN slg</entityAttribute>
                <entityAttribute name="list">1008</entityAttribute>
            </trackEntity>
        </subEntityRelation>
    </entityExchange>
</ns2:trackplusExchange>

Import rules#

A list is assumed to already exist in the database when all of the following properties match:

  • The name of the list

  • The repository type

  • The list type

  • The workspace, if present

  • The identifier of the parent list, if present

An option is to be considered already present when all of the following properties match:

  • The label

  • The list to which it belongs

  • The parent option in cascaded lists

If you change the list name, a new list is created during the import.

If you change the label of an option and keep the list name, a new option is added to the list.

If you select the “Delete child items” option, every child element of the list that is not contained in the XML file is removed from the original list during the import process.

If you select the “Overwrite existing” option, properties that are not used for identification are overwritten during the import process. This way you can change descriptions, icons, and CSS, but not the name or the label of a list or option.