-
Notifications
You must be signed in to change notification settings - Fork 19
adding an additional import format for a CDB domain
craigmcchesney edited this page May 10, 2021
·
6 revisions
Cable Catalog Item Connector Name Description Connector Type Is Male 91795 S-F-1 female safeconn connector #SAFECONN FALSE
- subclass extends ImportHelperBase (or a class derived from it) and specifies type parameters for the domain object the import process will create and the controller to use for creating them, e.g.,
public class ImportHelperCableCatalogConnectors extends ImportHelperBase<ItemConnector, ItemConnectorController> {
<snip>
- override getEntityController() e.g.,
@Override
public ItemConnectorController getEntityController() {
return ItemConnectorController.getInstance();
}
- override getFilenameBase() e.g.,
@Override
public String getFilenameBase() {
return "Cable Catalog Connectors";
}
- override getColumnSpecs() with a column spec for each column of the import spreadsheet format e.g.,
@Override
protected List<ColumnSpec> getColumnSpecs() {
List<ColumnSpec> specs = new ArrayList<>();
specs.add(new IdOrNameRefColumnSpec(
"Cable Catalog Item",
KEY_PARENT_ITEM,
"",
"ID or name of parent cable catalog item. Name must be unique and prefixed with '#'.",
null,
ColumnModeOptions.rCREATE(),
ItemDomainCableCatalogController.getInstance(),
Item.class,
null));
specs.add(new StringColumnSpec(
"Connector Name",
"connectorName",
"setConnectorName",
"Name for cable connector.",
null,
ColumnModeOptions.rCREATE(),
128));
specs.add(new StringColumnSpec(
"Description",
"connectorDescription",
"setConnectorDescription",
"Connector description.",
null,
ColumnModeOptions.rCREATE(),
128));
specs.add(new IdOrNameRefColumnSpec(
"Connector Type",
"connectorType",
"setConnectorType",
"ID or name of connector type. Name must be unique and prefixed with '#'.",
null,
ColumnModeOptions.rCREATE(),
ConnectorTypeController.getInstance(),
Item.class,
null));
specs.add(new BooleanColumnSpec(
"Is Male",
"connectorGender",
"setConnectorGender",
"True/yes/1 if connector gender is male.",
null,
ColumnModeOptions.oCREATE()));
return specs;
}