@Override
public String addItem (final Product product) {
// Trace message
- //this.getLogger().logTrace(MessageFormat.format("addItem: product={0} - CALLED!", product));
+ //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("addItem: product={0} - CALLED!", product));
// product should not be null
if (null == product) {
// Is orderedAmount set?
if (this.getOrderedAmount() == null) {
// Trace message
- //this.getLogger().logTrace("addItem: orderedAmount not specified, returning null ... - EXIT!");
+ //* NOISY-DEBUG: */ System.out.println("addItem: orderedAmount not specified, returning null ... - EXIT!");
// No orderedAmount specified?!
return null;
this.setOrderedAmount(null);
// Trace message
- //this.getLogger().logTrace(MessageFormat.format("addItem: item {0} - has been added to basket. - EXIT!", item));
+ //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("addItem: item {0} - has been added to basket. - EXIT!", item));
// Added
return "item_added"; //NOI18N
@Override
public List<AddableBasketItem> allItems () {
// Trace message
- //this.getLogger().logTrace("allItems: CALLED!");
+ //* NOISY-DEBUG: */ System.out.println("allItems: CALLED!");
// Deligate to basket instance
List<AddableBasketItem> list = this.basket.getAll();
// Trace message
- //this.getLogger().logTrace(MessageFormat.format("allItems: list={0} - EXIT!", list));
+ //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("allItems: list={0} - EXIT!", list));
// Return it
return list;
@Override
public Float calculateCurrentItemPrice () {
// Trace message
- //this.getLogger().logTrace("calculateCurrentItemPrice: CALLED!");
+ //* NOISY-DEBUG: */ System.out.println("calculateCurrentItemPrice: CALLED!");
// Is the current item/amount set?
if (this.getCurrentItem() == null) {
Float totalPrice = (this.getCurrentItem().getItemProduct().getProductPrice() * this.getCurrentItem().getOrderedAmount());
// Trace message
- //this.getLogger().logTrace(MessageFormat.format("calculateCurrentItemPrice: totalPrice={0} - EXIT!", totalPrice));
+ //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("calculateCurrentItemPrice: totalPrice={0} - EXIT!", totalPrice));
// Return it
return totalPrice;
@Override
public Float calculateItemPrice (final AddableBasketItem item) {
// Trace message
- //this.getLogger().logTrace(MessageFormat.format("calculateItemPrice: item={0} - CALLED!", item));
+ //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("calculateItemPrice: item={0} - CALLED!", item));
// item must not be null
if (null == item) {
}
// Trace message
- //this.getLogger().logTrace(MessageFormat.format("calculateItemPrice: totalPrice={0} - EXIT!", totalPrice));
+ //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("calculateItemPrice: totalPrice={0} - EXIT!", totalPrice));
// Return it
return totalPrice;
@Override
public Float calculateTotalPrice () {
// Trace message
- //this.getLogger().logTrace("calculateTotalPrice: CALLED!");
+ //* NOISY-DEBUG: */ System.out.println("calculateTotalPrice: CALLED!");
// Init total price
Float totalPrice = 0.0f;
}
// Trace message
- //this.getLogger().logTrace(MessageFormat.format("calculateTotalPrice: totalPrice={0} - EXIT!", totalPrice));
+ //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("calculateTotalPrice: totalPrice={0} - EXIT!", totalPrice));
// Return final sum
return totalPrice;
@Override
public String doChangeItem (final AddableBasketItem item) {
// Trace message
- //this.getLogger().logTrace(MessageFormat.format("doChangeItem: item={0} - CALLED!", item));
+ //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("doChangeItem: item={0} - CALLED!", item));
// item shall not be null
if (null == item) {
}
// Trace message
- //this.getLogger().logTrace(MessageFormat.format("doChangeItem: targetPage={0} - EXIT!", targetPage));
+ //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("doChangeItem: targetPage={0} - EXIT!", targetPage));
// Return page
return targetPage;
@Override
public Long getItemAmount (final Product product) {
// Trace message
- //this.getLogger().logTrace(MessageFormat.format("getItemAmount: product={0} - CALLED!", product));
+ //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("getItemAmount: product={0} - CALLED!", product));
// product should not be null
if (null == product) {
}
// Trace message
- //this.getLogger().logTrace(MessageFormat.format("getItemAmount: itemAmount={0} - EXIT!", itemAmount));
+ //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("getItemAmount: itemAmount={0} - EXIT!", itemAmount));
// Return it
return itemAmount;
@Override
public boolean isProductAdded (final Product product) {
// Trace message
- //this.getLogger().logTrace(MessageFormat.format("isProductAdded: product={0} - EXIT!", product));
+ //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("isProductAdded: product={0} - EXIT!", product));
// Must not be null
if (null == product) {
}
// Trace message
- //this.getLogger().logTrace(MessageFormat.format("isProductAdded: isAdded={0} - EXIT!", isAdded));
+ //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("isProductAdded: isAdded={0} - EXIT!", isAdded));
// Return status
return isAdded;
@Override
public String outputLastAddedItem () {
// Trace message
- //this.getLogger().logTrace("outputLastAddedItem: CALLED!");
+ //* NOISY-DEBUG: */ System.out.println("outputLastAddedItem: CALLED!");
// Default message
String lastItem = ""; //NOI18N
}
// Trace message
- //this.getLogger().logTrace(MessageFormat.format("outputLastAddedItem: lastItem={0} - EXIT!", lastItem));
+ //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("outputLastAddedItem: lastItem={0} - EXIT!", lastItem));
// Return it
return lastItem;
*/
private AddableBasketItem getItemFromProduct (final Product product) {
// Trace message
- //this.getLogger().logTrace(MessageFormat.format("getItemFromProduct: product={0} - CALLED!", product));
+ //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("getItemFromProduct: product={0} - CALLED!", product));
// Product must not be null
if (null == product) {
}
// Trace message
- //this.getLogger().logTrace(MessageFormat.format("getItemFromProduct: foundItem={0} - EXIT!", foundItem));
+ //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("getItemFromProduct: foundItem={0} - EXIT!", foundItem));
// Return it
return foundItem;
@Override
public String doCheckout () {
// Trace message
- //this.getLogger().logTrace("doCheckout: CALLED!");
+ //* NOISY-DEBUG: */ System.out.println("doCheckout: CALLED!");
// Are the beans set?
if (null == this.basketController) {
// Are at least the required fields set?
if (!this.contactController.isRequiredPersonalDataSet()) {
// Trace message
- //this.getLogger().logTrace("doCheckout: Not all required fields are set, returning checkout2 ... - EXIT!");
+ //* NOISY-DEBUG: */ System.out.println("doCheckout: Not all required fields are set, returning checkout2 ... - EXIT!");
// Not set, should not happen
return "checkout2"; //NOI18N
} else if (this.basketController.isEmpty()) {
// Trace message
- //this.getLogger().logTrace("doCheckout: basket is empty, returning empty_basket ... - EXIT!");
+ //* NOISY-DEBUG: */ System.out.println("doCheckout: basket is empty, returning empty_basket ... - EXIT!");
// Nothing to order
return "empty_basket"; //NOI18N
// Debug message
//this.getLogger().logDebug(MessageFormat.format("doCheckout: customer={0}", this.getCustomer()));
+
// Get ordered list
List<AddableBasketItem> list = this.basketController.allItems();
// Debug message
- //this.getLogger().logTrace(MessageFormat.format("doCheckout: list={0}", list));
+ //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("doCheckout: list={0}", list));
+
// Construct container
WrapableCheckout wrapper = new CheckoutWrapper();
wrapper.setCustomer(this.getCustomer());