Overview

Product-part option import support

cm.abstract.part.query adds the product-part and option-specific part of the new 17.0 query import workflow. Together with the base dialog changes in cm.core.part.query and the underlying option/customization changes in cm.abstract.part.ProdPart, product-part query dialogs can now import product parts and option items, drag option items into the query grid, and create option additions or overrides in addition to the existing option-special workflow.

Compile Time Changes

OptionMakeSpecialDialog

Option special generation now uses the owning Part to convert the amount from calculation currency before saving the special. This relies on the updated PartMakeSpecialDialog constructor from cm.core.part.query, so custom call sites should pass the owning part when constructing option special dialogs.

ProdPartQueryDialogBehavior

ProdPartQueryDialogBehavior now exposes import and option-drag extension points.

New: public SubWindow initImportWindow(QueryDialog dialog, Url url=null)
New: public PartImporterEnv getImporterEnv(str suffix)
New: public void beginGridDragAnimation(QueryDialog dialog, pointI dragPoint, Object dragValue)
New: public range[] getValidDragRanges(QueryDialog dialog, Object dragValue)

The option-special dialog creation path was also updated to pass the owning part into OptionMakeSpecialDialog.

ProdPartQueryDialogDataEnv

ProdPartQueryDialogDataEnv now includes public APIs for option filtering, option import, option overrides, and additional option specials. Key additions include:

New: extend public bool acceptPartOpt(Part part, SpecOption opt)
New: extend public PartOptionItem getOption(int row)
New: extend public Part getOptionParentPart(int row)
New: extend public void putOptionSpecial(int row, OptionSpecial special)
New: public void putOverride(int row, Object data)
New: extend public OptionSpecial createOptionSpecial(Part part, PartOptionItem option, bool priceReplace=true)
New: public void putAddition(int row, Object data)
New: extend public void putAdditionalOption(int row, PartOptionItem newOption)
New: extend public void putAdditionalOptionSpecial(int row, CustomOptionSpecial special)
New: extend public CustomOptionSpecial getAdditionalOptionSpecial(int row)
New: public void removeAddition(int row)
New: extend public void removeAdditionalOption(int row)
New: extend public CustomOptionSpecial createCustomOptionSpecial(Part part, PartOptionItem option)

createOptionRowData also changed its row identifier source:

Old: str optRowID = part.optSpecialKey(option)
New: str optRowID = option.key()

If you extend the product-part query data environment, review any assumptions about option row identifiers and option insertion/removal behavior.

Import-related classes

The following new public classes were added for product-part option import support:

New: public class ProdPartQueryImportWindow extends QueryImportWindow
New: public class QueryImportOptionTVI extends QueryImportTVI

These are used to display option items in the import tree and support dragging imported options into the query grid.

Other public additions

New: public customizationType customizationStatus()   // on QueryOptionRowData
New: extend public void putAddition(CustomOptionSpecial special)   // on QueryOptionRowData
New: extend public CustomOptionSpecial getAddition()   // on QueryOptionRowData
New: extend public void removeAddition()   // on QueryOptionRowData
New: extend public void putAddition(CustomOptionSpecial special)   // on QueryProdPartRowData
New: public int initialColumnWidth(str columnLabel)   // on QueryProdPartGridBuilderEnv
New: extend public Brush getStateBrush(customizationType status)   // on QueryProdPartGridBuilderEnv

These query-side APIs rely on the option identity, option customization, and additional-option APIs added in cm.abstract.part.ProdPart.

Runtime/Behavior Changes

Imported option items in query dialogs

Product-part query dialogs now support importing option items as well as parts. Imported option items can be shown in the import pane and dragged into valid option rows in the query grid as additional options or special overrides.

This is the abstract-part side of the broader query import workflow introduced together with cm.core.part.query.

Option row visibility and highlighting

Option rows are now filtered through acceptPartOpt(...). Options that are top-level features (have a level of 0) are filtered out of the Query Dialog. Options that are special, additional, or part of an overridden Part are kept visible.

Option and product-part rows now use customization-based highlighting similar to the core query package:

  • specials use the existing cyan highlight
  • overrides use a light green highlight
  • additions use a purple highlight

If you rely on previous option-row visibility or row-color assumptions, verify the updated behavior.

Additional option specials

The data environment now supports creating, anchoring, reordering, and removing additional option specials (CustomOptionSpecial) directly from query import and drag/drop operations. Removing an added option can also update anchor keys on neighboring added options.

If you have custom code that inspects or persists option special ordering, verify it against the new anchor-key update behavior.

Option-special currency handling

OptionMakeSpecialDialog now converts the amount shown in the dialog from calculation currency back to the part's main currency before storing the final OptionSpecial or CustomOptionSpecial. If you compare displayed amounts to stored option-special values, account for this conversion.