public class ProductGroupXrefImport extends Import<ProductGroupXref>
NOTE: A single instance of this class is cached by ImportProcessor
and used throughout the import processing.
BOBW 02/25/2021 - A new sort code field has been added to the product group x-ref database table and to the delimited import file. In order to accommodate sites that have not had this new field added to the table, the code has been written to allow for the field to be missing.
Modifier and Type | Field and Description |
---|---|
private ProductGroup |
ivGroup
A product group object.
|
private java.util.ArrayList<ProductGroup> |
ivGroups
A cache of all product groups.
|
private static long |
serialVersionUID
The class' serialization version id.
|
ACTION_ADD, ACTION_CLEAR, ACTION_DELETE, ACTION_UPDATE, ACTION_UPDATE_ADD, ivContext, ivLineNo, ivNumFields, ivObject, ivStarAll, ivTextLine, ivUseMixedCase, ivValues
Constructor and Description |
---|
ProductGroupXrefImport()
Constructs a new product group x-ref import class.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
addRecord()
Adds a new record to the Flash database.
|
protected boolean |
deleteRecord()
Deletes an existing record from the Flash database.
|
void |
housekeeping()
Garbage collection: Kills (nullifies) objects used by the import class.
|
boolean |
importData(int action,
java.util.ArrayList<java.lang.String> data,
int lineNo)
Imports a record of data values into the Flash database.
|
private boolean |
undoPrimary()
Changes the current primary group x-ref record to a non-primary group so
the current add or update can become the primary group.
|
protected boolean |
updateRecord()
Updates an existing record in the Flash database.
|
protected boolean |
validForAdd()
Answers if appropriate data has been supplied in order to add a record
to the Flash database.
|
protected boolean |
validForDelete()
Answers if appropriate data has been supplied in order to delete a record
in the Flash database.
|
protected boolean |
validForUpdate()
Answers if appropriate data has been supplied in order to update a record
in the Flash database.
|
private boolean |
validGroup(java.lang.String code)
Answers if a product group exists in the Flash database.
|
private boolean |
validProduct(java.lang.String code,
java.lang.String uom)
Answers if a product exists in the Flash database.
|
getContext, getMixedCase, getNumFields, getProperty, getTrueAction, isDecimal, isInteger, isStarAll, isTrue, log, log, qualifyKey, qualifyMsgId, setContext, setTextLine
private static final long serialVersionUID
private ProductGroup ivGroup
private java.util.ArrayList<ProductGroup> ivGroups
public ProductGroupXrefImport()
public void housekeeping()
housekeeping
in Import
.housekeeping
in class Import<ProductGroupXref>
public boolean importData(int action, java.util.ArrayList<java.lang.String> data, int lineNo)
importData
in Import
.importData
in class Import<ProductGroupXref>
action
- (int) The action code (i.e. add, update, delete).data
- (ArrayList) The set of data values to be imported. Each
element corresponds to a field in the original text line.lineNo
- (int) The current line number being processedtrue
if the import of data was successful,
otherwise false
.protected boolean addRecord()
addRecord
in Import
.addRecord
in class Import<ProductGroupXref>
true
if the add was successful,
otherwise false
.protected boolean deleteRecord()
deleteRecord
in Import
.deleteRecord
in class Import<ProductGroupXref>
true
if the delete was successful,
otherwise false
.protected boolean updateRecord()
updateRecord
in Import
.updateRecord
in class Import<ProductGroupXref>
true
if the update was successful,
otherwise false
.protected boolean validForAdd()
validForAdd
in Import
.validForAdd
in class Import<ProductGroupXref>
true
if appropriate data has been supplied,
otherwise false
.protected boolean validForDelete()
validForDelete
in Import
.validForDelete
in class Import<ProductGroupXref>
true
if appropriate data has been supplied,
otherwise false
.protected boolean validForUpdate()
validForUpdate
in Import
.validForUpdate
in class Import<ProductGroupXref>
true
if appropriate data has been supplied,
otherwise false
.private boolean validGroup(java.lang.String code)
code
- (String) The group code for the group to check.true
if the group exists in the database,
otherwise false
.private boolean validProduct(java.lang.String code, java.lang.String uom)
code
- (String) The product code for the product to check.uom
- (String) The unit of measure for the product to check.true
if the product exists in the database,
otherwise false
.private boolean undoPrimary()
true
if the update is successful,
otherwise false
.