The Import GPC data module provides functionality for administrators to import Standard product classification. Classifications are represented in censhare as product categories in an hierarchical asset structure. Currently we support the GPC/GS1 classification.

Implementation

Class model

All necessary classes are located in modules.product_classification.classification

To create the functionality for a new classification system in censhare you must implement the following interfaces:

  • FileReader: is responsible for scanning the classification file.
  • ItemCollection: stores parsed classification items and provides iterator of ordered items.
  • Key abstraction: is responsible for classification item identifier.
  • ClassificationParser: is responsible for parsing single classification item.

Algorithm overview

  1. The ProductClassificationAction class serves as entry point. It reads an uploaded file and creates the respective ImprortAction.
  2. The ImportAction class iterates through the ItemCollection and executes the SaveBehaviour class over every applicable ClassificationItem.

Domain model

Any classification system is represented in censhare with the following domain model:
Product category domain model

Properties

The classification system name is defined in the configuration properties of the module:

< import-params >
     < classificationSystem value = "GPC" />
</ import-params >

Usage

To import a new classification:

  1. Execute Import GPC data server action
  2. Choose the XML classification file from the classification folder (do not select the “Delta” file!)
  3. Go to Products in censhare Web to see the import results

Configuration

The module has to be enabled only. It does not require a specific configuration. After enabling, the Import GPC data menu item appears in the Server actions menu in the censhare Admin-Client and the censhare Client.