stephanstapel / BMECat.net

.net implementation of BMEcat electronic catalogue standard
Apache License 2.0
14 stars 3 forks source link

Saving new catalog with products features - features are not saved in XML file #5

Open KacperMarcinkiewicz opened 2 weeks ago

KacperMarcinkiewicz commented 2 weeks ago

Hi, Thx for the lib! Reading BMECat works great! I have some problems with creating files. I'm using version 4.5.0, I'm trying to create new catalog with my products and export it to XML BMECat file. I have problem because my features are not being saved to XML. Can You give me some example on how to create new catalog with features on products? Below I'm pasting some example of problem (with 1 feature but when i tried to save 33 features, non of them were saved), I've serialized Catalog to JSON for better visibility and the created XML BMECat. Thx!

{
  "GeneratorInfo": null,
  "Languages": [
    1,
    2
  ],
  "CatalogId": "BROKER-Export",
  "CatalogVersion": "1.0.0",
  "CatalogName": "BROKER Export",
  "GenerationDate": "2024-08-27T13:26:23.6922303+02:00",
  "Buyer": null,
  "Supplier": null,
  "Transport": null,
  "Products": [
    {
      "No": "100005",
      "PIds": [
        {
          "Id": "3250610660232",
          "Type": 1
        }
      ],
      "DescriptionShort": null,
      "DescriptionLong": null,
      "Stock": null,
      "Keywords": [],
      "FeatureSets": [
        {
          "FeatureClassificationSystem": {
            "Classification": "ETIM-9.0",
            "GroupIds": [
              {
                "Type": 0,
                "Name": "EC000058"
              }
            ],
            "GroupName": "ETIM-9.0"
          },
          "Features": [
            {
              "Name": "EC000058",
              "Values": [
                "False"
              ],
              "Unit": {
                "Code": null,
                "ClearText": null
              },
              "Description": null,
              "Order": null,
              "Template": null,
              "Reference": null
            }
          ]
        }
      ],
      "SupplierPIds": [],
      "OrderDetails": null,
      "Prices": [],
      "MimeInfos": [],
      "LogisticsDetails": null,
      "SupplierAltPid": null,
      "ManufacturerPID": null,
      "ManufacturerName": null,
      "ManufacturerTypeDescription": null,
      "ERPGroupSupplier": null,
      "ERPGroupBuyer": null,
      "References": [],
      "EDXF": null,
      "ExtendedInformation": [],
      "ProductCatalogGroupMappings": []
    }
  ],
  "Currency": 0,
  "Agreement": null,
  "CatalogStructures": []
}

XML BMECat

<?xml version="1.0" encoding="utf-8"?>
<BMECAT version="2005" xmlns="http://www.bmecat.org/bmecat/2005fd">
    <HEADER>
        <CATALOG>
            <LANGUAGE>eng</LANGUAGE>
            <LANGUAGE>unknown</LANGUAGE>
            <CATALOG_ID>BROKER-Export</CATALOG_ID>
            <CATALOG_VERSION>1.0.0</CATALOG_VERSION>
            <CATALOG_NAME>BROKER Export</CATALOG_NAME>
            <GENERATION_DATE>2024-08-27T01:26:23+02:00</GENERATION_DATE>
            <CURRENCY>Unknown</CURRENCY>
        </CATALOG>
    </HEADER>
    <T_NEW_CATALOG>
        <PRODUCT mode="new">
            <SUPPLIER_PID>100005</SUPPLIER_PID>
            <PRODUCT_DETAILS>
                <INTERNATIONAL_PID type="ean">3250610660232</INTERNATIONAL_PID>
                <EAN>3250610660232</EAN>
            </PRODUCT_DETAILS>
        </PRODUCT>
    </T_NEW_CATALOG>
</BMECAT>
stephanstapel commented 2 weeks ago

Hi, Writing is definitely far behind reading since I needed a 100% comprehensive reader for one of my gigs. I'm happy for a PR if you would like to add this functionality.

If you would like to have consulting or if you would be happy for sponsoring (I guess you are using the library in commercial context), I'm happy to add this functionality. If you should be interested, I am looking forward to a a mail to stephan dot stapel at web dot de