]> git.mxchange.org Git - pizzaservice-war.git/commitdiff
updated jars + switched from Deque to List
authorRoland Haeder <roland@mxchange.org>
Wed, 23 Sep 2015 12:52:09 +0000 (14:52 +0200)
committerRoland Haeder <roland@mxchange.org>
Wed, 23 Sep 2015 12:52:09 +0000 (14:52 +0200)
Signed-off-by:Roland Häder <roland@mxchange.org>

lib/jcore.jar
lib/jcoreee.jar
lib/jshop-core.jar
lib/jshop-ee-lib.jar
src/java/org/mxchange/pizzaapplication/beans/basket/BasketWebBean.java
src/java/org/mxchange/pizzaapplication/beans/controller/ShopWebBean.java
src/java/org/mxchange/pizzaapplication/beans/controller/ShopWebController.java
src/java/org/mxchange/pizzaapplication/beans/customer/CustomerWebBean.java
src/java/org/mxchange/pizzaapplication/beans/product/AdminProductWebBean.java
src/java/org/mxchange/pizzaapplication/beans/product/AdminProductWebController.java

index ead5916a21197864b7915b3c83d96c971ff478c8..e17de0c88e23d89b1f0953bcc4c3f8114d699b84 100644 (file)
Binary files a/lib/jcore.jar and b/lib/jcore.jar differ
index 93d401de39c53a2d93aaa31e42cad7b2ccac7bb9..ba35a455448e8374b4f25033d5ba05f5b6b7d3f1 100644 (file)
Binary files a/lib/jcoreee.jar and b/lib/jcoreee.jar differ
index f1aab858f0564debc187991ee4374bf956001f0a..bbfc4d47166a7908ed871f04030b505436fcc771 100644 (file)
Binary files a/lib/jshop-core.jar and b/lib/jshop-core.jar differ
index 6506266fda2670bff7f67138d709ff8339038a25..46fa0d78af40d07064c0344f6a70eef270de8117 100644 (file)
Binary files a/lib/jshop-ee-lib.jar and b/lib/jshop-ee-lib.jar differ
index afc1020d897271d781f3f08159a116eaa67d471a..25da04d7a60b8b0f35181cdc06674e8441ce02d3 100644 (file)
@@ -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;
 
 /**
index 3a37066c83c1deac6ab30f63bed167d3b6755dcb..9c861d19fc7247d966289ff48aa1421a31ba5514 100644 (file)
@@ -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<Product> availableProducts;
+       private List<Product> availableProducts;
 
        /**
         * All categories
         */
-       private Deque<Category> categories;
+       private List<Category> categories;
 
        @Override
        public void addCategory (final Category category) {
@@ -100,31 +100,34 @@ public class ShopWebBean extends BaseFrameworkBean implements ShopWebController
        }
 
        @Override
-       public Deque<Category> getAllCategories () throws FacesException {
+       public List<Category> getAllCategories () throws FacesException {
                // Return it
                // TODO Find something better here to prevent warning
-               return this.categories;
+               return Collections.unmodifiableList(this.categories);
        }
 
        @Override
-       public Deque<Category> getAllCategoriesParent () throws FaceletException {
+       public List<Category> getAllCategoriesParent () throws FaceletException {
                // Get regular list
-               Deque<Category> deque = new LinkedList<>(this.getAllCategories());
+               List<Category> 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<Product> getAvailableProducts () throws FacesException {
+       public List<Product> getAvailableProducts () throws FacesException {
                // Return it
                // TODO Find something better here to prevent warning
-               return this.availableProducts;
+               return Collections.unmodifiableList(this.availableProducts);
        }
 }
index 88e0b1c33e4f9a1c8a4d7014ebcba78ff3362731..61bd49b7a104e92c8f237794125c584c17a84f43 100644 (file)
@@ -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<Product> getAvailableProducts () throws FaceletException;
+       public List<Product> 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<Category> getAllCategories () throws FaceletException;
+       public List<Category> 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<Category> getAllCategoriesParent () throws FaceletException;
+       public List<Category> getAllCategoriesParent () throws FaceletException;
 }
index 4bb3504268896db92d090e5b3531c47375e023c2..de93ed505da56adf3d614ed3c3e551ddd2299f35 100644 (file)
@@ -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));
index 9de60f84d59df174ef187dce316597b189f4f451..8efd6f92027536ff2746543c43fd2776689fa665 100644 (file)
@@ -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<Product> getAllProducts () throws FaceletException {
+       public List<Product> getAllProducts () throws FaceletException {
                // Call bean
                return this.productBean.getAllProducts();
        }
index a2ab41677126ecd1e884400f8fab01dd849c7dad..29b26d0f9cf1c17434936d352a0f37df462e2e28 100644 (file)
@@ -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<Product> getAllProducts () throws FaceletException;
+       public List<Product> getAllProducts () throws FaceletException;
 
        /**
         * Getter for product's title property