EzXml Connector - Item Update
This document details the Item Update process for the EzXml connector. This process synchronizes item-related data from an external EzXml source (via FTP) into the App4Sales platform. It covers the retrieval of item catalog data, stock information, and semantic data, and then maps and transforms this data into App4Sales internal data structures such as Items, Matrix Parents, Children, Headers, Price Lists, and Item Categories.
Execution Flow
The Item Update is initiated by the ItemUpdate method in EzXmlConnector.cs. This method orchestrates the following high-level steps:
Fetches and processes item catalog data using
ItemsService.SyncItems().Imports semantic data for items using
SemanticsService.ImportSemantics().Updates the App4Sales database with the processed item data using
DatabaseManager.Instance.UpdateItems2().
Data Source Configuration
The EzXml connector retrieves item data from several XML and CSV files, which are downloaded via FTP from a configured location.
Item Catalog Data: Retrieved from
FD_catalog.xml. This file contains the core item definitions, styles, variants, and pricing.Stock Data: Retrieved from
FD_stock.xml. This file provides detailed stock levels and availability dates per item variant. IfFD_stock.xmlis not found or is empty, stock information fromFD_catalog.xmlis used as a fallback.Semantic Data: Retrieved from
semantics.csv. This CSV file provides additional categorization and descriptive information for items. The separator character for this CSV can be configured in the connector settings (default is comma).
Data Mapping Tables
Item (App4Sales.Models.ObjectsDb.Item)
App4Sales Field | Source Field (API/Excel/DB) | Logic/Notes |
|
| Direct mapping from the variant's unique identifier. |
|
| Direct mapping from the item's general description. Also populated from multi-language description fields ( |
|
| Mapped from |
|
| Mapped from |
|
| Set to 'I' if |
|
| Mapped from |
|
| Direct mapping. |
|
| Mapped from |
|
| Currency from the default price type ( |
|
| Unit price from the default price type ( |
|
| The Matrix Code of the parent item, derived from |
|
| The description of the matrix parent, derived from |
|
| The description of the matrix header (e.g., Size), derived from |
|
| The value of the matrix header (e.g., Size Code), derived from |
| Derived | Automatically generated sequence for matrix header. |
|
| The description of the matrix child (e.g., Color), derived from |
|
| The value of the matrix child (e.g., Color Code), derived from |
|
| The sorting sequence for the matrix child, derived from |
Item Prices (App4Sales.Models.PriceListPrice)
App4Sales Field | Source Field (API/Excel/DB) | Logic/Notes |
| Derived | Hash code of the price list code. |
|
| Direct mapping from the variant's unique identifier. |
|
| B2B price, mapped from |
|
| Recommended retail price (RRP), mapped from |
Price Lists (App4Sales.Models.PriceList)
App4Sales Field | Source Field (API/Excel/DB) | Logic/Notes |
|
| If |
|
| Direct mapping. |
| Derived | Hash code of the price list code. |
Matrix Parents (App4Sales.Models.MatrixParent)
App4Sales Field | Source Field (API/Excel/DB) | Logic/Notes |
|
| Direct mapping from the item's number ( |
|
| Direct mapping from the item's description. |
| Derived | Hash code of the matrix parent. |
Matrix Children (App4Sales.Models.MatrixChild)
App4Sales Field | Source Field (API/Excel/DB) | Logic/Notes |
|
| Direct mapping from the style's color code. |
|
| Direct mapping from the style's color description. |
|
| Mapped from the style's color sorting, parsed as an integer. |
| Derived | Hash code of the matrix child. |
Matrix Children Extended (App4Sales.Models.MatrixChildEx)
App4Sales Field | Source Field (API/Excel/DB) | Logic/Notes |
| Derived | Unique ID of the associated |
|
| Multi-language descriptions for the matrix child color. Each non-empty description creates a separate |
| Derived | "EN", "IT", "NL", "FR" based on the source description field. |
Matrix Headers (App4Sales.Models.MatrixHeader)
App4Sales Field | Source Field (API/Excel/DB) | Logic/Notes |
|
| Direct mapping from the variant's size. |
|
| Direct mapping from the variant's size. |
| Derived | Hash code of the matrix header. |
Domain Specifics (Expanded)
Price Logic
Prices are obtained from the <price> elements within each <variant> in FD_catalog.xml. Each <price> element can define different price types and currencies.
Default Price: Identified by
price_type="D". Theunit_priceof this entry is used as the baseSalesPricefor the item.Multiple Price Lists: The connector supports multiple price lists. A price list code is generated based on the
price_type_codeandcurrency(e.g., "B2B-EUR").Recommended Retail Price (RRP): If
unit_list_priceis different fromunit_price, a separate price list is created with "RRP " prepended to the generated price list code.Currency: The currency for a price list is taken directly from the
currencyfield in the<price>element.
Image Handling
(No specific image handling logic was identified in the provided code snippets. Images are not directly processed or mapped by this connector's Item Update. Further investigation into other connector components might be necessary if image synchronization is expected.)
Stock & Availability
Stock information is primarily sourced from FD_stock.xml, which contains <variant> elements with id, stock, and available_on fields.
Stock Source Fallback: If
FD_stock.xmlis not found or contains no variants, stock information is extracted from the<variant>elements withinFD_catalog.xml.Current Available Stock: Stock values where
available_onis empty or matches the current date are considered current available stock (mapped toCore.Constants.Stock.AvailableStock).Future Stock: Stock values with an
available_ondate in the future are treated as "to be received" stock and are associated with aNextDeliveryDate(mapped toCore.Constants.Stock.ToBeReceivedandCore.Constants.Stock.NextDeliveryDate).Past Dates: Stock entries with `available_on` dates in the past are ignored.
Matrix & Attributes
The connector handles matrix (parent-child) items, where an EzItem can have multiple EzStyle entries, and each EzStyle can have multiple EzVariant entries.
Matrix Parent Identification: An item is considered a matrix parent if it has multiple styles or variants, or if its model number is different from its variant ID when there's only one style and variant.
Parent-Child Linking:
EzItem.Numberforms theMatrixCodefor the parent.EzStyle.ColorandEzStyle.ColorDescriptionare used for the Y-axis (MatrixChild) values.EzVariant.Sizeis used for the X-axis (MatrixHeader) values.Attributes from Catalog:
Brand: Mapped from
EzItem.brand_id, matched against<brand>elements inFD_catalog.xml. Stored as an Item Category named "Brand".Category: Mapped from
EzItem.category_id, matched against<category>elements inFD_catalog.xml. Stored as an Item Category named "Category".Product Group: Mapped from
EzItem.productgroup_id, matched against<productgroup>elements inFD_catalog.xml. Stored as an Item Category named "Product Group".Collection: Mapped from
EzItem.collection_id, matched against<collection>elements inFD_catalog.xml. Stored as an Item Category named "Collection".Season: Mapped from
EzItem.season_id, matched against<season>elements inFD_catalog.xml. Stored as an Item Category named "Season".
Extra Filters: Up to five extra filters (
EzItem.extra_filters.extra_filter_1toextra_filter_5) can be applied. These are matched against<extra_filter>and their<filtervalue>elements inFD_catalog.xml. Each matched filter is added as an Item Category, with the category name taken fromEzExtraFilter.descriptionand the value fromExFilterValue.description.Semantic Data Attributes: The
semantics.csvfile can provide additional item categories. Any column insemantics.csvother than "ItemCode" or "Modelnummer" is treated as an item category. These categories are applied to items either by matchingItemCodedirectly or by matchingModelnummerto theMatrixParentcode, applying the category to all child items of that matrix parent.
Related Settings & Prerequisites
The following connector settings and prerequisites impact the item update process:
Separator Character: Used for parsing
semantics.csv. Configurable via a connector setting, defaults to comma (,).FTP Access: The connector requires read access to an FTP server to download
FD_catalog.xml,FD_stock.xml, andsemantics.csvfrom the configured import folder(s).
Known Limitations
The connector assumes that multi-language color descriptions (e.g.,
EzStyle.ColorDescriptionDE) when mapped toMatrixChildEx, theDE(German) description maps to language code "EN" (English). This might be an oversight or an intentional mapping.