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
- The
ProductClassificationAction
class serves as entry point. It reads an uploaded file and creates the respectiveImprortAction
. - The
ImportAction
class iterates through theItemCollection
and executes theSaveBehaviour
class over every applicableClassificationItem
.
Domain model
Any classification system is represented in censhare with the following domain model:
Properties
The classification system name is defined in the configuration properties of the module:
|
Usage
To import a new classification:
- Execute
Import GPC data
server action - Choose the XML classification file from the classification folder (do not select the “Delta” file!)
- 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.