Skip to main content

XML Configuration

(*): Required

Overview​

The Standard Import can map any Excel or CSV structure. The Generic Import Profile is the default standardized column structure (Bucket_*, KeyValue_*, MediaAsset_*). Projects with a custom Excel layout define their own mapping here instead.

For complete configuration examples, including the Generic Import Profile (Default) and a custom project structure, see XML Configuration Examples.

If you want to understand how the mapping configuration works, or you want to apply it for your customer import, have a look at the reference below.

Where to find the configuration​

Inside the ISON application, navigate to the configuration file for the standard import:

com.priint.accpack.standardimport.StandardImportPlugin/WerkII/default/accpackStandardImport.xml

Editing this file in ISON will allow you to view and adjust the structure.

The configuration is split into the following parts, each described below.

Standard Import(*)​

The <standardImport> element defines the project and configuration this import applies to, along with the import file type.

<standardImport projectIdentifier="aio" configId="aio_standard" fileType="excel">

Attributes​

AttributeRequiredDescription
configIdyesIdentifier for this configuration. Must match the configId of the import profile in the planner.
modeDetermines how existing buckets and content are handled before or during import. Default: delete.

delete: If the root bucket exists, deletes everything before importing.
insert: Leaves existing buckets and content unchanged; inserts new buckets and content.
update: Behaves like insert, but also updates existing buckets and content.

These attribute as below are only used when importing CSV file

AttributeRequiredDescription
charSetEncoding of the CSV data file. Not used for Excel.
Default: UTF-8.
Example: ISO-8859-1
delimiterColumn delimiter of CSV files.
Default: ,
Example: ;

Structure(*)​

Defines the bucket tree(only buckets). Must mirror the entity model hierarchy. The import process walks this structure to create buckets and their content for each row.

Single bucket per row​

When importing from a multi-sheet Excel file where parent relationships are defined by the data

<structure>
<bucket mappingId="bucket_mapping"/>
</structure>

Multi-level bucket tree​

One bucket hierarchy per row.

<structure>
<bucket type="root" mappingId="root_bucket_mapping">
<bucket mappingId="product_mapping">
<bucket mappingId="article_mapping"/>
</bucket>
</bucket>
</structure>
AttributeRequiredDescription
typeIf the bucket tree has only one static root bucket use type="root".
Omit if the root bucket depends on data (e.g. multi-sheet Excel).
mappingIdyesReferences the mapping that defines how to populate this bucket.

Mapping(*)​

Defines how to set attribute values for buckets and their content. Values can be transformed before being written.

These mapping tags are supported:

  • <bucket>: maps data to a bucket entity.
  • <keyValue>: maps data to a key value.
  • <text>: maps data to a text entity.
  • <price>: maps data to a price entity.
  • <mediaAsset>: maps data to a media asset.
  • <mediaObject>: maps data to a media object.
  • <metaData>: maps data to a metadata entity.
  • <context>: maps data to a context.
  • <cord>: maps data to a cord.
<mappings>
<bucket/>
<keyValue/>
<mediaAsset/>
<mediaObject/>
<context/>
</mappings>

Bucket mapping(*)​

Defines how to populate a bucket entity.

Bucket mapping accepts other content mapping as children elements:

  • <keyValue>
  • <mediaAsset>
  • <text>
  • <price>
  • <metaData>
  • <context>
  • <cord>

The example below sets the bucket identifier, a concatenated label, and references key value, media asset, text, price, and metadata mappings.

<bucket>
<mapping id="article_mapping">
<attribute name="entityBucketId">
<value type="static" value="article"/>
</attribute>
<attribute name="label">
<value type="row_value" column="Article Label"/>
<value type="static" value="_"/>
<value type="row_value" column="Article Number"/>
</attribute>
<keyValue mappingId="article_attribute_mapping"/>
<mediaAsset mappingId="article_image_mapping"/>
<price mappingId="article_price_mapping"/>
<text mappingId="article_text_mapping"/>
<metaData mappingId="article_metadata_mapping"/>
<cord mappingId="product_accessory_mapping"/>
</mapping>
</bucket>

Mapping element​

AttributeRequiredDescription
idyesReference mappingId for the <structure>.
sheetName of Excel sheet. Use this attribute if import Excel file contains multiple sheet.
validationIdReferences a validation to apply before import this entity. If validation return false value, the entity record is skipped.
Example:
<mapping id="article_mapping" validationId="validate_article">

See Validation

Attribute element​

Note: If sequence attribute element is not configured, the row index of the input file is used.

AttributeRequiredDescription
nameyesBuilt-in name of the bucket entity attribute. See entityMappingReference.xml for the full list per entity type.
Example:
name="entityBucketId": the bucket entity identifier

Value element​

AttributeRequiredDescription
typeyesSpecifies where the attribute value comes from. Supported types:
static: uses a fixed text value written directly in the config.
Example:
type="static" value="_"

row_value: reads the value from a specific column of the current row.
Example:
type="row_value" column="Article Label"

column_name: uses the column header itself as the value, not the cell content.
Example:
type="column_name" column=""
transformIdReferences a transformation to apply before writing the value.
Example:
<value type="row_value" column="Article Number" transformId="transform_country"/>

See Transformation.

KeyValue mapping​

Defines how to populate a KeyValue entity.

The configuration is similar to bucket mapping with additional options.

KeyValue mapping accepts other content mapping as children elements:

  • <metaData>
  • <context>
<keyValue>
<mapping id="article_attribute_mapping">
<attribute name="entityKeyValueId">
<value type="static" value="article_attribute"/>
</attribute>
<attribute name="key">
<value type="column_name" column=""/>
</attribute>
<attribute name="value">
<value type="row_value" column=""/>
</attribute>
<attribute name="keyLabel">
<value type="column_name" column=""/>
</attribute>
</mapping>
</keyValue>

Mapping element​

AttributeRequiredDescription
typeSupported types:
range: Only mapping some columns by column index.

column_list: Only mapping columns by list column name.

Default: empty(use the row data as-is.)

Mapping columns by column index​

This example maps all columns from index 0 to 5 to key values.

<mapping id="article_attribute_mapping" type="range" colFrom="0" colTo="5">
...
</mapping>
AttributeRequiredDescription
typeyesAlways range
colFromyesColumn index number, based on 0
colToColumn index number, should be greater than colFrom.
If colTo is greater than the total columns, the value is set to the total column.
Default: total column of input import file.

Mapping columns by list column name​

This example maps list of column names Name, Description, Category, Brand, Price, and Stock to key values.

<mapping id="article_attribute_mapping" type="column_list" columns="Name;Description;Category;Brand;Price;Stock">
...
</mapping>
AttributeRequiredDescription
typeyesAlways column_list
columnsList of column names, delimited by semicolons
startWithFrom column name starting with this value
endWithTo column name starting with this value

Mapping key values with a unit reference​

Use the refKeyValue element to reference another mapping that defines a unit for the key value.

<mapping id="article_attribute_mapping">
<refKeyValue mappingId="article_attribute_unit_mapping" />
</mapping>

MediaAsset mapping​

Defines how to populate a MediaAsset and MediaObject entity.

These two mappings should come together.

The configuration is similar to bucket mapping.

If both url and path are configured, url takes priority.

MediaAsset mapping accepts other content mapping as children elements:

  • <metaData>
  • <context>

Using a local path​

<mediaAsset>
<mapping id="article_image_mapping">
<attribute name="entityMediaAssetId">
<value type="static" value="article_image"/>
</attribute>
<attribute name="label">
<value type="row_value" column="Media Name"/>
</attribute>
<mediaObject mappingId="article_image_object_mapping" />
</mapping>
</mediaAsset>

<mapping id="article_image_object_mapping">
<attribute name="path">
<value type="static" value="C:\PubServer\userdata\images"/>
</attribute>
<attribute name="filename">
<value type="row_value" column="File Name"/>
</attribute>
</mapping>

Using a URL​

<mediaAsset>
<mapping id="article_image_mapping">
<attribute name="entityMediaAssetId">
<value type="static" value="article_image"/>
</attribute>
<attribute name="label">
<value type="row_value" column="Media Name"/>
</attribute>
<mediaObject mappingId="article_image_object_mapping" />
</mapping>
</mediaAsset>

<mapping id="article_image_object_mapping">
<attribute name="url">
<value type="static" value="http://priint.com/images"/>
</attribute>
<attribute name="filename">
<value type="row_value" column="File Name"/>
</attribute>
</mapping>

Price mapping​

Defines how to populate a Price entity.

The configuration is similar to bucket mapping, with additional options.

Price mapping accepts other content mapping as children elements:

  • <metaData>
  • <context>
<price>
<mapping id="article_price_mapping">
<attribute name="bucketId">
<value type="row_value" column="BucketID"/>
</attribute>
<attribute name="identifier">
<value type="row_value" column="identifier"/>
</attribute>
<attribute name="entityPriceId">
<value type="row_value" column="entity"/>
</attribute>
<attribute name="label">
<value type="row_value" column="label"/>
</attribute>
<attribute name="price">
<value type="row_value" column="price"/>
</attribute>
<attribute name="priceUnit">
<value type="row_value" column="price unit"/>
</attribute>
<attribute name="validFrom" format="M/dd/yyyy">
<value type="row_value" column="valid from"/>
</attribute>
<attribute name="validTo" format="M/dd/yyyy">
<value type="row_value" column="valid to"/>
</attribute>
</mapping>
</price>

Attribute element​

AttributeRequiredDescription
formatyesIf mapping validFrom and validTo date attributes

Text mapping​

Defines how to populate a Text entity.

The configuration is similar to KeyValue mapping.

Supports range and column_list types also.

Text mapping accepts other content mapping as children elements:

  • <metaData>
  • <context>
<text>
<mapping id="article_text_mapping">
<attribute name="bucketId">
<value type="row_value" column="BucketID"/>
</attribute>
<attribute name="identifier">
<value type="row_value" column="identifier"/>
</attribute>
<attribute name="entityTextId">
<value type="row_value" column="entity"/>
</attribute>
<attribute name="text">
<value type="row_value" column="text"/>
</attribute>
</mapping>
</text>

ContentMetaData mapping​

Defines how to populate a ContentMetaData entity.

The configuration is similar to KeyValue mapping.

Supports range and column_list types also.

ContentMetaData mapping accepts other content mapping as children elements:

  • <metaData>
<metaData>
<mapping id="article_metadata_mapping">
<attribute name="entityContentMetaDataId">
<value type="static" value="article_metadata_display"/>
</attribute>
<attribute name="key">
<value type="column_name" column=""/>
</attribute>
<attribute name="value">
<value type="row_value" column=""/>
</attribute>
</mapping>
</metaData>

Context mapping​

Defines how to populate a Context entity.

Static context​

<mapping id="article_context_mapping">
<attribute name="country">
<value type="static" value="DE"/>
</attribute>
<attribute name="language">
<value type="static" value="deu"/>
</attribute>
</mapping>

Dynamic context by row data​

<mapping id="default-context_mapping">
<attribute name="country">
<value type="row_value" column="Country"/>
</attribute>
<attribute name="language">
<value type="row_value" column="Language"/>
</attribute>
</mapping>

Dynamic context by import file name​

Language and country value are detected from the import file name.

<mapping id="file-context_mapping" type="file" contextDelimiter="_" country="false" language="true"/>
AttributeDescription
typeAlways file
contextDelimiterDelimiter between country and language in the file name
country
language
true if the file name contains that value.
false or empty otherwise

Cord mapping​

Defines how to populate a Cord entity.

After importing buckets and bucket content, the process walks all imported buckets and creates cords.

Required attributes:

  • entityCordId
  • sourceBucketId
  • sourceBucketEntityId
  • destinationBucketId
  • destinationBucketEntityId

Cord mapping accepts other content mapping as children elements:

  • <metaData>
  • <context>

Note:

  • If label is not defined, the label of the destination bucket is used.
  • Cord mapping supports context and metadata also.
<cord>
<mapping id="product_accessory_mapping">
<attribute name="entityCordId">
<value type="static" value="accessories"/>
</attribute>
<attribute name="sourceBucketId">
<value type="row_value" column="Main product"/>
</attribute>
<attribute name="sourceBucketEntityId">
<value type="static" value="product"/>
</attribute>
<attribute name="destinationBucketId">
<value type="row_value" column="Related product"/>
</attribute>
<attribute name="destinationBucketEntityId">
<value type="static" value="product"/>
</attribute>
</mapping>
</cord>