public class OrderMgr extends BaseMgr
Modifier | Constructor and Description |
---|---|
protected |
OrderMgr(com.konakart.appif.KKEngIf eng,
KKAppEng kkAppEng)
Constructor
|
Modifier and Type | Method and Description |
---|---|
boolean |
addPaymentDetailsToOrder(java.lang.String paymentCode)
The payment details object referenced by paymentCode is added to the order.
|
void |
addShippingQuoteToOrder(java.lang.String shippingCode,
java.lang.String description)
The shipping Quote referenced by shippingCode is added to the checkout order.
|
void |
addShippingQuoteToVendorOrder(java.lang.String shippingCode,
com.konakart.appif.OrderIf order,
java.lang.String description)
The shipping Quote referenced by shippingCode is added to the order.
|
protected void |
archiveOrder(com.konakart.appif.KKEngIf _eng,
com.konakart.app.SaveOrderOptions saveOptions,
boolean refresh)
Utility to archive an order
|
com.konakart.appif.OrderIf |
createCheckoutOrder()
Creates a partially populated order object and sets
checkoutOrder to this
object. |
com.konakart.appif.OrderIf |
createCheckoutOrderWithOptions(com.konakart.appif.CreateOrderOptionsIf _options)
Creates a partially populated order object and sets
checkoutOrder to this
object. |
com.konakart.appif.PaymentDetailsIf[] |
createPaymentGatewayList()
Gets an array of payment details from the engine.
|
void |
createShippingQuotes()
Gets an array of shipping quotes from the engine.
|
void |
fetchAllOrders()
It gets an array of orders sorted by date.
|
com.konakart.appif.OrderIf |
getCheckoutOrder()
Returns the current checkout order.
|
java.lang.String |
getCouponCode()
Latest coupon code entered by the customer
|
com.konakart.appif.CreateOrderOptionsIf |
getCreateOrderOptions()
Creates an CreateOrderOptionsIf based on the current FetchProductOptions stored in the
AppEng.
|
int |
getCurrentOffset()
Gets the currentOffset in the currentOrders array.
|
com.konakart.appif.OrderIf[] |
getCurrentOrders()
Gets an array of current orders.
|
int |
getCurrentPage() |
com.konakart.appif.FetchOrderOptionsIf |
getFetchOrderOptions()
Returns an FetchOrderOptions object based on customer tag values
|
java.lang.String |
getGiftCertCode() |
java.lang.String |
getHostAndPort()
In the form servername:serverport
|
int |
getIdForUserUpdatingOrder(com.konakart.appif.OrderIf order)
Get the Id of the user who is updating this order
|
com.konakart.app.Order |
getLastOrder(int custId,
java.lang.String sessionId,
int languageId)
It attempts to get last customer order
|
int |
getMaxRows()
Maximum number of orders to show in a list.
|
java.lang.String |
getNavBack()
navBack is a constant.
|
java.lang.String |
getNavNext()
navNext is a constant.
|
java.lang.String |
getNavStart()
navStart is a constant.
|
int |
getNumberOfOrders()
The number of orders in the currentOrders array.
|
int |
getNumPages() |
com.konakart.appif.OrderIf |
getOrder(int orderId)
It attempts to get an order from the currentOrders array.
|
com.konakart.appif.OrderIf |
getOrder(int orderId,
boolean force)
It attempts to get an order from the currentOrders array.
|
protected com.konakart.app.OrderSearch |
getOrderSearch()
Returns an OrderSearch object based on customer tag values
|
java.util.ArrayList<java.lang.Integer> |
getPageList() |
int |
getPageSize()
Used to get the maximum number of orders to display.
|
com.konakart.appif.PaymentDetailsIf[] |
getPaymentDetailsArray()
Returns an array of payment details for the current order.
|
int |
getPaymentType()
Returns an int that describes the payment type of the checkoutOrder.
|
int |
getRewardPoints()
Reward points entered by customer
|
protected com.konakart.app.SaveOrderOptions |
getSaveOrderOptions(com.konakart.appif.OrderIf order)
Utility to create a SaveOrderOptions object from an order where the id of the order to be
archived is stored in the archiveId attribute of the order.
|
com.konakart.appif.OrderIf |
getSelectedOrder()
Returns the selected order.
|
com.konakart.appif.ShippingQuoteIf[] |
getShippingQuotes()
Gets an array of shipping quotes for the current order.
|
int |
getShowBack()
Show the back button if set to 1.
|
int |
getShowNext()
Show the next button if set to 1.
|
int |
getTotalNumberOfOrders()
Used to determine the total number of orders.
|
com.konakart.appif.OrderIf[] |
getVendorOrders(int orderId)
Fetch the vendor orders from the database.
|
java.util.HashMap<java.lang.String,com.konakart.appif.ShippingQuoteIf[]> |
getVendorShippingQuoteMap() |
boolean |
isMgrReady()
Is the Manager Ready?
|
protected boolean |
isSamePaymentModule(com.konakart.appif.PaymentDetailsIf pd,
com.konakart.appif.OrderIf order)
Return true if the order uses the specified payment module
|
boolean |
isUseCheckoutOrder()
Boolean passed to GWT one page checkout code to tell it to either create a new order from the
basket items or to use the current checkoutOrder as would be the case for repeat order.
|
void |
navigateCurrentOrders(java.lang.String navDir)
This method is called to navigate through a list of orders when the list is longer than
maxRows.
|
void |
populateCheckoutOrderWithOrderTotals()
Calls the engine to get an array of OrderTotal objects which are added to the checkoutOrder.
|
void |
populateCustomerOrders()
Populates the currentCustomer object with the latest orders made.
|
void |
refreshConfigs()
Refresh the configuration variables.
|
void |
repeatOrder(int orderId,
boolean addToCurrentBasket,
boolean copyCustomFields,
boolean edit)
A new Order is created with the same products as a previous order which is passed in as a
parameter.
|
void |
repeatOrder(com.konakart.appif.OrderIf order,
boolean addToCurrentBasket,
boolean copyCustomFields,
boolean edit)
A new Order is created with the same products as a previous order which is passed in as a
parameter.
|
void |
reset()
Puts the OrderContainer object back into it's original state with no products selected
|
int |
saveOrder(boolean sendEmail)
Deprecated.
Use
saveOrder(boolean sendEmail, EmailOptionsIf options) instead.
This method gives you more flexibility and allows you to specify whether you want
to attach an invoice to the mail. |
int |
saveOrder(boolean sendEmail,
com.konakart.appif.EmailOptionsIf _options)
Calls the engine to save the order.
|
int |
saveOrder(java.lang.String _hostAndPort)
Deprecated.
Since version 2.2.0.6. hostAndPort is no longer used and the sending of email
cannot be controlled from this method. Use saveOrder(boolean sendEmail) instead.
|
void |
sendOrderConfirmationEmail(int orderId,
com.konakart.appif.EmailOptionsIf _options)
Calls the engine to send an order confirmation email to the customer.
|
void |
setCheckoutOrder(com.konakart.appif.OrderIf checkoutOrder)
Sets the checkout order with the order passed in as a parameter.
|
void |
setCheckoutOrderBillingAddress(int addrId)
The address object should already exist in the list of addresses for the current customer.
|
void |
setCheckoutOrderShippingAddress(int addrId)
The address object should already exist in the list of addresses for the current customer.
|
void |
setCouponCode(java.lang.String couponCode)
Latest coupon code entered by the customer
|
void |
setCurrentPage(int currentPage) |
void |
setGiftCertCode(java.lang.String giftCertCode) |
void |
setHostAndPort(java.lang.String hostAndPort)
In the form servername:serverport
|
void |
setNumPages(int numPages) |
void |
setPageList(java.util.ArrayList<java.lang.Integer> pageList) |
void |
setPageSize(int num)
Used to set a user defined maximum number of orders displayed on a page.
|
void |
setRewardPoints(int rewardPoints)
Reward points entered by customer
|
void |
setUseCheckoutOrder(boolean useCheckoutOrder)
Boolean passed to GWT one page checkout code to tell it to either create a new order from the
basket items or to use the current checkoutOrder as would be the case for repeat order.
|
void |
setVendorShippingQuoteMap(java.util.HashMap<java.lang.String,com.konakart.appif.ShippingQuoteIf[]> vendorShippingQuoteMap) |
void |
updateInventory(int orderId)
Update the product inventory based on the products sold in the order identified by orderId.
|
getEng, getKkAppEng, getPages, setEng, setKkAppEng
protected OrderMgr(com.konakart.appif.KKEngIf eng, KKAppEng kkAppEng)
eng
- the engkkAppEng
- the kkAppEngpublic boolean isMgrReady()
isMgrReady
in class BaseMgr
public void refreshConfigs()
public void reset()
public void navigateCurrentOrders(java.lang.String navDir) throws com.konakart.app.KKException, KKAppException
navDir
can take the following values which are retrieved using getter methods on
the OrderMgr instance:
navDir
- the navDircom.konakart.app.KKException
- an unexpected KKException exceptionKKAppException
- an unexpected KKAppException exceptionpublic void populateCheckoutOrderWithOrderTotals() throws java.lang.Exception
java.lang.Exception
- an unexpected exceptionpublic void populateCustomerOrders() throws com.konakart.app.KKException
com.konakart.app.KKException
- an unexpected KKException exceptionpublic void fetchAllOrders() throws com.konakart.app.KKException
com.konakart.app.KKException
- an unexpected KKException exceptionprotected com.konakart.app.OrderSearch getOrderSearch() throws com.konakart.app.KKException
com.konakart.app.KKException
- an unexpected KKException exceptionpublic com.konakart.appif.FetchOrderOptionsIf getFetchOrderOptions() throws com.konakart.app.KKException
com.konakart.app.KKException
- an unexpected KKException exception@Deprecated public int saveOrder(java.lang.String _hostAndPort) throws java.lang.Exception
_hostAndPort
- (i.e. my_server:8970)java.lang.Exception
- an unexpected exception@Deprecated public int saveOrder(boolean sendEmail) throws java.lang.Exception
saveOrder(boolean sendEmail, EmailOptionsIf options)
instead.
This method gives you more flexibility and allows you to specify whether you want
to attach an invoice to the mail.OrderConfReceived
.sendEmail
- Set to true to send an email to the customerjava.lang.Exception
- an unexpected exceptionpublic int saveOrder(boolean sendEmail, com.konakart.appif.EmailOptionsIf _options) throws java.lang.Exception
sendEmail
- Set to true to send an email to the customer_options
- Options for the eMail. If left null, default values will be created.java.lang.Exception
- an unexpected exceptionprotected com.konakart.app.SaveOrderOptions getSaveOrderOptions(com.konakart.appif.OrderIf order)
order
- the orderprotected void archiveOrder(com.konakart.appif.KKEngIf _eng, com.konakart.app.SaveOrderOptions saveOptions, boolean refresh) throws java.lang.Exception
_eng
- The engine to usesaveOptions
- the saveOptionsrefresh
- If true we refresh the order that's just been archivedjava.lang.Exception
- an unexpected exceptionpublic void sendOrderConfirmationEmail(int orderId, com.konakart.appif.EmailOptionsIf _options) throws com.konakart.app.KKException
orderId
- order Id_options
- email optionscom.konakart.app.KKException
- an unexpected exceptionpublic com.konakart.appif.OrderIf getOrder(int orderId) throws com.konakart.app.KKException
selectedOrder
attribute is set to the order.orderId
- The id of the order to fetch.com.konakart.app.KKException
- an unexpected KKException exceptionpublic com.konakart.appif.OrderIf getOrder(int orderId, boolean force) throws com.konakart.app.KKException
selectedOrder
attribute is set to the order.orderId
- The id of the order to fetch.force
- When true, order is always looked up from the DBcom.konakart.app.KKException
- an unexpected KKException exceptionpublic com.konakart.appif.OrderIf[] getVendorOrders(int orderId) throws com.konakart.app.KKException
orderId
- the orderIdcom.konakart.app.KKException
- an unexpected KKException exceptionpublic int getNumberOfOrders()
public com.konakart.appif.OrderIf createCheckoutOrder() throws java.lang.Exception
checkoutOrder
to this
object.java.lang.Exception
- an unexpected exceptionpublic com.konakart.appif.OrderIf createCheckoutOrderWithOptions(com.konakart.appif.CreateOrderOptionsIf _options) throws java.lang.Exception
checkoutOrder
to this
object. It receives an options object as input in order to configure certain aspects of the
creation._options
- An object containing options for the method. It may be set to null.java.lang.Exception
- an unexpected exceptionpublic void createShippingQuotes() throws java.lang.Exception
java.lang.Exception
- an unexpected exceptionpublic com.konakart.appif.PaymentDetailsIf[] createPaymentGatewayList() throws com.konakart.app.KKException
com.konakart.app.KKException
- an unexpected KKException exceptionpublic int getPaymentType()
public void addShippingQuoteToOrder(java.lang.String shippingCode, java.lang.String description)
shippingCode
- e.g. free, item, table, zonesdescription
- Used to make sure that the quotes match. In the case of dynamic lookups we call
them fedex_1, fedex_2 etc and so fedex_1 may in one case be Overnight and in
another case International Priority etc.public void addShippingQuoteToVendorOrder(java.lang.String shippingCode, com.konakart.appif.OrderIf order, java.lang.String description)
shippingCode
- e.g. free, item, table, zonesorder
- The vendor orderdescription
- Used to make sure that the quotes match. In the case of dynamic lookups we call
them fedex_1, fedex_2 etc and so fedex_1 may in one case be Overnight and in
another case International Priority etc.public boolean addPaymentDetailsToOrder(java.lang.String paymentCode) throws com.konakart.app.KKException
paymentCode
- The code of the payment module. e.g. cod, paypal, worldpaycom.konakart.app.KKException
- an unexpected KKException exceptionpublic void setCheckoutOrderShippingAddress(int addrId) throws com.konakart.app.KKException
addrId
- The id of the address objectcom.konakart.app.KKException
- an unexpected KKException exceptionpublic void setCheckoutOrderBillingAddress(int addrId)
addrId
- The id of the address objectpublic void repeatOrder(int orderId, boolean addToCurrentBasket, boolean copyCustomFields, boolean edit) throws KKNotInStockException, java.lang.Exception
CheckoutOrder
is set to the new order. The same payment
and shipping providers are selected although the default billing and shipping addresses are
used since the original ones may no longer be valid.orderId
- The id of the order to be repeatedaddToCurrentBasket
- If set to true, the order items are added to the items in the current basket.
Otherwise the current basket is cleared.copyCustomFields
- If set, the custom fields of the orderProducts are copied to the custom fields of
the basket items so that when the new order is created, the orderProducts of the
new order have the same custom field data as the original order.edit
- Set to true if the repeat order is called for an edit in which case the old order
is archivedKKNotInStockException
- Thrown if the stock of any product is not sufficient for the order and KonaKart
is configured to not allow checkout for products that are not in stock.java.lang.Exception
- an unexpected exceptionpublic void repeatOrder(com.konakart.appif.OrderIf order, boolean addToCurrentBasket, boolean copyCustomFields, boolean edit) throws KKNotInStockException, java.lang.Exception
CheckoutOrder
is set to the new order. The same payment
and shipping providers are selected although the default billing and shipping addresses are
used since the original ones may no longer be valid.order
- The order to be repeatedaddToCurrentBasket
- If set to true, the order items are added to the items in the current basket.
Otherwise the current basket is cleared.copyCustomFields
- If set, the custom fields of the orderProducts are copied to the custom fields of
the basket items so that when the new order is created, the orderProducts of the
new order have the same custom field data as the original order.edit
- Set to true if the repeat order is called for an edit in which case the old order
is archivedKKNotInStockException
- Thrown if the stock of any product is not sufficient for the order and KonaKart
is configured to not allow checkout for products that are not in stock.java.lang.Exception
- an unexpected exceptionprotected boolean isSamePaymentModule(com.konakart.appif.PaymentDetailsIf pd, com.konakart.appif.OrderIf order)
pd
- Payment Details objectorder
- the orderpublic com.konakart.app.Order getLastOrder(int custId, java.lang.String sessionId, int languageId) throws java.lang.Exception
custId
- customer IdsessionId
- Session IDlanguageId
- language IDjava.lang.Exception
- an unexpected Exception exceptionpublic int getIdForUserUpdatingOrder(com.konakart.appif.OrderIf order)
order
- the order being updatedpublic void updateInventory(int orderId) throws com.konakart.app.KKException, KKAppException
orderId
- The id of the ordercom.konakart.app.KKException
- an unexpected KKException exceptionKKAppException
- an unexpected KKAppException exceptionpublic int getCurrentOffset()
public int getMaxRows()
public int getShowBack()
public int getShowNext()
public java.lang.String getNavBack()
navdir
attribute when navigating backwards.public java.lang.String getNavNext()
navdir
attribute when navigating forwards.public java.lang.String getNavStart()
navdir
attribute when navigating to the start.public com.konakart.appif.OrderIf getSelectedOrder()
public int getTotalNumberOfOrders()
public com.konakart.appif.OrderIf[] getCurrentOrders()
public com.konakart.appif.OrderIf getCheckoutOrder()
public void setCheckoutOrder(com.konakart.appif.OrderIf checkoutOrder)
checkoutOrder
- The checkoutOrder to set.public com.konakart.appif.ShippingQuoteIf[] getShippingQuotes()
public com.konakart.appif.PaymentDetailsIf[] getPaymentDetailsArray()
public java.lang.String getHostAndPort()
public void setHostAndPort(java.lang.String hostAndPort)
hostAndPort
- The hostAndPort to set.public boolean isUseCheckoutOrder()
public void setUseCheckoutOrder(boolean useCheckoutOrder)
useCheckoutOrder
- The useCheckoutOrder to set.public com.konakart.appif.CreateOrderOptionsIf getCreateOrderOptions()
public java.lang.String getCouponCode()
public void setCouponCode(java.lang.String couponCode)
couponCode
- the couponCode to setpublic int getRewardPoints()
public void setRewardPoints(int rewardPoints)
rewardPoints
- the rewardPoints to setpublic java.lang.String getGiftCertCode()
public void setGiftCertCode(java.lang.String giftCertCode)
giftCertCode
- the giftCertCode to setpublic void setPageSize(int num)
num
- the numpublic int getPageSize()
public int getNumPages()
public void setNumPages(int numPages)
numPages
- the numPages to setpublic int getCurrentPage()
public void setCurrentPage(int currentPage)
currentPage
- the currentPage to setpublic java.util.ArrayList<java.lang.Integer> getPageList()
public void setPageList(java.util.ArrayList<java.lang.Integer> pageList)
pageList
- the pageList to setpublic java.util.HashMap<java.lang.String,com.konakart.appif.ShippingQuoteIf[]> getVendorShippingQuoteMap()
public void setVendorShippingQuoteMap(java.util.HashMap<java.lang.String,com.konakart.appif.ShippingQuoteIf[]> vendorShippingQuoteMap)
vendorShippingQuoteMap
- the vendorShippingQuoteMap to setCopyright © 2018 DS Data Systems UK Ltd.