From: Roland Haeder Date: Tue, 8 Sep 2015 20:48:29 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=6dd50dc44f9f220f4c32ce1dca3d620f3e5de06e;p=pizzaservice-war.git Continued: - first pages are working again! - migrated from JSP to JSF (more needs to be done) - added navigation rules - updated jcore.jar, jcoreee.jar, jshop-core.jar, jshop-ee-lib.jar + jswingcore.jar Signed-off-by:Roland Häder --- diff --git a/lib/jcore.jar b/lib/jcore.jar index 7318d475..217c364f 100644 Binary files a/lib/jcore.jar and b/lib/jcore.jar differ diff --git a/lib/jcoreee.jar b/lib/jcoreee.jar index f479cd85..9f0039fe 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 9965f385..3772ba4f 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 54ab89b5..7b536402 100644 Binary files a/lib/jshop-ee-lib.jar and b/lib/jshop-ee-lib.jar differ diff --git a/nbproject/build-impl.xml b/nbproject/build-impl.xml index cd59461d..4f43a2bd 100644 --- a/nbproject/build-impl.xml +++ b/nbproject/build-impl.xml @@ -1030,11 +1030,11 @@ exists or setup the property manually. For example like this: - + @@ -1044,11 +1044,11 @@ exists or setup the property manually. For example like this: - + diff --git a/nbproject/genfiles.properties b/nbproject/genfiles.properties index 2ae24f4c..c0c289dc 100644 --- a/nbproject/genfiles.properties +++ b/nbproject/genfiles.properties @@ -1,8 +1,8 @@ -build.xml.data.CRC32=1edfee4e +build.xml.data.CRC32=ae8d1d07 build.xml.script.CRC32=82213886 build.xml.stylesheet.CRC32=651128d4@1.68.1.1 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. -nbproject/build-impl.xml.data.CRC32=1edfee4e -nbproject/build-impl.xml.script.CRC32=055d9dec +nbproject/build-impl.xml.data.CRC32=ae8d1d07 +nbproject/build-impl.xml.script.CRC32=6b50b9cf nbproject/build-impl.xml.stylesheet.CRC32=99ea4b56@1.68.1.1 diff --git a/nbproject/project.properties b/nbproject/project.properties index a21586fd..f0ff76fd 100644 --- a/nbproject/project.properties +++ b/nbproject/project.properties @@ -50,7 +50,7 @@ j2ee.compile.on.save=true j2ee.copy.static.files.on.save=true j2ee.deploy.on.save=true j2ee.platform=1.7 -j2ee.platform.classpath=${j2ee.server.middleware}/mq/lib/jaxm-api.jar:${j2ee.server.home}/modules/endorsed/javax.annotation-api.jar:${j2ee.server.home}/modules/endorsed/jaxb-api.jar:${j2ee.server.home}/modules/endorsed/webservices-api-osgi.jar:${j2ee.server.home}/modules/bean-validator.jar:${j2ee.server.home}/modules/javax.batch-api.jar:${j2ee.server.home}/modules/javax.ejb-api.jar:${j2ee.server.home}/modules/javax.el.jar:${j2ee.server.home}/modules/javax.enterprise.concurrent-api.jar:${j2ee.server.home}/modules/javax.enterprise.concurrent.jar:${j2ee.server.home}/modules/javax.enterprise.deploy-api.jar:${j2ee.server.home}/modules/javax.faces.jar:${j2ee.server.home}/modules/javax.inject.jar:${j2ee.server.home}/modules/javax.interceptor-api.jar:${j2ee.server.home}/modules/javax.jms-api.jar:${j2ee.server.home}/modules/javax.json.jar:${j2ee.server.home}/modules/javax.mail.jar:${j2ee.server.home}/modules/javax.management.j2ee-api.jar:${j2ee.server.home}/modules/javax.persistence.jar:${j2ee.server.home}/modules/javax.resource-api.jar:${j2ee.server.home}/modules/javax.security.auth.message-api.jar:${j2ee.server.home}/modules/javax.security.jacc-api.jar:${j2ee.server.home}/modules/javax.servlet-api.jar:${j2ee.server.home}/modules/javax.servlet.jsp-api.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jstl-api.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jstl.jar:${j2ee.server.home}/modules/javax.transaction-api.jar:${j2ee.server.home}/modules/javax.websocket-api.jar:${j2ee.server.home}/modules/javax.ws.rs-api.jar:${j2ee.server.home}/modules/javax.xml.registry-api.jar:${j2ee.server.home}/modules/javax.xml.rpc-api.jar:${j2ee.server.home}/modules/jaxb-osgi.jar:${j2ee.server.home}/modules/webservices-osgi.jar:${j2ee.server.home}/modules/weld-osgi-bundle.jar +j2ee.platform.classpath=${j2ee.server.middleware}/mq/lib/jaxm-api.jar:${j2ee.server.home}/modules/endorsed/javax.annotation-api.jar:${j2ee.server.home}/modules/endorsed/webservices-api-osgi.jar:${j2ee.server.home}/modules/endorsed/jaxb-api.jar:${j2ee.server.home}/modules/javax.batch-api.jar:${j2ee.server.home}/modules/javax.security.auth.message-api.jar:${j2ee.server.home}/modules/javax.faces.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jstl-api.jar:${j2ee.server.home}/modules/javax.transaction-api.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jar:${j2ee.server.home}/modules/webservices-osgi.jar:${j2ee.server.home}/modules/javax.mail.jar:${j2ee.server.home}/modules/javax.interceptor-api.jar:${j2ee.server.home}/modules/javax.inject.jar:${j2ee.server.home}/modules/javax.resource-api.jar:${j2ee.server.home}/modules/javax.enterprise.concurrent-api.jar:${j2ee.server.home}/modules/javax.el.jar:${j2ee.server.home}/modules/javax.ejb-api.jar:${j2ee.server.home}/modules/javax.xml.rpc-api.jar:${j2ee.server.home}/modules/javax.security.jacc-api.jar:${j2ee.server.home}/modules/javax.json.jar:${j2ee.server.home}/modules/javax.xml.registry-api.jar:${j2ee.server.home}/modules/javax.websocket-api.jar:${j2ee.server.home}/modules/javax.management.j2ee-api.jar:${j2ee.server.home}/modules/javax.servlet-api.jar:${j2ee.server.home}/modules/javax.jms-api.jar:${j2ee.server.home}/modules/javax.enterprise.concurrent.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jstl.jar:${j2ee.server.home}/modules/javax.enterprise.deploy-api.jar:${j2ee.server.home}/modules/bean-validator.jar:${j2ee.server.home}/modules/javax.ws.rs-api.jar:${j2ee.server.home}/modules/javax.servlet.jsp-api.jar:${j2ee.server.home}/modules/jaxb-osgi.jar:${j2ee.server.home}/modules/weld-osgi-bundle.jar:${j2ee.server.home}/modules/javax.persistence.jar j2ee.platform.embeddableejb.classpath=${j2ee.server.home}/lib/embedded/glassfish-embedded-static-shell.jar j2ee.platform.wscompile.classpath=${j2ee.server.home}/modules/webservices-osgi.jar j2ee.platform.wsgen.classpath=${j2ee.server.home}/modules/webservices-osgi.jar:${j2ee.server.home}/modules/endorsed/webservices-api-osgi.jar:${j2ee.server.home}/modules/jaxb-osgi.jar:${j2ee.server.home}/modules/endorsed/jaxb-api.jar @@ -59,11 +59,11 @@ j2ee.platform.wsit.classpath= j2ee.server.type=gfv3ee6 jar.compress=false javac.classpath=\ - ${reference.PizzaService-lib.jar}:\ ${file.reference.jcore.jar}:\ ${file.reference.jcoreee.jar}:\ ${file.reference.jshop-core.jar}:\ ${file.reference.jshop-ee-lib.jar}:\ + ${reference.PizzaService-lib.jar}:\ ${file.reference.cdi-api.jar}:\ ${file.reference.gf-client.jar}:\ ${file.reference.log4j-api-2.3.jar}:\ diff --git a/nbproject/project.xml b/nbproject/project.xml index dee8330a..a412ce80 100644 --- a/nbproject/project.xml +++ b/nbproject/project.xml @@ -6,10 +6,6 @@ PizzaService-war 1.6.5 - - ${reference.PizzaService-lib.jar} - WEB-INF/lib - ${file.reference.jcore.jar} WEB-INF/lib @@ -26,6 +22,10 @@ ${file.reference.jshop-ee-lib.jar} WEB-INF/lib + + ${reference.PizzaService-lib.jar} + WEB-INF/lib + ${file.reference.cdi-api.jar} WEB-INF/lib diff --git a/src/java/org/mxchange/pizzaapplication/beans/basket/PizzaBasketWebBean.java b/src/java/org/mxchange/pizzaapplication/beans/basket/PizzaBasketWebBean.java index 68ffc3bc..12b55bc1 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/basket/PizzaBasketWebBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/basket/PizzaBasketWebBean.java @@ -17,6 +17,7 @@ package org.mxchange.pizzaapplication.beans.basket; import java.io.Serializable; +import org.mxchange.jshopcore.model.product.Product; /** * An interface for a basket @@ -37,4 +38,11 @@ public interface PizzaBasketWebBean extends Serializable { * @return Whether the basket is empty */ public boolean hasItems (); + + /** + * Setter for current product instance + * + * @param product Product instance + */ + public void setCurrentProduct (final Product product); } diff --git a/src/java/org/mxchange/pizzaapplication/beans/basket/PizzaServiceBasketWebBean.java b/src/java/org/mxchange/pizzaapplication/beans/basket/PizzaServiceBasketWebBean.java index 05586ed7..eca1f9eb 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/basket/PizzaServiceBasketWebBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/basket/PizzaServiceBasketWebBean.java @@ -24,7 +24,8 @@ import javax.inject.Named; import javax.naming.InitialContext; import javax.naming.NamingException; import org.mxchange.jcoreee.beans.BaseFrameworkBean; -import org.mxchange.jshopeelib.beans.remote.basket.BasketSessionBeanRemote; +import org.mxchange.jshopcore.model.basket.BasketSessionBeanRemote; +import org.mxchange.jshopcore.model.product.Product; /** * A bean for the basket @@ -45,6 +46,11 @@ public class PizzaServiceBasketWebBean extends BaseFrameworkBean implements Pizz */ private final BasketSessionBeanRemote basket; + /** + * Current product instance + */ + private Product currentProduct; + /** * Default constructor * @@ -80,4 +86,9 @@ public class PizzaServiceBasketWebBean extends BaseFrameworkBean implements Pizz // Call super init first super.genericInit(); } + + @Override + public void setCurrentProduct (final Product product) { + this.currentProduct = product; + } } diff --git a/src/java/org/mxchange/pizzaapplication/beans/controller/AdminProductWebController.java b/src/java/org/mxchange/pizzaapplication/beans/controller/AdminProductWebController.java new file mode 100644 index 00000000..6000979c --- /dev/null +++ b/src/java/org/mxchange/pizzaapplication/beans/controller/AdminProductWebController.java @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2015 Roland Haeder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.mxchange.pizzaapplication.beans.controller; + +import java.util.Deque; +import javax.faces.view.facelets.FaceletException; +import org.mxchange.jshopcore.model.category.Category; +import org.mxchange.jshopcore.model.product.Product; + +/** + * An interface for product controllers for "ADMIN" role + * + * @author Roland Haeder + */ +public interface AdminProductWebController { + + /** + * Adds given category data from request to database + * + * @param category Category instance + * @throws javax.faces.view.facelets.FaceletException If something unexpected happened + */ + public void doAdminAddCategory (final Category category) throws FaceletException; + + /** + * Adds given product data from request to database + * + * @param product Product instance + * @throws javax.faces.view.facelets.FaceletException If something unexpected happened + */ + public void doAdminAddProduct (final Product product) throws FaceletException; + + /** + * Some "getter" for a linked list of all products + * + * @return All products + * @throws javax.faces.view.facelets.FaceletException If anything went wrong + */ + public Deque getAllProducts () throws FaceletException; +} diff --git a/src/java/org/mxchange/pizzaapplication/beans/controller/PizzaServiceWebBean.java b/src/java/org/mxchange/pizzaapplication/beans/controller/PizzaServiceWebBean.java index 8755c9f7..cbaf01b3 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/controller/PizzaServiceWebBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/controller/PizzaServiceWebBean.java @@ -16,7 +16,6 @@ */ package org.mxchange.pizzaapplication.beans.controller; -import java.io.IOException; import java.rmi.RemoteException; import java.util.Deque; import javax.annotation.PostConstruct; @@ -26,11 +25,11 @@ import javax.inject.Named; import javax.naming.InitialContext; import javax.naming.NamingException; import org.mxchange.jcoreee.beans.BaseFrameworkBean; -import org.mxchange.jshopcore.exceptions.CategoryTitleAlreadyUsedException; -import org.mxchange.jshopcore.exceptions.ProductTitleAlreadyUsedException; import org.mxchange.jshopcore.model.category.Category; +import org.mxchange.jshopcore.model.category.CategorySessionBeanRemote; +import org.mxchange.jshopcore.model.category.ProductCategory; import org.mxchange.jshopcore.model.product.Product; -import org.mxchange.jshopeelib.beans.remote.shop.ShopSessionBeanRemote; +import org.mxchange.jshopcore.model.product.ProductSessionBeanRemote; /** * Main application class @@ -46,9 +45,14 @@ public class PizzaServiceWebBean extends BaseFrameworkBean implements PizzaWebBe private static final long serialVersionUID = 58_137_539_530_279L; /** - * Remote bean + * Remote bean for categories */ - private final ShopSessionBeanRemote shop; + private final CategorySessionBeanRemote category; + + /** + * Remote bean for products + */ + private final ProductSessionBeanRemote product; /** * Default constructor @@ -60,7 +64,10 @@ public class PizzaServiceWebBean extends BaseFrameworkBean implements PizzaWebBe InitialContext context = new InitialContext(); // Try to lookup the bean - this.shop = (ShopSessionBeanRemote) context.lookup("ejb/stateless-shop"); //NOI18N + this.category = (CategorySessionBeanRemote) context.lookup("ejb/stateless-category"); //NOI18N + + // Try to lookup the bean + this.product = (ProductSessionBeanRemote) context.lookup("ejb/stateless-product"); //NOI18N } @PostConstruct @@ -72,17 +79,7 @@ public class PizzaServiceWebBean extends BaseFrameworkBean implements PizzaWebBe @Override public Deque getAvailableProducts () throws FacesException { try { - return this.getShop().getAvailableProducts(); - } catch (final RemoteException ex) { - // Continue to throw - throw new FacesException(ex); - } - } - - @Override - public Deque getAllProducts () throws FacesException { - try { - return this.getShop().getAllProducts(); + return this.getProduct().getAvailableProducts(); } catch (final RemoteException ex) { // Continue to throw throw new FacesException(ex); @@ -92,31 +89,30 @@ public class PizzaServiceWebBean extends BaseFrameworkBean implements PizzaWebBe @Override public Deque getAllCategories () throws FacesException { try { - return this.getShop().getAllCategories(); - } catch (final RemoteException ex) { - // Continue to throw - throw new FacesException(ex); - } - } + // Fake zero category + Category c = new ProductCategory(0L, "Ist oberste Kategorie", 0L); - @Override - public void doAdminAddCategory (final Category category) throws FacesException { - try { - this.getShop().doAdminAddCategory(category); - } catch (final IOException | CategoryTitleAlreadyUsedException ex) { + // Get List back + Deque deque = this.getCategory().getAllCategories(); + + // Add fake category + deque.addFirst(c); + + // Return it + return deque; + } catch (final RemoteException ex) { // Continue to throw throw new FacesException(ex); } } - @Override - public void doAdminAddProduct (final Product product) throws FacesException { - try { - this.getShop().doAdminAddProduct(product); - } catch (final IOException | ProductTitleAlreadyUsedException ex) { - // Continue to throw - throw new FacesException(ex); - } + /** + * Getter for shop remote bean + * + * @return Remote shop bean + */ + private CategorySessionBeanRemote getCategory () { + return this.category; } /** @@ -124,7 +120,7 @@ public class PizzaServiceWebBean extends BaseFrameworkBean implements PizzaWebBe * * @return Remote shop bean */ - private ShopSessionBeanRemote getShop () { - return this.shop; + private ProductSessionBeanRemote getProduct () { + return this.product; } } diff --git a/src/java/org/mxchange/pizzaapplication/beans/controller/PizzaWebBean.java b/src/java/org/mxchange/pizzaapplication/beans/controller/PizzaWebBean.java index 8c248e50..d58d0449 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/controller/PizzaWebBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/controller/PizzaWebBean.java @@ -37,14 +37,6 @@ public interface PizzaWebBean extends Serializable { */ public Deque getAvailableProducts () throws FaceletException; - /** - * Some "getter" for a linked list of all products - * - * @return All products - * @throws javax.faces.view.facelets.FaceletException If anything went wrong - */ - public Deque getAllProducts () throws FaceletException; - /** * Some "getter" for a linked list of all categories * @@ -52,20 +44,4 @@ public interface PizzaWebBean extends Serializable { * @throws javax.faces.view.facelets.FaceletException If anything went wrong */ public Deque getAllCategories () throws FaceletException; - - /** - * Adds given category data from request to database - * - * @param category Category instance - * @throws javax.faces.view.facelets.FaceletException If something unexpected happened - */ - public void doAdminAddCategory (final Category category) throws FaceletException; - - /** - * Adds given product data from request to database - * - * @param product Product instance - * @throws javax.faces.view.facelets.FaceletException If something unexpected happened - */ - public void doAdminAddProduct (final Product product) throws FaceletException; } diff --git a/src/java/org/mxchange/pizzaapplication/beans/customer/PizzaServiceCustomerWebBean.java b/src/java/org/mxchange/pizzaapplication/beans/customer/PizzaServiceCustomerWebBean.java index 8b9af4d6..089590f0 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/customer/PizzaServiceCustomerWebBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/customer/PizzaServiceCustomerWebBean.java @@ -22,7 +22,7 @@ import javax.inject.Named; import javax.naming.InitialContext; import javax.naming.NamingException; import org.mxchange.jcoreee.beans.BaseFrameworkBean; -import org.mxchange.jshopeelib.beans.remote.customer.CustomerSessionBeanRemote; +import org.mxchange.jshopcore.model.customer.CustomerSessionBeanRemote; /** * A customer bean which hides the customer instance diff --git a/src/java/org/mxchange/pizzaapplication/beans/data/DataWebBean.java b/src/java/org/mxchange/pizzaapplication/beans/data/DataWebBean.java deleted file mode 100644 index c75c80a9..00000000 --- a/src/java/org/mxchange/pizzaapplication/beans/data/DataWebBean.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (C) 2015 Roland Haeder - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package org.mxchange.pizzaapplication.beans.data; - -import java.io.Serializable; -import java.util.List; -import org.mxchange.jcore.model.contact.gender.Gender; - -/** - * An interface for data beans - * - * @author Roland Haeder - */ -public interface DataWebBean extends Serializable { - - /** - * Getter for all genders as array - * - * @return All genders as array - */ - public Gender[] allGenders (); - - /** - * Getter for only selectable genders as array, UNKNOWN is not selectable - * - * @return All genders as array - */ - public List selectableGenders (); -} diff --git a/src/java/org/mxchange/pizzaapplication/beans/data/PizzaServiceDataWebBean.java b/src/java/org/mxchange/pizzaapplication/beans/data/PizzaServiceDataWebBean.java deleted file mode 100644 index aa977901..00000000 --- a/src/java/org/mxchange/pizzaapplication/beans/data/PizzaServiceDataWebBean.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2015 Roland Haeder - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package org.mxchange.pizzaapplication.beans.data; - -import java.util.List; -import javax.annotation.PostConstruct; -import javax.enterprise.context.ApplicationScoped; -import javax.inject.Named; -import javax.naming.InitialContext; -import javax.naming.NamingException; -import org.mxchange.jcore.model.contact.gender.Gender; -import org.mxchange.jcoreee.beans.BaseFrameworkBean; -import org.mxchange.jshopeelib.beans.remote.data.ShopDataBeanRemote; - -/** - * A customer bean which hides the customer instance - * - * @author Roland Haeder - */ -@Named ("data") -@ApplicationScoped -public class PizzaServiceDataWebBean extends BaseFrameworkBean implements DataWebBean { - - /** - * Serial number - */ - private static final long serialVersionUID = 835_482_364_189L; - - /** - * Remote bean - */ - private final ShopDataBeanRemote data; - - /** - * Default constructor - * - * @throws javax.naming.NamingException If something happens? - */ - public PizzaServiceDataWebBean () throws NamingException { - // Get initial context - InitialContext context = new InitialContext(); - - // Try to lookup bean - this.data = (ShopDataBeanRemote) context.lookup("ejb/stateless-data"); //NOI18N - } - - @Override - public Gender[] allGenders () { - // Return it - return this.getData().allGenders(); - } - - @Override - public List selectableGenders () { - // Init array - // TODO Call EJB here? - List genders = this.getData().selectableGenders(); - - // Return it - return genders; - } - - /** - * Getter for data remote bean - * - * @return data remote bean - */ - private ShopDataBeanRemote getData () { - return this.data; - } - - @PostConstruct - public void init () throws RuntimeException { - // Call super method - super.genericInit(); - } -} diff --git a/src/java/org/mxchange/pizzaapplication/beans/gender/GenderWebBean.java b/src/java/org/mxchange/pizzaapplication/beans/gender/GenderWebBean.java new file mode 100644 index 00000000..e6c44081 --- /dev/null +++ b/src/java/org/mxchange/pizzaapplication/beans/gender/GenderWebBean.java @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2015 Roland Haeder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.mxchange.pizzaapplication.beans.gender; + +import java.io.Serializable; +import java.util.List; +import org.mxchange.jcore.model.contact.gender.Gender; + +/** + * An interface for data beans + * + * @author Roland Haeder + */ +public interface GenderWebBean extends Serializable { + + /** + * Getter for all genders as array + * + * @return All genders as array + */ + public Gender[] allGenders (); + + /** + * Getter for only selectable genders as array, UNKNOWN is not selectable + * + * @return All genders as array + */ + public List selectableGenders (); +} diff --git a/src/java/org/mxchange/pizzaapplication/beans/gender/PizzaServiceGenderController.java b/src/java/org/mxchange/pizzaapplication/beans/gender/PizzaServiceGenderController.java new file mode 100644 index 00000000..fc39c971 --- /dev/null +++ b/src/java/org/mxchange/pizzaapplication/beans/gender/PizzaServiceGenderController.java @@ -0,0 +1,91 @@ +/* + * Copyright (C) 2015 Roland Haeder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.mxchange.pizzaapplication.beans.gender; + +import java.util.List; +import javax.annotation.PostConstruct; +import javax.enterprise.context.ApplicationScoped; +import javax.inject.Named; +import javax.naming.InitialContext; +import javax.naming.NamingException; +import org.mxchange.jcore.model.contact.gender.Gender; +import org.mxchange.jcore.model.contact.gender.GenderSessionBeanRemote; +import org.mxchange.jcoreee.beans.BaseFrameworkBean; + +/** + * A customer bean which hides the customer instance + * + * @author Roland Haeder + */ +@Named ("data") +@ApplicationScoped +public class PizzaServiceGenderController extends BaseFrameworkBean implements GenderWebBean { + + /** + * Serial number + */ + private static final long serialVersionUID = 835_482_364_189L; + + /** + * Remote bean + */ + private final GenderSessionBeanRemote gender; + + /** + * Default constructor + * + * @throws javax.naming.NamingException If something happens? + */ + public PizzaServiceGenderController () throws NamingException { + // Get initial context + InitialContext context = new InitialContext(); + + // Try to lookup bean + this.gender = (GenderSessionBeanRemote) context.lookup("ejb/stateless-data"); //NOI18N + } + + @Override + public Gender[] allGenders () { + // Return it + return this.getGender().allGenders(); + } + + @Override + public List selectableGenders () { + // Init array + // TODO Call EJB here? + List genders = this.getGender().selectableGenders(); + + // Return it + return genders; + } + + /** + * Getter for data remote bean + * + * @return data remote bean + */ + private GenderSessionBeanRemote getGender () { + return this.gender; + } + + @PostConstruct + public void init () throws RuntimeException { + // Call super method + super.genericInit(); + } +} diff --git a/web/WEB-INF/faces-config.xml b/web/WEB-INF/faces-config.xml index 1010e3f5..4f60a769 100644 --- a/web/WEB-INF/faces-config.xml +++ b/web/WEB-INF/faces-config.xml @@ -11,4 +11,54 @@ NameValidator org.mxchange.jcoreee.validator.string.names.NameValidator + + * + + customer_register + /customer/register.xhtml + + + index + /index.xhtml + + + customer_lost_passwd + /customer/lost_passwd.xhtml + + + customer_login + /customer/login.xhtml + + + terms + /terms.xhtml + + + privacy + /privacy.xhtml + + + imprint + /imprint.xhtml + + + logout + /bye.xhtml + + + admin_product + /admin/product.xhtml + + + admin_category + /admin/category.xhtml + + + + * + + admin_index + /admin/index.xhtml + + diff --git a/web/WEB-INF/static/admin/admin_category_selection_box.jsp b/web/WEB-INF/static/admin/admin_category_selection_box.jsp deleted file mode 100644 index e1d2bece..00000000 --- a/web/WEB-INF/static/admin/admin_category_selection_box.jsp +++ /dev/null @@ -1,16 +0,0 @@ -<%-- - Document : admin_category_selection_box - Created on : 14.08.2015, 12:51:05 - Author : Roland Haeder ---%> - -<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> -<%@page import="org.mxchange.pizzaapplication.beans.controller.PizzaServiceBean"%> -<%@page import="org.mxchange.pizzaapplication.beans.controller.PizzaBean"%> - - - diff --git a/web/WEB-INF/static/admin/admin_footer.jsp b/web/WEB-INF/static/admin/admin_footer.jsp deleted file mode 100644 index aa6b21b9..00000000 --- a/web/WEB-INF/static/admin/admin_footer.jsp +++ /dev/null @@ -1,16 +0,0 @@ -<%-- - Document : admin_footer - Created on : 11.08.2015, 12:28:03 - Author : Roland Haeder ---%> - -<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> - - - - -
diff --git a/web/WEB-INF/static/admin/admin_menu.jsp b/web/WEB-INF/static/admin/admin_menu.jsp deleted file mode 100644 index 92504285..00000000 --- a/web/WEB-INF/static/admin/admin_menu.jsp +++ /dev/null @@ -1,21 +0,0 @@ -<%-- - Document : admin_menu - Created on : 06.08.2015, 12:41:44 - Author : Roland Haeder ---%> - -<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> - - - diff --git a/web/WEB-INF/static/admin/admin_parent_category_selection_box.jsp b/web/WEB-INF/static/admin/admin_parent_category_selection_box.jsp deleted file mode 100644 index c00a925e..00000000 --- a/web/WEB-INF/static/admin/admin_parent_category_selection_box.jsp +++ /dev/null @@ -1,17 +0,0 @@ -<%-- - Document : admin_parent_category_selection_box - Created on : 14.08.2015, 12:51:05 - Author : Roland Haeder ---%> - -<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> -<%@page import="org.mxchange.pizzaapplication.beans.controller.PizzaServiceBean"%> -<%@page import="org.mxchange.pizzaapplication.beans.controller.PizzaBean"%> - - - diff --git a/web/WEB-INF/templates.dist/admin_page.xhtml b/web/WEB-INF/templates.dist/admin_page.xhtml new file mode 100644 index 00000000..c83abe25 --- /dev/null +++ b/web/WEB-INF/templates.dist/admin_page.xhtml @@ -0,0 +1,27 @@ + + + + + Your page's title here + + + + + + + Your header above content here + + + + Here goes your content. + + + + + + + diff --git a/web/WEB-INF/templates.dist/guest_page.xhtml b/web/WEB-INF/templates.dist/guest_page.xhtml index 7439d638..0622bd44 100644 --- a/web/WEB-INF/templates.dist/guest_page.xhtml +++ b/web/WEB-INF/templates.dist/guest_page.xhtml @@ -6,7 +6,7 @@ > - Your page's title here + Your page's title here diff --git a/web/WEB-INF/templates/admin/admin_base.tpl b/web/WEB-INF/templates/admin/admin_base.tpl new file mode 100644 index 00000000..0305ff96 --- /dev/null +++ b/web/WEB-INF/templates/admin/admin_base.tpl @@ -0,0 +1,11 @@ + + + Administration - + + + diff --git a/web/WEB-INF/templates/admin/admin_category_selection_box.tpl b/web/WEB-INF/templates/admin/admin_category_selection_box.tpl new file mode 100644 index 00000000..8783f813 --- /dev/null +++ b/web/WEB-INF/templates/admin/admin_category_selection_box.tpl @@ -0,0 +1,10 @@ + + + + + + diff --git a/web/WEB-INF/templates/admin/admin_footer.tpl b/web/WEB-INF/templates/admin/admin_footer.tpl new file mode 100644 index 00000000..ecdae42a --- /dev/null +++ b/web/WEB-INF/templates/admin/admin_footer.tpl @@ -0,0 +1,13 @@ + + + +
+
diff --git a/web/WEB-INF/templates/admin/admin_menu.tpl b/web/WEB-INF/templates/admin/admin_menu.tpl new file mode 100644 index 00000000..9e984152 --- /dev/null +++ b/web/WEB-INF/templates/admin/admin_menu.tpl @@ -0,0 +1,19 @@ + + + + diff --git a/web/WEB-INF/templates/admin/admin_parent_category_selection_box.tpl b/web/WEB-INF/templates/admin/admin_parent_category_selection_box.tpl new file mode 100644 index 00000000..5c3bb91d --- /dev/null +++ b/web/WEB-INF/templates/admin/admin_parent_category_selection_box.tpl @@ -0,0 +1,10 @@ + + + + + + diff --git a/web/WEB-INF/templates/base.tpl b/web/WEB-INF/templates/base.tpl index d191bf64..a70734cd 100644 --- a/web/WEB-INF/templates/base.tpl +++ b/web/WEB-INF/templates/base.tpl @@ -30,9 +30,13 @@ Default menu -
- Default content header - Default content +
+
+ Default content header +
+
+ Default content +
diff --git a/web/WEB-INF/templates/guest/guest_base.tpl b/web/WEB-INF/templates/guest/guest_base.tpl index 58f5a1e2..ee4ced7e 100644 --- a/web/WEB-INF/templates/guest/guest_base.tpl +++ b/web/WEB-INF/templates/guest/guest_base.tpl @@ -3,6 +3,8 @@ xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"> + + diff --git a/web/WEB-INF/templates/guest/guest_menu.tpl b/web/WEB-INF/templates/guest/guest_menu.tpl index 0e4d7180..76a0a275 100644 --- a/web/WEB-INF/templates/guest/guest_menu.tpl +++ b/web/WEB-INF/templates/guest/guest_menu.tpl @@ -11,7 +11,7 @@
  • -
  • +
- +
diff --git a/web/index.xhtml b/web/index.xhtml index 74acebc0..c8885c1e 100644 --- a/web/index.xhtml +++ b/web/index.xhtml @@ -18,7 +18,7 @@ - Eingangsseite (dummy) + Willkommen zum Pizza-Service @@ -65,10 +65,10 @@ - - - + + + @@ -96,7 +96,7 @@ - + diff --git a/web/resources/css/cssLayout.css b/web/resources/css/cssLayout.css index 57b5048d..27d10449 100644 --- a/web/resources/css/cssLayout.css +++ b/web/resources/css/cssLayout.css @@ -133,7 +133,11 @@ ul.footer_nav li { .table_header { text-align: center; font-weight: bold; - font-size: 20px; +} + +#content_header { + font-weight: bold; + font-size: 18px; } .table_header_column { diff --git a/web/terms.xhtml b/web/terms.xhtml index e84f73f1..46708d58 100644 --- a/web/terms.xhtml +++ b/web/terms.xhtml @@ -6,18 +6,18 @@ > - Allgemeine Geschäftsbedingungen + Allgemeine Geschäftsbedingungen - Allgemeine Geschäftsbedingungen + Allgemeine Geschäftsbedingungen - Hier kommen die allgemeinen Geschäftsbedingungen hin. + Hier kommen die allgemeinen Geschäftsbedingungen hin.