From: Roland Haeder Date: Wed, 23 Sep 2015 12:52:09 +0000 (+0200) Subject: updated jars + switched from Deque to List X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=44103982ccff50f72918a601658d6eb1c033488d;p=pizzaservice-war.git updated jars + switched from Deque to List Signed-off-by:Roland Häder --- diff --git a/lib/jcore.jar b/lib/jcore.jar index ead5916a..e17de0c8 100644 Binary files a/lib/jcore.jar and b/lib/jcore.jar differ diff --git a/lib/jcoreee.jar b/lib/jcoreee.jar index 93d401de..ba35a455 100644 Binary files a/lib/jcoreee.jar and b/lib/jcoreee.jar differ diff --git a/lib/jshop-core.jar b/lib/jshop-core.jar index f1aab858..bbfc4d47 100644 Binary files a/lib/jshop-core.jar and b/lib/jshop-core.jar differ diff --git a/lib/jshop-ee-lib.jar b/lib/jshop-ee-lib.jar index 6506266f..46fa0d78 100644 Binary files a/lib/jshop-ee-lib.jar and b/lib/jshop-ee-lib.jar differ diff --git a/src/java/org/mxchange/pizzaapplication/beans/basket/BasketWebBean.java b/src/java/org/mxchange/pizzaapplication/beans/basket/BasketWebBean.java index afc1020d..25da04d7 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/basket/BasketWebBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/basket/BasketWebBean.java @@ -32,7 +32,7 @@ import org.mxchange.jshopcore.model.basket.AddableBasketItem; import org.mxchange.jshopcore.model.basket.Basket; import org.mxchange.jshopcore.model.basket.BasketSessionBeanRemote; import org.mxchange.jshopcore.model.basket.ShopBasket; -import org.mxchange.jshopcore.model.item.BasketItem; +import org.mxchange.jshopcore.model.basket.items.BasketItem; import org.mxchange.jshopcore.model.product.Product; /** diff --git a/src/java/org/mxchange/pizzaapplication/beans/controller/ShopWebBean.java b/src/java/org/mxchange/pizzaapplication/beans/controller/ShopWebBean.java index 3a37066c..9c861d19 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/controller/ShopWebBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/controller/ShopWebBean.java @@ -16,9 +16,9 @@ */ package org.mxchange.pizzaapplication.beans.controller; -import java.util.Deque; +import java.util.Collections; import java.util.LinkedList; -import java.util.Queue; +import java.util.List; import javax.annotation.PostConstruct; import javax.enterprise.context.ApplicationScoped; import javax.faces.FacesException; @@ -51,12 +51,12 @@ public class ShopWebBean extends BaseFrameworkBean implements ShopWebController /** * "Cache" for all available products */ - private Deque availableProducts; + private List availableProducts; /** * All categories */ - private Deque categories; + private List categories; @Override public void addCategory (final Category category) { @@ -100,31 +100,34 @@ public class ShopWebBean extends BaseFrameworkBean implements ShopWebController } @Override - public Deque getAllCategories () throws FacesException { + public List getAllCategories () throws FacesException { // Return it // TODO Find something better here to prevent warning - return this.categories; + return Collections.unmodifiableList(this.categories); } @Override - public Deque getAllCategoriesParent () throws FaceletException { + public List getAllCategoriesParent () throws FaceletException { // Get regular list - Deque deque = new LinkedList<>(this.getAllCategories()); + List deque = new LinkedList<>(); // Create fake entry Category fake = new ProductCategory(0L, this.getMessage("ADMIN_CATEGORY_HAS_NO_PARENT"), 0L); //NOI18N // Add it - deque.addFirst(fake); + deque.add(fake); + + // Add all + deque.addAll(this.getAllCategories()); // Return it return deque; } @Override - public Queue getAvailableProducts () throws FacesException { + public List getAvailableProducts () throws FacesException { // Return it // TODO Find something better here to prevent warning - return this.availableProducts; + return Collections.unmodifiableList(this.availableProducts); } } diff --git a/src/java/org/mxchange/pizzaapplication/beans/controller/ShopWebController.java b/src/java/org/mxchange/pizzaapplication/beans/controller/ShopWebController.java index 88e0b1c3..61bd49b7 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/controller/ShopWebController.java +++ b/src/java/org/mxchange/pizzaapplication/beans/controller/ShopWebController.java @@ -17,8 +17,7 @@ package org.mxchange.pizzaapplication.beans.controller; import java.io.Serializable; -import java.util.Deque; -import java.util.Queue; +import java.util.List; import javax.faces.view.facelets.FaceletException; import org.mxchange.jshopcore.model.category.Category; import org.mxchange.jshopcore.model.product.Product; @@ -50,7 +49,7 @@ public interface ShopWebController extends Serializable { * @return Only available products * @throws javax.faces.view.facelets.FaceletException If anything went wrong */ - public Queue getAvailableProducts () throws FaceletException; + public List getAvailableProducts () throws FaceletException; /** * Some "getter" for a linked list of all categories @@ -58,7 +57,7 @@ public interface ShopWebController extends Serializable { * @return All categories * @throws javax.faces.view.facelets.FaceletException If anything went wrong */ - public Deque getAllCategories () throws FaceletException; + public List getAllCategories () throws FaceletException; /** * Some "getter" for a linked list of all categories including "Has no @@ -67,5 +66,5 @@ public interface ShopWebController extends Serializable { * @return All categories * @throws javax.faces.view.facelets.FaceletException If anything went wrong */ - public Deque getAllCategoriesParent () throws FaceletException; + public List getAllCategoriesParent () throws FaceletException; } diff --git a/src/java/org/mxchange/pizzaapplication/beans/customer/CustomerWebBean.java b/src/java/org/mxchange/pizzaapplication/beans/customer/CustomerWebBean.java index 4bb35042..de93ed50 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/customer/CustomerWebBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/customer/CustomerWebBean.java @@ -24,6 +24,8 @@ import javax.inject.Named; import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingException; +import org.mxchange.jcore.model.contact.Contact; +import org.mxchange.jcore.model.contact.CustomerContact; import org.mxchange.jcore.model.contact.gender.Gender; import org.mxchange.jcoreee.beans.BaseFrameworkBean; import org.mxchange.jshopcore.model.customer.Customer; @@ -148,17 +150,23 @@ public class CustomerWebBean extends BaseFrameworkBean implements CustomerWebCon // Create new customer instance Customer customer = new ShopCustomer(); - customer.setGender(this.getGender()); - customer.setFirstName(this.getFirstName()); - customer.setFamilyName(this.getFamilyName()); - customer.setCompanyName(this.getCompanyName()); - customer.setStreet(this.getStreet()); - customer.setHouseNumber(this.getHouseNumber()); - customer.setZipCode(this.getZipCode()); - customer.setCity(this.getCity()); - customer.setPhoneNumber(this.getPhoneNumber()); - customer.setFaxNumber(this.getFaxNumber()); - customer.setCellphoneNumber(this.getCellphoneNumber()); + + // Create new contact + Contact contact = new CustomerContact(); + contact.setGender(this.getGender()); + contact.setFirstName(this.getFirstName()); + contact.setFamilyName(this.getFamilyName()); + contact.setCompanyName(this.getCompanyName()); + contact.setStreet(this.getStreet()); + contact.setHouseNumber(this.getHouseNumber()); + contact.setZipCode(this.getZipCode()); + contact.setCity(this.getCity()); + contact.setPhoneNumber(this.getPhoneNumber()); + contact.setFaxNumber(this.getFaxNumber()); + contact.setCellphoneNumber(this.getCellphoneNumber()); + + // Set contact in customer + customer.setContact(contact); // Trace message this.getLogger().logTrace(MessageFormat.format("createInstance: customer={0} - EXIT!", customer)); diff --git a/src/java/org/mxchange/pizzaapplication/beans/product/AdminProductWebBean.java b/src/java/org/mxchange/pizzaapplication/beans/product/AdminProductWebBean.java index 9de60f84..8efd6f92 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/product/AdminProductWebBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/product/AdminProductWebBean.java @@ -16,7 +16,7 @@ */ package org.mxchange.pizzaapplication.beans.product; -import java.util.Deque; +import java.util.List; import javax.enterprise.context.RequestScoped; import javax.faces.view.facelets.FaceletException; import javax.inject.Inject; @@ -126,7 +126,7 @@ public class AdminProductWebBean extends BaseFrameworkBean implements AdminProdu } @Override - public Deque getAllProducts () throws FaceletException { + public List getAllProducts () throws FaceletException { // Call bean return this.productBean.getAllProducts(); } diff --git a/src/java/org/mxchange/pizzaapplication/beans/product/AdminProductWebController.java b/src/java/org/mxchange/pizzaapplication/beans/product/AdminProductWebController.java index a2ab4167..29b26d0f 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/product/AdminProductWebController.java +++ b/src/java/org/mxchange/pizzaapplication/beans/product/AdminProductWebController.java @@ -16,7 +16,7 @@ */ package org.mxchange.pizzaapplication.beans.product; -import java.util.Deque; +import java.util.List; import javax.faces.view.facelets.FaceletException; import org.mxchange.jshopcore.model.product.Product; @@ -40,7 +40,7 @@ public interface AdminProductWebController { * @return All products * @throws javax.faces.view.facelets.FaceletException If anything went wrong */ - public Deque getAllProducts () throws FaceletException; + public List getAllProducts () throws FaceletException; /** * Getter for product's title property