|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.paneris.melati.shopping.ShoppingTrolley
org.paneris.bibliomania.shopping.BibliomaniaShoppingTrolley
public class BibliomaniaShoppingTrolley
A Shopping Trolley stored information in the user's Shopping Trolley.
It does this by storing itself in the session.
For this reason, the constructors are private, and you will be expected to always get the Shopping Trolley using getInstance();
usage example: ShoppingTrolley trolley = ShoppingTrolley.getInstance(Melati melati); context.put("trolley", trolley);
| Nested Class Summary | |
|---|---|
class |
BibliomaniaShoppingTrolley.SupplierCharge
|
| Field Summary | |
|---|---|
Country |
countryCode
|
| Fields inherited from class org.paneris.melati.shopping.ShoppingTrolley |
|---|
address, config, country, county, email, hasDetails, locale, melati, message, name, postcode, tel, town, VAT_PERCENT_TIMES_TEN |
| Constructor Summary | |
|---|---|
BibliomaniaShoppingTrolley()
|
|
| Method Summary | |
|---|---|
void |
assertLogin(org.melati.Melati melatiP)
|
boolean |
canSupply()
Can we deliver this - we need to check that each item has a supplier. |
void |
configureRequest(org.melati.Melati melatiP)
|
void |
confirmPayment(org.melati.Melati melatiP)
|
double |
convertFromUK(double value)
Convert from foreign currency back to sterling. |
java.lang.String |
convertFromUKandFormat(double value)
Format a number in the locale currency. |
double |
convertToUK(double value)
Convert from foreign currency back to sterling. |
java.lang.String |
displayCurrency(double value)
|
org.melati.poem.Field |
getCountries()
|
Country |
getCountryCode()
|
Currency |
getCurrency()
|
Currency |
getCurrency(java.util.Locale localeP)
|
double |
getDeliveryValue()
Work out the cost of delivery. |
double |
getDiscountRate()
If you want to apply a discount to this order, do it here. |
java.util.Locale |
getLocale()
Get the Locale for this trolley. |
ShopOrder |
getOrder()
|
java.util.Enumeration |
getSuppliersCharges()
Extract the list of supplier's charges. |
boolean |
hasDelivery()
Provide a mechanism for working out if this order should include a delivery charge. |
boolean |
hasDiscount()
Provide a mechanism for working out if this order should include a discount. |
boolean |
hasVAT()
Provide a mechanism for working out if this order should include VAT (default should be true). |
void |
initialise(org.melati.Melati melatiP,
org.paneris.melati.shopping.MelatiShoppingConfig configP)
Public Constructor to build a trolley from some id. |
void |
load(java.lang.Integer id)
Load a trolley from something persistent. |
static java.lang.String |
name()
Return the name of the trolley (for storing in the session). |
static double |
round(double num)
|
void |
save()
Save a trolley to something persistent. |
void |
setCountryCode(Country newCode)
|
void |
setDefaultDetails(org.melati.Melati melati)
|
void |
setFromForm(org.melati.Melati melati)
|
| Methods inherited from class org.paneris.melati.shopping.ShoppingTrolley |
|---|
abandonURL, addItem, baseURL, confirmURL, detailsURL, displayCurrency, getCountry, getCounty, getDeliveryAddress, getDeliveryDisplay, getDiscountRateDisplay, getDiscountValue, getDiscountValueDisplay, getEmail, getInstance, getItem, getItems, getMessage, getName, getPostcode, getTel, getTotalDeliveryValue, getTotalValue, getTotalValueDisplay, getTotalValuePence, getTown, getValue, getValueDisplay, getVATDisplay, getVATValue, hasDetails, initialise, isEmpty, newItem, newTrolley, paidURL, remove, removeItem, roundTo2dp, setCountry, setCounty, setDeliveryAddress, setEmail, setLocale, setMessage, setName, setPostcode, setTel, setTown, updateURL, viewURL |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public Country countryCode
| Constructor Detail |
|---|
public BibliomaniaShoppingTrolley()
| Method Detail |
|---|
public java.util.Locale getLocale()
getLocale in class org.paneris.melati.shopping.ShoppingTrolley
public void initialise(org.melati.Melati melatiP,
org.paneris.melati.shopping.MelatiShoppingConfig configP)
initialise in class org.paneris.melati.shopping.ShoppingTrolley
public void load(java.lang.Integer id)
throws org.melati.util.InstantiationPropertyException
load in class org.paneris.melati.shopping.ShoppingTrolleyorg.melati.util.InstantiationPropertyExceptionpublic void save()
save in class org.paneris.melati.shopping.ShoppingTrolleypublic boolean hasDelivery()
hasDelivery in class org.paneris.melati.shopping.ShoppingTrolleypublic boolean canSupply()
public double getDeliveryValue()
getDeliveryValue in class org.paneris.melati.shopping.ShoppingTrolleypublic java.util.Enumeration getSuppliersCharges()
public boolean hasDiscount()
hasDiscount in class org.paneris.melati.shopping.ShoppingTrolleypublic double getDiscountRate()
getDiscountRate in class org.paneris.melati.shopping.ShoppingTrolleypublic boolean hasVAT()
hasVAT in class org.paneris.melati.shopping.ShoppingTrolleypublic org.melati.poem.Field getCountries()
public Country getCountryCode()
public void setFromForm(org.melati.Melati melati)
setFromForm in class org.paneris.melati.shopping.ShoppingTrolleypublic void setCountryCode(Country newCode)
public void setDefaultDetails(org.melati.Melati melati)
setDefaultDetails in class org.paneris.melati.shopping.ShoppingTrolleypublic void assertLogin(org.melati.Melati melatiP)
assertLogin in class org.paneris.melati.shopping.ShoppingTrolleypublic void confirmPayment(org.melati.Melati melatiP)
confirmPayment in class org.paneris.melati.shopping.ShoppingTrolleypublic static java.lang.String name()
public ShopOrder getOrder()
public static double round(double num)
public java.lang.String convertFromUKandFormat(double value)
public double convertFromUK(double value)
public double convertToUK(double value)
public Currency getCurrency(java.util.Locale localeP)
public Currency getCurrency()
public java.lang.String displayCurrency(double value)
displayCurrency in class org.paneris.melati.shopping.ShoppingTrolleypublic void configureRequest(org.melati.Melati melatiP)
configureRequest in class org.paneris.melati.shopping.ShoppingTrolley
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||