public class OrderPlacement extends ERPInterfaceAS400 implements IOrderPlacement
ERPInterfaceAS400.Pcml, ERPInterfaceAS400.Received
Modifier and Type | Field and Description |
---|---|
private static java.text.DecimalFormat |
FMT9
A number formatter of length 5.
|
protected Cart |
ivCart
The supplied shopping cart object.
|
protected int |
ivEmailAddrDfltIdx
A WIP value for default email address index.
|
protected java.util.ArrayList<java.lang.String> |
ivEmailAddrs
A WIP collection of email addresses.
|
protected java.util.ArrayList<java.lang.String> |
ivEmailNames
A WIP collection of email names.
|
protected java.util.ArrayList<java.lang.Object[]> |
ivErrorCodes
A WIP collection of error codes.
|
protected char |
ivMode
The current mode being processed.
|
private static long |
serialVersionUID
The class' serialization version id.
|
AS400TEXT3, ivAS400, ivConfig
ivHashCode, ivHashFlds, ivObjAttrs
ERROR_ORDER
ERROR_CONNECT, ERROR_NONE, ERROR_PROGRAM, WARN_DUPLICATE, WARN_NONE
Constructor and Description |
---|
OrderPlacement()
Constructs a new ERP order placement interface.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
callProgram()
Calls the ERP program for execution.
|
boolean |
createOrder(Cart cart)
Creates a new order on the ERP system.
|
boolean |
createQuote(Cart cart)
Creates a new quote on the ERP system.
|
int |
getEmailAddressDefaultIndex()
Returns the index in the retrieved collections of email addresses and
names for the default email.
|
java.util.ArrayList<java.lang.String> |
getEmailAddresses()
Returns the retrieved collection of email addresses.
|
java.util.ArrayList<java.lang.String> |
getEmailNames()
Returns the retrieved collection of email names.
|
java.util.ArrayList<java.lang.Object[]> |
getErrorCodes()
Returns the retrieved collection of error codes.
|
User |
getOrderUser()
Returns the ordering user for the order based on the properties value for
erp.OrderPlacement.Sfi.OrderingUser . |
protected void |
parseAdditional(ERPInterfaceAS400.Received rec)
Parses additional information from the receive data queue and adds to the
email name and address collections.
|
protected boolean |
parseCart(ERPInterfaceAS400.Pcml pcml)
Parses cart data returned from the ERP program and updates the current
cart's values.
|
protected void |
parseCartLine(ERPInterfaceAS400.Received rec)
Parses cart line data from the receive data queue and updates a cart line
in the current cart's collection of cart lines.
|
protected void |
parseConfirmLine(ERPInterfaceAS400.Received rec)
Parses order line information that is not in the cart which should be
displayed to the user.
|
protected void |
parseErrorCode(ERPInterfaceAS400.Received rec)
Parses error code information from the receive data queue and adds to the
collection of error codes.
|
protected boolean |
parseQueueEntry(java.lang.String fmtid,
byte[] qbytes)
Parses a data queue entry that was received on the inbound receiving
data queue.
|
boolean |
requestQuotation(Cart cart)
Sets order totals, taxes, freight, etc.
|
protected void |
resetVariables()
Resets the class' instance variables for the start of a new request.
|
protected boolean |
sendCart(ERPInterfaceAS400.Pcml pcml)
Sets the ERP program parameters for the current cart and calls the ERP
program for execution.
|
protected void |
sendCartLines(com.ibm.as400.access.KeyedDataQueue dq)
Places the current cart's cart lines on the outbound sending data queue.
|
protected void |
sendComments(com.ibm.as400.access.KeyedDataQueue dq,
java.lang.String comments)
Places cart or cart line comments on the outbound sending data queue.
|
protected void |
sendDataQueue()
Places information on the outbound sending data queue.
|
equals, getContext, getEncryptAESLength, getErrorType, getMixedCase, getQueueKey, getRecordFormat, getRecordFormatFieldDecimals, getRecvQueue, getSendQueue, getStoreCompany, getStoreWarehouse, getWarningType, isEncryptAES, isYes, process, readDataQueue, setContext, setErrorType, setQueueKey, setWarningType
cloneMapAttributes, formatValue, formatValue, getHashFields, getMapArrayList, getMapAttributes, getMapBigDecimal, getMapBoolean, getMapDate, getMapDouble, getMapInteger, getMapLong, getMapMapped, getMapObject, getMapShort, getMapString, getMapString, getMapStringBuffer, getMapStringBuilder, getMapTime, getMapTimestamp, getMapVector, hashCode, setHashFields, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMapAttributes, setMapObject, setMapTime, setMapTimestamp, toStringArray
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
getContext, getErrorType, getWarningType, setContext, setErrorType, setWarningType
private static final long serialVersionUID
private static final java.text.DecimalFormat FMT9
protected Cart ivCart
protected java.util.ArrayList<java.lang.Object[]> ivErrorCodes
protected java.util.ArrayList<java.lang.String> ivEmailNames
protected java.util.ArrayList<java.lang.String> ivEmailAddrs
protected int ivEmailAddrDfltIdx
protected char ivMode
public OrderPlacement()
public boolean createOrder(Cart cart)
createOrder
in IOrderPlacement
.createOrder
in interface IOrderPlacement
cart
- (Cart) The shopping cart on which the order is based.true
if creating the order was successful,
otherwise false
.public boolean createQuote(Cart cart)
createQuote
in IOrderPlacement
.createQuote
in interface IOrderPlacement
cart
- (Cart) The shopping cart on which the quote is based.true
if creating the quote was successful,
otherwise false
.public boolean requestQuotation(Cart cart)
requestQuotation
in IOrderPlacement
.requestQuotation
in interface IOrderPlacement
cart
- (Cart) The shoppping cart for quotation.true
if the quotation was successful,
otherwise false
.public java.util.ArrayList<java.lang.Object[]> getErrorCodes()
getErrorCodes
in IOrderPlacement
.getErrorCodes
in interface IOrderPlacement
public int getEmailAddressDefaultIndex()
getEmailAddressDefaultIndex
in IOrderPlacement
.getEmailAddressDefaultIndex
in interface IOrderPlacement
public java.util.ArrayList<java.lang.String> getEmailAddresses()
getEmailAddresses
in IOrderPlacement
.getEmailAddresses
in interface IOrderPlacement
public java.util.ArrayList<java.lang.String> getEmailNames()
getEmailNames
in IOrderPlacement
.getEmailNames
in interface IOrderPlacement
public User getOrderUser()
erp.OrderPlacement.Sfi.OrderingUser
.
Implements getOrderUser
in IOrderPlacement
.getOrderUser
in interface IOrderPlacement
protected boolean callProgram() throws java.lang.Exception
process
after
any data to be placed on the send queue has been successfully placed and
sent.
Overrides callProgram
in ERPInterfaceAS400
.callProgram
in class ERPInterfaceAS400
true
if the call was successful, otherwise
false
.java.lang.Exception
- - if an error occurs with the running of
the ERP program.protected boolean parseQueueEntry(java.lang.String fmtid, byte[] qbytes) throws java.lang.Exception
readDataQueue
for each queue entry that
is read for the current queue key.
Overrides parseQueueEntry
in ERPInterfaceAS400
.parseQueueEntry
in class ERPInterfaceAS400
fmtid
- (String) The record format id of the queue entry.qbytes
- (byte[]) The data queue entry's raw data.true
to read the next entry from the receive
data queue or false
to stop reading.java.lang.Exception
- - if an error occurs with reading data on
the queue.protected void sendDataQueue() throws java.lang.Exception
process
as the first step after a connection to the ERP system
has been successfully established.
Overrides sendDataQueue
in ERPInterfaceAS400
.sendDataQueue
in class ERPInterfaceAS400
java.lang.Exception
- - if an error occurs with placing data on
the queue and sending the queue.protected boolean parseCart(ERPInterfaceAS400.Pcml pcml) throws java.lang.Exception
pcml
- (Pcml) The ERP program definition.true
if the parsing is successful, otherwise
false
.java.lang.Exception
- - if an error occurs during the parsing of
the returned data.protected void parseCartLine(ERPInterfaceAS400.Received rec) throws java.lang.Exception
rec
- (Received) The receive data queue data.java.lang.Exception
- - if an error occurs during the parsing of
the queue's data.protected void parseConfirmLine(ERPInterfaceAS400.Received rec) throws java.lang.Exception
rec
- (Received) The receive data queue data.java.lang.Exception
- - if an error occurs during the parsing of
the queue's data.protected void parseErrorCode(ERPInterfaceAS400.Received rec) throws java.lang.Exception
rec
- (Received) The receive data queue data.java.lang.Exception
- - if an error occurs during the parsing of
the queue's data.protected void parseAdditional(ERPInterfaceAS400.Received rec) throws java.lang.Exception
rec
- (Received) The receive data queue data.java.lang.Exception
- - if an error occurs during the parsing of
the queue's data.protected boolean sendCart(ERPInterfaceAS400.Pcml pcml) throws java.lang.Exception
pcml
- (Pcml) The ERP program definition.true
if the call was successful, otherwise
false
.java.lang.Exception
- - if an error occurs with the running of
the ERP program.protected void sendCartLines(com.ibm.as400.access.KeyedDataQueue dq) throws java.lang.Exception
dq
- (KeyedDataQueue) The outbound sending queue.java.lang.Exception
- - if an error occurs with placing data on
the queue and sending the queue.protected void sendComments(com.ibm.as400.access.KeyedDataQueue dq, java.lang.String comments) throws java.lang.Exception
dq
- (KeyedDataQueue) The outbound sending queue.comments
- (String) The comments to send.java.lang.Exception
- - if an error occurs with placing data on
the queue and sending the queue.protected void resetVariables()