Overview

Product-part import overview

CET 17.0 adds a new product-part import layer in cm.abstract.part.import. These classes specialize the new core importer framework so SIF, PMX, and OFDA XML imports can create ProdPart instances instead of plain Part instances.

The most important new behavior is in SIF and OFDA XML import. ProdPartSIFImporterEnv can now build SpecOption data during import, and OFDA XML import can now route option tags into ProdPart through new shared option-import hooks.

This package is also the bridge used by the query import UI. cm.abstract.part.query now returns these environments from ProdPartQueryDialogBehavior.getImporterEnv(str suffix), so imported product parts and product options flow through the same importer framework as the core query import path.

Compile Time Changes

class ProdPartSIFImporterEnv

ProdPartSIFImporterEnv is the new SIF environment for importing ProdPart objects and their options.

Added: public class ProdPartSIFImporterEnv extends PartSIFImporterEnv
Added: public PartOptionItem currentOpt
Added: public PartOptionItem[] currentPartOpts
Added: public void beginImport(Url file, Part[] part)
Added: public void importKeyValue(str key, str value, Part[] part)
Added: public Part createPart(Object data)
Added: extend public PartOptionItem createOption(Object data, Part[] part)
Added: extend public str headerOptionKey()
Added: public void flushPart(Part[] part)
Added: extend public void flushOption(Part[] part)

The default SIF option mapping uses ON, OD, O1/OL, OP, and OG to build SpecOption objects before appending them to the imported ProdPart. In that mapping, OP now imports into SpecOption.groupCode and OG imports into SpecOption.groupDescription.

class ProdPartPMXImporterEnv

ProdPartPMXImporterEnv is the new PMX environment for creating ProdPart instances during PMX import.

Added: public class ProdPartPMXImporterEnv extends PartPMXImporterEnv
Added: public Part createPart(Object data)

This environment mainly switches the created part type to ProdPart. The PMX population hook itself remains initializePartFromItemData(...), which was already part of the older PMX path.

class ProdPartOFDAImporterEnv

ProdPartOFDAImporterEnv is the new OFDA XML environment for creating ProdPart instances.

Added: public class ProdPartOFDAImporterEnv extends PartOFDAImporterEnv
Added: public Part createPart(Object data)

class ProdPart OFDA option import hooks

These ProdPart interfaces are now part of the 17.0 import surface for OFDA XML product-part import.

Added/changed usage: public void importOFDASpecItemTag(XmlTag tag, OFDAHeaderContent header=null)
Added: extend public void importOptionTag(XmlTag tag, OFDAHeaderContent header=null)

importOptionTag(...) is the new shared hook for reading <Option> and <CustomOption> tags into SpecOption objects, including nested option tags.

Runtime/Behavior Changes

Runtime behavior overview

The abstract import layer changes visible import behavior by producing ProdPart instances and option data through the shared query import workflow.

Product-part query import now uses the new environments

ProdPartQueryDialogBehavior.getImporterEnv(str suffix) now returns:

  • ProdPartSIFImporterEnv(silent=false) for .sif
  • ProdPartPMXImporterEnv(silent=false) for .pmx
  • ProdPartOFDAImporterEnv(silent=false) for .xml

That means package-specific ProdPart import behavior should usually be implemented by subclassing one of these environments or by overriding the relevant ProdPart import hook, not by bypassing the query import flow.

SIF import now builds ProdPart options during import

ProdPartSIFImporterEnv tracks both the current part and the current option while parsing the file. When it sees headerOptionKey() (ON by default), it starts a new option, collects option fields into a SpecOption, and appends all flushed options to the part in flushPart(...).

If your older import code assumed SIF import only produced base part data, update that assumption. In 17.0 the abstract import layer can produce product-part option data directly from the imported file.

OFDA XML import can now populate product options

For imported OFDA XML, ProdPartOFDAImporterEnv creates ProdPart instances and ProdPart.importOFDASpecItemTag(...) now routes <Option> and <CustomOption> children into importOptionTag(...).

This is the shared path that now builds imported SpecOption objects from OFDA XML, including nested options. Packages that need to customize OFDA option import should override importOptionTag(...) or extend importOFDASpecItemTag(...) accordingly.