/
Import / Export Related Sort Orders

Import / Export Related Sort Orders

Prerequisite

Any base feature (e.g. “Product”) may have other features in its configuration. If one of those other features is a selectable feature (e.g. “Category”), then the “Product” feature items can be categorized using “Category” feature items by creating a custom section in Perfion. In this section user can create a special view, where “Product” items will be shown in the right window and in the left window there will be “Category” items. Then user can select any “Category” feature item in the left window to filter out “Product” feature items in the right window. Example of such custom section use is shown in Figure 1, where CategorizerFeature feature is a “Category” feature (further called categorizer feature) and RelatedFeature is a “Product” feature (further called related feature).

 

Figure 1: Categorizer and related features in Perfion

In order to be able to sort related feature items for each categorizer feature item one has to enable “Sortable Related Items” data property for categorizer feature. If this data property is enabled, then one can change the order of related feature items in the right window by using order change buttons “up arrow” (Alt+Up) and “down arrow” (Alt+Down) (refer to Figure 1). After ordering RelatedFeature items for chosen CategorizerFeature item, the order values will be saved to Perfion database. The related feature items can be ordered independently for each categorizer item and related sort order import and export allows to import and export these orders.

Supported Feature Data Types

Related sort order supports the following feature data types:

Compound

Table

Search

Date

File

Image

Link

Number

String

Text

No

No

No

Yes

Yes

Yes

Yes

Yes

Yes

Yes

Compound data type is considered as deprecated while Table and Search data types are not supported, because they cannot have related sort orders.

Supported Feature Data Properties

Related sort orders data import depends on data properties and allows importing data only to those features which meet specifications. The table below shows which data properties are supported.

Data property

Categorizer feature

Related feature

Selectable

Mandatory

Mandatory

Selectable with sortable related items (Sortable Related Items)

Mandatory

-

Import

In this section we will go into details how to specify import data and import related sort orders.

Data Format

The import data is table like data and can be specified as import data headers and import data values.

Related sort order import data format is shown in the table below.

Data header

Mandatory

Description

Cat_Feature

Yes/No

Categorizer feature name or ID. If numeric value, then it will be treated as an ID and otherwise as a name.

Format: string value, max 100 chars.

It is a mandatory parameter if categorizer feature item is defined using its base value (Cat_Value) or localizable base value (Cat_Value_<LanguageCode>).

If categorizer feature item is defined using ID, then this column is not used.

Note, the name is case insensitive.

Cat_ID

Cat_Value

Cat_Value_<LanguageCode>

Yes

Categorizer feature item ID, base value or localizable base value.

Format: string value.

It is a mandatory parameter.

When categorizer feature item is defined by ID:

  • One must use Cat_ID data header.

  • One must use integer values >0 and all IDs must exist in Perfion.

  • When categorizer feature item is defined by base value:

  • One can use Cat_Value or Cat_Value_<LanguageCode> data headers.

  • <LanguageCode> is 2 or 3 character language code. Refer to “Perfion Language Codes” manual.

  • By defining a language code one sets a default language for all categorizer feature items, but that language will be used only with those items, which are localizable.

  • The base value must be defined using a full path, e.g. including its all parent node values. Refer to “Item Base Values” for more information how base values must be defined.

  • The import data must also have categorizer feature data header (Cat_Feature).

  • When categorizer feature item is defined by localizable base value:

  • One must use Cat_Value_<LanguageCode> data header.

  • The same rules apply as for non localizable base value.

Rel_Feature

Yes/No

Related feature name or ID. If numeric value, then it will be treated as an ID and otherwise as a feature name.

Format: string value, max 100 chars.

It is a mandatory parameter if related feature item is defined using its base value (Rel_Value) or localizable base value (Rel_Value_<LanguageCode>).

If related feature item is defined using ID, then this column is not used.

Note, the name is case insensitive.

Rel_ID

Rel_Value

Rel_Value_<LanguageCode>

Yes

Related feature item ID, base value or localizable base value.

Format: string value.

It is a mandatory parameter.

When related feature item is defined by ID:

  • One must use Rel_ID data header.

  • One must use integer values >0 and all IDs must exist in Perfion.

  • When related feature item is defined by base value:

  • One can use Rel_Value or Rel_Value_<LanguageCode> data headers.

  • <LanguageCode> is 2 or 3 character language code. Refer to “Perfion Language Codes” manual.

  • By defining a language code one sets a default language for all related feature items, but that language will be used only with those items, which are localizable.

  • The base value must be defined using a full path, e.g. including its all parent node values. Refer to “Item Base Values” for more information how base values must be defined.

  • The import data must also have related feature data header (Rel_Feature).

  • When related feature item is defined by localizable base value:

  • One must use Rel_Value_<LanguageCode> data header.

  • The same rules apply as for non localizable base value.

Order

Rel_Order

 

No

Related feature item order.

Order and Rel_Order column names are aliases, e.g. one can use one or another and there is no difference how order data will be processed.

Parameter is optional.

Values: empty value or any 32-bit integer value <2147483647.

The actual order value will be determined using order value defined in import data and the item row number.

In case the order value is not defined (empty value or order data is not present in import data), then order value will be treated as if it is the maximum possible order value, e.g. 2147483647.

The order values are relative. This means that the final order value will be determined by comparing order values from all items in the same context, but the final order value will be reassigned so it is suitable for import to Perfion. That also means that one can use negative values, mix values and also use duplicate order values.

Refer to “Order Determination Rules” for more information how importer will determine related feature item order.

Some other details about import data:

  • Data header names are case insensitive.

  • Data header order in import data is not important.

  • One can comment the data header in import data by using # prefix. For example, data header “#Cat_Feature” will be ignored by importer.

  • If “Order” data header is present in import data and all order values are defined, then row order in import data is not important.

Item Base Values

In order to define feature item base value one must define it using the full path from the root item. This is actual only when a feature is hierarchical and has hierarchy. To separate the nodes in the path the pipe (|) character is used.

Example

Example of hierarchical feature and how to define its values. The hierarchical feature is shown in Figure 2. The table below shows how all feature items of HierarchicalFeature can be defined in import data using a full path.

Item actual base value

Item root and parent nodes

Item full path

VirtualItem1

-

VirtualItem1

VirtualItem11

VirtualItem1

VirtualItem1|VirtualItem11

Item1

VirtualItem1, VirtualItem11

VirtualItem1| VirtualItem11|Item1

VirtualItem12

VirtualItem1

VirtualItem1|VirtualItem12

Item2

VirtualItem1, VirtualItem12

VirtualItem1| VirtualItem12|Item2

VirtualItem2

-

VirtualItem2

Item3

VirtualItem2

VirtualItem2|Item3

Refer to “Example Using Various Order Values” to see an example how hierarchical data can be imported to Perfion.

Figure 2: Hierarchical feature example

Node Escaping

Item base value may have any characters if it is a String or Text type feature. In order to be able to distinguish between separate path nodes, the node’s value must not include the character used as a path separator or the path node must be escaped. One can use 4 delimiters (‘, “, $, #) for escaping.

The rules for path node escaping:

#

Rule

Example

Comment

1

The node value must be escaped if it contains a path separator (|) or one of 4 delimiter (‘, “, $, #) characters.

Note 1. The node value must be escaped even if it is a single node in the path.