classifications

Last modified by Joel Schmalöer on 14.09.2022, 14:00

This page contains code examples for classifications and their groups in the feed/export.

Tested for PIM 8.22 | PXM 1.3.7

Note: Exports classification data regardless of a product affiliation.

Iterator for classifications

<#list classifications as classificationKey, classification>
    ${classification.id}
</#list>

Result

jcatDemo
VariantAttributes
RfQResponse
hk001
CarParts
lyr001
TecDocCar
Kategorien
SmartForms001
Metal
stp001
int001
SpecialTreatmentClass
eclass-11-1
MasterClassification
eClass_5.1.3
basic
ETIM-7.0

Iterator for classification groups​​​

<#list classificationGroups as classificationId, classifications2classificationGroupMap>
 <#list classifications2classificationGroupMap as classificationGroupId, classificationGroup>
  ${classificationGroupId}
 </#list>
</#list>

Result

Equipment
Computer
Monitors
Service
Tablet
Tablets
CarParts
BrakeDiscs
Cables
CoffeeMakers
HairCare
Rim
Wearables
Childseats
Software
...

Typical fields (in CSV format)

<#assign languageId="en-EN">
ClassifcationId,ClassificationDescription,GroupID,GroupDescription,GroupStatus
<#list classifications as classificationKey, classification>
    <#list classificationGroups as classificationId, classifications2classificationGroupMap>
        <#list classifications2classificationGroupMap as classificationGroupId, classificationGroup>
            ${classificationId},${classification.description(languageId)!},${classificationGroupId},${classificationGroup.description(languageId)!},${classificationGroup.statusId}
        </#list>
    </#list>
</#list>

Result

ClassifcationId,ClassificationDescription,GroupID,GroupDescription,GroupStatus
jcatDemo,,Equipment,ZubehörEquipment,400
jcatDemo,,Computer,ComputerComputer,400
jcatDemo,,Monitors,MonitoreMonitors,400
jcatDemo,,Service,ServiceService,400
jcatDemo,,Tablet,TabletTablet,400
VariantAttributes,,Tablets,Tablets,400
VariantAttributes,,CarParts,,400
VariantAttributes,,BrakeDiscs,,400
VariantAttributes,,Cables,,400
VariantAttributes,,CoffeeMakers,,100
VariantAttributes,,HairCare,,400
VariantAttributes,,Rim,,400
VariantAttributes,,Wearables,,400
VariantAttributes,,Childseats,,100
VariantAttributes,,Software,,400
VariantAttributes,,Tires,,400
VariantAttributes,,MC_Tablets,,400
VariantAttributes,,Paints,Paints,400
CarParts,,Wheel,Complete wheels,100
CarParts,,BrakeCaliper,Brake Caliper,400
CarParts,,RoofRack,Roof-racks,100
CarParts,,BabyProducts,Baby Products,400
CarParts,,BrakeDiscs,Brake discs,100
...

All fields (in JSON format)

Note: "de-DE" and "en-GB" is assigned for language specific fields.

<#macro escapeJson text>${text?js_string?replace("\\'", "\'")?replace("\\>",">")}</#macro>
<#assign languages = ["de-DE", "en-GB"]>
{
  "classifications" : [ <#list classifications as classificationKey, classification>{
    "classificationId" : "${classification.id!}",
    "createdOn" : "${.now?iso_utc}",
    "changedOn" : "${.now?iso_utc}",
    "classificationSN" : "${classification.classificationSN!}",
    "description" : {<#list languages as language>
      "${language}" : "<@escapeJson classification.description(language)!/>"<#sep>,</#list>
    },
    "longDescription" : {<#list languages as language>
      "${language}" : "<@escapeJson classification.longDescription[language]!/>"<#sep>,</#list>
    },
    "type" : "${classification.type!}",
    "hierarchyCode" : "${classification.hierarchyCode!}",
    "versionNo" : "${classification.versionNo!}",
    "orderNo" : "${classification.orderNo!}",
    "documentUrl1" : "${classification.documentUrl1!}",
    "documentUrl2" : "${classification.documentUrl2!}",
    "documentUrl3" : "${classification.documentUrl3!}",
    "classificationGroups" : [
    <#list classificationGroups as classificationId, classifications2classificationGroupMap>
      <#list classifications2classificationGroupMap as classificationGroupId, classificationGroup> {
        "classificationGroupId" : "${classificationGroupId}",
        "createdOn" : "${.now?iso_utc}",
        "changedOn" : "${.now?iso_utc}",
        "description" : {<#list languages as language>
          "${language}" : "<@escapeJson classificationGroup.description(language)!/>"<#sep>,</#list>
        },
        "longDescriptions" : {<#list languages as language>
          "${language}" : "<@escapeJson classificationGroup.longDescriptions[language]!/>"<#sep>,</#list>
        },
        "fallbackDescShort" : "<@escapeJson classificationGroup.fallbackDescShort!/>",
        "classificationGroupSN" : "${classificationGroup.classificationGroupSN}",
        "statusId" : "${classificationGroup.statusID!}",
        "hierarchyCode" : "${classificationGroup.hierarchyCode!}",
        "orderNo" : "${classificationGroup.orderNo!}",
        "concatenatedInformation" : "<@escapeJson classificationGroup.concatenatedInformation!/>}",
        "documentUrl1" : "${classificationGroup.documentUrl1!}",
        "documentUrl2" : "${classificationGroup.documentUrl2!}",
        "documentUrl3" : "${classificationGroup.documentUrl3!}",
        "parentClassificationGroupSN" : "${classificationGroup.parentClassificationGroupSN!}"
      }
      <#sep>,</#list>
    </#list> ]
  }<#sep>,</#list> ]
}

Result

{
 "classifications" : [ {
   "classificationId" : "jcatDemo",
   "createdOn" : "2022-04-14T12:31:28Z",
   "changedOn" : "2022-04-14T12:31:28Z",
   "classificationSN" : "10",
 "description" : {
     "de-DE" : "",
     "en-GB" : ""
    },
   "longDescription" : {
     "de-DE" : "",
     "en-GB" : ""
    },
   "type" : "",
   "hierarchyCode" : "009",
   "versionNo" : "",
   "orderNo" : "",
   "documentUrl1" : "",
   "documentUrl2" : "",
   "documentUrl3" : "",
   "classificationGroups" : [
       {
       "classificationGroupId" : "Equipment",
       "createdOn" : "2022-04-14T12:31:28Z",
       "changedOn" : "2022-04-14T12:31:28Z",
       "description" : {
         "de-DE" : "ZubehörEquipment",
         "en-GB" : "ZubehörEquipment"
        },
       "longDescriptions" : {
         "de-DE" : "",
         "en-GB" : ""
        },
       "fallbackDescShort" : "",
       "classificationGroupSN" : "77",
       "statusId" : "",
       "hierarchyCode" : "009000001",
       "orderNo" : "",
       "concatenatedInformation" : "}",
       "documentUrl1" : "",
       "documentUrl2" : "",
       "documentUrl3" : "",
       "parentClassificationGroupSN" : ""
      }
      , {
       "classificationGroupId" : "Computer",
       "createdOn" : "2022-04-14T12:31:28Z",
       "changedOn" : "2022-04-14T12:31:28Z",
       "description" : {
         "de-DE" : "ComputerComputer",
         "en-GB" : "ComputerComputer"
        }
}
Tags:
Created by Rene Assenmacher on 18.03.2021, 14:40